Fixed Sentinel support

This commit is contained in:
Indyuce 2019-11-02 18:52:17 +01:00
parent f0665dfd68
commit c3704c708b

View File

@ -101,7 +101,7 @@ public class ItemUse implements Listener {
// check for npc
// safety checks
if (event.getEntity().hasMetadata("NPC") || !(event.getDamager() instanceof Player) || !(event.getEntity() instanceof LivingEntity) || event.getDamage() == 0 || event.getCause() != DamageCause.ENTITY_ATTACK)
if (event.getEntity().hasMetadata("NPC") || !(event.getDamager() instanceof Player) || event.getDamager().hasMetadata("NPC") || !(event.getEntity() instanceof LivingEntity) || event.getDamage() == 0 || event.getCause() != DamageCause.ENTITY_ATTACK)
return;
// custom damage check