"ignite" tnt block?

Discussion in 'Plugin Development' started by DanishDuckling, Sep 10, 2013.

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

    DanishDuckling

    How do I go by priming a tnt block, when I have the unprimed tnt Block from it's location?
     
  2. Offline

    Tarestudio

    DanishDuckling
    ignited TNT is a entity, so you have to remove the block and spawn a ignited tnt (TNTPrimed) at this location.
     
  3. Offline

    DanishDuckling

    .. how?
     
  4. DanishDuckling World.spawnEntity(loc, EntityType.PRIMED_TNT); Something among those lines, if this doesn't work then google it since there are 5 milion+ threads about this.
     
  5. Offline

    Tarestudio

    DanishDuckling
    First, nothing of this is tested:
    World.getBlockAt(location).setTypeId(0); //removes block
    TNTPrimed tnt = (TNTPrimed) World.spawnEntity(location, PRIMED_TNT); //spawn tnt
    tnt.setFuseTicks(20); //set fuse to 20ticks/1second
     
  6. Offline

    ISHLCMinecraft

    block.getState().setPower(Number above 0);
     
  7. Offline

    DanishDuckling

    Nice idea, but I don't get a "setPower" method on my block.getState()
     
Thread Status:
Not open for further replies.

Share This Page