Difference between revisions of "Lua API Documentation"

From Minetest Developer Wiki
Jump to navigation Jump to search
m (→‎Minetest Developer Wiki: fix another typo)
Line 2: Line 2:
  
 
== Official documentation ==
 
== Official documentation ==
=== lua_api.txt ===
+
=== lua_api.txt / HTML ===
  
This is the most important document you need during modding.  
+
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 <code>doc</code> directory of your Minetest installation. You can also read the latest (in-development) version of this file online here: [https://github.com/minetest/minetest/blob/master/doc/lua_api.txt lua_api.txt]. But we strongly recommend you read the file installed on your computer so you read the correct version.
+
This is a text file containing the only (!) official reference documentation for the entire Lua API. You can find it in the <code>doc</code> 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 [https://minetest.gitlab.io/minetest/ HTML] or [https://github.com/minetest/minetest/blob/master/doc/lua_api.txt plaintext].
  
 
Note this assumes you are already familiar with Lua programming. If you aren't, take a look into the [[#Minetest_Modding_Book|Minetest Modding Book]] first.
 
Note this assumes you are already familiar with Lua programming. If you aren't, take a look into the [[#Minetest_Modding_Book|Minetest Modding Book]] first.
Line 18: Line 20:
  
 
https://rubenwardy.com/minetest_modding_book/en/index.html
 
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 ===
 
=== Minetest Developer Wiki ===

Revision as of 20:06, 3 August 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 / 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.