Currently, it is impossible to create a dialog with input fields that players without op can interact with effectively. As it stands, any dialog input must have their input sent through the command_template on_submit action. However, without op, the only command that can receive such data is the trigger command, which does not accept text or floats, and only allows for a single input.
I propose that a new on_submit type be created for this purpose, called function_macro or something similar. The function macro submit type would accept the name of a function, and when submitted will pass along the input keys as keys for the function macro, and will not require elevated permissions combined with a scary popup to run. The function would run with the function permission level set in server.properties (so by default, dialog actions could not run commands like /op, /tick, or other server commands.)
An example dialog with multiple input fields might look something like this:
text input; key = text_1
text input; key = text_2
boolean input; key = boolean_1
slider input; key = slider_1
on_submit function_macro; id = example_namespace:example_function
Then, the function defined in the datapack "namespace:function" might look something like this:
$say Wow, you typed $(text_1) and $(text_2) in only $(slider_1) seconds, which is very $(boolean_1).
A player without op would therefore be able to pass on inputs to the datapack with dialog inputs, which is currently impossible under the current system.
Please sign in to leave a comment.
5 Comments