mojira.dev
MC-95469

Middle click / pick block on farmland gives dirt

The bug

When you middle click on farmland you get a dirt block despite the fact that farmland is an item as well.

How to reproduce

  1. Furrow a dirt block and middle click it
    You will get a dirt block

  2. Use the following command

    /give @p farmland

    You will have a farmland block

The reason

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The reason why this happens is because the net.minecraft.block.BlockFarmland.func_185473_a(World, BlockPos, IBlockState) method returns a dirt item stack.

public ItemStack func_185473_a(World worldIn, BlockPos pos, IBlockState state)
{
    // Replaced this
    //return new ItemStack(Blocks.dirt);
    return new ItemStack(Blocks.farmland);
}

Linked issues

Comments 3

[Mod] redstonehelper

Possibly WAI, though Grum's comment on MC-83729 indicates otherwise.

Confirmed for 1.9

[Mod] redstonehelper

Not fixed.

marcono1234

Agnes Larsson

Confirmed

dirt, farmland, item, middle-click, pick-block

Minecraft 15w51b, Minecraft 16w02a, Minecraft 1.9, Minecraft 1.9.4, Minecraft 1.10 Pre-Release 1, Minecraft 1.10.2

Minecraft 16w38a

Retrieved