mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 03:52:18 +00:00
Melee Swing Event
This commit is contained in:
1 parent
4f697e574e
commit
1393de181d
4 files changed
+33
No files matched your search
@@ -226,6 +226,28 @@ public class NpcEvent extends CustomNPCsEvent implements INpcEvent {
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class SwingEvent extends NpcEvent implements INpcEvent.SwingEvent {
|
||||
public final IItemStack itemStack;
|
||||
|
||||
public SwingEvent(ICustomNpc npc, ItemStack itemStack) {
|
||||
super(npc);
|
||||
this.itemStack = (IItemStack)NpcAPI.Instance().getIItemStack(itemStack);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.ATTACK_SWING.function;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the swung item
|
||||
*/
|
||||
@Override
|
||||
public IItemStack getItemStack() {
|
||||
return itemStack;
|
||||
}
|
||||
}
|
||||
|
||||
public static class KilledEntityEvent extends NpcEvent implements INpcEvent.KilledEntityEvent {
|
||||
public final IEntityLivingBase entity;
|
||||
|
||||
|
||||
Reference in new issue
Block a user