pineapple500 pineapple500 - 1 month ago 11
Java Question

Minecraft - creating spigot plugin - testing for op

I'm creating minecraft spigot plugin, how can I test if player is op?

For example in

if (player.hasPermission("example.permission"){ //do something }


I can use .hasPermission.
Is there something like that for checking op?
Does op have all permissions?

Answer

Use this query to check if the player is OP.

if (player.isOp()) {
//Do the things you wanna do
}
Comments