Class PlayerPropertyChangeEvent

java.lang.Object
org.bukkit.event.Event
de.marcely.bedwars.api.event.player.PlayerPropertyChangeEvent
All Implemented Interfaces:
Cancellable

public class PlayerPropertyChangeEvent extends Event implements Cancellable
Gets called whenever a value of a property has changed in a PlayerProperties, set or removed.

It's possible that this event might get called async.

  • Constructor Details

    • PlayerPropertyChangeEvent

      public PlayerPropertyChangeEvent(PlayerProperties playerProperties, boolean fromRemote, boolean async, String key, String previous, String after)
  • Method Details

    • getProperties

      public PlayerProperties getProperties()
      Get the PlayerProperties in which the new value might get set
      Returns:
      The PlayerProperties instance involved in this event
    • isFromRemoteServer

      public boolean isFromRemoteServer()
      Get whether a non-local server has caused the change.

      May be true when the ProxySync addon is used.

      Returns:
      true if a non-local server initiated the change
    • getKey

      public String getKey()
      Get the key of the property of who the value might change
      Returns:
      The key of the property
    • getOldValue

      @Nullable public @Nullable String getOldValue()
      Returns the previous value that was set.

      It is possible that it is null. In that case, it wasn't a part of the properties map.

      Returns:
      The previous value, null when it didn't exist before
    • getNewValue

      @Nullable public @Nullable String getNewValue()
      Get the new value that's on being planned to be set.

      It is possible that the new value may be null, which means that it is getting removed.

      Returns:
      The new value. May be null, in which case it gets removed
    • setNewValue

      public void setNewValue(@Nullable @Nullable String number)
      Modify the new value to be something else.

      Set it to null to remove it.

      Parameters:
      number - The new "new value". May be null
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()