Class PlayerUseUnknownEntityEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
com.destroystokyo.paper.event.player.PlayerUseUnknownEntityEvent
Represents an event that is called when a player right-clicks an unknown entity.
Useful for plugins dealing with virtual entities (entities that aren't actually spawned on the server).
This event may be called multiple times per interaction with different interaction hands and with or without the clicked position.
This event may be called multiple times per interaction with different interaction hands and with or without the clicked position.
-
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
ConstructorDescriptionPlayerUseUnknownEntityEvent
(Player player, int entityId, boolean attack, EquipmentSlot hand, @Nullable Vector clickedPosition) -
Method Summary
Modifier and TypeMethodDescriptionReturns the position relative to the entity that was clicked, ornull
if not available.int
Returns the entity id of the unknown entity that was interacted with.getHand()
Returns the hand used to perform this interaction.static HandlerList
boolean
isAttack()
Returns whether the interaction was an attack.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerUseUnknownEntityEvent
@Internal public PlayerUseUnknownEntityEvent(Player player, int entityId, boolean attack, EquipmentSlot hand, @Nullable Vector clickedPosition)
-
-
Method Details
-
getEntityId
public int getEntityId()Returns the entity id of the unknown entity that was interacted with.- Returns:
- the entity id of the entity that was interacted with
-
isAttack
public boolean isAttack()Returns whether the interaction was an attack.- Returns:
true
if the player is attacking the entity,false
if the player is interacting with the entity
-
getHand
Returns the hand used to perform this interaction.- Returns:
- the hand used to interact
-
getClickedRelativePosition
Returns the position relative to the entity that was clicked, ornull
if not available. SeePlayerInteractAtEntityEvent
for more details.- Returns:
- the position relative to the entity that was clicked, or
null
if not available - See Also:
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-