If you know the UUID of the existing entity, you might be able to do something like:
/summon Sheep ~ ~ ~ {Riding:{id:"Sheep",UUID:<entity-uuid>}}
However, I don't know how to get the UUID of a mob, nor do I know if this command will use the existing entity or duplicate it. Summoning mobs with a specific UUID could be weird.
No, there is no way to undo commandblock/console/chat commands in vanilla MC. The game has no code to even remember what command was executed (except "command success / fail" message in CB and line in log - but server does not see it), or what it done so it could be reverted. It is all discarded just after the command is finished.
There were some third party monitoring plugins (like HawkEye and similar), that were monitoring what happens in the world, logging it and possibly reverting the change, however it was purely based on per-block data, so all it seen were block changes and causes of that (so it could seen that your /fill
command changed blocks, and it seen what blocks were changed and how, but it did not seen the command itself or whatever). However the revert worked only on going back to last states of the block (it just remembered that this block was initially stone, then grass, then air, nothing more)
Also some plugins (like WorldEdit) have //undo, but it is just because it logs its last action completely and can do action opposite, so it looks like reverting. However it can log only its own actions.
If command kills entity, it is deleted forever and has to be resummoned. That is similar with all other changes, without third party plugins, that will store data about your world on some external place (like MySQL), you won't be able to revert any command. There is not a lot (if any) tools that would save all changes in MC world, that would be really server-wise and HDD-wise expensive and thus not reasonable... Using CommandBlocks is only for OP for reasons. You should know what you do, or don't do it.
Except...loading the backup.
Best Answer
You can make a sheep riding another sheep by using the
{Riding:{[Insert Mob Info]}
NBT data.If you want to simply add a sheep onto another, you can use:
However, this does not work as stacked entities are considered two different entities, though it is the correct command.
Why?
When you use
/summon
with the{Riding:{id:[Mob Name]}}
NBT data, the game automatically creates the mob for you. (All the other data, from UUID to statuses).However, using the
/entitydata
command only appends on the NBT data you've added. So, adding on{Riding:{id:[MobName]}}
isn't simply enough to define a mob.Update: You can't apprehend an entity onto another entity without manually editing its entity. (Safeguard or bug).
Suggested way to do it:
.mca
world data with any NBT Editor such as NBTExplorerUse F3 to look for the chunk co-ordinates you're in. Don't use the raw co-ordinates.
Entities are found in
Chunk [X, Y] > Level > Entities > ...
Riding:
The colon has to be there. Capitalization also matters.
Riding:
compound tag you've created.If you want stacks bigger than 2, it gets more complicated.