Discussion in 'Plugin Development' started by DanishDuckling, Sep 10, 2013.
How do I go by priming a tnt block, when I have the unprimed tnt Block from it's location?
ignited TNT is a entity, so you have to remove the block and spawn a ignited tnt (TNTPrimed) at this location.
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.
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
block.getState().setPower(Number above 0);
Nice idea, but I don't get a "setPower" method on my block.getState()
Separate names with a comma.