{
   "format_version":"1.21.0",
   "minecraft:entity":{
      "description":{
         "identifier":"true:vortex_mixer",
         "spawn_category":"creature",
         "is_spawnable":true,
         "is_summonable":true
      },
      "component_groups":{
         "true:vortex_mixer_off":{
            "minecraft:variant":{
               "value":0
            },
            "minecraft:interact":{
               "interactions":[
                  {
                     "hurt_item":1,
                     "on_interact":{
                        "filters":{
                           "all_of":[
                              {
                                 "test":"has_tag",
                                 "subject":"other",
                                 "operator":"equals",
                                 "value":"breaking_tool"
                              }
                           ]
                        },
                        "event":"true:pick_up",
                        "target":"self"
                     },
                     "add_items":{
                        "table":"loot_tables/pick_ups/vortex_mixer.json"
                     },
                     "use_item":false,
                     "play_sounds":"saddle",
                     "interact_text":"action.interact.pick_up"
                  }
               ]
            },
            "minecraft:environment_sensor":{
               "triggers":[
                  {
                     "filters":{
                        "all_of":[
                           {
                              "test":"is_brightness",
                              "operator":">",
                              "value":0.49
                           }
                        ]
                     },
                     "event":"true:power_on"
                  }
               ]
            }
         },
         "true:vortex_mixer_on":{
            "minecraft:variant":{
               "value":1
            },
            "minecraft:interact":{
               "interactions":[
                  {
                     "on_interact":{
                        "filters":{
                           "all_of":[
                              {
                                 "test":"has_equipment",
                                 "subject":"other",
                                 "domain":"hand",
                                 "value":"true:zombie_vaccine_unmixed"
                              }
                           ]
                        },
                        "event":"true:insert_vial",
                        "target":"self"
                     },
                     "play_sounds":"tripod",
                     "use_item":true,
                     "interact_text":"action.interact.insert_vial"
                  },
                  {
                     "hurt_item":1,
                     "on_interact":{
                        "filters":{
                           "all_of":[
                              {
                                 "test":"has_tag",
                                 "subject":"other",
                                 "operator":"equals",
                                 "value":"breaking_tool"
                              }
                           ]
                        },
                        "event":"true:pick_up",
                        "target":"self"
                     },
                     "add_items":{
                        "table":"loot_tables/pick_ups/vortex_mixer.json"
                     },
                     "use_item":false,
                     "play_sounds":"saddle",
                     "interact_text":"action.interact.pick_up"
                  }
               ]
            },
            "minecraft:environment_sensor":{
               "triggers":[
                  {
                     "filters":{
                        "all_of":[
                           {
                              "test":"is_brightness",
                              "operator":"<",
                              "value":0.49
                           }
                        ]
                     },
                     "event":"true:lights_off"
                  }
               ]
            }
         },
         "true:vortex_mixer_active":{
            "minecraft:variant":{
               "value":2
            },
            "minecraft:is_sheared":{
               
            },
            "minecraft:timer":{
               "looping":false,
               "randomInterval":false,
               "time":20,
               "time_down_event":{
                  "event":"true:vortex_mixer_finished"
               }
            },
            "minecraft:spawn_entity":{
               "entities":{
                  "min_wait_time":20,
                  "max_wait_time":20,
                  "spawn_sound":"plop",
                  "spawn_item":"true:zombie_vaccine"
               }
            }
         },
         "true:despawn":{
            "minecraft:transformation":{
               "into":"true:despawn"
            }
         }
      },
      "components":{
         "minecraft:type_family":{
            "family":[
               "vortex_mixer"
            ]
         },
         "minecraft:collision_box":{
            "width":0.6,
            "height":0.8
         },
         "minecraft:damage_sensor":{
            "triggers":[
               {
                  "on_damage":{
                     "filters":{
                        "test":"is_family",
                        "subject":"other",
                        "value":"player"
                     }
                  },
                  "deals_damage":false
               }
            ]
         },
         "minecraft:health":{
            "value":9999,
            "max":9999
         },
         "minecraft:scale":{
            "value":1.0
         },
         "minecraft:knockback_resistance":{
            "value":100,
            "max":100
         },
         "minecraft:physics":{
            
         }
      },
      "events":{
         "minecraft:entity_spawned":{
            "add":{
               "component_groups":[
                  "true:vortex_mixer_off"
               ]
            }
         },
         "true:power_on":{
            "remove":{
               "component_groups":[
                  "true:vortex_mixer_off"
               ]
            },
            "add":{
               "component_groups":[
                  "true:vortex_mixer_on"
               ]
            }
         },
         "true:power_off":{
            "remove":{
               "component_groups":[
                  "true:vortex_mixer_on"
               ]
            },
            "add":{
               "component_groups":[
                  "true:vortex_mixer_off"
               ]
            }
         },
         "true:insert_vial":{
            "remove":{
               "component_groups":[
                  "true:vortex_mixer_on"
               ]
            },
            "add":{
               "component_groups":[
                  "true:vortex_mixer_active"
               ]
            }
         },
         "true:vortex_mixer_finished":{
            "remove":{
               "component_groups":[
                  "true:vortex_mixer_active"
               ]
            },
            "add":{
               "component_groups":[
                  "true:vortex_mixer_on"
               ]
            }
         },
         "true:pick_up":{
            "add":{
               "component_groups":[
                  "true:despawn"
               ]
            }
         }
      }
   }
}