Solved How can I get a event for 5x5 pickaxe?

Discussion in 'Plugin Development' started by mAndAle, Jun 7, 2020.

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

    mAndAle

    Yeah, it's right but it is:
    Code:
    int Xmin = x - 2;
    int Xmax = x + 3;
    for who struggling with se same problem:

    Code:
    int x = block.getX();
            int y = block.getY();
            int z = block.getZ();
            int Xmin = x - 2;
            int Xmax = x + 3;
            int Ymin = y - 2;
            int Ymax = y + 3;
            int Zmin = z - 2;
            int Zmax = z + 3;
    
    for (int i = Xmin; i < Xmax; i++) {
                      
                            for (int j = Ymin; j < Ymax; j++) {
                          
                                for (int k = Zmin; k < Zmax; k++) {
                                    Block newBlock = block.getWorld().getBlockAt(i, j, k);
                                    player.getInventory().addItem(new ItemStack(newBlock.getType()));
                                    newBlock.setType(Material.AIR);
                                }
                            }
                        }
    However those guys help me a lot! Thanks! I'll change the title in Solved
     
    Last edited: Jun 10, 2020
Thread Status:
Not open for further replies.

Share This Page