Package com.comphenix.protocol.wrappers
Class WrappedEnumEntityUseAction
java.lang.Object
com.comphenix.protocol.wrappers.AbstractWrapper
com.comphenix.protocol.wrappers.WrappedEnumEntityUseAction
- All Implemented Interfaces:
ClonableWrapper
Represents an entity used action used in the UseEntity packet sent by the client.
-
Field Summary
FieldsFields inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
handle, handleType -
Method Summary
Modifier and TypeMethodDescriptionstatic WrappedEnumEntityUseActionattack()Get the jvm static action for attacking an entity.static WrappedEnumEntityUseActionfromHandle(Object handle) Construct a new wrapper for the entity use action class in the UseEntity packet.Get the action used for the interact.getHand()Get the hand used for the interact.org.bukkit.util.VectorGet the position of the interact.Get a field accessor for the position in the interact_at type.static WrappedEnumEntityUseActioninteract(EnumWrappers.Hand hand) Get an action for interacting with an entity.static WrappedEnumEntityUseActioninteractAt(EnumWrappers.Hand hand, org.bukkit.util.Vector vector) Get an action for interacting with an entity at a specific location.voidsetHand(EnumWrappers.Hand hand) Sets the hand used for the interact.voidsetPosition(org.bukkit.util.Vector position) Sets the position of the interact.Methods inherited from class com.comphenix.protocol.wrappers.AbstractWrapper
equals, getHandle, getHandleType, hashCode, setHandle, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.comphenix.protocol.wrappers.ClonableWrapper
getHandle
-
Field Details
-
CONVERTER
-
-
Method Details
-
fromHandle
Construct a new wrapper for the entity use action class in the UseEntity packet.- Parameters:
handle- - the NMS handle.- Returns:
- the created wrapper.
-
attack
Get the jvm static action for attacking an entity.- Returns:
- the action for an entity attack.
-
interact
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
Get the action used for the interact.- Returns:
- the interact action.
-
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
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
- Specified by:
deepClonein interfaceClonableWrapper
-
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.
-