textile_backup icon indicating copy to clipboard operation
textile_backup copied to clipboard

Feature Request: "/backup restore latest" or some other way to automatically restore the most recent backup

Open floral-qua-floral opened this issue 2 years ago • 2 comments

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.

floral-qua-floral avatar Jan 10 '22 22:01 floral-qua-floral

I might look into this later

Szum123321 avatar Jan 11 '22 09:01 Szum123321

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 2. fist command block in chain (repeat, unconditional, always active) execute if entity @a[scores={sleep=1..}] 3. second command block in chain (chain, conditional, always active) scoreboard players reset @a sleep 4. third command block in chain (chain, conditional, always active) backup start sleep 5. you can set up a similar command chain to detect deaths, but there's as of now no way to automate the /backup restore

wilcooo avatar Jan 15 '22 20:01 wilcooo

Implemented in 2.5.0

Szum123321 avatar Nov 06 '22 12:11 Szum123321