Package dev.majek.hexnicks.api
Class SetNickOtherEvent
java.lang.Object
org.bukkit.event.Event
dev.majek.hexnicks.api.SetNickOtherEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class SetNickOtherEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Handles the event fired when a player sets another player's nickname.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionSetNickOtherEvent
(@NotNull org.bukkit.command.CommandSender setter, @NotNull org.bukkit.entity.Player target, @NotNull net.kyori.adventure.text.Component newNick, @Nullable net.kyori.adventure.text.Component oldNick) Fires when a player changes another player's nickname using/nick
. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList
Get the HandlerList.@NotNull org.bukkit.event.HandlerList
boolean
net.kyori.adventure.text.Component
newNick()
The new nickname the player is attempting to set.void
newNick
(@NotNull net.kyori.adventure.text.Component newNick) Set the player's new nickname.@Nullable net.kyori.adventure.text.Component
oldNick()
The old nickname if the player had one previously.void
setCancelled
(boolean cancel) org.bukkit.command.CommandSender
setter()
TheCommandSender
changing thetarget()
's nickname.org.bukkit.entity.Player
target()
The in-game player who's nickname is being changed by thesetter()
.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
SetNickOtherEvent
public SetNickOtherEvent(@NotNull @NotNull org.bukkit.command.CommandSender setter, @NotNull @NotNull org.bukkit.entity.Player target, @NotNull @NotNull net.kyori.adventure.text.Component newNick, @Nullable @Nullable net.kyori.adventure.text.Component oldNick) Fires when a player changes another player's nickname using/nick
.- Parameters:
setter
- TheCommandSender
changing the target's nickname.target
- The player who's nickname is being changed.newNick
- The new nickname the setter is attempting to set.oldNick
- The target's old name if they had one.
-
-
Method Details
-
setter
public org.bukkit.command.CommandSender setter()TheCommandSender
changing thetarget()
's nickname.- Returns:
- Setter.
-
target
public org.bukkit.entity.Player target()The in-game player who's nickname is being changed by thesetter()
.- Returns:
- Target
-
oldNick
@Nullable public @Nullable net.kyori.adventure.text.Component oldNick()The old nickname if the player had one previously.- Returns:
- Old nickname.
-
newNick
public void newNick(@NotNull @NotNull net.kyori.adventure.text.Component newNick) Set the player's new nickname.- Parameters:
newNick
- New nickname.
-
newNick
public net.kyori.adventure.text.Component newNick()The new nickname the player is attempting to set.- Returns:
- New nickname.
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Get the HandlerList. Bukkit requires this.- Returns:
- HandlerList.
-