Minecraft World Loaded Detection Using Redstone (Save file load detection)
I've been trying to search for an answer to this question for some time now
(World Load Detection / Chunk Load Detection / Join World / etc)
However, despite my effort, I've been unable to find a solution...
Details:
- This is a single-player world, NOT a private or public server
- The use of command blocks is acceptable
- It needs to activate when I open the world, but only once
- (and every time the save is loaded, but only once)
- It is a 1.15 save file
I found a lead on this reddit post: https://www.reddit.com/r/technicalminecraft/comments/7vr2gz/worldchunk_loaded_detector/
This also seemed promising but I couldn't quite follow...
https://www.minecraftforum.net/forums/minecraft-java-edition/redstone-discussion-and/commands-command-blocks-and/2828667-custom-join-message
However, the solution appears to be outdated (1+ year ago) and no longer works in version 1.15
Does anyone have any ideas?
I've tried the /tag and /scoreboard approach but those only seem to work on servers (local or public) since the command blocks will be running regardless of players being on the server
With this being a local save (and not a server), that does not appear to work.
With commands it's easy:
/scoreboard objectives add leave custom:leaveGame
This ticks up once for every time you leave the world, so it can be detected on the next server tick (when you have joined again). I do not know how it behaves when Minecraft is killed or crashes.
Example usage:
/execute if entity @a[scores={leave=1..}] run say The world was reopened.
/scoreboard players reset * leave
I showed this question to some experts about the limits of what redstone can do, but they didn't respond. :(
So I found a solution myself: My initial idea was that chunk loading detectors might work as world loading detectors as well. It turns out that this is true, even when you close and re-open the world inside the chunk with the detector inside it. So you just need to put one of those detectors e.g. every 320 blocks in both X and Z direction for render distance 10 and somehow get the output to where you want it.
Now the problem of building a chunk loading detector. I found a very easy one on Reddit, which works in 1.15.2 as well: https://www.reddit.com/r/technicalminecraft/comments/7vr2gz/worldchunk_loaded_detector/
Here is an image. Everything is self-explanatory, except this: The armour stand wears frost walker boots.