7

I am currently working on a minecraft map for realms, and was wondering if there is any way to check a players op/permission level.

In a minigame, no one has operator permissions except the owner who is an operator with level 0 in order to be able to get into the server when it's full, and settings cannot be changed. Control panels normally designed to be used by operators may need to be updated to allow any player to use them.

(From the minecraft atlas guidelines page)

So how do I check if a player is operator? (Through datapacks/commands)

1
  • Maybe try an execute as command? Where I'm thinking is that maybe you could have them run a command that only operators can do and check if it worked or not... I'm not too sure though
    – c1uq92
    Commented Jul 19, 2021 at 16:26

1 Answer 1

1

Short answer:

You basically can't.

Long answer:

If you're in a very controlled environment (such as a custom map) you could check for things happening that could only occur if a player has a certain OP power, including but not limited to

  • them joining eventhough the server is full (a Realm has 10 slots, so if someone joins as the 11th player you know they at least have OP permission lvl 0). This has the caveat that you need to know the slot amount, which is a setting in the server and cannot be checked by commands.
  • them teleporting around when your datapack isn't doing that. Be careful with this, as operators can also always affect other players, so it's not necessarily the person who teleported who is the OP.
  • them changing gamemode. Again, it might not be them who is the OP.

All of these are quite unreliable or require you to have further knowledge of the server your map is running on, so they are questionable and unreliable and really shouldn't be used by anyone to determine if someone is OP.
The best course of action is generally to assume that nobody playing the map is OP.

Situation based answer:

Pretend there is nobody who is OP.

Since you're asking is in the context of realms maps, the solution here is really simple: Everyone should be able to change options, not just Operators. You should treat everyone as if they aren't OP (because they are) and make it so your settings/interfaces don't require OP to use them.

So if you're relying on OP players to do something, like fly to an elevated position you can't get to in survival/adventure, changes scoreboard scores to change settings, etc. you have to find a way for people without OP to do these things as well (e.g. using signs instead of commands to change settings in an for anyone easy to access area).

For Realms you can generally assume that players are friends / in communication with each other, so that its fine for anyone to change the settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.