#Is there any way to detect if someone has op (or has access to commands in general)
1 messages · Page 1 of 1 (latest)
You can do it through click events in tellraw
and how do I run a command if they can't run what ever is in the click event?
exactly what way do you want to achieve with this? Is it to like ask the player if they are /op and checking the answer etc?
You can op them with /op and then deop them with /deop if they weren't an op before
But you'll have to change something in your server files i think
yeah functions can not run /op on default you have to change the configs to make functions be able to run permission-level 4 commands
I want to be able to check for if a player has op or has access to commands that can be in an "execute if" command. Is there not a predicate or something that checks for this? (I also want this to work in single player)
I think what I said is the only method. Why do you even need this though?
I wanna make an item that when right-clicked opens different dialog menues depending if you have op or not.
well yeah but you can't run /op or /deop in singleplayer
But why?
I feel like there's a better way
i do believe i could use the solution for this problem in some of my datapacks as well XD this sounds like a useful thing in some specific cases altho i cant think of any way of solving this problem rn sry
I want to make a guide book item for my datapack but I also want to make some admin items for testing specific features of the datapack and instead of making two seperate items I wondered if there is any way I can merge them into one. That's why.
a really lazy approach could be just checking if the player is in creative mode. It wouldn't be exactly the same as checking if the player is op but if it is a survival world and only admins can be in creative that could be a solution
This is exactly what i would do