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

Solved Getting effect level of a player

Discussion in 'Development' started by minijaham, Aug 15, 2020.

  1. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Hi, it's me again.
    Is there a way to get the level of the effect that a player has?
     
  2. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    if($player->hasEffect(Effect::INVISIBILITY)) {

    i assume you could use that and get the level or you could do

    PHP:
    $effect = new EffectInstance(Effect::getEffect(effect), timemultiplier);

    if(
    $player->hasEffect($effect);
    Maybe it'll work
     
  3. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    This is not the answer to that person question, please refrain from giving misleading posts.
     
  4. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    Hi, you can get effects level like:
    PHP:
    $effect Effect::NIGHT_VISION//check nightvision level
    $player->getEffect($effect)->getEffectLevel(); //getting NightVision Level :P
    set prefix to SOLVED ;)
     
    minijaham likes this.
  5. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    Just trying to help I didn't say it would work, I just said it might.
     
  6. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    so dont say itmight if you are not 100% sure
     
  7. esh123cookie

    esh123cookie Baby Zombie

    Messages:
    104
    GitHub:
    esh123cookie
    I'm trying to help, dunno why you getting all upset
     
  8. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    im sying that, because that confusing people when you are not sure about your code.
     
  9. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
    Thank you for your help xD
     
  10. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    no problem ;)
     
  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.