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

Particle getLevelPosition

Comments in 'Plugin Development' started by PmServer, Oct 6, 2016.

  1. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
    hi gusy
    i want one code .
    example code :
    if FlameParticle touch Bedrock Block !
    stop the FlameParticle Moving
  2. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
    PHP:
    for($i 0$i 40$i++){
    $level->addParticle(new FlameParticle(new Vector3($i $x $px$i $y $py$i $z $pz)));
    // if particle touch bedrock block ! stop particle moving
    }
  3. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
    please any help ? :(
  4. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
  5. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    Fill your mind only you need to think about

    Particle getLevelPosition * Fix your say *
    Last edited: Oct 6, 2016
  6. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
    Thanks for the note, but I do not want to respond to it without that help me in the thing that I needed and thanked
  7. dktapps
    Offline

    dktapps Active Member

    Joined:
    Jul 25, 2016
    Posts:
    101
    In short - you can't. Particle's don't exist server-side, they aren't tracked by the server. Even if they did, it's impossible to set the motion of a particle.
  8. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    if position get block == bedrock kill for loop
  9. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Try to make a formula for calculating the movement and check when its inside the Bedrock block by calculating:

    Get or guess the speed of the particles and divide the $v3->distance($v3); by it.

    Please show the whole code!
    dktapps likes this.
  10. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
    Example :
    PHP:
    public function ParticleCl(Player $playerParticle $particle){
            
    $position $player;
            
    $unitVector $player->getDirectionVector();
            for(
    $i 0$i 40$i++){
                
    $position $position->add($unitVector);
                
    $particle->setComponents($position->x$position->y$position->z);
                
    $player->getLevel()->addParticle($particle);
                if(
    $particle /* touch Diamond Block ? */) {
                    
    $particle->kill or stop
                
    }
            }
        }
  11. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    https://github.com/NawafCraft/Pocke...c/pocketmine/level/particle/FlameParticle.php
    https://github.com/NawafCraft/PocketMine-MP/blob/master/src/pocketmine/math/Vector3.php

Share This Page

Advertisement