#How to get the player's permission level (or check if player is op)?

5 messages · Page 1 of 1 (latest)

unkempt shadow
#

The server is running on 1.19.2 fabric. I wrote this script to force players as survival

PlayerEvents.tick(event => {
    checkGamemode(event)
})

function checkGamemode(event) {
    const { player, server } = event
    let pData = player.persistentData

    const isOp = false;
    if (!isOp) {
        server.runCommand(`gamemode survival ${player.username}`)
    }
}

the constant isOp should automatically check if the player is op. Please help, thx!

warped kettleBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

frozen warren
#

@unkempt shadow I would listen to the forge event of game mode change and act accordingly.
Using tick event for this looks too much

#

oh good you are on fabric

#

my bad