Lua API Documentation

From Minetest Developer Wiki
Revision as of 11:25, 24 May 2022 by Wuzzy (talk | contribs) (add link to Modding API)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Lua API of Minetest is extensively documented. This page tells you which documentation exists, and where to find it.

Official documentation

lua_api.txt / HTML

This is the most important document you need during modding.

This is a text file containing the only (!) official reference documentation for the entire Lua API. You can find it in the doc directory of your Minetest installation, or available online using the links below. We strongly recommend you read the file installed on your computer so you read the correct version

Latest (in-development) version available online as HTML or plaintext.

Note this assumes you are already familiar with Lua programming. If you aren't, take a look into the Minetest Modding Book first.

Other text files

In the doc directory of your Minetest installation, you will find a few other text files with related, but less important information and documentation.

Unofficial Documentation

Minetest Modding Book

A very extensive introduction into Minetest modding, great for complete beginners. Written by rubenwardy, a long-time developer for Minetest.

https://rubenwardy.com/minetest_modding_book/en/index.html

Deprecated documentation

Minetest Developer Wiki

The Minetest Developer Wiki does NOT represent the Lua API documentation. You will see a lot of pages that were just lazily copied from lua_api.txt years ago and those are now unsurprisingly horribly outdated and outright misleading. This was a huge mistake and should have never been done in the first place. We have added a prominent warning on (hopefully) each of the offending pages and proposed them for deletion, but we want to delete them all eventually. For the real documentation, refer to the resources above. See also: MinetestWiki:Lua API Wiki Documentation Cleanup.

While this Developer Wiki is meant to be is not meant to document the Lua API itself, but instead to document common development practices, pitfalls and general advice or agreed-upon guidelines for engine, game and mod developers. This is OK.

The wiki is useful to find some nice tips and tricks that would not belong into a reference documentation. This part of the wiki should be OK. But ignore everything that makes specific claims about the Lua API, like concrete function names, parameters, etc.