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

Code for effects

Discussion in 'Facepalm' started by Defications2po, Apr 28, 2017.

Thread Status:
Not open for further replies.
  1. Defications2po

    Defications2po Witch

    Messages:
    51
    Yo, Hello pmmp user i am wondering if u happen to know what the code for effects is.
    so basically my brother Leo is making a sets plugin and hes making it with ease (well its obvious hes a god at coding) but anyway we fought so he does not want to talk to me so i cant ask him so i came here. Anyway so how do you make it so that when someone puts on a diamond helmet it gives them Regen and speed??
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    on the call to EntityArmorChangeEvent you can add something like this:
    PHP:
    $player->addEffect(Effect::getEffect(Effect::HASTE));
    $player->addEffect(Effect::getEffect(Effect::SPEED));
     
    corytortoise likes this.
  3. Defications2po

    Defications2po Witch

    Messages:
    51
    so whats the exact event is it use pocketmine\entity\Effect;???
     
  4. Defications2po

    Defications2po Witch

    Messages:
    51
    PHP:
    <?php

    namespace HCF;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\plugin;
    use 
    pocketmine\eventt;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\Player;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\command\CommandExecutor;
    use 
    pocketmine\utils\TextFormat;
    use 
    pocketmine\event\player\PlayerInteractEvent;
    use 
    pocketmine\entity\Effect;
    use 
    pocketmine\math\Vector3;
    use 
    pocketmine\block\Block;
    use 
    pocketmine\level\Level;
    use 
    pocketmine\event\player\PlayerMoveEvent;
    use 
    pocketmine\event\entity\EntityArmorChangeEvent;
     
    Last edited by a moderator: Apr 29, 2017
  5. Defications2po

    Defications2po Witch

    Messages:
    51
    are those the right events to use?
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Instead of asking for approval after each step maybe you should try testing it yourself?
     
    corytortoise and SOFe like this.
  7. Defications2po

    Defications2po Witch

    Messages:
    51
    Spoken like a true dev thx anyways ill try
     
    Teamblocket and jasonwynn10 like this.
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    I'm sorry to point out something that I bet 99% reading this want to say: please, nobody cares what happens between you and your brother, and you spent more than half of your post talking about it, before mentioning the main point of your post. If you really feel it necessary to mention, at least can you please kindly put it in a spoiler so that we won't be forced to read whatever happens in your very own family?
     
  9. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    He does these reasons so he does not get exposed on Twitter for being a 'fake dev'. there's nothing wrong with asking for help imo
     
  10. Defications2po

    Defications2po Witch

    Messages:
    51
    ohh ur talking about when ben got exposed by derpific for being a "fake dev" right???
     
  11. Defications2po

    Defications2po Witch

    Messages:
    51
  12. WreckagePE / ZAYD

    WreckagePE / ZAYD Slime

    Messages:
    82
    ? You do not know me. I am not ZaydPE, if you're thinking that.
     
  13. Defications2po

    Defications2po Witch

    Messages:
    51
Thread Status:
Not open for further replies.
  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.