Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Enchanted Condition

Comments in 'Plugin Development' started by Infernus101, Nov 6, 2016.

  1. Infernus101
    Offline

    Infernus101 New Member

    Joined:
    May 30, 2016
    Posts:
    7
    Minecraft User:
    Infernus101
    What's the function/code to check if the item is enchanted or not?
  2. XShockinFireX
    Offline

    XShockinFireX New Member

    Joined:
    Jan 28, 2016
    Posts:
    14
    Minecraft User:
    XShockinFireX
    PHP:
    if($item->hasEnchantments()) {
    applqpak and Infernus101 like this.
  3. Infernus101
    Offline

    Infernus101 New Member

    Joined:
    May 30, 2016
    Posts:
    7
    Minecraft User:
    Infernus101
    Thanks, What about how many enchantments on an item?
  4. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    applqpak and Infernus101 like this.
  5. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    PHP:
    count($item->hasEnchantments())
    //hasEnchantments return an array of enchantments Enchantment[] to be exact
    applqpak and Infernus101 like this.
  6. Infernus101
    Offline

    Infernus101 New Member

    Joined:
    May 30, 2016
    Posts:
    7
    Minecraft User:
    Infernus101
    @Thunder33345
    PHP:
    count($item->getEnchantments())
    Thanks though!
  7. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    no problem! also just note that we have moved to http://pmmp.io
    applqpak and HimbeersaftLP like this.

Share This Page

Advertisement