Commands with extra spaces between their arguments will not be executed by Minecraft via .mcfunction-files even though they will be executed just fine when triggered via the ingame CLI. Furthermore Minecraft wrongly reports that it executed those commands. This seems to apply to any command with multiple spaces between any of its arguments.
Steps to reproduce:
Create a .mcfunction-file
put
summon minecraft:armor_stand -1 64 0
into line 1
put
summon minecraft:armor_stand 0 64 0
into line 2 (note the extra space between 0 and 64)
save the file (duh!)
/function example:file_you_just_saved
See only the first armor stand being summoned and Minecraft wrongly reporting it executed two commands from the .mcfunction file
Appendum
While I was made aware that commands with extra spaces don't work in Command Blocks either, I still consider this behaviour disfunctional. Almost every single compiler/interpreter out there doesn't care about tab stops or extra spaces (and neither do any other minecraft data files) because the alternative makes it almost impossible to write easy to read and properly aligned code. It's a usability issue.
Linked issues
is duplicated by 1
Attachments
Comments 2
Your provided command does not work in a command block, and only works from chat because whitespace is trimmed out: MC-65034
I just double checked this and you are indeed correct. Turns out the mcedit-filter to import Command Block commands from textfiles that I was using before also trims whitespace.
However, I still consider the current behaviour a bug considering almost every single compiler and interpreter out there doesn't care about extra spaces and tab stops (and neither do any minecraft data files) in order to make writing and reading code not painful. 🙂
Your provided command does not work in a command block, and only works from chat because whitespace is trimmed out: MC-65034