Campfires begin producing massive amounts of particles when game lags
The bug
When placing a campfire, during excessive amounts of lag, it will start producing massive amounts of particles, which do not stop for several minutes, even if the campfire is put out or removed.
How to reproduce
- Place a campfire.
- Create a machine that produces lag (see screenshots, place armor stands on the pistons)
→
Campfire begins producing massive amounts of smoke
Linked Issues
is duplicated by4
Created Issue:
Campfires begin producing massive amounts of particles when game lags
When placing a campfire, during excessive amounts of lag, it will start producing massive amounts of particles, which do not stop for several minutes, even if the campfire is put out or removed.
To recreate,
- Place a campfire.
- Create a machine that produces lag (I used an observer clock hooked up to a bunch of sticky pistons, as seen in the screenshot)
Environment
Running on windows 10, Java edition. Game running on 2G of RAM.
is duplicated by
When placing a campfire, during excessive amounts of lag, it will start producing massive amounts of particles, which do not stop for several minutes, even if the campfire is put out or removed.
To recreate,
- Place a campfire.
- Create a machine that produces lag (I used an observer clock hooked up to a bunch of sticky pistons, as seen in the screenshot)
The bug
When placing a campfire, during excessive amounts of lag, it will start producing massive amounts of particles, which do not stop for several minutes, even if the campfire is put out or removed.
How to reproduce
- Place a campfire.
- Create a machine that produces lag (see screenshots, place armor stands on the pistons)
→Campfire begins producing massive amounts of smoke
Running on windows 10, Java edition. Game running on 2G of RAM.
relates to
is duplicated by
is duplicated by
is duplicated by
Thank you for your report!
However, this issue is a Duplicate of MC-142214.
If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki
PhiPro and I did some investigation into the cause of this bug and think we know both the cause and an easy fix. This hopefully also resolves MC-142214 and MC-142332. The basic issue is that when the client processes a ChunkDataClientPacket it does not properly remove the tile entities that are in that chunk. In particular, the tile entities are left in a few key lists like World.tickingBlockEntities, and therefore they continue to tick and produce smoke. This can lead to many duplicated tile entities at the same location (causing lag by creating many particles) or smoke particles being created from blocks that no longer contain campfires. In agreement with the other bug reports, this requires many blocks within the same chunk as the campfire to be updated (to trigger the ChunkDataClientPacket).
The relevant code is below (using the mappings from fabric for 19w05a):
In WorldChunk.method_12224(PacketByteBuf, CompoundTag, int, boolean), (called by ClientPlayNetworkHandler.onChunkData > ClientChunkManager.method_16020 > WorldChunk.method_12224) the following code appears:
Iterator iterator_1;
int int_2;
if (boolean_1) {
this.blockEntityMap.clear();
} else {
iterator_1 = this.blockEntityMap.keySet().iterator();
while(iterator_1.hasNext()) {
BlockPos blockPos_1 = (BlockPos)iterator_1.next();
int_2 = blockPos_1.getY() >> 4;
if ((int_1 & 1 << int_2) != 0) {
iterator_1.remove();
}
}
}
This code removes the entities from the chunk's block entity map, but leaves them in a few important lists. To fix this, we should call world.removeBlockEntity on the positions for each of the tile entities instead of using the iterator.remove method. To avoid ConcurrentModificationException s, one possibility is to make a list of the affected coordinates. Alternatively, it might be possible to call world.removeBlockEntity immediately after iterator_1.remove()


A very similar issue affects turtles when burying their eggs on a beach. I'm sure there is (and should be) a separate issue for that, but it might have the same underlying cause.
newest version (19w04b) is still affected.
Also this problem only occures in the same subchunk as the lag-generating contraption, in other (sub-)chunks this smoke-duplication does not appear.
Confirmed for 19w06a. It seems to happen when the campfire is just inside/outside loaded chunks, or just out of render distance.