Priming TNT

Discussion in 'Plugin Development' started by fullwall, Feb 23, 2011.

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

    fullwall

    As the title says, I have a plugin in which I have set a block's material to TNT. How do I then set it to primed?
     
  2. Offline

    Edward Hand

    Give this a shot:
    Code:
    CraftWorld world = (CraftWorld)theBlock.getWorld();
    EntityTNTPrimed tnt = new EntityTNTPrimed(world.getHandle(), theBlock.getX()+0.5F, theBlock.getY()+0.5F, theBlock.getZ()+0.5F);
    world.getHandle().a(tnt);
    
    --- merged: Feb 23, 2011 10:49 AM ---
    Oh, and you'll need to manually remove the TNT block after that.
     
  3. Offline

    fullwall

    Thanks.
     
  4. Offline

    eamike261

    Why does javadoc show org.bukkit.crafbukkit.CraftWorld but the latest API doesn't have that path?

    I tried doing this for primed TNT and obviously I can't get it to work because I cant import CraftWorld.

    edit: Oh wait, unless I should use craftbukkit as well when I add bukkit to my project?

    edit again:
    <----idiot
     
  5. Offline

    darknesschaos

    haha, it seems a lot of people tend to forget to import that when using craftbukkit code.
     
Thread Status:
Not open for further replies.

Share This Page