Posted October 9, 201510 yr so ive been working on a custom command and it doesn't seem to work i cant use the command in game. am i doing this right? or am i missing something. heres my common proxy: public class CommonProxy { public void registerRenders(){ RecipesInit.smeltingRCP(); } @EventHandler public void serverLoad(FMLServerStartingEvent event) { // register server commands event.registerServerCommand(new msssg()); } } and heres the command class: public class msssg extends CommandBase { @Override public int compareTo(Object arg0) { // TODO Auto-generated method stub return 0; } @Override public String getName() { // TODO Auto-generated method stub return "mssssg"; } @Override public String getCommandUsage(ICommandSender sender) { // TODO Auto-generated method stub return "mssssg messa"; } @Override public List getAliases() { // TODO Auto-generated method stub return this.getAliases(); } @Override public void execute(ICommandSender sender, String[] args) throws CommandException { EntityPlayer playerIn1 = (EntityPlayer) sender; sender.addChatMessage(new ChatComponentText("TEST2345234234234234")); } @Override public boolean canCommandSenderUse(ICommandSender sender) { // TODO Auto-generated method stub return true; } @Override public List addTabCompletionOptions(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; } }
October 9, 201510 yr for 1.8 you want to implement ICommand Also I can not see a constructor, should add one with no parameters but inside the constructor add your aliases you want it to allow.
October 9, 201510 yr Author what is the constructor it does not ask for one. can you paste the constructor
October 9, 201510 yr Author now i get this every time i try to play the game [18:34:41] [server thread/INFO] [FML]: The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED. Errors may have been discarded. [18:34:41] [server thread/INFO] [FML]: The state engine was in incorrect state ERRORED and forced into state AVAILABLE. Errors may have been discarded.
October 9, 201510 yr for 1.8 you want to implement ICommandWhat? No! you're not? that's how I did all of my commands and they work, what's the better way?
October 9, 201510 yr Author statphantom your right you solved my problems , Thanks!! all i needed was the proper constructor.
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.