â˜ĸī¸Actions

Actions that can be performed after a requirement

With a requirement, you can define actions for both success and failure. Here are the actions that can be performed.

Example: You will need to create an action list like this:

success_actions:
  - type: player_command
    commands:
      - "firstcommand"
      - "seconds commands %player%"
  - type: console_command
    commands:
      - "firstcommand"
      - "seconds commands %player%"      
  - type: message
    messages:
      - "firstcommand"
      - "seconds commands %player%"   

You can add a delay, in ticks, for each item in the list below. Do it like this:

success_actions:
  - type: player_command
    delay: 10 # 10 ticks
    commands:
      - "firstcommand"
      - "seconds commands %player%"
ActionDescription
- type: player_command
  commands:
    - "firstcommand"
    - "seconds commands %player%"
  commandInChat: false # false by default

Executes commands as the player. You can also send the command in the player's chat.

- type: console_command
  commands:
    - "firstcommand"
    - "seconds commands %player%"

Executes commands as the console.

- type: message
  messages:
    - "my message"
    - "my second messages"
  minimessage: true # true by default

Sends a message to the player. You can use placeholders, color codes, and format codes. The MiniMessage format is enabled by default if your server supports it.

- type: broadcast
  messages:
    - "my message"
    - "my second message to %player%"
  minimessage: true # true by default

Sends a message to all online players. You can use placeholders, color codes, and format codes. The MiniMessage format is enabled by default if your server supports it.

- type: chat
  messages:
    - "my message"

Sends messages on behalf of the player. You can use placeholders, color codes, and format codes. MiniMessage format is enabled by default if your server supports it.

- type: close

Closes the player's inventory.

- type: inventory
  inventory: <inventory name>
  plugin: <plugin name>
  page: <page>
  arguments: <argument list>

Opens an inventory of zMenu.

- type: connect
  server: <server name>

Allows sending the player to another server, only works with BungeeCord and Velocity.

- type: sound
  sound: <xsound>
  pitch: <sound pitch> # 1.0f by default
  volume: <sound volume> # 1.0f by default

Send a sound to a player, you must use XSound for sound.

- type: broadcast_sound
  sound: <xsound>
  pitch: <sound pitch> # 1.0f by default
  volume: <sound volume> # 1.0f by default

Send a sound to the online players, you must use XSound for sound.

- type: data
  action: <SET/REMOVE/ADD/SUBTRACT>
  key: <data key>
  value: <data value>
  seconds: <expire seconds> # 0 by default

Update player data.

- type: refresh  

Refresh current button. Works only in click requirement.

- type: back

Return to previous inventory.

- type: shopkeeper
  name: <shopkeeper name>

Open a Shopkeeper trading inventory

- type: book
  author: "Maxlego08" # Book author
  title: "&cTest" # Book title
  lines: # Book pages
    1: # First page
      - '     #34ebe8zMenu'
      - ''
      - ''
      - '<hover:show_text:"#34eba8Open an url !"><click:open_url:"https://minecraft-inventory-builder.com/">#f0af24Open URL<reset>'

Opens a book for the player. You can specify the title, author, and pages of the book.

- type: actionbar
  message: "my message"
  minimessage: true # true by default

Allows you to send a message in the action bar of the player. You can use placeholders and color/format codes here. MiniMessage format is enabled by default if your server supports it.

- type: withdraw
  amount: <amount>
  currency: <currency name>
  economy: <economy name> # Only the zEssentials, CoinsEngine and EcoBits plugins need this  

Allows you to withdraw money from the player’s account. Works with the BeastTokens, Vault, PlayerPoints, ElementalTokens, ElementalGems, Level, Experience, zEssentials, EcoBits, CoinsEngine and VotingPlugin. CurrenciesAPI : https://github.com/Traqueur-dev/CurrenciesAPI

- type: deposit
  amount: <amount>
  currency: <currency name>
  economy: <economy name> # Only the zEssentials, CoinsEngine and EcoBits plugins need this

Allows you to deposit money from the player’s account. Works with the BeastTokens, Vault, PlayerPoints, ElementalTokens, ElementalGems, Level, Experience, zEssentials, EcoBits, CoinsEngine and VotingPlugin. CurrenciesAPI : https://github.com/Traqueur-dev/CurrenciesAPI

Last updated