mojira.dev
MCPE-168809

Villagers use inconsistent amounts of food when breeding

Steps to reproduce

  1. Make two small chambers with 2-block high walls.

  2. Place 4 beds in each chamber.

  3. Spawn 2 villagers in each chamber.

  4. In chamber 1, give one villager 24 carrots and the other villager 0 carrots.

  5. In chamber 2, give each villager 12 carrots.

  6. Stand back and wait a while.

Expected result

Villagers in each chamber produce the same number of babies. (I am not sure if it should be 1 or 2.)

Observed result

The villagers in chamber 1 produce 2 babies. The villagers in chamber 2 produce 1 baby.

Linked issues

Comments 2

The logic here seems to be that breeding requires 12 carrots minimum, but when breeding each villager consumes 12 carrots if they have them.

I would guess that the intended behavior is for each villager to use 12 carrots to breed (that is what the wiki says, at any rate), and the bug is that minecraft:behavior.receive_love only decrements carrots by 12 and does not first check whether the villager actually has 12.

Mutatis mutandis for other food items.

Confirmed. In fact, my experiments show that two villagers can make love if one of them only has 12 carrots and the other has no food at all.

Apparently, a villager must have sufficient food before it can execute the make_love behavior, but can execute the receive_love behavior even if it has no food at all. If it does have food, it will consume as much as it has up to 12 carrots (or equivalent) if a baby is born.

If this is not the intended behavior, then the bug must be that the receive_love behavior is not conditioned on having enough food first.

GoldenHelmet

(Unassigned)

1086804

Confirmed

Multiple

1.19.71, 1.19.81 Hotfix, 1.20.12 Hotfix, 1.21.43 Hotfix

Retrieved