########################################################################################################## *** PHASE 8 - OCEAN *** #########################################################################################################



# BIOME SET #

execute if score fake_player ib_minedcount matches 2501 run function simply_oneblock:ib_biomefill/ocean

execute if score fake_player ib_minedcount matches 2501 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 sky is back to its beautiful blue colour and you feel like you can taste salt on your tongue. The warm, humid air carries with it an iodised scent that settles all around you. The sound of the waves and the clicking of dolphins can be heard in the distance. Despite this holiday atmosphere, your senses remain alert and ready to face the dangers that lurk in the depths of the water.","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 2501..2999 store result score fake_player ib_randomizer run random value 1..130

execute if score fake_player ib_randomizer matches 1..25 run setblock 0 64 0 minecraft:sand
execute if score fake_player ib_randomizer matches 26..45 run setblock 0 64 0 minecraft:gravel
execute if score fake_player ib_randomizer matches 46..55 run setblock 0 64 0 minecraft:dirt
execute if score fake_player ib_randomizer matches 56..60 run setblock 0 64 0 minecraft:stone
execute if score fake_player ib_randomizer matches 61..70 run setblock 0 64 0 minecraft:clay
execute if score fake_player ib_randomizer matches 71..75 run setblock 0 64 0 minecraft:magma_block
execute if score fake_player ib_randomizer matches 76..80 run setblock 0 64 0 minecraft:wet_sponge
execute if score fake_player ib_randomizer matches 81..88 run setblock 0 64 0 minecraft:prismarine
execute if score fake_player ib_randomizer matches 89..93 run setblock 0 64 0 minecraft:prismarine_bricks
execute if score fake_player ib_randomizer matches 94..96 run setblock 0 64 0 minecraft:dark_prismarine
execute if score fake_player ib_randomizer matches 97..100 run setblock 0 64 0 minecraft:sea_lantern

execute if score fake_player ib_randomizer matches 101..105 run setblock 0 64 0 minecraft:diorite
execute if score fake_player ib_randomizer matches 106..109 run setblock 0 64 0 minecraft:andesite
execute if score fake_player ib_randomizer matches 110..114 run setblock 0 64 0 minecraft:granite
execute if score fake_player ib_randomizer matches 115 run setblock 0 64 0 minecraft:deepslate
execute if score fake_player ib_randomizer matches 116..117 run setblock 0 64 0 minecraft:coal_ore
execute if score fake_player ib_randomizer matches 118 run setblock 0 64 0 minecraft:deepslate_coal_ore
execute if score fake_player ib_randomizer matches 119 run setblock 0 64 0 minecraft:copper_ore
execute if score fake_player ib_randomizer matches 120 run setblock 0 64 0 minecraft:deepslate_copper_ore
execute if score fake_player ib_randomizer matches 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 2561 run setblock 0 64 0 chest{LootTable:"simply_oneblock:ocean"} replace
execute as @e[y=64,dy=1] at @s if score fake_player ib_minedcount matches 2562 run teleport @s 0 65 0

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

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

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

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

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

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

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



# MOBS RANDOMIZER #

# Turtle #

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

execute if score fake_player ib_minedcount matches 2601 run summon minecraft:turtle 0 66 0 {home_pos:[0,64,0],CanPickUpLoot:1b,PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 2601 if score fake_player ib_mob_randomizer matches 1..50 run summon minecraft:turtle 0 66 0 {home_pos:[0,64,0],CanPickUpLoot:1b,PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 2601 if score fake_player ib_mob_randomizer matches 51..100 run summon minecraft:turtle 0 66 0 {home_pos:[0,64,0],CanPickUpLoot:1b,PersistenceRequired:1b,Age:-24000}
execute if score fake_player ib_minedcount matches 2601 if score fake_player ib_mob_randomizer matches 36..65 run summon minecraft:turtle 0 66 0 {home_pos:[0,64,0],CanPickUpLoot:1b,PersistenceRequired:1b,Age:-24000}

# Drowned #

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

execute if score fake_player ib_minedcount matches 2701 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2701 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}],equipment:{mainhand:{id:trident,count:1}}}
execute if score fake_player ib_minedcount matches 2701 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2701 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}

# Dolphin #

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

execute if score fake_player ib_minedcount matches 2801 run summon minecraft:dolphin 0 66 0 {CanPickUpLoot:1b,PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 2801 if score fake_player ib_mob_randomizer matches 1..50 run summon minecraft:dolphin 0 66 0 {CanPickUpLoot:1b,PersistenceRequired:1b}
execute if score fake_player ib_minedcount matches 2801 if score fake_player ib_mob_randomizer matches 51..100 run summon minecraft:dolphin 0 66 0 {CanPickUpLoot:1b,PersistenceRequired:1b,Age:-24000}
execute if score fake_player ib_minedcount matches 2801 if score fake_player ib_mob_randomizer matches 36..65 run summon minecraft:dolphin 0 66 0 {CanPickUpLoot:1b,PersistenceRequired:1b,Age:-24000}

# Drowned #

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

execute if score fake_player ib_minedcount matches 2901 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2901 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2901 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2901 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2901 if score fake_player ib_mob_randomizer matches 1..50 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2901 if score fake_player ib_mob_randomizer matches 51..100 run summon minecraft:drowned 0 66 0 {IsBaby:1,CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2901 if score fake_player ib_mob_randomizer matches 15..35 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}],equipment:{mainhand:{id:trident,count:1}}}
execute if score fake_player ib_minedcount matches 2901 if score fake_player ib_mob_randomizer matches 65..85 run summon minecraft:drowned 0 66 0 {IsBaby:1,CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2901 if score fake_player ib_mob_randomizer matches 36..65 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}]}
execute if score fake_player ib_minedcount matches 2901 if score fake_player ib_mob_randomizer matches 1..35 run summon minecraft:drowned 0 66 0 {IsBaby:1,CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}],equipment:{mainhand:{id:trident,count:1}}}
execute if score fake_player ib_minedcount matches 2901 if score fake_player ib_mob_randomizer matches 66..100 run summon minecraft:drowned 0 66 0 {CanBreakDoors:1,CanPickUpLoot:1b,PersistenceRequired:1b,active_effects:[{id:fire_resistance,duration:24000,show_particles:0b}],equipment:{mainhand:{id:trident,count:1}}}


