Break Naturally

Discussion in 'Plugin Development' started by xXTroopsXx, Aug 12, 2018.

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

    xXTroopsXx

    Good evening,
    I am having trouble dropping ingots when breaking ores. As shown below I have tried to break naturally with the gold ore. I have also tried spawning the ingot where the broken block was but that will not work for someone with a fortune pickaxe. Has anyone done this before? Any help would be appreciated. Thanks!


    if(e.getBlock().getType() == Material.GOLD_ORE) {
    e.getBlock().breakNaturally(new ItemStack(Material.GOLD_ORE));
     
  2. Offline

    Zombie_Striker

    "breakNaturally" requires the Itemstack that was used to mine the block, not what is dropped. Change the itemstack to be equal to the item the player has mined, or if you wish to override the default drops, don't provide an itemstack and use World#dropItem to drop the ingot.
     
Thread Status:
Not open for further replies.

Share This Page