diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java index 112996e6..e0f1297a 100644 --- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java @@ -1,6 +1,7 @@ package org.bukkit.event.entity; import java.util.List; + import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -9,12 +10,32 @@ import org.bukkit.inventory.ItemStack; */ public class PlayerDeathEvent extends EntityDeathEvent { private int newExp = 0; + private String deathMessage = ""; - public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp) { + public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp, String deathMessage) { super(player, drops, droppedExp); this.newExp = newExp; + this.deathMessage = deathMessage; + } + + /** + * Set the death message that will appear to everyone on the server. + * + * @param deathMessage Message to appear to other players on the server. + */ + public void setDeathMessage(String deathMessage) { + this.deathMessage = deathMessage; } - + + /** + * Get the death message that will appear to everyone on the server. + * + * @return Message to appear to other players on the server. + */ + public String getDeathMessage() { + return this.deathMessage; + } + /** * Gets how much EXP the Player should have at respawn. * <p> |