Actions

GUI or Item actions allow tags to execute when triggered by the player.

Structure

Actions have 2 formats, simple and advanced, see bellow.

Simple:

actions:
  LEFT_CLICK:
    - "[SOUND] ui.button.click 1 1"
    - "[MESSAGE] <green>You left clicked!"

Advanced:

actions:
  LEFT_CLICK:
    1:
      weight: 0
      chance:
        amount: 100.0
        fail:
          - "[MESSAGE] <red>Failed chance!"
      self-use: true
      durability-cost: 1
      price:
        money:
          amount: 100.0
        item:
          currencies:
            1:
              currency: "Items/Currency/scrap.yml"
              required: true
              amount: 1
      conditions:
        - if: "%has-price%"
          then:
            - "[MESSAGE] <green>Scrap!"
            - "[COMMAND] base give %player-name% Items/Currency/scrap.yml 1"
          durability-cost: 1
        - else-if: "!%has-price-money% && %has-price-item%"
          then:
            - "[MESSAGE] <red>You don't have enough money!"
          durability-cost: 5
        - else-if: "%has-price-money% && !%has-price-item%"
          then:
            - "[MESSAGE] <red>You don't have enough items!"
          durability-cost: 1
          cancel-event: false
        - else:
            - "[MESSAGE] <red>You don't have enough money or items!"
        - finally:
            - "[SOUND] ui.button.click 1 1"

Complex actions can be paged and can contain conditions as well as durability cost (only for items).

  • weight - Weight chance to run, set to -1 to always execute | Set ALL to 0 to execute all of them | Set to anything else to execute ONE of them.

  • chance.amount - One picked by weight, roll "chance" to execute

  • chance.fail - Executables to run if the chance check fails

  • self-use - Use the action on self or on another target depending on the action

  • durability-cost - The amount of durability to drain (item only)

  • price.money.amount - The amount of money it costs to execute

  • price.item - Item price to run

  • conditions - Can contain if, else-if, else or finally | each except finally has a then executable section, a durability-cost and a cancel-event (Item only) for that specific condition check.

Last updated