## Runs from multiple functions -> function player/spawning/tally_<mob>_cap
## @s = player

#scoreboard objectives setdisplay sidebar MobCapReached

scoreboard objectives add MobCapReached dummy
scoreboard players set ..vc MobCapReached 1
scoreboard players set ..bc MobCapReached 1
scoreboard players set ..mc MobCapReached 1
scoreboard players set ..sc MobCapReached 1
scoreboard players set ..wc MobCapReached 1

scoreboard objectives add TotalEndermen dummy
scoreboard players add ..vc TotalEndermen 0
scoreboard players add ..bc TotalEndermen 0
scoreboard players add ..mc TotalEndermen 0
scoreboard players add ..sc TotalEndermen 0
scoreboard players add ..wb TotalEndermen 0

## CHANGE THE NUMBER AFTER "MATCHES" TO INCREASE OR DECREASE THE TOTAL ENDERMEN ALLOWED
execute if score ..vc TotalEndermen matches ..8 run scoreboard players set ..vc MobCapReached 0
execute if score ..bc TotalEndermen matches ..6 run scoreboard players set ..bc MobCapReached 0
execute if score ..mc TotalEndermen matches ..6 run scoreboard players set ..mc MobCapReached 0
execute if score ..sc TotalEndermen matches ..6 run scoreboard players set ..sc MobCapReached 0
execute if score ..wc TotalEndermen matches ..6 run scoreboard players set ..wc MobCapReached 0