/undo Command: I can mess up!
(This originally appeared on the Minecraft Forum here)
<p style=”text-align: center;”>/undo command<u></u></p>
So, you’re making a map. You’ve spent a while making some redstone circuitry, and then some time later, you build something that your realize is a few blocks too far to the left. You use the /clone command to move the block to the correct position, but something distracts you, or you’re tired, or you’re just plain not paying attention, and you enter one of the coordinates incorrectly, which overlaps with some of that complex circuitry you spent an hour making. Great, now you either need to go restore a backup, or remake the circuits over again. If only there was someway to just undo it all.
It doesn’t matter how good you are, how experienced you are, how amazing you are–you are going to make a mistake with a command someday, and likely several. The consequences for such a mistake can vary in the amount of time required to fix it, but you really wish you could just fix it instantly as easily as pressing Ctrl+Z in a paint program.
A new command would be added: /undo . This would reverse the effects of most commands, and is saved per player. However, due to possible performance issues and the huge amount of data that would have to be written to each one, /undo cannot be used by a command block. /undo is an operator-only command and requires an operator level of 3 or higher.
How it works
Whenever you use a command that can be undone, the game saves all the data involved with the data prior to using the command, as well as the effect. When you use /undo the first time, it reverses the effect of that command as well as it can. Using /undo a second time will reattempt the original command. On a server, there is 15 second delay between using the /undo command per person.
To reduce file size, the information saved to a player.dat file from the /undo command is deleted upon exiting the world.
You can choose to allow undoing of specific commands on a server in the server_properties file.
While the chat is open, pressing Ctrl+Z will undo (or redo) the last executed command.
Effects of Specific Commands
Removes an achievement if given, or gives back a taken achievement.
Returns the blockdata of the specified block to what it was.
Gives the item(s) taken back to the player they’ve been taken from, NBT and all.
Returns the area that the clone has taken up back to it’s former state.
Returns the default game mode to its former state.
Returns the difficulty to it’s previous level
Removes an applied effect, although it does not remove what it has already done (for example, if you had gained two hearts from regeneration, you would not lose those hearts). Also gives back a removed effect for the duration it had when it was removed.
Removes the enchantment from the item.
Sets the entity’s data to its previous state.
Undoes the executed command.
Empties the filled area, then fills it back in with what it had previously contained.
Sets the gamemode for the player back to what it had been previously.
Returns the gamerule to its prior value.
Take the item away.
Makes the particle cease to exist.
Cuts the sound short.
The replaced item becomes what it had been before.
Reverses the effect of the last /scoreboard command. Scoreboards are too complicated to go into too much detail.
Sets the block to what it had been prior.
Returns the world spawn point to what it had been previously.
Kills the entity that had just been summoned, if it still exists. The entity does not drop anything.
/teleport and /tp
Returns the player to where they had been previously.
Sets the time to what it had been before the time change.
Toggles the downfall again.
Sets the weather to what it had been before.
Returns the world’s border to it’s previous state.
Returns the player’s xp level to what it had been previously.
You must be logged in to reply to this topic.