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

hi im having trouble getting my ore to drop my items using meta data

 

BlockOreEmeraldCrystal class:

package fergoman007.mods.fergotools.block;

import java.util.Random;

import fergoman007.mods.fergotools.FergoTools;
import fergoman007.mods.fergotools.lib.Reference;
import fergoman007.mods.fergotools.lib.Strings;
import fergoman007.mods.fergotools.lib.Textures;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.world.World;

public class BlockOreEmeraldCrystal extends Block {

public BlockOreEmeraldCrystal(int par1, Material par2Material) {
	super(par1, par2Material);
	this.setUnlocalizedName(Strings.oreEmeraldCrystal);
	this.setHardness(2.5f);
	this.setStepSound(soundStoneFootstep);
	this.setResistance(50f);
	this.setCreativeTab(FergoTools.tabFergoBlocks);
}

public void registerIcons(IconRegister register)
{
	blockIcon = register.registerIcon(Reference.TEXTURE_LOC + Textures.oreEmeraldCrystalTexture);
}

public int damageDropped(int metadata)
{
	switch(metadata)
	{
	case 1: return FergoTools.fergoMaterials.itemID;
	}
	return metadata;
}

@Override
public int idDropped(int metadata, Random random, int par2)
{
	switch(metadata)
	{
	case 1 : return FergoTools.fergoMaterials.itemID;
	// Error Case
	default: return -1; // air
	}
}

public int quantityDropped(int par1, Random rand, int par2)
{
	return 3 + rand.nextInt(4) + 1;
}

public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta)
{
	this.dropXpOnBlockBreak(world, x, y, z, 4);
}

}

 

i would appreciate the help

 

You may also want

@Override
public int idDropped(int metadata, Random random, int par2)
{
               return FergoTools.fergoMaterials.itemID;
}

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.