Package cn.lunadeer.dominion.events
Class PlayerCrossDominionBorderEvent
java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.PlayerCrossDominionBorderEvent
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.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPlayerCrossDominionBorderEvent(@NotNull org.bukkit.entity.Player player, @Nullable DominionDTO from, @Nullable DominionDTO to) Constructs a new PlayerCrossDominionBorderEvent. -
Method Summary
Modifier and TypeMethodDescription@Nullable DominionDTOgetFrom()Gets the dominion the player moved from.@NotNull org.bukkit.entity.PlayerGets the player who crossed the border.@Nullable DominionDTOgetTo()Gets the dominion the player moved to.Methods inherited from class cn.lunadeer.dominion.events.CallableEvent
call, getHandlerList, getHandlersMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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 borderfrom- the dominion the player moved from, null if the player entered a dominionto- 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
Gets the dominion the player moved from.- Returns:
- the dominion, or null if the player entered a dominion
-
getTo
Gets the dominion the player moved to.- Returns:
- the dominion, or null if the player left a dominion
-