Item Stacks: Add note about item meta data
This commit is contained in:
parent
6f9af6f0fd
commit
4b23c1689a
@ -120,14 +120,13 @@ local items2 = ItemStack(data)
|
||||
|
||||
## Meta data
|
||||
|
||||
ItemStacks can also have a single field of metadata attached to
|
||||
them.
|
||||
ItemStacks can have meta data, and use the same API as [Node Metadata](node_metadata.html).
|
||||
|
||||
{% highlight lua %}
|
||||
local meta = items:get_metadata()
|
||||
print(dump(meta))
|
||||
meta = meta .. " ha!"
|
||||
items:set_metadata(meta)
|
||||
local meta = items:get_meta()
|
||||
meta:set_string("foo", meta:get_string("foo") .. " ha!")
|
||||
|
||||
print(dump(meta:get_string("foo")))
|
||||
-- if ran multiple times, would give " ha! ha! ha!"
|
||||
{% endhighlight %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user