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

getArmorContents()

Discussion in 'Development' started by Zuruki, May 5, 2017.

  1. Zuruki

    Zuruki Baby Zombie

    Messages:
    118
    GitHub:
    zuruki
    If I $player->getArmorContents->getCustomName() == "Special Armor"

    so if they are wearing armor that ALL has the name "Special Armor" I want to give them strength
     
  2. Hipster

    Hipster Zombie

    Messages:
    214
    PHP:
    if($player->getInventory()->getHelmet()->getCustomName() === "Special Armor" and $player->getInventory()->getChestplate()->getCustomName() === "Special Armor" and $player->getInventory()->getLeggings()->getCustomName() === "Special Armor" and $player->getInventory()->getBoots()->getCustomName() === "Special Armor"){
    $player->addEffect(Effect::getEffect(5)->setDuration(600 20)->setAmplifier(2));
    return 
    true;
    }
     
  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.