Mojira Archive
MC-143952

data/chunks.dat isn't saved if the most recent /forceload command failed

If at the time of saving the world, the most recent /forceload add or /forceload remove command failed (e.g. if a data pack does /forceload add to the same chunk periodically), then no changes to any force-loaded chunks are saved at all.

The cause of this is that a single chunk's dirty state overwrites the dirty state of all force-loaded chunks (which are stored in chunks.dat).

Reproduction steps:

  1. /forceload add 0 0
    
  2. /forceload add 0 0
    
  3. Save and restart the world.
  4. /forceload query
    

    →  No force loaded chunks were found in minecraft:overworld

Code analysis (by intsuc):
In net.minecraft.server.level.ServerLevel#setChunkForced, the dirty state of chunks.dat is set to the result of addition/removal of a forced chunk. If the server saves/stops with the dirty state false, forced chunks will not be saved in chunks.dat properly.

Unresolved

Grant Gryczan

Syl2010

2019-02-10, 02:38 PM

2024-07-31, 04:54 PM

27

19

Community Consensus

Normal

Platform

Commands

command, world

Minecraft 1.13.2 - 1.21Minecraft 1.13.2, 1.15.2, 20w08a, 20w16a, 20w17a, 20w18a, 20w19a, 20w22a, 1.16 Pre-release 1, 1.16 Release Candidate 1, 1.16, 20w27a, 20w28a, 1.17.1, 22w19a, 1.19.3, 1.19.4, 1.20.1, 23w32a, 23w35a, 1.21

-