1. Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

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

Solved Itemflags & skript-mirror

Discussion in 'Skript' started by mel_instagibson, Sep 17, 2018.

Tags:
Thread Status:
Not open for further replies.
  1. mel_instagibson

    Joined:
    Feb 4, 2017
    Messages:
    71
    Likes Received:
    4
    Hi, so i updated to 1.13 and it seems like there wont be any update to skstuff so im trying to set item flags via skript-mirror since i cant use nbt anymore.

    currently i have this:

    Code (Skript):
    1.  
    2. import:
    3.         java.util.List
    4.         java.util.Arrays
    5.         java.util.ArrayList
    6.         org.bukkit.inventory.ItemFlag
    7.         org.bukkit.enchantments.Enchantment
    8.         org.bukkit.inventory.ItemStack
    9.  
    10. command /meta:
    11.         permission: *
    12.         trigger:
    13.                 set {mtest} to "diamond" parsed as item
    14.                 set {_meta} to {mtest}.getItemMeta()
    15.                 set {_lore} to new ArrayList()
    16.                 {_lore}.add("line1")
    17.                 {_lore}.add("line2")
    18.                 {_meta}.setLore({_lore})
    19.                 {_meta}.setDisplayName("&eName")
    20.                 {_meta}.setUnbreakable(true)
    21.                 {_meta}.addEnchant(Enchantment.ARROW_FIRE!, 10, true)
    22.                 {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS!, ItemFlag.HIDE_UNBREAKABLE!])
    23.                 {mtest}.setItemMeta({_meta})
    24.                 give 1 of {mtest} to player
    25.  
    but i get this warning and setting the itemflags its not working (everything else is tho:

    WARN]: [Skript] method CraftMetaItem#addItemFlags called with (HIDE_ENCHANTS, HIDE_UNBREAKABLE (ItemFlag[])) threw a ClassCastException: Cannot cast [Lorg.bukkit.inventory.ItemFlag; to org.bukkit.inventory.ItemFlag

    paperspigot 1.12.2, skript-mirror 0.18 and skript 2.2-dev37c

    i also tried this on 1.13.1 with the latest skript version but i get the same result, even if i try it with only one flag.
    anyone got an idea?
     
  2. btk5h

    Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    154
    Likes Received:
    159
    Hiya, I replied to this issue on the skript-mirror issue tracker. The method resolver was recently cleaned up, fixing this bug in the process. It will be fixed in the next update, which should come out later today or tomorrow.
     
    • Friendly Friendly x 1
  3. mel_instagibson

    Joined:
    Feb 4, 2017
    Messages:
    71
    Likes Received:
    4
    Oh nice, i wasnt sure if this was a bug since you couldnt reproduce it so i thought ill just ask here. guess thats solved now, ty!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...