
# -> If setting is disabled then return
execute if score #or.setting.no_monsters OverlyRealistic.Settings.ArbitrarySetting matches 0 run \
    return run \
        gamerule spawn_monsters true

# -> Remove aggro animals
execute as @e\
    [\
        type=#overly_realistic:no_monsters_setting_mobs,\
        x=0,\
    ] \
    at @s run \
        function overly_realistic:main/settings/setting_additionals/setting_9/remove_monster

# -> Set gamerule
gamerule spawn_monsters false

# -> Loop
schedule function overly_realistic:main/settings/setting_additionals/setting_9/no_monsters_loop_1 30s
