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

Solved Enchantment Shine/Glow

Discussion in 'Development' started by TheClimbing, Oct 18, 2021.

  1. TheClimbing

    TheClimbing Spider Jockey

    Messages:
    39
    GitHub:
    theclimbing
    Hello guys,
    I've been trying to find a way to give an item just the glow an enchantment gives and if possible change it's colour, for example green, blue or maybe red. This is going to be used to indicate an item's rarity. Was unable to find anything so I'm writing in hopes anyone knows something more.
    Thanks in advance for any leads or snippets.
     
  2. minijaham

    minijaham Skeleton

    Messages:
    801
    GitHub:
    minijaham
  3. TheClimbing

    TheClimbing Spider Jockey

    Messages:
    39
    GitHub:
    theclimbing
    PHP:
    $ench = new ListTag(self::TAG_ENCH, [], NBT::TAG_Compound);
            
    $ench->push(new CompoundTag("", []));
            
    $this->setNamedTagEntry($ench);
    Okay so this does add an enchantment but it also adds an Protection 0 to the item display. What am I doing wrong?
     
    minijaham likes this.
  4. TheClimbing

    TheClimbing Spider Jockey

    Messages:
    39
    GitHub:
    theclimbing
    Solution was:
    PHP:
    $ench = new ListTag(self::TAG_ENCH, [], NBT::TAG_Compound);
            
    $this->setNamedTagEntry($ench);
    It seems like i don't need a new Compond tag to get the enchant glow. Thank you @minijaham
     
    minijaham likes this.
  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.