❗Create abilities
How to create abilities
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 and "arrow" is the shooted arrow entity.
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 slotLast updated