execute if score world MultiplayerScaling matches ..4 run scoreboard players set world MobAmount 1
execute if score world MultiplayerScaling matches 5.. run scoreboard players set world MobAmount 2

title @a subtitle [{"text":"[MINIBOSS] ","color":"red","bold":true},{"text":"Subterranean Silverfish","color":"#6c6a61","bold":true}]

# If less 4 players or less spawn 1
execute if score world MultiplayerScaling matches ..4 run summon silverfish ~ ~50 ~ {DeathLootTable:"kiwi2:entities/30to40_point",Tags:["wave_mob","subterranean_silverfish"],Health:450f,attributes:[{id:"minecraft:attack_damage",base:12},{id:"minecraft:max_health",base:450},{id:"minecraft:movement_speed",base:0.15},{id:"minecraft:scale",base:6.5},{id:"step_height",base:2}],Silent:1b,PersistenceRequired:1b}

# If more than 5 players spawn 2
execute if score world MultiplayerScaling matches 5.. run summon silverfish ~ ~50 ~ {DeathLootTable:"kiwi2:entities/30to40_point",Tags:["wave_mob","subterranean_silverfish"],Health:450f,attributes:[{id:"minecraft:attack_damage",base:12},{id:"minecraft:max_health",base:450},{id:"minecraft:movement_speed",base:0.15},{id:"minecraft:scale",base:6.5},{id:"step_height",base:2}],Silent:1b,PersistenceRequired:1b}
execute if score world MultiplayerScaling matches 5.. run summon silverfish ~ ~50 ~ {DeathLootTable:"kiwi2:entities/30to40_point",Tags:["wave_mob","subterranean_silverfish"],Health:450f,attributes:[{id:"minecraft:attack_damage",base:12},{id:"minecraft:max_health",base:450},{id:"minecraft:movement_speed",base:0.15},{id:"minecraft:scale",base:6.5},{id:"step_height",base:2}],Silent:1b,PersistenceRequired:1b}

spreadplayers 0 0 1 20 false @e[type=silverfish,tag=subterranean_silverfish]