Make TNT Block Explode

Discussion in 'Plugin Development' started by Moogle, Mar 28, 2011.

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

    Moogle

    Hey, I've noticed there isn't a function in the Bukkit API to .destroy() a block, so I'm sort of stuck. How do I break a TNT block, causing it to explode? Failing that, how do I cause a creeper to explode?
     
  2. Offline

    Edward Hand

    To destroy a block normally you just set its material to Air.
    That won't make TNT explode though.
    You have to use:
    Code:
    CraftWorld cWorld = (CraftWorld)theWorld;
    Block.byId[46].b(cWorld.getHandle(), x, y, z, 0)
     
  3. Back in hMod, people activated TNT by setting the top on fire. Dunno if it works in your case, though.
     
  4. Offline

    Moogle

    Setting the top (or bottom!) to fire works. Kind of silly, though.

    The other code does not work. No such thing as .byId on Block.
     
  5. Offline

    Edward Hand

    You need to use net.minecraft.server.Block not org.bukkit.block.Block

    I assure you, it does work
     
Thread Status:
Not open for further replies.

Share This Page