Making three specific mobs ride each other in Minecraft?

I was just wondering how you could make a Pig with a Saddle ride an EnderDragon that is riding a MinecartRideable.

Right now, I have:

/summon Pig ~ ~ ~ {Riding:{id:EnderDragon},Saddle:1} 

and have tried:

/summon Pig ~ ~ ~ {Riding:{id:EnderDragon},Riding:{id:MinecartRideable},Saddle:1}

Which summons a Pig with a Saddle riding an EnderDragon.

I want it so that the EnderDragon is riding a MinecartRideable.


Solution 1:

Seeing your two attempts - You almost got it the second time around.

So, your attempt was:

/summon Pig ~ ~ ~ {Riding:{id:EnderDragon},Riding:{id:MinecartRideable},Saddle:1}`

Right now, your command looks like this:

Summon a Pig, riding on a Enderdragon AND a Minecart.

To make your command correct, you have to nest the mobs correctly:

/summon Pig ~ ~ ~ {Riding:{id:EnderDragon,Riding:{id:MinecartRideable}},Saddle:1}

Which is:

Summon a Pig, riding a Enderdragon that is riding a Minecart.

If you want a mob that is riding another mob to ride said mob, you have to nest the riding tag inside the second mob.


As stated by MrLemon in an comment, with the Riding tag being depreciated and being replaced by the Passenger tag (which is basically back-to-front) in the next version of Minecraft (currently active in snapshot 15w41a), we can use:

/summon MinecartRideable ~ ~ ~ {Passengers:[{id:EnderDragon,Passengers:[{id:Pig,Saddle:1}]}]}

Which is:

Summon a Minecart that has a Enderdragon in it which has a pig riding on it.

Or to simply put it: The above stuff but back-to-front.
Minecart-Enderdragon-Pig, not Pig-Enderdragon-Minecart.