Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. @Override
  2. public Item getItemDropped(IBlockState state, Random rand, int fortune) {
  3. return Items.CLAY_BALL; // Change this to your item, something like ModItems.itemBean.
  4. }
  5.  
  6. @Override
  7. public int quantityDropped(IBlockState state, int fortune, Random random) {
  8. // Check it was a player
  9. if(this.harvesters.get() != null && this.harvesters.get() instanceof EntityPlayer) {
  10. EntityPlayer player = this.harvesters.get(); // Player in a variable
  11. Item itemInHand = player.getHeldItemMainhand().getItem(); // Held in main hand item in a variable
  12.  
  13. // Check if the item they're using is an Axe (replace this with your spoon class, ItemSpoon or whatever)
  14. if(itemInHand instanceof ItemAxe) {
  15. return 4; // Number of your item you want to return.
  16. }
  17. }
  18.  
  19. return 0; // Otherwise we return 0 so nothing drops
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement