Difference between revisions of "Installing Mods"

From Minetest Wiki
Jump to navigation Jump to search
(Copied from dev wiki)
 
(rename Minetest to Luanti)
 
(34 intermediate revisions by 12 users not shown)
Line 1: Line 1:
After downloading a mod (e.g. from the [http://forum.minetest.net/viewforum.php?id=11 Mod Releases forum]) you usually have a .zip archive. In order to get the mod running in you have to unpack it in one of the folders where Minetest looks for mods. This depends on what Minetest version you have installed.
+
{{Languages}}
 +
__NOTOC__
 +
== Security considerations ==
 +
'''Mods are by default run in a secure environment that restricts access to the filesystem and execution of external programs, however not all sandboxes are 100% secure. Additionally do not mark mods as trusted or disable mod security altogether if you are not aware of what you are doing, as they will run unsandboxed at the same privileges as Luanti. This applies not only to malicious mods but benign ones with security vulnerabilities. Excercise caution when downloading mods outside of official channels such as ContentDB where mods are vetted by the community for safety and security.'''
  
Make sure that you rename the folder to the modname (e.g. rename <code>PilzAdam-carts-70cc4f4</code> to <code>carts</code>). You can find the modname in the title of the forum topic.
+
== Installing a mod ==
 +
Mods can be installed from ContentDB in the "Browse online content" button in Luanti 5.0+. Mods downloaded this way are automatically installed and get checked for updates. See [https://content.minetest.net/help/installing/ Installing content].
  
If one of the below mentioned directories does not exist, create it.
+
For mods downloaded manually, you would clone the source repository or extract the Zip archive into your mods folder.
  
== Install directory (Minetest 0.4.7 and later) ==
+
To find your mods folder, go into the "About" tab and press the "Open User Data Directory" button. If there isn't already a mods folder there then create it.
In 0.4.7 and later the mods are installed globally and enabled per world.
 
  
The common place to install them is <code>$path_user/mods/</code>. That is <code>minetest-install-directory/mods/</code> in the official windows releases and RUN_IN_PLACE versions on Linux and <code>~/.minetest/mods/</code> in globally installed Minetest versions.
+
After extracting the mod there you need to enable it for your world. This can either be done in the GUI by clicking on “Configure” in the world selection, or by adding <code>load_mod_<modname> = true</code> in the world.mt file in the world directory.
  
After extracting the mod there you need to enable it for your world. This can either be done in the GUI by clicking on "Configure" in the world selection, or by adding <code>load_mod_<modname> = true</code> in the world.mt file in the world directory.
+
Note that newly installed mods are disabled for all worlds by default, so you explicitly need to enable them.
  
Note that new installed mods are disabled for all worlds by default, so you explicitly need to enable them.
+
== Additional install directories (all Luanti versions) ==
  
== Install directory (Minetest 0.4.6 and earlier) ==
+
Other places to install mods are <code>world-directory/worldmods/</code>, <code>$path_share/mods/</code> and <code>$<path_user, path_share>/games/<gameid>/mods/</code>. <code>$path_share</code> and <code>$path_user</code> are only relevant to system-wide installs of Luanti (currently, possible only on Linux). As mentioned above, Luanti on Windows and portable builds operate within their install directory itself, which corresponds to both <code>$path_share</code> and <code>$path_user</code>.
In 0.4.6 and earlier the mods are installed game specific, that means that you install the mods for every world that runs the "minetest" game or the "dwarves" game.
 
  
The common place to install them is <code>$path_user/mods/<gameid>/</code> (<code><gameid></code> is <code>minetest</code> if you run minetest_game). That is <code>minetest-install-directory/mods/<gameid>/</code> in the official windows releases and RUN_IN_PLACE versions on Linux and <code>~/.minetest/mods/<gameid>/</code> in globally installed Minetest versions.
+
Note that users should generally install mods in the normal install directory and not in the additional ones. Note that having copies of the same mod in different places may easily generate mod conflicts.
  
The mod will be loaded in every world that runs the game with the gameid <code><gameid></code>.
 
  
== Additional install directories (all Minetest versions) ==
+
Differences between the three kinds of places mods can be loaded from:
Other places to install mods are <code>world-directory/worldmods/</code>, <code>$path_share/mods/</code> and <code>$<path_user, path_share>/games/<gameid>/mods/</code>.
 
  
Note that users should generally install mods in the normal install directory and not in the additional ones.
+
*In the <code>/mods</code> folder technically parallel to the <code>/bin</code> folder the executable is in.
  
== Example structure ==
+
On different installations this may very well also be in some other Luanti location such as a shared, <code>system/game</code>, user or hidden folder. Only mods in this place are '''togglable'''. Mods in this folder can be run with any world created by any game. This is therefore an easy place to create mod conflicts that might even crash Luanti.
In this example the mods "carts" and "tnt" are installed:
+
 
<source>
+
*In a <code>/games/<some_game>/mods</code> folder.
    mods/
+
 
    ├── carts/
+
In case of "Minetest Game", this could be a sub-folder of <code><someplace>/minetest/games/minetest_game/mods</code> or <code><some_other_place>/minetest(or ~/.minetest)/games/minetest_game/mods</code>.
    │  ├── depends.txt
+
 
    │  ├── init.lua
+
Mods loaded from such locations are considered to be an essential part of said game and are '''not togglable'''. These mods apply to all worlds created with this game but not to any world created by another game (although many games may include the same mods)
    │  ├── functions.lua
+
 
    │  ├── README.txt
+
*In a <code>/worlds/<name_of_some_world>/worldmods</code> folder inside the sub-folder of a specific world.
    │  ├── textures/
+
 
    │  │  ├── carts_top.png
+
Mods in a worldmods folder are '''not togglable''' and will run on and only on that specific world, and cannot be accessed from any other world.
    │  │  └── ...
+
 
    │  └── models/
+
 
    │      ├── cart.x
+
[[Category:Mods]]
    │      └── ...
+
[[Category:Tutorials]]
    └── tnt/
 
        ├── init.lua
 
        ├── depends.txt
 
        ├── README.txt
 
        ├── textures/
 
        │  ├── tnt_side.png
 
        │  └── ...
 
        └── sounds/
 
            ├── tnt_explode.ogg
 
            └── ...
 
</source>
 

Latest revision as of 23:13, 22 October 2024

Languages Language: English • Deutsch • français • italiano • Bahasa Melayu

Security considerations

Mods are by default run in a secure environment that restricts access to the filesystem and execution of external programs, however not all sandboxes are 100% secure. Additionally do not mark mods as trusted or disable mod security altogether if you are not aware of what you are doing, as they will run unsandboxed at the same privileges as Luanti. This applies not only to malicious mods but benign ones with security vulnerabilities. Excercise caution when downloading mods outside of official channels such as ContentDB where mods are vetted by the community for safety and security.

Installing a mod

Mods can be installed from ContentDB in the "Browse online content" button in Luanti 5.0+. Mods downloaded this way are automatically installed and get checked for updates. See Installing content.

For mods downloaded manually, you would clone the source repository or extract the Zip archive into your mods folder.

To find your mods folder, go into the "About" tab and press the "Open User Data Directory" button. If there isn't already a mods folder there then create it.

After extracting the mod there you need to enable it for your world. This can either be done in the GUI by clicking on “Configure” in the world selection, or by adding load_mod_<modname> = true in the world.mt file in the world directory.

Note that newly installed mods are disabled for all worlds by default, so you explicitly need to enable them.

Additional install directories (all Luanti versions)

Other places to install mods are world-directory/worldmods/, $path_share/mods/ and $<path_user, path_share>/games/<gameid>/mods/. $path_share and $path_user are only relevant to system-wide installs of Luanti (currently, possible only on Linux). As mentioned above, Luanti on Windows and portable builds operate within their install directory itself, which corresponds to both $path_share and $path_user.

Note that users should generally install mods in the normal install directory and not in the additional ones. Note that having copies of the same mod in different places may easily generate mod conflicts.


Differences between the three kinds of places mods can be loaded from:

  • In the /mods folder technically parallel to the /bin folder the executable is in.

On different installations this may very well also be in some other Luanti location such as a shared, system/game, user or hidden folder. Only mods in this place are togglable. Mods in this folder can be run with any world created by any game. This is therefore an easy place to create mod conflicts that might even crash Luanti.

  • In a /games/<some_game>/mods folder.

In case of "Minetest Game", this could be a sub-folder of <someplace>/minetest/games/minetest_game/mods or <some_other_place>/minetest(or ~/.minetest)/games/minetest_game/mods.

Mods loaded from such locations are considered to be an essential part of said game and are not togglable. These mods apply to all worlds created with this game but not to any world created by another game (although many games may include the same mods)

  • In a /worlds/<name_of_some_world>/worldmods folder inside the sub-folder of a specific world.

Mods in a worldmods folder are not togglable and will run on and only on that specific world, and cannot be accessed from any other world.