mojira.dev
MC-120480

Pets teleport onto blocks which have a solid "bottom", not "top" face

Pet will teleport onto lower-half-slab.
They will not teleport onto upper-half slab.
It is weird.

Blocks they will teleport onto:

  • Carpet

  • Daylight sensor

  • Enchantment table

  • End portal flame

  • Farm land

  • Grass path

  • Half slab

  • Snow layer

  • Normal stairs

  • Bottom trap door

  • Bed

  • Plants

  • Stairs

  • Rails

  • Pressure plates

  • Ice

  • Buttons

  • Redstone wire

  • Torch

  • Tripwire hooks

  • Doors

  • Banners

  • Flower pot

  • Lever

Linked issues

Comments 8

My suggestion to fix this bug here.
I use decompiled version of minecraft by mcp940 for MC 1.12.

The cause is the mothod func_192381_a in class EntityAIFollowOwner.
I think "EnumFacing.DOWN" should be "Enum.Facing.UP" in the final line.

protected boolean func_192381_a(int p_192381_1_, int p_192381_2_, int p_192381_3_, int p_192381_4_, int p_192381_5_)
{
    BlockPos blockpos = new BlockPos(p_192381_1_ + p_192381_4_, p_192381_3_ - 1, p_192381_2_ + p_192381_5_);
    IBlockState iblockstate = this.theWorld.getBlockState(blockpos);
    return iblockstate.func_193401_d(this.theWorld, blockpos, EnumFacing.DOWN) == BlockFaceShape.SOLID && iblockstate.canEntitySpawn(this.thePet) && this.theWorld.isAirBlock(blockpos.up()) && this.theWorld.isAirBlock(blockpos.up(2));
}

This causes pet suffocation bug in shulker box, though it is really rare case.
Should I make another issue page for it?

No, I think that it's probably best to put that in this issue as well (since changing this would also fix that). I'm assuming that the suffocation is because the shulker box continues above the top of a normal block, but pets would only teleport up 1 block (or something like that)?

(Side note: if you want to set up MCP for 1.12.1, here are some instructions I wrote a bit ago)

Confirmed 1.13-pre1

Couldn't replicate shulkers in 1.12 / 1.12.1 / 1.12.2

Still in 1.14.1 Release

Still in 1.14.2 Pre-Release 1 and 1.14.2 Pre-Release 2

kyaco

migrated

Confirmed

Block states, Mob behaviour

ocelot, pet, teleport, wolf

Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w20c, Minecraft 1.13-pre1, Minecraft 1.13-pre2, ..., 19w36a, 19w37a, 19w38b, 19w39a, 19w40a

19w41a

Retrieved