diff --git a/paper-api/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java index b773d6e536..6c9b7942b6 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java @@ -14,6 +14,7 @@ public class PlayerDeathEvent extends EntityDeathEvent { private int newLevel = 0; private int newTotalExp = 0; private boolean keepLevel = false; + private boolean keepInventory = false; public PlayerDeathEvent(final Player player, final List drops, final int droppedExp, final String deathMessage) { this(player, drops, droppedExp, 0, deathMessage); @@ -135,4 +136,22 @@ public class PlayerDeathEvent extends EntityDeathEvent { public void setKeepLevel(boolean keepLevel) { this.keepLevel = keepLevel; } + + /** + * Sets if the Player keeps inventory on death. + * + * @param keepInventory True to keep the inventory + */ + public void setKeepInventory(boolean keepInventory) { + this.keepInventory = keepInventory; + } + + /** + * Gets if the Player keeps inventory on death. + * + * @return True if the player keeps inventory on death + */ + public boolean getKeepInventory() { + return keepInventory; + } }