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

Adding effects when full armor is on!?

Discussion in 'Development' started by Remarkabless, Nov 29, 2017.

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

    Remarkabless Slime

    Messages:
    83
    GitHub:
    Remakem
    Hey i have this code, yes I know how to add effects when armor is on but how can I make it so that it only adds effect when a full iron armor set is put on. Heres the function
    PHP:
     public function onArmor(EntityChangeArmorEvent $e){

    $entity $e->getEntity();
    //We now use if statements and check if $entity is an instanceof Player.

    if($entity instanceof Player){
    if(
    //Code to check helmet, chestplate and leggings goes here){
     
  2. Remarkabless

    Remarkabless Slime

    Messages:
    83
    GitHub:
    Remakem
    I dont know how to check the whole armor suit please help
     
  3. KittyDev

    KittyDev Slime

    Messages:
    96
    GitHub:
    FreakingDev
    check if helmet, chestplate, leggings, boots is not equal to null
     
  4. Remarkabless

    Remarkabless Slime

    Messages:
    83
    GitHub:
    Remakem
    I get that, but how can I make it so that it only gives effects when it has CHESTPLATE HELMET LEGGINGS AND BOOTS. Like provide a function I tried using

    GOLD_HELMET && GOLD_CHESTPLATE but it didnt work please help
     
  5. KittyDev

    KittyDev Slime

    Messages:
    96
    GitHub:
    FreakingDev
    Check if the ID is equal to that
     
  6. Remarkabless

    Remarkabless Slime

    Messages:
    83
    GitHub:
    Remakem
    Can you please just give me simple example code? I cant really understand what you mean. I get it but I dont know what you mean like clearly please help.
     
  7. Remarkabless

    Remarkabless Slime

    Messages:
    83
    GitHub:
    Remakem
    Why are you being like this? Isnt this the point? I simply dont know how to check for null and atuff im new. I can make other functions and stuff. If you would have taught me I could have used for some othernstuff like I do with all the other stuff other people help me with. Seriously dude thats messed up
     
    Levi likes this.
  8. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    jasonwynn10 likes this.
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.