Jump to content

API for own mod mc 1.8[Solved!]


Soulas97

Recommended Posts

so hello guys its rolik here, and i was woundering how can i make own api for some of my mods ? is there any tutorials for that? api would allow people to create addons for mods, that would awesome to see what people can think of :)

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

Link to comment
Share on other sites

API is just an exposed methods and interfaces. Can you specify what you want to do with your API.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Link to comment
Share on other sites

First up:

Anything you can do with IMC messages, do with IMC messages.  You can get really far with this alone if you work hard enough.  While an IMC message types only have 1 message that passes ItemStacks (and only a single stack), you can get more information across than that using the NBT method (as ItemStacks can be converted to NBT data and back again).

 

That said, there may be more complex information that isn't encodable via messages, such as interfaces or recipe lookups.  In order to do anything with your API you need to know what it is that you want from your API.

 

My best advice would be that whatever your API does, use your own API in your own code.  This is the best way to insuring that your API functions correctly.  Secondly, if you ever need to change your API, mark the old methods as @deprecated and leave them in there, even if they do nothing.  The worst thing you can do is have a mod use your API and go dormant (i.e. no longer getting updates for whatever reason) and then you change your API around and delete things or move things.  Now that mod will crash trying to use your new API and people will complain to that mod's author, not you, which will make them very upset.

 

Finally, take a look at some other mods' APIs.  Here's one of mine, which I modeled on Mystcraft's approach, as I really liked that approach.  Inside HardLibAPI are some static objects (set to null) which would be instanced by my mod when run.  The interfaces give visibility to what methods are available (including documentation), without having to supply any actual code.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

my api would allow users to create addons, custom mobs, items, and crafting recipes, same way as lucky block mod works :)

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

Link to comment
Share on other sites

Then you should go look at how Lucky Blocks API works.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

i don't know where to find it, there isn't any url for download :/

 

show me example api with item/mob creation if you can :)

Proud mod developer of:

 

Mob Armor mod

Block monster mod

Clay Living Dolls mod

Much More Spiders mod

Elemental cows reborn

Mr gorilla mod

Link to comment
Share on other sites

i don't know where to find it, there isn't any url for download :/

 

Download the jar file and open it with JD-GUI

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.