diff --git a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/permissions/PermissionsIsland.java b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/permissions/PermissionsIsland.java index f1820ed..03137fb 100644 --- a/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/permissions/PermissionsIsland.java +++ b/api/src/main/java/fr/euphyllia/skyllia/api/skyblock/model/permissions/PermissionsIsland.java @@ -19,6 +19,7 @@ public enum PermissionsIsland implements Permissions { USE_END_PORTAL(1_024), INTERACT_ENTITIES(2_048), KILL_UNKNOWN_ENTITY(4_096), + KILL_NPC(8_192), ; private final long permissionValue; diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/entity/DamageEvent.java b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/entity/DamageEvent.java index 8468170..1eb1b21 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/entity/DamageEvent.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/listeners/bukkitevents/entity/DamageEvent.java @@ -5,9 +5,7 @@ import fr.euphyllia.skyllia.listeners.ListenersUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.bukkit.entity.Animals; -import org.bukkit.entity.Monster; -import org.bukkit.entity.Player; +import org.bukkit.entity.*; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -39,6 +37,8 @@ public void onPlayerDamageEntity(final EntityDamageByEntityEvent event) { ListenersUtils.checkPermission(event.getEntity().getChunk(), damager, PermissionsIsland.KILL_MONSTER, event); } else if (event.getEntity() instanceof Animals) { ListenersUtils.checkPermission(event.getEntity().getChunk(), damager, PermissionsIsland.KILL_ANIMAL, event); + } else if (event.getEntity() instanceof NPC) { + ListenersUtils.checkPermission(event.getEntity().getChunk(), damager, PermissionsIsland.KILL_NPC, event); } else { ListenersUtils.checkPermission(event.getEntity().getChunk(), damager, PermissionsIsland.KILL_UNKNOWN_ENTITY, event); }