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 PrimedTNT Entity?

Comments in 'Plugin Development' started by Asidert, May 31, 2015.

  1. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    Hello, who know how to spawn PrimedTNT on, example, $pos?
  2. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    I found how spawn, $pos=$p->getPosition();
    How to make $pos independent of $p? I need to specify the numbers in the $pos me it should not depend on the position of the player.
  3. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    Nobody? :C
  4. xpyctum
    Offline

    xpyctum Active Member Plugin Developer

    Joined:
    Jan 13, 2014
    Posts:
    292
    Plugins:
    4
    Minecraft User:
    tylerdisney
    Nobody.
  5. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    You again?
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    $p itself is the Position. $p->getPosition() is only to make the coordinates not change due to other references on the same object changing its position, which is useful when you want to save the position over time (i.e. save it outside the context of an event handler) without cloning the player object.
    You can construct a new position object using the Position constructor.
    Method declaration:
    PHP:
    public function \pocketmine\level\Position::__construct(number $xnumber $ynumber $zLevel $level null);

Share This Page

Advertisement