#Menu with player as argument

1 messages · Page 1 of 1 (latest)

wicked hare
#

I have a menu that takes an argument which is a player name. Is it possible to have the placeholders used inside this menu to act on the player passed into the menu ?

wicked hare
#

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.

floral terrace
wicked hare
#
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
bold geyser
wicked hare
#

aaah thanks 🙂

#

Is it possible to make the argument optional

#

And does parseother work with the built-in armor_chestplate and main_hand

bold geyser