The IAction interface, and the *Action classes (CombatAction/DrinkItemAction/etc) correspond to actions that your character performs in the world.
When an action (a creature is attacked, a potion is drank, a creature moves) is sent to the server, the server will respond with whether or the action succeeded.
To attack another creature, create this object and send it with the client sendAction(…) method.
When a combat action occurs, this response indicates whether it succeeded (HIT/MISS), and if hit then how much damage was done.
To drink a potion that is in your inventory, create this object and send it with client sendAction(…) method.
When a character drinks a potion, this value will be returned indicating the result.
To equip weapons or armour from your inventory, create this object and send it with the client sendAction(…) method.
When a character equips an item (weapon/armour), the object will be returned indicating the result.
To pick up an item from the ground, or place an item (from your inventory) on the ground, create this object and call the client sendAction(…) method.
A null action may be sent by the player to indicate that they wish their character to not perform an action this turn.
A null action response will always return false on actionPerformed(…).
To move your character, create an instance of this action and call the client API’s sendAction(…) command.
This object is returned when the player’s code attempts to move their character.
Whether the combat action succeeded, or failed (and why it failed)
To determine which type/class the action is, call getActionType() on an IAction.
If the step action failed, this will indicate the reason.
Copyright © 2018 the original author or authors.