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
is duplicated by 1
Attachments
Comments 13
Seems i confirmed. this issue is not intended. Can someone demonstrating the video?
Show them how it does like the reproducing.
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.
From the minecraft wiki:
Seems like WAI