{
  "format_version": "1.26.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:copper_golem",
      "is_summonable": true,
      "is_spawnable": true,
      "properties": {
        "minecraft:oxidation_level": {
          "client_sync": true,
          "default": "unoxidized",
          "type": "enum",
          "values": [
            "unoxidized",
            "exposed",
            "weathered",
            "oxidized"
          ]
        },
        "minecraft:is_waxed": {
          "default": false,
          "type": "bool"
        },
        "minecraft:chest_interaction": {
          "client_sync": true,
          "default": "none",
          "type": "enum",
          "values": [
            "none",
            "take",
            "take_fail",
            "put",
            "put_fail"
          ]
        },
        "minecraft:has_flower": {
          "client_sync": true,
          "default": false,
          "type": "bool"
        },
        "minecraft:is_becoming_statue": {
          "default": false,
          "type": "bool"
        }
      }
    },
    "components": {
      "minecraft:annotation.open_door": {},
      "minecraft:attack": {
        "damage": 2
      },
      "minecraft:balloonable": {},
      "minecraft:behavior.look_at_player": {
        "look_time": {
          "min": 1,
          "max": 2
        },
        "look_distance": 6,
        "priority": 6
      },
      "minecraft:behavior.panic": {
        "priority": 2,
        "speed_multiplier": 1.5
      },
      "minecraft:behavior.random_look_around": {
        "priority": 7
      },
      "minecraft:behavior.random_stroll": {
        "priority": 5,
        "xz_dist": 3
      },
      "minecraft:behavior.take_flower": {
        "filters": {
          "all_of": [
            {
              "test": "is_daytime",
              "value": true
            },
            {
              "domain": "minecraft:has_flower",
              "test": "bool_property",
              "value": false
            }
          ]
        },
        "on_take_flower": {
          "event": "minecraft:on_take_flower"
        },
        "priority": 4
      },
      "minecraft:behavior.transport_items": {
        "source_container_types": [
          {
            "name": "minecraft:copper_chest"
          },
          {
            "name": "minecraft:exposed_copper_chest"
          },
          {
            "name": "minecraft:oxidized_copper_chest"
          },
          {
            "name": "minecraft:waxed_copper_chest"
          },
          {
            "name": "minecraft:waxed_exposed_copper_chest"
          },
          {
            "name": "minecraft:waxed_oxidized_copper_chest"
          },
          {
            "name": "minecraft:waxed_weathered_copper_chest"
          },
          {
            "name": "minecraft:weathered_copper_chest"
          }
        ],
        "destination_container_types": [
          {
            "name": "minecraft:chest"
          },
          {
            "name": "minecraft:trapped_chest"
          }
        ],
        "max_stack_size": 16,
        "search_strategy": "nearest",
        "search_distance": [
          32,
          8
        ],
        "max_visited_containers": 10,
        "initial_cooldown": 3,
        "idle_cooldown": 7,
        "place_strategy": "with_matching_or_empty",
        "priority": 3
      },
      "minecraft:can_climb": {},
      "minecraft:collision_box": {
        "height": 0.98,
        "width": 0.6
      },
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "cause": "fall",
            "deals_damage": "no"
          },
          {
            "deals_damage": "no",
            "on_damage": {
              "event": "minecraft:remove_oxidation_layer",
              "filters": {
                "all_of": [
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "lightning"
                  },
                  {
                    "operator": "==",
                    "test": "is_variant",
                    "subject": "self",
                    "value": 0
                  }
                ]
              }
            }
          }
        ]
      },
      "minecraft:equipment": {
        "slot_drop_chance": [
          {
            "drop_chance": 1,
            "slot": "slot.weapon.mainhand"
          }
        ]
      },
      "minecraft:health": {
        "max": 12,
        "value": 12
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "cause": "lava",
            "damage_per_tick": 4,
            "filters": {
              "operator": "==",
              "test": "in_lava",
              "subject": "self",
              "value": true
            }
          }
        ]
      },
      "minecraft:interact": {
        "interactions": [
          // Wax on
          {
            "interact_text": "action.interact.wax_on",
            "on_interact": {
              "event": "minecraft:wax_on",
              "filters": {
                "all_of": [
                  {
                    "domain": "minecraft:is_waxed",
                    "test": "bool_property",
                    "value": false
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "player"
                  },
                  {
                    "domain": "hand",
                    "subject": "other",
                    "test": "has_equipment",
                    "value": "honeycomb"
                  }
                ]
              }
            },
            "particle_on_start": {
              "copper_event": "wax_on"
            },
            "use_item": true,
            "swing": true
          },
          // Scrape
          {
            "hurt_item": 1,
            "interact_text": "action.interact.scrape",
            "on_interact": {
              "event": "minecraft:remove_oxidation_layer",
              "filters": {
                "all_of": [
                  {
                    "domain": "minecraft:is_waxed",
                    "test": "bool_property",
                    "value": false
                  },
                  {
                    "domain": "minecraft:oxidation_level",
                    "operator": "not",
                    "test": "enum_property",
                    "value": "unoxidized"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "player"
                  },
                  {
                    "domain": "hand",
                    "subject": "other",
                    "test": "has_equipment_tag",
                    "value": "minecraft:is_axe"
                  }
                ]
              }
            },
            "particle_on_start": {
              "copper_event": "scrape"
            },
            "swing": true
          },
          // Wax off
          {
            "hurt_item": 1,
            "interact_text": "action.interact.wax_off",
            "on_interact": {
              "event": "minecraft:wax_off",
              "filters": {
                "all_of": [
                  {
                    "domain": "minecraft:is_waxed",
                    "test": "bool_property",
                    "value": true
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "player"
                  },
                  {
                    "domain": "hand",
                    "subject": "other",
                    "test": "has_equipment_tag",
                    "value": "minecraft:is_axe"
                  }
                ]
              }
            },
            "particle_on_start": {
              "copper_event": "wax_off"
            },
            "swing": true
          },
          // Drop item
          {
            "drop_item_slot": "slot.weapon.mainhand",
            "interact_text": "action.interact.drop_item",
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "operator": "not",
                    "test": "all_slots_empty",
                    "value": "hand"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "player"
                  },
                  {
                    "subject": "other",
                    "test": "all_slots_empty",
                    "value": "main_hand"
                  }
                ]
              }
            },
            "swing": true
          },
          // Shear flower
          {
            "play_sounds": "shear",
            "cooldown": 2.5,
            "hurt_item": 1,
            "spawn_items": {
              "table": "loot_tables/entities/copper_golem_shear.json"
            },
            "on_interact": {
              "event": "minecraft:on_sheared",
              "filters": {
                "all_of": [
                  {
                    "domain": "minecraft:has_flower",
                    "test": "bool_property",
                    "value": true
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "player"
                  },
                  {
                    "domain": "hand",
                    "subject": "other",
                    "test": "has_equipment",
                    "value": "shears"
                  }
                ]
              },
              "target": "self"
            },
            "interact_text": "action.interact.shear",
            "swing": false,
            "vibration": "shear",
            "use_item": false
          }
        ]
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:jump.static": {},
      "minecraft:leashable": {},
      "minecraft:leashable_to": {},
      "minecraft:loot": {
        "table": "loot_tables/entities/copper_golem.json"
      },
      "minecraft:movement": {
        "value": 0.2
      },
      "minecraft:movement.basic": {},
      "minecraft:nameable": {},
      "minecraft:navigation.walk": {
        "avoid_damage_blocks": true,
        "can_pass_doors": true,
        "avoid_water": true,
        "can_open_doors": true,
        "using_door_annotation": true
      },
      "minecraft:persistent": {},
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:type_family": {
        "family": [
          "copper_golem",
          "mob"
        ]
      }
    },
    "component_groups": {
      "minecraft:became_statue": {
        "minecraft:instant_despawn": {},
        "minecraft:spawn_entity": {
          "entities": {
            "filters": {
              "domain": "minecraft:has_flower",
              "test": "bool_property",
              "value": true
            },
            "max_wait_time": 0,
            "min_wait_time": 0,
            "spawn_item": "poppy"
          }
        }
      },
      "minecraft:becoming_statue": {
        "minecraft:behavior.place_block": {
          "affected_by_griefing_rule": false,
          "randomly_placeable_blocks": [
            {
              // North
              "block": {
                "name": "minecraft:oxidized_copper_golem_statue",
                "states": {
                  "minecraft:cardinal_direction": "north"
                }
              },
              "filter": {
                "any_of": [
                  {
                    "all_of": [
                      {
                        "operator": ">=",
                        "test": "y_rotation",
                        "value": 135
                      },
                      {
                        "operator": "<",
                        "test": "y_rotation",
                        "value": 180
                      }
                    ]
                  },
                  {
                    "all_of": [
                      {
                        "operator": ">=",
                        "test": "y_rotation",
                        "value": -180
                      },
                      {
                        "operator": "<",
                        "test": "y_rotation",
                        "value": -135
                      }
                    ]
                  }
                ]
              }
            },
            {
              // East
              "block": {
                "name": "minecraft:oxidized_copper_golem_statue",
                "states": {
                  "minecraft:cardinal_direction": "east"
                }
              },
              "filter": {
                "all_of": [
                  {
                    "operator": ">=",
                    "test": "y_rotation",
                    "value": -135
                  },
                  {
                    "operator": "<",
                    "test": "y_rotation",
                    "value": -45
                  }
                ]
              }
            },
            {
              // South
              "block": {
                "name": "minecraft:oxidized_copper_golem_statue",
                "states": {
                  "minecraft:cardinal_direction": "south"
                }
              },
              "filter": {
                "all_of": [
                  {
                    "operator": ">=",
                    "test": "y_rotation",
                    "value": -45
                  },
                  {
                    "operator": "<",
                    "test": "y_rotation",
                    "value": 45
                  }
                ]
              }
            },
            {
              // West
              "block": {
                "name": "minecraft:oxidized_copper_golem_statue",
                "states": {
                  "minecraft:cardinal_direction": "west"
                }
              },
              "filter": {
                "all_of": [
                  {
                    "operator": ">=",
                    "test": "y_rotation",
                    "value": 45
                  },
                  {
                    "operator": "<",
                    "test": "y_rotation",
                    "value": 135
                  }
                ]
              }
            }
          ],
          "can_place": {
            "domain": "minecraft:is_becoming_statue",
            "test": "bool_property",
            "value": false
          },
          "chance": 0.0058,
          "priority": 1,
          "on_place": {
            "event": "minecraft:become_statue",
            "target": "self"
          },
          "xz_range": 0,
          "y_range": 0
        }
      },
      "minecraft:copper_oxidizing": {
        "minecraft:timer": {
          "looping": true,
          // 420-460 minutes, 440 average
          "time": [
            25200,
            27600
          ],
          "time_down_event": {
            "event": "minecraft:oxidize_copper"
          }
        }
      }
    },
    "events": {
      "minecraft:become_statue": {
        "drop_item": {
          "slot": "slot.weapon.mainhand"
        },
        "set_property": {
          "minecraft:is_becoming_statue": true
        },
        "trigger": {
          "event": "minecraft:serialize_entity",
          "target": "block"
        }
      },
      "minecraft:begin_oxidizing": {
        "add": {
          "component_groups": [
            "minecraft:copper_oxidizing"
          ]
        }
      },
      "minecraft:from_player_weathered": {
        "set_property": {
          "minecraft:oxidation_level": "weathered"
        },
        "trigger": "minecraft:from_player_spawned"
      },
      "minecraft:from_player_default": {
        "set_property": {
          "minecraft:oxidation_level": "unoxidized"
        },
        "trigger": "minecraft:from_player_spawned"
      },
      "minecraft:entity_spawned": {
        "trigger": "minecraft:begin_oxidizing"
      },
      "minecraft:from_player_exposed": {
        "set_property": {
          "minecraft:oxidation_level": "exposed"
        },
        "trigger": "minecraft:from_player_spawned"
      },
      "minecraft:transport_items.start_take_succeed": {
        "set_property": {
          "minecraft:chest_interaction": "take"
        }
      },
      "minecraft:from_player_spawned": {
        "trigger": "minecraft:begin_oxidizing",
        "play_sound": {
          "sound": "spawn"
        }
      },
      "minecraft:from_player_oxidized": {
        "trigger": "minecraft:maximum_oxidation",
        "play_sound": {
          "sound": "spawn"
        },
        "set_property": {
          "minecraft:oxidation_level": "oxidized"
        }
      },
      "minecraft:transport_items.stop_interaction": {
        "set_property": {
          "minecraft:chest_interaction": "none"
        }
      },
      "minecraft:from_serialized_entity": {
        "set_property": {
          "minecraft:is_becoming_statue": false,
          "minecraft:oxidation_level": "unoxidized"
        },
        "trigger": "minecraft:restart_oxidation_timer"
      },
      "minecraft:maximum_oxidation": {
        "add": {
          "component_groups": [
            "minecraft:becoming_statue"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:copper_oxidizing"
          ]
        }
      },
      "minecraft:on_sheared": {
        "set_property": {
          "minecraft:has_flower": false
        }
      },
      "minecraft:on_take_flower": {
        "set_property": {
          "minecraft:has_flower": true
        }
      },
      "minecraft:oxidize_copper": {
        "first_valid": [
          {
            "filters": {
              "domain": "minecraft:oxidation_level",
              "test": "enum_property",
              "value": "unoxidized"
            },
            "set_property": {
              "minecraft:oxidation_level": "exposed"
            }
          },
          {
            "filters": {
              "domain": "minecraft:oxidation_level",
              "test": "enum_property",
              "value": "exposed"
            },
            "set_property": {
              "minecraft:oxidation_level": "weathered"
            }
          },
          {
            "filters": {
              "domain": "minecraft:oxidation_level",
              "test": "enum_property",
              "value": "weathered"
            },
            "set_property": {
              "minecraft:oxidation_level": "oxidized"
            },
            "trigger": "minecraft:maximum_oxidation"
          }
        ]
      },
      "minecraft:remove_oxidation_layer": {
        "sequence": [
          {
            // We restart the timer since it could be half way through oxidizing and that is annoying
            "trigger": "minecraft:restart_oxidation_timer"
          },
          {
            "first_valid": [
              {
                "filters": {
                  "domain": "minecraft:oxidation_level",
                  "test": "enum_property",
                  "value": "exposed"
                },
                "set_property": {
                  "minecraft:oxidation_level": "unoxidized"
                }
              },
              {
                "filters": {
                  "domain": "minecraft:oxidation_level",
                  "test": "enum_property",
                  "value": "weathered"
                },
                "set_property": {
                  "minecraft:oxidation_level": "exposed"
                }
              },
              {
                "filters": {
                  "domain": "minecraft:oxidation_level",
                  "test": "enum_property",
                  "value": "oxidized"
                },
                "set_property": {
                  "minecraft:oxidation_level": "weathered"
                }
              }
            ]
          }
        ]
      },
      "minecraft:transport_items.start_place_fail": {
        "set_property": {
          "minecraft:chest_interaction": "put_fail"
        }
      },
      "minecraft:restart_oxidation_timer": {
        "add": {
          "component_groups": [
            "minecraft:copper_oxidizing"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:copper_oxidizing",
            "minecraft:becoming_statue"
          ]
        }
      },
      "minecraft:serialize_entity_succeeded": {
        "add": {
          "component_groups": [
            "minecraft:became_statue"
          ]
        },
        "trigger": {
          "event": "minecraft:randomize_pose",
          "target": "block"
        },
        "play_sound": {
          "sound": "deactivate"
        }
      },
      "minecraft:transport_items.start_take_fail": {
        "set_property": {
          "minecraft:chest_interaction": "take_fail"
        }
      },
      "minecraft:transport_items.start_place_succeed": {
        "set_property": {
          "minecraft:chest_interaction": "put"
        }
      },
      "minecraft:wax_off": {
        "sequence": [
          {
            "first_valid": [
              {
                "filters": {
                  "domain": "minecraft:oxidation_level",
                  "test": "enum_property",
                  "value": "oxidized"
                },
                "add": {
                  "component_groups": [
                    "minecraft:becoming_statue"
                  ]
                }
              },
              {
                "add": {
                  "component_groups": [
                    "minecraft:copper_oxidizing"
                  ]
                }
              }
            ]
          },
          {
            "set_property": {
              "minecraft:is_waxed": false
            }
          }
        ]
      },
      "minecraft:wax_on": {
        "set_property": {
          "minecraft:is_waxed": true
        },
        "remove": {
          "component_groups": [
            "minecraft:copper_oxidizing",
            "minecraft:becoming_statue"
          ]
        }
      }
    }
  }
}