Package io.papermc.paper.event.player
Class PlayerNameEntityEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerNameEntityEvent
- All Implemented Interfaces:
Cancellable
Called when the player is attempting to rename a mob
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
Constructor Summary
ConstructorDescriptionPlayerNameEntityEvent
(@NotNull Player player, @NotNull LivingEntity entity, @NotNull Component name, boolean persistent) -
Method Summary
Modifier and TypeMethodDescriptionGets the entity involved in this event.static @NotNull HandlerList
getName()
Gets the name to be given to the entity.boolean
Gets the cancellation state of this event.boolean
Gets whether this will set the mob to be persistent.void
setCancelled
(boolean cancel) Sets the cancellation state of this event.void
setEntity
(@NotNull LivingEntity entity) Sets the entity involved in this event.void
Sets the name to be given to the entity.void
setPersistent
(boolean persistent) Sets whether this will set the mob to be persistent.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
asynchronous, callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerNameEntityEvent
-
-
Method Details
-
getName
Gets the name to be given to the entity.- Returns:
- the name
-
setName
Sets the name to be given to the entity.- Parameters:
name
- the name
-
getEntity
Gets the entity involved in this event.- Returns:
- the entity
-
setEntity
Sets the entity involved in this event.- Parameters:
entity
- the entity
-
isPersistent
public boolean isPersistent()Gets whether this will set the mob to be persistent.- Returns:
- persistent
-
setPersistent
public void setPersistent(boolean persistent) Sets whether this will set the mob to be persistent.- Parameters:
persistent
- persistent
-
isCancelled
public boolean isCancelled()Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelled
in interfaceCancellable
- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-