{
  "minecraft:entity" : {
    "format_version" : 0.1,
    "events" : {
      "become_zombie" : {
        "add" : {
          "component_groups" : [
            "become_zombie"
          ]
        }
      },
      "minecraft:entity_spawned" : {
        "sequence" : [
          {
            "randomize" : [
              {
                "add" : {
                  "component_groups" : [
                    "baby"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "adult"
                  ]
                },
                "weight" : 95
              }
            ]
          },
          {
            "randomize" : [
              {
                "add" : {
                  "component_groups" : [
                    "farmer",
                    "behavior_peasant"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "fisherman",
                    "behavior_peasant"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "shepherd",
                    "behavior_peasant"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "fletcher",
                    "behavior_peasant"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "librarian",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 20
              },
              {
                "add" : {
                  "component_groups" : [
                    "cleric",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 20
              },
              {
                "add" : {
                  "component_groups" : [
                    "armorer",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 6
              },
              {
                "add" : {
                  "component_groups" : [
                    "weaponsmith",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 6
              },
              {
                "add" : {
                  "component_groups" : [
                    "toolsmith",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 6
              },
              {
                "add" : {
                  "component_groups" : [
                    "butcher",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 10
              },
              {
                "add" : {
                  "component_groups" : [
                    "leatherworker",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 10
              }
            ]
          }
        ]
      },
      "become_witch" : {
        "add" : {
          "component_groups" : [
            "become_witch"
          ]
        }
      },
      "minecraft:entity_transformed" : {
        "sequence" : [
          {
            "add" : {
              "component_groups" : [
                "baby"
              ]
            },
            "filters" : {
              "other_with_components" : "is_baby"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "adult"
              ]
            },
            "filters" : {
              "other_without_components" : "is_baby"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "farmer",
                "behavior_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "farmer"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "fisherman",
                "behavior_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "fisherman"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "shepherd",
                "behavior_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "shepherd"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "fletcher",
                "behavior_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "fletcher"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "librarian",
                "behavior_non_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "librarian"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "cleric",
                "behavior_non_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "cleric"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "armorer",
                "behavior_non_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "armorer"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "weaponsmith",
                "behavior_non_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "weaponsmith"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "toolsmith",
                "behavior_non_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "toolsmith"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "butcher",
                "behavior_non_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "butcher"
            }
          },
          {
            "add" : {
              "component_groups" : [
                "leatherworker",
                "behavior_non_peasant"
              ]
            },
            "filters" : {
              "other_with_families" : "leatherworker"
            }
          }
        ]
      },
      "minecraft:entity_born" : {
        "sequence" : [
          {
            "add" : {
              "component_groups" : [
                "baby"
              ]
            }
          },
          {
            "randomize" : [
              {
                "add" : {
                  "component_groups" : [
                    "farmer",
                    "behavior_peasant"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "fisherman",
                    "behavior_peasant"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "shepherd",
                    "behavior_peasant"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "fletcher",
                    "behavior_peasant"
                  ]
                },
                "weight" : 5
              },
              {
                "add" : {
                  "component_groups" : [
                    "librarian",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 20
              },
              {
                "add" : {
                  "component_groups" : [
                    "cleric",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 20
              },
              {
                "add" : {
                  "component_groups" : [
                    "armorer",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 6
              },
              {
                "add" : {
                  "component_groups" : [
                    "weaponsmith",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 6
              },
              {
                "add" : {
                  "component_groups" : [
                    "toolsmith",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 6
              },
              {
                "add" : {
                  "component_groups" : [
                    "butcher",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 10
              },
              {
                "add" : {
                  "component_groups" : [
                    "leatherworker",
                    "behavior_non_peasant"
                  ]
                },
                "weight" : 10
              }
            ]
          }
        ]
      },
      "minecraft:ageable_grow_up" : {
        "sequence" : [
          {
            "add" : {
              "component_groups" : [
                "adult"
              ]
            },
            "remove" : {
              "component_groups" : [
                "baby"
              ]
            }
          }
        ]
      }
    },
    "components" : {
      "minecraft:identifier" : {
        "id" : "minecraft:villager"
      },
      "minecraft:behavior.move_towards_restriction" : {
        "priority" : 5,
        "speed_multiplier" : 0.6
      },
      "minecraft:nameable" : {

      },
      "minecraft:behavior.float" : {
        "priority" : 0
      },
      "minecraft:behavior.pickup_items" : {
        "priority" : 7,
        "items" : [
          "minecraft:bread",
          "minecraft:carrots",
          "minecraft:potatoes",
          "minecraft:wheat",
          "minecraft:beetroot",
          "minecraft:beetroot_seeds"
        ]
      },
      "minecraft:type_family" : {
        "family" : [
          "villager"
        ]
      },
      "minecraft:damage_sensor" : [
        {
          "deals_damage" : false,
          "on_damage" : {
            "filters" : {
              "other_with_families" : "lightning"
            },
            "event" : "become_witch"
          }
        },
        {
          "on_damage" : {
            "filters" : {
              "other_with_families" : "zombie",
              "with_damage_fatal" : true
            },
            "event" : "become_zombie"
          }
        }
      ],
      "minecraft:collision_box" : {
        "width" : 0.6,
        "height" : 1.8
      },
      "minecraft:behavior:panic" : {
        "priority" : 1
      },
      "minecraft:behavior.move_indoors" : {
        "priority" : 2,
        "speed_multiplier" : 0.8
      },
      "minecraft:behavior.open_door" : {
        "priority" : 4,
        "close_door_after" : true
      },
      "minecraft:inventory" : {
        "inventory_size" : 8
      },
      "minecraft:behavior.random_stroll" : {
        "priority" : 9,
        "speed_multiplier" : 0.6
      },
      "minecraft:behavior.look_at_player" : {
        "priority" : 10,
        "look_distance" : 8,
        "probability" : 0.02
      },
      "minecraft:movement" : {
        "max" : 0.5,
        "value" : 0.5
      },
      "minecraft:behavior.restrict_open_door" : {
        "priority" : 3
      },
      "minecraft:health" : {
        "max" : 20,
        "value" : 20
      },
      "minecraft:scale" : {
        "value" : 0.4
      },
      "minecraft:behavior:avoid_mob_type" : {
        "priority" : 1,
        "avoid_types" : [
          "minecraft:zombie",
          "minecraft:zombie_villager",
          "minecraft:pig_zombie"
        ],
        "max_dist" : 8,
        "sprint_speed_multiplier" : 0.6,
        "walk_speed_multiplier" : 0.6
      }
    },
    "component_groups" : {
      "fisherman" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "peasant",
            "fisherman"
          ]
        },
        "minecraft:variant" : {
          "value" : 0
        }
      },
      "librarian" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "librarian"
          ]
        },
        "minecraft:variant" : {
          "value" : 1
        }
      },
      "butcher" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "artisan",
            "butcher"
          ]
        },
        "minecraft:variant" : {
          "value" : 4
        }
      },
      "farmer" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "peasant",
            "farmer"
          ]
        },
        "minecraft:variant" : {
          "value" : 0
        }
      },
      "shepherd" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "peasant",
            "shepherd"
          ]
        },
        "minecraft:variant" : {
          "value" : 0
        }
      },
      "toolsmith" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "blacksmith",
            "toolsmith"
          ]
        },
        "minecraft:variant" : {
          "value" : 3
        }
      },
      "fletcher" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "peasant",
            "fletcher"
          ]
        },
        "minecraft:variant" : {
          "value" : 0
        }
      },
      "become_zombie" : {
        "minecraft:transformation" : {
          "into" : "minecraft:zombie_villager"
        }
      },
      "weaponsmith" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "blacksmith",
            "weaponsmith"
          ]
        },
        "minecraft:variant" : {
          "value" : 3
        }
      },
      "leatherworker" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "artisan",
            "leatherworker"
          ]
        },
        "minecraft:variant" : {
          "value" : 4
        }
      },
      "behavior_peasant" : {
        "minecraft:behavior.share_items" : {
          "priority" : 8,
          "target_entity_items" : [
            {
              "item" : "minecraft:bread",
              "max_count" : 3
            },
            {
              "item" : "minecraft:carrot",
              "max_count" : 12
            },
            {
              "item" : "minecraft:potato",
              "max_count" : 12
            },
            {
              "item" : "minecraft:beetroot",
              "max_count" : 12
            }
          ],
          "filters" : {
            "other_with_families" : "villager"
          },
          "items_filter" : [
            {
              "item" : "minecraft:bread",
              "min_count" : 6
            },
            {
              "item" : "minecraft:carrot",
              "min_count" : 24
            },
            {
              "item" : "minecraft:potato",
              "min_count" : 24
            },
            {
              "item" : "minecraft:beetroot",
              "min_count" : 24
            },
            {
              "item" : "minecraft:wheat",
              "min_count" : 18,
              "craft_into" : "minecraft:bread"
            }
          ]
        },
        "minecraft:behavior.harvest_farm_block" : {
          "priority" : 6,
          "speed_multiplier" : 0.32
        }
      },
      "adult" : {
        "minecraft:behavior.receive_love" : {
          "priority" : 7
        },
        "minecraft:behavior.make_love" : {
          "priority" : 6
        }
      },
      "become_witch" : {
        "minecraft:transformation" : {
          "into" : "minecraft:witch",
          "delay" : 0.5
        }
      },
      "behavior_non_peasant" : {
        "minecraft:behavior.share_items" : {
          "priority" : 8,
          "target_entity_items" : [
            {
              "item" : "minecraft:bread",
              "max_count" : 3
            },
            {
              "item" : "minecraft:carrot",
              "max_count" : 12
            },
            {
              "item" : "minecraft:potato",
              "max_count" : 12
            },
            {
              "item" : "minecraft:beetroot",
              "max_count" : 12
            }
          ],
          "filters" : {
            "other_with_families" : "villager"
          },
          "items_filter" : [
            {
              "item" : "minecraft:bread",
              "min_count" : 6
            },
            {
              "item" : "minecraft:carrot",
              "min_count" : 24
            },
            {
              "item" : "minecraft:potato",
              "min_count" : 24
            },
            {
              "item" : "minecraft:beetroot",
              "min_count" : 24
            }
          ]
        }
      },
      "cleric" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "priest",
            "cleric"
          ]
        },
        "minecraft:variant" : {
          "value" : 2
        }
      },
      "armorer" : {
        "minecraft:type_family" : {
          "family" : [
            "villager",
            "blacksmith",
            "armorer"
          ]
        },
        "minecraft:variant" : {
          "value" : 3
        }
      },
      "baby" : {
        "minecraft:behavior.take_flower" : {
          "priority" : 7
        },
        "minecraft:is_baby" : {

        },
        "minecraft:scale" : {
          "value" : 0.5
        },
        "minecraft:behavior.play" : {
          "priority" : 8,
          "speed_multiplier" : 0.32
        },
        "minecraft:ageable" : {
          "threshold" : 1200,
          "event" : {
            "target" : "self",
            "type" : "minecraft:ageable_grow_up"
          }
        }
      }
    }
  }
}