Package net.minestom.server.event.player
Class PlayerDeathEvent
java.lang.Object
net.minestom.server.event.player.PlayerDeathEvent
- All Implemented Interfaces:
Event
,EntityEvent
,EntityInstanceEvent
,InstanceEvent
,PlayerEvent
,PlayerInstanceEvent
Called when a player die in
Player.kill()
.-
Constructor Summary
ConstructorDescriptionPlayerDeathEvent
(@NotNull Player player, Component deathText, Component chatMessage) -
Method Summary
Modifier and TypeMethodDescription@Nullable Component
Gets the message sent to chat.@Nullable Component
Gets the text displayed in the death screen.@NotNull Player
Gets the player.void
setChatMessage
(@Nullable Component chatMessage) Changes the text sent in chatvoid
setDeathText
(@Nullable Component deathText) Changes the text displayed in the death screen.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstance
Methods inherited from interface net.minestom.server.event.trait.PlayerEvent
getEntity
-
Constructor Details
-
PlayerDeathEvent
-
-
Method Details
-
getDeathText
Gets the text displayed in the death screen.- Returns:
- the death text, can be null
-
setDeathText
Changes the text displayed in the death screen.- Parameters:
deathText
- the death text to display, null to remove
-
getChatMessage
Gets the message sent to chat.- Returns:
- the death chat message
-
setChatMessage
Changes the text sent in chat- Parameters:
chatMessage
- the death message to send, null to remove
-
getPlayer
Description copied from interface:PlayerEvent
Gets the player.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player
-