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

Solved Mobs Spawn event??

Discussion in 'Development' started by Nora1903, Jun 30, 2018.

  1. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    Hello, i am using pureEntitiesX and i want to set custom nametag for every entities when they spawn on the world. Are there any ways to do that?
    Thanks,
     
  2. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    Maybe use EntitySpawnEvent
     
    Nora1903 likes this.
  3. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    Yay but it doesnt have any function that can get or change name
     
  4. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    PHP:
    public function onEntitySpawn(EntitySpawnEvent $e) {
      
    $entity $e->getEntity();
      
    $nameTag $entity->getNameTag(); // get
      
    $entity->setNameTag(" ");  // set

    }
    ?
     
    corytortoise likes this.
  5. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    EntitySpawnEvent doesnt have getEntity() function :(
     
  6. byyEmirhanWSD

    byyEmirhanWSD Witch

    Messages:
    50
    GitHub:
    EmirhanWSD
    If you know some PHP, you didnt need ask this.
     
    jasonwynn10 likes this.
  7. Tee7even

    Tee7even Slime

    Messages:
    81
    GitHub:
    tee7even
    It does.
     
    jasonwynn10 likes this.
  8. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    Hava i didnt see, sorry
     
  9. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    But the name tag of entities doesnt visible :((
     
  10. Tee7even

    Tee7even Slime

    Messages:
    81
    GitHub:
    tee7even
    PHP:
    $entity->setNameTagVisible();
     
    jasonwynn10 and byyEmirhanWSD like this.
  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.