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

Spawning TNT

Discussion in 'Facepalm' started by Hipster, Aug 28, 2017.

  1. Hipster

    Hipster Zombie

    Messages:
    214
    How can we spawn a primed tnt which will break blocks but won't hurt other players? I tried spawning a primed tnt entity but it doesn't break blocks, it only gives knockback which i dont want..
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
  3. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    I've been working on a script for this. It's not the best because I did it freehand, but I think it should work.
     
  4. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    Why not just cancel pocketmine\event\entity\EntityDamageEvent when the cause is that of an explosion?
     
    Last edited: Sep 6, 2017
  5. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Because of the knockback
     
  6. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    $event->setKnockBack(0);
     
  7. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    Knockback isn't dealt if the event is cancelled.
     
    Last edited: Sep 6, 2017
  8. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
  9. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
  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.