-
Bug
-
Resolution: Unresolved
-
None
-
Minecraft 1.7.9, Minecraft 1.7.10-pre4, Minecraft 14w25b, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w45a, Minecraft 18w46a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c, 1.15.1, 1.16 Pre-release 3, 1.16.2, 1.16.4, 20w46a, 20w48a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w17a, 21w19a, 21w20a, 1.17 Pre-release 1, 1.17 Pre-release 3, 1.17 Pre-release 4, 1.17 Pre-release 5, 1.17 Release Candidate 1, 1.17 Release Candidate 2, 1.17, 1.17.1 Pre-release 1, 1.17.1 Pre-release 2, 1.17.1 Pre-release 3, 1.17.1 Release Candidate 1, 1.17.1, 21w38a, 21w39a, 21w41a, 21w42a, 21w43a, 1.18 Pre-release 1, 1.18 Pre-release 7, 1.18, 1.18.1, 22w03a, 22w05a, 22w06a, 22w07a, 1.18.2 Release Candidate 1, 1.18.2, 22w17a, 22w18a, 1.19, 1.19.1, 1.19.2, 22w43a, 1.19.3, 1.19.4, 1.20, 1.20.1, 23w51b, 24w11a, 1.21, 1.21.1, 1.21.3
-
Confirmed
-
Block states
-
Low
-
Gameplay
The Bug:
Ice with non-solid blocks below them doesn't create water when mined by players.
Steps to Reproduce:
- Place down some ice and ensure that there's air below it.
- Break the ice.
- Take note as to whether or not ice with non-solid blocks below them doesn't create water when mined by players.
Observed Behavior:
No water is created.
Expected Behavior:
Water would be created.
Code Analysis:
Code analysis by Avoma can be found below. An additional code analysis by TriWonder81 can be found in this comment.
The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.
public class IceBlock extends HalfTransparentBlock { ... public void playerDestroy(Level level, Player player, BlockPos blockPos, BlockState blockState, @Nullable BlockEntity blockEntity, ItemStack itemStack) { super.playerDestroy(level, player, blockPos, blockState, blockEntity, itemStack); if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemStack) == 0) { if (level.dimensionType().ultraWarm()) { level.removeBlock(blockPos, false); return; } Material material = level.getBlockState(blockPos.below()).getMaterial(); if (material.blocksMotion() || material.isLiquid()) { level.setBlockAndUpdate(blockPos, Blocks.WATER.defaultBlockState()); } } } ...
If we look at the above class, we can see that there are two checks that are carried out before allowing ice blocks to be converted into water upon being mined by players. One of these checks is to make sure that the player isn't holding an item enchanted with silk touch at the time of the interaction, and the other is to check if the material below the ice block blocks motion or is a liquid. Because of the material check that's in place here, when ice with non-solid blocks below them is mined by players, it doesn't create water, therefore resulting in this problem occurring.
Fix:
Simply removing the material check within this piece of code before allowing ice blocks to be converted into water upon being mined by players will resolve this problem.
...
Material material = level.getBlockState(blockPos.below()).getMaterial();
if (material.blocksMotion() || material.isLiquid()) {
level.setBlockAndUpdate(blockPos, Blocks.WATER.defaultBlockState());
}
...
... level.setBlockAndUpdate(blockPos, Blocks.WATER.defaultBlockState()); ...
- is duplicated by
-
MC-136926 When breaking ice with an air block under it it won't become an water source
- Resolved
-
MC-151010 ice won't turn to water when it's broken if there isn't a block under it.
- Resolved
-
MC-168618 ice placed on scaffolding dissappears when broken
- Resolved
-
MC-188533 Broken Ice Block Doesn't Create Water Source With Air Block Bellow
- Resolved
-
MC-267513 Ice does not melt into water when mined
- Resolved
- relates to
-
MC-206185 Breaking ice with kelp under it doesn't create water
- Open
-
MCPE-81670 Ice on top of air or scaffolding does not turn into water when broken
- Open