Posted December 5, 20186 yr Hello everyone. I have been working on an ore which is supposed to have a chance of dropping additional items with varying amount. I found a method wich seams to be depricated and does not work any more. @Deprecated public ArrayList<ItemStack> onBlockDestroyedByPlayer(World world, int x, int y, int z, int metadata, int fortune){ ArrayList<ItemStack> drops = new ArrayList<ItemStack>(); drops.add(new ItemStack(Items.COAL, world.rand.nextInt(100) + 1)); drops.add(new ItemStack(Items.APPLE, world.rand.nextInt(10) + 1)); if (world.rand.nextFloat() < 0.5F) drops.add(new ItemStack(Items.DIAMOND)); return drops; } Are there any similar methods or did I make some stupid mistake? Thank you in advance.
December 5, 20186 yr 5 minutes ago, SaltStation said: Are there any similar methods or did I make some stupid mistake? What version are you modding for? 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.
December 5, 20186 yr 2 minutes ago, SaltStation said: 1.12 Override the getDrops method in your block class and add the ItemStacks you want to be dropped to the List passed in as the parameter. 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.
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.