Class PlayerKillEvent

java.lang.Object
org.bukkit.event.Event
com.tomkeuper.bedwars.api.events.player.PlayerKillEvent

public class PlayerKillEvent extends org.bukkit.event.Event
  • 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

      public Function<org.bukkit.entity.Player,String> getMessage()
      Get the function that generates the kill chat message.
      Returns:
      The function generating the kill chat message.
    • setMessage

      public void setMessage(Function<org.bukkit.entity.Player,String> message)
      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

      public IArena 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 class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()