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

Does This Coding Check Out

Discussion in 'Development' started by Vincent, Dec 27, 2017.

  1. Vincent

    Vincent Silverfish

    Messages:
    16
    GitHub:
    vincent
    $item->setCustomName(PvP Elixer);
    $player = $event->getPlayer();
    if(count($player->getEffects()) != 3) {
    if($event->getItem()->getID() ==373) {
    $player->getInventory()->removeItem(Item::get(373, 0, 1));
    $player->addEffect(Effect::getEffect(Effect::STRENGTH)->setAmplifier(3)->setDuration(100 * 20));
    $player->addEffect(Effect::getEffect(Effect::SPEED)->setAmplifier(3)->setDuration(100 * 20));
    $player->addEffect(Effect::getEffect(Effect::REGENERATION)->setAmplifier(3)->setDuration(100 * 20));

    $player->addEffect(Effect::getEffect(Effect::JUMP_BOOST)->setAmplifier(3)->setDuration (100 * 20));
    $player->addEffect(Effect::getEffect(Effect::HEALTH_BOOST)->setAmplifier(3)->setDuration (100 * 20));
    $player->getLevel()->addSound(new \pocketmine\level\sound\LaunchSound($player));
    }
    }
    }
    }
     
  2. QuiverlyRivalry

    QuiverlyRivalry Zombie Pigman

    Messages:
    491
    GitHub:
    quiverlyrivalry
    What are you saying xD be descriptive
     
    Remarkabless likes this.
  3. Vincent

    Vincent Silverfish

    Messages:
    16
    GitHub:
    vincent
    Is there any flaws in the coding
     
  4. VCraft

    VCraft Witch

    Messages:
    60
    GitHub:
    VCraftMCPE
    try it yourself
     
  5. OnTheVerge

    OnTheVerge Spider Jockey

    Messages:
    46
    Yes many, you are trying to run before you can walk. Try looking over the code again, I noticed as I look at it that the first line has a syntax error. Goodluck :)
     
    Last edited: Dec 27, 2017
  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.