Class PlayerCrossDominionBorderEvent

java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.PlayerCrossDominionBorderEvent

public class PlayerCrossDominionBorderEvent extends CallableEvent
Event triggered when a player crosses a dominion border, which includes entering, leaving, or moving from one dominion to another. When a player moves from a location without a dominion to inside a dominion, `from` is null. When a player moves from inside a dominion to a location without a dominion, `to` is null. At least one of `from` and `to` is normally non-null; when both are non-null, they represent different dominions. For listening to player entering dominion events, refer to PlayerMoveInDominionEvent. For listening to player leaving dominion events, refer to PlayerMoveOutDominionEvent.
  • Constructor Details

    • PlayerCrossDominionBorderEvent

      public PlayerCrossDominionBorderEvent(@NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable DominionDTO from, @Nullable @Nullable DominionDTO to)
      Constructs a new PlayerCrossDominionBorderEvent.
      Parameters:
      player - the player who crossed the border
      from - the dominion the player moved from, null if the player entered a dominion
      to - the dominion the player moved to, null if the player left a dominion
  • Method Details

    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      Gets the player who crossed the border.
      Returns:
      the player
    • getFrom

      @Nullable public @Nullable DominionDTO getFrom()
      Gets the dominion the player moved from.
      Returns:
      the dominion, or null if the player entered a dominion
    • getTo

      @Nullable public @Nullable DominionDTO getTo()
      Gets the dominion the player moved to.
      Returns:
      the dominion, or null if the player left a dominion