Lua API Documentation

From Minetest Developer Wiki
Revision as of 20:06, 3 August 2021 by Rubenwardy (talk | contribs)
(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

Minetest Developer Wiki

WARNING: The Minetest Developer Wiki is NOT the official 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. The thing is, this was a huge mistake and should have never been done in the first place. If you want to know what a specific function XYZ does, do NOT use this wiki, use lua_api.txt (see above). So, yeah, we have a bit of a mess right now and it's not easy to clean it up, which is why we didn't do it so far. See also: MinetestWiki:Lua API Wiki Documentation Cleanup.

What 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.