Inconsistensy counting tile entities

Hey, I created a command to check tile entities amount, here is my code to compute them per type on a Map<EntityType, Integer>.

        for (Chunk loadedChunk : world.getLoadedChunks()) {
            for (BlockState tileEntity : loadedChunk.getTileEntities()) {
                tileEntities.compute(tileEntity.getType(), (material, amount) -> amount == null ? 1 : amount + 1);

However total (map’s values) is always greeter than both below:


Is this behavior expected, why this difference? In my opinion they should be the same, thanks! :slight_smile:
Please enlighten me if I’m totally wrong about these methods.

Node: The same code is adapted to entities amount, and it works perfectly, only issue with tiles.

Can someone help me please :confused: Thanks