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
ConstructorsConstructorDescriptionPlayerNameEntityEvent(Player player, LivingEntity entity, Component name, boolean persistent) -
Method Summary
Modifier and TypeMethodDescriptionGets the entity involved in this event.static HandlerListgetName()Gets the name to be given to the entity.booleanGets the cancellation state of this event.booleanGets whether this will set the mob to be persistent.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetEntity(LivingEntity entity) Sets the entity involved in this event.voidSets the name to be given to the entity.voidsetPersistent(boolean persistent) Sets whether this will set the mob to be persistent.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerNameEntityEvent
@Internal public PlayerNameEntityEvent(Player player, LivingEntity entity, Component name, boolean persistent)
-
-
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()Description copied from interface:CancellableGets 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:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableSets 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:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-