Alright so I have this problem where I can't get it to spawn dirt when I type in /spawnas dirt. It doesn't spawn anything and I tried changing "set {_2} to arg-1" to "set {_2} to dirt" and that worked. Please help me, thanks.
Code:
command /spawnas [<text>]:
trigger:
set {_1} to location of player
set {_2} to arg-1
spawn armor stand at {_1}
wait 1 tick
set armor stand helmet of last spawned entity to {_2}
set {_3} to last spawned armor stand
add "{ShowArms:1,NoGravity:1b,Invisible:1,Invulnerable:1,NoBasePlate:1}" to nbt of {_3}
send "%{_1}%"
send "%{_2}%"
send "%{_3}%"