diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/KillCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/KillCommand.java index e9d6f2a797..0deff08cc2 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/KillCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/KillCommand.java @@ -24,6 +24,7 @@ public class KillCommand extends VanillaCommand { Bukkit.getPluginManager().callEvent(ede); if (ede.isCancelled()) return true; + ede.getEntity().setLastDamageCause(ede); player.damage(ede.getDamage()); } else { sender.sendMessage("You can only perform this command as a player"); diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index 2fa2c4656e..f059b407ad 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -1,6 +1,5 @@ package org.bukkit.event.entity; -import org.bukkit.entity.ComplexEntityPart; import org.bukkit.entity.Entity; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; @@ -18,12 +17,6 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { super(damagee); this.cause = cause; this.damage = damage; - - if (damagee instanceof ComplexEntityPart) { - ((ComplexEntityPart) damagee).getParent().setLastDamageCause(this); - } else { - damagee.setLastDamageCause(this); - } } public boolean isCancelled() {