1 -- mods/default/nodes.lua
4 --[[ Node name convention:
6 Although many node names are in combined-word form, the required form for new
7 node names is words separated by underscores. If both forms are used in written
8 language (for example pinewood and pine wood) the underscore form should be used.
17 (1. Material 2. Cobble variant 3. Brick variant [4. Modified forms])
26 default:desert_stonebrick
29 default:sandstonebrick
36 (1. Material [2. Modified forms])
39 default:dirt_with_grass
40 default:dirt_with_grass_footsteps
41 default:dirt_with_dry_grass
42 default:dirt_with_snow
58 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling [5. Fruits])
79 default:acacia_sapling
83 (1. In stone 2. Block)
85 default:stone_with_coal
88 default:stone_with_iron
91 default:stone_with_copper
95 default:stone_with_gold
98 default:stone_with_mese
101 default:stone_with_diamond
104 Plantlife (non-cubic)
105 ---------------------
125 (1. Source 2. Flowing)
128 default:water_flowing
130 default:river_water_source
131 default:river_water_flowing
136 Tools / "Advanced" crafting / Non-"natural"
137 -------------------------------------------
152 default:obsidian_glass
164 default:nyancat_rainbow
172 minetest.register_node("default:stone", {
173 description = "Stone",
174 tiles = {"default_stone.png"},
175 groups = {cracky = 3, stone = 1},
176 drop = 'default:cobble',
177 legacy_mineral = true,
178 sounds = default.node_sound_stone_defaults(),
181 minetest.register_node("default:cobble", {
182 description = "Cobblestone",
183 tiles = {"default_cobble.png"},
184 is_ground_content = false,
185 groups = {cracky = 3, stone = 2},
186 sounds = default.node_sound_stone_defaults(),
189 minetest.register_node("default:stonebrick", {
190 description = "Stone Brick",
191 tiles = {"default_stone_brick.png"},
192 is_ground_content = false,
193 groups = {cracky = 2, stone = 1},
194 sounds = default.node_sound_stone_defaults(),
197 minetest.register_node("default:mossycobble", {
198 description = "Mossy Cobblestone",
199 tiles = {"default_mossycobble.png"},
200 is_ground_content = false,
201 groups = {cracky = 3, stone = 1},
202 sounds = default.node_sound_stone_defaults(),
206 minetest.register_node("default:desert_stone", {
207 description = "Desert Stone",
208 tiles = {"default_desert_stone.png"},
209 groups = {cracky = 3, stone = 1},
210 drop = 'default:desert_cobble',
211 legacy_mineral = true,
212 sounds = default.node_sound_stone_defaults(),
215 minetest.register_node("default:desert_cobble", {
216 description = "Desert Cobblestone",
217 tiles = {"default_desert_cobble.png"},
218 is_ground_content = false,
219 groups = {cracky = 3, stone = 2},
220 sounds = default.node_sound_stone_defaults(),
223 minetest.register_node("default:desert_stonebrick", {
224 description = "Desert Stone Brick",
225 tiles = {"default_desert_stone_brick.png"},
226 is_ground_content = false,
227 groups = {cracky = 2, stone = 1},
228 sounds = default.node_sound_stone_defaults(),
232 minetest.register_node("default:sandstone", {
233 description = "Sandstone",
234 tiles = {"default_sandstone.png"},
235 groups = {crumbly = 2, cracky = 3},
236 sounds = default.node_sound_stone_defaults(),
239 minetest.register_node("default:sandstonebrick", {
240 description = "Sandstone Brick",
241 tiles = {"default_sandstone_brick.png"},
242 is_ground_content = false,
243 groups = {cracky = 2},
244 sounds = default.node_sound_stone_defaults(),
248 minetest.register_node("default:obsidian", {
249 description = "Obsidian",
250 tiles = {"default_obsidian.png"},
251 sounds = default.node_sound_stone_defaults(),
252 groups = {cracky = 1, level = 2},
255 minetest.register_node("default:obsidianbrick", {
256 description = "Obsidian Brick",
257 tiles = {"default_obsidian_brick.png"},
258 is_ground_content = false,
259 sounds = default.node_sound_stone_defaults(),
260 groups = {cracky = 1, level = 2},
267 minetest.register_node("default:dirt", {
268 description = "Dirt",
269 tiles = {"default_dirt.png"},
270 groups = {crumbly = 3, soil = 1},
271 sounds = default.node_sound_dirt_defaults(),
274 minetest.register_node("default:dirt_with_grass", {
275 description = "Dirt with Grass",
276 tiles = {"default_grass.png", "default_dirt.png",
277 {name = "default_dirt.png^default_grass_side.png",
278 tileable_vertical = false}},
279 groups = {crumbly = 3, soil = 1},
280 drop = 'default:dirt',
281 sounds = default.node_sound_dirt_defaults({
282 footstep = {name = "default_grass_footstep", gain = 0.25},
286 minetest.register_node("default:dirt_with_grass_footsteps", {
287 description = "Dirt with Grass and Footsteps",
288 tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
289 {name = "default_dirt.png^default_grass_side.png",
290 tileable_vertical = false}},
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_dry_grass", {
299 description = "Dirt with Dry Grass",
300 tiles = {"default_dry_grass.png",
302 {name = "default_dirt.png^default_dry_grass_side.png",
303 tileable_vertical = false}},
304 groups = {crumbly = 3, soil = 1},
305 drop = 'default:dirt',
306 sounds = default.node_sound_dirt_defaults({
307 footstep = {name = "default_grass_footstep", gain = 0.4},
311 minetest.register_node("default:dirt_with_snow", {
312 description = "Dirt with Snow",
313 tiles = {"default_snow.png", "default_dirt.png",
314 {name = "default_dirt.png^default_snow_side.png",
315 tileable_vertical = false}},
316 groups = {crumbly = 3, soil = 1},
317 drop = 'default:dirt',
318 sounds = default.node_sound_dirt_defaults({
319 footstep = {name = "default_snow_footstep", gain = 0.25},
324 minetest.register_node("default:sand", {
325 description = "Sand",
326 tiles = {"default_sand.png"},
327 groups = {crumbly = 3, falling_node = 1, sand = 1},
328 sounds = default.node_sound_sand_defaults(),
331 minetest.register_node("default:desert_sand", {
332 description = "Desert Sand",
333 tiles = {"default_desert_sand.png"},
334 groups = {crumbly = 3, falling_node = 1, sand = 1},
335 sounds = default.node_sound_sand_defaults(),
339 minetest.register_node("default:gravel", {
340 description = "Gravel",
341 tiles = {"default_gravel.png"},
342 groups = {crumbly = 2, falling_node = 1},
343 sounds = default.node_sound_dirt_defaults({
344 footstep = {name = "default_gravel_footstep", gain = 0.5},
345 dug = {name = "default_gravel_footstep", gain = 1.0},
350 minetest.register_node("default:clay", {
351 description = "Clay",
352 tiles = {"default_clay.png"},
353 groups = {crumbly = 3},
354 drop = 'default:clay_lump 4',
355 sounds = default.node_sound_dirt_defaults(),
359 minetest.register_node("default:snow", {
360 description = "Snow",
361 tiles = {"default_snow.png"},
362 inventory_image = "default_snowball.png",
363 wield_image = "default_snowball.png",
366 drawtype = "nodebox",
370 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
373 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
374 sounds = default.node_sound_dirt_defaults({
375 footstep = {name = "default_snow_footstep", gain = 0.25},
376 dug = {name = "default_snow_footstep", gain = 0.75},
379 on_construct = function(pos)
381 if minetest.get_node(pos).name == "default:dirt_with_grass" then
382 minetest.set_node(pos, {name = "default:dirt_with_snow"})
387 minetest.register_node("default:snowblock", {
388 description = "Snow Block",
389 tiles = {"default_snow.png"},
390 groups = {crumbly = 3, puts_out_fire = 1},
391 sounds = default.node_sound_dirt_defaults({
392 footstep = {name = "default_snow_footstep", gain = 0.25},
393 dug = {name = "default_snow_footstep", gain = 0.75},
398 minetest.register_node("default:ice", {
400 tiles = {"default_ice.png"},
401 is_ground_content = false,
403 groups = {cracky = 3, puts_out_fire = 1},
404 sounds = default.node_sound_glass_defaults(),
411 minetest.register_node("default:tree", {
412 description = "Tree",
413 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
414 paramtype2 = "facedir",
415 is_ground_content = false,
416 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
417 sounds = default.node_sound_wood_defaults(),
419 on_place = minetest.rotate_node
422 minetest.register_node("default:wood", {
423 description = "Wooden Planks",
424 tiles = {"default_wood.png"},
425 is_ground_content = false,
426 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
427 sounds = default.node_sound_wood_defaults(),
430 minetest.register_node("default:sapling", {
431 description = "Sapling",
432 drawtype = "plantlike",
434 tiles = {"default_sapling.png"},
435 inventory_image = "default_sapling.png",
436 wield_image = "default_sapling.png",
438 sunlight_propagates = true,
442 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
444 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
445 attached_node = 1, sapling = 1},
446 sounds = default.node_sound_leaves_defaults(),
449 minetest.register_node("default:leaves", {
450 description = "Leaves",
451 drawtype = "allfaces_optional",
454 tiles = {"default_leaves.png"},
455 special_tiles = {"default_leaves_simple.png"},
457 is_ground_content = false,
458 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
463 -- player will get sapling with 1/20 chance
464 items = {'default:sapling'},
468 -- player will get leaves only if he get no saplings,
469 -- this is because max_items is 1
470 items = {'default:leaves'},
474 sounds = default.node_sound_leaves_defaults(),
476 after_place_node = default.after_place_leaves,
479 minetest.register_node("default:apple", {
480 description = "Apple",
481 drawtype = "plantlike",
483 tiles = {"default_apple.png"},
484 inventory_image = "default_apple.png",
486 sunlight_propagates = true,
488 is_ground_content = false,
491 fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
493 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
494 leafdecay = 3, leafdecay_drop = 1},
495 on_use = minetest.item_eat(2),
496 sounds = default.node_sound_leaves_defaults(),
498 after_place_node = function(pos, placer, itemstack)
499 if placer:is_player() then
500 minetest.set_node(pos, {name = "default:apple", param2 = 1})
506 minetest.register_node("default:jungletree", {
507 description = "Jungle Tree",
508 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
509 "default_jungletree.png"},
510 paramtype2 = "facedir",
511 is_ground_content = false,
512 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
513 sounds = default.node_sound_wood_defaults(),
515 on_place = minetest.rotate_node
518 minetest.register_node("default:junglewood", {
519 description = "Junglewood Planks",
520 tiles = {"default_junglewood.png"},
521 is_ground_content = false,
522 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
523 sounds = default.node_sound_wood_defaults(),
526 minetest.register_node("default:jungleleaves", {
527 description = "Jungle Leaves",
528 drawtype = "allfaces_optional",
531 tiles = {"default_jungleleaves.png"},
532 special_tiles = {"default_jungleleaves_simple.png"},
534 is_ground_content = false,
535 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
539 {items = {'default:junglesapling'}, rarity = 20},
540 {items = {'default:jungleleaves'}}
543 sounds = default.node_sound_leaves_defaults(),
545 after_place_node = default.after_place_leaves,
548 minetest.register_node("default:junglesapling", {
549 description = "Jungle Sapling",
550 drawtype = "plantlike",
552 tiles = {"default_junglesapling.png"},
553 inventory_image = "default_junglesapling.png",
554 wield_image = "default_junglesapling.png",
556 sunlight_propagates = true,
560 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
562 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
563 attached_node = 1, sapling = 1},
564 sounds = default.node_sound_leaves_defaults(),
568 minetest.register_node("default:pine_tree", {
569 description = "Pine Tree",
570 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
571 "default_pine_tree.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:pine_wood", {
581 description = "Pine Wood Planks",
582 tiles = {"default_pine_wood.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}
623 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
624 attached_node = 1, sapling = 1},
625 sounds = default.node_sound_leaves_defaults(),
629 minetest.register_node("default:acacia_tree", {
630 description = "Acacia Tree",
631 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
632 "default_acacia_tree.png"},
633 paramtype2 = "facedir",
634 is_ground_content = false,
635 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
636 sounds = default.node_sound_wood_defaults(),
638 on_place = minetest.rotate_node
641 minetest.register_node("default:acacia_wood", {
642 description = "Acacia Wood Planks",
643 tiles = {"default_acacia_wood.png"},
644 is_ground_content = false,
645 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
646 sounds = default.node_sound_wood_defaults(),
649 minetest.register_node("default:acacia_leaves", {
650 description = "Acacia Leaves",
651 drawtype = "allfaces_optional",
653 tiles = {"default_acacia_leaves.png"},
655 is_ground_content = false,
656 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
660 {items = {"default:acacia_sapling"}, rarity = 20},
661 {items = {"default:acacia_leaves"}}
664 sounds = default.node_sound_leaves_defaults(),
666 after_place_node = default.after_place_leaves,
669 minetest.register_node("default:acacia_sapling", {
670 description = "Acacia Tree Sapling",
671 drawtype = "plantlike",
673 tiles = {"default_acacia_sapling.png"},
674 inventory_image = "default_acacia_sapling.png",
675 wield_image = "default_acacia_sapling.png",
677 sunlight_propagates = true,
681 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
683 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
684 attached_node = 1, sapling = 1},
685 sounds = default.node_sound_leaves_defaults(),
692 minetest.register_node("default:stone_with_coal", {
693 description = "Coal Ore",
694 tiles = {"default_stone.png^default_mineral_coal.png"},
695 groups = {cracky = 3},
696 drop = 'default:coal_lump',
697 sounds = default.node_sound_stone_defaults(),
700 minetest.register_node("default:coalblock", {
701 description = "Coal Block",
702 tiles = {"default_coal_block.png"},
703 is_ground_content = false,
704 groups = {cracky = 3},
705 sounds = default.node_sound_stone_defaults(),
709 minetest.register_node("default:stone_with_iron", {
710 description = "Iron Ore",
711 tiles = {"default_stone.png^default_mineral_iron.png"},
712 groups = {cracky = 2},
713 drop = 'default:iron_lump',
714 sounds = default.node_sound_stone_defaults(),
717 minetest.register_node("default:steelblock", {
718 description = "Steel Block",
719 tiles = {"default_steel_block.png"},
720 is_ground_content = false,
721 groups = {cracky = 1, level = 2},
722 sounds = default.node_sound_stone_defaults(),
726 minetest.register_node("default:stone_with_copper", {
727 description = "Copper Ore",
728 tiles = {"default_stone.png^default_mineral_copper.png"},
729 groups = {cracky = 2},
730 drop = 'default:copper_lump',
731 sounds = default.node_sound_stone_defaults(),
734 minetest.register_node("default:copperblock", {
735 description = "Copper Block",
736 tiles = {"default_copper_block.png"},
737 is_ground_content = false,
738 groups = {cracky = 1, level = 2},
739 sounds = default.node_sound_stone_defaults(),
742 minetest.register_node("default:bronzeblock", {
743 description = "Bronze Block",
744 tiles = {"default_bronze_block.png"},
745 is_ground_content = false,
746 groups = {cracky = 1, level = 2},
747 sounds = default.node_sound_stone_defaults(),
751 minetest.register_node("default:stone_with_mese", {
752 description = "Mese Ore",
753 tiles = {"default_stone.png^default_mineral_mese.png"},
755 groups = {cracky = 1},
756 drop = "default:mese_crystal",
757 sounds = default.node_sound_stone_defaults(),
761 minetest.register_node("default:mese", {
762 description = "Mese Block",
763 tiles = {"default_mese_block.png"},
765 groups = {cracky = 1, level = 2},
766 sounds = default.node_sound_stone_defaults(),
771 minetest.register_node("default:stone_with_gold", {
772 description = "Gold Ore",
773 tiles = {"default_stone.png^default_mineral_gold.png"},
774 groups = {cracky = 2},
775 drop = "default:gold_lump",
776 sounds = default.node_sound_stone_defaults(),
779 minetest.register_node("default:goldblock", {
780 description = "Gold Block",
781 tiles = {"default_gold_block.png"},
782 is_ground_content = false,
783 groups = {cracky = 1},
784 sounds = default.node_sound_stone_defaults(),
788 minetest.register_node("default:stone_with_diamond", {
789 description = "Diamond Ore",
790 tiles = {"default_stone.png^default_mineral_diamond.png"},
791 groups = {cracky = 1},
792 drop = "default:diamond",
793 sounds = default.node_sound_stone_defaults(),
796 minetest.register_node("default:diamondblock", {
797 description = "Diamond Block",
798 tiles = {"default_diamond_block.png"},
799 is_ground_content = false,
800 groups = {cracky = 1, level = 3},
801 sounds = default.node_sound_stone_defaults(),
805 -- Plantlife (non-cubic)
808 minetest.register_node("default:cactus", {
809 description = "Cactus",
810 tiles = {"default_cactus_top.png", "default_cactus_top.png",
811 "default_cactus_side.png"},
812 paramtype2 = "facedir",
813 groups = {snappy = 1, choppy = 3, flammable = 2},
814 sounds = default.node_sound_wood_defaults(),
815 on_place = minetest.rotate_node,
817 after_dig_node = function(pos, node, metadata, digger)
818 default.dig_up(pos, node, digger)
822 minetest.register_node("default:papyrus", {
823 description = "Papyrus",
824 drawtype = "plantlike",
825 tiles = {"default_papyrus.png"},
826 inventory_image = "default_papyrus.png",
827 wield_image = "default_papyrus.png",
829 sunlight_propagates = true,
833 fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
835 groups = {snappy = 3, flammable = 2},
836 sounds = default.node_sound_leaves_defaults(),
838 after_dig_node = function(pos, node, metadata, digger)
839 default.dig_up(pos, node, digger)
843 minetest.register_node("default:dry_shrub", {
844 description = "Dry Shrub",
845 drawtype = "plantlike",
848 tiles = {"default_dry_shrub.png"},
849 inventory_image = "default_dry_shrub.png",
850 wield_image = "default_dry_shrub.png",
852 sunlight_propagates = true,
855 groups = {snappy = 3, flammable = 3, attached_node = 1},
856 sounds = default.node_sound_leaves_defaults(),
859 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
863 minetest.register_node("default:junglegrass", {
864 description = "Jungle Grass",
865 drawtype = "plantlike",
868 tiles = {"default_junglegrass.png"},
869 inventory_image = "default_junglegrass.png",
870 wield_image = "default_junglegrass.png",
872 sunlight_propagates = true,
875 groups = {snappy = 3, flammable = 2, flora = 1, attached_node = 1},
876 sounds = default.node_sound_leaves_defaults(),
879 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
884 minetest.register_node("default:grass_1", {
885 description = "Grass",
886 drawtype = "plantlike",
888 tiles = {"default_grass_1.png"},
889 -- Use texture of a taller grass stage in inventory
890 inventory_image = "default_grass_3.png",
891 wield_image = "default_grass_3.png",
893 sunlight_propagates = true,
896 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1},
897 sounds = default.node_sound_leaves_defaults(),
900 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
903 on_place = function(itemstack, placer, pointed_thing)
904 -- place a random grass node
905 local stack = ItemStack("default:grass_" .. math.random(1,5))
906 local ret = minetest.item_place(stack, placer, pointed_thing)
907 return ItemStack("default:grass_1 " ..
908 itemstack:get_count() - (1 - ret:get_count()))
913 minetest.register_node("default:grass_" .. i, {
914 description = "Grass",
915 drawtype = "plantlike",
917 tiles = {"default_grass_" .. i .. ".png"},
918 inventory_image = "default_grass_" .. i .. ".png",
919 wield_image = "default_grass_" .. i .. ".png",
921 sunlight_propagates = true,
924 drop = "default:grass_1",
925 groups = {snappy = 3, flammable = 3, flora = 1,
926 attached_node = 1, not_in_creative_inventory = 1},
927 sounds = default.node_sound_leaves_defaults(),
930 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
936 minetest.register_node("default:dry_grass_1", {
937 description = "Dry Grass",
938 drawtype = "plantlike",
940 tiles = {"default_dry_grass_1.png"},
941 inventory_image = "default_dry_grass_3.png",
942 wield_image = "default_dry_grass_3.png",
944 sunlight_propagates = true,
947 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1},
948 sounds = default.node_sound_leaves_defaults(),
951 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
954 on_place = function(itemstack, placer, pointed_thing)
955 -- place a random dry grass node
956 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
957 local ret = minetest.item_place(stack, placer, pointed_thing)
958 return ItemStack("default:dry_grass_1 " ..
959 itemstack:get_count() - (1 - ret:get_count()))
964 minetest.register_node("default:dry_grass_" .. i, {
965 description = "Dry Grass",
966 drawtype = "plantlike",
968 tiles = {"default_dry_grass_" .. i .. ".png"},
969 inventory_image = "default_dry_grass_" .. i .. ".png",
970 wield_image = "default_dry_grass_" .. i .. ".png",
972 sunlight_propagates = true,
975 groups = {snappy = 3, flammable = 3, flora = 1,
976 attached_node = 1, not_in_creative_inventory=1},
977 drop = "default:dry_grass_1",
978 sounds = default.node_sound_leaves_defaults(),
981 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
990 minetest.register_node("default:water_source", {
991 description = "Water Source",
992 inventory_image = minetest.inventorycube("default_water.png"),
996 name = "default_water_source_animated.png",
998 type = "vertical_frames",
1006 -- New-style water source material (mostly unused)
1008 name = "default_water_source_animated.png",
1010 type = "vertical_frames",
1015 backface_culling = false,
1019 paramtype = "light",
1023 buildable_to = true,
1024 is_ground_content = false,
1027 liquidtype = "source",
1028 liquid_alternative_flowing = "default:water_flowing",
1029 liquid_alternative_source = "default:water_source",
1030 liquid_viscosity = 1,
1031 post_effect_color = {a = 120, r = 30, g = 60, b = 90},
1032 groups = {water = 3, liquid = 3, puts_out_fire = 1},
1035 minetest.register_node("default:water_flowing", {
1036 description = "Flowing Water",
1037 inventory_image = minetest.inventorycube("default_water.png"),
1038 drawtype = "flowingliquid",
1039 tiles = {"default_water.png"},
1042 name = "default_water_flowing_animated.png",
1043 backface_culling = false,
1045 type = "vertical_frames",
1052 name = "default_water_flowing_animated.png",
1053 backface_culling = true,
1055 type = "vertical_frames",
1063 paramtype = "light",
1064 paramtype2 = "flowingliquid",
1068 buildable_to = true,
1069 is_ground_content = false,
1072 liquidtype = "flowing",
1073 liquid_alternative_flowing = "default:water_flowing",
1074 liquid_alternative_source = "default:water_source",
1075 liquid_viscosity = 1,
1076 post_effect_color = {a = 120, r = 30, g = 60, b = 90},
1077 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1078 not_in_creative_inventory = 1},
1082 minetest.register_node("default:river_water_source", {
1083 description = "River Water Source",
1084 inventory_image = minetest.inventorycube("default_river_water.png"),
1085 drawtype = "liquid",
1088 name = "default_river_water_source_animated.png",
1090 type = "vertical_frames",
1099 name = "default_river_water_source_animated.png",
1101 type = "vertical_frames",
1106 backface_culling = false,
1110 paramtype = "light",
1114 buildable_to = true,
1115 is_ground_content = false,
1118 liquidtype = "source",
1119 liquid_alternative_flowing = "default:river_water_flowing",
1120 liquid_alternative_source = "default:river_water_source",
1121 liquid_viscosity = 1,
1122 liquid_renewable = false,
1124 post_effect_color = {a = 120, r = 30, g = 76, b = 90},
1125 groups = {water = 3, liquid = 3, puts_out_fire = 1},
1128 minetest.register_node("default:river_water_flowing", {
1129 description = "Flowing River Water",
1130 inventory_image = minetest.inventorycube("default_river_water.png"),
1131 drawtype = "flowingliquid",
1132 tiles = {"default_river_water.png"},
1135 name = "default_river_water_flowing_animated.png",
1136 backface_culling = false,
1138 type = "vertical_frames",
1145 name = "default_river_water_flowing_animated.png",
1146 backface_culling = true,
1148 type = "vertical_frames",
1156 paramtype = "light",
1157 paramtype2 = "flowingliquid",
1161 buildable_to = true,
1162 is_ground_content = false,
1165 liquidtype = "flowing",
1166 liquid_alternative_flowing = "default:river_water_flowing",
1167 liquid_alternative_source = "default:river_water_source",
1168 liquid_viscosity = 1,
1169 liquid_renewable = false,
1171 post_effect_color = {a = 120, r = 30, g = 76, b = 90},
1172 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1173 not_in_creative_inventory = 1},
1177 minetest.register_node("default:lava_source", {
1178 description = "Lava Source",
1179 inventory_image = minetest.inventorycube("default_lava.png"),
1180 drawtype = "liquid",
1183 name = "default_lava_source_animated.png",
1185 type = "vertical_frames",
1193 -- New-style lava source material (mostly unused)
1195 name = "default_lava_source_animated.png",
1197 type = "vertical_frames",
1202 backface_culling = false,
1205 paramtype = "light",
1206 light_source = default.LIGHT_MAX - 1,
1210 buildable_to = true,
1211 is_ground_content = false,
1214 liquidtype = "source",
1215 liquid_alternative_flowing = "default:lava_flowing",
1216 liquid_alternative_source = "default:lava_source",
1217 liquid_viscosity = 7,
1218 liquid_renewable = false,
1219 damage_per_second = 4 * 2,
1220 post_effect_color = {a = 192, r = 255, g = 64, b = 0},
1221 groups = {lava = 3, liquid = 2, hot = 3, igniter = 1},
1224 minetest.register_node("default:lava_flowing", {
1225 description = "Flowing Lava",
1226 inventory_image = minetest.inventorycube("default_lava.png"),
1227 drawtype = "flowingliquid",
1228 tiles = {"default_lava.png"},
1231 name = "default_lava_flowing_animated.png",
1232 backface_culling = false,
1234 type = "vertical_frames",
1241 name = "default_lava_flowing_animated.png",
1242 backface_culling = true,
1244 type = "vertical_frames",
1251 paramtype = "light",
1252 paramtype2 = "flowingliquid",
1253 light_source = default.LIGHT_MAX - 1,
1257 buildable_to = true,
1258 is_ground_content = false,
1261 liquidtype = "flowing",
1262 liquid_alternative_flowing = "default:lava_flowing",
1263 liquid_alternative_source = "default:lava_source",
1264 liquid_viscosity = 7,
1265 liquid_renewable = false,
1266 damage_per_second = 4 * 2,
1267 post_effect_color = {a = 192, r = 255, g = 64, b = 0},
1268 groups = {lava = 3, liquid = 2, hot = 3, igniter = 1,
1269 not_in_creative_inventory = 1},
1273 -- Tools / "Advanced" crafting / Non-"natural"
1276 minetest.register_node("default:torch", {
1277 description = "Torch",
1278 drawtype = "torchlike",
1281 name = "default_torch_on_floor_animated.png",
1283 type = "vertical_frames",
1290 name="default_torch_on_ceiling_animated.png",
1292 type = "vertical_frames",
1299 name="default_torch_animated.png",
1301 type = "vertical_frames",
1308 inventory_image = "default_torch_on_floor.png",
1309 wield_image = "default_torch_on_floor.png",
1310 paramtype = "light",
1311 paramtype2 = "wallmounted",
1312 sunlight_propagates = true,
1313 is_ground_content = false,
1315 light_source = default.LIGHT_MAX - 1,
1317 type = "wallmounted",
1318 wall_top = {-0.1, 0.5 - 0.6, -0.1, 0.1, 0.5, 0.1},
1319 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5 + 0.6, 0.1},
1320 wall_side = {-0.5, -0.3, -0.1, -0.5 + 0.3, 0.3, 0.1},
1322 groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1},
1323 legacy_wallmounted = true,
1324 sounds = default.node_sound_defaults(),
1328 local chest_formspec =
1331 default.gui_bg_img ..
1332 default.gui_slots ..
1333 "list[current_name;main;0,0.3;8,4;]" ..
1334 "list[current_player;main;0,4.85;8,1;]" ..
1335 "list[current_player;main;0,6.08;8,3;8]" ..
1336 "listring[current_name;main]" ..
1337 "listring[current_player;main]" ..
1338 default.get_hotbar_bg(0,4.85)
1340 local function get_locked_chest_formspec(pos)
1341 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1345 default.gui_bg_img ..
1346 default.gui_slots ..
1347 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1348 "list[current_player;main;0,4.85;8,1;]" ..
1349 "list[current_player;main;0,6.08;8,3;8]" ..
1350 "listring[nodemeta:" .. spos .. ";main]" ..
1351 "listring[current_player;main]" ..
1352 default.get_hotbar_bg(0,4.85)
1356 local function has_locked_chest_privilege(meta, player)
1357 if player:get_player_name() ~= meta:get_string("owner") then
1363 minetest.register_node("default:chest", {
1364 description = "Chest",
1365 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1366 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1367 paramtype2 = "facedir",
1368 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1369 legacy_facedir_simple = true,
1370 is_ground_content = false,
1371 sounds = default.node_sound_wood_defaults(),
1373 on_construct = function(pos)
1374 local meta = minetest.get_meta(pos)
1375 meta:set_string("formspec", chest_formspec)
1376 meta:set_string("infotext", "Chest")
1377 local inv = meta:get_inventory()
1378 inv:set_size("main", 8*4)
1380 can_dig = function(pos,player)
1381 local meta = minetest.get_meta(pos);
1382 local inv = meta:get_inventory()
1383 return inv:is_empty("main")
1385 on_metadata_inventory_move = function(pos, from_list, from_index,
1386 to_list, to_index, count, player)
1387 minetest.log("action", player:get_player_name() ..
1388 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1390 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1391 minetest.log("action", player:get_player_name() ..
1392 " moves stuff to chest at " .. minetest.pos_to_string(pos))
1394 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1395 minetest.log("action", player:get_player_name() ..
1396 " takes stuff from chest at " .. minetest.pos_to_string(pos))
1400 minetest.register_node("default:chest_locked", {
1401 description = "Locked Chest",
1402 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1403 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1404 paramtype2 = "facedir",
1405 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1406 legacy_facedir_simple = true,
1407 is_ground_content = false,
1408 sounds = default.node_sound_wood_defaults(),
1410 after_place_node = function(pos, placer)
1411 local meta = minetest.get_meta(pos)
1412 meta:set_string("owner", placer:get_player_name() or "")
1413 meta:set_string("infotext", "Locked Chest (owned by " ..
1414 meta:get_string("owner") .. ")")
1416 on_construct = function(pos)
1417 local meta = minetest.get_meta(pos)
1418 meta:set_string("infotext", "Locked Chest")
1419 meta:set_string("owner", "")
1420 local inv = meta:get_inventory()
1421 inv:set_size("main", 8 * 4)
1423 can_dig = function(pos,player)
1424 local meta = minetest.get_meta(pos);
1425 local inv = meta:get_inventory()
1426 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1428 allow_metadata_inventory_move = function(pos, from_list, from_index,
1429 to_list, to_index, count, player)
1430 local meta = minetest.get_meta(pos)
1431 if not has_locked_chest_privilege(meta, player) then
1436 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1437 local meta = minetest.get_meta(pos)
1438 if not has_locked_chest_privilege(meta, player) then
1441 return stack:get_count()
1443 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1444 local meta = minetest.get_meta(pos)
1445 if not has_locked_chest_privilege(meta, player) then
1448 return stack:get_count()
1450 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1451 minetest.log("action", player:get_player_name() ..
1452 " moves stuff to locked chest at " .. minetest.pos_to_string(pos))
1454 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1455 minetest.log("action", player:get_player_name() ..
1456 " takes stuff from locked chest at " .. minetest.pos_to_string(pos))
1458 on_rightclick = function(pos, node, clicker)
1459 local meta = minetest.get_meta(pos)
1460 if has_locked_chest_privilege(meta, clicker) then
1461 minetest.show_formspec(
1462 clicker:get_player_name(),
1463 "default:chest_locked",
1464 get_locked_chest_formspec(pos)
1468 on_blast = function() end,
1472 local bookshelf_formspec =
1475 default.gui_bg_img ..
1476 default.gui_slots ..
1477 "list[context;books;0,0.3;8,2;]" ..
1478 "list[current_player;main;0,2.85;8,1;]" ..
1479 "list[current_player;main;0,4.08;8,3;8]" ..
1480 "listring[context;books]" ..
1481 "listring[current_player;main]" ..
1482 default.get_hotbar_bg(0,2.85)
1484 minetest.register_node("default:bookshelf", {
1485 description = "Bookshelf",
1486 tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
1487 is_ground_content = false,
1488 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1489 sounds = default.node_sound_wood_defaults(),
1491 on_construct = function(pos)
1492 local meta = minetest.get_meta(pos)
1493 meta:set_string("formspec", bookshelf_formspec)
1494 local inv = meta:get_inventory()
1495 inv:set_size("books", 8 * 2)
1497 can_dig = function(pos,player)
1498 local meta = minetest.get_meta(pos);
1499 local inv = meta:get_inventory()
1500 return inv:is_empty("books")
1503 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1504 local meta = minetest.get_meta(pos)
1505 local inv = meta:get_inventory()
1506 local to_stack = inv:get_stack(listname, index)
1507 if listname == "books" then
1508 if minetest.get_item_group(stack:get_name(), "book") ~= 0
1509 and to_stack:is_empty() then
1517 allow_metadata_inventory_move = function(pos, from_list, from_index,
1518 to_list, to_index, count, player)
1519 local meta = minetest.get_meta(pos)
1520 local inv = meta:get_inventory()
1521 local stack = inv:get_stack(from_list, from_index)
1522 local to_stack = inv:get_stack(to_list, to_index)
1523 if to_list == "books" then
1524 if minetest.get_item_group(stack:get_name(), "book") ~= 0
1525 and to_stack:is_empty() then
1533 on_metadata_inventory_move = function(pos, from_list, from_index,
1534 to_list, to_index, count, player)
1535 minetest.log("action", player:get_player_name() ..
1536 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1538 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1539 minetest.log("action", player:get_player_name() ..
1540 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1542 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1543 minetest.log("action", player:get_player_name() ..
1544 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1549 minetest.register_node("default:sign_wall", {
1550 description = "Sign",
1551 drawtype = "nodebox",
1552 tiles = {"default_sign.png"},
1553 inventory_image = "default_sign_wall.png",
1554 wield_image = "default_sign_wall.png",
1555 paramtype = "light",
1556 paramtype2 = "wallmounted",
1557 sunlight_propagates = true,
1558 is_ground_content = false,
1561 type = "wallmounted",
1562 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1563 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1564 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1566 groups = {choppy = 2, dig_immediate = 2, attached_node = 1},
1567 legacy_wallmounted = true,
1568 sounds = default.node_sound_defaults(),
1570 on_construct = function(pos)
1571 --local n = minetest.get_node(pos)
1572 local meta = minetest.get_meta(pos)
1573 meta:set_string("formspec", "field[text;;${text}]")
1574 meta:set_string("infotext", "\"\"")
1576 on_receive_fields = function(pos, formname, fields, sender)
1577 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1578 if minetest.is_protected(pos, sender:get_player_name()) then
1579 minetest.record_protection_violation(pos, sender:get_player_name())
1582 local meta = minetest.get_meta(pos)
1583 if not fields.text then return end
1584 minetest.log("action", (sender:get_player_name() or "") .. " wrote \"" ..
1585 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1586 meta:set_string("text", fields.text)
1587 meta:set_string("infotext", '"' .. fields.text .. '"')
1592 minetest.register_node("default:ladder", {
1593 description = "Ladder",
1594 drawtype = "signlike",
1595 tiles = {"default_ladder.png"},
1596 inventory_image = "default_ladder.png",
1597 wield_image = "default_ladder.png",
1598 paramtype = "light",
1599 paramtype2 = "wallmounted",
1600 sunlight_propagates = true,
1603 is_ground_content = false,
1605 type = "wallmounted",
1606 --wall_top = = <default>
1607 --wall_bottom = = <default>
1608 --wall_side = = <default>
1610 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1611 legacy_wallmounted = true,
1612 sounds = default.node_sound_wood_defaults(),
1616 local fence_texture =
1617 "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126"
1618 minetest.register_node("default:fence_wood", {
1619 description = "Wooden Fence",
1620 drawtype = "fencelike",
1621 tiles = {"default_wood.png"},
1622 inventory_image = fence_texture,
1623 wield_image = fence_texture,
1624 paramtype = "light",
1625 sunlight_propagates = true,
1626 is_ground_content = false,
1629 fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
1631 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1632 sounds = default.node_sound_wood_defaults(),
1636 minetest.register_node("default:glass", {
1637 description = "Glass",
1638 drawtype = "glasslike_framed_optional",
1639 tiles = {"default_glass.png", "default_glass_detail.png"},
1640 inventory_image = minetest.inventorycube("default_glass.png"),
1641 paramtype = "light",
1642 sunlight_propagates = true,
1643 is_ground_content = false,
1644 groups = {cracky = 3, oddly_breakable_by_hand = 3},
1645 sounds = default.node_sound_glass_defaults(),
1648 minetest.register_node("default:obsidian_glass", {
1649 description = "Obsidian Glass",
1650 drawtype = "glasslike",
1651 tiles = {"default_obsidian_glass.png"},
1652 paramtype = "light",
1653 is_ground_content = false,
1654 sunlight_propagates = true,
1655 sounds = default.node_sound_glass_defaults(),
1656 groups = {cracky = 3, oddly_breakable_by_hand = 3},
1660 minetest.register_node("default:rail", {
1661 description = "Rail",
1662 drawtype = "raillike",
1663 tiles = {"default_rail.png", "default_rail_curved.png",
1664 "default_rail_t_junction.png", "default_rail_crossing.png"},
1665 inventory_image = "default_rail.png",
1666 wield_image = "default_rail.png",
1667 paramtype = "light",
1668 sunlight_propagates = true,
1670 is_ground_content = false,
1673 -- but how to specify the dimensions for curved and sideways rails?
1674 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
1676 groups = {bendy = 2, dig_immediate = 2, attached_node = 1,
1677 connect_to_raillike = minetest.raillike_group("rail")},
1681 minetest.register_node("default:brick", {
1682 description = "Brick Block",
1683 tiles = {"default_brick.png"},
1684 is_ground_content = false,
1685 groups = {cracky = 3},
1686 sounds = default.node_sound_stone_defaults(),
1690 minetest.register_node("default:meselamp", {
1691 description = "Mese Lamp",
1692 drawtype = "glasslike",
1693 tiles = {"default_meselamp.png"},
1694 paramtype = "light",
1695 sunlight_propagates = true,
1696 is_ground_content = false,
1697 groups = {cracky = 3, oddly_breakable_by_hand = 3},
1698 sounds = default.node_sound_glass_defaults(),
1699 light_source = default.LIGHT_MAX,
1706 minetest.register_node("default:cloud", {
1707 description = "Cloud",
1708 tiles = {"default_cloud.png"},
1709 is_ground_content = false,
1710 sounds = default.node_sound_defaults(),
1711 groups = {not_in_creative_inventory = 1},
1714 minetest.register_node("default:nyancat", {
1715 description = "Nyan Cat",
1716 tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png",
1717 "default_nc_side.png", "default_nc_back.png", "default_nc_front.png"},
1718 paramtype2 = "facedir",
1719 groups = {cracky = 2},
1720 is_ground_content = false,
1721 legacy_facedir_simple = true,
1722 sounds = default.node_sound_defaults(),
1725 minetest.register_node("default:nyancat_rainbow", {
1726 description = "Nyan Cat Rainbow",
1728 "default_nc_rb.png^[transformR90", "default_nc_rb.png^[transformR90",
1729 "default_nc_rb.png", "default_nc_rb.png"
1731 paramtype2 = "facedir",
1732 groups = {cracky = 2},
1733 is_ground_content = false,
1734 sounds = default.node_sound_defaults(),