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)
27 default:desert_stonebrick
28 default:desert_stone_block
31 default:sandstonebrick
32 default:sandstone_block
36 default:obsidian_block
40 (1. Material 2. Modified forms)
43 default:dirt_with_grass
44 default:dirt_with_grass_footsteps
45 default:dirt_with_dry_grass
46 default:dirt_with_snow
63 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
84 default:acacia_sapling
93 (1. In stone 2. Blocks)
95 default:stone_with_coal
98 default:stone_with_iron
101 default:stone_with_copper
105 default:stone_with_gold
108 default:stone_with_mese
111 default:stone_with_diamond
136 default:acacia_bush_stem
137 default:acacia_bush_leaves
144 default:coral_skeleton
148 (1. Source 2. Flowing)
151 default:water_flowing
153 default:river_water_source
154 default:river_water_flowing
159 Tools / "Advanced" crafting / Non-"natural"
160 -------------------------------------------
169 default:sign_wall_wood
170 default:sign_wall_steel
176 default:fence_acacia_wood
177 default:fence_junglewood
178 default:fence_pine_wood
179 default:fence_aspen_wood
182 default:obsidian_glass
201 minetest.register_node("default:stone", {
202 description = "Stone",
203 tiles = {"default_stone.png"},
204 groups = {cracky = 3, stone = 1},
205 drop = 'default:cobble',
206 legacy_mineral = true,
207 sounds = default.node_sound_stone_defaults(),
210 minetest.register_node("default:cobble", {
211 description = "Cobblestone",
212 tiles = {"default_cobble.png"},
213 is_ground_content = false,
214 groups = {cracky = 3, stone = 2},
215 sounds = default.node_sound_stone_defaults(),
218 minetest.register_node("default:stonebrick", {
219 description = "Stone Brick",
220 paramtype2 = "facedir",
222 tiles = {"default_stone_brick.png"},
223 is_ground_content = false,
224 groups = {cracky = 2, stone = 1},
225 sounds = default.node_sound_stone_defaults(),
228 minetest.register_node("default:stone_block", {
229 description = "Stone Block",
230 tiles = {"default_stone_block.png"},
231 is_ground_content = false,
232 groups = {cracky = 2, stone = 1},
233 sounds = default.node_sound_stone_defaults(),
236 minetest.register_node("default:mossycobble", {
237 description = "Mossy Cobblestone",
238 tiles = {"default_mossycobble.png"},
239 is_ground_content = false,
240 groups = {cracky = 3, stone = 1},
241 sounds = default.node_sound_stone_defaults(),
245 minetest.register_node("default:desert_stone", {
246 description = "Desert Stone",
247 tiles = {"default_desert_stone.png"},
248 groups = {cracky = 3, stone = 1},
249 drop = 'default:desert_cobble',
250 legacy_mineral = true,
251 sounds = default.node_sound_stone_defaults(),
254 minetest.register_node("default:desert_cobble", {
255 description = "Desert Cobblestone",
256 tiles = {"default_desert_cobble.png"},
257 is_ground_content = false,
258 groups = {cracky = 3, stone = 2},
259 sounds = default.node_sound_stone_defaults(),
262 minetest.register_node("default:desert_stonebrick", {
263 description = "Desert Stone Brick",
264 paramtype2 = "facedir",
266 tiles = {"default_desert_stone_brick.png"},
267 is_ground_content = false,
268 groups = {cracky = 2, stone = 1},
269 sounds = default.node_sound_stone_defaults(),
272 minetest.register_node("default:desert_stone_block", {
273 description = "Desert Stone Block",
274 tiles = {"default_desert_stone_block.png"},
275 is_ground_content = false,
276 groups = {cracky = 2, stone = 1},
277 sounds = default.node_sound_stone_defaults(),
281 minetest.register_node("default:sandstone", {
282 description = "Sandstone",
283 tiles = {"default_sandstone.png"},
284 groups = {crumbly = 1, cracky = 3},
285 sounds = default.node_sound_stone_defaults(),
288 minetest.register_node("default:sandstonebrick", {
289 description = "Sandstone Brick",
290 paramtype2 = "facedir",
292 tiles = {"default_sandstone_brick.png"},
293 is_ground_content = false,
294 groups = {cracky = 2},
295 sounds = default.node_sound_stone_defaults(),
298 minetest.register_node("default:sandstone_block", {
299 description = "Sandstone Block",
300 tiles = {"default_sandstone_block.png"},
301 is_ground_content = false,
302 groups = {cracky = 2},
303 sounds = default.node_sound_stone_defaults(),
307 minetest.register_node("default:obsidian", {
308 description = "Obsidian",
309 tiles = {"default_obsidian.png"},
310 sounds = default.node_sound_stone_defaults(),
311 groups = {cracky = 1, level = 2},
314 minetest.register_node("default:obsidianbrick", {
315 description = "Obsidian Brick",
316 paramtype2 = "facedir",
318 tiles = {"default_obsidian_brick.png"},
319 is_ground_content = false,
320 sounds = default.node_sound_stone_defaults(),
321 groups = {cracky = 1, level = 2},
324 minetest.register_node("default:obsidian_block", {
325 description = "Obsidian Block",
326 tiles = {"default_obsidian_block.png"},
327 is_ground_content = false,
328 sounds = default.node_sound_stone_defaults(),
329 groups = {cracky = 1, level = 2},
336 minetest.register_node("default:dirt", {
337 description = "Dirt",
338 tiles = {"default_dirt.png"},
339 groups = {crumbly = 3, soil = 1},
340 sounds = default.node_sound_dirt_defaults(),
343 minetest.register_node("default:dirt_with_grass", {
344 description = "Dirt with Grass",
345 tiles = {"default_grass.png", "default_dirt.png",
346 {name = "default_dirt.png^default_grass_side.png",
347 tileable_vertical = false}},
348 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
349 drop = 'default:dirt',
350 sounds = default.node_sound_dirt_defaults({
351 footstep = {name = "default_grass_footstep", gain = 0.25},
355 minetest.register_node("default:dirt_with_grass_footsteps", {
356 description = "Dirt with Grass and Footsteps",
357 tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
358 {name = "default_dirt.png^default_grass_side.png",
359 tileable_vertical = false}},
360 groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
361 drop = 'default:dirt',
362 sounds = default.node_sound_dirt_defaults({
363 footstep = {name = "default_grass_footstep", gain = 0.25},
367 minetest.register_node("default:dirt_with_dry_grass", {
368 description = "Dirt with Dry Grass",
369 tiles = {"default_dry_grass.png",
371 {name = "default_dirt.png^default_dry_grass_side.png",
372 tileable_vertical = false}},
373 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
374 drop = 'default:dirt',
375 sounds = default.node_sound_dirt_defaults({
376 footstep = {name = "default_grass_footstep", gain = 0.4},
380 minetest.register_node("default:dirt_with_snow", {
381 description = "Dirt with Snow",
382 tiles = {"default_snow.png", "default_dirt.png",
383 {name = "default_dirt.png^default_snow_side.png",
384 tileable_vertical = false}},
385 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
386 drop = 'default:dirt',
387 sounds = default.node_sound_dirt_defaults({
388 footstep = {name = "default_snow_footstep", gain = 0.15},
392 minetest.register_node("default:sand", {
393 description = "Sand",
394 tiles = {"default_sand.png"},
395 groups = {crumbly = 3, falling_node = 1, sand = 1},
396 sounds = default.node_sound_sand_defaults(),
399 minetest.register_node("default:desert_sand", {
400 description = "Desert Sand",
401 tiles = {"default_desert_sand.png"},
402 groups = {crumbly = 3, falling_node = 1, sand = 1},
403 sounds = default.node_sound_sand_defaults(),
406 minetest.register_node("default:silver_sand", {
407 description = "Silver Sand",
408 tiles = {"default_silver_sand.png"},
409 groups = {crumbly = 3, falling_node = 1, sand = 1},
410 sounds = default.node_sound_sand_defaults(),
414 minetest.register_node("default:gravel", {
415 description = "Gravel",
416 tiles = {"default_gravel.png"},
417 groups = {crumbly = 2, falling_node = 1},
418 sounds = default.node_sound_gravel_defaults(),
422 {items = {'default:flint'}, rarity = 16},
423 {items = {'default:gravel'}}
428 minetest.register_node("default:clay", {
429 description = "Clay",
430 tiles = {"default_clay.png"},
431 groups = {crumbly = 3},
432 drop = 'default:clay_lump 4',
433 sounds = default.node_sound_dirt_defaults(),
437 minetest.register_node("default:snow", {
438 description = "Snow",
439 tiles = {"default_snow.png"},
440 inventory_image = "default_snowball.png",
441 wield_image = "default_snowball.png",
446 drawtype = "nodebox",
450 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
453 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
454 sounds = default.node_sound_dirt_defaults({
455 footstep = {name = "default_snow_footstep", gain = 0.15},
456 dug = {name = "default_snow_footstep", gain = 0.2},
457 dig = {name = "default_snow_footstep", gain = 0.2}
460 on_construct = function(pos)
462 if minetest.get_node(pos).name == "default:dirt_with_grass" then
463 minetest.set_node(pos, {name = "default:dirt_with_snow"})
468 minetest.register_node("default:snowblock", {
469 description = "Snow Block",
470 tiles = {"default_snow.png"},
471 groups = {crumbly = 3, puts_out_fire = 1},
472 sounds = default.node_sound_dirt_defaults({
473 footstep = {name = "default_snow_footstep", gain = 0.15},
474 dug = {name = "default_snow_footstep", gain = 0.2},
475 dig = {name = "default_snow_footstep", gain = 0.2}
479 minetest.register_node("default:ice", {
481 tiles = {"default_ice.png"},
482 is_ground_content = false,
484 groups = {cracky = 3, puts_out_fire = 1},
485 sounds = default.node_sound_glass_defaults(),
492 minetest.register_node("default:tree", {
493 description = "Tree",
494 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
495 paramtype2 = "facedir",
496 is_ground_content = false,
497 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
498 sounds = default.node_sound_wood_defaults(),
500 on_place = minetest.rotate_node
503 minetest.register_node("default:wood", {
504 description = "Wooden Planks",
505 paramtype2 = "facedir",
507 tiles = {"default_wood.png"},
508 is_ground_content = false,
509 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
510 sounds = default.node_sound_wood_defaults(),
513 minetest.register_node("default:sapling", {
514 description = "Sapling",
515 drawtype = "plantlike",
517 tiles = {"default_sapling.png"},
518 inventory_image = "default_sapling.png",
519 wield_image = "default_sapling.png",
521 sunlight_propagates = true,
523 on_timer = default.grow_sapling,
526 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
528 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
529 attached_node = 1, sapling = 1},
530 sounds = default.node_sound_leaves_defaults(),
532 on_construct = function(pos)
533 minetest.get_node_timer(pos):start(math.random(2400,4800))
536 on_place = function(itemstack, placer, pointed_thing)
537 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
539 -- minp, maxp to be checked, relative to sapling pos
540 -- minp_relative.y = 1 because sapling pos has been checked
541 {x = -2, y = 1, z = -2},
542 {x = 2, y = 6, z = 2},
543 -- maximum interval of interior volume check
550 minetest.register_node("default:leaves", {
551 description = "Leaves",
552 drawtype = "allfaces_optional",
554 tiles = {"default_leaves.png"},
555 special_tiles = {"default_leaves_simple.png"},
557 is_ground_content = false,
558 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
563 -- player will get sapling with 1/20 chance
564 items = {'default:sapling'},
568 -- player will get leaves only if he get no saplings,
569 -- this is because max_items is 1
570 items = {'default:leaves'},
574 sounds = default.node_sound_leaves_defaults(),
576 after_place_node = default.after_place_leaves,
579 minetest.register_node("default:apple", {
580 description = "Apple",
581 drawtype = "plantlike",
583 tiles = {"default_apple.png"},
584 inventory_image = "default_apple.png",
586 sunlight_propagates = true,
588 is_ground_content = false,
591 fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
593 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
594 leafdecay = 3, leafdecay_drop = 1},
595 on_use = minetest.item_eat(2),
596 sounds = default.node_sound_leaves_defaults(),
598 after_place_node = function(pos, placer, itemstack)
599 if placer:is_player() then
600 minetest.set_node(pos, {name = "default:apple", param2 = 1})
606 minetest.register_node("default:jungletree", {
607 description = "Jungle Tree",
608 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
609 "default_jungletree.png"},
610 paramtype2 = "facedir",
611 is_ground_content = false,
612 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
613 sounds = default.node_sound_wood_defaults(),
615 on_place = minetest.rotate_node
618 minetest.register_node("default:junglewood", {
619 description = "Junglewood Planks",
620 paramtype2 = "facedir",
622 tiles = {"default_junglewood.png"},
623 is_ground_content = false,
624 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
625 sounds = default.node_sound_wood_defaults(),
628 minetest.register_node("default:jungleleaves", {
629 description = "Jungle Leaves",
630 drawtype = "allfaces_optional",
632 tiles = {"default_jungleleaves.png"},
633 special_tiles = {"default_jungleleaves_simple.png"},
635 is_ground_content = false,
636 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
640 {items = {'default:junglesapling'}, rarity = 20},
641 {items = {'default:jungleleaves'}}
644 sounds = default.node_sound_leaves_defaults(),
646 after_place_node = default.after_place_leaves,
649 minetest.register_node("default:junglesapling", {
650 description = "Jungle Sapling",
651 drawtype = "plantlike",
653 tiles = {"default_junglesapling.png"},
654 inventory_image = "default_junglesapling.png",
655 wield_image = "default_junglesapling.png",
657 sunlight_propagates = true,
659 on_timer = default.grow_sapling,
662 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
664 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
665 attached_node = 1, sapling = 1},
666 sounds = default.node_sound_leaves_defaults(),
668 on_construct = function(pos)
669 minetest.get_node_timer(pos):start(math.random(2400,4800))
672 on_place = function(itemstack, placer, pointed_thing)
673 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
674 "default:junglesapling",
675 -- minp, maxp to be checked, relative to sapling pos
676 -- minp_relative.y = 1 because sapling pos has been checked
677 {x = -2, y = 1, z = -2},
678 {x = 2, y = 15, z = 2},
679 -- maximum interval of interior volume check
687 minetest.register_node("default:pine_tree", {
688 description = "Pine Tree",
689 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
690 "default_pine_tree.png"},
691 paramtype2 = "facedir",
692 is_ground_content = false,
693 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
694 sounds = default.node_sound_wood_defaults(),
696 on_place = minetest.rotate_node
699 minetest.register_node("default:pine_wood", {
700 description = "Pine Wood Planks",
701 paramtype2 = "facedir",
703 tiles = {"default_pine_wood.png"},
704 is_ground_content = false,
705 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
706 sounds = default.node_sound_wood_defaults(),
709 minetest.register_node("default:pine_needles",{
710 description = "Pine Needles",
711 drawtype = "allfaces_optional",
712 tiles = {"default_pine_needles.png"},
715 is_ground_content = false,
716 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
720 {items = {"default:pine_sapling"}, rarity = 20},
721 {items = {"default:pine_needles"}}
724 sounds = default.node_sound_leaves_defaults(),
726 after_place_node = default.after_place_leaves,
729 minetest.register_node("default:pine_sapling", {
730 description = "Pine Sapling",
731 drawtype = "plantlike",
733 tiles = {"default_pine_sapling.png"},
734 inventory_image = "default_pine_sapling.png",
735 wield_image = "default_pine_sapling.png",
737 sunlight_propagates = true,
739 on_timer = default.grow_sapling,
742 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
744 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
745 attached_node = 1, sapling = 1},
746 sounds = default.node_sound_leaves_defaults(),
748 on_construct = function(pos)
749 minetest.get_node_timer(pos):start(math.random(2400,4800))
752 on_place = function(itemstack, placer, pointed_thing)
753 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
754 "default:pine_sapling",
755 -- minp, maxp to be checked, relative to sapling pos
756 -- minp_relative.y = 1 because sapling pos has been checked
757 {x = -2, y = 1, z = -2},
758 {x = 2, y = 12, z = 2},
759 -- maximum interval of interior volume check
767 minetest.register_node("default:acacia_tree", {
768 description = "Acacia Tree",
769 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
770 "default_acacia_tree.png"},
771 paramtype2 = "facedir",
772 is_ground_content = false,
773 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
774 sounds = default.node_sound_wood_defaults(),
776 on_place = minetest.rotate_node
779 minetest.register_node("default:acacia_wood", {
780 description = "Acacia Wood Planks",
781 paramtype2 = "facedir",
783 tiles = {"default_acacia_wood.png"},
784 is_ground_content = false,
785 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
786 sounds = default.node_sound_wood_defaults(),
789 minetest.register_node("default:acacia_leaves", {
790 description = "Acacia Leaves",
791 drawtype = "allfaces_optional",
792 tiles = {"default_acacia_leaves.png"},
795 is_ground_content = false,
796 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
800 {items = {"default:acacia_sapling"}, rarity = 20},
801 {items = {"default:acacia_leaves"}}
804 sounds = default.node_sound_leaves_defaults(),
806 after_place_node = default.after_place_leaves,
809 minetest.register_node("default:acacia_sapling", {
810 description = "Acacia Tree Sapling",
811 drawtype = "plantlike",
813 tiles = {"default_acacia_sapling.png"},
814 inventory_image = "default_acacia_sapling.png",
815 wield_image = "default_acacia_sapling.png",
817 sunlight_propagates = true,
819 on_timer = default.grow_sapling,
822 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
824 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
825 attached_node = 1, sapling = 1},
826 sounds = default.node_sound_leaves_defaults(),
828 on_construct = function(pos)
829 minetest.get_node_timer(pos):start(math.random(2400,4800))
832 on_place = function(itemstack, placer, pointed_thing)
833 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
834 "default:acacia_sapling",
835 -- minp, maxp to be checked, relative to sapling pos
836 -- minp_relative.y = 1 because sapling pos has been checked
837 {x = -4, y = 1, z = -4},
838 {x = 4, y = 6, z = 4},
839 -- maximum interval of interior volume check
846 minetest.register_node("default:aspen_tree", {
847 description = "Aspen Tree",
848 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
849 "default_aspen_tree.png"},
850 paramtype2 = "facedir",
851 is_ground_content = false,
852 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
853 sounds = default.node_sound_wood_defaults(),
855 on_place = minetest.rotate_node
858 minetest.register_node("default:aspen_wood", {
859 description = "Aspen Wood Planks",
860 paramtype2 = "facedir",
862 tiles = {"default_aspen_wood.png"},
863 is_ground_content = false,
864 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
865 sounds = default.node_sound_wood_defaults(),
868 minetest.register_node("default:aspen_leaves", {
869 description = "Aspen Leaves",
870 drawtype = "allfaces_optional",
871 tiles = {"default_aspen_leaves.png"},
874 is_ground_content = false,
875 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
879 {items = {"default:aspen_sapling"}, rarity = 20},
880 {items = {"default:aspen_leaves"}}
883 sounds = default.node_sound_leaves_defaults(),
885 after_place_node = default.after_place_leaves,
888 minetest.register_node("default:aspen_sapling", {
889 description = "Aspen Tree Sapling",
890 drawtype = "plantlike",
892 tiles = {"default_aspen_sapling.png"},
893 inventory_image = "default_aspen_sapling.png",
894 wield_image = "default_aspen_sapling.png",
896 sunlight_propagates = true,
898 on_timer = default.grow_sapling,
901 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
903 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
904 attached_node = 1, sapling = 1},
905 sounds = default.node_sound_leaves_defaults(),
907 on_construct = function(pos)
908 minetest.get_node_timer(pos):start(math.random(2400,4800))
911 on_place = function(itemstack, placer, pointed_thing)
912 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
913 "default:aspen_sapling",
914 -- minp, maxp to be checked, relative to sapling pos
915 -- minp_relative.y = 1 because sapling pos has been checked
916 {x = -2, y = 1, z = -2},
917 {x = 2, y = 12, z = 2},
918 -- maximum interval of interior volume check
929 minetest.register_node("default:stone_with_coal", {
930 description = "Coal Ore",
931 tiles = {"default_stone.png^default_mineral_coal.png"},
932 groups = {cracky = 3},
933 drop = 'default:coal_lump',
934 sounds = default.node_sound_stone_defaults(),
937 minetest.register_node("default:coalblock", {
938 description = "Coal Block",
939 tiles = {"default_coal_block.png"},
940 is_ground_content = false,
941 groups = {cracky = 3},
942 sounds = default.node_sound_stone_defaults(),
946 minetest.register_node("default:stone_with_iron", {
947 description = "Iron Ore",
948 tiles = {"default_stone.png^default_mineral_iron.png"},
949 groups = {cracky = 2},
950 drop = 'default:iron_lump',
951 sounds = default.node_sound_stone_defaults(),
954 minetest.register_node("default:steelblock", {
955 description = "Steel Block",
956 tiles = {"default_steel_block.png"},
957 is_ground_content = false,
958 groups = {cracky = 1, level = 2},
959 sounds = default.node_sound_metal_defaults(),
963 minetest.register_node("default:stone_with_copper", {
964 description = "Copper Ore",
965 tiles = {"default_stone.png^default_mineral_copper.png"},
966 groups = {cracky = 2},
967 drop = 'default:copper_lump',
968 sounds = default.node_sound_stone_defaults(),
971 minetest.register_node("default:copperblock", {
972 description = "Copper Block",
973 tiles = {"default_copper_block.png"},
974 is_ground_content = false,
975 groups = {cracky = 1, level = 2},
976 sounds = default.node_sound_metal_defaults(),
979 minetest.register_node("default:bronzeblock", {
980 description = "Bronze Block",
981 tiles = {"default_bronze_block.png"},
982 is_ground_content = false,
983 groups = {cracky = 1, level = 2},
984 sounds = default.node_sound_metal_defaults(),
988 minetest.register_node("default:stone_with_mese", {
989 description = "Mese Ore",
990 tiles = {"default_stone.png^default_mineral_mese.png"},
991 groups = {cracky = 1},
992 drop = "default:mese_crystal",
993 sounds = default.node_sound_stone_defaults(),
996 minetest.register_node("default:mese", {
997 description = "Mese Block",
998 tiles = {"default_mese_block.png"},
1000 groups = {cracky = 1, level = 2},
1001 sounds = default.node_sound_stone_defaults(),
1006 minetest.register_node("default:stone_with_gold", {
1007 description = "Gold Ore",
1008 tiles = {"default_stone.png^default_mineral_gold.png"},
1009 groups = {cracky = 2},
1010 drop = "default:gold_lump",
1011 sounds = default.node_sound_stone_defaults(),
1014 minetest.register_node("default:goldblock", {
1015 description = "Gold Block",
1016 tiles = {"default_gold_block.png"},
1017 is_ground_content = false,
1018 groups = {cracky = 1},
1019 sounds = default.node_sound_metal_defaults(),
1023 minetest.register_node("default:stone_with_diamond", {
1024 description = "Diamond Ore",
1025 tiles = {"default_stone.png^default_mineral_diamond.png"},
1026 groups = {cracky = 1},
1027 drop = "default:diamond",
1028 sounds = default.node_sound_stone_defaults(),
1031 minetest.register_node("default:diamondblock", {
1032 description = "Diamond Block",
1033 tiles = {"default_diamond_block.png"},
1034 is_ground_content = false,
1035 groups = {cracky = 1, level = 3},
1036 sounds = default.node_sound_stone_defaults(),
1040 -- Plantlife (non-cubic)
1043 minetest.register_node("default:cactus", {
1044 description = "Cactus",
1045 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1046 "default_cactus_side.png"},
1047 paramtype2 = "facedir",
1048 groups = {snappy = 1, choppy = 3},
1049 sounds = default.node_sound_wood_defaults(),
1050 on_place = minetest.rotate_node,
1053 minetest.register_node("default:papyrus", {
1054 description = "Papyrus",
1055 drawtype = "plantlike",
1056 tiles = {"default_papyrus.png"},
1057 inventory_image = "default_papyrus.png",
1058 wield_image = "default_papyrus.png",
1059 paramtype = "light",
1060 sunlight_propagates = true,
1064 fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
1066 groups = {snappy = 3, flammable = 2},
1067 sounds = default.node_sound_leaves_defaults(),
1069 after_dig_node = function(pos, node, metadata, digger)
1070 default.dig_up(pos, node, digger)
1074 minetest.register_node("default:dry_shrub", {
1075 description = "Dry Shrub",
1076 drawtype = "plantlike",
1079 tiles = {"default_dry_shrub.png"},
1080 inventory_image = "default_dry_shrub.png",
1081 wield_image = "default_dry_shrub.png",
1082 paramtype = "light",
1083 sunlight_propagates = true,
1085 buildable_to = true,
1086 groups = {snappy = 3, flammable = 3, attached_node = 1},
1087 sounds = default.node_sound_leaves_defaults(),
1090 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1094 minetest.register_node("default:junglegrass", {
1095 description = "Jungle Grass",
1096 drawtype = "plantlike",
1099 tiles = {"default_junglegrass.png"},
1100 inventory_image = "default_junglegrass.png",
1101 wield_image = "default_junglegrass.png",
1102 paramtype = "light",
1103 sunlight_propagates = true,
1105 buildable_to = true,
1106 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1107 sounds = default.node_sound_leaves_defaults(),
1110 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1115 minetest.register_node("default:grass_1", {
1116 description = "Grass",
1117 drawtype = "plantlike",
1119 tiles = {"default_grass_1.png"},
1120 -- Use texture of a taller grass stage in inventory
1121 inventory_image = "default_grass_3.png",
1122 wield_image = "default_grass_3.png",
1123 paramtype = "light",
1124 sunlight_propagates = true,
1126 buildable_to = true,
1127 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1128 sounds = default.node_sound_leaves_defaults(),
1131 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1134 on_place = function(itemstack, placer, pointed_thing)
1135 -- place a random grass node
1136 local stack = ItemStack("default:grass_" .. math.random(1,5))
1137 local ret = minetest.item_place(stack, placer, pointed_thing)
1138 return ItemStack("default:grass_1 " ..
1139 itemstack:get_count() - (1 - ret:get_count()))
1144 minetest.register_node("default:grass_" .. i, {
1145 description = "Grass",
1146 drawtype = "plantlike",
1148 tiles = {"default_grass_" .. i .. ".png"},
1149 inventory_image = "default_grass_" .. i .. ".png",
1150 wield_image = "default_grass_" .. i .. ".png",
1151 paramtype = "light",
1152 sunlight_propagates = true,
1154 buildable_to = true,
1155 drop = "default:grass_1",
1156 groups = {snappy = 3, flora = 1, attached_node = 1,
1157 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1158 sounds = default.node_sound_leaves_defaults(),
1161 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1167 minetest.register_node("default:dry_grass_1", {
1168 description = "Dry Grass",
1169 drawtype = "plantlike",
1171 tiles = {"default_dry_grass_1.png"},
1172 inventory_image = "default_dry_grass_3.png",
1173 wield_image = "default_dry_grass_3.png",
1174 paramtype = "light",
1175 sunlight_propagates = true,
1177 buildable_to = true,
1178 groups = {snappy = 3, flammable = 3, flora = 1,
1179 attached_node = 1, dry_grass = 1},
1180 sounds = default.node_sound_leaves_defaults(),
1183 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1186 on_place = function(itemstack, placer, pointed_thing)
1187 -- place a random dry grass node
1188 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1189 local ret = minetest.item_place(stack, placer, pointed_thing)
1190 return ItemStack("default:dry_grass_1 " ..
1191 itemstack:get_count() - (1 - ret:get_count()))
1196 minetest.register_node("default:dry_grass_" .. i, {
1197 description = "Dry Grass",
1198 drawtype = "plantlike",
1200 tiles = {"default_dry_grass_" .. i .. ".png"},
1201 inventory_image = "default_dry_grass_" .. i .. ".png",
1202 wield_image = "default_dry_grass_" .. i .. ".png",
1203 paramtype = "light",
1204 sunlight_propagates = true,
1206 buildable_to = true,
1207 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1208 not_in_creative_inventory=1, dry_grass = 1},
1209 drop = "default:dry_grass_1",
1210 sounds = default.node_sound_leaves_defaults(),
1213 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1219 minetest.register_node("default:bush_stem", {
1220 description = "Bush Stem",
1221 drawtype = "plantlike",
1222 visual_scale = 1.18,
1223 tiles = {"default_bush_stem.png"},
1224 inventory_image = "default_bush_stem.png",
1225 wield_image = "default_bush_stem.png",
1226 paramtype = "light",
1227 sunlight_propagates = true,
1228 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1229 sounds = default.node_sound_wood_defaults(),
1232 minetest.register_node("default:bush_leaves", {
1233 description = "Bush Leaves",
1234 drawtype = "allfaces_optional",
1236 tiles = {"default_leaves_simple.png"},
1237 paramtype = "light",
1238 groups = {snappy = 3, flammable = 2, leaves = 1},
1239 sounds = default.node_sound_leaves_defaults(),
1242 minetest.register_node("default:acacia_bush_stem", {
1243 description = "Acacia Bush Stem",
1244 drawtype = "plantlike",
1245 visual_scale = 1.18,
1246 tiles = {"default_acacia_bush_stem.png"},
1247 inventory_image = "default_acacia_bush_stem.png",
1248 wield_image = "default_acacia_bush_stem.png",
1249 paramtype = "light",
1250 sunlight_propagates = true,
1251 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1252 sounds = default.node_sound_wood_defaults(),
1255 minetest.register_node("default:acacia_bush_leaves", {
1256 description = "Acacia Bush Leaves",
1257 drawtype = "allfaces_optional",
1259 tiles = {"default_acacia_leaves.png"},
1260 paramtype = "light",
1261 groups = {snappy = 3, flammable = 2, leaves = 1},
1262 sounds = default.node_sound_leaves_defaults(),
1270 minetest.register_node("default:coral_brown", {
1271 description = "Brown Coral",
1272 tiles = {"default_coral_brown.png"},
1273 groups = {cracky = 3},
1274 drop = "default:coral_skeleton",
1275 sounds = default.node_sound_stone_defaults(),
1278 minetest.register_node("default:coral_orange", {
1279 description = "Orange Coral",
1280 tiles = {"default_coral_orange.png"},
1281 groups = {cracky = 3},
1282 drop = "default:coral_skeleton",
1283 sounds = default.node_sound_stone_defaults(),
1286 minetest.register_node("default:coral_skeleton", {
1287 description = "Coral Skeleton",
1288 tiles = {"default_coral_skeleton.png"},
1289 groups = {cracky = 3},
1290 sounds = default.node_sound_stone_defaults(),
1298 minetest.register_node("default:water_source", {
1299 description = "Water Source",
1300 drawtype = "liquid",
1303 name = "default_water_source_animated.png",
1305 type = "vertical_frames",
1313 -- New-style water source material (mostly unused)
1315 name = "default_water_source_animated.png",
1317 type = "vertical_frames",
1322 backface_culling = false,
1326 paramtype = "light",
1330 buildable_to = true,
1331 is_ground_content = false,
1334 liquidtype = "source",
1335 liquid_alternative_flowing = "default:water_flowing",
1336 liquid_alternative_source = "default:water_source",
1337 liquid_viscosity = 1,
1338 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1339 groups = {water = 3, liquid = 3, puts_out_fire = 1},
1342 minetest.register_node("default:water_flowing", {
1343 description = "Flowing Water",
1344 drawtype = "flowingliquid",
1345 tiles = {"default_water.png"},
1348 name = "default_water_flowing_animated.png",
1349 backface_culling = false,
1351 type = "vertical_frames",
1358 name = "default_water_flowing_animated.png",
1359 backface_culling = true,
1361 type = "vertical_frames",
1369 paramtype = "light",
1370 paramtype2 = "flowingliquid",
1374 buildable_to = true,
1375 is_ground_content = false,
1378 liquidtype = "flowing",
1379 liquid_alternative_flowing = "default:water_flowing",
1380 liquid_alternative_source = "default:water_source",
1381 liquid_viscosity = 1,
1382 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1383 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1384 not_in_creative_inventory = 1},
1388 minetest.register_node("default:river_water_source", {
1389 description = "River Water Source",
1390 drawtype = "liquid",
1393 name = "default_river_water_source_animated.png",
1395 type = "vertical_frames",
1404 name = "default_river_water_source_animated.png",
1406 type = "vertical_frames",
1411 backface_culling = false,
1415 paramtype = "light",
1419 buildable_to = true,
1420 is_ground_content = false,
1423 liquidtype = "source",
1424 liquid_alternative_flowing = "default:river_water_flowing",
1425 liquid_alternative_source = "default:river_water_source",
1426 liquid_viscosity = 1,
1427 liquid_renewable = false,
1429 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1430 groups = {water = 3, liquid = 3, puts_out_fire = 1},
1433 minetest.register_node("default:river_water_flowing", {
1434 description = "Flowing River Water",
1435 drawtype = "flowingliquid",
1436 tiles = {"default_river_water.png"},
1439 name = "default_river_water_flowing_animated.png",
1440 backface_culling = false,
1442 type = "vertical_frames",
1449 name = "default_river_water_flowing_animated.png",
1450 backface_culling = true,
1452 type = "vertical_frames",
1460 paramtype = "light",
1461 paramtype2 = "flowingliquid",
1465 buildable_to = true,
1466 is_ground_content = false,
1469 liquidtype = "flowing",
1470 liquid_alternative_flowing = "default:river_water_flowing",
1471 liquid_alternative_source = "default:river_water_source",
1472 liquid_viscosity = 1,
1473 liquid_renewable = false,
1475 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1476 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1477 not_in_creative_inventory = 1},
1481 minetest.register_node("default:lava_source", {
1482 description = "Lava Source",
1483 drawtype = "liquid",
1486 name = "default_lava_source_animated.png",
1488 type = "vertical_frames",
1496 -- New-style lava source material (mostly unused)
1498 name = "default_lava_source_animated.png",
1500 type = "vertical_frames",
1505 backface_culling = false,
1508 paramtype = "light",
1509 light_source = default.LIGHT_MAX - 1,
1513 buildable_to = true,
1514 is_ground_content = false,
1517 liquidtype = "source",
1518 liquid_alternative_flowing = "default:lava_flowing",
1519 liquid_alternative_source = "default:lava_source",
1520 liquid_viscosity = 7,
1521 liquid_renewable = false,
1522 damage_per_second = 4 * 2,
1523 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1524 groups = {lava = 3, liquid = 2, igniter = 1},
1527 minetest.register_node("default:lava_flowing", {
1528 description = "Flowing Lava",
1529 drawtype = "flowingliquid",
1530 tiles = {"default_lava.png"},
1533 name = "default_lava_flowing_animated.png",
1534 backface_culling = false,
1536 type = "vertical_frames",
1543 name = "default_lava_flowing_animated.png",
1544 backface_culling = true,
1546 type = "vertical_frames",
1553 paramtype = "light",
1554 paramtype2 = "flowingliquid",
1555 light_source = default.LIGHT_MAX - 1,
1559 buildable_to = true,
1560 is_ground_content = false,
1563 liquidtype = "flowing",
1564 liquid_alternative_flowing = "default:lava_flowing",
1565 liquid_alternative_source = "default:lava_source",
1566 liquid_viscosity = 7,
1567 liquid_renewable = false,
1568 damage_per_second = 4 * 2,
1569 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1570 groups = {lava = 3, liquid = 2, igniter = 1,
1571 not_in_creative_inventory = 1},
1575 -- Tools / "Advanced" crafting / Non-"natural"
1578 minetest.register_node("default:torch", {
1579 description = "Torch",
1580 drawtype = "torchlike",
1583 name = "default_torch_on_floor_animated.png",
1585 type = "vertical_frames",
1592 name="default_torch_on_ceiling_animated.png",
1594 type = "vertical_frames",
1601 name="default_torch_animated.png",
1603 type = "vertical_frames",
1610 inventory_image = "default_torch_on_floor.png",
1611 wield_image = "default_torch_on_floor.png",
1612 paramtype = "light",
1613 paramtype2 = "wallmounted",
1614 sunlight_propagates = true,
1615 is_ground_content = false,
1617 light_source = default.LIGHT_MAX - 1,
1619 type = "wallmounted",
1620 wall_top = {-0.1, 0.5 - 0.6, -0.1, 0.1, 0.5, 0.1},
1621 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5 + 0.6, 0.1},
1622 wall_side = {-0.5, -0.3, -0.1, -0.5 + 0.3, 0.3, 0.1},
1624 groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1},
1625 legacy_wallmounted = true,
1626 sounds = default.node_sound_defaults(),
1630 local chest_formspec =
1633 default.gui_bg_img ..
1634 default.gui_slots ..
1635 "list[current_name;main;0,0.3;8,4;]" ..
1636 "list[current_player;main;0,4.85;8,1;]" ..
1637 "list[current_player;main;0,6.08;8,3;8]" ..
1638 "listring[current_name;main]" ..
1639 "listring[current_player;main]" ..
1640 default.get_hotbar_bg(0,4.85)
1642 local function get_locked_chest_formspec(pos)
1643 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1647 default.gui_bg_img ..
1648 default.gui_slots ..
1649 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1650 "list[current_player;main;0,4.85;8,1;]" ..
1651 "list[current_player;main;0,6.08;8,3;8]" ..
1652 "listring[nodemeta:" .. spos .. ";main]" ..
1653 "listring[current_player;main]" ..
1654 default.get_hotbar_bg(0,4.85)
1658 local function has_locked_chest_privilege(meta, player)
1661 if minetest.check_player_privs(player, "protection_bypass") then
1664 name = player:get_player_name()
1666 if name ~= meta:get_string("owner") then
1672 minetest.register_node("default:chest", {
1673 description = "Chest",
1674 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1675 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1676 paramtype2 = "facedir",
1677 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1678 legacy_facedir_simple = true,
1679 is_ground_content = false,
1680 sounds = default.node_sound_wood_defaults(),
1682 on_construct = function(pos)
1683 local meta = minetest.get_meta(pos)
1684 meta:set_string("formspec", chest_formspec)
1685 local inv = meta:get_inventory()
1686 inv:set_size("main", 8*4)
1688 can_dig = function(pos,player)
1689 local meta = minetest.get_meta(pos);
1690 local inv = meta:get_inventory()
1691 return inv:is_empty("main")
1693 on_metadata_inventory_move = function(pos, from_list, from_index,
1694 to_list, to_index, count, player)
1695 minetest.log("action", player:get_player_name() ..
1696 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1698 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1699 minetest.log("action", player:get_player_name() ..
1700 " moves " .. stack:get_name() ..
1701 " to chest at " .. minetest.pos_to_string(pos))
1703 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1704 minetest.log("action", player:get_player_name() ..
1705 " takes " .. stack:get_name() ..
1706 " from chest at " .. minetest.pos_to_string(pos))
1708 on_blast = function(pos)
1710 default.get_inventory_drops(pos, "main", drops)
1711 drops[#drops+1] = "default:chest"
1712 minetest.remove_node(pos)
1717 minetest.register_node("default:chest_locked", {
1718 description = "Locked Chest",
1719 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1720 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1721 paramtype2 = "facedir",
1722 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1723 legacy_facedir_simple = true,
1724 is_ground_content = false,
1725 sounds = default.node_sound_wood_defaults(),
1727 after_place_node = function(pos, placer)
1728 local meta = minetest.get_meta(pos)
1729 meta:set_string("owner", placer:get_player_name() or "")
1730 meta:set_string("infotext", "Locked Chest (owned by " ..
1731 meta:get_string("owner") .. ")")
1733 on_construct = function(pos)
1734 local meta = minetest.get_meta(pos)
1735 meta:set_string("owner", "")
1736 local inv = meta:get_inventory()
1737 inv:set_size("main", 8 * 4)
1739 can_dig = function(pos,player)
1740 local meta = minetest.get_meta(pos);
1741 local inv = meta:get_inventory()
1742 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1744 allow_metadata_inventory_move = function(pos, from_list, from_index,
1745 to_list, to_index, count, player)
1746 local meta = minetest.get_meta(pos)
1747 if not has_locked_chest_privilege(meta, player) then
1752 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1753 local meta = minetest.get_meta(pos)
1754 if not has_locked_chest_privilege(meta, player) then
1757 return stack:get_count()
1759 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1760 local meta = minetest.get_meta(pos)
1761 if not has_locked_chest_privilege(meta, player) then
1764 return stack:get_count()
1766 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1767 minetest.log("action", player:get_player_name() ..
1768 " moves " .. stack:get_name() ..
1769 " to locked chest at " .. minetest.pos_to_string(pos))
1771 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1772 minetest.log("action", player:get_player_name() ..
1773 " takes " .. stack:get_name() ..
1774 " from locked chest at " .. minetest.pos_to_string(pos))
1776 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1777 local meta = minetest.get_meta(pos)
1778 if has_locked_chest_privilege(meta, clicker) then
1779 minetest.show_formspec(
1780 clicker:get_player_name(),
1781 "default:chest_locked",
1782 get_locked_chest_formspec(pos)
1787 on_blast = function() end,
1791 local bookshelf_formspec =
1794 default.gui_bg_img ..
1795 default.gui_slots ..
1796 "list[context;books;0,0.3;8,2;]" ..
1797 "list[current_player;main;0,2.85;8,1;]" ..
1798 "list[current_player;main;0,4.08;8,3;8]" ..
1799 "listring[context;books]" ..
1800 "listring[current_player;main]" ..
1801 default.get_hotbar_bg(0,2.85)
1803 minetest.register_node("default:bookshelf", {
1804 description = "Bookshelf",
1805 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1806 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1807 paramtype2 = "facedir",
1808 is_ground_content = false,
1809 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1810 sounds = default.node_sound_wood_defaults(),
1812 on_construct = function(pos)
1813 local meta = minetest.get_meta(pos)
1814 meta:set_string("formspec", bookshelf_formspec)
1815 local inv = meta:get_inventory()
1816 inv:set_size("books", 8 * 2)
1818 can_dig = function(pos,player)
1819 local inv = minetest.get_meta(pos):get_inventory()
1820 return inv:is_empty("books")
1822 allow_metadata_inventory_put = function(pos, listname, index, stack)
1823 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1824 return stack:get_count()
1828 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1829 minetest.log("action", player:get_player_name() ..
1830 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1832 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1833 minetest.log("action", player:get_player_name() ..
1834 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1836 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1837 minetest.log("action", player:get_player_name() ..
1838 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1840 on_blast = function(pos)
1842 default.get_inventory_drops(pos, "books", drops)
1843 drops[#drops+1] = "default:bookshelf"
1844 minetest.remove_node(pos)
1849 local function register_sign(material, desc, def)
1850 minetest.register_node("default:sign_wall_" .. material, {
1851 description = desc .. " Sign",
1852 drawtype = "nodebox",
1853 tiles = {"default_sign_wall_" .. material .. ".png"},
1854 inventory_image = "default_sign_" .. material .. ".png",
1855 wield_image = "default_sign_" .. material .. ".png",
1856 paramtype = "light",
1857 paramtype2 = "wallmounted",
1858 sunlight_propagates = true,
1859 is_ground_content = false,
1862 type = "wallmounted",
1863 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1864 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1865 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1867 groups = def.groups,
1868 legacy_wallmounted = true,
1869 sounds = def.sounds,
1871 on_construct = function(pos)
1872 --local n = minetest.get_node(pos)
1873 local meta = minetest.get_meta(pos)
1874 meta:set_string("formspec", "field[text;;${text}]")
1876 on_receive_fields = function(pos, formname, fields, sender)
1877 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1878 local player_name = sender:get_player_name()
1879 if minetest.is_protected(pos, player_name) then
1880 minetest.record_protection_violation(pos, player_name)
1883 local meta = minetest.get_meta(pos)
1884 if not fields.text then return end
1885 minetest.log("action", (player_name or "") .. " wrote \"" ..
1886 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1887 meta:set_string("text", fields.text)
1888 meta:set_string("infotext", '"' .. fields.text .. '"')
1893 register_sign("wood", "Wooden", {
1894 sounds = default.node_sound_wood_defaults(),
1895 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1898 register_sign("steel", "Steel", {
1899 sounds = default.node_sound_metal_defaults(),
1900 groups = {cracky = 2, attached_node = 1}
1903 minetest.register_node("default:ladder_wood", {
1904 description = "Wooden Ladder",
1905 drawtype = "signlike",
1906 tiles = {"default_ladder_wood.png"},
1907 inventory_image = "default_ladder_wood.png",
1908 wield_image = "default_ladder_wood.png",
1909 paramtype = "light",
1910 paramtype2 = "wallmounted",
1911 sunlight_propagates = true,
1914 is_ground_content = false,
1916 type = "wallmounted",
1917 --wall_top = = <default>
1918 --wall_bottom = = <default>
1919 --wall_side = = <default>
1921 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1922 legacy_wallmounted = true,
1923 sounds = default.node_sound_wood_defaults(),
1926 minetest.register_node("default:ladder_steel", {
1927 description = "Steel Ladder",
1928 drawtype = "signlike",
1929 tiles = {"default_ladder_steel.png"},
1930 inventory_image = "default_ladder_steel.png",
1931 wield_image = "default_ladder_steel.png",
1932 paramtype = "light",
1933 paramtype2 = "wallmounted",
1934 sunlight_propagates = true,
1937 is_ground_content = false,
1939 type = "wallmounted",
1940 --wall_top = = <default>
1941 --wall_bottom = = <default>
1942 --wall_side = = <default>
1944 groups = {cracky = 2},
1945 sounds = default.node_sound_metal_defaults(),
1948 default.register_fence("default:fence_wood", {
1949 description = "Wooden Fence",
1950 texture = "default_fence_wood.png",
1951 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1952 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1953 material = "default:wood",
1954 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1955 sounds = default.node_sound_wood_defaults()
1958 default.register_fence("default:fence_acacia_wood", {
1959 description = "Acacia Fence",
1960 texture = "default_fence_acacia_wood.png",
1961 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1962 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1963 material = "default:acacia_wood",
1964 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1965 sounds = default.node_sound_wood_defaults()
1968 default.register_fence("default:fence_junglewood", {
1969 description = "Junglewood Fence",
1970 texture = "default_fence_junglewood.png",
1971 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1972 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
1973 material = "default:junglewood",
1974 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1975 sounds = default.node_sound_wood_defaults()
1978 default.register_fence("default:fence_pine_wood", {
1979 description = "Pine Fence",
1980 texture = "default_fence_pine_wood.png",
1981 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1982 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1983 material = "default:pine_wood",
1984 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1985 sounds = default.node_sound_wood_defaults()
1988 default.register_fence("default:fence_aspen_wood", {
1989 description = "Aspen Fence",
1990 texture = "default_fence_aspen_wood.png",
1991 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1992 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1993 material = "default:aspen_wood",
1994 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1995 sounds = default.node_sound_wood_defaults()
1998 minetest.register_node("default:glass", {
1999 description = "Glass",
2000 drawtype = "glasslike_framed_optional",
2001 tiles = {"default_glass.png", "default_glass_detail.png"},
2002 paramtype = "light",
2003 sunlight_propagates = true,
2004 is_ground_content = false,
2005 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2006 sounds = default.node_sound_glass_defaults(),
2009 minetest.register_node("default:obsidian_glass", {
2010 description = "Obsidian Glass",
2011 drawtype = "glasslike_framed_optional",
2012 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2013 paramtype = "light",
2014 is_ground_content = false,
2015 sunlight_propagates = true,
2016 sounds = default.node_sound_glass_defaults(),
2017 groups = {cracky = 3},
2021 minetest.register_node("default:rail", {
2022 description = "Rail",
2023 drawtype = "raillike",
2024 tiles = {"default_rail.png", "default_rail_curved.png",
2025 "default_rail_t_junction.png", "default_rail_crossing.png"},
2026 inventory_image = "default_rail.png",
2027 wield_image = "default_rail.png",
2028 paramtype = "light",
2029 sunlight_propagates = true,
2031 is_ground_content = false,
2034 -- but how to specify the dimensions for curved and sideways rails?
2035 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
2037 groups = {dig_immediate = 2, attached_node = 1,
2038 connect_to_raillike = minetest.raillike_group("rail")},
2042 minetest.register_node("default:brick", {
2043 description = "Brick Block",
2044 paramtype2 = "facedir",
2046 tiles = {"default_brick.png"},
2047 is_ground_content = false,
2048 groups = {cracky = 3},
2049 sounds = default.node_sound_stone_defaults(),
2053 minetest.register_node("default:meselamp", {
2054 description = "Mese Lamp",
2055 drawtype = "glasslike",
2056 tiles = {"default_meselamp.png"},
2057 paramtype = "light",
2058 sunlight_propagates = true,
2059 is_ground_content = false,
2060 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2061 sounds = default.node_sound_glass_defaults(),
2062 light_source = default.LIGHT_MAX,
2069 minetest.register_node("default:cloud", {
2070 description = "Cloud",
2071 tiles = {"default_cloud.png"},
2072 is_ground_content = false,
2073 sounds = default.node_sound_defaults(),
2074 groups = {not_in_creative_inventory = 1},