1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Event fired on tnt ignite?

Discussion in 'Development' started by kriskotooBG, Mar 17, 2020.

  1. kriskotooBG

    kriskotooBG Spider Jockey

    Messages:
    46
    GitHub:
    kriskotoobg
    Does pocketmine fire an event when a tnt block gets ignited?
    If so, what is its name... :)
    Or you have to listen to interact events and check if the player has a lighter in his hand, and the block is a tnt block.... Doing so seems inefficient...
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    You could listen for the EntitySpawnEvent which will be called as soon as the PrimedTNT entity is created (= after the tnt has been ignited).
    However this will react to all kinds of TNT ignition like TNT being ignited from another explosion or TNT being ignited from a nearby block burning, not just TNT being primed by a flint and steel by a player.
     
  3. kriskotooBG

    kriskotooBG Spider Jockey

    Messages:
    46
    GitHub:
    kriskotoobg
    That is actually perfect! Thank you!
     
    HimbeersaftLP likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.