Class CosmeticPreviewEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.cosmetics.CosmeticPreviewEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class CosmeticPreviewEvent extends ZentrixEvent implements org.bukkit.event.Cancellable
Called before a cosmetic preview starts for a player, in the cosmetics menu or through CosmeticsService#startPreview, in any type. Cancelling shows nothing.

Main thread; only fired while a listener is registered.

Since:
1.11.0
  • Constructor Details

    • CosmeticPreviewEvent

      public CosmeticPreviewEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull CosmeticTypeKey type, @NotNull @NotNull String cosmeticId, @NotNull @NotNull CosmeticActionOrigin origin)
  • Method Details

    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      The player who sees the preview.
    • getType

      @NotNull public @NotNull CosmeticTypeKey getType()
      The type of the cosmetic previewed.
    • getCosmeticId

      @NotNull public @NotNull String getCosmeticId()
      The cosmetic previewed.
    • getOrigin

      @NotNull public @NotNull CosmeticActionOrigin getOrigin()
      Where the preview was asked for.
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Description copied from class: ZentrixEvent
      Gets the handler list for this event.
      Overrides:
      getHandlers in class ZentrixEvent
      Returns:
      The handler list
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()