Moving Tools to a Custom Creative Tab

Started by JujuBeans on Mon, 01/02/2017 - 19:12

Topic category: Advanced modding

Last seen on 20:30, 23. Aug 2019
Joined Jan 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Moving Tools to a Custom Creative Tab
Mon, 01/02/2017 - 19:12 (edited)

Ok, I figured out how to move armor to a custom creative tab that I made. However, I cannot figure out where to put the line for moving tools to a custom tab. My tab is called  

(mcreator_clothingCraftBase.tab) 

Where would I put this?

or, here is the text:

 

import net.minecraftforge.common.util.*;public class mcreator_halitePickaxe{

public mcreator_halitePickaxe(){}

public static Item block;
public static Object instance;public void load(){
ItemStack stack = new ItemStack(block, 1);
GameRegistry.addRecipe(stack, new Object[]{
    "012", "X4X", "X7X", Character.valueOf('0'), new ItemStack(mcreator_rockSalt.block, 1), Character.valueOf('1'), new ItemStack(mcreator_rockSalt.block, 1), Character.valueOf('2'), new ItemStack(mcreator_rockSalt.block, 1), Character.valueOf('4'), new ItemStack(Items.stick, 1), Character.valueOf('7'), new ItemStack(Items.stick, 1), 
});}
public void generateNether(World world, Random random, int chunkX, int chunkZ){}
public void generateSurface(World world, Random random, int chunkX, int chunkZ){}
public int addFuel(ItemStack fuel){return 0;}
public void serverLoad(FMLServerStartingEvent event){}
public void preInit(FMLPreInitializationEvent event){}
public void registerRenderers(){}

static{
Item.ToolMaterial enumt = EnumHelper.addToolMaterial("HALITEPICKAXE", 3, 100, 4F, 5, 9);block = (Item)(new ItemPickaxe(enumt){public Set<String> getToolClasses(ItemStack stack){
HashMap<String, Integer> ret = new HashMap<String, Integer>();
ret.put("pickaxe", 3);
return ret.keySet();
}
}).setUnlocalizedName("HalitePickaxe").setTextureName("pickaxehalite2");
Item.itemRegistry.addObject(743, "HalitePickaxe", block);

}

}

Edited by JujuBeans on Mon, 01/02/2017 - 19:12
Last seen on 20:03, 30. Apr 2019
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
There's an easier way to do
Mon, 01/02/2017 - 23:42

There's an easier way to do all of this, but I'm not 200% sure how it works. I know the basic premise though.

 

Instead of creating a new tool, create a new item. Set the tool type to whatever it is, for example pickaxe/axe/sword/custom (not sure what the custom option does, so do more research before choosing that one). I've never done this before, so either it creates a new page with all of the tool power and stuff, or you have to manually go into the code and change the power. Either way, within the item directory you can choose a tab to put it under.

 

Alternatively, if you go into the code and search (type in the top left textbox) "tab" without the quotation marks,  then you can change whatever it is (from what I remember it's something like creativeTab.tabBlock, creativeTab.tabTools, etc) to mCreator_myTab.tab (or whatever your tab name is), or you could change it to another vanilla tab like creativeTab.tabTransportation

 

Hope that helped,

  -A

Last seen on 20:30, 23. Aug 2019
Joined Jan 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Yes! Thank you, that helps a
Wed, 01/04/2017 - 00:26

Yes! Thank you, that helps a lot. I was making swords as items and setting them to their ID. I did not even think to do that for my tools--even though it says so right there. haha. I was overthinking again. :D