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

public class PlayerEnterClaimEvent extends CustomPlayerEvent
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.

  • fromClaim may be null if the player was not previously inside a claim.
  • toClaim may be null if 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

    metadataHolder

    Fields inherited from class org.bukkit.event.player.PlayerEvent

    player
  • Constructor Summary

    Constructors
    Constructor
    Description
    PlayerEnterClaimEvent(@NotNull org.bukkit.entity.Player who, @Nullable Long fromClaimId, @Nullable Long toClaimId)
    Constructs a new PlayerEnterClaimEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Long
    Gets the ID of the claim the player is leaving.
    static org.bukkit.event.HandlerList
    Gets the static list of handlers for this event type.
    @NotNull org.bukkit.event.HandlerList
    Returns the HandlerList for this event type.
    @Nullable Long
    Gets the ID of the claim the player is entering.

    Methods inherited from class net.mathias2246.buildmc.api.event.CustomPlayerEvent

    getMetadata, putMetadata, removeMetadata

    Methods inherited from class org.bukkit.event.player.PlayerEvent

    getPlayer

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerEnterClaimEvent

      public PlayerEnterClaimEvent(@NotNull @NotNull org.bukkit.entity.Player who, @Nullable @Nullable Long fromClaimId, @Nullable @Nullable Long toClaimId)
      Constructs a new PlayerEnterClaimEvent.
      Parameters:
      who - the player entering the claim (never null)
      fromClaimId - the ID of the claim the player is leaving, or null if none
      toClaimId - the ID of the claim the player is entering, or null if none
  • Method Details

    • getFromClaim

      @Nullable public @Nullable Long getFromClaim()
      Gets the ID of the claim the player is leaving.
      Returns:
      the ID of the previous claim, or null if the player was not in a claim
    • getToClaim

      @Nullable public @Nullable Long getToClaim()
      Gets the ID of the claim the player is entering.
      Returns:
      the ID of the new claim, or null if the player is entering unclaimed land
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Description copied from class: CustomPlayerEvent
      Returns the HandlerList for this event type.

      Bukkit requires each concrete event class to define its own static HandlerList instance and to return it from this method. This is necessary for Bukkit’s event registration and dispatch system.

      Specified by:
      getHandlers in class CustomPlayerEvent
      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