It isn't possible to call the /closechat command with scripting.
- Partner Rank: 2
- Partner Team Reporting: 57Digital
- Verification builds: UWP 1.20.50 19034321
- Regression Builds: Unknown
- Summary: It isn't possible to call the /closechat command with scripting.
- Impact: It isn't possible to open up a @server/scripting-ui easily from a chat command without convoluted workarounds.
- Repro Steps:
- Subscribe to chat events:
world.afterEvents.chatSend.subscribe - Check for a chat message being sent: !test
- Send this command to the player: /closechat
- A little moment after, with system.runTimeout, create and send a ModalFormData UI to the player.
- Observe that the process failed on Step 3 due to a "Unknown command" error.
- Observe that the UI was never delivered to the player.
- Subscribe to chat events:
- Observed Results: It is not possible to send UIs to the player from written commands/messages, as the chat does not close automatically, and there does not seem to be a working mechanism to programmatically close the chat UI.
- Expected Results: The chat should close (via /closechat), and the UI should be delivered shortly after.
- Screenshots / Videos attached:
- /closechat is a valid command, and is not a cyan colored dev command (see video):
- @minecraft/server reports Unknown command: closechat.
- /closechat is a valid command, and is not a cyan colored dev command (see video):
- Notes:
- A potential workaround is to keep sending the ModalFormData via a loop until the cancellation reason is not FormCancellationReason.UserBusy... but this seems like a long way around when we should just be able to close the chat via the command.
- In an ideal world, we should be able to set .shouldCloseChat(true) on ActionFormData / MessageFormData / ModalFormData. If a UI is delivered to the player while their chat is open then the chat is closed automatically.
2023-12-13, 04:11 PM
2023-12-21, 08:56 PM
2023-12-21, 08:56 PM
0
0
-

