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. Typically, `from` and `to` can both be null but not at the same time, and if both are not null, they will not be the same. 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