scoreboard players add @s SpiderChestOW 1
execute at @s[scores={SpiderChestOW=1..1}] run setblock ~ ~ ~ minecraft:chest{LootTable:"chests/spiderden_chest"}
#execute at @s[scores={SpiderChestOW=1..1}] run setblock ~ ~1 ~ hopper
execute at @s[scores={SpiderChestOW=1..199}] run data merge block ~ ~1 ~ {TransferCooldown:0}
#execute at @s[sort=random,limit=1,scores={SpiderChestOW=1..99}] run tp @e[distance=..7,type=item] @s
#execute at @s[sort=random,limit=1,scores={SpiderChestOW=1..99}] run tp @e[distance=..5,type=item] ~1 ~2 ~1
execute at @s[scores={SpiderChestOW=1..99}] run tp @e[distance=..7,type=item] @s
execute at @s[scores={SpiderChestOW=1..99}] run tp @e[distance=..5,type=item] ~1 ~2 ~1

execute at @s[scores={SpiderChestOW=99}] run kill @e[distance=..8,type=spawner_minecart]
execute at @s[scores={SpiderChestOW=199}] run setblock ~ ~1 ~ air
execute at @s[scores={SpiderChestOW=199}] run kill @e[distance=..8,type=item]
#execute at @s[type=armor_stand,scores={SpiderChestOW=1}] run summon spawner_minecart ~ ~2 ~ {id: spawner_minecart,OnGround: 0,MaxNearbyEntities:100,Type: 0,Items: [],Delay: 1,MinSpawnDelay: 13,MaxSpawndelay: 19,SpawnCount: 1,SpawnRange:0,RequiredPlayerRange: 32767,SpawnData:{id:"item",Item:{id:air,Count:1}},SpawnPotentials: [{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:protection",lvl:1}]}}},Weight:10},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:protection",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:protection",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:protection",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:feather_falling",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:feather_falling",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:feather_falling",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:feather_falling",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:blast_protection",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:blast_protection",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:blast_protection",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:blast_protection",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:respiration",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:respiration",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:respiration",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:aqua_affinity",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:aqua_affinity",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:aqua_affinity",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:depth_strider",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:depth_strider",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:depth_strider",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:frost_walker",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:frost_walker",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:frost_walker",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:sharpness",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:sharpness",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:sharpness",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:sharpness",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:sharpness",lvl:5}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:smite",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:smite",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:smite",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:smite",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:smite",lvl:5}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:bane_of_arthropods",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:bane_of_arthropods",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:bane_of_arthropods",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:bane_of_arthropods",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:bane_of_arthropods",lvl:5}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:knockback",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:knockback",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:knockback",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:looting",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:looting",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:looting",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:sweeping",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:sweeping",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:sweeping",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:efficiency",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:efficiency",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:efficiency",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:efficiency",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:silk_touch",lvl:1}]}}},Weight:5},{Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:unbreaking",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:unbreaking",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:unbreaking",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:unbreaking",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:fortune",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:fortune",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:fortune",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:power",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:power",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:power",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:power",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:power",lvl:5}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:punch",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:punch",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:punch",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:punch",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:punch",lvl:5}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:infinity",lvl:1}]}}},Weight:5},{Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:luck_of_the_sea",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:luck_of_the_sea",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:luck_of_the_sea",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:lure",lvl:1}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:lure",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:lure",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:mending",lvl:1}]}}},Weight:5},{Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:efficiency",lvl:3},{id:"minecraft:unbreaking",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:smite",lvl:5},{id:"minecraft:knockback",lvl:2}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:luck_of_the_sea",lvl:3},{id:"minecraft:lure",lvl:3},{id:"minecraft:aqua_affinity",lvl:1},{id:"minecraft:depth_strider",lvl:3}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:protection",lvl:3},{id:"minecraft:mending",lvl:4}]}}},Weight:5},{ Entity:{id:"item",Item:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:protection",lvl:4},{id:"minecraft:mending",lvl:5}]}}},Weight:5},{ Entity:{id:"item",Item:{id:diamond_helmet,Damage:0,Count:1}},Weight:15},{ Entity:{id:"item",Item:{id:diamond_chestplate,Damage:0,Count:1}},Weight:15},{ Entity:{id:"item",Item:{id:diamond_leggings,Damage:0,Count:1}},Weight:15},{ Entity:{id:"item",Item:{id:diamond_boots,Damage:0,Count:1}},Weight:15},{ Entity:{id:"item",Item:{id:diamond_sword,Damage:0,Count:1}},Weight:15},{ Entity:{id:"item",Item:{id:totem_of_undying,Damage:0,Count:1}},Weight:1},{ Entity:{id:"item",Item:{id:golden_carrot,Damage:0,Count:5}},Weight:20},{ Entity:{id:"item",Item:{id:fish,Damage:2,Count:1,tag:{display:{Name:"Coulda been a notch apple"}}}},Weight:1},{ Entity:{id:"item",Item:{id:milk_bucket,Damage:0,Count:1}},Weight:30},{ Entity:{id:"item",Item:{id:tnt,Damage:0,Count:6}},Weight:30},{ Entity:{id:"item",Item:{id:diamond,Damage:0,Count:2}},Weight:30},{ Entity:{id:"item",Item:{id:emerald,Damage:0,Count:5}},Weight:40},{ Entity:{id:"item",Item:{id:gold_block,Damage:0,Count:5}},Weight:20},{ Entity:{id:"item",Item:{id:apple,Damage:0,Count:5}},Weight:30},{ Entity:{id:"item",Item:{id:golden_apple,Damage:0,Count:1}},Weight:30},{ Entity:{id:"item",Item:{id:golden_apple,Damage:1,Count:1}},Weight:4},{ Entity:{id:"item",Item:{id:cobweb,Damage:0,Count:1}},Weight:500},{ Entity:{id:"item",Item:{id:potion,Damage:0,Count:1,tag:{custom_potion_effects:[{id:"minecraft:instant_health",amplifier:1,duration:1,show_particles:0b}]}}},Weight:45},{ Entity:{id:"item",Item:{id:lingering_potion,Damage:0,Count:1,tag:{custom_potion_effects:[{id:"minecraft:instant_damage",amplifier:1,duration:1,show_particles:0b}]}}},Weight:40},{ Entity:{id:"item",Item:{id:splash_potion,Count:1,tag:{display:{Name:"\"GETMEOUTTAHERE\""},custom_potion_effects:[{id:"minecraft:regeneration",amplifier:0,duration:120},{id:"minecraft:speed",amplifier:2,duration:100},{id:"minecraft:haste",amplifier:2,duration:100},{id:"minecraft:resistance",amplifier:0,duration:300},{id:"minecraft:absorption",amplifier:0,duration:1200}],Potion:"minecraft:mundane",CustomPotionColor:3159616}}},Weight:25},{ Entity:{id:"item",Item:{id:experience_bottle,Damage:0,Count:1}},Weight:20},{ Entity:{id:"item",Item:{id:experience_bottle,Damage:0,Count:5}},Weight:20},{ Entity:{id:"item",Item:{id:experience_bottle,Damage:0,Count:12}},Weight:20},{ Entity:{id:"item",Item:{id:experience_bottle,Damage:0,Count:20}},Weight:20}]}
kill @e[type=armor_stand,name=GlowyChestOW2]

execute as @s[scores={SpiderChestOW=200..}] run execute in overworld run data merge block 999982 125 999974 {auto:0b}
kill @s[scores={SpiderChestOW=200..}]
