Cannot set potion meta
LadyCailinBot opened this issue ยท 6 comments
CMDHELPER-3052 - Reported by Josh.vdub
This code does not work for me: set_itemmeta(player(), null, array(potions: array(id: 8, strength: 4, seconds: 90, ambient: true)))
This is the example code from the api doc
Comment by PseudoKnight
potions is an array of potion effect arrays. The example is correct in get_itemmeta, but not in set_itemmeta.
Comment by Josh.vdub
this is straight from the docs: http://wiki.sk89q.com/wiki/CommandHelper/Staged/API/set_itemmeta#Description
What should I be doing instead
Comment by PseudoKnight
I told you. It's an array of arrays, as shown in get_itemmeta.
Comment by Josh.vdub
get_itemmeta returns null for existing potions, and I cannot make new custom potions because the above code does not work
Comment by PseudoKnight
http://wiki.sk89q.com/wiki/CommandHelper/Staged/API/get_itemmeta#Examples
eg. set_itemmeta(player(), null, array(potions: array(array(id: 8, strength: 4, seconds: 90, ambient: true))))