Class PlayerEliminateEvent

java.lang.Object
com.ohacd.matchbox.api.MatchboxEvent
com.ohacd.matchbox.api.events.PlayerEliminateEvent

public class PlayerEliminateEvent extends MatchboxEvent
Event fired when a player is eliminated from the game.
Since:
0.9.5
  • Constructor Details

    • PlayerEliminateEvent

      public PlayerEliminateEvent(String sessionName, org.bukkit.entity.Player eliminatedPlayer, com.ohacd.matchbox.game.utils.Role role, PlayerEliminateEvent.EliminationReason reason)
      Creates a new player elimination event.
      Parameters:
      sessionName - the session where elimination occurred
      eliminatedPlayer - the player who was eliminated
      role - the role of the eliminated player
      reason - the reason for elimination
    • PlayerEliminateEvent

      public PlayerEliminateEvent(String sessionName, org.bukkit.entity.Player eliminatedPlayer, com.ohacd.matchbox.game.utils.Role role, PlayerEliminateEvent.EliminationReason reason, long timestamp)
      Creates a new player elimination event with explicit timestamp.
      Parameters:
      sessionName - the session where elimination occurred
      eliminatedPlayer - the player who was eliminated
      role - the role of the eliminated player
      reason - the reason for elimination
      timestamp - epoch millis when the event occurred
  • Method Details

    • dispatch

      public void dispatch(MatchboxEventListener listener)
      Description copied from class: MatchboxEvent
      Dispatches this event to the appropriate listener method.

      This method uses the visitor pattern to call the correct handler method based on the concrete event type. Implementing classes should call super.dispatch(listener) as the first line.

      Specified by:
      dispatch in class MatchboxEvent
      Parameters:
      listener - the listener to dispatch to
    • getSessionName

      @NotNull public @NotNull String getSessionName()
      Gets the name of the session where the elimination occurred.
      Returns:
      the session name
    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      Gets the player who was eliminated.
      Returns:
      the eliminated player
    • getRole

      @NotNull public @NotNull com.ohacd.matchbox.game.utils.Role getRole()
      Gets the role of the eliminated player.
      Returns:
      the player's role
    • getReason

      @NotNull public @NotNull PlayerEliminateEvent.EliminationReason getReason()
      Gets the reason for the elimination.
      Returns:
      the elimination reason
    • toString

      public String toString()
      Overrides:
      toString in class MatchboxEvent