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

Here is my problem am made a custom axe tool and when I entered in game the axe doesn't act like one or he is not recognize as a axe

if the problem come from me am sorry.

 

but in case,here is my code

 

 

package jejeliteSimplelogic;

 

import javax.tools.Tool;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockWood;

import net.minecraft.block.material.MapColor;

import net.minecraft.block.material.Material;

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

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.SidedProxy;

import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.Item;

import net.minecraft.item.ItemAxe;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.EnumHelper;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

import jejeliteSimplelogic.ToolWoodAxe;

import net.minecraft.item.EnumToolMaterial;

 

@Mod(modid="SimpleLogicMod", name="Simple Logic", version="0.1")

@NetworkMod(clientSideRequired=true, serverSideRequired=false)

 

public class SimpleLogicMod {

 

//Instance of the mod

public static SimpleLogicMod instance;

 

//Initialisation des outils

 

public static Item WoodHachet;

 

// Initialisation de la hachet

 

public static EnumToolMaterial CHIP = EnumHelper.addToolMaterial("CHIP", 0, 26, 2.0F, 0F, 4);

 

 

    @EventHandler

    public void preInit (FMLPreInitializationEvent event) {

        // Stub Method

   

    //Outils

   

    WoodHachet = new ToolWoodAxe (255,CHIP).setUnlocalizedName("simplelogic:hachet");

       

    //enregistrement de la hachet

      GameRegistry.registerItem(WoodHachet, "Hachet");

      LanguageRegistry.addName(WoodHachet, "Hachet");

     

      //  objets et blocks

      ItemStack StickStack  = new ItemStack(Item.stick);

      ItemStack planksStack = new ItemStack(Block.planks); 

     

    // recette   

        // recette pour "planks"

        GameRegistry.addRecipe(new ItemStack(Block.planks), "s", "s",

                's', StickStack);

        // recette pour "hachet"

        GameRegistry.addRecipe(new ItemStack(WoodHachet), "ps", " s",

                's', StickStack, 'p', planksStack);

}

 

   

@EventHandler

public void load (FMLInitializationEvent event) {

   

}

 

@EventHandler

public void postInit (FMLPostInitializationEvent event) {

    // Stub Method

}

 

}

 

 

 

and the ToolAxeWood class

 

 

package jejeliteSimplelogic;

 

import com.jcraft.jorbis.Block;

import net.minecraft.block.*;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.ItemAxe;

 

public class ToolWoodAxe extends ItemAxe

{

 

    public ToolWoodAxe(int par1, EnumToolMaterial par2EnumToolMaterial) {

super(par1, par2EnumToolMaterial);

    }

   

public void registerIcons(IconRegister iconRegister) {

itemIcon = iconRegister.registerIcon("simplelogic:hachet");

}

 

}

 

 

note I change the wood and dirt material to requiretool(set.requiretool)

 

 

Not sure about 1.6, but in 1.5 you have to register your tool with MinecraftForge.setToolClass.

 

PS: You can directly pass "ingredient" items to the recipe method (if you don't want to setup damage or NBT) - GameRegistry.addRecipe(new ItemStack(Block.planks), "s", "s", 's', Item.stick);

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

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.