/undo Command: I can mess up!

Snapshot MC Home SnapshotMC Forums! Creative Circle Minecraft Suggestions /undo Command: I can mess up!

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by Cameron Cameron 6 days, 19 hours ago.

  • Creator
    Topic
  • #1740
    GameWyrm
    GameWyrm
    @gamewyrm

    (This originally appeared on the Minecraft Forum here)
    <p style=”text-align: center;”>/undo command<u></u></p>
    The Problem

    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.

    The Solution

    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

    /achievement
    Removes an achievement if given, or gives back a taken achievement.

    /blockdata
    Returns the blockdata of the specified block to what it was.

    /clear
    Gives the item(s) taken back to the player they’ve been taken from, NBT and all.

    /clone
    Returns the area that the clone has taken up back to it’s former state.

    /defaultgamemode
    Returns the default game mode to its former state.

    /difficulty
    Returns the difficulty to it’s previous level

    /effect
    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.

    /enchant
    Removes the enchantment from the item.

    /entitydata
    Sets the entity’s data to its previous state.

    /execute
    Undoes the executed command.

    /fill
    Empties the filled area, then fills it back in with what it had previously contained.

    /gamemode
    Sets the gamemode for the player back to what it had been previously.

    /gamerule
    Returns the gamerule to its prior value.

    /give
    Take the item away.

    /particle
    Makes the particle cease to exist.

    /playsound
    Cuts the sound short.

    /replaceitem
    The replaced item becomes what it had been before.

    /scoreboard
    Reverses the effect of the last /scoreboard command. Scoreboards are too complicated to go into too much detail.

    /setblock
    Sets the block to what it had been prior.

    /setworldspawn
    Returns the world spawn point to what it had been previously.

    /summon
    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.

    /time
    Sets the time to what it had been before the time change.

    /toggledownfall
    Toggles the downfall again.

    /weather
    Sets the weather to what it had been before.

    /worldborder
    Returns the world’s border to it’s previous state.

    /xp
    Returns the player’s xp level to what it had been previously.

You must be logged in to reply to this topic.