Mojira Archive
MCM-1727

It isn't possible to call the /closechat command with scripting.

  1. Partner Rank: 2
  2. Partner Team Reporting: 57Digital
  3. Verification builds: UWP 1.20.50 19034321
  4. Regression Builds: Unknown
  5. Summary: It isn't possible to call the /closechat command with scripting. 
  6. Impact: It isn't possible to open up a @server/scripting-ui easily from a chat command without convoluted workarounds.
  7. Repro Steps:
    1. Subscribe to chat events: 
      world.afterEvents.chatSend.subscribe
    2. Check for a chat message being sent: !test
    3. Send this command to the player: /closechat
    4. A little moment after, with system.runTimeout, create and send a ModalFormData UI to the player.
    5. Observe that the process failed on Step 3 due to a "Unknown command" error.
    6. Observe that the UI was never delivered to the player.
  8. 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.
  9. Expected Results: The chat should close (via /closechat), and the UI should be delivered shortly after.
  10. Screenshots / Videos attached
    1. /closechat is a valid command, and is not a cyan colored dev command (see video): 
    2. @minecraft/server reports Unknown command: closechat. 
  11. Notes
    1. 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.
    2. 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.

Works As Intended

57Digital

2023-12-13, 04:11 PM

2023-12-21, 08:56 PM

2023-12-21, 08:56 PM

0

0

Future Release

-