textile_backup
textile_backup copied to clipboard
Feature Request: "/backup restore latest" or some other way to automatically restore the most recent backup
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.
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
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
Implemented in 2.5.0