You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, commands entered by a player will appear in chat as if they were a normal chat message. Correctly handle chat messages prefixed with a "/" and reroute to command handler.
How this will be structured is yet to be seen—a system per command seems somewhat messy.
It might be a good idea to start by having commands take World as a parameter and running them sequentially at the end of the tick. There's no real need to run them in parallel, so this is a fine way to begin.
Maybe use Fn fields for component and grouped commands by parameters?
Then you can expand it with future plugins ... Potentially, because it is part of ECS.
But introducing the system as a team sounds good for ECS and further expansion. You can implement the command macro for convenience.
What would be involved in command support? Are we talking about a low-level system triggering all "/" or more in-depth with argument parsing like Mojang/bridgadier or both?
Further more if we are talking about a more fully featured command framework, should it be similar to bridgadier since thats how vanilla commands are handled.
The arguments should be stored as some graph, and each node may have a command attached. The function attached to said command has the Argument which is the sum of all parent's arguments. Such that we can pass all previously partial parsed arguments from the graph as the total argument for the function.
Activity
caelunshun commentedon Oct 6, 2019
It might be a good idea to start by having commands take
Worldas a parameter and running them sequentially at the end of the tick. There's no real need to run them in parallel, so this is a fine way to begin.DarkWeird commentedon Nov 13, 2019
Maybe use Fn fields for component and grouped commands by parameters?
Then you can expand it with future plugins ... Potentially, because it is part of ECS.
But introducing the system as a team sounds good for ECS and further expansion. You can implement the command macro for convenience.
caelunshun commentedon Nov 13, 2019
With the Tonks rewrite, this will become a lot easier, because we will be able to schedule arbitrary systems on demand.
Defman commentedon Feb 25, 2020
What would be involved in command support? Are we talking about a low-level system triggering all "/" or more in-depth with argument parsing like Mojang/bridgadier or both?
Further more if we are talking about a more fully featured command framework, should it be similar to bridgadier since thats how vanilla commands are handled.
Defman commentedon Mar 30, 2020
I have been looking into implementing this and found it should support the following.
The arguments should be stored as some graph, and each node may have a command attached. The function attached to said command has the Argument which is the sum of all parent's arguments. Such that we can pass all previously partial parsed arguments from the graph as the total argument for the function.
Merge pull request #209 from feather-rs/commands