mojira.dev
MC-121859

Live command parsing deals poorly with redundant spaces

The bug

If you enter something like /gamemode  survival (notice the double space, for the bugtracker one was replaced with  ), the preview predicts an error, but the command works.

The exact error message can vary, sometimes it wants the next, sometimes the second next part. For example:

  • /gamemode  survival: No error message, just four lines with grey /gamemode and red gamemode names

  • /effect give &nbsp;@p strength 100 100: "Invalid name or uuid at position 12: …fect give <--[HERE]" (So it apparently expects the next argument now, the selector.)

  • /effect give @p &nbsp;strength 100 100: "Expected integer at position 16: … give @p <--[HERE]" (So it apparently expects the second next argument now, the duration. But if I entered the duration there, the command would fail when executing.)

Linked issues

Comments 2

This seems to be caused by the chat space normalization happening when executing the command, but not for the live preview. In a similar vein, NBSP or ohgam spaces also break the preview but work fine for actual execution (e.g. /gamemode creative and /gamemode creative).

Resolved as duplicate of MC-65034 since that appears to be the underlying issue, for example /gamemode&nbsp;&nbsp;survival (two spaces) becomes /gamemode survival (one space) for the server and is therefore a valid command.

FaRo1

Nathan Adams

Confirmed

command-syntax-help, whitespace

Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w50a, Minecraft 18w02a, Minecraft 18w16a, ..., Minecraft 1.13, Minecraft 18w30b, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w44a

Retrieved