CommandHelper

CommandHelper

46.5k Downloads

Cannot set potion meta

LadyCailinBot opened this issue ยท 6 comments

commented

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

commented

Comment by PseudoKnight

potions is an array of potion effect arrays. The example is correct in get_itemmeta, but not in set_itemmeta.

commented

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

commented

Comment by PseudoKnight

I told you. It's an array of arrays, as shown in get_itemmeta.

commented

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

commented

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))))

commented

Comment by PseudoKnight

Fixed the incorrect documentation in set_itemmeta()