Endermen place carried blocks where the block cannot survive
Summary
Endermen can place a carried block on any solid full cube other than bedrock without checking the carried block's own placement rule. This allows impossible placements such as a dandelion on stone.
Current behavior
PlaceBlockGoal::tick checks that the target is air, the block below is a solid full cube and not bedrock, and the target has no entity. It then directly installs the carried state:
// TODO: also check the carried block can survive there.
world_clone.set_block_state(&target_pos, block_state_id, BlockFlags::NOTIFY_ALL);Because the carried block's can_place_at behavior is never called, support-sensitive blocks on the enderman-holdable list can be placed on invalid supports.
Vanilla behavior
Vanilla requires both a suitable target/support and that the carried state can be placed at the target. The Enderman behavior documentation describes this as the block being generally allowed to be placed at that location.
References:
- https://minecraft.wiki/w/Enderman
- https://maven.fabricmc.net/docs/yarn-23w31a+build.2/net/minecraft/entity/mob/EndermanEntity.PlaceBlockGoal.html
Reproduction
- Give or arrange for an enderman to carry a support-sensitive holdable block such as a dandelion.
- Provide an air target above a solid full block that is not valid support, such as stone.
- Let the place-block goal run.
Pumpkin can place the dandelion on stone. Vanilla's placement predicate rejects that location.
Suggested fix
Before setting the state, invoke the carried block behavior's placement-survival check at the target using the carried state. Add coverage for a dandelion above stone (rejected), a dandelion above valid soil (accepted), and an ordinary carried full block above valid support.
Verified against current master at 1ac447f2918b7dec7d19a5836fa3673d4fe3c9f5; the connected issue list and targeted title search found no existing enderman carried-block placement-survival report.
Source: Pumpkin-MC/Pumpkin