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
ConstructorsConstructorDescriptionPlayerDeathEvent(@NotNull Player player, Component deathText, Component chatMessage) -
Method Summary
Modifier and TypeMethodDescription@Nullable ComponentGets the message sent to chat.@Nullable ComponentGets the text displayed in the death screen.@NotNull PlayerGets the player.voidsetChatMessage(@Nullable Component chatMessage) Changes the text sent in chatvoidsetDeathText(@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, waitMethods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstanceMethods 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:PlayerEventGets the player.- Specified by:
getPlayerin interfacePlayerEvent- Returns:
- the player
-