{
  "format_version": "1.20.71",
  "minecraft:entity": {
    "description": {
      "identifier": "mythicus_im:hdc.name",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false
    },

    "component_groups": {
      
      "mythicus_im:instant_despawn": { "minecraft:instant_despawn": {} },

      "mythicus_im:sensors": {
        "minecraft:environment_sensor": {
          "triggers": [
            {
              "filters": { "test": "distance_to_nearest_player", "operator": ">", "value": 10 },
              "event": "mythicus_im:instant_despawn"
            }
          ]
        }
      },
      "mythicus_im:persistent": {
        "minecraft:persistent": {}
      }

    },

    "components": {
      
      "minecraft:collision_box": {
        "width": 0,
        "height": 0
      },
      "minecraft:damage_sensor": {
        "triggers": {
          "cause": "all",
          "deals_damage": false
        }
      },
      "minecraft:health": {
        "value": 100,
        "min": 100,
        "max": 100
      },
      "minecraft:persistent": {
      },
      "minecraft:knockback_resistance": {
        "value": 1,
        "max": 1
      },
      //"minecraft:push_through": {
      //  "value": 1
      //},
      "minecraft:pushable": {
        "is_pushable": false,
        "is_pushable_by_piston": false
      },
      "minecraft:physics": {
        "has_gravity": false,
        "has_collision": false
      },

      "minecraft:nameable": {
        "allow_name_tag_renaming": false,
        "always_show": true
      },

      "minecraft:inside_block_notifier": {
        "block_list": [
          {
            "block": { "name": "minecraft:air" },
            "entered_block_event": { "event": "mythicus_im:instant_despawn" }
          }
        ]
      },

      "minecraft:environment_sensor": {
        "triggers": [
          {
            "filters": { "test": "distance_to_nearest_player", "operator": ">",  "value": 10 },
            "event": "mythicus_im:instant_despawn"
          }
        ]
      }

    },

    "events": {

      "mythicus_im:instant_despawn": { "add": { "component_groups": [ "mythicus_im:instant_despawn" ] } },

      "mythicus_im:persistent.true": { 
        "remove": { "component_groups": [ "mythicus_im:sensors" ] },
        "add": { "component_groups": [ "mythicus_im:persistent" ] }
      },
      "mythicus_im:persistent.false": { 
        "remove": { "component_groups": [ "mythicus_im:persistent" ] },
        "add": { "component_groups": [ "mythicus_im:sensors" ] }
      }

    }

  }
}