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

join effect

Comments in 'Plugin Development' started by Artide, Apr 22, 2015.

  1. Artide
    Offline

    Artide Active Member

    Joined:
    Apr 20, 2015
    Posts:
    214
    Minecraft User:
    Artide5
    Hi, TonyDroidd and I, have been trying to make a join effect plugin, but we tried many function and none of them work. Here's one of the ones I tried.
    PHP:
        public function onJoin(PlayerJoinEvent $event) {
             
    $p $event->getPlayer();
                 
    $cfg $this->getConfig()->getAll();
                  
    $effect Effect::getEffectByName($cfg["Effect Name"]);
                  
    $effect->setVisible(true);
                  
    $effect->setDuration(1200);//ticks
                  
    $p->addEffect($effect);
    }
    HotFireyDeath likes this.
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    He's asking lots of people.
  3. Artide
    Offline

    Artide Active Member

    Joined:
    Apr 20, 2015
    Posts:
    214
    Minecraft User:
    Artide5
    But I also need it :(
    HotFireyDeath likes this.
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    $cfg is not defined in the code shown.
  5. TonyDroidd
    Offline

    TonyDroidd Active Member

    Joined:
    Sep 6, 2014
    Posts:
    180
    Minecraft User:
    TonyDroidd
  6. Artide
    Offline

    Artide Active Member

    Joined:
    Apr 20, 2015
    Posts:
    214
    Minecraft User:
    Artide5
    Maybe its not supported yet :( I will try a new event
    TonyDroidd and HotFireyDeath like this.

Share This Page

Advertisement