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!