Posted May 29, 20178 yr I'm working on a scheduled shutdown mod in forge-1.10.2-12.18.3.2281. I want a command that allows for operators to /setdelay <minutes> on the schedule, however, I can't seem to figure out how to check if the ICommandSender is an operator on the server. Since most answers I can find are aimed towards earlier versions of minecraft/forge, these answers are deprecated, and the methods no longer exist. public boolean checkPermission(MinecraftServer server, ICommandSender sender) { } This is the method I'm talking about
May 29, 20178 yr Check out some of the vanilla commands, I'm looking at 1.11.2 source, but I see /** * Return the required permission level for this command. */ public int getRequiredPermissionLevel() { return 2; } in CommandGameMode in net.Minecraft.command, looks like it might be what you're looking for
May 29, 20178 yr Author 6 minutes ago, Ugdhar said: Check out some of the vanilla commands, I'm looking at 1.11.2 source, but I see /** * Return the required permission level for this command. */ public int getRequiredPermissionLevel() { return 2; } in CommandGameMode in net.Minecraft.command, looks like it might be what you're looking for Hello there! Thank your for the quick response! So, what methods would I have to invoke on the ICommandSender to get the actual playerentity? I'm sorry if I'm coming off as a moron, I'm just quite new to Forge/Minecraft modding.
May 29, 20178 yr Well, I've not really done anything with commands myself, but looking at CommandBase, I see both getCommandSenderAsPlayer and getPlayer methods, so I'd hazard a guess at one of those being the solution. Try some things, and come post your code if it's not working, along with logs and/or what it's (not) doing as expected.
May 29, 20178 yr Author Thanks a lot for your replies, guys. I think I've got it working, I'll get back to you when I've tested it!
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.