In a data pack I’m working on, I use dialogs with an after_action of “wait_for_response” for a calculator menu. This lets me back out of the menu if I run into something that I haven’t implemented yet (as opposed to “none”, where my only recourse would be to exit the world entirely). For when I wanted to close the dialog, I put in a scoreboard trigger that would run “dialog clear @s” on the player. However, this didn’t work as I expected; instead of clearing out the dialog, I was once again forced to sit and wait out the five seconds for the Back button to appear on the Waiting for Server screen.
Reproduction steps:
Download the attached data pack, and create a new world with it. Make sure that “Demo ready!” appears in the chat when you start the world.
Run “dialog show @s demo:after_action_none”, and click the “Ok” button. Observe how the dialog closes, as you would expect it to. Also observe the feedback of the trigger command, and the “Function ran!” message, indicating the tick function did indeed run and clear the dialog.
Now, run “dialog show @s demo:after_action_wait_for_response”, and click the “Ok” button.
Expected result: The dialog is cleared, with the chat showing the feedback of the trigger command and the “Function ran!” message.
Actual result: The trigger command is ran, and the “Function ran!” message is shown, but the dialog is not, in fact, cleared, and you must wait the 5 seconds for the “Back” button on the “Waiting for Server” screen to become clickable in order to exit.
There is a workaround for this bug (not illustrated in the pack): By displaying a “throwaway” dialog (I have one that just says “Quitting…”) with a default after_action (“close”), you can then clear the dialog as expected.
Thank you for helping us improve Minecraft! We saved your files: