EmptyServerCommands [API v5]
This plugin automatically executes the commands specified in the config when the server is empty for a specified amount of time.
commands=["stop"] # Duration in minutes the server has to be empty to execute the commands. delay=20 # Max. amount of players that can be on the server and it is still marked as 'empty'. trigger-player-count=0 # Whether it should be waited for at least one player to join before the plugin is activated. wait-for-first-player=false
Thanks to @ryantheleach for some ideas and inspiration!