Solved Anyone knows why the floating textes don't change?

Discussion in 'Development' started by Wertzui123, Jul 12, 2019.

  1. Wertzui123

    Wertzui123 Spider

    Messages:
    10
    GitHub:
    wertzui123
    Hi, I'm working on a plugin, and was wondering why this doesn't work:


    PHP:
    public function LevelChange(EntityLevelChangeEvent $event){
    if(
    $event->getEntity() instanceof Player){
    if(isset(
    $this->playertextes[$event->getEntity()->getName()])) {
        if (
    $event->getTarget()->getName() == "Hub") {
            
    //set text visible
            
    $hub $event->getTarget();
            
    $part $this->playertextes[$event->getEntity()->getName()];
            
    $part->setInvisible(false);
            
    $hub->addParticle($part);
            
    $this->playertextes[$event->getEntity()->getName()] = $part;
        } else {
            
    //set text invisible
            
    $hub $event->getOrigin();
            
    $to $event->getTarget();
            if (
    $hub->getName() == "Hub") {
                
    $part $this->playertextes[$event->getEntity()->getName()];
                
    $part->setInvisible();
                
    $to->addParticle($part);
                
    $this->playertextes[$event->getEntity()->getName()] = $part;
            }
        }
    }
    }
    }
    The textes are still there, if I teleport into another world. Anyone can help me fixing this issue?
     
  2. Emirhan Akpınar

    Emirhan Akpınar Witch

    Messages:
    63
    GitHub:
    EmirhanWSD
    try
    PHP:
    Level->getFolderName()
     
  3. Wertzui123

    Wertzui123 Spider

    Messages:
    10
    GitHub:
    wertzui123
    Think I fixed it with that, thanks.
     
  4. Wertzui123

    Wertzui123 Spider

    Messages:
    10
    GitHub:
    wertzui123
    How to close this thread? I am new to the forums.
     
  5. Emirhan Akpınar

    Emirhan Akpınar Witch

    Messages:
    63
    GitHub:
    EmirhanWSD
    Select Solved
     
  6. HimbeersaftLP

    HimbeersaftLP Chicken

    Messages:
    1,722
    GitHub:
    HimbeersaftLP
    Use the link labled "thread tools"
     

Share This Page

  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.