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

Particles

Comments in 'Plugin Development' started by ender_kenji, Dec 21, 2015.

  1. ender_kenji
    Offline

    ender_kenji New Member

    Joined:
    Oct 13, 2015
    Posts:
    29
    Minecraft User:
    EnderKenji
    1) How to add particles in specified position?
    2) How to add particles on player?

    I posted this on Plugin Development. I need code, not Plugin. Thanks.
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    Level::addParticle($yourVector);
    For a Position, just replace $yourVector with your Vector(obviously). For adding "on a player" either create a task or use PlayerMoveEvent to spawn the Particle an Player's Position.
  3. ender_kenji
    Offline

    ender_kenji New Member

    Joined:
    Oct 13, 2015
    Posts:
    29
    Minecraft User:
    EnderKenji
    For Example?
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    I gave you the code why would you need an example?
  5. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    PHP:
    $pos = new Vector3($x$y$z);
    $level $server->getLevelByName('levelName');
    $level->addParticle(new FloatingTextParticle($pos->add(0.50.00.5),"",  "Your text here"));
  6. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    $server is undefined. Use
    PHP:
    $this->getServer()
  7. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    It was obvious :)
    Vaivez66 likes this.
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    $this is not specified either, in this case ;)
    Legoboy0215 and TonyDroide like this.
  9. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    You can get the players coordinates with
    PHP:
    $player $event->getPlayer();
    $x $player->getX();
    $y $player->getY();
    $z $player->getZ();
    And, I know that $event it's not defined, but I think is obvius what it's, no? ;)
  10. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    $player is a Position itself/extends one.
  11. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Can you show me a example?
  12. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Eh.. You don't know what extends means, do you?._. Learn PHP.
  13. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    I understand it.
    I only said 'Can you show me a example?'.
  14. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    An example for what?
  15. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    Really? xD
  16. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    What's the problem?
    iDirtPlayzMC likes this.

Share This Page

Advertisement