Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to know if somone is igniting a tnt?

Comments in 'Plugin Development' started by iAnonymous28, Sep 8, 2015.

  1. iAnonymous28
    Offline

    iAnonymous28 New Member

    Joined:
    Sep 2, 2015
    Posts:
    3
    Minecraft User:
    iAnonymous28
    As the title says how do i know if somone is ignoting a tnt what events do we use here?
  2. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    PlayerInteractEvent, check the hand of the player for flint and steel and the block touched is tnt
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PlayerInteractEvent, check if event block is TNT, event item is flint and steel and event action is RIGHT_CLICK.
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    check the action too. Otherwise, breaking TNT with flint and steel will get detected too.
    Taha_The_Hacker and jojoe77777 like this.
  5. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    You forgot a biggie. Remember to check if the event is cancelled.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It wouldn't be an issue if you have the @ignoreCancelled tag enabled.
  7. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Depends if you will use it.

Share This Page

Advertisement