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

Flying Entity with nametag

Comments in 'Plugin Development' started by Xenturio, Jul 30, 2015.

  1. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    can someone help me by a question...

    i spawn an entity like a zombie with nametag and set it invisible...

    how its possible that the entity with nametag is flying in the air and dont fall down to earth?

    i want to create a flying text with an entity but all the time the entity drops down (and the nametag as well):mad:

    and dont know how to disable this falling feature

    ps.
    1- i dont want to do it with floating text
    2- many lines in nametag is an idea but players can push the entity away so the nametag as well...

    Can someone say me how to disable falling down or how to use the "onCollisionWith" Event?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What's wrong with FloatingTextParticle?

    The pushing thing is client-side. You can't disable it unless you keep teleporting it back.
    jojoe77777 likes this.
  3. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    dont like it and try to learn an other way to do it
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    FloatingTextParticle is the most convenient way.
    And you can't prevent zombies from being pushed away. Use an ID 0 DroppedItem - that's the best way to spawn an invisible entity without making it invisible.
    Xenturio and jojoe77777 like this.
  5. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    FloatingTextParticle is the most convenient way. <--- sure but i dont like FloatingTextPaticle xD dont ask me why ^^

    thats a good idea and i can set an invisible block under it that its not falling down... thats a way...i will try it...
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,472
    Minecraft User:
    PrimusLV
    Sorry too curious :D Why you don't like TextParticle?
  7. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    you cant tap it
  8. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    FallingBlock is the optimum solution :)
    Also, see if it works with air block?
  9. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    ???? iam confused now -> kick me so i understand what u mean...
  10. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    656
    Plugins:
    1
    Minecraft User:
    jojoe77777
    Use invisible named falling sand (But isn't affected by gravity)
  11. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    656
    Plugins:
    1
    Minecraft User:
    jojoe77777
    Oh, just remembered, set NoAI to 1.
    Example spawning code:
    PHP:
       public function spawnTo(Player $player){

            
    $pk = new AddEntityPacket();
            
    $pk->eid $this->getId();
            
    $pk->type self::NETWORK_ID;
            
    $pk->$this->x;
            
    $pk->$this->y;
            
    $pk->$this->z;
            
    $pk->nametag "Hi";
            
    $pk->speedX $this->motionX;
            
    $pk->speedY $this->motionY;
            
    $pk->speedZ $this->motionZ;
            
    $pk->yaw $this->yaw;
            
    $pk->pitch $this->pitch;
            
    $pk->metadata = [
                    
    Entity::DATA_NO_AI => [Entity::DATA_TYPE_BYTE1]
            ];

            
    $player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
            
    parent::spawnTo($player);
        }

Share This Page

Advertisement