On Minecraft 1.12, I'm making a thing for a boss fight, and it has baby zombies riding chickens. You can kill the zombies and they will die but the chicken won't. How should I detect the chicken no longer having a passenger?
Minecraft-Java-Edition-Commands – How to Detect a Mob That No Longer Has a Passenger
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – How to test if a passive mob is a baby with command blocks
- Minecraft – How to teleport players after defeating a mob
- Minecraft – How to detect the death of a mob
- Minecraft Java Edition – Why Are Pistons Killing Chickens?
- Minecraft – How to detect if a player has no item selected in his hand
- Minecraft – the RAREST thing to spawn in Minecraft
Best Answer
Sadly you can't just test for an empty list of passengers, because the game removes the
Passengers
tag when the zombie is killed instead of just emptying it.But you can detect all chickens and you can detect all chickens with passengers, so you can do something like this:
This first adds the tag
noPassenger
to all chickens and then removes it from every chicken that is ridden by a zombie. You can later select all tagged chickens with@e[tag=noPassenger]
.