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
  • Constructor Details

  • Method Details

    • getName

      @Nullable public @Nullable net.kyori.adventure.text.Component getName()
      Gets the name to be given to the entity.
      Returns:
      the name
    • setName

      public void setName(@Nullable @Nullable net.kyori.adventure.text.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()