Posted September 11, 201312 yr I want to find out if the players is op or not does anyone know how to do this?
September 11, 201312 yr I want to find out if the players is op or not does anyone know how to do this? These are some utility functions I wrote but have not tested in multiplayer (can't get Eclipse to launch the server). They do work for singleplayer however. public boolean isOp (String playerName) { // Check if multiplayer and OP or singleplayer and commands allowed (cheats) return MinecraftServer.getServer().getConfigurationManager().areCommandsAllowed(playerName); } public boolean isOp (EntityPlayer player) { return isOp(player.getEntityName()); } public boolean isOp (EntityLiving entity) { if (entity instanceof EntityPlayer) return isOp(entity.getEntityName()); else return false; }
January 6, 201411 yr Just for the record, the method changed (as of version 9.11.1.953 for 1.6.4 from 11/21/2013 03:31:15 PM): static public boolean isPlayerOp(String name) { return MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(name); }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.