{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "hoh_bht:treasure_chest",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "hoh_bht:despawn": {
        "minecraft:despawn": {
          "filters": {
            "all_of": [
              {
                "test": "is_riding",
                "operator": "=",
                "value": false
              }
            ]
          }
        }
      },
      "hoh_bht:triggerd": {
        "minecraft:skin_id": {
          "value": 1
        },
        "minecraft:is_baby": {},
        "minecraft:timer": {
          "looping": false,
          "randomInterval": false,
          "time": [5.0, 5.0],
          "time_down_event": {
            "event": "hoh_bht:times_up"
          }
        }
      },
      "hoh_bht:big": {
        "minecraft:collision_box": {
          "width": 1.4,
          "height": 1.0
        },
        "minecraft:interact": {
          "interactions": [
            {
              "on_interact": {
                "filters": [
                  {
                    "all_of": [
                      {
                        "test": "has_component",
                        "subject": "self",
                        "operator": "!=",
                        "value": "minecraft:is_baby"
                      },
                      {
                        "test": "is_family",
                        "subject": "other",
                        "value": "player"
                      },
                      {
                        "test": "has_equipment",
                        "domain": "hand",
                        "subject": "other",
                        "value": "hoh_bht:chest_key_large:0"
                      }
                    ]
                  }
                ],
                "target": "self",
                "event": "hoh_bht:triggerd"
              },
              "swing": true,
           
              "spawn_items": {
                "table": "loot_tables/HoH/bht/entities/hoh_bht_big_chest.json"
              }
            }
          ]
        },
        "minecraft:variant": {
          "value": 2
        },
        "minecraft:scale": {
          "value": 1.5
        }
      },
      "hoh_bht:medium": {
        "minecraft:collision_box": {
          "width": 1.0,
          "height": 1.0
        },
        "minecraft:interact": {
          "interactions": [
            {
              "on_interact": {
                "filters": [
                  {
                    "all_of": [
                      {
                        "test": "has_component",
                        "subject": "self",
                        "operator": "!=",
                        "value": "minecraft:is_baby"
                      },
                      {
                        "test": "is_family",
                        "subject": "other",
                        "value": "player"
                      },
                      {
                        "test": "has_equipment",
                        "domain": "hand",
                        "subject": "other",
                        "value": "hoh_bht:chest_key_medium:0"
                      }
                    ]
                  }
                ],
                "target": "self",
                "event": "hoh_bht:triggerd"
              },
              "swing": true,
           
              "spawn_items": {
                  "table": "loot_tables/HoH/bht/entities/hoh_bht_normal_chest.json"
              }
            }
          ]
        },

        "minecraft:variant": {
          "value": 1
        },
        "minecraft:scale": {
          "value": 1.2
        }
      },
      "hoh_bht:small": {
        "minecraft:collision_box": {
          "width": 1.0,
          "height": 1.0
        },
        "minecraft:interact": {
          "interactions": [
            {
              "on_interact": {
                "filters": [
                  {
                    "all_of": [
                      {
                        "test": "has_component",
                        "subject": "self",
                        "operator": "!=",
                        "value": "minecraft:is_baby"
                      },
                      {
                        "test": "is_family",
                        "subject": "other",
                        "value": "player"
                      },
                      {
                        "test": "has_equipment",
                        "domain": "hand",
                        "subject": "other",
                        "value": "hoh_bht:chest_key_small:0"
                      }
                    ]
                  }
                ],
                "target": "self",
                "event": "hoh_bht:triggerd"
              },
              "swing": true,
           
              "spawn_items": {
                "table": "loot_tables/HoH/bht/entities/hoh_bht_small_chest.json"
              }
            }
          ]
        },
        "minecraft:variant": {
          "value": 0
        },
        "minecraft:scale": {
          "value": 1.0
        }
      }
    },
    "components": {

      "minecraft:type_family": {
        "family": ["treasure_chest", "mob", "inanimate"]
      },
      "minecraft:jump.static": {},
      "minecraft:health": {
        "value": 20,
        "max": 20
      },
      "minecraft:variant": {
        "value": 0
      },
      "minecraft:movement.basic": {},
      "minecraft:navigation.generic": {
        "avoid_damage_blocks": true,
        "can_pass_doors": true,
        "can_jump": true
      },
      "minecraft:interact": {
        "interactions": [
          {
            "on_interact": {
              "filters": [
                {
                  "all_of": [
                    {
                      "test": "has_component",
                      "subject": "self",
                      "operator": "!=",
                      "value": "minecraft:is_baby"
                    },
                    {
                      "test": "is_family",
                      "subject": "other",
                      "value": "player"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "subject": "other",
                      "value": "hoh_bht:chest_key_small:0"
                    }
                  ]
                }
              ],
              "target": "self",
              "event": "hoh_bht:triggerd"
            },
            "swing": true,
         
            "spawn_items": {
              "table": "loot_tables/HoH/bht/entities/hoh_bht_small_chest.json"
            }
          }
        ]
      },
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "on_damage": {},
            "deals_damage": false
          }
        ]
      },
      "minecraft:collision_box": {
        "width": 1.0,
        "height": 1.0
      },
      "minecraft:movement": {
        "value": 1,
        "max": 1
      },
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": false,
        "is_pushable_by_piston": false
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:conditional_bandwidth_optimization": {}
    },
    "events": {
      "hoh_bht:times_up": {
        "add": {
          "component_groups": ["hoh_bht:despawn"]
        }
      },
      "hoh_bht:big_chest": {
        "add": {
          "component_groups": ["hoh_bht:big"]
        }
      },
      "hoh_bht:medium_chest": {
        "add": {
          "component_groups": ["hoh_bht:medium"]
        }
      },
      "hoh_bht:small_chest": {
        "add": {
          "component_groups": ["hoh_bht:small"]
        }
      },
      "hoh_bht:triggerd": {
        "add": {
          "component_groups": ["hoh_bht:triggerd"]
        }
      }
    }
  }
}
