Skip to content

Add Brigadier ArgumentType Support for Vanilla-style Operation Symbols (+=, *=, %=, etc) #12540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Lock-Robster opened this issue May 10, 2025 · 6 comments · May be fixed by #12541
Open

Add Brigadier ArgumentType Support for Vanilla-style Operation Symbols (+=, *=, %=, etc) #12540

Lock-Robster opened this issue May 10, 2025 · 6 comments · May be fixed by #12541
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added.

Comments

@Lock-Robster
Copy link

Is your feature request related to a problem?

Yes. Currently, when creating custom Brigadier commands in Paper using StringArgumentType.word() or StringArgumentType.string(), it is not possible to enter vanilla-style operation symbols (e.g., +=, *=, %=, etc.) without the argument turning red and being rejected as invalid by the client. This prevents the user from completing the command and adding arguments after it.

The only workaround is to use StringArgumentType.greedyString(), but that restricts me from adding further arguments, which limits command flexibility and usability.

Describe the solution you'd like.

I would like Paper to add a native ArgumentType that allows for the inclusion of vanilla-style operation symbols (+=, -=, *=, /=, %=, etc.) in a way that works seamlessly with the client’s command validation—just like /scoreboard players operation in vanilla Minecraft.

Ideally, this argument type would:

  • Provide proper suggestions for valid operations
  • Avoid being marked red/invalid in the command UI
  • Support additional arguments after it (i.e., not consume the rest of the command like greedyString() does)

This could be implemented as a specialized argument under ArgumentTypes, such as an enum-style argument for supported operators.

Describe alternatives you've considered.

  • StringArgumentType.word() or .string() → These both cause symbols like +=, *= to appear red in-game and block further input.
  • StringArgumentType.greedyString() → Accepts symbols but consumes the rest of the input, disallowing more arguments.
  • Custom argument types → Still show red in the client due to lack of proper integration with client-side syntax validation.

Other

This becomes a blocker when trying to replicate or mirror vanilla command syntax, such as with /scoreboard players operation, where operations are a core part of the command flow.

Adding native support would make plugin commands much more expressive and compatible with existing Minecraft patterns.

@electronicboy
Copy link
Member

You can't have native argument types without modifying the client

@electronicboy electronicboy closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2025
@electronicboy
Copy link
Member

I might have misread this, was pointed out that maybe you were asking for us to expose an argument type that already exists in the vanilla client?

@electronicboy electronicboy reopened this May 10, 2025
@Lock-Robster
Copy link
Author

Yes, here is a typical command in vanilla Minecraft.
It takes different operations and shows them as suggestions and syntax highlighted, then after it, it then prompts for next argument:
/scoreboard players operation @s Health += 10

Image

@NonSwag
Copy link
Contributor

NonSwag commented May 10, 2025

This looks like a literal and not like an argument type

@jpenilla
Copy link
Member

This looks like a literal and not like an argument type

It is an argument type

@Strokkur424
Copy link
Contributor

Indeed, it is its own dedicated argument. In Mojang code, it is referred to as the OperationArgument

@Strokkur424 Strokkur424 linked a pull request May 10, 2025 that will close this issue
3 tasks
@Warriorrrr Warriorrrr added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. and removed status: needs triage labels May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants