If an enderman is given any tall flowers with commands, the flower will break immediately when placed.
What I expected to happen was...:
The tall flower being places as a player would place it, placing two blocks.
What actually happened was...:
No flower was placed.
Reproduction steps:
Summon an enderman with
summon enderman ~ ~ ~ {carriedBlockState:{Name:"minecraft:sunflower"}}
Spectate it
Wait until it places the sunflower
See that while the sunflower is removed from his hands, it doesn't get placed anywhere in the world
Code analysis
EnderMan.EndermanLeaveBlockGoal.tick runs
level.setBlock(blockPos, blockState3, 3);
this.enderman.setCarriedBlock(null);
without running Block.setPlacedBy, which causes the block to not update correctly.
It can be fixed by adding
this.enderman.getCarriedBlock().getBlock().setPlacedBy(level, blockPos, this.enderman.getCarriedBlock(), this.enderman, this.enderman.getCarriedBlock().getBlock().asItem());
before doing
this.enderman.setCarriedBlock(null);
Same as MC-183054
Mwahaha the evil agenda will be fulfilled!!