TNTPrimed not acting as it should.

Discussion in 'Plugin Development' started by Nateb1121, Sep 29, 2013.

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

    Nateb1121

    I'm trying to make it so in my plugin when a player places a block of TNT it will spawn a TNTPrimed entity instead however, through testing this TNTPrimed isn't hurting players like TNT traditionally does when I light it with a redstone torch. Any ideas as to why?

    This test plugin is the only plugin I have installed. Here's the code to my event listener:

    Code:
            @EventHandler
            public void TNTPlaced(BlockPlaceEvent evt) {
                    if(evt.getBlock().getTypeId() == 46) {
                      evt.getBlock().setType(Material.AIR);
                      Entity tnt = evt.getPlayer().getWorld().spawn(evt.getBlock().getLocation(), TNTPrimed.class);
                      ((TNTPrimed)tnt).setFuseTicks(20*3);
                }
    }
    When I say not hurting players I mean something like this, I can stand in the middle of the TNTPrimed entity and I'll only take 4 hearts damage, but with traditionally lit TNT I will die.
     
Thread Status:
Not open for further replies.

Share This Page