Home›Java›Mods›GiveAutoOp
⚠️ SANDBOX / TEST SERVERS ONLY ⚠️
Do NOT install this on a public or production server.

This plugin gives full operator access to every single player that joins.
On a public server that means anyone can grief, ban players, run any command,
and (at default op level 4) manage or shut down your server.
If you install it anywhere other than a private sandbox, you accept that risk.
​

What it does
Gives OP to every player on join, and removes OP on quit — for privacy and to keep ops.json tidy.

Strongly recommended setup
It respects server.properties, so set op-permission-level=3 before use.
Level 3 = moderation commands only. The default (level 4) also allows /stop and other server-management commands.
More about permission levels: minecraft.wiki/w/Permission_level


Good to know
• De-op happens on quit — if the server crashes or you remove the plugin while players are online, they stay OP in ops.json. Check it after a crash.
• If you don't know what "OP" means, this plugin is not for you.


Bukkit/Spigot/Paper 1.21.x + 26.x
(everything Java, 1.21 and newer)

Source:
Code (Java):
package com.darkstarworks.giveautoop ;
import org.bukkit.entity.Player ;
import org.bukkit.event.EventHandler ;
import org.bukkit.event.Listener ;
import org.bukkit.event.player.PlayerJoinEvent ;
import org.bukkit.event.player.PlayerQuitEvent ;
import org.bukkit.plugin.java.JavaPlugin ;
public final class GiveAutoOp extends JavaPlugin implements Listener {
    @Override
    public void onEnable ( ) {
        getServer ( ). getPluginManager ( ). registerEvents ( this, this ) ;
        getLogger ( ). info ( "AutoOp (with Auto-DeOp) Enabled for Sandbox Testing!" ) ;
    }
    @Override
    public void onDisable ( ) {
        // De-op everyone still online so a clean shutdown never leaves stale entries in ops.json
        getServer ( ). getOnlinePlayers ( ). forEach (p -> p. setOp ( false ) ) ;
        getLogger ( ). info ( "AutoOp Disabled." ) ;
    }
    @EventHandler
    public void onPlayerJoin (PlayerJoinEvent event ) {
        Player player = event. getPlayer ( ) ;
       
        if ( !player. isOp ( ) ) {
            player. setOp ( true ) ;
            player. sendMessage ( "§a[Sandbox] You have been automatically granted OP status." ) ;
        }
    }
    @EventHandler
    public void onPlayerQuit (PlayerQuitEvent event ) {
        Player player = event. getPlayer ( ) ;
       
        // Strip OP on leave so the ops.json file stays clean
        if (player. isOp ( ) ) {
            player. setOp ( false ) ;
        }
    }
}
Check out my other stuff:
https://www.spigotmc.org/members/darkstarworks.2385885/
https://modrinth.com/user/darkstarworks
https://modrinth.com/organization/esmp
https://github.com/darkstarworks
k bye

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

GiveAutoOp is a free Minecraft Java mod. Compatible with Minecraft 1.21, 26.1, 26.2. Downloaded 19 times (via Spigot). Download it and open it directly in the game.

Explore more