💣
BaseRaiders
  • 💣BaseRaiders - Main
  • Installation
    • 💡Installation
  • Configuration
    • 🖥️GUIs & Items
      • Creating GUIs & Items
      • Custom Items - On Click
      • Custom Items - Executables
      • Special executables
    • 📋Config.yml
    • 👨‍💻Commands.yml
    • 👉Handlers.yml
    • 🏚️protections.yml
    • 🫥Placeholders
  • Resource Pack
    • ⛺Setting up
    • 🖥️Custom GUIs
    • 🔢Custom Model Data
  • Usage
    • 🚚Obtaining & Usage
    • 🤷‍♂️Protection features
    • 🍄Decay system
    • 💹Upgrade section
      • Range upgrade
      • Fuel upgrade
      • Generator upgrade
  • Commands
    • 🅱️Base
    • 🆘Help
    • 🎁Give
    • 🔃Reload
    • ✈️TP
    • 👥Trust
    • 👥Untrust
    • 🚧Bypass
    • 🗂️Invites
    • 🏗️Place
    • 💬Toggle
    • 🔤Nick
    • 📉Discount
  • Support & Bugs
    • 🔧Discord
Powered by GitBook
On this page
  • On Click - Free
  • On Click - Buy
  • On Click - Special
  1. Configuration
  2. GUIs & Items

Custom Items - On Click

Executable types:

  • On Click - Free

  • On Click - Buy

  • On Click - Special


To add a custom on-click event to your item, you will need to do the following:

Let's take the item from "Custom Items - Creating" for this example.

GUI-items:
  <Item_ID>:
    slot: [39, 40, 41]
    custom-model-data: 499
    item: "STRUCTURE_VOID"
    name: "&c&lClose"
    lore:
      - "&7Screw this, I'm out!"
      on-click:
        left-click:
          free:
            execute:
              - "[SOUND] UI_BUTTON_CLICK 1 1"
          buy:
            type: "MONEY"
            money:
              price: 1
            item:
              item: "COAL"
              placeholder-name: "Coal"
              model-data: -1
              amount: 1
            buy:
              execute:
                - "[MESSAGE] &7Execute either way"
              on-success:
                - "[MESSAGE] &7Only execute if the player can afford it."
              on-fail:
                - "[MESSAGE] &7Executeif the player does not have enough money"
          special:
            special-to-execute:
              - "[SPECIAL] closeGUI"

On Click - Free

The "free" event will execute anything in the "execute" variable without any condition.


On Click - Buy

The "buy" event has a few rules. It requires a type of currency, either "MONEY" or "ITEM".

Buy currency types:

  • "MONEY" - Using an economy plugin such as Vault to charge the player

  • "ITEM" - Instead of money, charge the player an item.

  • If the "model-data" is -1, any kind of item of that type will be accepted as payment.

  • If the "model-data" is <any number>, only items with that custom model data will be accepted as payment.

  • And the "amount" is the amount of that item to charge the player.

Executable types:

After you're done with the buy type, its time for the executables.

buy:
  type: "MONEY"
  money:
    price: 1
  item:
    item: "COAL"
    placeholder-name: "Coal"
    model-data: -1
    amount: 1
  buy:
    execute:
      - "[MESSAGE] &7Execute either way"
    on-success:
      - "[MESSAGE] &7Only execute if the player can afford it."
    on-fail:
      - "[MESSAGE] &7Executeif the player does not have enough money"

You will need to add another "buy" value, and to it assign the following:

  • An "execute" variable, that runs on click.

  • An "on-success" variable, that will run if the transaction was a success.

  • And an "on-fail" variable, that will run if the player does not have sufficient funds.


On Click - Special

The special tag, as per its name, is a special tag that does things only BaseRaiders can do, such as buying fuel, upgrading or collecting the generator.

special:
  special-to-execute:
    - "[SPECIAL] <special name>"

More info about special executables here:


PreviousCreating GUIs & ItemsNextCustom Items - Executables

Last updated 9 months ago

🖥️
Special executables