---
description: How to create abilities
---

# Create abilities

To create an item ability you can add a code to run for a specific action, for example:\
item.setLeftAction(core.createRunnable("\<code>")) // The "\<code>" will run when the player will left click with this item. You will also have another special variable for each action, the "event" variable is the event it self (used to cancel it, etc)

Here is the action list:

{% tabs %}
{% tab title="Free Version" %}
```javascript
item.setLeftAction(core.createRunnable("")) // Left click action
item.setLeftSAction(core.createRunnable("")) // Shift left  click action
item.setRightAction(core.createRunnable("")) // Right click action
item.setRightSAction(core.createRunnable("")) // Shift right click action
item.setShiftAction(core.createRunnable("")) // Shift action, if the item is an armor piece the code will run only if the armor is equipped
item.setDropAction(core.createRunnable("")) // Drop action
item.setSwapAction(core.createRunnable("")) // Swap items action (the "item" variable is the item on the second hand after the swap. 1.9+)
item.setShootAction(core.createRunnable("")) // When entity shoots a projectile with this item (the "player" variable is replaced with "shooter")
item.setPickupAction(core.createRunnable("")) // When a player picks up the item
item.setArrowLandAction(core.createRunnable("")) // When arrow lands (Instead of the variable "player" there will be the variable "shooter" which is a LivingEntity) Special variable "landLocation" is the location that the arrow landed at.
```
{% endtab %}

{% tab title="Premium Version" %}
```javascript
item.setLeftAction(core.createRunnable("")) // Left click action

item.setLeftSAction(core.createRunnable("")) // Shift left  click action

item.setRightAction(core.createRunnable("")) // Right click action

item.setRightSAction(core.createRunnable("")) // Shift right click action

item.setShiftAction(core.createRunnable("")) // Shift action, if the item is an armor piece the code will run only if the armor is equipped

item.setDropAction(core.createRunnable("")) // Drop action

item.setSwapAction(core.createRunnable("")) // Swap items action (the "item" variable is the item on the second hand after the swap. 1.9+)

item.setShootAction(core.createRunnable("")) // When entity shoots a projectile with this item (the "player" variable is replaced with "shooter")

item.setPickupAction(core.createRunnable("")) // When a player picks up the item

item.setArrowLandAction(core.createRunnable("")) // When arrow lands (Instead of the variable "player" there will be the variable "shooter" which is a LivingEntity) Special variable "landLocation" is the location that the arrow landed at.

item.setOnConsumeAction(core.createRunnable("")) // When a player consumes the item (for example if the item is an apple and the player ate it)

item.setOnItemEquip(core.createRunnable("")) // When you equip the item (hold it), provides 2 new variables "newEquippedSlot" the held slot and "previousEquippedSlot" the previous held slot
```
{% endtab %}
{% endtabs %}

You can have multiple actions for one item.
