skript-mirror is so amazing, it's a crime that there isn't more documentation on it!
But that's how it is and i can live with brute forcing my way through it until things work - however unfortunately i got stuck on this bit.
I'm try to make a script that can add itemflags. loading this script will produce no errors, but the part that adds the item flag does not work and i can't figure out why.
anybody push me in the right direction?
thank you
Solution:
The meta (for to me unknown reasons) had to be set to a variable first and then be applied to the item
But that's how it is and i can live with brute forcing my way through it until things work - however unfortunately i got stuck on this bit.
I'm try to make a script that can add itemflags. loading this script will produce no errors, but the part that adds the item flag does not work and i can't figure out why.
code_language.skript:
import:
org.bukkit.inventory.ItemFlag as ItemFlag
command /test:
trigger:
set {_item} to diamond hoe named "adsasdas"
{_item}.setItemMeta().addItemFlags(ItemFlag.HIDE_ATTRIBUTES!)
send "%{_item}.getItemMeta().getItemFlags()%"
anybody push me in the right direction?
thank you
Solution:
The meta (for to me unknown reasons) had to be set to a variable first and then be applied to the item
code_language.skript:
import:
org.bukkit.inventory.ItemFlag
command /test:
trigger:
set {_item} to diamond hoe named "adsasdas"
set {_meta} to {_item}.getItemMeta()
{_meta}.addItemFlags(ItemFlag.HIDE_ATTRIBUTES!, ItemFlag.HIDE_ENCHANTS!)
{_item}.setItemMeta({_meta})
send "%{_item}% flags: %{_item}.getItemMeta().getItemFlags()%"
add 1 of {_item} to command sender's inventory
Last edited: