Custom Abilities - BoBoBalloon/InnovativeItemsDOCS GitHub Wiki

Intro

In this section we will go over the components that make up an ability and provide some examples to help further your understanding.

Overview

Abilities are the most complex part of the plugin. This is because they are extremely customizable. Abilities can be broken down into three sections: keywords, conditions and trigger. The trigger is the event in game that causes the ability to fire when an item with the ability is used or involved. The keywords section are all the keywords used to give the ability meaning and function. The conditions are true or false statements that depending on their value will prevent the ability to fire. An example of an ability is provided below:

test-ability:
  trigger: 'right-click'
  cooldown: 20
  show-cooldown: '&cYou can use this ability again in {cooldown}'
  show-cooldown-type: 'ACTION_BAR'
  conditions:
    - 'isclearweather()'
  keywords:
    - 'damage(?player, 1)'
    - 'delay(40)'
    - 'effect(?player, JUMP, 80, 2)'
    - 'particle(?player, FLAME, 20, 0, 0, 0)'

This ability has the name of test-ability. It also has the trigger of right-click. This trigger will fire any time the player holding the item right clicks the air. The conditions section would first check if it is not raining or snowing in the world the ability was fired. If this value is false, the keywords section will not be triggered. The keywords section would damage the player who right clicked for half a heart of damage and after a delay of two seconds, it will give them the jump boost potion effect and fire the flame particles at their location.

(Keep in mind that keywords and conditions are read and executed from top to bottom)

A trigger field and keywords section are required for an ability to be read and adding into the game, but you may omit the conditions section if you would not like any conditions.

More information

Below are links to useful resources that go into more detail regarding the key elements you must understand to utilize abilities to their fullest potential and a list of all built-in functionality you can use.

For more details regarding keywords click here!

For more details regarding conditions click here!

For more details regarding targeters click here!

For more details regarding triggers click here!