-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Dynamically Updated MultiLiteral Argument #513
Comments
This is a limitation of Brigadier. The The It's not possible to create a dynamically changing list of suggestions without restructing the command tree during the running of the server and updating the player's list of commands which is not something that we can do easily or quickly on a per-player basis. |
Acts like `MultiLiteralArgument`, but literals can be changed and differ for each CommandSender Resolves #513 Uses Paper's `AsyncPlayerSendCommandsEvent` and Velocity's `PlayerAvailableCommandsEvent` to change the client's view of the command tree. Note that a similar event does not exist on Spigot, so the suggestions are not dynamic, though the parsing still is. `DifferentClientNode` class added to handle creating client-server command tree de-syncs (I believe this can be used to make `FlagsArgument` platform-agnostic)
An experimental implementation of this idea is present on the |
Acts like `MultiLiteralArgument`, but literals can be changed and differ for each CommandSender Resolves #513 Uses Paper's `AsyncPlayerSendCommandsEvent` and Velocity's `PlayerAvailableCommandsEvent` to change the client's view of the command tree. Note that a similar event does not exist on Spigot, so the suggestions are not dynamic, though the parsing still is. `DifferentClientNode` class added to handle creating client-server command tree de-syncs (I believe this can be used to make `FlagsArgument` platform-agnostic)
Acts like `MultiLiteralArgument`, but literals can be changed and differ for each CommandSender Resolves #513 Uses Paper's `AsyncPlayerSendCommandsEvent` and Velocity's `PlayerAvailableCommandsEvent` to change the client's view of the command tree. Note that a similar event does not exist on Spigot, so the suggestions are not dynamic, though the parsing still is. `DifferentClientNode` class added to handle creating client-server command tree de-syncs (I believe this can be used to make `FlagsArgument` platform-agnostic)
Acts like `MultiLiteralArgument`, but literals can be changed and differ for each CommandSender Resolves #513 Uses Paper's `AsyncPlayerSendCommandsEvent` and Velocity's `PlayerAvailableCommandsEvent` to change the client's view of the command tree. Note that a similar event does not exist on Spigot, so the suggestions are not dynamic, though the parsing still is. `DifferentClientNode` class added to handle creating client-server command tree de-syncs (I believe this can be used to make `FlagsArgument` platform-agnostic)
Description
Currently, with
StringArgument
, you can provide a list of suggestions dynamically for the player to chose from using.replaceSuggestions(...)
but it will really accept any token. There is alsoMultiLiteralArgument
which has a hard-coded list of accepted values and considers any other token invalid. I would like to see an in-between where you can dynamically provide a list of accepted values and the argument will mark any other token as invalid.Expected code
// Optimally, I imagine this
// Variation 1:
// Variation 2:
// This could work too
// Or a new argument altogether
Extra details
No response
The text was updated successfully, but these errors were encountered: