A EnumToolMaterial can be incredible handy. EnumToolMaterial is used for tools, it holds the information on how fast the tool mines, how hard it hits, and so on.
To make our custom EnumToolMaterial we only need a little bit of code.
This code is a nasty bit to understand at first for some people.
To make a EnumToolMaterial Forge has created a class called EnumHelper, and EnumHelper got a method called 'addToolMaterial'.
The firstone being a String. This String is the name of the EnumToolMaterial.
The second is a int of the harvest level. This is the level of material this tool can harvest.
Obsidian is a block only diamond can break. diamond is set to 3 at harvest level.
If you have harvest level at 3 i can harvest all kinds of stuff, everything in normal minecraft.
The third being the max uses this tool has.
The forth is efficiencyOnProperMaterial, this is a float, and this tells the strength of this tool agains blocks that it is effective against.
Like pickaxe on stone or shovel on dirt.
Diamond at 8.0F here, and Gold at 12.0F
The fifth is the damageVsEntity, this tells how hard this tool is on another entity/mob
And the last is the enchantability. every enchantment has its max enchantability. if this argument is over that it will not be able to enchant that spesific enchantment. in other word, the higher, the better enchantments on this tool
Could you do a video for this possibly? I got a pickaxe added and working and all that, but now I want to have this pickaxe be a "tier" up from diamond. For this i know I need to add a new EnumToolMaterial using
But I am confused on which class I add this into, Is it into, my base mod class? EnumHelper?
I am relitivly new to modding minecraft but (unlike some new modders) I am not completly clueless. I am just a bit stumped.
Help (as soon as possible) would be greatly appreciated. Also i can post my code to pastebin if needed.
Could you do a video for this possibly? I got a pickaxe added and working and all that, but now I want to have this pickaxe be a "tier" up from diamond. For this i know I need to add a new EnumToolMaterial using
But I am confused on which class I add this into, Is it into, my base mod class? EnumHelper?
I am relitivly new to modding minecraft but (unlike some new modders) I am not completly clueless. I am just a bit stumped.
Help (as soon as possible) would be greatly appreciated. Also i can post my code to pastebin if needed.
All mods i am creating is working for 1.4.7! and contains video tutorial!
Uploading Modding Tutorials every single day!
Hit up my channel at http://youtube.com/ScratchForFun!
Today we create an 'EnumToolMaterial' for 1.4.7!
Main mod class
To make our custom EnumToolMaterial we only need a little bit of code.
This code is a nasty bit to understand at first for some people.
To make a EnumToolMaterial Forge has created a class called EnumHelper, and EnumHelper got a method called 'addToolMaterial'.
Now, this method needs 6 arguments.
The firstone being a String. This String is the name of the EnumToolMaterial.
The second is a int of the harvest level. This is the level of material this tool can harvest.
Obsidian is a block only diamond can break. diamond is set to 3 at harvest level.
If you have harvest level at 3 i can harvest all kinds of stuff, everything in normal minecraft.
The third being the max uses this tool has.
The forth is efficiencyOnProperMaterial, this is a float, and this tells the strength of this tool agains blocks that it is effective against.
Like pickaxe on stone or shovel on dirt.
Diamond at 8.0F here, and Gold at 12.0F
The fifth is the damageVsEntity, this tells how hard this tool is on another entity/mob
And the last is the enchantability. every enchantment has its max enchantability. if this argument is over that it will not be able to enchant that spesific enchantment. in other word, the higher, the better enchantments on this tool
The ingame EnumToolMaterials for you to compare
Hope this helped you!
Be sure to subscribe and follow Link Removed!
Everything I have done is at my youtube channel!
Have any ideas? Please feel free to comment at any of my videos or in Link Removed! You can also email me at: [email protected]
public static EnumToolMaterial genericToolMaterial = EnumHelper.addToolMaterial("GENERIC", 4, 2500, 20.0F, 5, 100);
But I am confused on which class I add this into, Is it into, my base mod class? EnumHelper?
I am relitivly new to modding minecraft but (unlike some new modders) I am not completly clueless. I am just a bit stumped.
Help (as soon as possible) would be greatly appreciated. Also i can post my code to pastebin if needed.