The Bug:
You cannot convert blocks into dirt paths when non-full blocks are above them.
Steps to Reproduce:
Build the setup as shown in the attachment below.
Obtain a shovel and attempt to turn all of the three grass blocks into dirt paths.
Take note as to whether or not you can convert blocks into dirt paths when non-full blocks are above them.
Observed Behavior:
You cannot convert blocks into dirt paths when non-full blocks are above them.
Expected Behavior:
You would be able to convert blocks into dirt paths when non-full blocks are above them.
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.ShovelItem.java
public class ShovelItem extends DiggerItem {
protected static final Map<Block, BlockState> FLATTENABLES = Maps.newHashMap((new Builder()).put(Blocks.GRASS_BLOCK, Blocks.DIRT_PATH.defaultBlockState()).put(Blocks.DIRT, Blocks.DIRT_PATH.defaultBlockState()).put(Blocks.PODZOL, Blocks.DIRT_PATH.defaultBlockState()).put(Blocks.COARSE_DIRT, Blocks.DIRT_PATH.defaultBlockState()).put(Blocks.MYCELIUM, Blocks.DIRT_PATH.defaultBlockState()).put(Blocks.ROOTED_DIRT, Blocks.DIRT_PATH.defaultBlockState()).build());
...
public InteractionResult useOn(UseOnContext $$0) {
Level level = $$0.getLevel();
BlockPos blockpos = $$0.getClickedPos();
BlockState blockstate = level.getBlockState(blockpos);
if ($$0.getClickedFace() == Direction.DOWN) {
return InteractionResult.PASS;
} else {
Player player = $$0.getPlayer();
BlockState blockstate1 = FLATTENABLES.get(blockstate.getBlock());
BlockState blockstate2 = null;
if (blockstate1 != null && level.getBlockState(blockpos.above()).isAir()) {
level.playSound(player, blockpos, SoundEvents.SHOVEL_FLATTEN, SoundSource.BLOCKS, 1.0F, 1.0F);
...
If we look at the above class, we can see that you can only convert blocks into dirt paths using shovels if air is above them. This is evident through the following line of code:
if (blockstate1 != null && level.getBlockState(blockpos.above()).isAir())
Linked issues
is duplicated by 7
relates to 2
Attachments
Comments


Confirmed for 1.10-pre1
Can confirm for MC 1.12.1

Confirmed in 1.16-pre5.

Related to MC-84731.
Can confirm for 20w46a.
Can confirm in 20w51a.
Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 21w07a.
Can confirm in 21w11a.
Can confirm in 21w17a.
Can confirm in 1.17.
Can confirm in 1.17.1.
Can confirm this behavior in 21w41a. Here are some extra details regarding this problem.
The Bug:
You cannot convert blocks into dirt paths when non-full blocks are above them.
Steps to Reproduce:
Build the setup as shown in the attachment below.
Obtain a shovel and attempt to turn all of the three grass blocks into dirt paths.
Take note as to whether or not you are able to convert blocks into dirt paths when non-full blocks are above them.
Observed Behavior:
You cannot convert blocks into dirt paths when non-full blocks are above them.
Expected Behavior:
You would be able to convert blocks into dirt paths when non-full blocks are above them.
Confirmed.