File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2181,6 +2181,21 @@ Example:
2181
2181
meta:set_string("key", "value")
2182
2182
print(dump(meta:to_table()))
2183
2183
2184
+ Example manipulations of "description" and expected output behaviors:
2185
+
2186
+ print(ItemStack("default:pick_steel"):get_description()) --> Steel Pickaxe
2187
+ print(ItemStack("foobar"):get_description()) --> Unknown Item
2188
+
2189
+ local stack = ItemStack("default:stone")
2190
+ stack:get_meta():set_string("description", "Custom description\nAnother line")
2191
+ print(stack:get_description()) --> Custom description\nAnother line
2192
+ print(stack:get_short_description()) --> Custom description
2193
+
2194
+ stack:get_meta():set_string("short_description", "Short")
2195
+ print(stack:get_description()) --> Custom description\nAnother line
2196
+ print(stack:get_short_description()) --> Short
2197
+
2198
+ print(ItemStack("mod:item_with_no_desc"):get_description()) --> mod:item_with_no_desc
2184
2199
2185
2200
2186
2201
You can’t perform that action at this time.
0 commit comments