@@ -2,6 +2,7 @@ Minetest Game API
2
2
=================
3
3
GitHub Repo: https://github.com/minetest/minetest_game
4
4
5
+
5
6
Introduction
6
7
------------
7
8
@@ -14,6 +15,7 @@ Please note:
14
15
* [#ABC] refers to a section in this document
15
16
* [pos] refers to a position table `{x = -5, y = 0, z = 200}`
16
17
18
+
17
19
Bucket API
18
20
----------
19
21
@@ -34,6 +36,7 @@ The bucket API allows registering new types of buckets for non-default liquids.
34
36
The filled bucket item is returned to the player that uses an empty bucket pointing to the given liquid source.
35
37
When punching with an empty bucket pointing to an entity or a non-liquid node, the on_punch of the entity or node will be triggered.
36
38
39
+
37
40
Beds API
38
41
--------
39
42
@@ -68,6 +71,7 @@ Beds API
68
71
}
69
72
}
70
73
74
+
71
75
Bones API
72
76
---------
73
77
@@ -77,6 +81,7 @@ in `bones.player_inventory_lists`.
77
81
78
82
e.g. `table.insert(bones.player_inventory_lists, "backpack")`
79
83
84
+
80
85
Creative API
81
86
------------
82
87
@@ -98,6 +103,7 @@ The contents of `creative.formspec_add` is appended to every creative inventory
98
103
page. Mods can use it to add additional formspec elements onto the default
99
104
creative inventory formspec to be drawn after each update.
100
105
106
+
101
107
Chests API
102
108
----------
103
109
@@ -148,6 +154,7 @@ The chests API allows the creation of chests, which have their own inventories f
148
154
groups = {choppy = 2, oddly_breakable_by_hand = 2},
149
155
protected = false, -- If true, only placer can modify chest.
150
156
157
+
151
158
Doors API
152
159
---------
153
160
@@ -221,6 +228,7 @@ The doors mod allows modders to register custom doors and trapdoors.
221
228
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
222
229
sounds = default.node_sound_wood_defaults(), -- optional
223
230
231
+
224
232
Dungeon Loot API
225
233
----------------
226
234
@@ -253,6 +261,7 @@ The mod that places chests with loot in dungeons provides an API to register add
253
261
-- supported types: "normal" (the cobble/mossycobble one), "sandstone", "desert"
254
262
-- optional, defaults to no type restrictions
255
263
264
+
256
265
Fence API
257
266
---------
258
267
@@ -274,6 +283,7 @@ Allows creation of new fences with "fencelike" drawtype.
274
283
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
275
284
sounds = default.node_sound_wood_defaults(),
276
285
286
+
277
287
Walls API
278
288
---------
279
289
@@ -286,6 +296,7 @@ walls.register(name, desc, texture, mat, sounds)
286
296
^ mat = "default:stone". Used to auto-generate crafting recipe.
287
297
^ sounds = sounds: see [#Default sounds]
288
298
299
+
289
300
Farming API
290
301
-----------
291
302
@@ -326,6 +337,7 @@ The farming API allows you to easily register plants and hoes.
326
337
maxlight = default.LIGHT_MAX -- Maximum light to grow
327
338
}
328
339
340
+
329
341
Fire API
330
342
--------
331
343
@@ -653,6 +665,7 @@ And override this function to change the layout:
653
665
return table.concat(tmp, "")
654
666
end
655
667
668
+
656
669
Stairs API
657
670
----------
658
671
@@ -686,6 +699,7 @@ delivered with Minetest Game, to keep them compatible with other mods.
686
699
* `desc_stair`: Description for stair node
687
700
* `desc_slab`: Description for slab node
688
701
702
+
689
703
Xpanes API
690
704
----------
691
705
@@ -706,6 +720,7 @@ Creates panes that automatically connect to each other
706
720
use_texture_alpha = true, -- Optional boolean (default: `false`) for colored glass panes
707
721
}
708
722
723
+
709
724
Raillike definitions
710
725
--------------------
711
726
@@ -739,6 +754,7 @@ Sounds inside the default table can be used within the sounds field of node defi
739
754
* `default.node_sound_glass_defaults()`
740
755
* `default.node_sound_metal_defaults()`
741
756
757
+
742
758
Default constants
743
759
-----------------
744
760
@@ -818,70 +834,39 @@ callback overridden. All the nodes listed in `leaves` have their
818
834
Dyes
819
835
----
820
836
821
- To make recipes that will work with any dye ever made by anybody, define
822
- them based on groups. You can select any group of groups, based on your need for
823
- amount of colors.
824
-
825
- ### Color groups
826
-
827
- Base color groups:
828
-
829
- * `basecolor_white`
830
- * `basecolor_grey`
831
- * `basecolor_black`
832
- * `basecolor_red`
833
- * `basecolor_yellow`
834
- * `basecolor_green`
835
- * `basecolor_cyan`
836
- * `basecolor_blue`
837
- * `basecolor_magenta`
838
-
839
- Extended color groups ( * means also base color )
840
-
841
- * `excolor_white` *
842
- * `excolor_lightgrey`
843
- * `excolor_grey` *
844
- * `excolor_darkgrey`
845
- * `excolor_black` *
846
- * `excolor_red` *
847
- * `excolor_orange`
848
- * `excolor_yellow` *
849
- * `excolor_lime`
850
- * `excolor_green` *
851
- * `excolor_aqua`
852
- * `excolor_cyan` *
853
- * `excolor_sky_blue`
854
- * `excolor_blue` *
855
- * `excolor_violet`
856
- * `excolor_magenta` *
857
- * `excolor_red_violet`
858
-
859
- The whole unifieddyes palette as groups:
860
-
861
- * `unicolor_<excolor>`
862
-
863
- For the following, no white/grey/black is allowed:
864
-
865
- * `unicolor_medium_<excolor>`
866
- * `unicolor_dark_<excolor>`
867
- * `unicolor_light_<excolor>`
868
- * `unicolor_<excolor>_s50`
869
- * `unicolor_medium_<excolor>_s50`
870
- * `unicolor_dark_<excolor>_s50`
871
-
872
- Example of one shapeless recipe using a color group:
837
+ Minetest Game dyes are registered with:
838
+
839
+ groups = {dye = 1, color_<color> = 1},
840
+
841
+ To make recipes that will work with dyes from many mods, define them using the
842
+ dye group and the color groups.
843
+
844
+ Dye color groups:
845
+
846
+ * `color_white`
847
+ * `color_grey`
848
+ * `color_dark_grey`
849
+ * `color_black`
850
+ * `color_red`
851
+ * `color_pink`
852
+ * `color_orange`
853
+ * `color_brown`
854
+ * `color_yellow`
855
+ * `color_green`
856
+ * `color_dark_green`
857
+ * `color_blue`
858
+ * `color_cyan`
859
+ * `color_violet`
860
+ * `color_magenta`
861
+
862
+ Example of one shapeless recipe using the dye group and a color group:
873
863
874
864
minetest.register_craft({
875
865
type = "shapeless",
876
- output = ' <mod>:item_yellow' ,
877
- recipe = {' <mod>:item_no_color', ' group:basecolor_yellow' },
866
+ output = " <mod>:item_yellow" ,
867
+ recipe = {" <mod>:item_no_color", " group:dye,color_yellow" },
878
868
})
879
869
880
- ### Color lists
881
-
882
- * `dye.basecolors` are an array containing the names of available base colors
883
-
884
- * `dye.excolors` are an array containing the names of the available extended colors
885
870
886
871
Trees
887
872
-----
@@ -922,6 +907,7 @@ Trees
922
907
* `default.grow_pine_bush(pos)`
923
908
* Grows a pine bush at pos
924
909
910
+
925
911
Carts
926
912
-----
927
913
@@ -944,6 +930,7 @@ Carts
944
930
likely be called many times per second, so the function needs
945
931
to make sure that the event is handled properly.
946
932
933
+
947
934
Key API
948
935
-------
949
936
0 commit comments