Class PlayerPropertyChangeEvent
java.lang.Object
org.bukkit.event.Event
de.marcely.bedwars.api.event.player.PlayerPropertyChangeEvent
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionPlayerPropertyChangeEvent
(PlayerProperties playerProperties, boolean fromRemote, boolean async, String key, String previous, String after) -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerList
getKey()
Get the key of the property of who the value might change@Nullable String
Get the new value that's on being planned to be set.@Nullable String
Returns the previous value that was set.Get thePlayerProperties
in which the new value might get setboolean
Get whether a non-local server has caused the change.void
setNewValue
(@Nullable String number) Modify the new value to be something else.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
Methods inherited from interface org.bukkit.event.Cancellable
isCancelled, setCancelled
-
Constructor Details
-
PlayerPropertyChangeEvent
public PlayerPropertyChangeEvent(PlayerProperties playerProperties, boolean fromRemote, boolean async, String key, String previous, String after)
-
-
Method Details
-
getProperties
Get thePlayerProperties
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
Get the key of the property of who the value might change- Returns:
- The key of the property
-
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
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
Modify the new value to be something else.Set it to
null
to remove it.- Parameters:
number
- The new "new value". May benull
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-