Class StatusChangeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
net.mathias2246.buildmc.api.event.CustomPlayerEvent
net.mathias2246.buildmc.api.event.player.StatusChangeEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Called when a players status is about to change.
You can cancel this event if you want to prevent the player from changing his status.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class CustomPlayerEvent
metadataHolderFields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionStatusChangeEvent(@NotNull org.bukkit.entity.Player player, @Nullable StatusInstance oldStatus, @Nullable StatusInstance newStatus) The default constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListReturns theHandlerListfor this event type.@Nullable StatusInstance@Nullable StatusInstancebooleanvoidsetCancelled(boolean b) voidsetNewStatus(@Nullable StatusInstance newStatus) Methods inherited from class CustomPlayerEvent
getMetadata, putMetadata, removeMetadataMethods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
StatusChangeEvent
public StatusChangeEvent(@NotNull @NotNull org.bukkit.entity.Player player, @Nullable @Nullable StatusInstance oldStatus, @Nullable @Nullable StatusInstance newStatus) The default constructor- Parameters:
player- the player associated with this event (must not be null)oldStatus- TheStatusInstancethe player had before trying to change his status.Is
nullif the players status was not set.newStatus- TheStatusInstancethe player gets after this event was successfully executed.If
nullthe current status of the player will be removed.
-
-
Method Details
-
getOldStatus
- Returns:
- The
StatusInstancethe player had before changing
-
getNewStatus
- Returns:
- The
StatusInstancethe player will get after this event has successfully executed.
-
setNewStatus
- Parameters:
newStatus- The status the player gets after this event has successfully executedIf set to
null, the players current status will be removed.
-
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
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList() -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean b) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-