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

Item effect code or Plugin?

Discussion in 'Requests' started by echo_gamesz234, Jun 8, 2017.

  1. echo_gamesz234

    echo_gamesz234 Silverfish

    Messages:
    24
    GitHub:
    echogamesz234
    Hey,I was wondering if anyone has a code to set a (item) to give effect (potion) for example I use BlazePowder and it gives strength effect and then the BlazePowder goes down (Removed Or Goes Down By 1)
     
  2. DayKoala

    DayKoala Silverfish

    Messages:
    22
    GitHub:
    daykoala
    PHP:
       public function onHeld(PlayerItemHeldEvent $event){   
            
    $player $event->getPlayer();
            
    $hand $player->getInventory()->getItemInHand();
            
    $count $hand->getCount();
            
    $air Item::get(001);
            
            if(
    $hand->getId() == 1){

            
    $player->sendMessage("You Have ".$count." Stones!");
            
    $speed Effect::getEffect(Effect::SPEED);
            
    $speed->setDuration($count);
            
    $player->addEffect($speed);
            
    $player->getInventory()->setItemInHand($air);
            }   
        }
     
  3. echo_gamesz234

    echo_gamesz234 Silverfish

    Messages:
    24
    GitHub:
    echogamesz234
    Hmm thank you,I'll figure how to use I I really appreciate it :) new to this codding thing
     
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Why do you request code rather than requesting a plugin directly :/
     
    jasonwynn10 and Thunder33345 like this.
  5. echo_gamesz234

    echo_gamesz234 Silverfish

    Messages:
    24
    GitHub:
    echogamesz234
    Because idont think people have one :/
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    If you request code, this belongs in the development section. If you are requesting a plugin, then it belongs in the Request section. Make up your mind. What do you want?
     
  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.