Package net.minestom.server.event.player
Class PlayerPickEntityEvent
java.lang.Object
net.minestom.server.event.player.PlayerPickEntityEvent
- All Implemented Interfaces:
Event
,EntityEvent
,EntityInstanceEvent
,InstanceEvent
,PlayerEvent
,PlayerInstanceEvent
Called when a player tries to pick an entity (middle-click).
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerPickEntityEvent
(@NotNull Player player, @Nullable Entity entityTarget, boolean includeData) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstance
Methods inherited from interface net.minestom.server.event.trait.PlayerEvent
getEntity
-
Constructor Details
-
PlayerPickEntityEvent
-
-
Method Details
-
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
Description copied from interface:PlayerEvent
Gets the player.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player
-