An Example User
An Example User

Reputation: 23

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?

Upvotes: 0

Views: 388

Answers (1)

Plasma
Plasma

Reputation: 46

Use this query to check if the player is OP.

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

Upvotes: 3

Related Questions