Redstone Ore Block Break Event

Discussion in 'Plugin Development' started by Creeperzombi3, Jun 22, 2015.

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

    Creeperzombi3

    I have this code atm, but only Redstone doesn't work, when I break a redstone ore block, it just breaks and drops redstone dust, nothing goes to my inventory.

    Code:
    if (tool.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 20) {
        if (blType == Material.DIAMOND_ORE) {
            player.getInventory().addItem(new ItemStack(Material.DIAMOND, 20));
            block.setType(Material.AIR);
        } else if (blType == Material.IRON_ORE) {
            player.getInventory().addItem(new ItemStack(Material.IRON_INGOT, 20));
            block.setType(Material.AIR);
        } else if (blType == Material.GOLD_ORE) {
            player.getInventory().addItem(new ItemStack(Material.GOLD_INGOT, 20));
            block.setType(Material.AIR);
        } else if (blType == Material.EMERALD_ORE) {
            player.getInventory().addItem(new ItemStack(Material.EMERALD, 20));
            block.setType(Material.AIR);
        } else if (blType == Material.REDSTONE_ORE) {
            player.getInventory().addItem(new ItemStack(Material.REDSTONE, 20));
            block.setType(Material.AIR);
        }
     
  2. Offline

    Zombie_Striker

    @Creeperzombi3
    Did you debug? Is this the BlockBreakEvent?Are you clearing the drops?
     
  3. Offline

    Boomer

    Material.GLOWING_REDSTONE_ORE

    Two different materials for redstone ore, interchanging frequently - check both types
     
  4. Offline

    Creeperzombi3

    Thanks That helped.
    Also, can you help me with this?
    I want to make it so it gives Lapiz
    Code:
    else if (blType == Material.LAPIS_ORE) {
       player.getInventory().addItem(new ItemStack(Material.LAPIS_ORE, 20));
       block.setType(Material.AIR);
    }
     
  5. Offline

    Boomer

    lapis stone/chunk/dust is an inksack
     
Thread Status:
Not open for further replies.

Share This Page