###Uses loot table for randomness###
loot replace entity @s armor.head loot nitk:command/adventure_random

###Assigns corresponding quest###
execute if predicate nitk:adventure/ancient_city run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/ancient_city_quest
execute if predicate nitk:adventure/buried_treasure run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/buried_treasure_quest
execute if predicate nitk:adventure/cave_spider run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/cave_spider_quest
execute if predicate nitk:adventure/conduit run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/conduit_quest
execute if predicate nitk:adventure/dungeon run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/dungeon_quest
execute if predicate nitk:adventure/elder_guardian run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/elder_guardian_quest
execute if predicate nitk:adventure/evoker run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/evoker_quest
execute if predicate nitk:adventure/gapple run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/gapple_quest
execute if predicate nitk:adventure/igloo run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/igloo_quest
execute if predicate nitk:adventure/iron_golem run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/iron_golem_quest
execute if predicate nitk:adventure/jungle_pyramid run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/jungle_pyramid_quest
execute if predicate nitk:adventure/mushroom run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/mushroom_quest
execute if predicate nitk:adventure/music_disc run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/music_disc_quest
execute if predicate nitk:adventure/piglin_brute run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/piglin_brute_quest
execute if predicate nitk:adventure/snow_golem run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/snow_golem_quest
execute if predicate nitk:adventure/stronghold_library run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/stronghold_library_quest
execute if predicate nitk:adventure/trident run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/trident_quest
execute if predicate nitk:adventure/witch run advancement grant @p[scores={nitSuccess=0}] only nitk:adventure/witch_quest

###Removes head item###
item replace entity @s armor.head with air 1