mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 02:39:05 +00:00
RightClick Event for Scripted Items
This commit is contained in:
1 parent
4a58702d16
commit
7f2a375323
9 files changed
+101
-14
No files matched your search
@@ -138,6 +138,40 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class RightClickEvent extends ItemEvent implements IItemEvent.RightClickEvent {
|
||||
|
||||
/**
|
||||
* 0:air, 1:entity, 2:block
|
||||
*/
|
||||
public final int type;
|
||||
public final Object target;
|
||||
public final IPlayer player;
|
||||
|
||||
public RightClickEvent(IItemCustom item, IPlayer player, int type, Object target) {
|
||||
super(item);
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.INTERACT.function;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public Object getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public IPlayer getPlayer() {
|
||||
return player;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class AttackEvent extends ItemEvent implements IItemEvent.AttackEvent {
|
||||
public final int type;//1: Hit, 2: Whiff
|
||||
|
||||
Reference in new issue
Block a user