Jump to content

_Zerys

Members
  • Posts

    6
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

_Zerys's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Can you tell me why I shouldn't override said methods? Since removing them doesn't throw any error's why are they there to begin with? Still rather new to Java.
  2. Found the issue, I needed to essentially tell the code to check the required permission. An oversight to say the least. For those that are having a simliar issue this is what I changed. @Override public boolean checkPermission(MinecraftServer server, ICommandSender sender) { return true; }
  3. lowered it to 2, then 0 and still getting you don't have enough permission to use these commands, the commands are registering. The other issue is i'm not seeing them in /help either.
  4. Already tried that, It was having none of it.
  5. I think you misread what I put, I stated that I was indeed opped and still having issues.
  6. I Want to add a server command I set it up and am not getting any issues or anything the command is simply not showing up via /help. When I tried simply doing /fly and the log comes up with "You do not have permission to access this command". I have also messed with permissions via the code and nothing is working as well. I also tested being op on the test server. Any help? Main class package zTestMod; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandManager; import net.minecraft.command.ServerCommandManager; import net.minecraft.server.MinecraftServer; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @Mod(modid = Ztestmod.MOD_ID, name = Ztestmod.MOD_NAME, version=Ztestmod.VERSION, acceptableRemoteVersions = "*") public class Ztestmod { public static final String MOD_ID = "Ztestmod"; public static final String MOD_NAME = "Ztestmod"; public static final String VERSION = "1.10.2"; @EventHandler public void severStart(FMLServerStartingEvent e) { MinecraftServer server = e.getServer(); e.registerServerCommand(new Fly()); } } Fly Class package zTestMod; import java.util.ArrayList; import java.util.List; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; public class Fly extends CommandBase{ private final List<String> aliases = new ArrayList<String>(); public Fly() { aliases.add("fly"); aliases.add("Fly"); aliases.add("Flying"); } @Override public int getRequiredPermissionLevel() { return 4; } @Override public String getCommandUsage(ICommandSender commandSender) { return getCommandName() + " help"; } @Override public List<String> getCommandAliases() { return aliases; } @Override public int compareTo(ICommand o) { // TODO Auto-generated method stub return 0; } @Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { // TODO Auto-generated method stub } @Override public boolean checkPermission(MinecraftServer server, ICommandSender sender) { // TODO Auto-generated method stub return false; } @Override public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos) { // TODO Auto-generated method stub return null; } @Override public boolean isUsernameIndex(String[] args, int index) { // TODO Auto-generated method stub return false; } @Override public String getCommandName() { // TODO Auto-generated method stub return "/fly"; } public boolean canCommandSenderUseCommand(ICommandSender sender) { return true; } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.