######################################################################################################### *** PHASE 10 - SWAMP *** #########################################################################################################



# BIOME SET #

execute if score fake_player ib_minedcount matches 3501 run function simply_oneblock:ib_biomefill/mangrove_swamp

execute if score fake_player ib_minedcount matches 3501 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":"The air remains heavy, even though it's slightly cooler. A strong smell of silt and rotting water suddenly replaces the scent of lush swamp plants. Croaks can be heard in the distance, along with the crackling of fireflies.","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 3501..3999 store result score fake_player ib_randomizer run random value 1..130

execute if score fake_player ib_randomizer matches 0..20 run setblock 0 64 0 minecraft:grass_block
execute if score fake_player ib_randomizer matches 21..50 run setblock 0 64 0 minecraft:mangrove_log[axis=y]
execute if score fake_player ib_randomizer matches 51..90 run setblock 0 64 0 minecraft:mud
execute if score fake_player ib_randomizer matches 91..100 run setblock 0 64 0 minecraft:moss_block

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: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 3561 run setblock 0 64 0 chest{LootTable:"simply_oneblock:swamp"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 3562 run teleport @s 0 65 0

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

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

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

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

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

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

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



# MOBS RANDOMIZER #

# Frog #

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

execute if score fake_player ib_minedcount matches 3620 run summon minecraft:frog 0 66 0 {PersistenceRequired:1b,variant:warm}
execute if score fake_player ib_minedcount matches 3620 run summon minecraft:frog 0 66 0 {PersistenceRequired:1b,variant:warm}
execute if score fake_player ib_minedcount matches 3620 if score fake_player ib_mob_randomizer matches 36..65 run summon minecraft:frog 0 66 0 {PersistenceRequired:1b,variant:warm}

# Bogged #

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

execute if score fake_player ib_minedcount matches 3740 run summon minecraft:bogged 0 66 0 {PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}],equipment:{mainhand:{id:bow,count:1}}}
execute if score fake_player ib_minedcount matches 3740 run summon minecraft:bogged 0 66 0 {PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}],equipment:{mainhand:{id:bow,count:1}}}
execute if score fake_player ib_minedcount matches 3740 run summon minecraft:bogged 0 66 0 {PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}],equipment:{mainhand:{id:bow,count:1}}}
execute if score fake_player ib_minedcount matches 3740 run summon minecraft:bogged 0 66 0 {PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}],equipment:{mainhand:{id:bow,count:1}}}

# Villager #

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

execute if score fake_player ib_minedcount matches 3860 run summon minecraft:villager 0 66 0 {VillagerData:{type:swamp},PersistenceRequired:1b,Age:-24000,CanPickUpLoot:1b}
execute if score fake_player ib_minedcount matches 3860 run summon minecraft:villager 0 66 0 {VillagerData:{type:swamp},PersistenceRequired:1b,Age:-24000,CanPickUpLoot:1b}

# Slime #

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

execute if score fake_player ib_minedcount matches 3980 run summon minecraft:slime 0 66 0 {PersistenceRequired:1b,Size:3}
execute if score fake_player ib_minedcount matches 3980 run summon minecraft:slime 0 66 0 {PersistenceRequired:1b,Size:3}
execute if score fake_player ib_minedcount matches 3980 run summon minecraft:slime 0 66 0 {PersistenceRequired:1b,Size:3}
execute if score fake_player ib_minedcount matches 3980 run summon minecraft:slime 0 66 0 {PersistenceRequired:1b,Size:3}


