Okay I've pulling my hair out because I cannot for the life of me figure out how to execute a command if an entity has a tag. This seems like such a basic function yet I am too stupid to figure it out.
Below are two sets of commands written almost exactly except one uses type=chicken and one uses tag=test
# Failed Attempts to teleport
execute as @e[tag=test] run teleport ~ -500 ~
teleport @e[tag=test] ~ ~-500 ~
execute if entity @e[tag=test] run tp @e[tag=test] ~ ~-500 ~
tp @e[tag=test] @s
# Teleportation works
execute as @e[type=chicken] run teleport ~ -500 ~
teleport @e[type=chicken] ~ ~-500 ~
execute if entity @e[type=chicken] run tp @e[type=chicken] ~ ~-500 ~
tp @e[type=chicken] @s
All I want to do is teleport a chicken into the void if it has the tag of test.
Below are two sets of commands written almost exactly except one uses type=chicken and one uses tag=test
# Failed Attempts to teleport
execute as @e[tag=test] run teleport ~ -500 ~
teleport @e[tag=test] ~ ~-500 ~
execute if entity @e[tag=test] run tp @e[tag=test] ~ ~-500 ~
tp @e[tag=test] @s
# Teleportation works
execute as @e[type=chicken] run teleport ~ -500 ~
teleport @e[type=chicken] ~ ~-500 ~
execute if entity @e[type=chicken] run tp @e[type=chicken] ~ ~-500 ~
tp @e[type=chicken] @s
All I want to do is teleport a chicken into the void if it has the tag of test.
Create an account or sign in to comment.
2
Does your mob actually have the test tag? You can check using /tag <selector> list
Other than that, the commands you provided would work
Other than that, the commands you provided would work
Yes I confirmed the mob has that tag two ways.
I reloaded the world after taking a break and watching a show and what do you know the command is now working correctly. I guess I should have followed the golden rule. "When in doubt, power out"
Thanks for the sanity check!
- using /tag <selector> list
- using /data get <selector>
I reloaded the world after taking a break and watching a show and what do you know the command is now working correctly. I guess I should have followed the golden rule. "When in doubt, power out"
Thanks for the sanity check!