Class WrappedEnumEntityUseAction

java.lang.Object
com.comphenix.protocol.wrappers.AbstractWrapper
com.comphenix.protocol.wrappers.WrappedEnumEntityUseAction
All Implemented Interfaces:
ClonableWrapper

public class WrappedEnumEntityUseAction extends AbstractWrapper implements ClonableWrapper
Represents an entity used action used in the UseEntity packet sent by the client.
  • Field Details

  • Method Details

    • fromHandle

      public static WrappedEnumEntityUseAction fromHandle(Object handle)
      Construct a new wrapper for the entity use action class in the UseEntity packet.
      Parameters:
      handle - - the NMS handle.
      Returns:
      the created wrapper.
    • attack

      public static WrappedEnumEntityUseAction attack()
      Get the jvm static action for attacking an entity.
      Returns:
      the action for an entity attack.
    • interact

      public static WrappedEnumEntityUseAction interact(EnumWrappers.Hand hand)
      Get an action for interacting with an entity.
      Parameters:
      hand - - the hand used for the interact.
      Returns:
      the action for an interact.
    • interactAt

      public static WrappedEnumEntityUseAction interactAt(EnumWrappers.Hand hand, org.bukkit.util.Vector vector)
      Get an action for interacting with an entity at a specific location.
      Parameters:
      hand - - the hand used for the interact.
      vector - - the position of the interact.
      Returns:
      the action for an interact_at.
    • getAction

      public EnumWrappers.EntityUseAction getAction()
      Get the action used for the interact.
      Returns:
      the interact action.
    • getHand

      public EnumWrappers.Hand getHand()
      Get the hand used for the interact. Only available if this represents interact or interact_at.
      Returns:
      the hand used for the interact.
      Throws:
      IllegalArgumentException - if called for attack.
    • setHand

      public void setHand(EnumWrappers.Hand hand)
      Sets the hand used for the interact.
      Parameters:
      hand - the used hand.
      Throws:
      IllegalArgumentException - if called for attack.
    • getPosition

      public org.bukkit.util.Vector getPosition()
      Get the position of the interact. Only available if this represents interact_at.
      Returns:
      the position of the interact.
      Throws:
      IllegalArgumentException - if called for attack or interact.
    • setPosition

      public void setPosition(org.bukkit.util.Vector position)
      Sets the position of the interact.
      Parameters:
      position - the position.
      Throws:
      IllegalArgumentException - if called for attack or interact.
    • deepClone

      public WrappedEnumEntityUseAction deepClone()
      Specified by:
      deepClone in interface ClonableWrapper
    • getPositionAccessor

      public FieldAccessor getPositionAccessor()
      Get a field accessor for the position in the interact_at type.
      Returns:
      a field accessor for the position field.
      Throws:
      IllegalArgumentException - if called for attack or interact.