1

Execute command bug? PLEASE HELP!!!

Incey 7/4/19 9:15 pm
157
7/5/2019 4:16 am
So I'm trying to make a pig teleport to me whenever I get more than 15 blocks away and I've done the commands for that and it works,

/execute at @e[type=pig,name=RainbowPig] run execute if entity @a[name=InceyBoi,distance=15..1000000] run tp @e[type=pig,name=RainbowPig] @a[name=InceyBoi,limit=1]

but then I want that to only happen when it isn't on a leash, so I tried:

/execute at @e[type=pig,name=RainbowPig],nbt={Leashed:0b}] run execute if entity @a[name=InceyBoi,distance=15..1000000] run tp @e[type=pig,name=RainbowPig] @a[name=InceyBoi,limit=1]

But it stopped working. Does anyone know how I can fix this?

Thanks!
Posted by
Incey
Level 1 : New Crafter
0

  Have something to say?

JoinSign in

2

HoboMaggot
07/05/2019 1:52 am
Level 55 : Grandmaster Blob
/execute as @e[type=pig,name=RainbowPig],nbt={Leashed:0b}] at @s if entity @a[name=InceyBoi,distance=15..1000000] run tp @s @a[name=InceyBoi,limit=1]

try this command format, its a bit more cleaned up and your formatting might be the issue
1
Incey
07/05/2019 4:16 am
Level 1 : New Crafter
Thankyou this worked a lot better!
1

Welcome