DeluxeMenus icon

DeluxeMenus -----

The all in one GUI menu plugin!



1.12.0 "args" update
1.12.0

Another update!

This update adds support for arguments when opening menus with your custom menu commands:

You can now specify a new section in your menu "args". The keys in this config section are the placeholders and will be parsed when using for example {target} (since we specified target below. The value for each key is the amount of words required for each argument when opening the menu. In the example below we can use /punish <target> <time> <reason> and there must be at least 3 arguments after the open command. Setting a value of an argument key to -1 allows every arg to be included in that "arg". NOTE: -1 can only be used as the last "arg" in your arg list in the config which means the arg spans from the start of "reason" until the end of the string provided. If you only want "reason" to allow 1 word, you would specify the value as 1, if you want 2 words, you would specify the value as 2. If you add this "args" option to a menu, the menu will not open if the required arg amount is not provided with the command. You must also specify an "args_usage_message" to tell the person opening the menu the correct usage.

Code (YAML):

args
:
  target
: 1
  time
: 1
  reason
: -1
args_usage_message
: "/punish <player> <time> <reason>"
 
This allows you to use arguments in your menus rather than having to make custom js placeholders.

From here, you can use the new "arg" placeholders in any of your "click commands".

NOTE: as of right now arg placeholders are not parsed in requirements.
The only place they are parsed are in material, display_name, lore, and "click commands".

Code (YAML):

items
:
  '1'
:
    material
: barrier
    slot
: 0
    display_name
: '&cMute {target }'
    lore
:
   - '&aClick to mute {target } for {time }'
    - '&aReason for mute
: {reason }'
    left_click_commands
:
   - ' [player ] mute {target } {time }'
    - '[message] {target} being muted for {time} for
: {reason }'
    - ' [close ]'
    right_click_commands
:
   - ' [player ] mute {target } {time }'
    - '[message] {target} being muted for {time} for
: {reason }'
    - ' [close ]'
Hope this allows more customization with your menus and especially anyone who wishes to create punishment menus!

This has been requested for ages so here you go! Enjoy!

[​IMG]
----------, Jul 2, 2019
Resource Information
Author:
----------
Total Downloads: 507,357
First Release: Sep 1, 2015
Last Update: Dec 13, 2023
Category: ---------------
All-Time Rating:
604 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings