mojira.dev
MC-146825

Red and brown mushrooms can't be placed on top slabs or stairs

Summary:
I can't place red or brown mushrooms on the top slab or stair, despite the fact that it is a suitable surface for their growth.

Code analysis:
Code analysis by @unknown can be found in this comment.

Attachments

Comments 15

probably intended feature 

I don't think this is intended. Most other things like torches only require to be placed on top of a solid face. The same should be true for mushrooms as well.

Can confirm in 20w51a.

Can confirm in 21w05b.

Can confirm in 21w06a.

5 more comments

Can confirm in 1.19.

Can confirm in 1.19.2.

Can confirm in 23w31a.

Code Analysis:

(Decompiled with MCP)
Currently, the applicable blocks for placement are ones that are "isSolidRender" (Full cube blocks)

protected boolean mayPlaceOn(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
      return blockState.isSolidRender(blockGetter, blockPos);
   }

Possible Fix:

One fix for this, is to use "isFaceSturdy" instead, which only checks for a certain face of the block being applicable for placement (In this case, the top face).

protected boolean mayPlaceOn(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
      return blockState.isFaceSturdy(blockGetter, blockPos, Direction.UP);
   }

This provides the following behavior:

[media]

Can confirm in 1.20.6 and 1.21 Release Candidate 1.

Gravinser

(Unassigned)

Confirmed

Gameplay

Low

Block states

mushroom, placement-and-support

Minecraft 1.13.2, Minecraft 19w12b, Minecraft 19w13a, Minecraft 19w13b, Minecraft 19w14a, ..., 1.20.1, 23w31a, 1.20.4, 1.21, 1.21.4

Retrieved