How do I use the RootVehicle tag on other entities in Minecraft?

How do I use the RootVehicle tag on other entities in Minecraft? - Positive black colleagues giving high five

I am attempting to make a contraption that gives Horses the AI of Skeletons. I am working on the backbone of the contraption and I'll add details later but currently I want the Skeleton to be killed when the Horse is killed by detecting if it has fallen off the Horse. I try to use the RootVehicle tag but the RootVehicle tag does not appear to be on the Skeleton when I did

/entitydata @e[type=Skeleton] {}

with only one skeleton in the world and I got this: There is no RootVehicle tag even though the Skeleton is obviously on the Horse.

And the /summon command for the Horse and Skeleton combo is listed above the /entitydata return.

The commands I have running 20Hz:

/scoreboard players add @e[type=Skeleton,name=pony] ponyAge 1
/scoreboard players tag @e[type=Skeleton,name=pony,score_ponyAge_min=3] remove onPony
/scoreboard players tag @e[type=Skeleton,name=pony,score_ponyAge_min=3] add onPony {RootVehicle:{Entity:{id:"EntityHorse"}}}
kill @e[type=Skeleton,name=pony,tag=!onPony,score_ponyAge_min=4]

And there is a dummy scoreboard called "ponyAge." What happens when this runs is the Horse/Skeleton combo spawns and the Skeleton instantly dies. Am I using the RootVehicle tag incorrectly? Is there a different tag for these things? Is this a bug? If it is intended behavior, it is ridiculous. All entities should have the RootVehicle tag if they are riding something.



Best Answer

RootVehicle is a player-only tag. You cannot directly detect if a non-player entity is riding something.

You would need to rely on the host, which makes multi-target situations unreliable (such that you can only reliably have 1 set of those mobs at a time for it to work perfectly).

For example, you would mark the skeleton for death but cause the horse to remove that label. If the horse dies, it no longer exists to remove the label and the skeleton would die.

/scoreboard players tag @e[type=Skeleton,name=pony] add kill
/execute @e[type=EntityHorse,tag=pony] ~ ~ ~ /scoreboard players tag @e[type=Skeleton,name=pony] remove kill

/kill @e[type=Skeleton,name=pony,tag=kill]



Pictures about "How do I use the RootVehicle tag on other entities in Minecraft?"

How do I use the RootVehicle tag on other entities in Minecraft? - Elderly white hair worker using machine
How do I use the RootVehicle tag on other entities in Minecraft? - From above of young casually dressed women choosing warm puffer jacket in shop while standing near rails with clothes and discussing details
How do I use the RootVehicle tag on other entities in Minecraft? - African American Girl in Kerchief and Other Woman with Dreadlocks



How do you add entity tags in Minecraft?

How to Enter the Command
  • Open the Chat Window. The easiest way to run a command in Minecraft is within the chat window.
  • Type the Command. In this example, we will add a tag called FoundMesaBiome to the nearest player in Minecraft Java Edition (PC/Mac) 1.13 with the following command: /tag @p add FoundMesaBiome.


  • What does the hashtag do in Minecraft commands?

    These tags allow you to select multiple types of entities (or other mentioned types) at the same time. The "#" prefix indicates that you are referencing a tag. For example, "#minecraft:arrows" will target all arrow types (normal arrows and spectral arrows).

    How do you make a custom tag in Minecraft?

    Use the namespace "forge:" with a colon then the tag name to test for tags from other mods. Use the namespace "minecraft:" with a colon then the tag name to test for tags from Minecraft. Use the namespace "mod_id:" with a colon then the tag name to test for tags from your mod.



    Why Sudo Is The Best Command in Minecraft




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Armin Rimoldi, Andrea Piacquadio, Gustavo Fring, Oluwagbenga Fashola