{
   "format_version":"1.21.0",
   "minecraft:entity":{
      "description":{
         "identifier":"true:katana_trader",
         "spawn_category":"creature",
         "is_spawnable":true,
         "is_summonable":true
      },
      "component_groups":{
         "true:default":{
            "minecraft:variant":{
               "value":0
            },
            "minecraft:type_family":{
               "family":[
                  "human"
               ]
            },
            "minecraft:despawn":{
               "filters":{
                  "test":"distance_to_nearest_player",
                  "subject":"self",
                  "operator":">",
                  "value":48
               }
            },
            "minecraft:spawn_entity":{
               "entities":[
                  {
                     "min_wait_time":0,
                     "max_wait_time":0,
                     "spawn_entity":"true:zombie_armless",
                     "spawn_event":"minecraft:entity_spawned",
                     "single_use":true,
                     "num_to_spawn":2,
                     "should_leash":true
                  }
               ]
            },
            "minecraft:interact":{
               "interactions":[
                  {
                     "on_interact":{
                        "filters":{
                           "all_of":[
                              {
                                 "test":"has_equipment",
                                 "subject":"other",
                                 "domain":"hand",
                                 "value":"true:zombie_vaccine"
                              }
                           ]
                        },
                        "event":"true:to_vaccinate",
                        "target":"self"
                     },
                     "use_item":true,
                     "interact_text":"action.interact.vaccinate"
                  }
               ]
            },
            "minecraft:damage_sensor":{
               "triggers":[
                  {
                     "on_damage":{
                        "filters":{
                           "any_of":[
                              {
                                 "test":"is_family",
                                 "subject":"other",
                                 "value":"apocalypse"
                              }
                           ],
                           "all_of":[
                              {
                                 "test":"has_damage",
                                 "value":"fatal"
                              }
                           ]
                        },
                        "event":"true:to_zombie"
                     }
                  },
                  {
                     "on_damage":{
                        "filters":{
                           "all_of":[
                              {
                                 "test":"has_damage",
                                 "value":"fatal"
                              }
                           ]
                        },
                        "event":"true:to_dead"
                     }
                  }
               ]
            }
         },
         "true:vaccinated":{
            "minecraft:variant":{
               "value":0
            },
            "minecraft:type_family":{
               "family":[
                  "vaccinated",
                  "female"
               ]
            },
            "minecraft:nameable":{
               
            },
            "minecraft:healable":{
               "items":[
                  {
                     "item":"bread",
                     "heal_amount":10
                  },
                  {
                     "item":"true:tin_of_beans",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_revioli",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_chicken_soup",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_custard",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_macaroni_cheese",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_mushroom_soup",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_oxtail_soup",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_spaghetti_hoops",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_spam",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_tomato_soup",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_tuna",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_vegetable_soup",
                     "heal_amount":20
                  }
               ]
            },
            "minecraft:entity_sensor":{
               "subsensors":[
                  {
                     "minimum_count":1,
                     "event_filters":{
                        "all_of":[
                           {
                              "test":"is_family",
                              "subject":"other",
                              "value":"male"
                           },
                           {
                              "test":"is_daytime",
                              "subject":"self",
                              "operator":"equals",
                              "value":false
                           }
                        ]
                     },
                     "event":"true:attempt_pregnant"
                  }
               ]
            },
            "minecraft:damage_sensor":{
               "triggers":[
                  {
                     "on_damage":{
                        "filters":{
                           "all_of":[
                              {
                                 "test":"has_damage",
                                 "value":"fatal"
                              }
                           ]
                        },
                        "event":"true:to_dead"
                     }
                  }
               ]
            }
         },
         "true:pregnant":{
            "minecraft:variant":{
               "value":1
            },
            "minecraft:type_family":{
               "family":[
                  "pregnant",
                  "female"
               ]
            },
            "minecraft:healable":{
               "items":[
                  {
                     "item":"bread",
                     "heal_amount":10
                  },
                  {
                     "item":"true:tin_of_beans",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_revioli",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_chicken_soup",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_custard",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_macaroni_cheese",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_mushroom_soup",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_oxtail_soup",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_spaghetti_hoops",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_spam",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_tomato_soup",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_tuna",
                     "heal_amount":20
                  },
                  {
                     "item":"true:tin_of_vegetable_soup",
                     "heal_amount":20
                  }
               ]
            },
            "minecraft:damage_sensor":{
               "triggers":[
                  {
                     "on_damage":{
                        "filters":{
                           "all_of":[
                              {
                                 "test":"has_damage",
                                 "value":"fatal"
                              }
                           ]
                        },
                        "event":"true:to_dead"
                     }
                  }
               ]
            },
            "minecraft:timer":{
               "looping":false,
               "randomInterval":false,
               "time":2400.0,
               "time_down_event":{
                  "event":"true:to_having_baby"
               }
            }
         },
         "true:having_baby":{
            "minecraft:variant":{
               "value":1
            },
            "minecraft:timer":{
               "looping":false,
               "randomInterval":false,
               "time":1,
               "time_down_event":{
                  "event":"true:to_reset"
               }
            },
            "minecraft:spawn_entity":{
               "entities":[
                  {
                     "min_wait_time":0,
                     "max_wait_time":0,
                     "spawn_entity":"true:immune_baby",
                     "spawn_event":"true:t_default",
                     "single_use":true,
                     "num_to_spawn":1,
                     "should_leash":false
                  }
               ]
            }
         },
         "true:dead":{
            "minecraft:transformation":{
               "into":"true:katana_trader_corpse<true:to_default>"
            }
         },
         "true:zombie":{
            "minecraft:transformation":{
               "into":"true:zombie_human<true:to_katana_trader>"
            }
         },
         "true:peaceful":{
            "minecraft:transformation":{
               "into":"true:despawn"
            }
         }
      },
      "components":{
         "minecraft:collision_box":{
            "width":0.9,
            "height":1.8
         },
         "minecraft:health":{
            "value":30,
            "max":30
         },
         "minecraft:scale":{
            "value":1.0
         },
         "minecraft:movement":{
            "value":0.26
         },
         "minecraft:hurt_on_condition":{
            "damage_conditions":[
               {
                  "filters":{
                     "test":"in_lava",
                     "subject":"self",
                     "operator":"==",
                     "value":true
                  },
                  "cause":"lava",
                  "damage_per_tick":4
               }
            ]
         },
         "minecraft:navigation.generic":{
            "can_path_over_water":true,
            "avoid_water":true,
            "avoid_damage_blocks":true
         },
         "minecraft:jump.static":{
            
         },
         "minecraft:movement.basic":{
            
         },
         "minecraft:attack":{
            "damage":1
         },
         "minecraft:behavior.melee_attack":{
            "priority":3,
            "track_target":false,
            "reach_multiplier":1.0,
            "speed_multiplier":1.0
         },
         "minecraft:behavior.hurt_by_target":{
            "priority":1
         },
         "minecraft:behavior.look_at_player":{
            "priority":7,
            "look_distance":6.0,
            "probability":0.02
         },
         "minecraft:behavior.random_look_around":{
            "priority":9
         },
         "minecraft:behavior.float":{
            "priority":0
         },
         "minecraft:behavior.random_stroll":{
            "priority":4,
            "speed_multiplier":1.0
         },
         "minecraft:persistent":{
            
         },
         "minecraft:environment_sensor":{
            "triggers":[
               {
                  "filters":{
                     "all_of":[
                        {
                           "test":"is_difficulty",
                           "subject":"self",
                           "operator":"equals",
                           "value":"peaceful"
                        }
                     ]
                  },
                  "event":"true:to_peaceful"
               }
            ]
         },
         "minecraft:equip_item":{
            
         },
         "minecraft:equipment":{
            "table":"loot_tables/equipment/humans/katana_trader.json",
            "slot_drop_chance":[
               {
                  "slot":"slot.weapon.mainhand",
                  "drop_chance":0.3
               }
            ]
         },
         "minecraft:trade_table":{
            "display_name":"§dKatana Trader§r",
            "table":"trading/humans/katana_trader.json",
            "new_screen":true
         },
         "minecraft:behavior.trade_with_player":{
            "priority":1
         },
         "minecraft:behavior.trade_interest":{
            "priority":3,
            "within_radius":4.0,
            "interest_time":5.0,
            "cooldown":5.0
         },
         "minecraft:behavior.look_at_trading_player":{
            "priority":4
         },
         "minecraft:behavior.tempt":{
            "priority":1,
            "speed_multiplier":1.25,
            "items":[
               "true:tin_of_beans",
               "true:tin_of_revioli",
               "true:tin_of_chicken_soup",
               "true:tin_of_custard",
               "true:tin_of_macaroni_cheese",
               "true:tin_of_mushroom_soup",
               "true:tin_of_oxtail_soup",
               "true:tin_of_spaghetti_hoops",
               "true:tin_of_spam",
               "true:tin_of_tomato_soup",
               "true:tin_of_tuna",
               "true:tin_of_vegetable_soup"
            ]
         },
         "minecraft:on_hurt_by_player":{
            "event":"true:hurt",
            "target":"self"
         },
         "minecraft:on_hurt":{
            "event":"true:hurt",
            "target":"self"
         },
         "minecraft:pushable":{
            "is_pushable":true,
            "is_pushable_by_piston":true
         },
         "minecraft:physics":{
            
         }
      },
      "events":{
         "minecraft:entity_spawned":{
            "add":{
               "component_groups":[
                  "true:default"
               ]
            }
         },
         "true:to_vaccinate":{
            "remove":{
               "component_groups":[
                  "true:default"
               ]
            },
            "add":{
               "component_groups":[
                  "true:vaccinated"
               ]
            },
            "queue_command":{
               "command":[
                  "particle true:vaccine ^ ^0.7 ^",
                  "playsound vaccine @a [r=6] ~ ~ ~"
               ]
            }
         },
         "true:attempt_pregnant":{
            "sequence":[
               {
                  "randomize":[
                     {
                        "weight":1,
                        "remove":{
                           "component_groups":[
                              "true:vaccinated"
                           ]
                        },
                        "add":{
                           "component_groups":[
                              "true:pregnant"
                           ]
                        }
                     },
                     {
                        "weight":1000,
                        "add":{
                           "component_groups":[
                              "true:vaccinated"
                           ]
                        }
                     }
                  ]
               }
            ]
         },
         "true:to_having_baby":{
            "remove":{
               "component_groups":[
                  "true:pregnant"
               ]
            },
            "add":{
               "component_groups":[
                  "true:having_baby"
               ]
            }
         },
         "true:to_reset":{
            "remove":{
               "component_groups":[
                  "true:having_baby"
               ]
            },
            "add":{
               "component_groups":[
                  "true:vaccinated"
               ]
            }
         },
         "true:to_dead":{
            "add":{
               "component_groups":[
                  "true:dead"
               ]
            },
            "queue_command":{
               "command":[
                  "particle true:blood_splatter ^ ^1 ^",
                  "particle true:blood_splatter ^ ^2 ^"
               ]
            }
         },
         "true:to_zombie":{
            "add":{
               "component_groups":[
                  "true:zombie"
               ]
            }
         },
         "true:hurt":{
            "queue_command":{
               "command":[
                  "particle true:blood_splatter ^ ^1 ^",
                  "particle true:blood_splatter ^ ^2 ^"
               ]
            }
         },
         "true:to_peaceful":{
            "add":{
               "component_groups":[
                  "true:peaceful"
               ]
            }
         }
      }
   }
}