mojira.dev
MC-185353

Water can't be frozen with Frost Walker if there is a block on top

The Bug

Water can't be frozen with Frost Walker if there is a block on top of it.

Expected Result

Water would be frozen with Frost Walker even if there is a block on top of it.

Code analysis

Code analysis by @unknown in this comment.

Linked issues

Attachments

Comments 13

From the minecraft wiki:

any still water blocks with air above within a radius of 2 + level around the block being moved to transforms into frosted ice

Seems like WAI

The minecraft wiki isn't a valid source for WAI

Can confirm in 20w51a.

Seems i confirmed. this issue is not intended. Can someone demonstrating the video?

Show them how it does like the reproducing.

Can confirm in 21w03a.

3 more comments

Affects 1.18.

Some analysis of the relevant code using Mojang mappings (net.minecraft.world.item.enchantment.FrostWalkerEnchantment.onEntityMoved()):

$$6 is initialised as a new MutableBlockPos

BlockPos.MutableBlockPos $$6 = new BlockPos.MutableBlockPos();

$$6 set to the position one block above the current block being checked

$$6.set($$7.getX(), $$7.getY() + 1, $$7.getZ());

$$8 is initialised as the block at position $$6

BlockState $$8 = $$1.getBlockState($$6);

The line below is a long guard clause.

if (
  !$$8.isAir() 
  || ($$9 = $$1.getBlockState($$7)).getMaterial() != Material.WATER
  || $$9.getValue(LiquidBlock.LEVEL) != 0
  || !$$4.canSurvive($$1, $$7)
  || !$$1.isUnobstructed($$4, $$7, CollisionContext.empty())
) continue;

The relevant expression is !$$8.isAir(), which will ignore the current block being checked if $$8 (the block above the one being checked) isn't air. (It then checks more things like if the block being checked it a water block, etc.)
In other words, the block will be ignored if there is not an air block above it. I'm assuming that this could be fixed by removing that expression from the if statement, but I haven't tested this.

Can confirm in 1.18.

Can confirm in 1.18.2.

Can confirm in 1.19.

Can confirm in 1.19.2.

Anton Aparin

(Unassigned)

Confirmed

Block states

20w21a, 20w51a, 21w03a, 1.16.5, 21w05b, ..., 1.19 Pre-release 1, 1.19, 1.19.2, 1.19.4, 23w16a

Retrieved