BurstPickaxes plugin help

Discussion in 'Spigot Plugin Help' started by AppleMonJeans, Jun 11, 2017.

  1. So i am making a plugin called bustpickaxes and i have run into a problem (I am fairly new to this) what i want the plugin to do is get the block the is mined with the pickaxe i made called a shockwave pickaxe and i want it to set all the blocks around it to air in a 3x3 block square but i dont know how to do this.... this is my code so far.

    package com.Splurgies.burstpickaxes;

    import java.util.ArrayList;

    import org.bukkit.ChatColor;
    import org.bukkit.block.Block;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.BlockBreakEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;

    public class Mining implements Listener {

    public void onBlockBreak(BlockBreakEvent event) {
    Block block = event.getBlock();
    Player player = event.getPlayer();
    ItemStack shockwave = new ItemStack(org.bukkit.Material.DIAMOND_PICKAXE);
    shockwave.addEnchantment(org.bukkit.enchantments.Enchantment.DIG_SPEED, 5);
    shockwave.addEnchantment(org.bukkit.enchantments.Enchantment.DURABILITY, 3);
    ItemMeta shockwavemeta = shockwave.getItemMeta();
    ArrayList<String> shockwavelore = new ArrayList<String>();
    shockwavelore.add(ChatColor.GREEN + "Mines in a 3x3 Area");
    if (player.getInventory().getItemInHand().equals(shockwave)) {

  2. What's the error?
  3. If you wanted to break blocks in a 3x3 area, you could create nested for loops and iterate in a 3 grid