Hello Folks,
I am working on my own mod. One of the features I want to impelement is a teleport (home/sethome) command.
I got everything to work if cheats are allowed, but my command wont work if cheats are disabled.
I also overwrote the getRequiredPermissionLevel, but that doesn't seem to help
Here's the code for the execute
@Override
public void execute(ICommandSender sender, String[] args)
throws CommandException {
if (sender instanceof EntityPlayer)
{
EntityPlayer player = (EntityPlayer) sender;
HomeHelper.setHome(player.getName(), player.getPosition());
sender.addChatMessage(new ChatComponentText("home set"));
try {
HomeHelper.safeDataToFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
And the override
@Override
public int getRequiredPermissionLevel()
{
return 0;
}
Any help would be appreciated.
Greetz Fail