Posted August 11, 20205 yr Hello. I have made a sweet berry bush block, and I'm trying to change its drop from Items.SWEET_BERRIES to Registry.BLUEBERRY.get(). For some reason, this isn't working in game. Here's my code: package com.pickleface.survival.blocks; import com.pickleface.survival.Registry; import net.minecraft.block.*; import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; public class BlueberryBush extends SweetBerryBushBlock { public BlueberryBush() { super(Block.Properties.create(Material.PLANTS) .tickRandomly() .doesNotBlockMovement() .sound(SoundType.SWEET_BERRY_BUSH) .zeroHardnessAndResistance() ); } @Override public ItemStack getItem(IBlockReader block, BlockPos pos, BlockState state) { return new ItemStack(Registry.BLUEBERRY.get()); } } The part that controls its drops is at the Override. Also, I get 2 warnings saying "Not annotated method overrides method annotated with @MethodsReturnNonnullByDefault" and "Not annotated parameters overrides @ParametersNonnullByDefault". Any help is appreciated. Thanks. Have some lorem ispum.
August 11, 20205 yr Sounds like you haven't correctly overridden the method. That is, the original has an annotation that is IMPORTANT that you have not annotated your override with. 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.
August 11, 20205 yr 32 minutes ago, Pickle_Face5 said: The part that controls its drops is at the Override. If I'm not wrong, you actually need to override the method onBlockActivated as well. Just keep it identical as vanilla and replace the Sweetberry Item in spawnAsEntity with your blue berry. I did this in my own Blueberry bush and it's working just fine!
August 11, 20205 yr Author Just now, Talp1 said: If I'm not wrong, you actually need to override the method onBlockActivated as well. Just keep it identical as vanilla and replace the Sweetberry Item in spawnAsEntity with your blue berry. I did this in my own Blueberry bush and it's working just fine! Thanks, it works now! 🎉 Have some lorem ispum.
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.