aromaa / WorldGuardExtraFlags

Extension for the WorldGuard plugin.
https://www.spigotmc.org/resources/worldguard-extra-flags.4823
MIT License
90 stars 71 forks source link

Add command-RegionHasPlayers and command-RegionNoPlayers flags #119

Closed mle-gall closed 4 years ago

mle-gall commented 4 years ago

Hi ! A bit of context : I'm looking to reduce amount of commandblocks on my server to improve TPS. I'm actually using a lot of 1.13 "testfor" like commandblocks to detect wether there's player or not in certain areas.

I think it would be nice to have flags triggering when there's some players entering the region (and there was not before) and when some players are leaving the region (and no one's left inside).

This would be really close to command-on-entry & command-on-exit flags, except it triggers only when the region passes from having no players to having some, and from having some players to not having any.

aromaa commented 4 years ago

You could instead take advantage of the existing flags and maybe use scoreboards to keep track of that yourself.