Class PlayerPickEntityEvent

java.lang.Object
net.minestom.server.event.player.PlayerPickEntityEvent
All Implemented Interfaces:
Event, EntityEvent, EntityInstanceEvent, InstanceEvent, PlayerEvent, PlayerInstanceEvent

public class PlayerPickEntityEvent extends Object implements PlayerInstanceEvent
Called when a player tries to pick an entity (middle-click).
  • Constructor Details

    • PlayerPickEntityEvent

      public PlayerPickEntityEvent(@NotNull @NotNull Player player, @Nullable @Nullable Entity entityTarget, boolean includeData)
  • Method Details

    • getTarget

      @Nullable public @Nullable Entity getTarget()
      Gets the entity which was picked. May be null if the entity is not known by the server (eg spawned with packets).
      Returns:
      the entity which was picked
    • isIncludeData

      public boolean isIncludeData()
      Get if the entity data should be included in the result (control middle-click).
      Returns:
      if the entity data should be included.
    • getPlayer

      @NotNull public @NotNull Player getPlayer()
      Description copied from interface: PlayerEvent
      Gets the player.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player