Update by @unknown 9/6/2023:
The previous resolution of this report focused on villagers being "in" rain in the literal sense of being directly touched by rain, but that is not what players usually mean by "work in rain". The behavior that concerns players is that villagers do not work during rain. That is, villagers do not work while the biome they are in experiences rain, regardless of whether the villagers are literally "in" the rain. Even if villagers and their workstations are indoors in the same room, the villagers will not work while there is rain outside.
This issue has three impacts on gameplay:
Indoor/sheltered villagers cannot restock trades during rain/thunder weather.
Indoor/sheltered villages cannot spawn iron golems if they happen to be loaded on too many rainy days in a row.
Villagers continuously run around indoors as if they are running away from rain even when they are not being rained on. This looks unnatural.
Steps to reproduce
Load
. This world contains an underground village with 10 villagers, 8 workstations, and 20 beds. Weather cycle is off and the weather is set to rain, which can be observed at the upper NW corner of the chamber. Command blocks can be used to change the weather and refresh the day/night cycle.
Press the "Rain" button, then watch the villagers for a minute.
Press the "Thunder" button, then watch the villagers for a minute.
Press the "Sunshine button, then watch the villagers for a minute.
Expected results
The villagers work during rain or thunderstorms because both they and their workstations are "indoors" (not exposed to rain). Iron golems spawn.
Observed results
The villagers do not work during rainy or thundering weather, even though neither they nor their workstations are exposed to rain. They constantly run from place to place as if trying to get out of the rain despite being indoors. Iron golems do not spawn because the work requirement cannot be met. After the weather changes to clear and the villagers work again, iron golems spawn.
Code analysis
behavior.move_indoors
loops infinitely during rain or thunder weather, causing villagers to continuously run around indoors. While it is active it prevents behavior.work
from firing. Instead of looping infinitely, behavior.move_indoors
should check for whether the villager is already "indoors" at its current position, and if the villager is already indoors it should exit and allow other behaviors to fire.
According to previous versions, and the behavior pack files, Farmers, Fishermen and Librarians don't work in rain. However, it appears that none of the villagers are currently working in the rain. Tested with Armorers, Fletchers, Toolsmiths and Weaponsmiths which should all be fine.
Looking at villager_v2.json I did find:
"work_schedule_villager": {
"minecraft:behavior.work": {
"priority": 7,
"active_time": 250,
"speed_multiplier": 0.5,
"goal_cooldown": 200,
"sound_delay_min": 100,
"sound_delay_max": 200,
"can_work_in_rain": false,
"work_in_rain_tolerance": 100,
"on_arrival": {
"event": "minecraft:resupply_trades",
"target": "self"
}
}
},
What I find odd here, is that it seems to hit every villager where the 3 mentioned above have specific tags for this:
"work_schedule_fisher": {
"minecraft:behavior.work": {
"priority": 7,
"active_time": 250,
"speed_multiplier": 0.5,
"goal_cooldown": 200,
"sound_delay_min": 100,
"sound_delay_max": 200,
"can_work_in_rain": false,
"work_in_rain_tolerance": 100,
"on_arrival": {
"event": "minecraft:resupply_trades",
"target": "self"
}
}
},
There wasn't any changes in patch notes relating to this and at least before 1.16.210 (this is when I noticed the change) they were working during rain.
Replicate:
Link up any villager to a job station, set weather to rain. Will hear no working sounds for duration of rain (disable weather cycle to test)
Linked issues
relates to 3
Attachments
Comments 3
That's a curious case, because... Java has the villages working in the rain. So I guess it is a Java parity issue.
To add a little more information about this issue:
Villagers can restock in rain as long as they are near their workstation, because the restocking event gets triggered just based on distance from the workstation.
Villagers do not pathfind to their workstation during rain.
Villagers that restock in rain nevertheless do not get credit work "working" with regard to spawning iron golems, so rain can slow down or stop iron golem farms.
These distinctions need to be considered with respect to whether there is really a parity difference from Java. The impact of rain on iron golem spawning cannot be compared directly to Java, because on Java iron golem spawning does not require villagers to work at all. That's an underlying parity issue. (The 1.16 update removed the work requirement from Java at the same time it added to Bedrock).
Farmers and librarians have separate component groups for working so that they can harvest crops and inspect bookshelves. It's not clear why fishermen have a separate group, but see MCPE-122035.
I checked the villager_v2.json files back to 1.13 and the general work schedule has
"can_work_in_rain": false
, so the claim that only farmers, fishermen, and librarians can't work in rain appears to have been a misinterpretation.The documentation for
"can_work_in_rain"
says that it applies to the profession block, not the villager. I've also tested and found that if you set"can_work_in_rain": true,
, villagers still try to avoid being in rain themselves and end up running back and forth between their beds and their workstations when everything is open to the sky. I'm not sure if it's possible to get them to stop reacting to rain this way with a behavior pack; it looks to me like coding to adequately support that behavior option may not exist. Perhaps it was an unfinished idea? In any case, I suspect that no one working in rain is intended behavior.