#Menu with player as argument
1 messages · Page 1 of 1 (latest)
Yes, see the wiki here for details:
https://wiki.helpch.at/helpchat-plugins/deluxemenus/options-and-configurations/gui#args
Yeah I know I can pass arguments into the menu and use them, but I want the placeholders used to act on the passed in player instead of the player the menu is shown to.
The same placeholder used in the argument messages should work else where in the GUI I believe.
open_command: profile
register_command: true
args:
player:
requirements:
regex:
type: "regex matches"
input: "{player}"
regex: "^[a-zA-Z]{2,16}$"
deny_commands:
- "[message] That's not a valid player!"
length:
type: "string length"
input: "{player}"
min: 2
max: 32
deny_commands:
- "[message] Player must be between 2 and 32 characters long."
player:
type: "is object"
input: "{player}"
object: "player"
deny_commands:
- "[message] &cMust be an online player."
args_usage_message: "&7Usage: /profile [player]"```
And then I have this item:
chest_equipped:
material: armor_chestplate
slot: 17
priority: 0
view_requirement:
requirements:
equipped:
type: ==
input: "%player_armor_chestplate_data%"
output: 0```
The placeholder is still using the player who opened the menu, not the player passed in as argument
Yes. Because the argument is a simple string that you can use inside the menu. If you want to parse placeholders for another player other than the menu viewer, you can use expansions such as ParseOther.
For example: %parseother_{player}_{player_armor_chestplate_data}%
aaah thanks 🙂
Is it possible to make the argument optional
And does parseother work with the built-in armor_chestplate and main_hand
ParseOther is a PlaceholderAPI expansion. It will work anywhere in DeluxeMenus where placeholders work.