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

How to spawn Primed TNT when a player touches a block?

Comments in 'Plugin Development' started by ToNeX, Sep 16, 2015.

  1. ToNeX
    Offline

    ToNeX New Member

    Joined:
    Jan 19, 2015
    Posts:
    39
    Minecraft User:
    AryToNeX
    Hello all! Finally I can make my own plugins!

    I need help: I want to spawn a primed TNT entity which explodes in one second and causes no damage in the world but it can hurt players. I want to spawn it 0.2 blocks on top of the block I tap (in order to make a "primed TNT carpet").

    Does anybody know a method?
  2. Kvetinac97
    Offline

    Kvetinac97 Active Member Plugin Developer

    Joined:
    Nov 17, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    Kvetinac97
    Make new "Carpet" entity. Then start the delayed task (20 ticks). I think there's no need to make explosion. Just get all players in same level as tapped block, find out if they're close enought and set their health to $p->getHealth()-X. Or, make invisible explosion...
  3. ToNeX
    Offline

    ToNeX New Member

    Joined:
    Jan 19, 2015
    Posts:
    39
    Minecraft User:
    AryToNeX
    TNT is more realistic for my purposes. And I actually don't know how to spawn entities.
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Minecrafter9203 likes this.

Share This Page

Advertisement