Essentially, my code is spawning an armor stand at a location with the helmet of an item, and I am wanting to change the facing/yaw of {_e} when the item is magenta glazed terracotta block, but the yaw of {_e} just wont change
This is where the function is called, it will spawn an armor stand where the player is looking, and a weird thing I have found, is if the player is looking at a placed magenta glazed terracotta block, the yaw will be changed....
Example: if the player is looking at a westward magenta glazed terracotta block, the yaw will be 90..
This is where the function is called, it will spawn an armor stand where the player is looking, and a weird thing I have found, is if the player is looking at a placed magenta glazed terracotta block, the yaw will be changed....
Example: if the player is looking at a westward magenta glazed terracotta block, the yaw will be 90..
Code:
on player's held item change:
if {convery::%player%} is set:
if player's held item is magenta glazed terracotta block:
while player's held item is magenta glazed terracotta block:
wait 0.3 seconds
loop {holo::%player%::*}:
kill {holo::%player%::%loop-index%} parsed as entity
set {_originspawn} to targeted block's location
set {_spawnloc1} to {_originspawn}
remove 0.6 from y-coordinate of {_spawnloc1}
spawnStand(({_spawnloc1}), magenta glazed terracotta block, player)
loop {holo::%player%::*}:
kill {holo::%player%::%loop-index%} parsed as entity
Code:
function spawnStand(sp: location, h: item, p: player):
spawn armor stand at {_sp}
set {_e} to last spawned entity
set helmet of {_e} to {_h}
if {_h} is magenta glazed terracotta block:
set yaw of {_e} to 180
send yaw of {_e} to {_p}
add "{Invulnerable:1b,NoGravity:1b,Invisible:1,NoBasePlate:1,DisabledSlots:2039583}" to NBT of {_e}
add {_e}'s uuid to {holo::%{_p}%::*}