diff --git a/src/main/java/de/flo56958/minetinker/listeners/EntityListener.java b/src/main/java/de/flo56958/minetinker/listeners/EntityListener.java index c116c2df..13e12823 100644 --- a/src/main/java/de/flo56958/minetinker/listeners/EntityListener.java +++ b/src/main/java/de/flo56958/minetinker/listeners/EntityListener.java @@ -110,7 +110,16 @@ public void onDeath(@NotNull final EntityDeathEvent event) { return; } - final ItemStack tool = player.getInventory().getItemInMainHand(); + ItemStack tool = player.getInventory().getItemInMainHand(); + if (mob.getLastDamageCause() instanceof EntityDamageByEntityEvent lastevent) { + if (lastevent.getDamager() instanceof Arrow || lastevent.getDamager() instanceof Trident) { + List tools = lastevent.getDamager().getMetadata(MineTinker.getPlugin().getName() + "item"); + FixedMetadataValue obj = (FixedMetadataValue) tools.get(0); + if (obj == null || !(obj.value() instanceof ItemStack t)) return; + tool = t; + } + } + if (!modManager.isToolViable(tool)) { return;