mojira.dev
MC-198110

commands in functions can have preceding and trailing spaces and tabs

Commands in functions can have preceding and trailing spaces and tabs.

xp add @s 1 levels         
			tellraw @s {"text":"hello"}				
clear @s cobblestone 1
xp add @s 1 levels         
			tellraw @s {"text":"hello"}				
clear @s cobblestone 1

This can be conflicting in commands like /say, because it trims these characters.

say Look! I'm not displaying the trailing spaces and tabs!!
say Look! I'm not displaying the trailing spaces and tabs!!

Preceding tabs and spaces may be intentional, because it then allows comments to be indented.

Comments 1

Per the 23w31a changelog, preceding spaces are intended to be trimmed (at least for multi-line commands).
Confirmed for 1.20.1 and 23w33a.

ErrorCraft

(Unassigned)

Confirmed

Commands

1.16.2, 20w51a, 21w03a, 1.16.5, 21w05b, 1.21.6

Retrieved