Option to disable game-mode flag reversion on region exit / force an actual gamemode change permanently.
LadyCailinBot opened this issue ยท 5 comments
WORLDGUARD-3928 - Reported by mibby
WorldGuard dev 1712
Paper dev 1316 (Spigot 1.12.2)
The WorldGuard game-mode flag seems to revert players back to their previous gamemode upon exiting the region that has the flag set. However, this causes an issue with players keep creative in worlds they aren't suppose to have it in.
World / Gamemode settings.
- world - Survival
- world_nether - Survival
- build1 - Creative
world does not have any __global__
region flags to force any specific gamemode one way.
world_nether has the __global__
region flagged game-mode: SURVIVAL
set to force survival gameplay.
build1 has the __global__
region flagged game-mode: CREATIVE
set to ensure people have creative in that world.
A player in survival enters the build1 world. He gets set creative since it is a creative world. He then teleports to his home in the nether and gets set forcefully to survival. Then he teleports to spawn which is located in the 'world' world. WorldGuard reverts him back to the gamemode creative he had in the prior world.
Thus, would it be possible to add an option to not preserve prior gamemodes and instead forcefully set the player to the new gamemode defined in the region when entering one with a specified gamemode?
Related? - https://dev.enginehub.org/youtrack/issue/WORLDGUARD-3759
Comment by wizjany
this is the whole point of regions. the flags only apply to the region.
Comment by mibby
Right, but it is reverting people to a gamemode they shouldn't have normally. Going from the creative world back to spawn normally, they lose creative. Going from creative to a location that has a gamemode flag, then to spawn, they "revert" back to creative when they shouldn't have it in that world.
Comment by mibby
@wizjany Another example of players exploiting keeping creative due to worldedit reverting gamemode on exit.
A staff member put the forced survival gamemode flag onto his /warp event region in the main world.
Teleporting there from the creative world puts you in survival. But walking out of that region puts you back into creative since that was their last gamemode. This is despite the multiverse / world setting being survival for that world.
When players teleport from the creative world to main world regardless of region, they properly get set to that world's gamemode. When players teleport from the creative world into a worldguard region in the main world with a gamemode flag set, then walk out of that region, they get set back to creative while in the main world.
Comment by wizjany
in your example in the main post, should world
have gamemode set to survival? if we don't set gamemode back, then they could go from build1
to world
and retain creative.
Comment by mibby
Fortunately multiverse handles that for me. But you would be correct that if WG didn't set players back on exit, then people would retain the new gamemode when entering a region with that set. This is why it would be nice to have it be an option, so you can have it forcefully change the player's gamemode if they enter somewhere.
For me, players do not have the multiverse world gamemode bypass permission so when they swap between worlds (i.e. build1
to world
, it forces them back to that world's intended gamemode. I don't force the __global__
region in world
with a survival gamemode flag because there are some players who are allowed to be in creative in that world and bypass the multiverse gamemode setting.
Multiverse checks player gamemodes on teleport / world change to see if it matches the world's intended gamemode. Because players teleport into a region that sets them survival, they are in the clear. When they leave the region by walking out, they get set back to the previous world's gamemode (creative) by worldgaurd when they should be in survival.