node

From Minetest Developer Wiki
Jump to: navigation, search

{name="name", param1=num, param2=num}

param1 and param2 are 8 bit integers. The engine uses them for certain automated functions. If you don't use these functions, you can use them to store arbitrary values.

The functions of param1 and param2 are determined by certain fields in the node definition:

  • param1 is reserved for the engine when paramtype != "none":
  • paramtype = "light". The value stores light with and without sun in its upper and lower 4 bits.
  • param2 is reserved for the engine when any of these are used:
  • liquidtype == "flowing". The level and some flags of the liquid is stored in param2
  • drawtype == "flowingliquid". The drawn liquid level is read from param2
  • drawtype == "torchlike", drawtype == "signlike" or paramtype2 == "wallmounted". The rotation of the node is stored in param2. You can make this value by using minetest.dir_to_wallmounted().
  • paramtype2 == "facedir". The rotation of the node is stored in param2. Furnaces and chests are rotated this way. Can be made by using minetest.dir_to_facedir().


Nodes can also contain extra data. See NodeMetaRef.

New nodes can be registered with minetest.register_node

Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox