Solved Changing block drop ammount

Discussion in 'Plugin Development' started by gamelord327, Aug 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    gamelord327

    Hi,

    Im working on a plugin that needs to double the amount of items the block drops when it breaks.

    This is my code:

    Code:java
    1. public class Events implements Listener{
    2.  
    3. private static Main plugin;
    4.  
    5. public Events(Main instance) {
    6. plugin = instance;
    7. }
    8.  
    9.  
    10. Player player;
    11.  
    12. //Harvester
    13. public void BlockBreackEvent(BlockBreakEvent event) {
    14. Block block = event.getBlock();
    15. Location loc = block.getLocation();
    16. if ((block.getType() == Material.GRASS)){
    17. block.getWorld().dropItem(loc, new ItemStack(Material.GRASS, 2));
    18. }
    19. }
    20. }


    When i tested the plugin i did not double the drop amount. What am i doing wrong?

    Dw, got a fix on #bukkitdev... all i had to do was add @EventHandler

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
Thread Status:
Not open for further replies.

Share This Page