diff --git a/src/main/java/net/coreprotect/listener/entity/EntityDeathListener.java b/src/main/java/net/coreprotect/listener/entity/EntityDeathListener.java index 91c9103e..8690afee 100644 --- a/src/main/java/net/coreprotect/listener/entity/EntityDeathListener.java +++ b/src/main/java/net/coreprotect/listener/entity/EntityDeathListener.java @@ -1,6 +1,7 @@ package net.coreprotect.listener.entity; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.Map; @@ -121,8 +122,11 @@ protected static void logEntityDeath(LivingEntity entity, String e) { e = isCommand ? "#command" : ""; } + List validDamageCauses = Arrays.asList(DamageCause.KILL, DamageCause.POISON, DamageCause.THORNS, DamageCause.MAGIC, DamageCause.WITHER); + boolean skip = true; - if (!Config.getConfig(entity.getWorld()).SKIP_GENERIC_DATA || (!(entity instanceof Zombie) && !(entity instanceof Skeleton))) { + EntityDamageEvent.DamageCause cause = damage.getCause(); + if (!Config.getConfig(entity.getWorld()).SKIP_GENERIC_DATA || (!(entity instanceof Zombie) && !(entity instanceof Skeleton)) || validDamageCauses.contains(cause)) { skip = false; } @@ -171,7 +175,6 @@ else if (attacker.getType().name() != null) { } } else { - EntityDamageEvent.DamageCause cause = damage.getCause(); if (cause.equals(EntityDamageEvent.DamageCause.FIRE)) { e = "#fire"; } @@ -189,6 +192,9 @@ else if (cause.equals(EntityDamageEvent.DamageCause.BLOCK_EXPLOSION)) { else if (cause.equals(EntityDamageEvent.DamageCause.MAGIC)) { e = "#magic"; } + else if (cause.equals(EntityDamageEvent.DamageCause.WITHER)) { + e = "#wither_effect"; + } } if (entity instanceof ArmorStand) { @@ -224,7 +230,7 @@ else if (entity instanceof Player) { } } - if (e.startsWith("#wither")) { + if (e.startsWith("#wither") && !e.equals("#wither_effect")) { e = "#wither"; }