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

So I have lots of custom ores and I want each one to be mineable only with the previous tier of ore

For example, Orichulum can only be mined with Diamond, Mythril only with Orichulum, and so on.

 

But for some reason, every tool I make can mine every block I make, regardless of its harvest level.

What am I doing wrong?

 

ToolMaterials:

public static ToolMaterial ORICHULUM = EnumHelper.addToolMaterial("ORICHULUM", 4, 1800, 9F, 4F, 50);
public static ToolMaterial MYTHRIL = EnumHelper.addToolMaterial("MYTHRIL", 5, 2100, 10.0F, 6.0F, 12);
public static ToolMaterial ERIDIUM = EnumHelper.addToolMaterial("ERIDIUM", 6, 2800, 11.0F, 8.0F, 14);

 

Tools:

orichulumPick = new com.pixelmoncore.tools.nightmarePick(ORICHULUM).setCreativeTab(tabPixelmonCoreTools).setUnlocalizedName("orichulumPick").setTextureName("pixelmoncore:" + "orichulumPick");
mythrilPick = new com.pixelmoncore.tools.nightmarePick(MYTHRIL).setCreativeTab(tabPixelmonCoreTools).setUnlocalizedName("mythrilPick").setTextureName("pixelmoncore:" + "mythrilPick");

package com.pixelmoncore.tools;

import java.util.List;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;

public class orichulumPick extends ItemPickaxe
{
public orichulumPick(ToolMaterial material)
{
	super(material);
	this.setMaxStackSize(1);
}
    public void addInformation(ItemStack item, EntityPlayer player, List list, boolean par4)
    {
    	list.add("Can mine Mythril");     	
    }	

}

package com.pixelmoncore.tools;

import java.util.List;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;

public class mythrilPick extends ItemPickaxe
{
public mythrilPick(ToolMaterial material)
{
	super(material);
	this.setMaxStackSize(1);
}
    public void addInformation(ItemStack item, EntityPlayer player, List list, boolean par4)
    {
    	list.add("Can mine Eridium");     	
    }	

}

 

Blocks:

package com.pixelmoncore.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;


public class orichulumOre extends Block
{
public orichulumOre()
{
	super(Material.rock);
	this.setHardness(4F);
	this.setResistance(5F);
}
    public void setHarvestLevel(String toolClass, int level)
    {
        for (int m = 0; m < 16; m++)
        {
            setHarvestLevel("pickaxe", 3);
        }
    }
}

package com.pixelmoncore.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;


public class mythrilOre extends Block
{
public mythrilOre()
{
	super(Material.rock);
	this.setHardness(6F);
	this.setResistance(5F);
}
    public void setHarvestLevel(String toolClass, int level)
    {
        for (int m = 0; m < 16; m++)
        {
            setHarvestLevel("pickaxe", 4);
        }
    }
}

If this is for 1.7.2 then put the setHarvestLevel in your constructor like:

this.setHarvestLevel("pickaxe", Whatever_level);

0 = Wood and Gold,  1 = Stone, 2 = Iron, 3 = Diamond

  • Author

Ah, I thought that might be it, but I've been going off of tutorials that showed it the way I had it, so...

Got it working, thanks.

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.