Get Drop Count?

Discussion in 'Plugin Development' started by XDemonic25, May 25, 2012.

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

    XDemonic25

    I need to find someway how much Diamonds is being dropped from a diamond block (from using Enchant Fortune of course)

    for example, someone is using Fortune III, breaking the diamond block drops 4 diamond, My plugin records 4 diamonds. Is this possible?
     
  2. Offline

    Nitnelave

    Did you try listening to the blockBreak event and doing getdrops, or whatever the method is? It surely includes the enchantments.
     
  3. Offline

    Njol

    Copied from the Javadocs of Block:
    You would call it like this:
    Code:
    Collection<ItemStack> drops = event.getBlock().getDrops(event.getPlayer().getItemInHand());
    BlockBreakEvent unfortunately does not have a getDrops() method like EntityDeathEvent.

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

Share This Page