1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

FloatingTextParticle update

Discussion in 'Development' started by Az928, Apr 19, 2017.

  1. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    PHP:
    $pk = new AddPlayerPacket();
    $pk->eid 837373737//id of the FloatingText
    $pk->uuid UUID::fromRandom();
    $pk->275.5;
    $pk->8;
    $pk->284.5;
    $pk->speedX 0;
    $pk->speedY 0;
    $pk->speedZ 0;
    $pk->yaw 275;
    $pk->pitch 0;
    $pk->item Item::get(0);
    $pk->meta 0;
    $flags 0;
    $flags |= << Entity::DATA_FLAG_INVISIBLE//set the player invisible
    $flags |= << Entity::DATA_FLAG_CAN_SHOW_NAMETAG;
    $flags |= << Entity::DATA_FLAG_ALWAYS_SHOW_NAMETAG;
    $flags |= << Entity::DATA_FLAG_IMMOBILE;
    $pk->metadata = [
    Entity::DATA_FLAGS => [Entity::DATA_TYPE_LONG$flags],
    Entity::DATA_NAMETAG => [Entity::DATA_TYPE_STRING"text\ntext"],
    38 => [Entity::DATA_TYPE_LONG, -1],
    ];
    $p->dataPacket($pk);
    To edit the text just resend the packet with an other text

     
    Last edited: Apr 21, 2017
  2. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    not good idea to use that, you send multiple packets.
     
    Levi likes this.
  3. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    Please if you don't know anything of Pocketmine don't answer xd (and check pm)
    Using setParticle return the same things mdrr
     
  4. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    FloatingTextParticle is just an AddEntityPacket of an Item's entity.
    Spawn a human with AddPlayerPacket return to the same thing.
     
    Levi likes this.
  5. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    You use this function with a task without task your function does not work while with FloatingTextParticle the particle stays.
     
  6. Miste

    Miste Baby Zombie

    Messages:
    109
    GitHub:
    Misteboss
    Please don't use GoogleTranslate i can't understand anything, thanks, oh and last things all you said is wrong.
     
  7. Primus

    Primus Zombie Pigman

    Messages:
    749
    PHP:
       public function updateTextParticle() {
           
    $this->position->level->addParticle($this->ftp);
       }

       public function 
    addTextParticle() {
           
    $this->ftp = new FloatingTextParticle($this->position->add(03), """");
       }

       public function 
    removeTextParticle() {
           
    $this->ftp->setInvisible(true);
           
    $this->position->level->addParticle($this->ftp);
       }
     
    corytortoise, Az928 and Marabou like this.
  8. Marabou

    Marabou Baby Zombie

    Messages:
    137
    GitHub:
    wiligangster
    You do not want to know anything you show yourself when you do not know anything here is an example to help you.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.