Class PlayerEntityInteractEvent

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

public class PlayerEntityInteractEvent extends Object implements PlayerInstanceEvent
Called when a Player interacts (right-click) with an Entity.
  • Constructor Details

    • PlayerEntityInteractEvent

      public PlayerEntityInteractEvent(@NotNull @NotNull Player player, @NotNull @NotNull Entity entityTarget, @NotNull Player.Hand hand, @NotNull @NotNull Point interactPosition)
  • Method Details

    • getPlayer

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

      @NotNull public @NotNull Entity getTarget()
      Gets the Entity with who getPlayer() is interacting.
      Returns:
      the Entity
    • getHand

      @NotNull public Player.Hand getHand()
      Gets with which hand the player interacted with the entity.
      Returns:
      the hand
    • getInteractPosition

      @NotNull public @NotNull Point getInteractPosition()
      Gets the position at which the entity was interacted
      Returns:
      the interaction position
      See Also: