mojira.dev
MC-127407

InhabitedTime not always updating in some chunks

The NBT for each chunk includes a long integer variable called "InhabitedTime" that is supposed to be incremented whenever the chunk is loaded with a player in the vicinity. However, this doesn't always get updated as expected. For some chunks, the variable increases more slowly than expected.

To test: create a new world in creative mode and simply do nothing for 20 to 30 minutes. Then save the world and inspect "InhabitedTime" for each chunk.

The screenshots were obtained by mapping the inhabited time for each chunk to a heat map with lighter values corresponding to higher inhabited times. Two worlds were created with the same seed (seed was 1).

Tested in the 18w11a snapshot but the problem is known to exist in older versions.

Linked issues

Attachments

Comments 14

So this also affects 1.12.2?

It appears to be an old bug because I have seen evidence of it in old maps. I will check a selection of older versions including 1.12.2 and 1.8.9.

Confirmed for 1.12.2.

The image "InhabitedTime-1-12-2.png" shows the issue. I created a new world with seed 1 in creative mode then stayed in one place for 25 minutes. World age was 29,367 ticks (Time field from level.dat). The inhabited time for the loaded chunks is plotted in the image. Chunks that exist have InhabitedTime plotted in greyscale, chunks that do not exist are shown in blue.

Inhabited chunks had four distinct values for InhabitedTIme that can be seen clearly in the image: 0, 7998, 15999, 24000.

It is particularly interesting that some chunks in the middle - near the player - have an InhabitedTime of 0, even though the player is nearby.

Save files showing the bug in 1.12.2 are attached as "Test127407-1122.zip".

Confirmed in 1.8.9, see the image "InhabitedTime-1-8-9.png" for details. Save file for 1.8.9 is attached as "Test127407-1089.zip".

4 more comments

Reproduced successfully in 20w30a. InhabitedTime does not update consistently in all loaded chunks. The pattern of updating is different to older versions. In older versions the updating chunks were a square box around the player. In 20w30a this pattern is circular.

To reproduce:

  1. Create a new world. (Parameters I used: Seed 1, creative mode, disable daylight cycle and weather cycle.)

  2. Wait a minute or so, and then walk 200 or so blocks south.

  3. Wait here 10 minutes and then save the world.

  4. Inspect InhabitedTime in all chunks. --> It will have a patchy pattern.

I have uploaded two images. One shows the patchy pattern as a heat map. The other shows the location of caves. I have reconfirmed a weak correlation between the InhabitedTime for chunks and the location of caves. Chunks that do not contain caves tend to update less often than chunks that contain caves.

The new images mentioned in the previous comment:

[media][media]

Additional remarks:

  1. The correlation between caves and InhabitedTime can be seen by overlaying the two images and flicking between them. (I used Gimp for this.) The images cover the same area.

  2. It is likely that InhabitedTime only increments if there are hostile mobs in the chunk, or spawn attempts for hostile mobs have been made in a chunk.

Can confirm in 1.17.1.

This is still a thing in 1.18.2

bdm68

(Unassigned)

Community Consensus

Chunk loading

Minecraft 1.12.2, Minecraft 18w11a, 20w30a, 1.17.1, 1.18.2

Retrieved