Jump to content

Command Creation


Recommended Posts



I am relatively new to Minecraft Modding and have watched 46 Java tutorials already and read a few as well. Not to mention the other 30 something videos I watched for Minecraft Modding. In an effort to further my understanding I wanted to create a Mod that added a wide range of commands, and as i learn i'll let them yield things. I have about 28 command classes already made and they all implement the ICommand interface, but I had questions on how to improve them.


#1. If i have a command that is /home and another that is /home 1 the game will only let me execute the /home, not the /home 1.


#2. How can command creation be more efficient? I see lots of people use CommandMapper, CommandBase, CommandWrapper classes.


#3. How can I color the message or text that is being printed to the user when they enter a command?


#4. How can I add permission nodes to each command?


Additionally I wanted to keep each Command's class simple with relatively 10-15 lines of code depending on what they have to yield. This is why I wanted to create some sort of CommandHandler or CommandManager that acts like an interface or annotation. That way I could just create a new command class and do @ Command { name, alias, usage, message} to create a command. This helps because instead of having to fill out the "template" from iCommand, i can do it in far less lines.


Many thanks in advance.


Edited by Andrew2070
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.

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.


  • Create New...

Important Information

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