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

How to add FloatingTextParticle

Comments in 'Plugin Development' started by TheRockGER, May 22, 2015.

  1. TheRockGER
    Offline

    TheRockGER New Member

    Joined:
    May 22, 2015
    Posts:
    3
    Minecraft User:
    Redberg
    How to add FloatingTextParticleFloatingTextParticle?
    Full code, please
  2. yuri
    Offline

    yuri New Member

    Joined:
    May 20, 2015
    Posts:
    36
    Minecraft User:
    yodaylay22
    I do not know the code but I wonder and code and where do I put the code
  3. yuri
    Offline

    yuri New Member

    Joined:
    May 20, 2015
    Posts:
    36
    Minecraft User:
    yodaylay22
    you know What do I do when I have the code?
  4. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    you know, theres a magical search form provided above the website that can be used to find something thats already answered or that existed.
    Jon and Falk like this.
  5. PixelGuy75
    Offline

    PixelGuy75 Notable Member Plugin Developer

    Joined:
    Feb 9, 2014
    Posts:
    316
    Plugins:
    2
    Minecraft User:
    PixelGuy75
    Many people have asked about this already including me. Just look around the forums.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Learn PHP, understand your own code and put it at the place you want to put.
    picker118 and Jon like this.
  7. TheRockGER
    Offline

    TheRockGER New Member

    Joined:
    May 22, 2015
    Posts:
    3
    Minecraft User:
    Redberg
    Please give a theme to answer
  8. TheRockGER
    Offline

    TheRockGER New Member

    Joined:
    May 22, 2015
    Posts:
    3
    Minecraft User:
    Redberg
    PHP:
    <?php

    namespace spocket\mel;

    use 
    pocketmine\event\Listener;
    use 
    pocketmine\event\player\PlayerJoinEvent;
    use 
    pocketmine\level\particle\FloatingTextParticle;
    use 
    pocketmine\math\Vector3;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\utils\TextFormat;

    class 
    Main extends PluginBase implements Listener
    {

        public 
    $var;

        public function 
    onEnable(){
            
    $this->var 0;
            
    $this->getServer()->getPluginManager()->registerEvents($this$this);
        }
        public function 
    onJoin(PlayerJoinEvent $event )
        {
            if(
    $this->var == 0)
            {
            
    $level1 "world";
            
    $level $this->getServer()->getLevelByName($level1);
            
    $pos = new Vector3(12743128);
            
    $pos1 = new Vector3(12744133);
            
    $pos2 = new Vector3(12244128);
            
    $pos3 = new Vector3(13244128);
            
    $pos4 = new Vector3(12744123); 

          
            
    $level->addParticle(new FloatingTextParticle($pos->add(0.50.00.5),"",  "§cS§6P§eO§aC§bK§9E§dT §espk.ddns.net §d19132"));
            
    $level->addParticle(new FloatingTextParticle($pos1->add(0.50.00.5),"""SURVIVAL SERVER"));
            
    $level->addParticle(new FloatingTextParticle($pos2->add(0.50.00.5),"""MINIGAME SERVER"));
            
    $level->addParticle(new FloatingTextParticle($pos3->add(0.50.00.5),"""SPOCKET SERVER"));
            
    $level->addParticle(new FloatingTextParticle($pos4->add(0.50.00.5),"""?????"));
            
    $this->var 1;
                   }
            else
                   {
           
    //do nothing
                    
    }
        }

    }

    Attached Files:

  9. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    PHP:
    public function onJoin(PlayerJoinEvent) {
        
    $level $this->getLevelByName("world");
        
    $level->addParticle(new FloatingTextParticle(0.55.50.5""TextFormat::BOLD "Floating Text!"));
    }
    Next time look at other Threads, there are far too many threads about TextParticles already.
    Last edited: May 24, 2015
  10. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    and next time, you need to remember to add semi-colons ";" at the end of the code.
    CrazedMiner and Jon like this.
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    and next time, you need to remember to read the crash dump yourself.
  12. tigerza118
    Offline

    tigerza118 Active Member

    Joined:
    Jan 31, 2015
    Posts:
    100
    Minecraft User:
    tigerza117
    laggs

Share This Page

Advertisement