How to make these items enchanted/glow.

Discussion in 'Plugin Development' started by Seuana, May 30, 2021.

  1. Offline

    Seuana

    For the last hour i've trying to find a way to get these items enchanted / glow but I cannot find any / do it, could someone help me?


    COMPASS = build(Material.COMPASS, ChatColor.AQUA + "Compass");
    INSPECT_BOOK = build(Material.BOOK, ChatColor.AQUA + "Inspection Book");
    WAND = build(Material.NETHER_STAR, 1, DyeColor.GRAY ChatColor.AQUA + "WorldEdit Wand");
    GO_VIS = build(Material.INK_SACK, 1, DyeColor.GRAY.getDyeData(), ChatColor.AQUA + "Become Visible");
    GO_INVIS = build(Material.INK_SACK, 1, DyeColor.LIME.getDyeData(), ChatColor.AQUA + "Become Invisible");
    ONLINE_STAFF = build(Material.SKULL_ITEM, 1, (byte)1, ChatColor.AQUA + "Online Staff");
    CARPET = build(Material.CARPET, 1, DyeColor.RED.getDyeData(), " ");
     
  2. Offline

    Shqep

    Code:Java
    1. final ItemStack item = new ItemStack(things);
    2. final ItemMeta meta = item.getItemMeta();
    3. meta.addEnchant(enchant, level, ignoresRestriction);
    4. // If you want them to hide the enchantments, so only the glow will show.
    5. meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);


    Assuming you know Java and wouldn't copy and paste without thinking, of course.

    EDIT:
    Javadocs link:
    ItemStack
    ItemMeta
     
    Theztc likes this.

Share This Page