Mods

Mod load path

Paths are relative to the directories listed in the [Paths] section above.

  • games/<gameid>/mods/
  • mods/
  • worlds/<worldname>/worldmods/

World-specific games

It is possible to include a game in a world; in this case, no mods or games are loaded or checked from anywhere else.

This is useful for e.g. adventure worlds and happens if the <worldname>/game/ directory exists.

Mods should then be placed in <worldname>/game/mods/.

Modpacks

Mods can be put in a subdirectory, if the parent directory, which otherwise should be a mod, contains a file named modpack.conf. The file is a key-value store of modpack details.

  • name: The modpack name.
  • description: Description of mod to be shown in the Mods tab of the main menu.

Note: to support 0.4.x, please also create an empty modpack.txt file.

Mod directory structure

mods
├── modname
   ├── mod.conf
   ├── screenshot.png
   ├── settingtypes.txt
   ├── init.lua
   ├── models
   ├── textures
      ├── modname_stuff.png
      └── modname_something_else.png
   ├── sounds
   ├── media
   ├── locale
   └── <custom data>
└── another

modname

The location of this directory can be fetched by using minetest.get_modpath(modname).

mod.conf

A key-value store of mod details.

  • name: The mod name. Allows Minetest to determine the mod name even if the folder is wrongly named.
  • description: Description of mod to be shown in the Mods tab of the main menu.
  • depends: A comma separated list of dependencies. These are mods that must be loaded before this mod.
  • optional_depends: A comma separated list of optional dependencies. Like a dependency, but no error if the mod doesn't exist.

Note: to support 0.4.x, please also provide depends.txt.

screenshot.png

A screenshot shown in the mod manager within the main menu. It should have an aspect ratio of 3:2 and a minimum size of 300×200 pixels.

depends.txt

Deprecated: you should use mod.conf instead.

This file is used if there are no dependencies in mod.conf.

List of mods that have to be loaded before loading this mod.

A single line contains a single modname.

Optional dependencies can be defined by appending a question mark to a single modname. This means that if the specified mod is missing, it does not prevent this mod from being loaded.

description.txt

Deprecated: you should use mod.conf instead.

This file is used if there is no description in mod.conf.

A file containing a description to be shown in the Mods tab of the main menu.

settingtypes.txt

A file in the same format as the one in builtin. It will be parsed by the settings menu and the settings will be displayed in the "Mods" category.

init.lua

The main Lua script. Running this script should register everything it wants to register. Subsequent execution depends on minetest calling the registered callbacks.

minetest.settings can be used to read custom or existing settings at load time, if necessary. (See [Settings])

models

Models for entities or meshnodes.

textures, sounds, media

Media files (textures, sounds, whatever) that will be transferred to the client and will be available for use by the mod.

locale

Translation files for the clients. (See [Translations])

Naming conventions

Registered names should generally be in this format:

modname:<whatever>

<whatever> can have these characters:

a-zA-Z0-9_

This is to prevent conflicting names from corrupting maps and is enforced by the mod loader.

Registered names can be overridden by prefixing the name with :. This can be used for overriding the registrations of some other mod.

The : prefix can also be used for maintaining backwards compatibility.

Example

In the mod experimental, there is the ideal item/node/entity name tnt. So the name should be experimental:tnt.

Any mod can redefine experimental:tnt by using the name

:experimental:tnt

when registering it. That mod is required to have experimental as a dependency.