The /execute command doesn't work inside the on_open_commands, on_close_commands or as a button in dialogue json files that are opened with /dialogue. The command works everyhwere else including in a normal NPC dialogue that is configured ingame in creative mode.
Steps to reproduce:
Open the attached world
Click the button on the command block to open a test dialogue using /dialogue
Click the "Execute Test" button in the dialogue
Expected results:
It should say "[NPC] open", "[NPC] button" and "[NPC] close" in chat because "/execute as @s run say ..." should be run when the dialogue opens, when the button is clicked and when the dialogue closes.
Observed results:
The execute commands in the dialogue won't trigger and it won't say "[NPC] open, "[NPC] button" or "[NPC] close" in chat.
Thank you for your report!
However, this issue has been closed as Working as Intended.
It appears the issue is with a mismatched command and minimum engine version. If you need help or have a suggestion you might like to follow a link below.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki