{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "numberblocks:thirty",
      "spawn_category": "creature",
      "is_spawnable": true,
      "is_summonable": true,
      "properties": {
        "minecraft:nature_spawn": {
          "type": "bool", 
          "default": false,
          "client_sync": true
        },
        "numberblocks:splited": {
          "type": "bool", 
          "default": false,
          "client_sync": true
        }
      }
    },
    
    "component_groups": {
      "nature_spawn": {
        "minecraft:loot": {
          "table": "loot_tables/entities/numberblocks/thirty.json"
        },
        "minecraft:despawn": {
          "despawn_from_distance": {}
        }
      },
      "spawn_numberblobs": {
        "minecraft:spawn_entity": {
          "entities": [
            {
              "min_wait_time": 0,
              "max_wait_time": 0,
              "spawn_entity": "numberblocks:numberblob",
              "spawn_event": "numberblocks:numberblob_thirty",
              "single_use": true,
              "num_to_spawn": 30
            }
          ]
        }
      },
      "spawn_twos": {
        "minecraft:spawn_entity": {
          "entities": [
            {
              "min_wait_time": 0,
              "max_wait_time": 0,
              "spawn_entity": "numberblocks:thirty",
              "spawn_event": "numberblocks:nature_spawn_splited",
              "single_use": true,
              "num_to_spawn": 1
            }
          ]
        }
      },
      "egg_spawn_twos": {
        "minecraft:spawn_entity": {
          "entities": [
            {
              "min_wait_time": 0,
              "max_wait_time": 0,
              "spawn_entity": "numberblocks:thirty",
              "spawn_event": "numberblocks:splited",
              "single_use": true,
              "num_to_spawn": 1
            }
          ]
        }
      },
      "spawn_threes": {
        "minecraft:spawn_entity": {
          "entities": [
            {
              "min_wait_time": 0,
              "max_wait_time": 0,
              "spawn_entity": "numberblocks:thirty",
              "spawn_event": "numberblocks:nature_spawn_splited",
              "single_use": true,
              "num_to_spawn": 2
            }
          ]
        }
      },
      "egg_spawn_threes": {
        "minecraft:spawn_entity": {
          "entities": [
            {
              "min_wait_time": 0,
              "max_wait_time": 0,
              "spawn_entity": "numberblocks:thirty",
              "spawn_event": "numberblocks:splited",
              "single_use": true,
              "num_to_spawn": 2
            }
          ]
        }
      },
      "spawn_fours": {
        "minecraft:spawn_entity": {
          "entities": [
            {
              "min_wait_time": 0,
              "max_wait_time": 0,
              "spawn_entity": "numberblocks:thirty",
              "spawn_event": "numberblocks:nature_spawn_splited",
              "single_use": true,
              "num_to_spawn": 3
            }
          ]
        }
      },
      "egg_spawn_fours": {
        "minecraft:spawn_entity": {
          "entities": [
            {
              "min_wait_time": 0,
              "max_wait_time": 0,
              "spawn_entity": "numberblocks:thirty",
              "spawn_event": "numberblocks:splited",
              "single_use": true,
              "num_to_spawn": 3
            }
          ]
        }
      },
      "split_into_half_nature_spawn": {
        "minecraft:transformation": {
          "into": "numberblocks:fifteen<numberblocks:spawn_twos>",
          "preserve_equipment": true
        }
      },
      "split_into_half": {
        "minecraft:transformation": {
          "into": "numberblocks:fifteen<numberblocks:egg_spawn_twos>",
          "preserve_equipment": true
        }
      },
      "split_into_thirds_nature_spawn": {
        "minecraft:transformation": {
          "into": "numberblocks:ten<numberblocks:spawn_threes>",
          "preserve_equipment": true
        }
      },
      "split_into_thirds": {
        "minecraft:transformation": {
          "into": "numberblocks:ten<numberblocks:egg_spawn_threes>",
          "preserve_equipment": true
        }
      }
    },
    "components": {
      "minecraft:is_hidden_when_invisible": {
      },

      "minecraft:type_family": {
        "family": [
          "thirty",
          "numberblock",
          "numberblocks",
          "mob",
          "even",
          "made_of_ones",
          "family_of_threes",
          "super_rectangle",
          "super_duper_rectangle",
          "female"
        ]
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0
      },
      "minecraft:nameable": {
      },
      "minecraft:health": {
        "value": 30,
        "max": 30
      },
      "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": true,
        "avoid_water": true,
        "avoid_damage_blocks": true
      },
      "minecraft:movement.basic": {

      },
      "minecraft:jump.static": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:collision_box": {
        "width": 1.2,
        "height": 5.3
      },
      "minecraft:attack": {
        "damage": 1
      },
      "minecraft:leashable_to": {
      },
      "minecraft:equipment": {
        "slot_drop_chance": [
          {
            "slot": "slot.weapon.mainhand",
            "drop_chance": 1.0
          }
        ]
      },
      "minecraft:interact": {
        "interactions": [
          {
            "cooldown": 0,
            "use_item": false,
            "interact_text": "action.interact.numberblockssplit",
            "on_interact": {
              "filters": {
                "all_of": [
                  { "test": "has_equipment", "subject": "other", "domain": "hand", "value": "numberblocks:fractionator_split_into_half" },
                  { "test": "bool_property", "subject": "self", "domain": "numberblocks:splited", "operator": "!=" }
                ]
              },
              "event": "numberblocks:split_into_half"
            }
          },
          {
            "cooldown": 0,
            "use_item": false,
            "interact_text": "action.interact.numberblockssplit",
            "on_interact": {
              "filters": {
                "all_of": [
                  { "test": "has_equipment", "subject": "other", "domain": "hand", "value": "numberblocks:fractionator_split_into_thirds" },
                  { "test": "bool_property", "subject": "self", "domain": "numberblocks:splited", "operator": "!=" }
                ]
              },
              "event": "numberblocks:split_into_thirds"
            }
          }
        ]
      },
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1,
        "entity_types": [
          {
            "filters": {
              "all_of": [
                { "test": "is_family", "subject": "other", "value": "terribleblock" },
                { "test": "is_family", "subject": "other", "operator": "!=", "value": "player" }
              ]
            },
            "max_dist": 64
          }
        ]
      },
      "minecraft:behavior.avoid_mob_type": {
        "priority": 2,
        "entity_types": [
          {
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    {
                      "all_of": [
                        { "test": "is_family", "subject": "other", "value": "terrible_twenty" },
                        { "test": "has_equipment", "subject": "self", "domain": "hand", "operator": "!=", "value": "numberblocks:fractionator_split_into_half" }
                      ]
                    },
                    {
                      "all_of": [
                        { "test": "is_family", "subject": "other", "value": "octonaughty" },
                        { "test": "has_equipment", "subject": "self", "domain": "hand", "operator": "!=", "value": "numberblocks:fractionator_split_into_quarters" }
                      ]
                    }
                  ]
                },
                { "test": "is_target", "subject": "other", "operator": "!=" }
              ]
            },
            "max_dist": 8,
            "sprint_speed_multiplier": 1.3
          }
        ]
      },
      "minecraft:behavior.send_event": {
        "priority": 3,
        "event_choices": [
          {
            "min_activation_range": 0.0,
            "max_activation_range": 8.0,
            "cooldown_time": 5.0,
            "cast_duration": 1.0,
            "weight": 1,
            "filters": {
              "all_of": [
                { "test": "has_equipment", "subject": "self", "domain": "hand", "value": "numberblocks:fractionator_split_into_half" },
                { "test": "is_family", "subject": "other", "operator": "!=", "value": "player" },
                { "test": "bool_property", "subject": "other", "domain": "numberblocks:splited", "operator": "!=" },
                {
                  "any_of": [
                    { "test": "is_family", "subject": "other", "value": "terrible_twenty" }
                  ]
                }
              ]
            },
            "sequence": [
              {
                "event": "numberblocks:split_into_half"
              }
            ]
          },
          {
            "min_activation_range": 0.0,
            "max_activation_range": 8.0,
            "cooldown_time": 5.0,
            "cast_duration": 1.0,
            "weight": 1,
            "filters": {
              "all_of": [
                { "test": "has_equipment", "subject": "self", "domain": "hand", "value": "numberblocks:fractionator_split_into_quarters" },
                { "test": "is_family", "subject": "other", "operator": "!=", "value": "player" },
                { "test": "bool_property", "subject": "other", "domain": "numberblocks:splited", "operator": "!=" },
                { "test": "is_family", "subject": "other", "value": "octonaughty" }
              ]
            },
            "sequence": [
              {
                "event": "numberblocks:split_into_quarters"
              }
            ]
          }
        ]
      },
      "minecraft:behavior.melee_box_attack": {
        "priority": 3,
        "track_target": true
      },
      "minecraft:behavior.random_stroll": {
        "priority": 4,
        "speed_multiplier": 1.0
      },
      "minecraft:behavior.look_at_player": {
        "priority": 5,
        "look_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:behavior.random_look_around": {
        "priority": 6
      },
	    "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:conditional_bandwidth_optimization": {
      }
    },
    "events": {
      "numberblocks:nature_spawn_numberblobs": {
        "sequence":[
          {
            "trigger": "minecraft:nature_spawn"
          },
          {
            "trigger": "numberblocks:roll_spawn_numberblobs"
          }
        ]
      },
      "minecraft:nature_spawn": {
        "set_property": {
          "minecraft:nature_spawn": true
        },
        "add": {
          "component_groups": [
            "nature_spawn"
          ]
        }
      },
      "numberblocks:splited": {
        "set_property": {
          "numberblocks:splited": true
        }
      },
      "numberblocks:nature_spawn_splited": {
        "sequence": [
          {
            "trigger": "minecraft:nature_spawn"
          },
          {
            "trigger": "numberblocks:splited"
          }
        ]
      },
      "numberblocks:roll_spawn_numberblobs": {
        "randomize": [
          {
            "weight": 98
          },
          {
            "weight": 2,
            "trigger": "numberblocks:spawn_numberblobs"
          }
        ]
      },
      "numberblocks:spawn_numberblobs": {
        "add": {
          "component_groups": [
            "spawn_numberblobs"
          ]
        }
      },
      "numberblocks:spawn_twos": {
        "trigger": "numberblocks:nature_spawn_splited",
        "add": {
          "component_groups": [
            "spawn_twos"
          ]
        }
      },
      "numberblocks:egg_spawn_twos": {
        "trigger": "numberblocks:splited",
        "add": {
          "component_groups": [
            "egg_spawn_twos"
          ]
        }
      },
      "numberblocks:spawn_threes": {
        "trigger": "numberblocks:nature_spawn_splited",
        "add": {
          "component_groups": [
            "spawn_threes"
          ]
        }
      },
      "numberblocks:egg_spawn_threes": {
        "trigger": "numberblocks:splited",
        "add": {
          "component_groups": [
            "egg_spawn_threes"
          ]
        }
      },
      "numberblocks:spawn_fours": {
        "trigger": "numberblocks:nature_spawn_splited",
        "add": {
          "component_groups": [
            "spawn_fours"
          ]
        }
      },
      "numberblocks:egg_spawn_fours": {
        "trigger": "numberblocks:splited",
        "add": {
          "component_groups": [
            "egg_spawn_fours"
          ]
        }
      },
      "numberblocks:split_into_half": {
        "sequence": [
          {
            "filters": { "test": "bool_property", "subject": "self", "domain": "minecraft:nature_spawn" },
            "add": {
              "component_groups": [
                "split_into_half_nature_spawn"
              ]
            }
          },
          {
            "filters": { "test": "bool_property", "subject": "self", "domain": "minecraft:nature_spawn", "operator": "!=" },
            "add": {
              "component_groups": [
                "split_into_half"
              ]
            }
          }
        ]
      },
      "numberblocks:split_into_thirds": {
        "sequence": [
          {
            "filters": { "test": "bool_property", "subject": "self", "domain": "minecraft:nature_spawn" },
            "add": {
              "component_groups": [
                "split_into_thirds_nature_spawn"
              ]
            }
          },
          {
            "filters": { "test": "bool_property", "subject": "self", "domain": "minecraft:nature_spawn", "operator": "!=" },
            "add": {
              "component_groups": [
                "split_into_thirds"
              ]
            }
          }
        ]
      }
    }
  }
}
