Jump to content

Recommended Posts

Posted

So, I wanted to see if it was possible to make a single tool that could do multiple things. Like, an axe and pickaxe combined, or maybe a hoe that deals damage like a sword. I can't seem to figure out how one would go about coding such a thing, but I've seen things like it in other mods, so I'm assuming it's possible?

Posted

Make this tool a pick with the mining level you want if you want it as a pick, but then us this method: getStrVsBlock(ItemStack par1ItemStack, Block par2Block)

You can set custom value for each block or i believe according to their material(don't quote me on that)

Not sure if it is a good way, but it works.

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Posted

In 1.7.x, you can use the method setHarvestLevel("axe",n) and setHarvestLevel("pickaxe",m), and so on. Derive from itemTool for a start or the main type of tool it is. Or you could derive from ItemSword and just add in the toolClass settings.

There is more to make it all work than just that, but it should get you started.

Posted

So, I wanted to see if it was possible to make a single tool that could do multiple things. Like, an axe and pickaxe combined, or maybe a hoe that deals damage like a sword. I can't seem to figure out how one would go about coding such a thing, but I've seen things like it in other mods, so I'm assuming it's possible?

 

In my mod "DivineRPG", we have something that is all tools into one, that's called the "Shickaxe"

 

In out open src repo: (https://github.com/TheSlayerMC/DivineRPG) you can find the item that does everything

Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods

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.