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`

public class PlayerNameEntityEvent extends PlayerEvent implements 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

Constructors
Constructor
Description
`PlayerNameEntityEvent(@NotNull Player player, @NotNull LivingEntity entity, @NotNull Component name, boolean persistent)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull LivingEntity`
`getEntity()`
Gets the entity involved in this event.
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@Nullable Component`
`getName()`
Gets the name to be given to the entity.
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`boolean`
`isPersistent()`
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`
`setName(@Nullable Component name)`
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

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PlayerNameEntityEvent

public PlayerNameEntityEvent(@NotNull @NotNull Player player, @NotNull @NotNull LivingEntity entity, @NotNull @NotNull Component name, boolean persistent)

## Method Details

### getName

@Nullable public @Nullable Component getName()
Gets the name to be given to the entity.

Returns:
  the name

### setName

public void setName(@Nullable @Nullable Component name)
Sets the name to be given to the entity.

Parameters:
  `name` - the name

### getEntity

@NotNull public @NotNull LivingEntity getEntity()
Gets the entity involved in this event.

Returns:
  the entity

### setEntity

public void setEntity(@NotNull @NotNull LivingEntity entity)
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 interface `Cancellable`
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 interface `Cancellable`
Parameters:
  `cancel` - true if you wish to cancel this event

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()