Commands

Informations

The plugin has an commands folder that will contain all your commands. You can create an infinite number of commands. A command will contain the name of the command, its aliases, its permission and the name of the inventory to open. You can put several commands per file and create an unlimited number of files.

|- commands
  |- punish
    - punish.yml
  |- example
    - example.yml    
  - commands.yml

Syntax

commands:
  basic_command:
    command: basic_command
    inventory: basic_inventory
  advanced_command:
    command: advanced_command
    permission: "admin.use"
    aliases:
      - zai
    inventory: advanced_inventory
  pro_command:
    command: pro_command
    inventory: pro_inventory
  openbook:
    command: openbook
    actions:
      - 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>'
  punish:
    command: punish
    permission: "admin.punish"
    aliases:
      - sanction
    inventory: example_punish
    arguments:
      - name: target
      - name: reason
        auto-completion:
          - cheat
          - chat
          - skin
          - other
        actions:
          - type: message
            messages:
              - "&7You will put a punishment to the player &f&n%target%&r &7with the reason&8: &f%reason%"            

Command

command: <command>

Main command


Aliases

aliases:
  - <aliase 1>
  - <aliase 2>
  - ...

The aliases of the command.


Action

actions:
  - ...  

You can use actions that will always be performed when executing the order.


Permission

permission: <permission>

The permission the player must have to open the inventory.


Inventory

inventory: <inventory name>

Name of the inventory that will be opened.

You can also specify the name of the plugin this way:

inventory: "<plugin name>:<inventory name>"

Arguments

arguments:
  - <arg1>
  - <arg2>
  - ...

Allows you to add arguments to your commands. You can use the arguments with the following placeholder: %zmenu_argument_<argument name>%

Example

commands:
  punish:
    command: punish
    permission: "admin.punish"
    aliases:
      - sanction
    inventory: example_punish
    arguments:
      - name: target
      - name: reason
        auto-completion:
          - cheat
          - chat
          - skin
          - other
        actions:
          - type: message
            messages:
              - "&7You will put a punishment to the player &f&n%target%&r &7with the reason&8: &f%reason%"

You can define an action and auto-completion list for each action.

Here you have the command /punish <target> <reason> . So you can run the command this way: /punish Maxlego08 Cheat (fly).

With the placeholders you will be able to retrieve the arguments:

You can define whether the argument is optional and whether the argument has a specific inventory.

Example

arguments: # argument name, true or false, plugin name : inventory name
  - name,false,zmenu:example2

You have:

  • argument name

  • true or false, set argument required or not

  • inventory name. You can set the inventory name and plugin name

Last updated