-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.21.1] Cancelled villager breeding causes beds to be wrongly occupied #1606
Comments
Confirmed on 21.4.38-beta. The simple fix, which seems to work, is to modify A remaining question, however, is what to do with the parent's ages (which controls when they're allowed to breed again) if the villager child is blocked from spawning. I'm assuming that what we want is to have the parents still have their age increased (for the 5-minute cooldown between breeding attempts), but that might be up for debate. |
Hello, thank you for opening a PR addressing this issue! |
Welcome! On your point of looking into other animals for this kind of fix, I think this particular fix only applies to villagers because of use of a bed POI for the child. The other mobs, which are various animals, use |
Minecraft Version: 1.21.1
NeoForge Version: 21.1.68
Steps to Reproduce:
FinalizeSpawnEvent
, and cancels it & callssetSpawnCancelled
on the event if the entity in the event is aVillager
, theMobSpawnType
isBREEDING
and the gametime is <24000 ticks (or any other arbitrary condition)Description of issue:
When villager breeding is stopped through canceling the
FinalizeSpawnEvent
of the baby villager spawning, the relevant code in theVillagerMakeLove
class does not account for the baby villager not actually being in the world and requests the one free bed in range to be reserved for the baby villager, even though the baby is not in the world. This lock of the bed POI (which can also happen repeatedly with multiple beds, if multiple free ones are pathfindable) will then prevent villagers from mating even if the relevantFinalizeSpawnEvent
is no longer cancelled, due to the vanilla villager breeding logic not finding a free bed in range (even though at least one of the beds never had a villager sleeping in it, but was falsely marked as occupied by the cancelled first breeding process).This can be fixed by breaking + replacing the wrongly occupied beds, however it is still an annoyance having to do that, since beds that will never be slept in should also logically allow villager breeding (everything else would be unintuitive).
The text was updated successfully, but these errors were encountered: