The "exit_action" is executed even the "after_action" is set to "none" in Dialogs
The exit_action is called “exit_action” and is executed when we press the button in the footer or when we press the escape key, and the “exit_action” executes an action even if the “after_action” is set to “none” it’s not logic because it should execute the exist_action ONLY if the dialog as been closed but if the “after_action” is set to “none” we would can’t close the dialog, but by pressing the escape key we can even close the dialog and execute the “exit_action”.
And there is a problem, we can disable the closing of the dialog with the escape key and put “after_action” to “none” and we can stay stuck in the dialog. I think the button in the footer need to close the dialog even the “exit_action” is set to “none” to prevent to be stuck in a dialog or to have an useless button, or you Mojang, could make disable the button in the footer if the “after_action” is set to “none”, like this, players know that they can’t close the dialog with the button.
I’m obliged to execute a command when the “exit_action” is executed to close the dialog with the dialog clear @s
command (but it execute this command even when I press the escape key but the escape key don’t need the command to close the dialog :/…
I think the escape key wouldn’t execute the “exit_action”, but an action that we can choose, and the button in the footer would execute another action than the “exit_action”.
A “close_dialog” action could be created to be used with the button in the footer and when we press the escape key only if we want and even if the “after_action” is set to “none”.
It’s not a suggestion but it’s a way to fix the problem of the misunderstanding of this “exit_action” feature because it doesn’t really executed when the dialog is closed (by the button, escape key or dialog clear
command) and to fix the problem of being stuck in the dialog.
Steps to reproduce :
Place an Impulse Command Block and place a button on it
Put this command inside (I disabled the close with escape key) :
dialog show @p { "type": "minecraft:multi_action", "title": "Test Closing Dialog", "can_close_with_escape": false, "pause": false, "after_action": "none", "exit_action": { "label": "Close", "tooltip": { "text": "Nope", "color": "aqua", "italic": true }, "width": 50, "action": { "type": "minecraft:run_command", "command": "tellraw @a {text:\"Closed\",bold:true,color:red}" } }, "actions": [ { "label": "Test", "width": 50, "action": { "type": "minecraft:run_command", "command": "tellraw @s \"Test\"" } } ] }
Try to click on the “Test” button and look it don’t close the dialog as expected
Try to close the dialog with your escape key, look that you can’t because it’s disabled as expected
Try to click on the “Close” button, look that you can’t close the dialog because the “after_action” is set to “none”, but you see the command of “exit_action” as been executed, but you didn’t really exit th dialog
Observed result :
You can’t close the dialog, and you stay stuck, it’s a problem. But the exit_action that is supposed to don’t be executed with the “after_action” set to “none” is even executed and send the tellraw (if the close with escape key was enabled, it execute the “exit_action” even the “after_action” is set to “none”, but the “exit_action” is actually an action.
Expected result :
You can’t close the dialog by clicking the “Test” button for example, but you can close the dialog with the “Close” button, because it’s the only button of the footer is supposed to close the dialog even the “after_action” is set to “none” to prevent to be stuck in the dialog, and because it’s a button that which is made to validate a dialog, not just execute an action like the other buttons, so it should close it in any case (or if it have to close in any case, it shouldn’t execute the exit_action).
Environment
Windows 10
Java Edition
Related issues
Attachments
Comments

Aren't you just re-reporting MC-298457 because you are not happy with the resolution?
This ticket will automatically reopen when you reply.

[Mod] turbo No, but I'm now trying to show that the “exit_action” is not clear to understand because it executes even when the dialog doesn't close and that's not logical, and also the fact that you can get stuck in a dialog because of the “after_action” when it's set to “none” and when the dialog can't be closed with the escape key.
Loupieur
(Unassigned)
Plausible
Commands
1.21.6 Pre-Release 3
Retrieved