Go to file
aBlender 74ba2d0251 Added Game-Rule Drop Item 2018-06-28 13:23:46 -07:00
doc fixing docs again 2017-12-29 19:20:51 -08:00
examples fixing docs again 2017-12-29 19:12:15 -08:00
.gitignore git ignore 2017-12-22 11:52:52 -08:00
License.md license 2017-12-28 14:09:50 -08:00
README.md Update README.md 2018-03-15 11:08:16 -07:00
blocks.rkt fixed transparent mappings and added air and glass 2018-03-29 18:35:11 -07:00
compiler.rkt better success message 2018-01-04 12:03:17 -08:00
core.rkt Modified MINETEST_PATH to auto get the home user 2018-03-15 11:06:52 -07:00
entities.rkt entities 2017-12-26 12:44:12 -08:00
info.rkt fixing docs again 2017-12-29 19:12:15 -08:00
items.rkt refactored so assets are easier to add more key vals to (add-behaviour-to) form 2017-12-24 20:10:39 -08:00
lua.rkt Added Game-Rule Drop Item 2018-06-28 13:23:46 -07:00
main.rkt converted to a hash lang 2017-12-28 13:34:34 -08:00
make-docs.sh fixing docs again 2017-12-29 19:20:51 -08:00
minetest.scrbl fixing docs again 2017-12-29 19:20:51 -08:00
minetest.scrbl~ figuring out how to use scribble 2017-12-28 17:07:29 -08:00
mob-api-raw.rkt entities 2017-12-26 12:44:12 -08:00
recipes.rkt refactored so assets are easier to add more key vals to (add-behaviour-to) form 2017-12-24 20:10:39 -08:00
rocket-module.rkt converted to a hash lang 2017-12-28 13:34:34 -08:00
rules.rkt basic rules language for logic 2017-12-27 15:27:30 -08:00
schematics-writer-raw.rkt schematics working 2017-12-26 18:25:57 -08:00
schematics.rkt fixed transparent mappings and added air and glass 2018-03-29 18:35:11 -07:00
textures.rkt refactoring, added a texture noise function 2017-12-27 10:33:23 -08:00

README.md

#lang minetest for Modding Minetest in Racket

This language helps you create Minetest mods. Quick demo:

Alt text

This compiles to a mod that gives you a red block that toggles to a green block when you punch it (and vice versa):

Alt text

The goal of #lang minetest is to help you get procedurally generated art onto Minetest blocks, items, particles, entities, recipes, and schematics. We developed it for educational purposes at ThoughtSTEM.

Getting Started

(Note: #lang minetest works out of the box on Linux. For Mac or Windows, you'll have to make sure your minetest installation is at ~/HOME_DIR/.minetest)

Install Minetest:

sudo apt-get install minetest

Install Racket:

sudo apt-get install racket

Open DrRacket. Add the minetest package (File > Install Package...)

Write a hello world mod:

#lang minetest

(define-block hello "Hello" (text "Hello" 24 "red"))

(compile-mod my-mod)

Run it in DrRacket (this compiles the mod). Launch Minetest. Create a world and add the mod named my_racket_mod.

You will find a "Hello" block in your inventory:

Alt text

Current Status

This language gives you ways of converting images into:

  • Blocks
  • Items
  • (Cube shaped) Entities
  • Recipes
  • Particles
  • Schematics

There are currently also a (limited) set of game rules for defining callbacks. Only a few callbacks are currently supported:

  • on_punch for blocks
  • on_drop for blocks
  • on_drop for items

And for each of the above callbacks there is a (limited) set of effects you can trigger:

  • produce particles
  • spawn entity
  • place schematic
  • place block

We'll probably add more in the future.

Further Reading

  • How to Design Programs: 2nd Edition - For an amazing introduction to Racket and the equally amazing image library (2htdp/image). Anything you can create with the 2htdp/image library can be placed into Minetest with #lang minetest. You should learn this first. Most of the power of #lang minetest comes from the power of Racket and 2htdp/image.

  • The docs for #lang minetest - I'm still working on these. If something isn't documented, a good supplement would be the /examples directory.

  • The docs for Minetest modding in Lua - For when you want to do something that #lang minetest doesn't yet support. The compilation process tries to produce readable Lua code. Feel free to edit it after compilation (just remember that it will get overwritten when you compile again -- so you might want to copy the compiled output directory to a new directory).

Authors

  • Stephen R. Foster - Initial work - srfoster