类 PlayerInteractEvent.EntityInteractSpecific

封闭类:
PlayerInteractEvent

public static class PlayerInteractEvent.EntityInteractSpecific extends PlayerInteractEvent
This event is fired on both sides whenever a player right clicks an entity. "Specific" is an interact where the local vector (which part of the entity you clicked) is known. The state of this event affects whether Entity.interactAt(Player, Vec3, InteractionHand) is called. Let result be the return value of Entity.interactAt(Player, Vec3, InteractionHand), or PlayerInteractEvent.cancellationResult if the event is cancelled. If we are on the client and result is not InteractionResult.SUCCESS, the client will then try PlayerInteractEvent.EntityInteract.
  • 字段详细资料

    • localPos

      private final Vec3 localPos
    • target

      private final Entity target
  • 构造器详细资料

  • 方法详细资料

    • getLocalPos

      public Vec3 getLocalPos()
      Returns the local interaction position. This is a 3D vector, where (0, 0, 0) is centered exactly at the center of the entity's bounding box at their feet. This means the X and Z values will be in the range [-width / 2, width / 2] while Y values will be in the range [0, height]
      返回:
      The local position
    • getTarget

      public Entity getTarget()