#Is there any way to detect if someone has op (or has access to commands in general)

1 messages · Page 1 of 1 (latest)

topaz yarrow
#

^

gusty frostBOT
thorn tinsel
#

You can do it through click events in tellraw

topaz yarrow
#

and how do I run a command if they can't run what ever is in the click event?

fickle sonnet
wanton cypress
#

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

fickle sonnet
#

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

topaz yarrow
#

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)

wanton cypress
#

I think what I said is the only method. Why do you even need this though?

topaz yarrow
#

I wanna make an item that when right-clicked opens different dialog menues depending if you have op or not.

topaz yarrow
wanton cypress
#

I feel like there's a better way

sage orchid
#

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

topaz yarrow
# wanton cypress But why?

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.

chrome magnet
#

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

wanton cypress