pineapple500 pineapple500 - 1 year ago 165
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 Source

Use this query to check if the player is OP.

if (player.isOp()) {
//Do the things you wanna do
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download