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

How to use DustParticle

Comments in 'Plugin Development' started by tigerza118, Jul 27, 2015.

  1. tigerza118
    Offline

    tigerza118 Active Member

    Joined:
    Jan 31, 2015
    Posts:
    100
    Minecraft User:
    tigerza117
    How to use DustParticle
    sorry i am bad eng
    Thx
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    $level->addParticle(new DustParticle($position$r$g$b$alpha));
  3. tigerza118
    Offline

    tigerza118 Active Member

    Joined:
    Jan 31, 2015
    Posts:
    100
    Minecraft User:
    tigerza117
    PHP:
        public function spiral(PlayerMoveEvent $event) {
                    
    $sender $event->getPlayer();
                    
    $level $sender->getLevel();
                    
    $x $sender->getX();
                    
    $y $sender->getY();
                    
    $z $sender->getZ();
                    
    $center = new Vector3($x$y$z40452081);
                    
    $radius 0.5;
                    
    $count 100;
                    
    $particle = new DustParticle($center);
                    for(
    $yaw 0$y $center->y$y $center->4$yaw += (M_PI 2) / 20$y += 20){
                      
    $x = -sin($yaw) + $center->x;
                      
    $z cos($yaw) + $center->z;
                      
    $particle->setComponents($x$y$z);
                      
    $level->addParticle($particle);
    }
        }
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Add back the RGBA parameters in the new DustParticle line.
  5. tigerza118
    Offline

    tigerza118 Active Member

    Joined:
    Jan 31, 2015
    Posts:
    100
    Minecraft User:
    tigerza117
    Complete Sample pls
  6. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
  7. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    Code:
    change   $center = new Vector3($x, $y, $z, 40, 45, 208, 1);
    into $center = new Vector3($x, $y, $z);
                   
    change = $particle = new DustParticle($center);
    into = $particle = new DustParticle($center, 40, 45, 208, 1);
    
    if u read AND UNDERSTAND the error message u now that...
    Jon, hoyinm14mc and PEMapModder like this.
  8. tigerza118
    Offline

    tigerza118 Active Member

    Joined:
    Jan 31, 2015
    Posts:
    100
    Minecraft User:
    tigerza117
    Thx
    Xenturio likes this.
  9. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
  10. GmWM
    Offline

    GmWM Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    181
    Plugins:
    3
    Looks awesome! :eek: I'll try that right now. Thank you!
    xiaoq likes this.

Share This Page

Advertisement