Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,

 

I'm looking for a tutorial on how to make custom tools and armour on Minecraft 1.5.2. I've followed Havvy's tutorials, but the tools tutorial isn't done yet; I would like to know if anyone would be willing to help me out or to give me a proper tutorial.

 

Thanks by advance,

Have a great day.

You think custom tool like custom axe/pickaxe/shovel or universal tool ?

 

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

  • Author

You think custom tool like custom axe/pickaxe/shovel or universal tool ?

 

I'm thinking of an axe, pickaxe, shovel, sword and hoe; in separate tools.

You need Material for these tools, I think you want to have your own material..

all these lines you need to write into the base class of your mod!

 

 

public static EnumToolMaterial matname = EnumHelper.addToolMaterial("unlocalNameofMaterial",harvest level,maxUses,efficiency,damage,enchantibility);

 

Example of Material:

 

public static EnumToolMaterial STAR = EnumHelper.addToolMaterial("STAR", 2, 625, 6.0F, 4, 10);

 

And this is for the custom tool:

You need to extend:

ItemAxe for custom axe

ItemPickaxe for custom pickaxe

ItemHoe for custom hoe

ItemSword for custom sword

ItemSpade for custom shovel

ItemTool for custom universal tool

Example create a class customAxe and edit the:

public class customAxe

to

public class customAxe extends ItemAxe

And you have to add unimplemented methods...  :)

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

  • Author

You need Material for these tools, I think you want to have your own material..

all these lines you need to write into the base class of your mod!

 

 

public static EnumToolMaterial matname = EnumHelper.addToolMaterial("unlocalNameofMaterial",harvest level,maxUses,efficiency,damage,enchantibility);

 

Example of Material:

 

public static EnumToolMaterial STAR = EnumHelper.addToolMaterial("STAR", 2, 625, 6.0F, 4, 10);

 

And this is for the custom tool:

You need to extend:

ItemAxe for custom axe

ItemPickaxe for custom pickaxe

ItemHoe for custom hoe

ItemSword for custom sword

ItemSpade for custom shovel

ItemTool for custom universal tool

Example create a class customAxe and edit the:

public class customAxe

to

public class customAxe extends ItemAxe

And you have to add unimplemented methods...  :)

 

Can you explain what are the numbers in the EnumHelper ? (I know the harvest level of 3 = minable obsidian, but I forgot about the others)

  • Author

Thank you, I've taken the basic EnumToolMaterial to compare to vanilla Minecraft materials. Thanks again for your time!

  • Author

Hum... I don't know why but my Eclipse doesn't seem to like EnumHelper... "EnumHelper cannot be resolved"

Can you post the code ?

Have you imported all right ?

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

  • Author

public static EnumToolMaterial steelMaterial = EnumHelper.addToolMaterial("materialSteel", 2,550,6.2F,2.5,9);

 

My imports:

 

import s0vietique.alloycraft.common.CommonProxyClass;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

 

I think you need int, not double in section of the code with bold text

public static EnumToolMaterial steelMaterial = EnumHelper.addToolMaterial("materialSteel", 2,550,6.2F,2.5,9);

So, it need to be (I think):

public static EnumToolMaterial steelMaterial = EnumHelper.addToolMaterial("materialSteel", 2,550,6.2F,3,9);

And you need to import this:

import net.minecraftforge.common.EnumHelper;

I wish this will get out the error!  ;)

 

//EDIT

You need to take attention on the variable types, like: (examples)

Float - 0.0F,0.5F,1.6F

Double - 0.0,1.0

Boolean - true/false

Int - 1,2,3,5

String - "String"

Check out my m2cAPI: http://pastebin.com/SJmjgdgK [WIP! If something doesnt work or you have a better resolution, write me a PM]

If you want to use my API please give me a Karma/Thank you

Sorry for some bad words ´cause I am not a walkin´ library!

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.