mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 05:19:41 +00:00
PlayerEvent:
-Added PlayerEvent.AttackEvent & PlayerEvent.AttackedEvent, preventing any knockback from happening from attacks.
This commit is contained in:
1 parent
5e0b1282f7
commit
12a3fffeab
5 files changed
+62
-16
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user