2

On our server I'd like to switch people to adventure when they enter an area, but when they leave it should set them back to the game mode they were in before entering.

So my question is, is it possible to record player information in the scoreboard or a tag for their game mode and then use it later

e.g. tag @s add GameMode=[m]

1
  • 2
    First question is "Can I query the game mode of a player?" and I think the answer is yes. Then it's just a matter of saving the result of that query to a scoreboard objective for the player, which shouldn't be too hard. – MBraedley Feb 11 at 22:34
3

When they enter the area do:

/tag @a[m=s] add survival

And:

/tag @a[m=c] add creative

And:

/tag @a[m=a] add adventure

Then just change their gamemodes back later accordingly:

/gamemode a @a[tag=adventure,r=5]

etc.

Make sure to untag them:

/tag @a[tag=survival,r=5] remove survival

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.