mojira.dev
MC-124320

Endermen can pick up and place snowless snowy grass blocks

The bug

Now that endermen copy block states exactly when picking up and placing blocks, they can grab and place snowy grass (and mycelium, podzol...). They appear with the strange top texture (MC-109531) and when placed, exist as an invalid block state (snowy, but with no snow on top).

Code analysis

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

Linked issues

MC-133420 Enderman Resolved MC-149947 Endermen can pick up snowy grass blocks Resolved MC-154782 Enderman transports grass block including snowy falg Resolved MC-160801 if an enderman picks up a snowy grass block the top of the block is gray Resolved MC-162251 Uncolored grass block Resolved

Attachments

Comments 16

A distinction should be made between block states that rely only on the block itself, such as the mode of a comparator, and block states that rely on blocks placed nearby in the world, such as a redstone lamp's powered state, fences' connections and grass' snowy state mentioned in this ticket.

Confirmed on 18w30b

Hold up, theirs a texture for the top of the snowy grass block?, learn new things every day and this is confirmed on 18w30b

This can be fixed by calling Block#getValidBlockForPosition for iblockstate2 in Enderman#AIPlaceBlock#updateTask() to place the correct BlockState.

From this:

IBlockState iblockstate2 = this.enderman.func_195405_dq();

To this:

IBlockState iblockstate2 = Block.getValidBlockForPosition(this.enderman.func_195405_dq(), this.enderman.world, blockpos);

Also to fix the block in the enderman's hands make the change in AITakeBlock in addition to swapping the order of these two lines:

if (block.isIn(BlockTags.ENDERMAN_HOLDABLE) && flag) {
    this.enderman.func_195406_b(iblockstate);
    world.setBlockToAir(blockpos);
}

To:

if (block.isIn(BlockTags.ENDERMAN_HOLDABLE) && flag) {
    world.setBlockToAir(blockpos);
    this.enderman.func_195406_b(Block.getValidBlockForPosition(iblockstate, this.enderman.world, blockpos));
}

Can confirm for 19w34a

6 more comments

I get this on 1.16 pre-release 5

I get this on 1.16 pre-7

I get this on 1.16 rc-1.

Please don't fix this. Make it a nice easter egg. That block state is impossible to get on survival, so having this makes that now possible. These blocks should be an unique generation with endermans.

tryashtar

Felix Jones

Confirmed

Block states, Mob behaviour

enderman, grass_block

Minecraft 18w02a, Minecraft 18w03b, Minecraft 18w11a, Minecraft 18w16a, Minecraft 1.13-pre1, ..., 1.16, 1.16.1, 20w27a, 20w29a, 1.16.2 Pre-release 1

1.16.2 Pre-release 2

Retrieved