Closed floral-qua-floral closed 2 years ago
I might look into this later
Suggestion: /backup restore latest [comment]
will restore the latest backup with a certain comment.
Use case: I've set up command blocks to automatically backup when sleeping (commands below for anyone interested[^1]), which I want to restore when dying. However, this is not necessarily the latest backup when automatic interval backup is enabled.
[^1]: 1. enable the scoreboard tracking sleeping (once per world)
/scoreboard objectives add sleep minecraft.custom:minecraft.sleep_in_bed
execute if entity @a[scores={sleep=1..}]
scoreboard players reset @a sleep
backup start sleep
/backup restore
Implemented in 2.5.0
I'm thinking about setting up a data pack or CraftTweaker script that will allow me to get a psuedo-hardcore experience, by automatically reloading to the most recent backup when the player dies. This mod seems absolutely perfect for that, since it allows for restoring backups in-game using a command. The only troublesome part is, I can't figure out how to get the script to target the most recent backup, since the restore command requires a name, which would be different after every backup. Having some way to automatically select the most recent backup using a command would be really handy.