mojira.dev
MC-148559

Sleeping villagers have a very small hitbox

The bug

The hitbox of villagers and baby villagers is too small when they are in a bed.

How to reproduce

  1. Spawn a baby villager or a villager

  2. Place a bed near the villager

  3. Set the time to night

  4. Press F3+B to show hitboxes

  5. Look at the villager's hitbox once it is in bed

Examples

[media]

[media]

Linked issues

Attachments

Comments 19

still present in 20w16a

still present in 20w18a

still present in 20w19a

still present in 20w20a

still present in 20w22a

9 more comments

Can confirm in 1.19.

Can confirm in 1.19.2.

I thought this is where the bug comes from (decompiled 1.20.2 using vanilla mapping:

net.minecraft.world.entity.LivingEntity.class

protected static final EntityDimensions SLEEPING_DIMENSIONS = EntityDimensions.fixed(0.2F, 0.2F);

...

public EntityDimensions getDimensions(Pose $$0) {
    return ($$0 == Pose.SLEEPING) ? SLEEPING_DIMENSIONS : super.getDimensions($$0).scale(getScale());
}

and it affects MC-10919 as well.

No way that got added by accident.

himazinn_Japan

Can confirm in 1.21.4.

Георг

(Unassigned)

Confirmed

Gameplay

Low

Hitboxes

baby-villager, bed, hitbox, sleeping, villager

Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 4, 1.14.4, 1.15 Pre-Release 2, ..., 23w17a, 1.20.1, 1.20.2, 1.20.4, 1.21.4

Retrieved