mojira.dev
MC-100342

Several Non-Ticking blocks are marked as ticking forcing the growth-algorithm to check chunks needlessly

The bug

Blocktypes in Minecraft are marked as ticking if they can be activated by the random growth algorithm.

Examples would be crops, grass or fire.

However, several other blocks have no ticking-functionality but are still marked as ticking. An example would be the Cake or the Button-Blocks.

This causes problems with the growth-algorithm and chunk-indexing on chunk-loads. Each time a chunk is loaded it will count all ticking blocks. If the count is == 0 the specific chunk has no tickable blocks and will not need to be randomly checked every tick and try to grow something.

Unfortunately this benefit never really occurs if so many blocks are marked as ticking when in fact they cannot tick.

Maybe some additional information as I have some optimizations running for some time now:

  • A large amount of ChunkSections will always need to tick as they contain growable blocks like grass or leaves so the optimizations here are limited

  • Currently only the ChunkSections contain a counter that indicates if it needs to be ticked, a Chunk itself could contain this too and reduce the lookups at runtime

Affected blocks

Based on 20w07a code using Mojang names.

For the blocks in question randomTicks() is called on the builder when constructing the constants in net.minecraft.world.level.block.Blocks.

List might be incomplete, last updated for 20w07a

Block (Mojang name)

Comment

SoulFireBlock

Does nothing when ticked

RedStoneOreBlock

Could be solved by scheduling a block event with random delay

CampfireBlock

Does nothing when ticked

Linked issues

Comments 3

Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.

This is an automated comment on any open or reopened issue with out-of-date affected versions.

Updated report but removed some optimizations which would remove features of the game.

Affects 20w07a, but I didn't check the whole table, and there may be new blocks with this issue.

Kademlia

boq

Confirmed

(Unassigned)

block, block-update, randomTickSpeed, tick

Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 1.11.2, 20w07a

20w12a

Retrieved