{
  "format_version": "1.21.50",
  "minecraft:entity": {
    "description": {
      "identifier": "silverlabs_nat:snake_egg",
      "is_summonable": true
    },
    "components": {
      "minecraft:collision_box": {
        "width": 0.2,
        "height": 0.2
      },
      "minecraft:health": {
        "value": 1,
        "max": 1
      },
      "minecraft:knockback_resistance": {
        "value": 1
      },
      "minecraft:pushable": {
        "is_pushable": false,
        "is_pushable_by_piston": false
      },
      "minecraft:physics": {},
      "minecraft:type_family": {
        "family": [
          "silverlabs_nat:snake_egg",
          "inanimate"
        ]
      },
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "cause": "entity_attack",
            "on_damage": {
              "filters": {
                "test": "is_family",
                "subject": "other",
                "value": "player"
              },
              "event": "silverlabs_nat:drop"
            },
            "deals_damage": "no"
          },
          {
            "cause": "all",
            "deals_damage": "no"
          }
        ]
      },
      "minecraft:persistent": {}
    },
    "component_groups": {
      "silverlabs_nat:stage_0": {
        "minecraft:variant": {
          "value": 0
        }
      },
      "silverlabs_nat:stage_1": {
        "minecraft:variant": {
          "value": 1
        }
      },
      "silverlabs_nat:stage_2": {
        "minecraft:variant": {
          "value": 2
        }
      },
      "silverlabs_nat:hatch_timer": {
        "minecraft:timer": {
          "looping": true,
          "time": 200,
          "time_down_event": {
            "event": "silverlabs_nat:next_stage"
          }
        }
      },
      "silverlabs_nat:hatch": {
        "minecraft:transformation": {
          "into": "silverlabs_nat:snake<silverlabs_nat:entity_born>",
          "keep_owner": true,
          "delay": 0.2
        }
      },
      "silverlabs_nat:drop": {
        "minecraft:instant_despawn": {},
        "minecraft:spawn_entity": {
          "entities": [
            {
              "min_wait_time": 0,
              "max_wait_time": 0,
              "spawn_item": "silverlabs_nat:snake_egg"
            }
          ]
        }
      }
    },
    "events": {
      "minecraft:entity_born": {
        "trigger": "minecraft:entity_spawned"
      },
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "silverlabs_nat:hatch_timer",
            "silverlabs_nat:stage_0"
          ]
        }
      },
      "silverlabs_nat:next_stage": {
        "sequence": [
          {
            "filters": {
              "test": "is_variant",
              "value": 2
            },
            "add": {
              "component_groups": [
                "silverlabs_nat:hatch"
              ]
            }
          },
          {
            "filters": {
              "test": "is_variant",
              "value": 1
            },
            "remove": {
              "component_groups": [
                "silverlabs_nat:stage_1"
              ]
            },
            "add": {
              "component_groups": [
                "silverlabs_nat:stage_2"
              ]
            }
          },
          {
            "filters": {
              "test": "is_variant",
              "value": 0
            },
            "remove": {
              "component_groups": [
                "silverlabs_nat:stage_0"
              ]
            },
            "add": {
              "component_groups": [
                "silverlabs_nat:stage_1"
              ]
            }
          }
        ]
      },
      "silverlabs_nat:drop": {
        "add": {
          "component_groups": [
            "silverlabs_nat:drop"
          ]
        }
      }
    }
  }
}
