mirror of
https://github.com/KAMKEEL/CustomNPC-Gecko-Addon.git
synced 2026-11-14 00:14:10 +00:00
Made an event handler for hurt and attack events
This commit is contained in:
1 parent
a3e0484ed1
commit
604385b346
1 file changed
+25
@@ -0,0 +1,25 @@
|
||||
package com.goodbird.npcgecko.handler;
|
||||
|
||||
import com.goodbird.npcgecko.constants.EnumSyncAutoAnim;
|
||||
import com.goodbird.npcgecko.network.CPacketSyncAutoAnim;
|
||||
import com.goodbird.npcgecko.network.NetworkHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.scripted.event.NpcEvent;
|
||||
|
||||
public class EventHandler {
|
||||
@SubscribeEvent
|
||||
public void onNpcMeleeAttack(NpcEvent.MeleeAttackEvent event){
|
||||
NetworkHandler.sendToAll(new CPacketSyncAutoAnim((EntityNPCInterface) event.npc.getMCEntity(), EnumSyncAutoAnim.MELEE_ATTACK));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onNpcRanged(NpcEvent.RangedLaunchedEvent event){
|
||||
NetworkHandler.sendToAll(new CPacketSyncAutoAnim((EntityNPCInterface) event.npc.getMCEntity(), EnumSyncAutoAnim.RANGED_ATTACK));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onNpcDamaged(NpcEvent.DamagedEvent event){
|
||||
NetworkHandler.sendToAll(new CPacketSyncAutoAnim((EntityNPCInterface) event.npc.getMCEntity(), EnumSyncAutoAnim.HURT));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user