mojira.dev
MC-183054

Enderman-placed wither skulls can't summon the wither/other missing block updates

The bug

Although enderman can place pumpkins on top of snow to create snow golems, the same cannot be done for wither skulls to summon the wither. For the same reason, repeaters/comparators don't update their power state when placed.

How to reproduce

1. Download the provided world. It adds wither_skeleton_skull to the enderman_holdable block tag, allowing endermen to pick it up. It adds air to the wither_summon_base_blocks block tag, allowing the wither to spawn almost anywhere.
2. Place a wither skeleton skull manually next to one of the many piles
→ ✔ The wither spawns and is immediately killed by the running command block
3. Wait for an enderman to place down the skull it's holding
→ ❌ No wither is spawned

Code analysis

EnderMan.EndermanLeaveBlockGoal.tick runs

level.setBlock(blockPos, blockState3, 3);
this.enderman.setCarriedBlock(null);

without running Block.setPlacedBy, which some blocks rely on to be placed correctly.

It can be fixed by adding

this.enderman.getCarriedBlock().getBlock().setPlacedBy(level, blockPos, this.enderman.getCarriedBlock(), this.enderman, this.enderman.getCarriedBlock().getBlock().asItem());

between the two above lines.

😇 There is definitely no nefarious mapmaking agenda in this bug report!

Linked issues

Attachments

Comments 12

You can add to the issue the fact that tall flowers, doors and beds break, instead of placing as they normally should. You can also add the line of code I posted on my duplicate which fixes this bug

There is an empty title of "Analysis" above "Code analysis"

2 more comments

Can confirm in 22w15a with the provided world.

I don't think villagers call setPlacedBy when placing their crops either, though I suppose in that instance it wouldn't do anything.

Can confirm in 1.20.6 and especially in 24w21b.

tryashtar

(Unassigned)

Confirmed

Gameplay

Low

Commands, Mob behaviour

block-update, enderman

1.15.2, 20w19a, 1.16.1, 1.16.4, 20w51a, ..., 21w05a, 1.18.1, 22w15a, 1.20.6, 24w21b

Retrieved