######################################################################################################### *** PHASE 17 - BADLANDS *** ######################################################################################################



# BIOME SET #

execute if score fake_player ib_minedcount matches 7001 run function simply_oneblock:ib_biomefill/badlands

execute if score fake_player ib_minedcount matches 7001 run tellraw @a ["",{"text":"\n\n\n\n\n\n\n\nThe block's energy seems to have changed again","italic":true,"color":"gray"},{"text":"\n\n"},{"text":"It is still as hot around you as ever, and the blazing sun is becoming increasingly unbearable. You hear strange hissing noises that seem to come from everywhere and nowhere at the same time. And even though you feel deep down that you have faced worse, you remain on your guard.","color":"aqua"}]



# GRAVITY WARNING #

execute if entity @e[type=minecraft:falling_block,x=0,y=64,z=0] run tellraw @a {"text":"\n\n\n\n\n\n\n\nSome blocks are subject to gravity, placing a solid block under the infinite block should help","italic":true,"color":"yellow"}



# PARTICLE #

kill @e[type=area_effect_cloud,x=0,y=64,z=0]
summon area_effect_cloud 0.5 65.5 0.5 {custom_particle:{type:ash},Radius:0.2,Duration:100000}



# BLOCK RANDOMIZER #

execute if score fake_player ib_minedcount matches 7001..7499 store result score fake_player ib_randomizer run random value 1..130

execute if score fake_player ib_randomizer matches 1..10 run setblock 0 64 0 minecraft:red_sand
execute if score fake_player ib_randomizer matches 11..20 run setblock 0 64 0 minecraft:coarse_dirt
execute if score fake_player ib_randomizer matches 21..30 run setblock 0 64 0 minecraft:red_sandstone
execute if score fake_player ib_randomizer matches 31..40 run setblock 0 64 0 minecraft:terracotta
execute if score fake_player ib_randomizer matches 41..50 run setblock 0 64 0 minecraft:red_terracotta
execute if score fake_player ib_randomizer matches 51..60 run setblock 0 64 0 minecraft:orange_terracotta
execute if score fake_player ib_randomizer matches 61..70 run setblock 0 64 0 minecraft:yellow_terracotta
execute if score fake_player ib_randomizer matches 71..80 run setblock 0 64 0 minecraft:brown_terracotta
execute if score fake_player ib_randomizer matches 81..90 run setblock 0 64 0 minecraft:white_terracotta
execute if score fake_player ib_randomizer matches 91..100 run setblock 0 64 0 minecraft:light_gray_terracotta



execute if score fake_player ib_randomizer matches 101..102 run setblock 0 64 0 minecraft:gravel
execute if score fake_player ib_randomizer matches 103..104 run setblock 0 64 0 minecraft:clay
execute if score fake_player ib_randomizer matches 105..106 run setblock 0 64 0 minecraft:red_sand
execute if score fake_player ib_randomizer matches 107..108 run setblock 0 64 0 minecraft:stone
execute if score fake_player ib_randomizer matches 109..110 run setblock 0 64 0 minecraft:diorite
execute if score fake_player ib_randomizer matches 110..111 run setblock 0 64 0 minecraft:andesite
execute if score fake_player ib_randomizer matches 112..113 run setblock 0 64 0 minecraft:granite
execute if score fake_player ib_randomizer matches 114 run setblock 0 64 0 minecraft:deepslate
execute if score fake_player ib_randomizer matches 115..116 run setblock 0 64 0 minecraft:coal_ore
execute if score fake_player ib_randomizer matches 117 run setblock 0 64 0 minecraft:deepslate_coal_ore
execute if score fake_player ib_randomizer matches 118 run setblock 0 64 0 minecraft:copper_ore
execute if score fake_player ib_randomizer matches 119 run setblock 0 64 0 minecraft:deepslate_copper_ore
execute if score fake_player ib_randomizer matches 120..121 run setblock 0 64 0 minecraft:iron_ore
execute if score fake_player ib_randomizer matches 122 run setblock 0 64 0 minecraft:deepslate_iron_ore
execute if score fake_player ib_randomizer matches 123 run setblock 0 64 0 minecraft:gold_ore
execute if score fake_player ib_randomizer matches 124 run setblock 0 64 0 minecraft:deepslate_gold_ore
execute if score fake_player ib_randomizer matches 125 run setblock 0 64 0 minecraft:lapis_ore
execute if score fake_player ib_randomizer matches 126 run setblock 0 64 0 minecraft:deepslate_lapis_ore
execute if score fake_player ib_randomizer matches 127 run setblock 0 64 0 minecraft:redstone_ore
execute if score fake_player ib_randomizer matches 128 run setblock 0 64 0 minecraft:deepslate_redstone_ore
execute if score fake_player ib_randomizer matches 129 run setblock 0 64 0 minecraft:diamond_ore
execute if score fake_player ib_randomizer matches 130 run setblock 0 64 0 minecraft:deepslate_diamond_ore



# CHESTS #

execute if score fake_player ib_minedcount matches 7061 run setblock 0 64 0 chest{LootTable:"simply_oneblock:badlands"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 7062 run teleport @s 0 65 0

execute if score fake_player ib_minedcount matches 7121 run setblock 0 64 0 chest{LootTable:"simply_oneblock:badlands"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 7122 run teleport @s 0 65 0

execute if score fake_player ib_minedcount matches 7181 run setblock 0 64 0 chest{LootTable:"simply_oneblock:badlands"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 7182 run teleport @s 0 65 0

execute if score fake_player ib_minedcount matches 7241 run setblock 0 64 0 chest{LootTable:"simply_oneblock:badlands"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 7242 run teleport @s 0 65 0

execute if score fake_player ib_minedcount matches 7301 run setblock 0 64 0 chest{LootTable:"simply_oneblock:badlands"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 7302 run teleport @s 0 65 0

execute if score fake_player ib_minedcount matches 7361 run setblock 0 64 0 chest{LootTable:"simply_oneblock:badlands"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 7362 run teleport @s 0 65 0

execute if score fake_player ib_minedcount matches 7421 run setblock 0 64 0 chest{LootTable:"simply_oneblock:badlands"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 7422 run teleport @s 0 65 0

execute if score fake_player ib_minedcount matches 7481 run setblock 0 64 0 chest{LootTable:"simply_oneblock:badlands"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 7482 run teleport @s 0 65 0



# MOBS RANDOMIZER #

# Armadillo #

execute if score fake_player ib_minedcount matches 7120 store result score fake_player ib_mob_randomizer run random value 1..100
execute if score fake_player ib_minedcount matches 7120 run playsound minecraft:entity.player.teleport block @a 0 66 0
execute if score fake_player ib_minedcount matches 7120 run playsound minecraft:entity.armadillo.ambient block @a 0 66 0

execute if score fake_player ib_minedcount matches 7120 run summon minecraft:armadillo 0 66 0 {PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7120 if score fake_player ib_mob_randomizer matches 1..40 run summon minecraft:armadillo 0 66 0 {PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7120 if score fake_player ib_mob_randomizer matches 41..66 run summon minecraft:armadillo 0 66 0 {PersistenceRequired:1b,Age:-24000}

# Cave Spider #

execute if score fake_player ib_minedcount matches 7240 store result score fake_player ib_mob_randomizer run random value 1..100
execute if score fake_player ib_minedcount matches 7240 run playsound minecraft:entity.player.teleport block @a 0 66 0
execute if score fake_player ib_minedcount matches 7240 run playsound minecraft:entity.spider.ambient block @a 0 66 0

execute if score fake_player ib_minedcount matches 7240 run summon minecraft:cave_spider 0 66 0 {PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7240 run summon minecraft:cave_spider 0 66 0 {PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7240 run summon minecraft:cave_spider 0 66 0 {PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7240 run summon minecraft:cave_spider 0 66 0 {PersistenceRequired:1b}

# Wolf #

execute if score fake_player ib_minedcount matches 7360 store result score fake_player ib_mob_randomizer run random value 1..100
execute if score fake_player ib_minedcount matches 7360 run playsound minecraft:entity.player.teleport block @a 0 66 0
execute if score fake_player ib_minedcount matches 7360 run playsound minecraft:entity.wolf.ambient block @a 0 66 0

execute if score fake_player ib_minedcount matches 7360 run summon minecraft:wolf 0 66 0 {variant:striped,PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7360 if score fake_player ib_mob_randomizer matches 1..40 run summon minecraft:wolf 0 66 0 {variant:striped,PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7360 if score fake_player ib_mob_randomizer matches 41..66 run summon minecraft:wolf 0 66 0 {variant:striped,PersistenceRequired:1b,Age:-24000}

# Cave Spider #

execute if score fake_player ib_minedcount matches 7480 store result score fake_player ib_mob_randomizer run random value 1..100
execute if score fake_player ib_minedcount matches 7480 run playsound minecraft:entity.player.teleport block @a 0 66 0
execute if score fake_player ib_minedcount matches 7480 run playsound minecraft:entity.spider.ambient block @a 0 66 0

execute if score fake_player ib_minedcount matches 7480 run summon minecraft:cave_spider 0 66 0 {PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7480 run summon minecraft:cave_spider 0 66 0 {PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7480 run summon minecraft:cave_spider 0 66 0 {PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 7480 run summon minecraft:cave_spider 0 66 0 {PersistenceRequired:1b}


