Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-121902

Villagers do not work during rain/thunder weather even if they and their workstations are sheltered from the rain

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.16.210, 1.16.221 Hotfix, 1.17.41 Hotfix, 1.20.15 Hotfix
    • None
    • Confirmed
    • Windows
    • 518756

      Update by GoldenHelmet 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

      1. Load Villagers sheltered durin rain.mcworld. 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.
      2. Press the "Rain" button, then watch the villagers for a minute.
      3. Press the "Thunder" button, then watch the villagers for a minute.
      4. 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)

            Rayth Rayth
            Votes:
            15 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: