Skip to content

Lua API

EliasFleckenstein03 edited this page Feb 14, 2020 · 5 revisions

How to start

If you'd like to mod dragonblocks, create a file in the game folder. Then add a dofile("your_file.lua") in game/init.lua. Your mod will get loaded when dragonblocks is starting.

Fuctions

dragonblocks.register_node(obj)

This function is used to register a new node. obj is a table that needs the following fields:

  • name: This is the itemstring of the node. It should follow the convention "modulename:modname"
  • texture: The path where the Texture for the Block is saved. You should place textures in the textures folder. They have to be 16*16 px. It can also contain:
  • translucent: If a node has this attribute black pixels of the texture will be transparent. [default: false]
Clone this wiki locally