Minecraft – “Merging” Entities

minecraft-commandsminecraft-java-edition

In a recent Video video I watched, about creating smooth elevators in 1.9, the first step he took was to merge a falling sand block with a shulker mob, and then to put that falling sand/shulker entity as the head of a named armorstand. I saw someone commented on his video this same question, but there was no answer (at least not yet). Any Ideas on how this works?

Best Answer

The Passengers list tag in 1.9, previously Riding compound tag in 1.8, holds a list of entities riding a host. These entities will appear at the same height when within the same depth.

Example, where the armor stand is the host and the FallingSand and Shulker are riding it at the same depth:

/summon ArmorStand ~ ~1 ~ {Passengers:[{id:"FallingSand",Block:"minecraft:stone",Time:1},{id:"Shulker",NoAI:1b}]}

Example, where the Shulker is at a lower depth (within the Passengers tag of the FallingSand, which is similar to what Riding was restricted to prior):

/summon ArmorStand ~ ~1 ~ {Passengers:[{id:"FallingSand",Block:"minecraft:stone",Time:1,Passengers:[{id:"Shulker",NoAI:1b}]}]}

Note that the stacking order is reversed from Riding, in that the host is at the root (ArmorStand) while the top-most entity is at the top (Shulker). Riding would cause the deepest-nested entity to be the host instead, while the root was on top.