1 -- mods/default/nodes.lua
7 (1. Material 2. Cobble variant 3. Brick variant [4. Modified forms])
16 default:desert_stonebrick
19 default:sandstonebrick
26 (1. Material [2. Modified forms])
29 default:dirt_with_grass
30 default:dirt_with_dry_grass
31 default:dirt_with_grass_footsteps
32 default:dirt_with_snow
48 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling [5. Fruits])
69 default:acacia_sapling
73 (1. In stone 2. Block)
75 default:stone_with_coal
78 default:stone_with_iron
81 default:stone_with_copper
85 default:stone_with_gold
88 default:stone_with_mese
91 default:stone_with_diamond
115 (1. Source 2. Flowing)
118 default:water_flowing
120 default:river_water_source
121 default:river_water_flowing
126 Tools / "Advanced" crafting / Non-"natural"
127 -------------------------------------------
140 default:obsidian_glass
152 default:nyancat_rainbow
160 minetest.register_node("default:stone", {
161 description = "Stone",
162 tiles = {"default_stone.png"},
163 groups = {cracky=3, stone=1},
164 drop = 'default:cobble',
165 legacy_mineral = true,
166 sounds = default.node_sound_stone_defaults(),
169 minetest.register_node("default:cobble", {
170 description = "Cobblestone",
171 tiles = {"default_cobble.png"},
172 is_ground_content = false,
173 groups = {cracky=3, stone=2},
174 sounds = default.node_sound_stone_defaults(),
177 minetest.register_node("default:stonebrick", {
178 description = "Stone Brick",
179 tiles = {"default_stone_brick.png"},
180 is_ground_content = false,
181 groups = {cracky=2, stone=1},
182 sounds = default.node_sound_stone_defaults(),
185 minetest.register_node("default:mossycobble", {
186 description = "Mossy Cobblestone",
187 tiles = {"default_mossycobble.png"},
188 is_ground_content = false,
189 groups = {cracky=3, stone=1},
190 sounds = default.node_sound_stone_defaults(),
195 minetest.register_node("default:desert_stone", {
196 description = "Desert Stone",
197 tiles = {"default_desert_stone.png"},
198 groups = {cracky=3, stone=1},
199 drop = 'default:desert_cobble',
200 legacy_mineral = true,
201 sounds = default.node_sound_stone_defaults(),
204 minetest.register_node("default:desert_cobble", {
205 description = "Desert Cobblestone",
206 tiles = {"default_desert_cobble.png"},
207 is_ground_content = false,
208 groups = {cracky=3, stone=2},
209 sounds = default.node_sound_stone_defaults(),
212 minetest.register_node("default:desert_stonebrick", {
213 description = "Desert Stone Brick",
214 tiles = {"default_desert_stone_brick.png"},
215 is_ground_content = false,
216 groups = {cracky=2, stone=1},
217 sounds = default.node_sound_stone_defaults(),
222 minetest.register_node("default:sandstone", {
223 description = "Sandstone",
224 tiles = {"default_sandstone.png"},
225 groups = {crumbly=2,cracky=3},
226 sounds = default.node_sound_stone_defaults(),
229 minetest.register_node("default:sandstonebrick", {
230 description = "Sandstone Brick",
231 tiles = {"default_sandstone_brick.png"},
232 is_ground_content = false,
234 sounds = default.node_sound_stone_defaults(),
239 minetest.register_node("default:obsidian", {
240 description = "Obsidian",
241 tiles = {"default_obsidian.png"},
242 sounds = default.node_sound_stone_defaults(),
243 groups = {cracky=1,level=2},
246 minetest.register_node("default:obsidianbrick", {
247 description = "Obsidian Brick",
248 tiles = {"default_obsidian_brick.png"},
249 is_ground_content = false,
250 sounds = default.node_sound_stone_defaults(),
251 groups = {cracky=1,level=2},
258 minetest.register_node("default:dirt", {
259 description = "Dirt",
260 tiles = {"default_dirt.png"},
261 groups = {crumbly=3,soil=1},
262 sounds = default.node_sound_dirt_defaults(),
265 minetest.register_node("default:dirt_with_grass", {
266 description = "Dirt with Grass",
267 tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
268 groups = {crumbly=3,soil=1},
269 drop = 'default:dirt',
270 sounds = default.node_sound_dirt_defaults({
271 footstep = {name="default_grass_footstep", gain=0.25},
275 minetest.register_node("default:dirt_with_dry_grass", {
276 description = "Dirt with Dry Grass",
277 tiles = {"default_dry_grass.png",
279 "default_dirt.png^default_dry_grass_side.png"
281 groups = {crumbly = 3, soil = 1},
282 drop = 'default:dirt',
283 sounds = default.node_sound_dirt_defaults({
284 footstep = {name = "default_grass_footstep", gain = 0.4},
288 minetest.register_node("default:dirt_with_grass_footsteps", {
289 description = "Dirt with Grass and Footsteps",
290 tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
291 groups = {crumbly=3,soil=1,not_in_creative_inventory=1},
292 drop = 'default:dirt',
293 sounds = default.node_sound_dirt_defaults({
294 footstep = {name="default_grass_footstep", gain=0.25},
298 minetest.register_node("default:dirt_with_snow", {
299 description = "Dirt with Snow",
300 tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"},
301 groups = {crumbly=3,soil=1},
302 drop = 'default:dirt',
303 sounds = default.node_sound_dirt_defaults({
304 footstep = {name="default_snow_footstep", gain=0.25},
310 minetest.register_node("default:sand", {
311 description = "Sand",
312 tiles = {"default_sand.png"},
313 groups = {crumbly=3, falling_node=1, sand=1},
314 sounds = default.node_sound_sand_defaults(),
317 minetest.register_node("default:desert_sand", {
318 description = "Desert Sand",
319 tiles = {"default_desert_sand.png"},
320 groups = {crumbly=3, falling_node=1, sand=1},
321 sounds = default.node_sound_sand_defaults(),
326 minetest.register_node("default:gravel", {
327 description = "Gravel",
328 tiles = {"default_gravel.png"},
329 groups = {crumbly=2, falling_node=1},
330 sounds = default.node_sound_dirt_defaults({
331 footstep = {name="default_gravel_footstep", gain=0.5},
332 dug = {name="default_gravel_footstep", gain=1.0},
338 minetest.register_node("default:clay", {
339 description = "Clay",
340 tiles = {"default_clay.png"},
341 groups = {crumbly=3},
342 drop = 'default:clay_lump 4',
343 sounds = default.node_sound_dirt_defaults(),
348 minetest.register_node("default:snow", {
349 description = "Snow",
350 tiles = {"default_snow.png"},
351 inventory_image = "default_snowball.png",
352 wield_image = "default_snowball.png",
355 drawtype = "nodebox",
359 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
362 groups = {crumbly = 3, falling_node = 1},
363 sounds = default.node_sound_dirt_defaults({
364 footstep = {name = "default_snow_footstep", gain = 0.25},
365 dug = {name = "default_snow_footstep", gain = 0.75},
368 on_construct = function(pos)
370 if minetest.get_node(pos).name == "default:dirt_with_grass" then
371 minetest.set_node(pos, {name = "default:dirt_with_snow"})
377 minetest.register_node("default:snowblock", {
378 description = "Snow Block",
379 tiles = {"default_snow.png"},
380 groups = {crumbly=3},
381 sounds = default.node_sound_dirt_defaults({
382 footstep = {name="default_snow_footstep", gain=0.25},
383 dug = {name="default_snow_footstep", gain=0.75},
389 minetest.register_node("default:ice", {
391 tiles = {"default_ice.png"},
392 is_ground_content = false,
395 sounds = default.node_sound_glass_defaults(),
402 minetest.register_node("default:tree", {
403 description = "Tree",
404 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
405 paramtype2 = "facedir",
406 is_ground_content = false,
407 groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
408 sounds = default.node_sound_wood_defaults(),
410 on_place = minetest.rotate_node
413 minetest.register_node("default:wood", {
414 description = "Wooden Planks",
415 tiles = {"default_wood.png"},
416 is_ground_content = false,
417 groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
418 sounds = default.node_sound_wood_defaults(),
421 minetest.register_node("default:sapling", {
422 description = "Sapling",
423 drawtype = "plantlike",
425 tiles = {"default_sapling.png"},
426 inventory_image = "default_sapling.png",
427 wield_image = "default_sapling.png",
429 sunlight_propagates = true,
433 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
435 groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
436 sounds = default.node_sound_leaves_defaults(),
439 minetest.register_node("default:leaves", {
440 description = "Leaves",
441 drawtype = "allfaces_optional",
444 tiles = {"default_leaves.png"},
445 special_tiles = {"default_leaves_simple.png"},
447 is_ground_content = false,
448 groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
453 -- player will get sapling with 1/20 chance
454 items = {'default:sapling'},
458 -- player will get leaves only if he get no saplings,
459 -- this is because max_items is 1
460 items = {'default:leaves'},
464 sounds = default.node_sound_leaves_defaults(),
466 after_place_node = default.after_place_leaves,
469 minetest.register_node("default:apple", {
470 description = "Apple",
471 drawtype = "plantlike",
473 tiles = {"default_apple.png"},
474 inventory_image = "default_apple.png",
476 sunlight_propagates = true,
478 is_ground_content = false,
481 fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
483 groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1},
484 on_use = minetest.item_eat(2),
485 sounds = default.node_sound_leaves_defaults(),
487 after_place_node = function(pos, placer, itemstack)
488 if placer:is_player() then
489 minetest.set_node(pos, {name="default:apple", param2=1})
496 minetest.register_node("default:jungletree", {
497 description = "Jungle Tree",
498 tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
499 paramtype2 = "facedir",
500 is_ground_content = false,
501 groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
502 sounds = default.node_sound_wood_defaults(),
504 on_place = minetest.rotate_node
507 minetest.register_node("default:junglewood", {
508 description = "Junglewood Planks",
509 tiles = {"default_junglewood.png"},
510 is_ground_content = false,
511 groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
512 sounds = default.node_sound_wood_defaults(),
515 minetest.register_node("default:jungleleaves", {
516 description = "Jungle Leaves",
517 drawtype = "allfaces_optional",
520 tiles = {"default_jungleleaves.png"},
521 special_tiles = {"default_jungleleaves_simple.png"},
523 is_ground_content = false,
524 groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
529 -- player will get sapling with 1/20 chance
530 items = {'default:junglesapling'},
534 -- player will get leaves only if he get no saplings,
535 -- this is because max_items is 1
536 items = {'default:jungleleaves'},
540 sounds = default.node_sound_leaves_defaults(),
542 after_place_node = default.after_place_leaves,
545 minetest.register_node("default:junglesapling", {
546 description = "Jungle Sapling",
547 drawtype = "plantlike",
549 tiles = {"default_junglesapling.png"},
550 inventory_image = "default_junglesapling.png",
551 wield_image = "default_junglesapling.png",
553 sunlight_propagates = true,
557 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
559 groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
560 sounds = default.node_sound_leaves_defaults(),
565 minetest.register_node("default:pinetree", {
566 description = "Pine Tree",
568 "default_pinetree_top.png",
569 "default_pinetree_top.png",
570 "default_pinetree.png"
572 paramtype2 = "facedir",
573 is_ground_content = false,
574 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
575 sounds = default.node_sound_wood_defaults(),
577 on_place = minetest.rotate_node
580 minetest.register_node("default:pinewood", {
581 description = "Pinewood Planks",
582 tiles = {"default_pinewood.png"},
583 is_ground_content = false,
584 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
585 sounds = default.node_sound_wood_defaults(),
588 minetest.register_node("default:pine_needles",{
589 description = "Pine Needles",
590 drawtype = "allfaces_optional",
592 tiles = {"default_pine_needles.png"},
595 is_ground_content = false,
596 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
600 {items = {"default:pine_sapling"}, rarity = 20},
601 {items = {"default:pine_needles"}}
604 sounds = default.node_sound_leaves_defaults(),
606 after_place_node = default.after_place_leaves,
609 minetest.register_node("default:pine_sapling", {
610 description = "Pine Sapling",
611 drawtype = "plantlike",
613 tiles = {"default_pine_sapling.png"},
614 inventory_image = "default_pine_sapling.png",
615 wield_image = "default_pine_sapling.png",
617 sunlight_propagates = true,
621 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
630 sounds = default.node_sound_leaves_defaults(),
633 minetest.register_node("default:acacia_tree", {
634 description = "Acacia Tree",
636 "default_acacia_tree_top.png",
637 "default_acacia_tree_top.png",
638 "default_acacia_tree.png"
640 paramtype2 = "facedir",
641 is_ground_content = false,
642 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
643 sounds = default.node_sound_wood_defaults(),
645 on_place = minetest.rotate_node
648 minetest.register_node("default:acacia_wood", {
649 description = "Acacia Wood Planks",
650 tiles = {"default_acacia_wood.png"},
651 is_ground_content = false,
652 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
653 sounds = default.node_sound_wood_defaults(),
656 minetest.register_node("default:acacia_leaves", {
657 description = "Acacia Leaves",
658 drawtype = "allfaces_optional",
660 tiles = {"default_acacia_leaves.png"},
662 is_ground_content = false,
663 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
667 {items = {"default:acacia_sapling"}, rarity = 20},
668 {items = {"default:acacia_leaves"}}
671 sounds = default.node_sound_leaves_defaults(),
673 after_place_node = default.after_place_leaves,
676 minetest.register_node("default:acacia_sapling", {
677 description = "Acacia Tree Sapling",
678 drawtype = "plantlike",
680 tiles = {"default_acacia_sapling.png"},
681 inventory_image = "default_acacia_sapling.png",
682 wield_image = "default_acacia_sapling.png",
684 sunlight_propagates = true,
688 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
697 sounds = default.node_sound_leaves_defaults(),
704 minetest.register_node("default:stone_with_coal", {
705 description = "Coal Ore",
706 tiles = {"default_stone.png^default_mineral_coal.png"},
708 drop = 'default:coal_lump',
709 sounds = default.node_sound_stone_defaults(),
712 minetest.register_node("default:coalblock", {
713 description = "Coal Block",
714 tiles = {"default_coal_block.png"},
715 is_ground_content = false,
717 sounds = default.node_sound_stone_defaults(),
722 minetest.register_node("default:stone_with_iron", {
723 description = "Iron Ore",
724 tiles = {"default_stone.png^default_mineral_iron.png"},
726 drop = 'default:iron_lump',
727 sounds = default.node_sound_stone_defaults(),
730 minetest.register_node("default:steelblock", {
731 description = "Steel Block",
732 tiles = {"default_steel_block.png"},
733 is_ground_content = false,
734 groups = {cracky=1,level=2},
735 sounds = default.node_sound_stone_defaults(),
740 minetest.register_node("default:stone_with_copper", {
741 description = "Copper Ore",
742 tiles = {"default_stone.png^default_mineral_copper.png"},
744 drop = 'default:copper_lump',
745 sounds = default.node_sound_stone_defaults(),
748 minetest.register_node("default:copperblock", {
749 description = "Copper Block",
750 tiles = {"default_copper_block.png"},
751 is_ground_content = false,
752 groups = {cracky=1,level=2},
753 sounds = default.node_sound_stone_defaults(),
756 minetest.register_node("default:bronzeblock", {
757 description = "Bronze Block",
758 tiles = {"default_bronze_block.png"},
759 is_ground_content = false,
760 groups = {cracky=1,level=2},
761 sounds = default.node_sound_stone_defaults(),
766 minetest.register_node("default:stone_with_mese", {
767 description = "Mese Ore",
768 tiles = {"default_stone.png^default_mineral_mese.png"},
770 groups = {cracky = 1},
771 drop = "default:mese_crystal",
772 sounds = default.node_sound_stone_defaults(),
776 minetest.register_node("default:mese", {
777 description = "Mese Block",
778 tiles = {"default_mese_block.png"},
780 groups = {cracky = 1, level = 2},
781 sounds = default.node_sound_stone_defaults(),
788 minetest.register_node("default:stone_with_gold", {
789 description = "Gold Ore",
790 tiles = {"default_stone.png^default_mineral_gold.png"},
792 drop = "default:gold_lump",
793 sounds = default.node_sound_stone_defaults(),
796 minetest.register_node("default:goldblock", {
797 description = "Gold Block",
798 tiles = {"default_gold_block.png"},
799 is_ground_content = false,
801 sounds = default.node_sound_stone_defaults(),
806 minetest.register_node("default:stone_with_diamond", {
807 description = "Diamond Ore",
808 tiles = {"default_stone.png^default_mineral_diamond.png"},
810 drop = "default:diamond",
811 sounds = default.node_sound_stone_defaults(),
814 minetest.register_node("default:diamondblock", {
815 description = "Diamond Block",
816 tiles = {"default_diamond_block.png"},
817 is_ground_content = false,
818 groups = {cracky=1,level=3},
819 sounds = default.node_sound_stone_defaults(),
823 -- Plantlife (non-cubic)
826 minetest.register_node("default:cactus", {
827 description = "Cactus",
828 tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
829 paramtype2 = "facedir",
830 groups = {snappy=1,choppy=3,flammable=2},
831 sounds = default.node_sound_wood_defaults(),
832 on_place = minetest.rotate_node,
834 after_dig_node = function(pos, node, metadata, digger)
835 default.dig_up(pos, node, digger)
839 minetest.register_node("default:papyrus", {
840 description = "Papyrus",
841 drawtype = "plantlike",
842 tiles = {"default_papyrus.png"},
843 inventory_image = "default_papyrus.png",
844 wield_image = "default_papyrus.png",
846 sunlight_propagates = true,
850 fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
852 groups = {snappy=3,flammable=2},
853 sounds = default.node_sound_leaves_defaults(),
855 after_dig_node = function(pos, node, metadata, digger)
856 default.dig_up(pos, node, digger)
860 minetest.register_node("default:dry_shrub", {
861 description = "Dry Shrub",
862 drawtype = "plantlike",
865 tiles = {"default_dry_shrub.png"},
866 inventory_image = "default_dry_shrub.png",
867 wield_image = "default_dry_shrub.png",
869 sunlight_propagates = true,
872 groups = {snappy=3,flammable=3,attached_node=1},
873 sounds = default.node_sound_leaves_defaults(),
876 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
880 minetest.register_node("default:junglegrass", {
881 description = "Jungle Grass",
882 drawtype = "plantlike",
885 tiles = {"default_junglegrass.png"},
886 inventory_image = "default_junglegrass.png",
887 wield_image = "default_junglegrass.png",
889 sunlight_propagates = true,
892 groups = {snappy=3,flammable=2,flora=1,attached_node=1},
893 sounds = default.node_sound_leaves_defaults(),
896 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
900 minetest.register_node("default:grass_1", {
901 description = "Grass",
902 drawtype = "plantlike",
904 tiles = {"default_grass_1.png"},
905 -- Use texture of a taller grass stage in inventory
906 inventory_image = "default_grass_3.png",
907 wield_image = "default_grass_3.png",
909 sunlight_propagates = true,
912 groups = {snappy=3,flammable=3,flora=1,attached_node=1},
913 sounds = default.node_sound_leaves_defaults(),
916 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
919 on_place = function(itemstack, placer, pointed_thing)
920 -- place a random grass node
921 local stack = ItemStack("default:grass_"..math.random(1,5))
922 local ret = minetest.item_place(stack, placer, pointed_thing)
923 return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
928 minetest.register_node("default:grass_"..i, {
929 description = "Grass",
930 drawtype = "plantlike",
932 tiles = {"default_grass_"..i..".png"},
933 inventory_image = "default_grass_"..i..".png",
934 wield_image = "default_grass_"..i..".png",
936 sunlight_propagates = true,
939 drop = "default:grass_1",
940 groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
941 sounds = default.node_sound_leaves_defaults(),
944 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
949 minetest.register_node("default:dry_grass_1", {
950 description = "Dry Grass",
951 drawtype = "plantlike",
953 tiles = {"default_dry_grass_1.png"},
954 inventory_image = "default_dry_grass_3.png",
955 wield_image = "default_dry_grass_3.png",
957 sunlight_propagates = true,
960 groups = {snappy=3,flammable=3,flora=1,attached_node=1},
961 sounds = default.node_sound_leaves_defaults(),
964 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
967 on_place = function(itemstack, placer, pointed_thing)
968 -- place a random dry grass node
969 local stack = ItemStack("default:dry_grass_"..math.random(1,5))
970 local ret = minetest.item_place(stack, placer, pointed_thing)
971 return ItemStack("default:dry_grass_1 "..itemstack:get_count()-(1-ret:get_count()))
976 minetest.register_node("default:dry_grass_"..i, {
977 description = "Dry Grass",
978 drawtype = "plantlike",
980 tiles = {"default_dry_grass_"..i..".png"},
981 inventory_image = "default_dry_grass_"..i..".png",
982 wield_image = "default_dry_grass_"..i..".png",
984 sunlight_propagates = true,
987 groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
988 drop = "default:dry_grass_1",
989 sounds = default.node_sound_leaves_defaults(),
992 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1001 minetest.register_node("default:water_source", {
1002 description = "Water Source",
1003 inventory_image = minetest.inventorycube("default_water.png"),
1004 drawtype = "liquid",
1007 name = "default_water_source_animated.png",
1009 type = "vertical_frames",
1017 -- New-style water source material (mostly unused)
1019 name = "default_water_source_animated.png",
1021 type = "vertical_frames",
1026 backface_culling = false,
1030 paramtype = "light",
1034 buildable_to = true,
1035 is_ground_content = false,
1038 liquidtype = "source",
1039 liquid_alternative_flowing = "default:water_flowing",
1040 liquid_alternative_source = "default:water_source",
1041 liquid_viscosity = 1,
1042 post_effect_color = {a=120, r=30, g=60, b=90},
1043 groups = {water=3, liquid=3, puts_out_fire=1},
1046 minetest.register_node("default:water_flowing", {
1047 description = "Flowing Water",
1048 inventory_image = minetest.inventorycube("default_water.png"),
1049 drawtype = "flowingliquid",
1050 tiles = {"default_water.png"},
1053 name = "default_water_flowing_animated.png",
1054 backface_culling = false,
1056 type = "vertical_frames",
1063 name = "default_water_flowing_animated.png",
1064 backface_culling = true,
1066 type = "vertical_frames",
1074 paramtype = "light",
1075 paramtype2 = "flowingliquid",
1079 buildable_to = true,
1080 is_ground_content = false,
1083 liquidtype = "flowing",
1084 liquid_alternative_flowing = "default:water_flowing",
1085 liquid_alternative_source = "default:water_source",
1086 liquid_viscosity = 1,
1087 post_effect_color = {a=120, r=30, g=60, b=90},
1088 groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
1092 minetest.register_node("default:river_water_source", {
1093 description = "River Water Source",
1094 inventory_image = minetest.inventorycube("default_river_water.png"),
1095 drawtype = "liquid",
1098 name = "default_river_water_source_animated.png",
1100 type = "vertical_frames",
1109 name = "default_river_water_source_animated.png",
1111 type = "vertical_frames",
1116 backface_culling = false,
1120 paramtype = "light",
1124 buildable_to = true,
1125 is_ground_content = false,
1128 liquidtype = "source",
1129 liquid_alternative_flowing = "default:river_water_flowing",
1130 liquid_alternative_source = "default:river_water_source",
1131 liquid_viscosity = 1,
1132 liquid_renewable = false,
1134 post_effect_color = {a=120, r=30, g=76, b=90},
1135 groups = {water=3, liquid=3, puts_out_fire=1},
1138 minetest.register_node("default:river_water_flowing", {
1139 description = "Flowing River Water",
1140 inventory_image = minetest.inventorycube("default_river_water.png"),
1141 drawtype = "flowingliquid",
1142 tiles = {"default_river_water.png"},
1145 name = "default_river_water_flowing_animated.png",
1146 backface_culling = false,
1148 type = "vertical_frames",
1155 name = "default_river_water_flowing_animated.png",
1156 backface_culling = true,
1158 type = "vertical_frames",
1166 paramtype = "light",
1167 paramtype2 = "flowingliquid",
1171 buildable_to = true,
1172 is_ground_content = false,
1175 liquidtype = "flowing",
1176 liquid_alternative_flowing = "default:river_water_flowing",
1177 liquid_alternative_source = "default:river_water_source",
1178 liquid_viscosity = 1,
1179 liquid_renewable = false,
1181 post_effect_color = {a=120, r=30, g=76, b=90},
1182 groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
1187 minetest.register_node("default:lava_source", {
1188 description = "Lava Source",
1189 inventory_image = minetest.inventorycube("default_lava.png"),
1190 drawtype = "liquid",
1193 name = "default_lava_source_animated.png",
1195 type = "vertical_frames",
1203 -- New-style lava source material (mostly unused)
1205 name = "default_lava_source_animated.png",
1207 type = "vertical_frames",
1212 backface_culling = false,
1215 paramtype = "light",
1216 light_source = default.LIGHT_MAX - 1,
1220 buildable_to = true,
1221 is_ground_content = false,
1224 liquidtype = "source",
1225 liquid_alternative_flowing = "default:lava_flowing",
1226 liquid_alternative_source = "default:lava_source",
1227 liquid_viscosity = 7,
1228 liquid_renewable = false,
1229 damage_per_second = 4 * 2,
1230 post_effect_color = {a=192, r=255, g=64, b=0},
1231 groups = {lava=3, liquid=2, hot=3, igniter=1},
1234 minetest.register_node("default:lava_flowing", {
1235 description = "Flowing Lava",
1236 inventory_image = minetest.inventorycube("default_lava.png"),
1237 drawtype = "flowingliquid",
1238 tiles = {"default_lava.png"},
1241 name = "default_lava_flowing_animated.png",
1242 backface_culling = false,
1244 type = "vertical_frames",
1251 name = "default_lava_flowing_animated.png",
1252 backface_culling = true,
1254 type = "vertical_frames",
1261 paramtype = "light",
1262 paramtype2 = "flowingliquid",
1263 light_source = default.LIGHT_MAX - 1,
1267 buildable_to = true,
1268 is_ground_content = false,
1271 liquidtype = "flowing",
1272 liquid_alternative_flowing = "default:lava_flowing",
1273 liquid_alternative_source = "default:lava_source",
1274 liquid_viscosity = 7,
1275 liquid_renewable = false,
1276 damage_per_second = 4 * 2,
1277 post_effect_color = {a=192, r=255, g=64, b=0},
1278 groups = {lava=3, liquid=2, hot=3, igniter=1, not_in_creative_inventory=1},
1282 -- Tools / "Advanced" crafting / Non-"natural"
1285 minetest.register_node("default:torch", {
1286 description = "Torch",
1287 drawtype = "torchlike",
1290 name = "default_torch_on_floor_animated.png",
1292 type = "vertical_frames",
1299 name="default_torch_on_ceiling_animated.png",
1301 type = "vertical_frames",
1308 name="default_torch_animated.png",
1310 type = "vertical_frames",
1317 inventory_image = "default_torch_on_floor.png",
1318 wield_image = "default_torch_on_floor.png",
1319 paramtype = "light",
1320 paramtype2 = "wallmounted",
1321 sunlight_propagates = true,
1322 is_ground_content = false,
1324 light_source = default.LIGHT_MAX - 1,
1326 type = "wallmounted",
1327 wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},
1328 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
1329 wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
1331 groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1},
1332 legacy_wallmounted = true,
1333 sounds = default.node_sound_defaults(),
1338 local chest_formspec =
1341 default.gui_bg_img..
1343 "list[current_name;main;0,0.3;8,4;]"..
1344 "list[current_player;main;0,4.85;8,1;]"..
1345 "list[current_player;main;0,6.08;8,3;8]"..
1346 "listring[current_name;main]"..
1347 "listring[current_player;main]"..
1348 default.get_hotbar_bg(0,4.85)
1350 local function get_locked_chest_formspec(pos)
1351 local spos = pos.x .. "," .. pos.y .. "," ..pos.z
1355 default.gui_bg_img..
1357 "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"..
1358 "list[current_player;main;0,4.85;8,1;]"..
1359 "list[current_player;main;0,6.08;8,3;8]"..
1360 "listring[nodemeta:".. spos .. ";main]"..
1361 "listring[current_player;main]"..
1362 default.get_hotbar_bg(0,4.85)
1366 local function has_locked_chest_privilege(meta, player)
1367 if player:get_player_name() ~= meta:get_string("owner") then
1373 minetest.register_node("default:chest", {
1374 description = "Chest",
1375 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1376 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1377 paramtype2 = "facedir",
1378 groups = {choppy=2,oddly_breakable_by_hand=2},
1379 legacy_facedir_simple = true,
1380 is_ground_content = false,
1381 sounds = default.node_sound_wood_defaults(),
1383 on_construct = function(pos)
1384 local meta = minetest.get_meta(pos)
1385 meta:set_string("formspec", chest_formspec)
1386 meta:set_string("infotext", "Chest")
1387 local inv = meta:get_inventory()
1388 inv:set_size("main", 8*4)
1390 can_dig = function(pos,player)
1391 local meta = minetest.get_meta(pos);
1392 local inv = meta:get_inventory()
1393 return inv:is_empty("main")
1395 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1396 minetest.log("action", player:get_player_name()..
1397 " moves stuff in chest at "..minetest.pos_to_string(pos))
1399 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1400 minetest.log("action", player:get_player_name()..
1401 " moves stuff to chest at "..minetest.pos_to_string(pos))
1403 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1404 minetest.log("action", player:get_player_name()..
1405 " takes stuff from chest at "..minetest.pos_to_string(pos))
1411 minetest.register_node("default:chest_locked", {
1412 description = "Locked Chest",
1413 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1414 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1415 paramtype2 = "facedir",
1416 groups = {choppy=2,oddly_breakable_by_hand=2},
1417 legacy_facedir_simple = true,
1418 is_ground_content = false,
1419 sounds = default.node_sound_wood_defaults(),
1421 after_place_node = function(pos, placer)
1422 local meta = minetest.get_meta(pos)
1423 meta:set_string("owner", placer:get_player_name() or "")
1424 meta:set_string("infotext", "Locked Chest (owned by "..
1425 meta:get_string("owner")..")")
1427 on_construct = function(pos)
1428 local meta = minetest.get_meta(pos)
1429 meta:set_string("infotext", "Locked Chest")
1430 meta:set_string("owner", "")
1431 local inv = meta:get_inventory()
1432 inv:set_size("main", 8*4)
1434 can_dig = function(pos,player)
1435 local meta = minetest.get_meta(pos);
1436 local inv = meta:get_inventory()
1437 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1439 allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1440 local meta = minetest.get_meta(pos)
1441 if not has_locked_chest_privilege(meta, player) then
1446 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1447 local meta = minetest.get_meta(pos)
1448 if not has_locked_chest_privilege(meta, player) then
1451 return stack:get_count()
1453 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1454 local meta = minetest.get_meta(pos)
1455 if not has_locked_chest_privilege(meta, player) then
1458 return stack:get_count()
1460 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1461 minetest.log("action", player:get_player_name()..
1462 " moves stuff to locked chest at "..minetest.pos_to_string(pos))
1464 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1465 minetest.log("action", player:get_player_name()..
1466 " takes stuff from locked chest at "..minetest.pos_to_string(pos))
1468 on_rightclick = function(pos, node, clicker)
1469 local meta = minetest.get_meta(pos)
1470 if has_locked_chest_privilege(meta, clicker) then
1471 minetest.show_formspec(
1472 clicker:get_player_name(),
1473 "default:chest_locked",
1474 get_locked_chest_formspec(pos)
1478 on_blast = function() end,
1483 local bookshelf_formspec =
1486 default.gui_bg_img..
1488 "list[context;books;0,0.3;8,2;]"..
1489 "list[current_player;main;0,2.85;8,1;]"..
1490 "list[current_player;main;0,4.08;8,3;8]"..
1491 "listring[context;books]"..
1492 "listring[current_player;main]"..
1493 default.get_hotbar_bg(0,2.85)
1495 minetest.register_node("default:bookshelf", {
1496 description = "Bookshelf",
1497 tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
1498 is_ground_content = false,
1499 groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
1500 sounds = default.node_sound_wood_defaults(),
1502 on_construct = function(pos)
1503 local meta = minetest.get_meta(pos)
1504 meta:set_string("formspec", bookshelf_formspec)
1505 local inv = meta:get_inventory()
1506 inv:set_size("books", 8*2)
1508 can_dig = function(pos,player)
1509 local meta = minetest.get_meta(pos);
1510 local inv = meta:get_inventory()
1511 return inv:is_empty("books")
1514 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1515 local meta = minetest.get_meta(pos)
1516 local inv = meta:get_inventory()
1517 local to_stack = inv:get_stack(listname, index)
1518 if listname == "books" then
1519 if minetest.get_item_group(stack:get_name(), "book") ~= 0
1520 and to_stack:is_empty() then
1528 allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1529 local meta = minetest.get_meta(pos)
1530 local inv = meta:get_inventory()
1531 local stack = inv:get_stack(from_list, from_index)
1532 local to_stack = inv:get_stack(to_list, to_index)
1533 if to_list == "books" then
1534 if minetest.get_item_group(stack:get_name(), "book") ~= 0
1535 and to_stack:is_empty() then
1543 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1544 minetest.log("action", player:get_player_name()..
1545 " moves stuff in bookshelf at "..minetest.pos_to_string(pos))
1547 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1548 minetest.log("action", player:get_player_name()..
1549 " moves stuff to bookshelf at "..minetest.pos_to_string(pos))
1551 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1552 minetest.log("action", player:get_player_name()..
1553 " takes stuff from bookshelf at "..minetest.pos_to_string(pos))
1559 minetest.register_node("default:sign_wall", {
1560 description = "Sign",
1561 drawtype = "nodebox",
1562 tiles = {"default_sign.png"},
1563 inventory_image = "default_sign_wall.png",
1564 wield_image = "default_sign_wall.png",
1565 paramtype = "light",
1566 paramtype2 = "wallmounted",
1567 sunlight_propagates = true,
1568 is_ground_content = false,
1571 type = "wallmounted",
1572 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1573 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1574 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1576 groups = {choppy=2,dig_immediate=2,attached_node=1},
1577 legacy_wallmounted = true,
1578 sounds = default.node_sound_defaults(),
1580 on_construct = function(pos)
1581 --local n = minetest.get_node(pos)
1582 local meta = minetest.get_meta(pos)
1583 meta:set_string("formspec", "field[text;;${text}]")
1584 meta:set_string("infotext", "\"\"")
1586 on_receive_fields = function(pos, formname, fields, sender)
1587 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1588 if minetest.is_protected(pos, sender:get_player_name()) then
1589 minetest.record_protection_violation(pos, sender:get_player_name())
1592 local meta = minetest.get_meta(pos)
1593 if not fields.text then return end
1594 minetest.log("action", (sender:get_player_name() or "").." wrote \""..fields.text..
1595 "\" to sign at "..minetest.pos_to_string(pos))
1596 meta:set_string("text", fields.text)
1597 meta:set_string("infotext", '"'..fields.text..'"')
1601 minetest.register_node("default:ladder", {
1602 description = "Ladder",
1603 drawtype = "signlike",
1604 tiles = {"default_ladder.png"},
1605 inventory_image = "default_ladder.png",
1606 wield_image = "default_ladder.png",
1607 paramtype = "light",
1608 paramtype2 = "wallmounted",
1609 sunlight_propagates = true,
1612 is_ground_content = false,
1614 type = "wallmounted",
1615 --wall_top = = <default>
1616 --wall_bottom = = <default>
1617 --wall_side = = <default>
1619 groups = {choppy=2,oddly_breakable_by_hand=3,flammable=2},
1620 legacy_wallmounted = true,
1621 sounds = default.node_sound_wood_defaults(),
1624 local fence_texture = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126"
1625 minetest.register_node("default:fence_wood", {
1626 description = "Wooden Fence",
1627 drawtype = "fencelike",
1628 tiles = {"default_wood.png"},
1629 inventory_image = fence_texture,
1630 wield_image = fence_texture,
1631 paramtype = "light",
1632 sunlight_propagates = true,
1633 is_ground_content = false,
1636 fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
1638 groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2},
1639 sounds = default.node_sound_wood_defaults(),
1644 minetest.register_node("default:glass", {
1645 description = "Glass",
1646 drawtype = "glasslike_framed_optional",
1647 tiles = {"default_glass.png", "default_glass_detail.png"},
1648 inventory_image = minetest.inventorycube("default_glass.png"),
1649 paramtype = "light",
1650 sunlight_propagates = true,
1651 is_ground_content = false,
1652 groups = {cracky=3,oddly_breakable_by_hand=3},
1653 sounds = default.node_sound_glass_defaults(),
1656 minetest.register_node("default:obsidian_glass", {
1657 description = "Obsidian Glass",
1658 drawtype = "glasslike",
1659 tiles = {"default_obsidian_glass.png"},
1660 paramtype = "light",
1661 is_ground_content = false,
1662 sunlight_propagates = true,
1663 sounds = default.node_sound_glass_defaults(),
1664 groups = {cracky=3,oddly_breakable_by_hand=3},
1669 minetest.register_node("default:rail", {
1670 description = "Rail",
1671 drawtype = "raillike",
1672 tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
1673 inventory_image = "default_rail.png",
1674 wield_image = "default_rail.png",
1675 paramtype = "light",
1676 sunlight_propagates = true,
1678 is_ground_content = false,
1681 -- but how to specify the dimensions for curved and sideways rails?
1682 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
1684 groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("rail")},
1689 minetest.register_node("default:brick", {
1690 description = "Brick Block",
1691 tiles = {"default_brick.png"},
1692 is_ground_content = false,
1693 groups = {cracky=3},
1694 sounds = default.node_sound_stone_defaults(),
1698 minetest.register_node("default:meselamp", {
1699 description = "Mese Lamp",
1700 drawtype = "glasslike",
1701 tiles = {"default_meselamp.png"},
1702 paramtype = "light",
1703 sunlight_propagates = true,
1704 is_ground_content = false,
1705 groups = {cracky = 3, oddly_breakable_by_hand = 3},
1706 sounds = default.node_sound_glass_defaults(),
1707 light_source = default.LIGHT_MAX,
1714 minetest.register_node("default:cloud", {
1715 description = "Cloud",
1716 tiles = {"default_cloud.png"},
1717 is_ground_content = false,
1718 sounds = default.node_sound_defaults(),
1719 groups = {not_in_creative_inventory=1},
1722 minetest.register_node("default:nyancat", {
1723 description = "Nyan Cat",
1724 tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png",
1725 "default_nc_side.png", "default_nc_back.png", "default_nc_front.png"},
1726 paramtype2 = "facedir",
1727 groups = {cracky=2},
1728 is_ground_content = false,
1729 legacy_facedir_simple = true,
1730 sounds = default.node_sound_defaults(),
1733 minetest.register_node("default:nyancat_rainbow", {
1734 description = "Nyan Cat Rainbow",
1736 "default_nc_rb.png^[transformR90", "default_nc_rb.png^[transformR90",
1737 "default_nc_rb.png", "default_nc_rb.png"
1739 paramtype2 = "facedir",
1740 groups = {cracky=2},
1741 is_ground_content = false,
1742 sounds = default.node_sound_defaults(),