Explosion Pickaxes

Discussion in 'Plugin Development' started by yoitsjimby, Aug 24, 2014.

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

    yoitsjimby

    Well im working on custom enchants I would like the enchant boom I when there mining they the pick make tiny evplosions every time the break a block and the items drop naturally please help me
     
  2. Offline

    Epicballzy

    I think you'd have to use BlockBreakEvent. If a block is broken with said pickaxe, then play the explosion effect/sound at the block.
    I never done anything with blocks, so its a wild guess for me.
     
  3. Make a blockbreak event, make a random/rand, make sure the itemInHand contains a certain lore, get the rand.nextInt and then get the location and world of the player, createexplosion, profit.
     
  4. Offline

    yoitsjimby

    how do I get the explosion
     
  5. Offline

    drpk

    yoitsjimby here's what I use, this will break blocks
    Code:java
    1. World world = p.getWorld();
    2. Location loc = p.getLocation();
    3. int x = loc.getBlockX();
    4. int y = loc.getBlockY();
    5. int z = loc.getBlockZ();
    6. world.createExplosion(x, y, z, 3.0F, false, true); //4.0F is tnt size
     
  6. Offline

    yoitsjimby

    Code:java
    1. still not getting this show me a better example
     
Thread Status:
Not open for further replies.

Share This Page