Posted July 17, 20187 yr Hey, new modder here. I've been searching for a tutorial on how to make a block (an ore, in my case) drop something other than itself (like redstone ore does), but tutorials I've found have either been outdated or not good for my context (designed for having ore variants, etc) So, that said, could someone please explain how to make my ore drop a random amount (from x to y) of an item other than itself? Here's the code for the block itself: public class OreUranium extends Block implements IHasModel { public OreUranium(String name, Material material) { super(material); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(Main.uraniumtab); setHarvestLevel("pickaxe", 2); setHardness(3.0F); BlockInit.BLOCKS.add(this); ItemInit.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName())); } @Override public void registerModels() { Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory"); } } Any help would be appreciated Edited July 17, 20187 yr by hisui
July 17, 20187 yr Have you tried looking at the vanilla blocks that do this? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
July 17, 20187 yr Author 37 minutes ago, Draco18s said: Have you tried looking at the vanilla blocks that do this? Thank you. Feel a bit silly since I've read before that you should use a different method than vanilla uses for doing drops like that but I guess that's not entirely true since it does work. 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.