ORE BLOCK LOOT BUG'S

Started by ZerTiXDzn on

Topic category: General discussion

Last seen on 09:58, 22. Oct 2018
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ORE BLOCK LOOT BUG'S

I HAVE MADE A NEW ORE IN MY MOD ON MC 1.11.2 AND I HAVE PUT A LOOT IF I BREAK THE BLOCK AND IF A BREAK THE BLOCK I D'ONT RECEIVE ANYTHING Please Help Me The Code If You are Pro :D :

    import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent;   import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.World; import net.minecraft.world.IBlockAccess; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.EnumFacing; import net.minecraft.util.BlockRenderLayer; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemBlock; import net.minecraft.item.Item; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.Minecraft; import net.minecraft.block.state.IBlockState; import net.minecraft.block.material.Material; import net.minecraft.block.SoundType; import net.minecraft.block.Block;   import java.util.Random;   public class mcreator_abyssalOre {   public mcreator_abyssalOre() { }   public static BlockAbyssalOre block;   public static Object instance;   public int addFuel(ItemStack fuel) { return 0; }   public void serverLoad(FMLServerStartingEvent event) { }   public void preInit(FMLPreInitializationEvent event) { block.setRegistryName("abyssalore"); GameRegistry.register(block); GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); }   public void registerRenderers() { }   public void load(FMLInitializationEvent event) { if (event.getSide() == Side.CLIENT) { Minecraft.getMinecraft().getRenderItem().getItemModelMesher() .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("testenvironmentmod:abyssalore", "inventory")); } }   static {   block = (BlockAbyssalOre) (new BlockAbyssalOre().setHardness(3.0F).setResistance(10.0F).setLightLevel(0.0F).setUnlocalizedName("AbyssalOre") .setLightOpacity(0).setCreativeTab(mcreator_cryptixCraftItems.tab)); block.setHarvestLevel("pickaxe", 4); }   public void generateSurface(World world, java.util.Random rand, int chunkX, int chunkZ) { for (int i = 0; i < 5; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(16) + 51; int randPosZ = chunkZ + rand.nextInt(16); (new WorldGenMinable(mcreator_abyssalOre.block.getDefaultState(), 8)).generate(world, rand, new BlockPos(randPosX, randPosY, randPosZ)); } }   public void generateNether(World world, Random random, int chunkX, int chunkZ) { }   static class BlockAbyssalOre extends Block {   int a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0;   boolean red = false;   protected BlockAbyssalOre() { super(Material.ROCK);   setSoundType(SoundType.STONE);   }   @Override public void onBlockAdded(World world, BlockPos pos, IBlockState state) { int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); world.scheduleUpdate(new BlockPos(i, j, k), this, this.tickRate(world));   }   @Override public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { return red ? 15 : 0; }   @Override public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { return red ? 15 : 0; }   @SideOnly(Side.CLIENT) @Override public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.SOLID; }   @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); }   @Override public int tickRate(World world) { return 10; }   @Override public int quantityDropped(Random par1Random) { return 1; }   @Override public Item getItemDropped(IBlockState state, Random par2Random, int par3) { return new ItemStack(mcreator_abyssalStone.block).getItem(); } } }
Last seen on 20:13, 26. Jun 2017
Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It looks like you need a
Fri, 06/23/2017 - 17:02

It looks like you need a pickaxe tier of 4.  That means not even a diamond pickaxe can harvest that ore.  Make sure you lower the tier to 3 if you want diamond pickaxes to mine it, or 2 if you want iron & diamond pickaxes to mine it.

0 is hand/wood, 1 is stone, 2 is iron, & 3 is diamond tier.

Of course, you can always create another pickaxe with a harvest tier of 4 or higher.

Last seen on 20:13, 26. Jun 2017
Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:It looks like you need a
Fri, 06/23/2017 - 17:10

Also, if you don't know wether your pickaxe can mine an ore, check how long it takes to mine it.  With a hardness of 3, it will take 4.5 seconds to break with a proper tool that has an efficiency of 1 (like your hand).  If you're not using a proper tool and it still has an efficiency of 1, it will take 15 seconds instead.  You probably won't be using an efficiency of 1, however, so divide both times by your efficiency number to get the result.  For example, it will take 0.45 seconds to break an ore with an pickaxe with efficiency of 10, but it will take 1.5 seconds if it's not the proper tier to mine it.

Oh, and when I say "efficiency", I don't mean the enchantment.  The "efficiency" I'm talking about it the speed multiplier it takes to break a block.  Here's a list of the efficiencies of the vanilla tools:

Wood: 2x Multiplier (Wood digs twice as fast as your hand.)

Stone: 4x Multiplier

Iron: 6x

Diamond: 8x

Gold: 12x (Pretty outstanding for being so weak.)