diff --git a/src/main/java/com/example/oneshot/OneShotHandler.java b/src/main/java/com/example/oneshot/OneShotHandler.java index 47e1424..4df8cfa 100644 --- a/src/main/java/com/example/oneshot/OneShotHandler.java +++ b/src/main/java/com/example/oneshot/OneShotHandler.java @@ -26,6 +26,13 @@ public static void onAttack(LivingEntity target, LivingEntity attacker, ItemStac livingAttacker = (net.minecraft.entity.LivingEntity) attacker; } + // For players, wipe inventory before kill so nothing drops + if (target instanceof PlayerEntity playerTarget) { + try { + playerTarget.getInventory().clear(); + } catch (Throwable ignored) {} + } + // Attempt a proper instant-kill using DamageSources when attacker exists if (livingAttacker != null) { try {