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

how make particels

Comments in 'Plugin Development' started by XWITHERHEROX, Dec 8, 2015.

  1. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
    how make particels in x y z and world with command lik
    /plc
    and suumon
    partcile in
    world : Spawn
    x: 123
    y:41
    z:12
    and think you :)
  2. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    PHP:
    $level->addParticle(new pocketmine\level\particle\RedstoneParticle(new Vector3($x$y$z)));
    I just used RedstoneParticle as an example
  3. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
    men think you but a cheinge the x y z ? or no
    and i can add this in aney commands
    take a look
    public function onCommand(PlayerJoinEvent $ev, CommandSender $sender, Command $command, $label, array $args){
    if($sender instanceof Player) {
    $level->addParticle(new pocketmine\level\particle\RedstoneParticle(new Vector3($x, $y, $z)));
    lik this sorry for bad english
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Yes, you can make the $x, $y, and $z anything you want.
  5. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
    this is right ?
    ?php

    namespace ptc;

    use pocketmine\plugin\PluginBase;
    use pocketmine\command\CommandSender;
    use pocketmine\utils\TextFormat as Color;
    use pocketmine\command\Command;
    use pocketmine\Player;
    use pocketmine\level\particle\RedstoneParticle

    class main extends PluginBase {

    public function onEnable() {
    $this->getLogger()->info(Color::GREEN."[ptc] on!");
    }

    public function onCommand(CommandSender $sender, Command $command,$level level , $label, array $args) {
    if($sender instanceof Player) {
    if(strtolower($command->getName()) == 'ptc') {
    if(count($args) < 1) {
    $level->addParticle(new RedstoneParticle(new Vector3($x, $y, $z)));
    return;
    } else {
    $sender->sendMessage(Color::Red."[ptc] eror");
    return;
    }
    }
    }
    }
    }
  6. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    PHP:
    $level->addParticle(new RedstoneParticle(new Vector3($x$y$z)));
    should be
    PHP:
    $level->addParticle(new RedstoneParticle(new Vector3($sender->x$sender->y$sender->z)));
  7. XWITHERHEROX
    Offline

    XWITHERHEROX Active Member

    Joined:
    Jun 4, 2015
    Posts:
    57
    Minecraft User:
    ReDaRWiTheR
    oky
    but all thits is right ?

    <?php

    namespace ptc;

    use pocketmine\plugin\PluginBase;
    use pocketmine\command\CommandSender;
    use pocketmine\utils\TextFormat as Color;
    use pocketmine\command\Command;
    use pocketmine\Player;
    use pocketmine\level\particle\RedstoneParticle;

    class main extends PluginBase {

    public function onEnable() {
    $this->getLogger()->info(Color::GREEN."[ptc] on!");
    }

    public function onCommand(CommandSender $sender, Command $command, $label, array $args) {
    if($sender instanceof Player) {
    if(strtolower($command->getName()) == 'ptc') {
    if(count($args) < 1) {
    $level->addParticle(new RedstoneParticle(new Vector3($sender->x, $sender->y, $sender->z)));
    return;
    } else {
    $sender->sendMessage(Color::Red."[ptc] eror");
    return;
    }
    }
    }
    }
    }



    his give me "An unknown error........."
    you can help me in thits ? and think you for feedback
    #sorry_for_bad_english
  8. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    What exactly is the error message?
    You should return true, if not it will show the usage to the sender
  9. TutoGamerWalid
    Offline

    TutoGamerWalid Active Member

    Joined:
    Jun 11, 2015
    Posts:
    69
    Minecraft User:
    TutoGamerWalid
    Code:
    use pocketmine\math\Vector3;

Share This Page

Advertisement