Mojira Archive
MC-114728

Falling block can place directional block state at invalid position

The bug

Falling block entities can place directional block states at invalid positions. For example a lever attached to the ceiling is placed without ceiling.

How to reproduce

Use the following command while standing on a block a lever can be placed on, like for example stone

/summon falling_block ~ ~ ~ {Time:1,BlockState:{Name:"minecraft:lever"}}

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.entity.item.EntityFallingBlock.onUpdate() calls the method net.minecraft.world.World.mayPlace(Block, BlockPos, boolean, EnumFacing, Entity) always with EnumFacing.UP but places the stored block state which is not necessarily facing upwards.

This could maybe be solved by adding a general method boolean isStateValidForPosition(World world, IBlockState blockState, BlockPos position) since many blocks currently have a method similar to this anyways which is called when they are updated.

Cannot Reproduce

Marcono1234

2017-03-22, 10:07 PM

2020-06-04, 02:03 PM

2020-06-04, 02:03 PM

1

2

Confirmed

(Unassigned)

block, blockstate, button, directional, falling_block, lever, position

Minecraft 1.11.2 - Minecraft 18w50aMinecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.2, Minecraft 18w05a, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a

-