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
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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionIdentityMaskEvent(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.plugin.Plugin owner, @NotNull String scope, @NotNull MaskedIdentity identity, @Nullable MaskedIdentity previous) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the handler list for this event.@NotNull MaskedIdentityThe identity the player would wear.@NotNull org.bukkit.plugin.PlugingetOwner()The plugin asking for the mask.@NotNull org.bukkit.entity.PlayerThe player to be masked.@NotNull Optional<MaskedIdentity> The identity this mask would replace, when the player already wears one.@NotNull StringgetScope()The runtime ID of the match the mask belongs to.booleanvoidsetCancelled(boolean cancelled) voidsetIdentity(@NotNull MaskedIdentity identity) Replaces the identity the player will wear.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
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
The runtime ID of the match the mask belongs to. -
getIdentity
The identity the player would wear. -
setIdentity
Replaces the identity the player will wear. -
getPreviousIdentity
The identity this mask would replace, when the player already wears one. -
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()
-