Difference between revisions of "Lua API Documentation"

From Minetest Developer Wiki
Jump to navigation Jump to search
m (→‎Minetest Developer Wiki: fix formatting)
Line 23: Line 23:
  
 
=== Minetest Developer Wiki ===
 
=== Minetest Developer Wiki ===
'''WARNING''': The Minetest Developer Wiki is NOT the official Lua API documentation. You will see a lot of pages that just nippets lazily copied from <code>lua_api.txt</code> years ago and those are unsurprisingly now 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 <code>lua_api.txt</code> (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]].
+
'''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 <code>lua_api.txt</code> years ago and those are now unsurprisingly now 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 <code>lua_api.txt</code> (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.
 
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.

Revision as of 06:43, 29 July 2021

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

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. You can also read the latest (in-development) version of this file online here: lua_api.txt. But we strongly recommend you read the file installed on your computer so you read the correct version.

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

lua_api.txt, but more readable

You can view a more readable version of this document here: https://minetest.gitlab.io/minetest/ It's the same content, just nicely formatted and up to date.

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