//用于修改士兵击杀boss后玩家无法获得进度的问题

let entityAdvancements = [
    { entity: 'born_in_chaos_v1:bonescaller',           advancement: 'born_in_chaos_v1:junior_summoner' },
    { entity: 'born_in_chaos_v1:dark_vortex',           advancement: 'born_in_chaos_v1:the_wind_darkening' },
    { entity: 'born_in_chaos_v1:dire_hound_leader',     advancement: 'born_in_chaos_v1:big_boy' },
    { entity: 'born_in_chaos_v1:glutton_fish',          advancement: 'born_in_chaos_v1:horrorofthe_depths' },
    { entity: 'born_in_chaos_v1:krampus',               advancement: 'born_in_chaos_v1:wrong_santa' },
    { entity: 'born_in_chaos_v1:lifestealer',           advancement: 'born_in_chaos_v1:horror_underthe_mantle' },
    { entity: 'born_in_chaos_v1:lord_pumpkinhead_head', advancement: 'born_in_chaos_v1:pumpkin_lord' },
    { entity: 'born_in_chaos_v1:missioner',             advancement: 'born_in_chaos_v1:dark_creator' },
    { entity: 'born_in_chaos_v1:mother_spider',         advancement: 'born_in_chaos_v1:arachnophobes_nightmare' },
    { entity: 'born_in_chaos_v1:nightmare_stalker',     advancement: 'born_in_chaos_v1:fighting_nightmares' },
    { entity: 'born_in_chaos_v1:pumpkinhead',           advancement: 'born_in_chaos_v1:pumpkin_sir' },
    { entity: 'born_in_chaos_v1:skeleton_demoman',      advancement: 'born_in_chaos_v1:good_demoman' },
    { entity: 'born_in_chaos_v1:spirit_guide',          advancement: 'born_in_chaos_v1:guidetothenextworld' },
    { entity: 'born_in_chaos_v1:spiritof_chaos',        advancement: 'born_in_chaos_v1:exorcism' },
    { entity: 'born_in_chaos_v1:supreme_bonescaller',   advancement: 'born_in_chaos_v1:dismantledto_bones' },
    { entity: 'born_in_chaos_v1:zombie_clown',          advancement: 'born_in_chaos_v1:lifeturnedouttobeacomedy' },
    { entity: 'bosses_of_mass_destruction:gauntlet',    advancement: 'bosses_of_mass_destruction:nether/gauntlet_defeat' },
    { entity: 'bosses_of_mass_destruction:lich',        advancement: 'bosses_of_mass_destruction:adventure/night_lich_defeat' },
    { entity: 'bosses_of_mass_destruction:obsidilith',  advancement: 'bosses_of_mass_destruction:end/obsidilith_defeat' },
    { entity: 'bosses_of_mass_destruction:void_blossom',advancement: 'bosses_of_mass_destruction:adventure/void_blossom_defeat' },
    { entity: 'cataclysm:ancient_remnant',       advancement: 'cataclysm:kill_remnant' },
    { entity: 'cataclysm:ender_golem',           advancement: 'cataclysm:kill_ender_golem' },
    { entity: 'cataclysm:ender_guardian',        advancement: 'cataclysm:kill_ender_guardian' },
    { entity: 'cataclysm:ignis',                 advancement: 'cataclysm:kill_ignis' },
    { entity: 'cataclysm:ignited_revenant',      advancement: 'cataclysm:kill_revenant' },
    { entity: 'cataclysm:maledictus',            advancement: 'cataclysm:kill_maledictus' },
    { entity: 'cataclysm:netherite_monstrosity', advancement: 'cataclysm:kill_monstrosity' },
    { entity: 'cataclysm:the_harbinger',         advancement: 'cataclysm:kill_harbinger' },
    { entity: 'cataclysm:the_leviathan',         advancement: 'cataclysm:kill_leviathan' },
    { entity: 'eeeabsmobs:nameless_guardian',    advancement: 'eeeabsmobs:kill_nameless_guardian' },
    { entity: 'minecraft:ender_dragon',          advancement: 'minecraft:end/kill_dragon' },
    { entity: 'mowziesmobs:bluff',               advancement: 'mowziesmobs:kill_bluff' },
    { entity: 'mowziesmobs:ferrous_wroughtnaut', advancement: 'mowziesmobs:kill_ferrous_wroughtnaut' },
    { entity: 'mowziesmobs:foliaath',            advancement: 'mowziesmobs:kill_foliaath' },
    { entity: 'mowziesmobs:frostmaw',            advancement: 'mowziesmobs:kill_frostmaw' },
    { entity: 'mowziesmobs:grottol',             advancement: 'mowziesmobs:kill_grottol' },
    { entity: 'mowziesmobs:naga',                advancement: 'mowziesmobs:kill_naga' },
    { entity: 'mowziesmobs:umvuthana_raptor',    advancement: 'mowziesmobs:kill_umvuthana_raptor' },
    { entity: 'mowziesmobs:umvuthi',             advancement: 'mowziesmobs:kill_umvuthi' },
]
function handleEntityDeath(entityID, advancementID) {
    EntityEvents.death(entityID, event => {
        event.server.runCommandSilent(`execute at ${event.entity.uuid} run advancement grant @a[distance=..120] only ${advancementID}`)
    })
}
entityAdvancements.forEach(event => {
    handleEntityDeath(event.entity, event.advancement)
})