The Bug:
You cannot use hoes on blocks that are underwater.
Steps to Reproduce:
Obtain a hoe and right-click on a dirt block that is underwater.
Take note as to whether or not you can use hoes on blocks that are underwater.
Observed Behavior:
You cannot use hoes on blocks that are underwater.
Expected Behavior:
You would be able to use hoes on blocks that are underwater.
Code Analysis:
Code analysis by @unknown can be found below.
The following is based on a decompiled version of Minecraft 1.18 using MCP-Reborn.
net.minecraft.world.item.HoeItem.java
public class HoeItem extends DiggerItem {
protected static final Map<Block, Pair<Predicate<UseOnContext>, Consumer<UseOnContext>>> TILLABLES = Maps.newHashMap(ImmutableMap.of(Blocks.GRASS_BLOCK, Pair.of(HoeItem::onlyIfAirAbove, changeIntoState(Blocks.FARMLAND.defaultBlockState())), Blocks.DIRT_PATH, Pair.of(HoeItem::onlyIfAirAbove, changeIntoState(Blocks.FARMLAND.defaultBlockState())), Blocks.DIRT, Pair.of(HoeItem::onlyIfAirAbove, changeIntoState(Blocks.FARMLAND.defaultBlockState())), Blocks.COARSE_DIRT, Pair.of(HoeItem::onlyIfAirAbove, changeIntoState(Blocks.DIRT.defaultBlockState())), Blocks.ROOTED_DIRT, Pair.of(($$0) -> {
return true;
}, changeIntoStateAndDropItem(Blocks.DIRT.defaultBlockState(), Items.HANGING_ROOTS))));
...
public static boolean onlyIfAirAbove(UseOnContext $$1) {
return $$1.getClickedFace() != Direction.DOWN && $$1.getLevel().getBlockState($$1.getClickedPos().above()).isAir();
}
}
If we look at the above class, we can see that you can only till blocks using hoes if air is above them. This is evident through the following line of code:
HoeItem::onlyIfAirAbove
Linked issues
is duplicated by 1
relates to 2
Attachments
Comments 3
You shouldn't be able to anyways...

Relates to MC-103899.
I can confirm, duplicates/relates to MC-85237. Also affects the shovel.