Skip to content

pass args with dm open command#259

Open
FakEEE14 wants to merge 1 commit into
HelpChat:mainfrom
FakEEE14:main4
Open

pass args with dm open command#259
FakEEE14 wants to merge 1 commit into
HelpChat:mainfrom
FakEEE14:main4

Conversation

@FakEEE14
Copy link
Copy Markdown
Contributor

@FakEEE14 FakEEE14 commented Oct 6, 2025

added arguments to /dm open command so you can pass arguments for that player
like this:
/dm open punish_menu target -p:me arg1 arg2 arg3 ...
or
/dm open punish_menu target arg1 arg2 arg3 -p:me ...

@FakEEE14
Copy link
Copy Markdown
Contributor Author

FakEEE14 commented Oct 6, 2025

Hello @BlitzOffline , as you said i break down each change into its own PR, this one need to be accepted because default value is on top of this

@FakEEE14
Copy link
Copy Markdown
Contributor Author

hello @BlitzOffline , what you think ?

@FakEEE14
Copy link
Copy Markdown
Contributor Author

hi @BlitzOffline , any news ?

@FakEEE14 FakEEE14 closed this May 1, 2026
@FakEEE14 FakEEE14 deleted the main4 branch May 1, 2026 06:04
@FakEEE14 FakEEE14 restored the main4 branch May 7, 2026 05:07
@FakEEE14 FakEEE14 reopened this May 7, 2026
@BlitzOffline
Copy link
Copy Markdown
Member

Hi. I will take a look at this by the end of the week.

Comment on lines +54 to 61
for (String arg : arguments) {
if (arg.startsWith("-p:")) {
if (!sender.hasPermission("deluxemenus.placeholdersfor")) {
plugin.sms(sender, Messages.NO_PERMISSION_PLAYER_ARGUMENT);
return;
}

viewer = Bukkit.getPlayerExact(arguments.get(1));

placeholderPlayer = arg.substring(3);
} else {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the last argument starting with -p: is taken as a placeholder player. This will break backwards compatibility, if, for example, one of the arguments is also -p:SOMETHING, for some reason.

The command schema should be strictly respected:

/dm open <menu> - open menu for you
/dm open <menu> -p:<target> - open menu for you, but parse placeholders of another player
/dm open <menu> <viewer> - open menu for a player
/dm open <menu> <viewer> -p:<target> - open menu for a player, but parse placeholders of another player.

So, in the end, it should probably have this structure:
/dm open <menu> [args] - open menu for you
/dm open <menu> -p:<target> [args] - open menu for you, but parse placeholders of another player
/dm open <menu> <viewer> [args] - open menu for a player
/dm open <menu> <viewer> -p:<target> [args] - open menu for a player, but parse placeholders of another player.

I'm not sure how to actually do this, because some arguments here are optional, but are in the middle of the argument list.

Maybe we should have a new command for this? I am open to suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants