mojira.dev
MC-248170

Composters at level 7 convert to level 8 when randomtickspeed is 0

Steps to reproduce:

  • /gamerule randomTickSpeed 0

  • /setblock ~ ~ ~ minecraft:composter[ level= 7 ]

  • watch it turn to level 8 even though randomtickspeed is 0

Comments 4

It's not based on random ticks, it's a scheduled tick, making this fall out of scope from the game rule. Other scheduled tick examples: redstone components triggering, repeating command blocks; changing random tick speed to also stop scheduled ticks would break all of them.

I can reinforce the above statement by simply looking at the code.

The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.

net.minecraft.world.level.block.ComposterBlock.java

public class ComposterBlock extends Block implements WorldlyContainerHolder {
   ...
   public void tick(BlockState $bs, ServerLevel $sl, BlockPos $bp, Random $r) {
      if ($bs.getValue(LEVEL) == 7) {
         $sl.setBlock($bp, $bs.cycle(LEVEL), 3);
         $sl.playSound((Player)null, $bp, SoundEvents.COMPOSTER_READY, SoundSource.BLOCKS, 1.0F, 1.0F);
      }

   }
   ...

If composters were affected by the randomTickSpeed gamerule, the randomTick() method would be present within the ComposterBlock.java class, and since it isn't, we know that this is a scheduled tick.

I see, thanks for explaining,

But shouldn't composter 7-8 changing and copper oxidation be randomticked instead of scheduled? Or is that less efficient?

Copper oxidation is, that was my bad, and not really. Additionally, it'd make the timing of when it changes completely random, whereas now it's a consistent time.

T727

(Unassigned)

Unconfirmed

(Unassigned)

1.18.1

Retrieved