![]() (use on_punch in the node def and minetest. Make a block which disappears after it has been punched 5 times.meta : set_string ( "infotext", "Here is some text that will appear on mouse over!" ) Your Turn This is used by furnaces to show progress and signs The Minetest Engine reads the field infotext in order to make textĪppear on mouse-over. foo = "bar" meta : from_table ( tmp ) Infotext You can convert to and from lua tables using to_table and from_table: local tmp = meta : to_table () tmp. Here are all the set functions you can use, as of writing: local value = "one" meta : set_string ( "key", value ) meta : set_string ( "foo", "bar" ) Setting meta data works pretty much exactly the same way. is_yes ( meta : get_string ( "key" )) if value then print ( "is yes" ) else print ( "is no" ) end Setting Metadata In order to do booleans, you should use get_string and minetest.is_yes: local value = minetest. Here are all the get functions you can use, as of writing: get_meta ( pos ) - where pos = Reading Metadata local value = meta : get_string ( "key" ) if value then print ( value ) else - value = nil - metadata of key "key" does not exist print ( value ) end ![]() Once you have a position of a node, you can do this: local meta = minetest. Metadata is stored in a key value relationship. who owns the node (such as in a locked chest).Īnd orientation are not stored in the metadata, but rather are part.progress on crafting (such as in a furnace). Requires the settime privilege /time Sets the time of day as a number between 0 (see time of day ). ⢠an nodeâs inventory (such as in a chest). /time Current game time (24h clock) World manipulation /time : Sets the time of day in the 24-hour format (0:00-23:59).In this chapter you will learn how to manipulate a nodeâs metadata. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |