Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-85237

You cannot convert blocks into dirt paths when non-full blocks are above them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 15w32a, Minecraft 15w45a, Minecraft 1.9.4, Minecraft 1.10 Pre-Release 1, Minecraft 1.10.2, Minecraft 16w32b, Minecraft 16w38a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w15a, Minecraft 17w16b, Minecraft 17w17b, Minecraft 17w18b, Minecraft 1.12 Pre-Release 2, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 19w04b, Minecraft 19w05a, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, 1.16 Pre-release 5, 1.16.2 Pre-release 2, 1.16.2 Release Candidate 1, 1.16.2, 1.16.3, 1.16.4, 20w46a, 20w51a, 21w03a, 21w05b, 21w06a, 21w07a, 21w11a, 21w17a, 1.17 Pre-release 2, 1.17, 1.17.1, 21w41a, 21w43a, 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, 1.20.4, 23w51b, 1.20.6, 24w19b, 1.21, 1.21.1, 1.21.2 Pre-Release 3, 1.21.3
    • None
    • Confirmed
    • Block states
    • Low
    • Gameplay

      The Bug:

      You cannot convert blocks into dirt paths when non-full blocks are above them.

      Steps to Reproduce:

      1. Build the setup as shown in the attachment below. setup.png
      2. Obtain a shovel and attempt to turn all of the three grass blocks into dirt paths.
      3. 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 Avoma 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())

        1. 2015-08-06_08.07.46.png
          2015-08-06_08.07.46.png
          166 kB
        2. MC-85237.mp4
          4.72 MB
        3. MC-85237.png
          MC-85237.png
          938 kB
        4. setup.png
          setup.png
          792 kB

            Unassigned Unassigned
            Avoma [Mod] Avoma
            Votes:
            23 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              CHK: