mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 08:45:11 +00:00
Added target lost event. Added all new NPC events to the old 1.7.10 script system.
This commit is contained in:
1 parent
29935a1c6d
commit
fe780d69ee
9 files changed
+39
-8
No files matched your search
@@ -204,6 +204,16 @@ public class EventHooks {
|
||||
return NpcAPI.EVENT_BUS.post(event);
|
||||
}
|
||||
|
||||
public static boolean onNPCTargetLost(EntityNPCInterface npc, EntityLivingBase prevtarget, EntityLivingBase newTarget) {
|
||||
if(npc.script.isClient())
|
||||
return false;
|
||||
NpcEvent.TargetLostEvent event = new NpcEvent.TargetLostEvent(npc.wrappedNPC, prevtarget, newTarget);
|
||||
|
||||
ScriptController.Instance.globalNpcScripts.callScript(EnumScriptType.TARGET_LOST, event);
|
||||
npc.script.callScript(EnumScriptType.TARGET_LOST, event);
|
||||
return NpcAPI.EVENT_BUS.post(event);
|
||||
}
|
||||
|
||||
public static void onNPCCollide(EntityNPCInterface npc, Entity entity){
|
||||
if(npc == null || npc.wrappedNPC == null)
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user