Solved Itemflags & skript-mirror

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Feb 4, 2017
71
4
1
36
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_language.skript:
import:
        java.util.List
        java.util.Arrays
        java.util.ArrayList
        org.bukkit.inventory.ItemFlag
        org.bukkit.enchantments.Enchantment
        org.bukkit.inventory.ItemStack

command /meta:
        permission: *
        trigger:
                set {mtest} to "diamond" parsed as item
                set {_meta} to {mtest}.getItemMeta()
                set {_lore} to new ArrayList()
                {_lore}.add("line1")
                {_lore}.add("line2")
                {_meta}.setLore({_lore})
                {_meta}.setDisplayName("&eName")
                {_meta}.setUnbreakable(true)
                {_meta}.addEnchant(Enchantment.ARROW_FIRE!, 10, true)
                {_meta}.addItemFlags([ItemFlag.HIDE_ENCHANTS!, ItemFlag.HIDE_UNBREAKABLE!])
                {mtest}.setItemMeta({_meta})
                give 1 of {mtest} to player

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?
 
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.
 
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!
 
Status
Not open for further replies.