Can we disable only a specific command for a specific Minecraft server operator?
Lately a operator is misusing some admin commands. Is it possible for us to disable /give and /gamemode commands for him in his op.json file?
Version 1.17.1, Java Edition, server hosted from Aternos
11 Answer
Vanilla Way
You can't. This isn't supported; you can't be an op but be unable to access these commands as /give and /gamemode belong to Level 1 (cheats) permissions; second-lowest and will lock them out of other commands.
See What does op-permission-level do?.
Permissions Way (Requires Plugins and Bukkit/Spigot/Paper)
Give the following permission nodes and deop your player:
minecraft.command.clearminecraft.command.difficultyminecraft.command.effectminecraft.command.gameruleminecraft.command.summonminecraft.command.setblockminecraft.command.tpminecraft.command.banminecraft.command.deopminecraft.command.whitelistminecraft.command.kickminecraft.command.opminecraft.command.stopminecraft.command.saveminecraft.command.save-all
Also, you shouldn't be giving away op to players you don't want cheating. That's on you; just /deop them. By giving all operator powers other than /give or /gamemode, what's stopping them from them just /baning you out of retaliation?