If you want to practice at home building Minetest structures with python programs, you will need to install Minetest server with its mods. Before we start, make sure you have completed the Minetest client install.
The steps to configure the server are:
- Install git
- Install mods.
irc, irc_commands, irc_builder, signs_lib
- Configure IRC
Windows users will need to download the latest from https://git-scm.com/ and install. This will also install Git-Bash which is a command line shell similar to those on Mac and Linux.
Linux and Mac users should already have git installed. To test, type the following in the Terminal:
If it is not installed it will give an error message saying “command not found”. Mac users can download the software from the above site or install it using brew as they did with minetest.
brew install git # Mac
Linux users can install using one of the following if it is not already installed.
apt install git # Ubuntu, Debian
yum install git # Fedora, Centos, Red Hat
The irc mod for minetest requires luasocket. This is difficult to install on windows so I have built a 64 bit version of minetest with irc mod and luasocket already built in. It can be downloaded from minetest-0.5.0-6cfd699b-irc-win64.zip.
On Mac, install luasocket using brew and luarocks.
brew install lua51
luarocks-5.1 install luasocket
On Ubuntu install luasocket using apt and luarocks.
apt install luarocks
luarocks install luasocket
The following commands are to be typed into Git-Bash (Windows) or Terminal (Mac, Linux). Change directory to the minetest mods directory. If the directory doesn’t exist you may have to create it.
Windows 64 bit
cd Library/Application\ Support/minetest/mods git clone --recursive https://github.com/minetest-mods/irc.git
cd .minetest/mods git clone --recursive https://github.com/minetest-mods/irc.git
Windows / Mac / Linux
git clone https://github.com/ShadowNinja/minetest-irc_commands.git git clone https://github.com/minetest-mods/signs_lib.git git clone https://github.com/timcu/irc_builder.git mv minetest-irc_commands irc_commands
Configure mods and IRC
Every Minetest world in which you want to use these mods needs to have them enabled.
- Run Minetest.
- Select [Settings] tab, then [Advanced Settings] button in bottom left
- Expand: + Server / Singleplayer + Security
- [Edit] secure.trusted+mods. type in
- Expand: + Mods + irc + Basic
- [Edit] Bot nickname. For example:
- [Edit] IRC server. I like Rizon which has server:
- [Edit] Channel to join. Choose a unique channel . eg
- Port number can be 6667 and Auto-connect enabled. Channels starting with ## are generally temporary channels. Remember these settings to use in your python program. Make sure your IRC server allows several connections from the same IP address.
- From the [Local Game] tab, select your world and click on [Configure]
- Select mod on the right and click the “enabled” check box above for each of the four
- Click [Save] button to return to [Local Game] tab
- Type in a password in green password field and click [Host Game]
- Users who wish to build structures from python will need privilege irc_builder. After they have logged in grant them this privilege by typing
/grant username irc_builder
Program in Python 3
Now you can start to write programs in Python which will build structures in Minetest. Remember to install ircbuilder python module in your python virtual environment so that your program can communicate with IRC and hence with Minetest. You can do this in PyCharm Edu from Settings (Windows) or Preferences (Mac) > Project > Project Interpreter > + (and type in ircbuilder).