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

How to make effect particles invisible?

Comments in 'Plugin Development' started by Hotshot_9930, Jun 13, 2015.

  1. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    I've been doing setVisible(false); but that doesn't seem to work, i can still see the effect particles. Any help would be appreciated.
  2. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    After changing a particle you need to add it to the level.
  3. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    I'm talking about potion effects. I'm trying to get rid of the particles around the player.
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    It works for me.
  5. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    try:

    PHP:
        $effect Effect::getEffect($effectid); //Effect ID
        
    $effect->setVisible(false); //Particles
        
    $effect->setAmplifier($amplifier); //Intensity
        
    $effect->setDuration($duration); //Ticks
        
    $p->addEffect($effect); //To add effect
  6. BalAnce
    Offline

    BalAnce Active Member

    Joined:
    Mar 10, 2015
    Posts:
    125
    Minecraft User:
    BalAnce
    This works for me:
    PHP:
    $player->addEffect(Effect::getEffect(8)->setDuration(20*10)->setVisible(false));
    The int 8 is the effect id the rest is self explanatory i think. ;)
  7. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    My bad. It actually was working.
  8. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    ;)

Share This Page

Advertisement