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
apt install git # Ubuntu
apt-get install git # Debian
yum install git # Fedora, Centos, Red Hat
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.
cd Documents/minetest-0.4.16-win64/mods # Windows 64 bit cd Documents/minetest-0.4.16-win32-msvc/mods # Windows 32 bit cd Library/Application\ Support/minetest/mods # Mac cd .minetest/mods # Linux git clone --recursive https://github.com/minetest-mods/irc.git 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: + Mods + irc + Basic
- [Edit] Bot nickname. For example: mtserver
- [Edit] IRC server. I like Rizon which has server: irc.rizon.net
- [Edit] Channel to join. Choose a unique channel . eg ##minetest3214
- 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).