Jump to content

[1.6.4] How to properly register server commands


Robosphinx

Recommended Posts

How might one properly register a server command without throwing an AbstractMethodError? I've currently got one command registered, which works just fine within eclipse, however, when I export the mod, the mod loads just fine but when the command is entered it throws an AbstractMethodError and barfs up a bunch of locations it's throwing the exception.

 

Here's how I'm registering the command:

 

@EventHandler

@SideOnly(Side.SERVER)

public void serverLoad(FMLServerStartingEvent event) {

    event.registerServerCommand(new ZeusCommand());

}

 

Here's the error it's throwing:

 

https://gist.github.com/anonymous/b648cf189e6453848aab

 

Here's the full log:

 

https://gist.github.com/anonymous/59fcf536246d499662d7

 

I've looked at one other mod, Morpheus (by Quetzi), which uses the same method of registering the command, and I'm using it the same way. Any tips?

The further a society drifts from the truth, the more it hates those who speak it.

Link to comment
Share on other sites

Are you properly reobfuscating your mod? From this:

 

java.lang.AbstractMethodError

at net.minecraft.command.CommandHandler.func_71560_a(CommandHandler.java:119)

 

I'm guessing that either your mod wasn't reobfuscated, or you're not implementing all of the required ICommand methods. Since your code compiles in eclipse, it's more likely that your mod wasn't property reobfuscated. I've used this code myself to successfully register server commands. In my mod, my commands extend CommandBase, because it implements a few useful methods for you.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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