Class PlayerKillEvent
java.lang.Object
org.bukkit.event.Event
com.tomkeuper.bedwars.api.events.player.PlayerKillEvent
public class PlayerKillEvent
extends org.bukkit.event.Event
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration representing various causes of death events.Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerKillEvent
(IArena arena, org.bukkit.entity.Player victim, org.bukkit.entity.Player killer, Function<org.bukkit.entity.Player, String> message, PlayerKillEvent.PlayerKillCause cause) Called when a Player got killed during the game. -
Method Summary
Modifier and TypeMethodDescriptiongetArena()
Get the arena where the kill occurred.getCause()
Get the cause of the player's death.static org.bukkit.event.HandlerList
org.bukkit.event.HandlerList
org.bukkit.entity.Player
Get the killer player.Get the function that generates the kill chat message.org.bukkit.entity.Player
Get the player who died.boolean
Checks if the kill sound should be played for the killer.void
setMessage
(Function<org.bukkit.entity.Player, String> message) Set the function that generates the kill chat message.void
setPlaySound
(boolean playSound) Set whether the kill sound should be played for the killer.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerKillEvent
public PlayerKillEvent(IArena arena, org.bukkit.entity.Player victim, org.bukkit.entity.Player killer, Function<org.bukkit.entity.Player, String> message, PlayerKillEvent.PlayerKillCause cause) Called when a Player got killed during the game.- Parameters:
killer
- can be NULL.
-
-
Method Details
-
getKiller
public org.bukkit.entity.Player getKiller()Get the killer player. Can be NULL (e.g., in cases of falling into void).- Returns:
- The player who performed the kill.
-
getMessage
Get the function that generates the kill chat message.- Returns:
- The function generating the kill chat message.
-
setMessage
Set the function that generates the kill chat message.- Parameters:
message
- The function to set.
-
getCause
Get the cause of the player's death.- Returns:
- The cause of the player's death.
-
getArena
Get the arena where the kill occurred.- Returns:
- The arena where the kill occurred.
-
getVictim
public org.bukkit.entity.Player getVictim()Get the player who died.- Returns:
- The player who died.
-
playSound
public boolean playSound()Checks if the kill sound should be played for the killer.- Returns:
- true if the kill sound should be played for the killer, false otherwise.
-
setPlaySound
public void setPlaySound(boolean playSound) Set whether the kill sound should be played for the killer.- Parameters:
playSound
- true to play the kill sound for the killer, false otherwise.
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-