Jump to content

How drop items another mod(my mods, buildcraft, ic2 and other) ?


Recommended Posts

Posted

I have my mod named "mod1", which adds things.

I have my other mod named "mod2", which adds mobs

how to make: if both mod set in game, the mobs of mod2 could drop items from mod1?

 

I'm new in eclipse...

I think:

1. in mod2 need check is set mod1. (How?)

2. get itemId of item from mod2.          (How?)

3. drop item.

 

How get itemId for drop if another mod Buildcraft or IC2 ?

 

 

Posted

I have my mod named "mod1", which adds things.

I have my other mod named "mod2", which adds mobs

how to make: if both mod set in game, the mobs of mod2 could drop items from mod1?

 

I'm new in eclipse...

I think:

1. in mod2 need check is set mod1. (How?)

2. get itemId of item from mod2.          (How?)

3. drop item.

 

How get itemId for drop if another mod Buildcraft or IC2 ?

 

1. Loader.isModLoaded(MODID) - where MODID is the mod-ID of the mod you search for, e.g. Loader.isModLoaded("RedPowerWorld")

2. GameRegistry.findItem(modId, name) - where modId is the above-mentioned one, and name is the registered name of the mod item (the second parameter in GameRegistry.registerItem)

 

The second returns null if it can't find the item, so you could skip the first check if the mod is loaded.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.