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 -------------------------------------------
167 default:sign_wall_wood
168 default:sign_wall_steel
174 default:fence_acacia_wood
175 default:fence_junglewood
176 default:fence_pine_wood
177 default:fence_aspen_wood
180 default:obsidian_glass
197 minetest.register_node("default:stone", {
198 description = "Stone",
199 tiles = {"default_stone.png"},
200 groups = {cracky = 3, stone = 1},
201 drop = 'default:cobble',
202 legacy_mineral = true,
203 sounds = default.node_sound_stone_defaults(),
206 minetest.register_node("default:cobble", {
207 description = "Cobblestone",
208 tiles = {"default_cobble.png"},
209 is_ground_content = false,
210 groups = {cracky = 3, stone = 2},
211 sounds = default.node_sound_stone_defaults(),
214 minetest.register_node("default:stonebrick", {
215 description = "Stone Brick",
216 paramtype2 = "facedir",
218 tiles = {"default_stone_brick.png"},
219 is_ground_content = false,
220 groups = {cracky = 2, stone = 1},
221 sounds = default.node_sound_stone_defaults(),
224 minetest.register_node("default:stone_block", {
225 description = "Stone Block",
226 tiles = {"default_stone_block.png"},
227 is_ground_content = false,
228 groups = {cracky = 2, stone = 1},
229 sounds = default.node_sound_stone_defaults(),
232 minetest.register_node("default:mossycobble", {
233 description = "Mossy Cobblestone",
234 tiles = {"default_mossycobble.png"},
235 is_ground_content = false,
236 groups = {cracky = 3, stone = 1},
237 sounds = default.node_sound_stone_defaults(),
241 minetest.register_node("default:desert_stone", {
242 description = "Desert Stone",
243 tiles = {"default_desert_stone.png"},
244 groups = {cracky = 3, stone = 1},
245 drop = 'default:desert_cobble',
246 legacy_mineral = true,
247 sounds = default.node_sound_stone_defaults(),
250 minetest.register_node("default:desert_cobble", {
251 description = "Desert Cobblestone",
252 tiles = {"default_desert_cobble.png"},
253 is_ground_content = false,
254 groups = {cracky = 3, stone = 2},
255 sounds = default.node_sound_stone_defaults(),
258 minetest.register_node("default:desert_stonebrick", {
259 description = "Desert Stone Brick",
260 paramtype2 = "facedir",
262 tiles = {"default_desert_stone_brick.png"},
263 is_ground_content = false,
264 groups = {cracky = 2, stone = 1},
265 sounds = default.node_sound_stone_defaults(),
268 minetest.register_node("default:desert_stone_block", {
269 description = "Desert Stone Block",
270 tiles = {"default_desert_stone_block.png"},
271 is_ground_content = false,
272 groups = {cracky = 2, stone = 1},
273 sounds = default.node_sound_stone_defaults(),
277 minetest.register_node("default:sandstone", {
278 description = "Sandstone",
279 tiles = {"default_sandstone.png"},
280 groups = {crumbly = 1, cracky = 3},
281 sounds = default.node_sound_stone_defaults(),
284 minetest.register_node("default:sandstonebrick", {
285 description = "Sandstone Brick",
286 paramtype2 = "facedir",
288 tiles = {"default_sandstone_brick.png"},
289 is_ground_content = false,
290 groups = {cracky = 2},
291 sounds = default.node_sound_stone_defaults(),
294 minetest.register_node("default:sandstone_block", {
295 description = "Sandstone Block",
296 tiles = {"default_sandstone_block.png"},
297 is_ground_content = false,
298 groups = {cracky = 2},
299 sounds = default.node_sound_stone_defaults(),
303 minetest.register_node("default:obsidian", {
304 description = "Obsidian",
305 tiles = {"default_obsidian.png"},
306 sounds = default.node_sound_stone_defaults(),
307 groups = {cracky = 1, level = 2},
310 minetest.register_node("default:obsidianbrick", {
311 description = "Obsidian Brick",
312 paramtype2 = "facedir",
314 tiles = {"default_obsidian_brick.png"},
315 is_ground_content = false,
316 sounds = default.node_sound_stone_defaults(),
317 groups = {cracky = 1, level = 2},
320 minetest.register_node("default:obsidian_block", {
321 description = "Obsidian Block",
322 tiles = {"default_obsidian_block.png"},
323 is_ground_content = false,
324 sounds = default.node_sound_stone_defaults(),
325 groups = {cracky = 1, level = 2},
332 minetest.register_node("default:dirt", {
333 description = "Dirt",
334 tiles = {"default_dirt.png"},
335 groups = {crumbly = 3, soil = 1},
336 sounds = default.node_sound_dirt_defaults(),
339 minetest.register_node("default:dirt_with_grass", {
340 description = "Dirt with Grass",
341 tiles = {"default_grass.png", "default_dirt.png",
342 {name = "default_dirt.png^default_grass_side.png",
343 tileable_vertical = false}},
344 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
345 drop = 'default:dirt',
346 sounds = default.node_sound_dirt_defaults({
347 footstep = {name = "default_grass_footstep", gain = 0.25},
351 minetest.register_node("default:dirt_with_grass_footsteps", {
352 description = "Dirt with Grass and Footsteps",
353 tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
354 {name = "default_dirt.png^default_grass_side.png",
355 tileable_vertical = false}},
356 groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
357 drop = 'default:dirt',
358 sounds = default.node_sound_dirt_defaults({
359 footstep = {name = "default_grass_footstep", gain = 0.25},
363 minetest.register_node("default:dirt_with_dry_grass", {
364 description = "Dirt with Dry Grass",
365 tiles = {"default_dry_grass.png",
367 {name = "default_dirt.png^default_dry_grass_side.png",
368 tileable_vertical = false}},
369 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
370 drop = 'default:dirt',
371 sounds = default.node_sound_dirt_defaults({
372 footstep = {name = "default_grass_footstep", gain = 0.4},
376 minetest.register_node("default:dirt_with_snow", {
377 description = "Dirt with Snow",
378 tiles = {"default_snow.png", "default_dirt.png",
379 {name = "default_dirt.png^default_snow_side.png",
380 tileable_vertical = false}},
381 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
382 drop = 'default:dirt',
383 sounds = default.node_sound_dirt_defaults({
384 footstep = {name = "default_snow_footstep", gain = 0.15},
388 minetest.register_node("default:sand", {
389 description = "Sand",
390 tiles = {"default_sand.png"},
391 groups = {crumbly = 3, falling_node = 1, sand = 1},
392 sounds = default.node_sound_sand_defaults(),
395 minetest.register_node("default:desert_sand", {
396 description = "Desert Sand",
397 tiles = {"default_desert_sand.png"},
398 groups = {crumbly = 3, falling_node = 1, sand = 1},
399 sounds = default.node_sound_sand_defaults(),
402 minetest.register_node("default:silver_sand", {
403 description = "Silver Sand",
404 tiles = {"default_silver_sand.png"},
405 groups = {crumbly = 3, falling_node = 1, sand = 1},
406 sounds = default.node_sound_sand_defaults(),
410 minetest.register_node("default:gravel", {
411 description = "Gravel",
412 tiles = {"default_gravel.png"},
413 groups = {crumbly = 2, falling_node = 1},
414 sounds = default.node_sound_gravel_defaults(),
418 {items = {'default:flint'}, rarity = 16},
419 {items = {'default:gravel'}}
424 minetest.register_node("default:clay", {
425 description = "Clay",
426 tiles = {"default_clay.png"},
427 groups = {crumbly = 3},
428 drop = 'default:clay_lump 4',
429 sounds = default.node_sound_dirt_defaults(),
433 minetest.register_node("default:snow", {
434 description = "Snow",
435 tiles = {"default_snow.png"},
436 inventory_image = "default_snowball.png",
437 wield_image = "default_snowball.png",
441 drawtype = "nodebox",
445 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
448 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
449 sounds = default.node_sound_dirt_defaults({
450 footstep = {name = "default_snow_footstep", gain = 0.15},
451 dug = {name = "default_snow_footstep", gain = 0.2},
452 dig = {name = "default_snow_footstep", gain = 0.2}
455 on_construct = function(pos)
457 if minetest.get_node(pos).name == "default:dirt_with_grass" then
458 minetest.set_node(pos, {name = "default:dirt_with_snow"})
463 minetest.register_node("default:snowblock", {
464 description = "Snow Block",
465 tiles = {"default_snow.png"},
466 groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1},
467 sounds = default.node_sound_dirt_defaults({
468 footstep = {name = "default_snow_footstep", gain = 0.15},
469 dug = {name = "default_snow_footstep", gain = 0.2},
470 dig = {name = "default_snow_footstep", gain = 0.2}
473 on_construct = function(pos)
475 if minetest.get_node(pos).name == "default:dirt_with_grass" then
476 minetest.set_node(pos, {name = "default:dirt_with_snow"})
481 minetest.register_node("default:ice", {
483 tiles = {"default_ice.png"},
484 is_ground_content = false,
486 groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1},
487 sounds = default.node_sound_glass_defaults(),
494 minetest.register_node("default:tree", {
495 description = "Tree",
496 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
497 paramtype2 = "facedir",
498 is_ground_content = false,
499 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
500 sounds = default.node_sound_wood_defaults(),
502 on_place = minetest.rotate_node
505 minetest.register_node("default:wood", {
506 description = "Wooden Planks",
507 paramtype2 = "facedir",
509 tiles = {"default_wood.png"},
510 is_ground_content = false,
511 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
512 sounds = default.node_sound_wood_defaults(),
515 minetest.register_node("default:sapling", {
516 description = "Sapling",
517 drawtype = "plantlike",
519 tiles = {"default_sapling.png"},
520 inventory_image = "default_sapling.png",
521 wield_image = "default_sapling.png",
523 sunlight_propagates = true,
525 on_timer = default.grow_sapling,
528 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
530 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
531 attached_node = 1, sapling = 1},
532 sounds = default.node_sound_leaves_defaults(),
534 on_construct = function(pos)
535 minetest.get_node_timer(pos):start(math.random(2400,4800))
538 on_place = function(itemstack, placer, pointed_thing)
539 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
541 -- minp, maxp to be checked, relative to sapling pos
542 -- minp_relative.y = 1 because sapling pos has been checked
543 {x = -2, y = 1, z = -2},
544 {x = 2, y = 6, z = 2},
545 -- maximum interval of interior volume check
552 minetest.register_node("default:leaves", {
553 description = "Leaves",
554 drawtype = "allfaces_optional",
556 tiles = {"default_leaves.png"},
557 special_tiles = {"default_leaves_simple.png"},
559 is_ground_content = false,
560 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
565 -- player will get sapling with 1/20 chance
566 items = {'default:sapling'},
570 -- player will get leaves only if he get no saplings,
571 -- this is because max_items is 1
572 items = {'default:leaves'},
576 sounds = default.node_sound_leaves_defaults(),
578 after_place_node = default.after_place_leaves,
581 minetest.register_node("default:apple", {
582 description = "Apple",
583 drawtype = "plantlike",
585 tiles = {"default_apple.png"},
586 inventory_image = "default_apple.png",
588 sunlight_propagates = true,
590 is_ground_content = false,
593 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
595 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
596 leafdecay = 3, leafdecay_drop = 1},
597 on_use = minetest.item_eat(2),
598 sounds = default.node_sound_leaves_defaults(),
600 after_place_node = function(pos, placer, itemstack)
601 if placer:is_player() then
602 minetest.set_node(pos, {name = "default:apple", param2 = 1})
608 minetest.register_node("default:jungletree", {
609 description = "Jungle Tree",
610 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
611 "default_jungletree.png"},
612 paramtype2 = "facedir",
613 is_ground_content = false,
614 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
615 sounds = default.node_sound_wood_defaults(),
617 on_place = minetest.rotate_node
620 minetest.register_node("default:junglewood", {
621 description = "Junglewood Planks",
622 paramtype2 = "facedir",
624 tiles = {"default_junglewood.png"},
625 is_ground_content = false,
626 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
627 sounds = default.node_sound_wood_defaults(),
630 minetest.register_node("default:jungleleaves", {
631 description = "Jungle Leaves",
632 drawtype = "allfaces_optional",
634 tiles = {"default_jungleleaves.png"},
635 special_tiles = {"default_jungleleaves_simple.png"},
637 is_ground_content = false,
638 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
642 {items = {'default:junglesapling'}, rarity = 20},
643 {items = {'default:jungleleaves'}}
646 sounds = default.node_sound_leaves_defaults(),
648 after_place_node = default.after_place_leaves,
651 minetest.register_node("default:junglesapling", {
652 description = "Jungle Sapling",
653 drawtype = "plantlike",
655 tiles = {"default_junglesapling.png"},
656 inventory_image = "default_junglesapling.png",
657 wield_image = "default_junglesapling.png",
659 sunlight_propagates = true,
661 on_timer = default.grow_sapling,
664 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
666 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
667 attached_node = 1, sapling = 1},
668 sounds = default.node_sound_leaves_defaults(),
670 on_construct = function(pos)
671 minetest.get_node_timer(pos):start(math.random(2400,4800))
674 on_place = function(itemstack, placer, pointed_thing)
675 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
676 "default:junglesapling",
677 -- minp, maxp to be checked, relative to sapling pos
678 -- minp_relative.y = 1 because sapling pos has been checked
679 {x = -2, y = 1, z = -2},
680 {x = 2, y = 15, z = 2},
681 -- maximum interval of interior volume check
689 minetest.register_node("default:pine_tree", {
690 description = "Pine Tree",
691 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
692 "default_pine_tree.png"},
693 paramtype2 = "facedir",
694 is_ground_content = false,
695 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
696 sounds = default.node_sound_wood_defaults(),
698 on_place = minetest.rotate_node
701 minetest.register_node("default:pine_wood", {
702 description = "Pine Wood Planks",
703 paramtype2 = "facedir",
705 tiles = {"default_pine_wood.png"},
706 is_ground_content = false,
707 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
708 sounds = default.node_sound_wood_defaults(),
711 minetest.register_node("default:pine_needles",{
712 description = "Pine Needles",
713 drawtype = "allfaces_optional",
714 tiles = {"default_pine_needles.png"},
717 is_ground_content = false,
718 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
722 {items = {"default:pine_sapling"}, rarity = 20},
723 {items = {"default:pine_needles"}}
726 sounds = default.node_sound_leaves_defaults(),
728 after_place_node = default.after_place_leaves,
731 minetest.register_node("default:pine_sapling", {
732 description = "Pine Sapling",
733 drawtype = "plantlike",
735 tiles = {"default_pine_sapling.png"},
736 inventory_image = "default_pine_sapling.png",
737 wield_image = "default_pine_sapling.png",
739 sunlight_propagates = true,
741 on_timer = default.grow_sapling,
744 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
746 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
747 attached_node = 1, sapling = 1},
748 sounds = default.node_sound_leaves_defaults(),
750 on_construct = function(pos)
751 minetest.get_node_timer(pos):start(math.random(2400,4800))
754 on_place = function(itemstack, placer, pointed_thing)
755 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
756 "default:pine_sapling",
757 -- minp, maxp to be checked, relative to sapling pos
758 -- minp_relative.y = 1 because sapling pos has been checked
759 {x = -2, y = 1, z = -2},
760 {x = 2, y = 12, z = 2},
761 -- maximum interval of interior volume check
769 minetest.register_node("default:acacia_tree", {
770 description = "Acacia Tree",
771 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
772 "default_acacia_tree.png"},
773 paramtype2 = "facedir",
774 is_ground_content = false,
775 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
776 sounds = default.node_sound_wood_defaults(),
778 on_place = minetest.rotate_node
781 minetest.register_node("default:acacia_wood", {
782 description = "Acacia Wood Planks",
783 paramtype2 = "facedir",
785 tiles = {"default_acacia_wood.png"},
786 is_ground_content = false,
787 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
788 sounds = default.node_sound_wood_defaults(),
791 minetest.register_node("default:acacia_leaves", {
792 description = "Acacia Leaves",
793 drawtype = "allfaces_optional",
794 tiles = {"default_acacia_leaves.png"},
795 special_tiles = {"default_acacia_leaves_simple.png"},
798 is_ground_content = false,
799 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
803 {items = {"default:acacia_sapling"}, rarity = 20},
804 {items = {"default:acacia_leaves"}}
807 sounds = default.node_sound_leaves_defaults(),
809 after_place_node = default.after_place_leaves,
812 minetest.register_node("default:acacia_sapling", {
813 description = "Acacia Tree Sapling",
814 drawtype = "plantlike",
816 tiles = {"default_acacia_sapling.png"},
817 inventory_image = "default_acacia_sapling.png",
818 wield_image = "default_acacia_sapling.png",
820 sunlight_propagates = true,
822 on_timer = default.grow_sapling,
825 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
827 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
828 attached_node = 1, sapling = 1},
829 sounds = default.node_sound_leaves_defaults(),
831 on_construct = function(pos)
832 minetest.get_node_timer(pos):start(math.random(2400,4800))
835 on_place = function(itemstack, placer, pointed_thing)
836 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
837 "default:acacia_sapling",
838 -- minp, maxp to be checked, relative to sapling pos
839 -- minp_relative.y = 1 because sapling pos has been checked
840 {x = -4, y = 1, z = -4},
841 {x = 4, y = 6, z = 4},
842 -- maximum interval of interior volume check
849 minetest.register_node("default:aspen_tree", {
850 description = "Aspen Tree",
851 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
852 "default_aspen_tree.png"},
853 paramtype2 = "facedir",
854 is_ground_content = false,
855 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
856 sounds = default.node_sound_wood_defaults(),
858 on_place = minetest.rotate_node
861 minetest.register_node("default:aspen_wood", {
862 description = "Aspen Wood Planks",
863 paramtype2 = "facedir",
865 tiles = {"default_aspen_wood.png"},
866 is_ground_content = false,
867 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
868 sounds = default.node_sound_wood_defaults(),
871 minetest.register_node("default:aspen_leaves", {
872 description = "Aspen Leaves",
873 drawtype = "allfaces_optional",
874 tiles = {"default_aspen_leaves.png"},
877 is_ground_content = false,
878 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
882 {items = {"default:aspen_sapling"}, rarity = 20},
883 {items = {"default:aspen_leaves"}}
886 sounds = default.node_sound_leaves_defaults(),
888 after_place_node = default.after_place_leaves,
891 minetest.register_node("default:aspen_sapling", {
892 description = "Aspen Tree Sapling",
893 drawtype = "plantlike",
895 tiles = {"default_aspen_sapling.png"},
896 inventory_image = "default_aspen_sapling.png",
897 wield_image = "default_aspen_sapling.png",
899 sunlight_propagates = true,
901 on_timer = default.grow_sapling,
904 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
906 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
907 attached_node = 1, sapling = 1},
908 sounds = default.node_sound_leaves_defaults(),
910 on_construct = function(pos)
911 minetest.get_node_timer(pos):start(math.random(2400,4800))
914 on_place = function(itemstack, placer, pointed_thing)
915 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
916 "default:aspen_sapling",
917 -- minp, maxp to be checked, relative to sapling pos
918 -- minp_relative.y = 1 because sapling pos has been checked
919 {x = -2, y = 1, z = -2},
920 {x = 2, y = 12, z = 2},
921 -- maximum interval of interior volume check
932 minetest.register_node("default:stone_with_coal", {
933 description = "Coal Ore",
934 tiles = {"default_stone.png^default_mineral_coal.png"},
935 groups = {cracky = 3},
936 drop = 'default:coal_lump',
937 sounds = default.node_sound_stone_defaults(),
940 minetest.register_node("default:coalblock", {
941 description = "Coal Block",
942 tiles = {"default_coal_block.png"},
943 is_ground_content = false,
944 groups = {cracky = 3},
945 sounds = default.node_sound_stone_defaults(),
949 minetest.register_node("default:stone_with_iron", {
950 description = "Iron Ore",
951 tiles = {"default_stone.png^default_mineral_iron.png"},
952 groups = {cracky = 2},
953 drop = 'default:iron_lump',
954 sounds = default.node_sound_stone_defaults(),
957 minetest.register_node("default:steelblock", {
958 description = "Steel Block",
959 tiles = {"default_steel_block.png"},
960 is_ground_content = false,
961 groups = {cracky = 1, level = 2},
962 sounds = default.node_sound_metal_defaults(),
966 minetest.register_node("default:stone_with_copper", {
967 description = "Copper Ore",
968 tiles = {"default_stone.png^default_mineral_copper.png"},
969 groups = {cracky = 2},
970 drop = 'default:copper_lump',
971 sounds = default.node_sound_stone_defaults(),
974 minetest.register_node("default:copperblock", {
975 description = "Copper Block",
976 tiles = {"default_copper_block.png"},
977 is_ground_content = false,
978 groups = {cracky = 1, level = 2},
979 sounds = default.node_sound_metal_defaults(),
982 minetest.register_node("default:bronzeblock", {
983 description = "Bronze Block",
984 tiles = {"default_bronze_block.png"},
985 is_ground_content = false,
986 groups = {cracky = 1, level = 2},
987 sounds = default.node_sound_metal_defaults(),
991 minetest.register_node("default:stone_with_mese", {
992 description = "Mese Ore",
993 tiles = {"default_stone.png^default_mineral_mese.png"},
994 groups = {cracky = 1},
995 drop = "default:mese_crystal",
996 sounds = default.node_sound_stone_defaults(),
999 minetest.register_node("default:mese", {
1000 description = "Mese Block",
1001 tiles = {"default_mese_block.png"},
1002 paramtype = "light",
1003 groups = {cracky = 1, level = 2},
1004 sounds = default.node_sound_stone_defaults(),
1009 minetest.register_node("default:stone_with_gold", {
1010 description = "Gold Ore",
1011 tiles = {"default_stone.png^default_mineral_gold.png"},
1012 groups = {cracky = 2},
1013 drop = "default:gold_lump",
1014 sounds = default.node_sound_stone_defaults(),
1017 minetest.register_node("default:goldblock", {
1018 description = "Gold Block",
1019 tiles = {"default_gold_block.png"},
1020 is_ground_content = false,
1021 groups = {cracky = 1},
1022 sounds = default.node_sound_metal_defaults(),
1026 minetest.register_node("default:stone_with_diamond", {
1027 description = "Diamond Ore",
1028 tiles = {"default_stone.png^default_mineral_diamond.png"},
1029 groups = {cracky = 1},
1030 drop = "default:diamond",
1031 sounds = default.node_sound_stone_defaults(),
1034 minetest.register_node("default:diamondblock", {
1035 description = "Diamond Block",
1036 tiles = {"default_diamond_block.png"},
1037 is_ground_content = false,
1038 groups = {cracky = 1, level = 3},
1039 sounds = default.node_sound_stone_defaults(),
1043 -- Plantlife (non-cubic)
1046 minetest.register_node("default:cactus", {
1047 description = "Cactus",
1048 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1049 "default_cactus_side.png"},
1050 paramtype2 = "facedir",
1051 groups = {choppy = 3},
1052 sounds = default.node_sound_wood_defaults(),
1053 on_place = minetest.rotate_node,
1056 minetest.register_node("default:papyrus", {
1057 description = "Papyrus",
1058 drawtype = "plantlike",
1059 tiles = {"default_papyrus.png"},
1060 inventory_image = "default_papyrus.png",
1061 wield_image = "default_papyrus.png",
1062 paramtype = "light",
1063 sunlight_propagates = true,
1067 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1069 groups = {snappy = 3, flammable = 2},
1070 sounds = default.node_sound_leaves_defaults(),
1072 after_dig_node = function(pos, node, metadata, digger)
1073 default.dig_up(pos, node, digger)
1077 minetest.register_node("default:dry_shrub", {
1078 description = "Dry Shrub",
1079 drawtype = "plantlike",
1082 tiles = {"default_dry_shrub.png"},
1083 inventory_image = "default_dry_shrub.png",
1084 wield_image = "default_dry_shrub.png",
1085 paramtype = "light",
1086 sunlight_propagates = true,
1088 buildable_to = true,
1089 groups = {snappy = 3, flammable = 3, attached_node = 1},
1090 sounds = default.node_sound_leaves_defaults(),
1093 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1097 minetest.register_node("default:junglegrass", {
1098 description = "Jungle Grass",
1099 drawtype = "plantlike",
1102 tiles = {"default_junglegrass.png"},
1103 inventory_image = "default_junglegrass.png",
1104 wield_image = "default_junglegrass.png",
1105 paramtype = "light",
1106 sunlight_propagates = true,
1108 buildable_to = true,
1109 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1110 sounds = default.node_sound_leaves_defaults(),
1113 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1118 minetest.register_node("default:grass_1", {
1119 description = "Grass",
1120 drawtype = "plantlike",
1122 tiles = {"default_grass_1.png"},
1123 -- Use texture of a taller grass stage in inventory
1124 inventory_image = "default_grass_3.png",
1125 wield_image = "default_grass_3.png",
1126 paramtype = "light",
1127 sunlight_propagates = true,
1129 buildable_to = true,
1130 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1131 sounds = default.node_sound_leaves_defaults(),
1134 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1137 on_place = function(itemstack, placer, pointed_thing)
1138 -- place a random grass node
1139 local stack = ItemStack("default:grass_" .. math.random(1,5))
1140 local ret = minetest.item_place(stack, placer, pointed_thing)
1141 return ItemStack("default:grass_1 " ..
1142 itemstack:get_count() - (1 - ret:get_count()))
1147 minetest.register_node("default:grass_" .. i, {
1148 description = "Grass",
1149 drawtype = "plantlike",
1151 tiles = {"default_grass_" .. i .. ".png"},
1152 inventory_image = "default_grass_" .. i .. ".png",
1153 wield_image = "default_grass_" .. i .. ".png",
1154 paramtype = "light",
1155 sunlight_propagates = true,
1157 buildable_to = true,
1158 drop = "default:grass_1",
1159 groups = {snappy = 3, flora = 1, attached_node = 1,
1160 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1161 sounds = default.node_sound_leaves_defaults(),
1164 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1170 minetest.register_node("default:dry_grass_1", {
1171 description = "Dry Grass",
1172 drawtype = "plantlike",
1174 tiles = {"default_dry_grass_1.png"},
1175 inventory_image = "default_dry_grass_3.png",
1176 wield_image = "default_dry_grass_3.png",
1177 paramtype = "light",
1178 sunlight_propagates = true,
1180 buildable_to = true,
1181 groups = {snappy = 3, flammable = 3, flora = 1,
1182 attached_node = 1, dry_grass = 1},
1183 sounds = default.node_sound_leaves_defaults(),
1186 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1189 on_place = function(itemstack, placer, pointed_thing)
1190 -- place a random dry grass node
1191 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1192 local ret = minetest.item_place(stack, placer, pointed_thing)
1193 return ItemStack("default:dry_grass_1 " ..
1194 itemstack:get_count() - (1 - ret:get_count()))
1199 minetest.register_node("default:dry_grass_" .. i, {
1200 description = "Dry Grass",
1201 drawtype = "plantlike",
1203 tiles = {"default_dry_grass_" .. i .. ".png"},
1204 inventory_image = "default_dry_grass_" .. i .. ".png",
1205 wield_image = "default_dry_grass_" .. i .. ".png",
1206 paramtype = "light",
1207 sunlight_propagates = true,
1209 buildable_to = true,
1210 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1211 not_in_creative_inventory=1, dry_grass = 1},
1212 drop = "default:dry_grass_1",
1213 sounds = default.node_sound_leaves_defaults(),
1216 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1222 minetest.register_node("default:bush_stem", {
1223 description = "Bush Stem",
1224 drawtype = "plantlike",
1225 visual_scale = 1.18,
1226 tiles = {"default_bush_stem.png"},
1227 inventory_image = "default_bush_stem.png",
1228 wield_image = "default_bush_stem.png",
1229 paramtype = "light",
1230 sunlight_propagates = true,
1231 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1232 sounds = default.node_sound_wood_defaults(),
1235 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1239 minetest.register_node("default:bush_leaves", {
1240 description = "Bush Leaves",
1241 drawtype = "allfaces_optional",
1243 tiles = {"default_leaves_simple.png"},
1244 paramtype = "light",
1245 groups = {snappy = 3, flammable = 2, leaves = 1},
1246 sounds = default.node_sound_leaves_defaults(),
1249 minetest.register_node("default:acacia_bush_stem", {
1250 description = "Acacia Bush Stem",
1251 drawtype = "plantlike",
1252 visual_scale = 1.18,
1253 tiles = {"default_acacia_bush_stem.png"},
1254 inventory_image = "default_acacia_bush_stem.png",
1255 wield_image = "default_acacia_bush_stem.png",
1256 paramtype = "light",
1257 sunlight_propagates = true,
1258 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1259 sounds = default.node_sound_wood_defaults(),
1262 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1266 minetest.register_node("default:acacia_bush_leaves", {
1267 description = "Acacia Bush Leaves",
1268 drawtype = "allfaces_optional",
1270 tiles = {"default_acacia_leaves_simple.png"},
1271 paramtype = "light",
1272 groups = {snappy = 3, flammable = 2, leaves = 1},
1273 sounds = default.node_sound_leaves_defaults(),
1281 minetest.register_node("default:coral_brown", {
1282 description = "Brown Coral",
1283 tiles = {"default_coral_brown.png"},
1284 groups = {cracky = 3},
1285 drop = "default:coral_skeleton",
1286 sounds = default.node_sound_stone_defaults(),
1289 minetest.register_node("default:coral_orange", {
1290 description = "Orange Coral",
1291 tiles = {"default_coral_orange.png"},
1292 groups = {cracky = 3},
1293 drop = "default:coral_skeleton",
1294 sounds = default.node_sound_stone_defaults(),
1297 minetest.register_node("default:coral_skeleton", {
1298 description = "Coral Skeleton",
1299 tiles = {"default_coral_skeleton.png"},
1300 groups = {cracky = 3},
1301 sounds = default.node_sound_stone_defaults(),
1309 minetest.register_node("default:water_source", {
1310 description = "Water Source",
1311 drawtype = "liquid",
1314 name = "default_water_source_animated.png",
1316 type = "vertical_frames",
1324 -- New-style water source material (mostly unused)
1326 name = "default_water_source_animated.png",
1328 type = "vertical_frames",
1333 backface_culling = false,
1337 paramtype = "light",
1341 buildable_to = true,
1342 is_ground_content = false,
1345 liquidtype = "source",
1346 liquid_alternative_flowing = "default:water_flowing",
1347 liquid_alternative_source = "default:water_source",
1348 liquid_viscosity = 1,
1349 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1350 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1351 sounds = default.node_sound_water_defaults(),
1354 minetest.register_node("default:water_flowing", {
1355 description = "Flowing Water",
1356 drawtype = "flowingliquid",
1357 tiles = {"default_water.png"},
1360 name = "default_water_flowing_animated.png",
1361 backface_culling = false,
1363 type = "vertical_frames",
1370 name = "default_water_flowing_animated.png",
1371 backface_culling = true,
1373 type = "vertical_frames",
1381 paramtype = "light",
1382 paramtype2 = "flowingliquid",
1386 buildable_to = true,
1387 is_ground_content = false,
1390 liquidtype = "flowing",
1391 liquid_alternative_flowing = "default:water_flowing",
1392 liquid_alternative_source = "default:water_source",
1393 liquid_viscosity = 1,
1394 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1395 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1396 not_in_creative_inventory = 1, cools_lava = 1},
1397 sounds = default.node_sound_water_defaults(),
1401 minetest.register_node("default:river_water_source", {
1402 description = "River Water Source",
1403 drawtype = "liquid",
1406 name = "default_river_water_source_animated.png",
1408 type = "vertical_frames",
1417 name = "default_river_water_source_animated.png",
1419 type = "vertical_frames",
1424 backface_culling = false,
1428 paramtype = "light",
1432 buildable_to = true,
1433 is_ground_content = false,
1436 liquidtype = "source",
1437 liquid_alternative_flowing = "default:river_water_flowing",
1438 liquid_alternative_source = "default:river_water_source",
1439 liquid_viscosity = 1,
1440 liquid_renewable = false,
1442 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1443 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1444 sounds = default.node_sound_water_defaults(),
1447 minetest.register_node("default:river_water_flowing", {
1448 description = "Flowing River Water",
1449 drawtype = "flowingliquid",
1450 tiles = {"default_river_water.png"},
1453 name = "default_river_water_flowing_animated.png",
1454 backface_culling = false,
1456 type = "vertical_frames",
1463 name = "default_river_water_flowing_animated.png",
1464 backface_culling = true,
1466 type = "vertical_frames",
1474 paramtype = "light",
1475 paramtype2 = "flowingliquid",
1479 buildable_to = true,
1480 is_ground_content = false,
1483 liquidtype = "flowing",
1484 liquid_alternative_flowing = "default:river_water_flowing",
1485 liquid_alternative_source = "default:river_water_source",
1486 liquid_viscosity = 1,
1487 liquid_renewable = false,
1489 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1490 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1491 not_in_creative_inventory = 1, cools_lava = 1},
1492 sounds = default.node_sound_water_defaults(),
1496 minetest.register_node("default:lava_source", {
1497 description = "Lava Source",
1498 drawtype = "liquid",
1501 name = "default_lava_source_animated.png",
1503 type = "vertical_frames",
1511 -- New-style lava source material (mostly unused)
1513 name = "default_lava_source_animated.png",
1515 type = "vertical_frames",
1520 backface_culling = false,
1523 paramtype = "light",
1524 light_source = default.LIGHT_MAX - 1,
1528 buildable_to = true,
1529 is_ground_content = false,
1532 liquidtype = "source",
1533 liquid_alternative_flowing = "default:lava_flowing",
1534 liquid_alternative_source = "default:lava_source",
1535 liquid_viscosity = 7,
1536 liquid_renewable = false,
1537 damage_per_second = 4 * 2,
1538 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1539 groups = {lava = 3, liquid = 2, igniter = 1},
1542 minetest.register_node("default:lava_flowing", {
1543 description = "Flowing Lava",
1544 drawtype = "flowingliquid",
1545 tiles = {"default_lava.png"},
1548 name = "default_lava_flowing_animated.png",
1549 backface_culling = false,
1551 type = "vertical_frames",
1558 name = "default_lava_flowing_animated.png",
1559 backface_culling = true,
1561 type = "vertical_frames",
1568 paramtype = "light",
1569 paramtype2 = "flowingliquid",
1570 light_source = default.LIGHT_MAX - 1,
1574 buildable_to = true,
1575 is_ground_content = false,
1578 liquidtype = "flowing",
1579 liquid_alternative_flowing = "default:lava_flowing",
1580 liquid_alternative_source = "default:lava_source",
1581 liquid_viscosity = 7,
1582 liquid_renewable = false,
1583 damage_per_second = 4 * 2,
1584 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1585 groups = {lava = 3, liquid = 2, igniter = 1,
1586 not_in_creative_inventory = 1},
1590 -- Tools / "Advanced" crafting / Non-"natural"
1593 local chest_formspec =
1596 default.gui_bg_img ..
1597 default.gui_slots ..
1598 "list[current_name;main;0,0.3;8,4;]" ..
1599 "list[current_player;main;0,4.85;8,1;]" ..
1600 "list[current_player;main;0,6.08;8,3;8]" ..
1601 "listring[current_name;main]" ..
1602 "listring[current_player;main]" ..
1603 default.get_hotbar_bg(0,4.85)
1605 local function get_locked_chest_formspec(pos)
1606 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1610 default.gui_bg_img ..
1611 default.gui_slots ..
1612 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1613 "list[current_player;main;0,4.85;8,1;]" ..
1614 "list[current_player;main;0,6.08;8,3;8]" ..
1615 "listring[nodemeta:" .. spos .. ";main]" ..
1616 "listring[current_player;main]" ..
1617 default.get_hotbar_bg(0,4.85)
1621 local function has_locked_chest_privilege(meta, player)
1623 if minetest.check_player_privs(player, "protection_bypass") then
1630 -- is player wielding the right key?
1631 local item = player:get_wielded_item()
1632 if item:get_name() == "default:key" then
1633 local key_meta = minetest.parse_json(item:get_metadata())
1634 local secret = meta:get_string("key_lock_secret")
1635 if secret ~= key_meta.secret then
1642 if player:get_player_name() ~= meta:get_string("owner") then
1649 minetest.register_node("default:chest", {
1650 description = "Chest",
1651 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1652 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1653 paramtype2 = "facedir",
1654 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1655 legacy_facedir_simple = true,
1656 is_ground_content = false,
1657 sounds = default.node_sound_wood_defaults(),
1659 on_construct = function(pos)
1660 local meta = minetest.get_meta(pos)
1661 meta:set_string("formspec", chest_formspec)
1662 local inv = meta:get_inventory()
1663 inv:set_size("main", 8*4)
1665 can_dig = function(pos,player)
1666 local meta = minetest.get_meta(pos);
1667 local inv = meta:get_inventory()
1668 return inv:is_empty("main")
1670 on_metadata_inventory_move = function(pos, from_list, from_index,
1671 to_list, to_index, count, player)
1672 minetest.log("action", player:get_player_name() ..
1673 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1675 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1676 minetest.log("action", player:get_player_name() ..
1677 " moves " .. stack:get_name() ..
1678 " to chest at " .. minetest.pos_to_string(pos))
1680 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1681 minetest.log("action", player:get_player_name() ..
1682 " takes " .. stack:get_name() ..
1683 " from chest at " .. minetest.pos_to_string(pos))
1685 on_blast = function(pos)
1687 default.get_inventory_drops(pos, "main", drops)
1688 drops[#drops+1] = "default:chest"
1689 minetest.remove_node(pos)
1694 minetest.register_node("default:chest_locked", {
1695 description = "Locked Chest",
1696 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1697 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1698 paramtype2 = "facedir",
1699 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1700 legacy_facedir_simple = true,
1701 is_ground_content = false,
1702 sounds = default.node_sound_wood_defaults(),
1704 after_place_node = function(pos, placer)
1705 local meta = minetest.get_meta(pos)
1706 meta:set_string("owner", placer:get_player_name() or "")
1707 meta:set_string("infotext", "Locked Chest (owned by " ..
1708 meta:get_string("owner") .. ")")
1710 on_construct = function(pos)
1711 local meta = minetest.get_meta(pos)
1712 meta:set_string("owner", "")
1713 local inv = meta:get_inventory()
1714 inv:set_size("main", 8 * 4)
1716 can_dig = function(pos,player)
1717 local meta = minetest.get_meta(pos);
1718 local inv = meta:get_inventory()
1719 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1721 allow_metadata_inventory_move = function(pos, from_list, from_index,
1722 to_list, to_index, count, player)
1723 local meta = minetest.get_meta(pos)
1724 if not has_locked_chest_privilege(meta, player) then
1729 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1730 local meta = minetest.get_meta(pos)
1731 if not has_locked_chest_privilege(meta, player) then
1734 return stack:get_count()
1736 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1737 local meta = minetest.get_meta(pos)
1738 if not has_locked_chest_privilege(meta, player) then
1741 return stack:get_count()
1743 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1744 minetest.log("action", player:get_player_name() ..
1745 " moves " .. stack:get_name() ..
1746 " to locked chest at " .. minetest.pos_to_string(pos))
1748 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1749 minetest.log("action", player:get_player_name() ..
1750 " takes " .. stack:get_name() ..
1751 " from locked chest at " .. minetest.pos_to_string(pos))
1753 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1754 local meta = minetest.get_meta(pos)
1755 if has_locked_chest_privilege(meta, clicker) then
1756 minetest.show_formspec(
1757 clicker:get_player_name(),
1758 "default:chest_locked",
1759 get_locked_chest_formspec(pos)
1764 on_blast = function() end,
1765 on_key_use = function(pos, player)
1766 local secret = minetest.get_meta(pos):get_string("key_lock_secret")
1767 local itemstack = player:get_wielded_item()
1768 local key_meta = minetest.parse_json(itemstack:get_metadata())
1770 if secret ~= key_meta.secret then
1774 minetest.show_formspec(
1775 player:get_player_name(),
1776 "default:chest_locked",
1777 get_locked_chest_formspec(pos)
1780 on_skeleton_key_use = function(pos, player, newsecret)
1781 local meta = minetest.get_meta(pos)
1782 local owner = meta:get_string("owner")
1783 local name = player:get_player_name()
1785 -- verify placer is owner of lockable chest
1786 if owner ~= name then
1787 minetest.record_protection_violation(pos, name)
1788 minetest.chat_send_player(name, "You do not own this chest.")
1792 local secret = meta:get_string("key_lock_secret")
1793 if secret == "" then
1795 meta:set_string("key_lock_secret", secret)
1798 return secret, "a locked chest", owner
1803 local bookshelf_formspec =
1806 default.gui_bg_img ..
1807 default.gui_slots ..
1808 "list[context;books;0,0.3;8,2;]" ..
1809 "list[current_player;main;0,2.85;8,1;]" ..
1810 "list[current_player;main;0,4.08;8,3;8]" ..
1811 "listring[context;books]" ..
1812 "listring[current_player;main]" ..
1813 default.get_hotbar_bg(0,2.85)
1815 local function get_bookshelf_formspec(inv)
1816 local formspec = bookshelf_formspec
1817 local invlist = inv and inv:get_list("books")
1818 -- Inventory slots overlay
1819 local bx, by = 0, 0.3
1825 if not invlist or invlist[i]:is_empty() then
1826 formspec = formspec ..
1827 "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
1834 minetest.register_node("default:bookshelf", {
1835 description = "Bookshelf",
1836 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1837 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1838 paramtype2 = "facedir",
1839 is_ground_content = false,
1840 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1841 sounds = default.node_sound_wood_defaults(),
1843 on_construct = function(pos)
1844 local meta = minetest.get_meta(pos)
1845 meta:set_string("formspec", get_bookshelf_formspec(nil))
1846 local inv = meta:get_inventory()
1847 inv:set_size("books", 8 * 2)
1849 can_dig = function(pos,player)
1850 local inv = minetest.get_meta(pos):get_inventory()
1851 return inv:is_empty("books")
1853 allow_metadata_inventory_put = function(pos, listname, index, stack)
1854 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1855 return stack:get_count()
1859 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1860 minetest.log("action", player:get_player_name() ..
1861 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1862 local meta = minetest.get_meta(pos)
1863 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1865 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1866 minetest.log("action", player:get_player_name() ..
1867 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1868 local meta = minetest.get_meta(pos)
1869 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1871 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1872 minetest.log("action", player:get_player_name() ..
1873 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1874 local meta = minetest.get_meta(pos)
1875 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1877 on_blast = function(pos)
1879 default.get_inventory_drops(pos, "books", drops)
1880 drops[#drops+1] = "default:bookshelf"
1881 minetest.remove_node(pos)
1886 local function register_sign(material, desc, def)
1887 minetest.register_node("default:sign_wall_" .. material, {
1888 description = desc .. " Sign",
1889 drawtype = "nodebox",
1890 tiles = {"default_sign_wall_" .. material .. ".png"},
1891 inventory_image = "default_sign_" .. material .. ".png",
1892 wield_image = "default_sign_" .. material .. ".png",
1893 paramtype = "light",
1894 paramtype2 = "wallmounted",
1895 sunlight_propagates = true,
1896 is_ground_content = false,
1899 type = "wallmounted",
1900 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1901 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1902 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1904 groups = def.groups,
1905 legacy_wallmounted = true,
1906 sounds = def.sounds,
1908 on_construct = function(pos)
1909 --local n = minetest.get_node(pos)
1910 local meta = minetest.get_meta(pos)
1911 meta:set_string("formspec", "field[text;;${text}]")
1913 on_receive_fields = function(pos, formname, fields, sender)
1914 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1915 local player_name = sender:get_player_name()
1916 if minetest.is_protected(pos, player_name) then
1917 minetest.record_protection_violation(pos, player_name)
1920 local meta = minetest.get_meta(pos)
1921 if not fields.text then return end
1922 minetest.log("action", (player_name or "") .. " wrote \"" ..
1923 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1924 meta:set_string("text", fields.text)
1925 meta:set_string("infotext", '"' .. fields.text .. '"')
1930 register_sign("wood", "Wooden", {
1931 sounds = default.node_sound_wood_defaults(),
1932 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1935 register_sign("steel", "Steel", {
1936 sounds = default.node_sound_metal_defaults(),
1937 groups = {cracky = 2, attached_node = 1}
1940 minetest.register_node("default:ladder_wood", {
1941 description = "Wooden Ladder",
1942 drawtype = "signlike",
1943 tiles = {"default_ladder_wood.png"},
1944 inventory_image = "default_ladder_wood.png",
1945 wield_image = "default_ladder_wood.png",
1946 paramtype = "light",
1947 paramtype2 = "wallmounted",
1948 sunlight_propagates = true,
1951 is_ground_content = false,
1953 type = "wallmounted",
1954 --wall_top = = <default>
1955 --wall_bottom = = <default>
1956 --wall_side = = <default>
1958 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1959 legacy_wallmounted = true,
1960 sounds = default.node_sound_wood_defaults(),
1963 minetest.register_node("default:ladder_steel", {
1964 description = "Steel Ladder",
1965 drawtype = "signlike",
1966 tiles = {"default_ladder_steel.png"},
1967 inventory_image = "default_ladder_steel.png",
1968 wield_image = "default_ladder_steel.png",
1969 paramtype = "light",
1970 paramtype2 = "wallmounted",
1971 sunlight_propagates = true,
1974 is_ground_content = false,
1976 type = "wallmounted",
1977 --wall_top = = <default>
1978 --wall_bottom = = <default>
1979 --wall_side = = <default>
1981 groups = {cracky = 2},
1982 sounds = default.node_sound_metal_defaults(),
1985 default.register_fence("default:fence_wood", {
1986 description = "Wooden Fence",
1987 texture = "default_fence_wood.png",
1988 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1989 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1990 material = "default:wood",
1991 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
1992 sounds = default.node_sound_wood_defaults()
1995 default.register_fence("default:fence_acacia_wood", {
1996 description = "Acacia Fence",
1997 texture = "default_fence_acacia_wood.png",
1998 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
1999 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2000 material = "default:acacia_wood",
2001 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2002 sounds = default.node_sound_wood_defaults()
2005 default.register_fence("default:fence_junglewood", {
2006 description = "Junglewood Fence",
2007 texture = "default_fence_junglewood.png",
2008 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2009 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2010 material = "default:junglewood",
2011 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2012 sounds = default.node_sound_wood_defaults()
2015 default.register_fence("default:fence_pine_wood", {
2016 description = "Pine Fence",
2017 texture = "default_fence_pine_wood.png",
2018 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2019 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2020 material = "default:pine_wood",
2021 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2022 sounds = default.node_sound_wood_defaults()
2025 default.register_fence("default:fence_aspen_wood", {
2026 description = "Aspen Fence",
2027 texture = "default_fence_aspen_wood.png",
2028 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2029 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2030 material = "default:aspen_wood",
2031 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2032 sounds = default.node_sound_wood_defaults()
2035 minetest.register_node("default:glass", {
2036 description = "Glass",
2037 drawtype = "glasslike_framed_optional",
2038 tiles = {"default_glass.png", "default_glass_detail.png"},
2039 paramtype = "light",
2040 sunlight_propagates = true,
2041 is_ground_content = false,
2042 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2043 sounds = default.node_sound_glass_defaults(),
2046 minetest.register_node("default:obsidian_glass", {
2047 description = "Obsidian Glass",
2048 drawtype = "glasslike_framed_optional",
2049 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2050 paramtype = "light",
2051 is_ground_content = false,
2052 sunlight_propagates = true,
2053 sounds = default.node_sound_glass_defaults(),
2054 groups = {cracky = 3},
2058 minetest.register_node("default:brick", {
2059 description = "Brick Block",
2060 paramtype2 = "facedir",
2062 tiles = {"default_brick.png"},
2063 is_ground_content = false,
2064 groups = {cracky = 3},
2065 sounds = default.node_sound_stone_defaults(),
2069 minetest.register_node("default:meselamp", {
2070 description = "Mese Lamp",
2071 drawtype = "glasslike",
2072 tiles = {"default_meselamp.png"},
2073 paramtype = "light",
2074 sunlight_propagates = true,
2075 is_ground_content = false,
2076 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2077 sounds = default.node_sound_glass_defaults(),
2078 light_source = default.LIGHT_MAX,
2085 minetest.register_node("default:cloud", {
2086 description = "Cloud",
2087 tiles = {"default_cloud.png"},
2088 is_ground_content = false,
2089 sounds = default.node_sound_defaults(),
2090 groups = {not_in_creative_inventory = 1},