Posted November 15, 20186 yr i have a block that a want to multiple items (which it does) but i cant figure out how to get it to stop dropping itself Code Spoiler public class CowCarcassBlock extends CustomBlock { public CowCarcassBlock(String name) { super(Material.ROCK, name); setHardness(10f); setResistance(6000f); this.setHarvestLevel("pickaxe", 0); } @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return super.getItemDropped(state, rand, fortune); } @Override public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { Random rand = new Random(); int n = rand.nextInt(3) + 1; int a = rand.nextInt(3) + 1; int b = rand.nextInt(3) + 1; int c = rand.nextInt(3) + 1; super.getDrops(drops, world, pos, state, fortune); drops.add(new ItemStack(ItemInit.cowbelly, n)); drops.add(new ItemStack(ItemInit.cowleg, a)); drops.add(new ItemStack(ItemInit.cowshoulder, b)); drops.add(new ItemStack(ItemInit.cowrump, c)); } @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT; } @Override public boolean isFullCube(IBlockState state) { return false; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public CowCarcassBlock setCreativeTab(CreativeTabs tab) { super.setCreativeTab(ButcheryMod.BMCT); return this; } } Edited November 15, 20186 yr by Trhod177
November 15, 20186 yr 3 hours ago, Trhod177 said: @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return super.getItemDropped(state, rand, fortune); } Remove the other methods relating to drops and return Items.AIR from this method. About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
November 15, 20186 yr 6 hours ago, Trhod177 said: super.getDrops(drops, world, pos, state, fortune); I believe you can just get rid of this here super call. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 15, 20186 yr Author 9 hours ago, Animefan8888 said: I believe you can just get rid of this here super call. Thanks that fix it..
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.