Class PlayerEnterClaimEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
net.mathias2246.buildmc.api.event.CustomPlayerEvent
net.mathias2246.buildmc.api.event.claims.PlayerEnterClaimEvent
Called when a
Player moves from one claim into another.
Both the "from" and "to" claim IDs may be null, and there is no guarantee
that the claim IDs correspond to an existing claim at the time of the event.
fromClaimmay benullif the player was not previously inside a claim.toClaimmay benullif the player is leaving a claim and entering unclaimed land.
This event is fired synchronously on the main server thread.
Plugins can attach optional metadata to this event via CustomPlayerEvent.putMetadata(String, Object).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class net.mathias2246.buildmc.api.event.CustomPlayerEvent
metadataHolderFields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerEnterClaimEvent(@NotNull org.bukkit.entity.Player who, @Nullable Long fromClaimId, @Nullable Long toClaimId) Constructs a newPlayerEnterClaimEvent. -
Method Summary
Modifier and TypeMethodDescription@Nullable LongGets the ID of the claim the player is leaving.static org.bukkit.event.HandlerListGets the static list of handlers for this event type.@NotNull org.bukkit.event.HandlerListReturns theHandlerListfor this event type.@Nullable LongGets the ID of the claim the player is entering.Methods inherited from class net.mathias2246.buildmc.api.event.CustomPlayerEvent
getMetadata, putMetadata, removeMetadataMethods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerEnterClaimEvent
public PlayerEnterClaimEvent(@NotNull @NotNull org.bukkit.entity.Player who, @Nullable @Nullable Long fromClaimId, @Nullable @Nullable Long toClaimId) Constructs a newPlayerEnterClaimEvent.- Parameters:
who- the player entering the claim (nevernull)fromClaimId- the ID of the claim the player is leaving, ornullif nonetoClaimId- the ID of the claim the player is entering, ornullif none
-
-
Method Details
-
getFromClaim
Gets the ID of the claim the player is leaving.- Returns:
- the ID of the previous claim, or
nullif the player was not in a claim
-
getToClaim
Gets the ID of the claim the player is entering.- Returns:
- the ID of the new claim, or
nullif the player is entering unclaimed land
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Description copied from class:CustomPlayerEventReturns theHandlerListfor this event type.Bukkit requires each concrete event class to define its own static
HandlerListinstance and to return it from this method. This is necessary for Bukkitâs event registration and dispatch system.- Specified by:
getHandlersin classCustomPlayerEvent- Returns:
- the handler list for this event (never
null)
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Gets the static list of handlers for this event type.Required by the Bukkit event system for registration.
- Returns:
- the handler list
-