iron_golem

{
  "format_version": "1.18.10",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:iron_golem",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false
    },

    "component_groups": {
      "minecraft:player_created": {
        "minecraft:behavior.hurt_by_target": {
          "priority": 2,
          "entity_types": {
            "filters": { 
                "all_of": [
                  { "test" :  "is_family", "subject" : "other", "operator": "!=", "value" :  "player"},
                  { "test" :  "is_family", "subject" : "other", "operator": "!=", "value" :  "creeper"}
                ] 
            }
          }
        }
      },
      "minecraft:village_created": {
        "minecraft:behavior.defend_village_target": {
          "priority": 1,
          "must_reach": true,
          "attack_chance": 0.05,
          "entity_types": {
            "filters": {
              "any_of": [
                { "test": "is_family", "subject": "other", "value": "mob" },
                { "test": "is_family", "subject": "other", "value": "player" }
              ] 
            }
          }
        },
        "minecraft:dweller": {
          "dwelling_type": "village",
          "dweller_role": "defender",
          "update_interval_base": 60,
          "update_interval_variant": 40,
          "can_find_poi": false,
          "can_migrate": true,
          "first_founding_reward": 0
        }
      }
    },

    "components": {
      "minecraft:is_hidden_when_invisible": {
      },
      "minecraft:type_family": {
        "family": [ "irongolem", "mob" ]
      },
      "minecraft:nameable": {
      },
      "minecraft:collision_box": {
        "width": 1.4,
        "height": 2.9
      },
      "minecraft:loot": {
        "table": "loot_tables/entities/iron_golem.json"
      },
      "minecraft:health": {
        "value": 100,
        "max": 100
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:navigation.walk": {
        "can_path_over_water": false,
        "avoid_water": true,
        "avoid_damage_blocks": true
      },
      "minecraft:movement.basic": {
        
      },
      "minecraft:jump.static": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:interact": {
        "interactions": [
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "player"
                  },
                  {
                    "test": "has_equipment",
                    "domain": "hand",
                    "subject": "other",
                    "value": "iron_ingot"
                  },
                  {
                    "test": "is_missing_health",
                    "value": true
                  }
                ]
              }
            },
            "use_item": true,
            "health_amount": 25,
            "play_sounds": "irongolem.repair",
            "interact_text": "action.interact.repair"
          }
        ]
      },
      "minecraft:attack": {
        "damage": {
          "range_min": 7,
          "range_max": 21
        }
      },
      "minecraft:damage_sensor": {
        "triggers": {
          "cause": "fall",
          "deals_damage": false
        }
      },
      "minecraft:knockback_resistance": {
        "value": 1.0
      },
      "minecraft:leashable": {
        "soft_distance": 4.0,
        "hard_distance": 6.0,
        "max_distance": 10.0
      },
      "minecraft:balloonable": {
        "mass": 2.0
      },
      "minecraft:preferred_path": {
        "max_fall_blocks": 1,
        "jump_cost": 5,
        "default_block_cost": 1.5,
        "preferred_path_blocks": [
          {
            "cost": 0,
            "blocks": [
              "grass_path"
            ]
          },
          {
            "cost": 1,
            "blocks": [
              "cobblestone",
              "stone",
              "stonebrick",
              "sandstone",
              "mossy_cobblestone",
              "stone_slab",
              "stone_slab2",
              "stone_slab3",
              "stone_slab4",
              "double_stone_slab",
              "double_stone_slab2",
              "double_stone_slab3",
              "double_stone_slab4",
              "wooden_slab",
              "double_wooden_slab",
              "planks",
              "brick_block",
              "nether_brick",
              "red_nether_brick",
              "end_bricks",
              "red_sandstone",
              "stained_glass",
              "glass",
              "glowstone",
              "prismarine",
              "emerald_block",
              "diamond_block",
              "lapis_block",
              "gold_block",
              "redstone_block",
              "purple_glazed_terracotta",
              "white_glazed_terracotta",
              "orange_glazed_terracotta",
              "magenta_glazed_terracotta",
              "light_blue_glazed_terracotta",
              "yellow_glazed_terracotta",
              "lime_glazed_terracotta",
              "pink_glazed_terracotta",
              "gray_glazed_terracotta",
              "silver_glazed_terracotta",
              "cyan_glazed_terracotta",
              "blue_glazed_terracotta",
              "brown_glazed_terracotta",
              "green_glazed_terracotta",
              "red_glazed_terracotta",
              "black_glazed_terracotta"
            ]
          },
          {
            "cost": 50,
            "blocks": [
              "bed",
              "lectern",
              "composter",
              "grindstone",
              "blast_furnace",
              "smoker",
              "fletching_table",
              "cartography_table",
              "brewing_stand",
              "smithing_table",
              "cauldron",
              "barrel",
              "loom",
              "stonecutter"
            ]
          }
        ]
      },
      "minecraft:behavior.target_when_pushed": {
        "priority": 1,
        "percent_chance": 5.0,
        "entity_types": [
          {
            "filters": {
              "all_of": [
                { "test" :  "is_family", "subject" : "other", "value" :  "monster" },
                { "test" :  "is_family", "subject" : "other", "operator": "!=", "value" :  "creeper" }
              ] 
            }
          }
        ]
      },
      "minecraft:behavior.melee_attack": {
        "priority": 1,
        "track_target": true
      },
      "minecraft:behavior.move_towards_target": {
        "priority": 2,
        "speed_multiplier": 0.9,
        "within_radius": 32
      },
      "minecraft:behavior.move_through_village": {
        "priority": 3,
        "speed_multiplier": 0.6,
        "only_at_night": true
      },
      "minecraft:behavior.move_towards_dwelling_restriction": {
        "priority": 4,
        "speed_multiplier": 1
      },
      "minecraft:behavior.offer_flower": {
        "priority": 5
      },
      "minecraft:behavior.random_stroll": {
        "priority": 6,
        "speed_multiplier": 0.6,
        "xz_dist": 16
      },
      "minecraft:behavior.look_at_player": {
        "priority": 7,
        "look_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:behavior.random_look_around": {
        "priority": 8
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 3,
        "must_reach": true,
        "must_see": true,

        "entity_types": [
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "monster"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "operator": "!=",
                  "value": "creeper"
                }
              ]
            },
            "within_default": 10
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "hoglin"
                },
                {
                  "test": "is_difficulty",
                  "operator": "!=",
                  "value": "peaceful"
                }
              ]
            },
            "max_dist": 16
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "zoglin"
                },
                {
                  "test": "is_difficulty",
                  "operator": "!=",
                  "value": "peaceful"
                }
              ]
            },
            "max_dist": 16
          }
        ]
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 2,
        "entity_types": {
          "filters": { "test": "is_family", "subject": "other", "operator": "!=", "value": "creeper" }
        }
      },
      "minecraft:persistent": {
      },
      "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:follow_range": {
        "value": 64
      },
      "minecraft:conditional_bandwidth_optimization": {
      }
    },

    "events": {
      "minecraft:from_player": {
        "add": {
          "component_groups": [
            "minecraft:player_created"
          ]
        }
      },
      "minecraft:from_village": {
        "add": {
          "component_groups": [
            "minecraft:village_created"
          ]
        }
      }
    }
  }
}