PlayerEvent:

-Added PlayerEvent.AttackEvent & PlayerEvent.AttackedEvent, preventing any knockback from happening from attacks.
This commit is contained in:
c0508383 committed 2022-07-07 12:49:30 -05:00
1 parent 5e0b1282f7
commit 12a3fffeab
5 files changed
+62 -16

No files matched your search

+10
View File
@@ -351,6 +351,11 @@ public class EventHooks {
NpcAPI.EVENT_BUS.post(event);
}
public static boolean onPlayerAttacked(PlayerDataScript handler, noppes.npcs.scripted.event.PlayerEvent.AttackedEvent event) {
handler.callScript(EnumScriptType.ATTACKED, event);
return NpcAPI.EVENT_BUS.post(event);
}
public static boolean onPlayerDamaged(PlayerDataScript handler, noppes.npcs.scripted.event.PlayerEvent.DamagedEvent event) {
handler.callScript(EnumScriptType.DAMAGED, event);
return NpcAPI.EVENT_BUS.post(event);
@@ -431,6 +436,11 @@ public class EventHooks {
return NpcAPI.EVENT_BUS.post(event);
}
public static boolean onPlayerAttack(PlayerDataScript handler, PlayerEvent.AttackEvent event) {
handler.callScript(EnumScriptType.ATTACK, event);
return NpcAPI.EVENT_BUS.post(event);
}
public static boolean onPlayerDamagedEntity(PlayerDataScript handler, DamagedEntityEvent event) {
handler.callScript(EnumScriptType.DAMAGED_ENTITY, event);
return NpcAPI.EVENT_BUS.post(event);