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

Mycelium and podzol cannot be tilled with hoes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w03a, Snapshot 13w04a, 1.15.2, 20w08a, 20w13b, 20w14a, 20w15a, 20w16a, 20w17a, 20w18a, 20w19a, 20w20b, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 4, 1.16 Pre-release 5, 1.16 Pre-release 7, 1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 2, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w15a, 21w16a, 21w17a, 21w18a, 21w19a, 21w20a, 1.17 Release Candidate 2, 1.17, 1.17.1, 21w40a, 21w41a, 21w42a, 21w44a, 1.18 Pre-release 1, 1.18 Release Candidate 3, 1.18, 1.18.1, 22w03a, 22w05a, 22w07a, 1.18.2 Release Candidate 1, 1.18.2, 22w12a, 22w14a, 1.19 Pre-release 1, 1.19 Release Candidate 2, 1.19, 1.19.1, 1.19.2, 22w43a, 1.19.3, 1.19.4, 1.20, 1.20.1, 23w33a, 24w11a
    • Confirmed
    • Block states, Items
    • Normal
    • Gameplay

      The Bug:

      Mycelium and podzol cannot be tilled with hoes.

      Steps to Reproduce:

      1. Build the setup as shown in the attachment below. setup.png
      2. Obtain a hoe and use it on all six blocks.
      3. Take note as to what blocks you can use the hoe on and what blocks you can't.

      Observed Behavior:

      Mycelium and podzol cannot be tilled with hoes.

      Expected Behavior:

      Mycelium and podzol would be able to be tilled with hoes.

      Code Analysis:

      Code analysis by Avoma can be found below.

      The following is based on a decompiled version of Minecraft 1.18.1 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))));
         ...

      If we look at the above class, we can see that you can only use hoes on grass blocks, dirt paths, dirt, coarse dirt, and rooted dirt. Both mycelium and podzol aren't included within this particular piece of code, resulting in this problem occurring.

      Potential Fix:

      Simply adding that mycelium and podzol can be tilled with hoes to this piece of code should resolve this problem. The correct line of code within its class should look something like the following:

      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.MYCELIUM, Pair.of(HoeItem::onlyIfAirAbove, changeIntoState(Blocks.FARMLAND.defaultBlockState())), Blocks.PODZOL, 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))));
         ...

        1. MC-8231.mp4
          2.99 MB
        2. setup.png
          setup.png
          591 kB
        3. tilling grasslike blocks.png
          tilling grasslike blocks.png
          239 kB

            Unassigned Unassigned
            Avoma [Mod] Avoma
            Votes:
            30 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              CHK: