{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "lifeboat:trahtor",
      //"runtime_identifier": "minecraft:ghast",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
      "scripts": {
        "animate": [ "underwater_breath_controller", "trahtor_text" ]
      },
      "animations": {
        "animation.underwater_breath": "animation.underwater_breath",
        "underwater_breath_controller": "controller.animation.underwater_breath",

        "trahtor_text": "controller.animation.trahtor_text"
      }
    },
    "component_groups": {

      "variant_0": {
        "minecraft:variant": {
          "value": 0
        }
      },

      "transformation_car": {
        "minecraft:variant": {
          "value": 1
        },
        "minecraft:mark_variant": {
          "value": 0
        },
        "minecraft:timer": {
          "time": 3.3,
          "looping": false,
          "time_down_event": {
            "event": "transformer_robot",
            "target": "self"
          }
        }
      },

      "transformation_robot": {
        "minecraft:variant": {
          "value": 2
        },
        "minecraft:mark_variant": {
          "value": 0
        },
        "minecraft:timer": {
          "time": 3.3,
          "looping": false,
          "time_down_event": {
            "event": "transformer_car",
            "target": "self"
          }
        }
      },


      "transformer_car": {
        "minecraft:mark_variant": {
          "value": 0
        },
        "minecraft:movement": {
          "value": 0.15
        },
        "minecraft:rideable": {
          "seat_count": 1,
          "family_types": ["player"],
          "interact_text": "On Board",
          "seats": {
            "position": [ 0.0, 1.4, -1.5 ]
          }
        },
        "minecraft:break_blocks": {
          "breakable_blocks": [
            "log",
            "wood",
            "leaves",
            "leaves2",
            "vine",
            "tallgrass",
            "double_plant",
            "concretepowder",
            "stone_slab",
            "beacon",
            "wool",
            "brown_mushroom",
            "cobblestone_wall",
            "iron_block",
            "carrots",
            "carved_pumpkin",
            "chorus_flower",
            "chorus_plant",
            "deadbush",
            "leaves",
            "leaves2",
            "lit_pumpkin",
            "melon_block",
            "melon_stem",
            "smooth_stone",
            "pumpkin",
            "pumpkin_stem",
            "red_flower",
            "red_mushroom",
            "reeds",
            "sapling",
            "snow_layer",
            "sweet_berry_bush",
            "turtle_egg",
            "waterlily",
            "wheat",
            "yellow_flower"
          ]
        },
        "minecraft:interact": {
          "interactions": [
            {
              "cooldown": 0.0,
              "use_item": false,
              "hurt_item": 0,
              "play_sounds": "drop.slot",
              "interact_text": "Shrink",
              "spawn_items": { "table": "loot_tables/trahtor.json" },
              "on_interact": {
                "filters": {
                  "all_of": [
                    { "test": "is_family", "subject": "other", "value": "player" },
                    { "test": "is_sneaking", 	"subject": "other" }
                  ]
                },
                "event": "shrink",
                "target": "self"
              },
              "swing": true
            },
            {
              "cooldown": 0.0,
              "use_item": false,
              "hurt_item": 0,
              "play_sounds": "drop.slot",
              "interact_text": "Transform",
              "on_interact": {
                "filters": {
                  "all_of": [
                    { "test": "is_family", "subject": "other", "value": "player" },
                    { "test": "has_equipment", "domain": "hand", "subject": "other", "value": "lifeboat:car_changer"}
                  ]
                },
                "event": "transformation_car",
                "target": "self"
              },
              "swing": true
            }
          ]
        }
      },

      "transformer_robot": {
        "minecraft:mark_variant": {
          "value": 1
        },
        "minecraft:rideable": {
          "seat_count": 1,
          "family_types": ["player"],
          "interact_text": "On Board",
          "rider_can_interact": true,
          "seats": {
            "position": [ -0.15, 2.5, -1.5 ]
          }
        },
        "minecraft:behavior.look_at_player": {
          "priority": 7,
          "look_distance": 6.0,
          "probability": 0.02
        },
        "minecraft:behavior.random_look_around": {
          "priority": 9
        },
        "minecraft:can_power_jump": {},
        "minecraft:jump.static": {},
        "minecraft:horse.jump_strength": {
          "value": 2.0
        },
        "minecraft:movement": {
          "value": 0.15
        },
        "minecraft:interact": {
          "interactions": [
            {
              "cooldown": 0.0,
              "use_item": false,
              "hurt_item": 0,
              "play_sounds": "drop.slot",
              "interact_text": "Shrink",
               "spawn_items": { "table": "loot_tables/trahtor.json" },
              "on_interact": {
                "filters": {
                  "all_of": [
                    { "test": "is_family", "subject": "other", "value": "player" },
                    { "test": "is_sneaking", 	"subject": "other" }
                  ]
                },
                "event": "shrink",
                "target": "self"
              },
              "swing": true
            },
            {
              "cooldown": 0.0,
              "use_item": false,
              "hurt_item": 0,
              "play_sounds": "drop.slot",
              "interact_text": "Transform",
              "on_interact": {
                "filters": {
                  "all_of": [
                    { "test": "is_family", "subject": "other", "value": "player" },
                    { "test": "has_equipment", "domain": "hand", "subject": "other", "value": "lifeboat:car_changer"}
                  ]
                },
                "event": "transformation_robot",
                "target": "self"
              },
              "swing": true
            },
            {
              "cooldown": 0.0,
              "use_item": false,
              "hurt_item": 0,
              "play_sounds": "mob.shulker.shoot",
              "interact_text": "Spawn Sheep",
              "on_interact": {
                "filters": {
                  "all_of": [
                    { "test": "is_riding", "subject": "other", "value": true },
                    { "test": "is_family", "subject": "other", "value": "player" }
                  ]
                }
              },
              "spawn_entities": "lifeboat:explosive_sheep"
            }
          ]
        }
      },

      "shrink": {
        "minecraft:explode": {
          "fuseLength": -0.5,
          "fuseLit": true,
          "power": 0, 
          "causesFire": false,
          "destroyAffectedByGriefing": true
        }
      }

    },
      "components": {
			  "minecraft:type_family": {
				  "family": [ "transformer" ]
			  },
      "minecraft:collision_box": {
        "width": 2.0,
        "height": 4.0
      },
      "minecraft:input_ground_controlled":{
      },
      "minecraft:movement.basic": {
      },
      "minecraft:damage_sensor": {
        "triggers": 
        {
          "deals_damage": false
        }
      },
	    "minecraft:physics": {
      }
    },
      "events":{

        "minecraft:entity_spawned":{
          "add": {
            "component_groups": [
              "transformer_car",
              "variant_0"
            ]
          }
        },


        "transformation_car":{
          "remove": {
            "component_groups": [
              "transformer_car",
              "variant_0"
            ]
          },
          "add": {
            "component_groups": [
              "transformation_car"
            ]
          }
        },
        "transformation_robot":{
          "remove": {
            "component_groups": [
              "transformer_robot",
              "variant_0"
            ]
          },
          "add": {
            "component_groups": [
              "transformation_robot"
            ]
          }
        },


        "transformer_robot":{
          "remove": {
            "component_groups": [
              "transformation_car",
              "transformer_car"
            ]
          },
          "add": {
            "component_groups": [
              "transformer_robot",
              "variant_0"
            ]
          }
        },
        "transformer_car":{
          "remove": {
            "component_groups": [
              "transformation_robot",
              "transformer_robot"
            ]
          },
          "add": {
            "component_groups": [
              "transformer_car",
              "variant_0"
            ]
          }
        },


        "shrink":{
          "add": {
            "component_groups": [
              "shrink"
            ]
          }
        }

      }
   }
}