Class CosmeticSelectEvent
java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.cosmetics.CosmeticSelectEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
Called before a player's own choice of cosmetic in the cosmetics menu is saved, and, since
1.11.0, one an addon makes for them through
CosmeticsService#equip or #unequip.
Only for built-in categories; CosmeticEquipEvent, called next, covers every type.
Cancelling keeps their current choice; the menu plays its error sound, and telling the player
why is up to the listener. Choices made through CosmeticsService#select do not fire this
event.
Main thread; only fired while a listener is registered.
- Since:
- 1.8.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionCosmeticSelectEvent(@NotNull org.bukkit.entity.Player player, @NotNull CosmeticCategory category, @Nullable String cosmeticId) -
Method Summary
Modifier and TypeMethodDescription@NotNull CosmeticCategoryThe category they choose in.The cosmetic chosen; empty when they chose the server's default.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.@NotNull org.bukkit.entity.PlayerThe player choosing.booleanvoidsetCancelled(boolean cancelled) Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CosmeticSelectEvent
public CosmeticSelectEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull CosmeticCategory category, @Nullable @Nullable String cosmeticId)
-
-
Method Details
-
getPlayer
@NotNull public @NotNull org.bukkit.entity.Player getPlayer()The player choosing. -
getCategory
The category they choose in. -
getCosmeticId
The cosmetic chosen; empty when they chose the server's default. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Description copied from class:ZentrixEventGets the handler list for this event.- Overrides:
getHandlersin classZentrixEvent- Returns:
- The handler list
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
-