#timer for events that happend every 20 secs
schedule function inqui:20_sec_shit 20s
#chunkload save state
execute run forceload add ~-100 ~-100 ~100 ~100
#buffs overcharged calamities
execute as @e[tag=overcharged_calamity] run function inqui:20sec_calls/calamity
#buffs overcharged evolved 
execute as @e[tag=overcharged_evolved] run function inqui:20sec_calls/evolved
#extra follow range
execute as @e[type=#spore:fungus_entities] run attribute @s minecraft:generic.follow_range base set 50
execute as @e[type=#inqui:evolved] run attribute @s minecraft:generic.follow_range base set 100
execute as @e[type=#inqui:hyper] run attribute @s minecraft:generic.follow_range base set 150
execute as @e[type=#inqui:calamity] run attribute @s minecraft:generic.follow_range base set 300
execute as @e[type=spore:proto] run attribute @s minecraft:generic.follow_range base set 300
execute as @e[tag=inf_pla_boss] run attribute @s minecraft:generic.follow_range base set 300
#the end
execute unless entity @e[type=spore:mound,nbt={age:5}] run advancement grant @a only inqui:ending
execute if entity @e[type=spore:mound,nbt={age:5}] run advancement revoke @a only inqui:ending
#rooted mycelium mound replacement
execute as @e[type= spore:mound,nbt={age:1}] at @s if block ~ ~ ~ minecraft:air run fill ~-10 ~-1 ~-10 ~10 ~-1 ~10 spore:crusted_bile replace minecraft:water
execute as @e[type= spore:mound,nbt={age:2}] at @s if block ~ ~ ~ minecraft:air run fill ~-15 ~-1 ~-15 ~15 ~-1 ~15 spore:crusted_bile replace minecraft:water
execute as @e[type= spore:mound,nbt={age:3}] at @s if block ~ ~ ~ minecraft:air run fill ~-20 ~-1 ~-20 ~20 ~-1 ~20 spore:crusted_bile replace minecraft:water
execute as @e[type= spore:mound,nbt={age:4}] at @s if block ~ ~ ~ minecraft:air run fill ~-25 ~-1 ~-25 ~25 ~-1 ~25 spore:crusted_bile replace minecraft:water
#V2
execute as @e[type=spore:inf_player, tag=inf_pla_boss] at @s if entity @e[distance=..20, type=!#spore:fungus_entities, type=!minecraft:item,type=!spore:inf_player] run function inqui:20sec_calls/v2
#apostle
execute as @e[tag=apostle] at @s run effect give @e[type=!#spore:fungus_entities,distance=..30] spore:mycelium_ef 300 1 true
#finale
execute unless entity @e[type=spore:mound,nbt={age:5}] as @e[type=#inqui:calamity] run data merge entity @s {rooted:1b}
#nunny
execute as @e[type=spore:proto,tag=nunny] run data merge entity @s {biomass:1000}
#die freeze burned biomass
kill @e[type=item,nbt={Item:{id:"spore:freeze_burned_biomass"}}]