Class IdentityMaskEvent

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

public final class IdentityMaskEvent extends ZentrixEvent implements org.bukkit.event.Cancellable
Called before a player is put behind a masked identity - by Hidden Identities, another scenario or an addon - including when a new mask would replace the one they wear.

Listeners may replace the proposed identity or cancel the mask; a cancelled request returns an already released handle and leaves any current mask in place. The alias still has to be free: an alias another player wears refuses the mask after this event, as before.

Main thread; only fired while a listener is registered. Real names stay server-side: this event is for plugins, never something to show players.

Since:
1.8.0
  • Constructor Details

    • IdentityMaskEvent

      public IdentityMaskEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.plugin.Plugin owner, @NotNull @NotNull String scope, @NotNull @NotNull MaskedIdentity identity, @Nullable @Nullable MaskedIdentity previous)
  • Method Details

    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      The player to be masked.
    • getOwner

      @NotNull public @NotNull org.bukkit.plugin.Plugin getOwner()
      The plugin asking for the mask.
    • getScope

      @NotNull public @NotNull String getScope()
      The runtime ID of the match the mask belongs to.
    • getIdentity

      @NotNull public @NotNull MaskedIdentity getIdentity()
      The identity the player would wear.
    • setIdentity

      public void setIdentity(@NotNull @NotNull MaskedIdentity identity)
      Replaces the identity the player will wear.
    • getPreviousIdentity

      @NotNull public @NotNull Optional<MaskedIdentity> getPreviousIdentity()
      The identity this mask would replace, when the player already wears one.
    • 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()