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
33 default:desert_sandstone
34 default:desert_sandstone_brick
35 default:desert_sandstone_block
36 default:silver_sandstone
37 default:silver_sandstone_brick
38 default:silver_sandstone_block
42 default:obsidian_block
46 (1. Material 2. Modified forms)
49 default:dirt_with_grass
50 default:dirt_with_grass_footsteps
51 default:dirt_with_dry_grass
52 default:dirt_with_snow
53 default:dirt_with_rainforest_litter
70 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
91 default:acacia_sapling
100 (1. In stone 2. Blocks)
102 default:stone_with_coal
105 default:stone_with_iron
108 default:stone_with_copper
112 default:stone_with_gold
115 default:stone_with_mese
118 default:stone_with_diamond
143 default:acacia_bush_stem
144 default:acacia_bush_leaves
151 default:coral_skeleton
155 (1. Source 2. Flowing)
158 default:water_flowing
160 default:river_water_source
161 default:river_water_flowing
166 Tools / "Advanced" crafting / Non-"natural"
167 -------------------------------------------
174 default:sign_wall_wood
175 default:sign_wall_steel
181 default:fence_acacia_wood
182 default:fence_junglewood
183 default:fence_pine_wood
184 default:fence_aspen_wood
187 default:obsidian_glass
192 default:mese_post_light
205 minetest.register_node("default:stone", {
206 description = "Stone",
207 tiles = {"default_stone.png"},
208 groups = {cracky = 3, stone = 1},
209 drop = 'default:cobble',
210 legacy_mineral = true,
211 sounds = default.node_sound_stone_defaults(),
214 minetest.register_node("default:cobble", {
215 description = "Cobblestone",
216 tiles = {"default_cobble.png"},
217 is_ground_content = false,
218 groups = {cracky = 3, stone = 2},
219 sounds = default.node_sound_stone_defaults(),
222 minetest.register_node("default:stonebrick", {
223 description = "Stone Brick",
224 paramtype2 = "facedir",
226 tiles = {"default_stone_brick.png"},
227 is_ground_content = false,
228 groups = {cracky = 2, stone = 1},
229 sounds = default.node_sound_stone_defaults(),
232 minetest.register_node("default:stone_block", {
233 description = "Stone Block",
234 tiles = {"default_stone_block.png"},
235 is_ground_content = false,
236 groups = {cracky = 2, stone = 1},
237 sounds = default.node_sound_stone_defaults(),
240 minetest.register_node("default:mossycobble", {
241 description = "Mossy Cobblestone",
242 tiles = {"default_mossycobble.png"},
243 is_ground_content = false,
244 groups = {cracky = 3, stone = 1},
245 sounds = default.node_sound_stone_defaults(),
249 minetest.register_node("default:desert_stone", {
250 description = "Desert Stone",
251 tiles = {"default_desert_stone.png"},
252 groups = {cracky = 3, stone = 1},
253 drop = 'default:desert_cobble',
254 legacy_mineral = true,
255 sounds = default.node_sound_stone_defaults(),
258 minetest.register_node("default:desert_cobble", {
259 description = "Desert Cobblestone",
260 tiles = {"default_desert_cobble.png"},
261 is_ground_content = false,
262 groups = {cracky = 3, stone = 2},
263 sounds = default.node_sound_stone_defaults(),
266 minetest.register_node("default:desert_stonebrick", {
267 description = "Desert Stone Brick",
268 paramtype2 = "facedir",
270 tiles = {"default_desert_stone_brick.png"},
271 is_ground_content = false,
272 groups = {cracky = 2, stone = 1},
273 sounds = default.node_sound_stone_defaults(),
276 minetest.register_node("default:desert_stone_block", {
277 description = "Desert Stone Block",
278 tiles = {"default_desert_stone_block.png"},
279 is_ground_content = false,
280 groups = {cracky = 2, stone = 1},
281 sounds = default.node_sound_stone_defaults(),
284 minetest.register_node("default:sandstone", {
285 description = "Sandstone",
286 tiles = {"default_sandstone.png"},
287 groups = {crumbly = 1, cracky = 3},
288 sounds = default.node_sound_stone_defaults(),
291 minetest.register_node("default:sandstonebrick", {
292 description = "Sandstone Brick",
293 paramtype2 = "facedir",
295 tiles = {"default_sandstone_brick.png"},
296 is_ground_content = false,
297 groups = {cracky = 2},
298 sounds = default.node_sound_stone_defaults(),
301 minetest.register_node("default:sandstone_block", {
302 description = "Sandstone Block",
303 tiles = {"default_sandstone_block.png"},
304 is_ground_content = false,
305 groups = {cracky = 2},
306 sounds = default.node_sound_stone_defaults(),
309 minetest.register_node("default:desert_sandstone", {
310 description = "Desert Sandstone",
311 tiles = {"default_desert_sandstone.png"},
312 groups = {crumbly = 1, cracky = 3},
313 sounds = default.node_sound_stone_defaults(),
316 minetest.register_node("default:desert_sandstone_brick", {
317 description = "Desert Sandstone Brick",
318 paramtype2 = "facedir",
320 tiles = {"default_desert_sandstone_brick.png"},
321 is_ground_content = false,
322 groups = {cracky = 2},
323 sounds = default.node_sound_stone_defaults(),
326 minetest.register_node("default:desert_sandstone_block", {
327 description = "Desert Sandstone Block",
328 tiles = {"default_desert_sandstone_block.png"},
329 is_ground_content = false,
330 groups = {cracky = 2},
331 sounds = default.node_sound_stone_defaults(),
334 minetest.register_node("default:silver_sandstone", {
335 description = "Silver Sandstone",
336 tiles = {"default_silver_sandstone.png"},
337 groups = {crumbly = 1, cracky = 3},
338 sounds = default.node_sound_stone_defaults(),
341 minetest.register_node("default:silver_sandstone_brick", {
342 description = "Silver Sandstone Brick",
343 paramtype2 = "facedir",
345 tiles = {"default_silver_sandstone_brick.png"},
346 is_ground_content = false,
347 groups = {cracky = 2},
348 sounds = default.node_sound_stone_defaults(),
351 minetest.register_node("default:silver_sandstone_block", {
352 description = "Silver Sandstone Block",
353 tiles = {"default_silver_sandstone_block.png"},
354 is_ground_content = false,
355 groups = {cracky = 2},
356 sounds = default.node_sound_stone_defaults(),
359 minetest.register_node("default:obsidian", {
360 description = "Obsidian",
361 tiles = {"default_obsidian.png"},
362 sounds = default.node_sound_stone_defaults(),
363 groups = {cracky = 1, level = 2},
366 minetest.register_node("default:obsidianbrick", {
367 description = "Obsidian Brick",
368 paramtype2 = "facedir",
370 tiles = {"default_obsidian_brick.png"},
371 is_ground_content = false,
372 sounds = default.node_sound_stone_defaults(),
373 groups = {cracky = 1, level = 2},
376 minetest.register_node("default:obsidian_block", {
377 description = "Obsidian Block",
378 tiles = {"default_obsidian_block.png"},
379 is_ground_content = false,
380 sounds = default.node_sound_stone_defaults(),
381 groups = {cracky = 1, level = 2},
388 minetest.register_node("default:dirt", {
389 description = "Dirt",
390 tiles = {"default_dirt.png"},
391 groups = {crumbly = 3, soil = 1},
392 sounds = default.node_sound_dirt_defaults(),
395 minetest.register_node("default:dirt_with_grass", {
396 description = "Dirt with Grass",
397 tiles = {"default_grass.png", "default_dirt.png",
398 {name = "default_dirt.png^default_grass_side.png",
399 tileable_vertical = false}},
400 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
401 drop = 'default:dirt',
402 sounds = default.node_sound_dirt_defaults({
403 footstep = {name = "default_grass_footstep", gain = 0.25},
407 minetest.register_node("default:dirt_with_grass_footsteps", {
408 description = "Dirt with Grass and Footsteps",
409 tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
410 {name = "default_dirt.png^default_grass_side.png",
411 tileable_vertical = false}},
412 groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
413 drop = 'default:dirt',
414 sounds = default.node_sound_dirt_defaults({
415 footstep = {name = "default_grass_footstep", gain = 0.25},
419 minetest.register_node("default:dirt_with_dry_grass", {
420 description = "Dirt with Dry Grass",
421 tiles = {"default_dry_grass.png",
423 {name = "default_dirt.png^default_dry_grass_side.png",
424 tileable_vertical = false}},
425 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
426 drop = 'default:dirt',
427 sounds = default.node_sound_dirt_defaults({
428 footstep = {name = "default_grass_footstep", gain = 0.4},
432 minetest.register_node("default:dirt_with_snow", {
433 description = "Dirt with Snow",
434 tiles = {"default_snow.png", "default_dirt.png",
435 {name = "default_dirt.png^default_snow_side.png",
436 tileable_vertical = false}},
437 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1},
438 drop = 'default:dirt',
439 sounds = default.node_sound_dirt_defaults({
440 footstep = {name = "default_snow_footstep", gain = 0.15},
444 minetest.register_node("default:dirt_with_rainforest_litter", {
445 description = "Dirt with Rainforest Litter",
447 "default_rainforest_litter.png",
449 {name = "default_dirt.png^default_rainforest_litter_side.png",
450 tileable_vertical = false}
452 groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
453 drop = "default:dirt",
454 sounds = default.node_sound_dirt_defaults({
455 footstep = {name = "default_grass_footstep", gain = 0.4},
459 minetest.register_node("default:sand", {
460 description = "Sand",
461 tiles = {"default_sand.png"},
462 groups = {crumbly = 3, falling_node = 1, sand = 1},
463 sounds = default.node_sound_sand_defaults(),
466 minetest.register_node("default:desert_sand", {
467 description = "Desert Sand",
468 tiles = {"default_desert_sand.png"},
469 groups = {crumbly = 3, falling_node = 1, sand = 1},
470 sounds = default.node_sound_sand_defaults(),
473 minetest.register_node("default:silver_sand", {
474 description = "Silver Sand",
475 tiles = {"default_silver_sand.png"},
476 groups = {crumbly = 3, falling_node = 1, sand = 1},
477 sounds = default.node_sound_sand_defaults(),
481 minetest.register_node("default:gravel", {
482 description = "Gravel",
483 tiles = {"default_gravel.png"},
484 groups = {crumbly = 2, falling_node = 1},
485 sounds = default.node_sound_gravel_defaults(),
489 {items = {'default:flint'}, rarity = 16},
490 {items = {'default:gravel'}}
495 minetest.register_node("default:clay", {
496 description = "Clay",
497 tiles = {"default_clay.png"},
498 groups = {crumbly = 3},
499 drop = 'default:clay_lump 4',
500 sounds = default.node_sound_dirt_defaults(),
504 minetest.register_node("default:snow", {
505 description = "Snow",
506 tiles = {"default_snow.png"},
507 inventory_image = "default_snowball.png",
508 wield_image = "default_snowball.png",
512 drawtype = "nodebox",
516 {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
519 groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1, snowy = 1},
520 sounds = default.node_sound_dirt_defaults({
521 footstep = {name = "default_snow_footstep", gain = 0.15},
522 dug = {name = "default_snow_footstep", gain = 0.2},
523 dig = {name = "default_snow_footstep", gain = 0.2}
526 on_construct = function(pos)
528 if minetest.get_node(pos).name == "default:dirt_with_grass" then
529 minetest.set_node(pos, {name = "default:dirt_with_snow"})
534 minetest.register_node("default:snowblock", {
535 description = "Snow Block",
536 tiles = {"default_snow.png"},
537 groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1},
538 sounds = default.node_sound_dirt_defaults({
539 footstep = {name = "default_snow_footstep", gain = 0.15},
540 dug = {name = "default_snow_footstep", gain = 0.2},
541 dig = {name = "default_snow_footstep", gain = 0.2}
544 on_construct = function(pos)
546 if minetest.get_node(pos).name == "default:dirt_with_grass" then
547 minetest.set_node(pos, {name = "default:dirt_with_snow"})
552 minetest.register_node("default:ice", {
554 tiles = {"default_ice.png"},
555 is_ground_content = false,
557 groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1},
558 sounds = default.node_sound_glass_defaults(),
565 minetest.register_node("default:tree", {
566 description = "Tree",
567 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
568 paramtype2 = "facedir",
569 is_ground_content = false,
570 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
571 sounds = default.node_sound_wood_defaults(),
573 on_place = minetest.rotate_node
576 minetest.register_node("default:wood", {
577 description = "Wooden Planks",
578 paramtype2 = "facedir",
580 tiles = {"default_wood.png"},
581 is_ground_content = false,
582 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
583 sounds = default.node_sound_wood_defaults(),
586 minetest.register_node("default:sapling", {
587 description = "Sapling",
588 drawtype = "plantlike",
589 tiles = {"default_sapling.png"},
590 inventory_image = "default_sapling.png",
591 wield_image = "default_sapling.png",
593 sunlight_propagates = true,
595 on_timer = default.grow_sapling,
598 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
600 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
601 attached_node = 1, sapling = 1},
602 sounds = default.node_sound_leaves_defaults(),
604 on_construct = function(pos)
605 minetest.get_node_timer(pos):start(math.random(2400,4800))
608 on_place = function(itemstack, placer, pointed_thing)
609 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
611 -- minp, maxp to be checked, relative to sapling pos
612 -- minp_relative.y = 1 because sapling pos has been checked
613 {x = -2, y = 1, z = -2},
614 {x = 2, y = 6, z = 2},
615 -- maximum interval of interior volume check
622 minetest.register_node("default:leaves", {
623 description = "Leaves",
624 drawtype = "allfaces_optional",
626 tiles = {"default_leaves.png"},
627 special_tiles = {"default_leaves_simple.png"},
629 is_ground_content = false,
630 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
635 -- player will get sapling with 1/20 chance
636 items = {'default:sapling'},
640 -- player will get leaves only if he get no saplings,
641 -- this is because max_items is 1
642 items = {'default:leaves'},
646 sounds = default.node_sound_leaves_defaults(),
648 after_place_node = default.after_place_leaves,
651 minetest.register_node("default:apple", {
652 description = "Apple",
653 drawtype = "plantlike",
654 tiles = {"default_apple.png"},
655 inventory_image = "default_apple.png",
657 sunlight_propagates = true,
659 is_ground_content = false,
662 fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
664 groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
665 leafdecay = 3, leafdecay_drop = 1},
666 on_use = minetest.item_eat(2),
667 sounds = default.node_sound_leaves_defaults(),
669 after_place_node = function(pos, placer, itemstack)
670 if placer:is_player() then
671 minetest.set_node(pos, {name = "default:apple", param2 = 1})
677 minetest.register_node("default:jungletree", {
678 description = "Jungle Tree",
679 tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
680 "default_jungletree.png"},
681 paramtype2 = "facedir",
682 is_ground_content = false,
683 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
684 sounds = default.node_sound_wood_defaults(),
686 on_place = minetest.rotate_node
689 minetest.register_node("default:junglewood", {
690 description = "Junglewood Planks",
691 paramtype2 = "facedir",
693 tiles = {"default_junglewood.png"},
694 is_ground_content = false,
695 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
696 sounds = default.node_sound_wood_defaults(),
699 minetest.register_node("default:jungleleaves", {
700 description = "Jungle Leaves",
701 drawtype = "allfaces_optional",
703 tiles = {"default_jungleleaves.png"},
704 special_tiles = {"default_jungleleaves_simple.png"},
706 is_ground_content = false,
707 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
711 {items = {'default:junglesapling'}, rarity = 20},
712 {items = {'default:jungleleaves'}}
715 sounds = default.node_sound_leaves_defaults(),
717 after_place_node = default.after_place_leaves,
720 minetest.register_node("default:junglesapling", {
721 description = "Jungle Sapling",
722 drawtype = "plantlike",
723 tiles = {"default_junglesapling.png"},
724 inventory_image = "default_junglesapling.png",
725 wield_image = "default_junglesapling.png",
727 sunlight_propagates = true,
729 on_timer = default.grow_sapling,
732 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
734 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
735 attached_node = 1, sapling = 1},
736 sounds = default.node_sound_leaves_defaults(),
738 on_construct = function(pos)
739 minetest.get_node_timer(pos):start(math.random(2400,4800))
742 on_place = function(itemstack, placer, pointed_thing)
743 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
744 "default:junglesapling",
745 -- minp, maxp to be checked, relative to sapling pos
746 -- minp_relative.y = 1 because sapling pos has been checked
747 {x = -2, y = 1, z = -2},
748 {x = 2, y = 15, z = 2},
749 -- maximum interval of interior volume check
757 minetest.register_node("default:pine_tree", {
758 description = "Pine Tree",
759 tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
760 "default_pine_tree.png"},
761 paramtype2 = "facedir",
762 is_ground_content = false,
763 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
764 sounds = default.node_sound_wood_defaults(),
766 on_place = minetest.rotate_node
769 minetest.register_node("default:pine_wood", {
770 description = "Pine Wood Planks",
771 paramtype2 = "facedir",
773 tiles = {"default_pine_wood.png"},
774 is_ground_content = false,
775 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
776 sounds = default.node_sound_wood_defaults(),
779 minetest.register_node("default:pine_needles",{
780 description = "Pine Needles",
781 drawtype = "allfaces_optional",
782 tiles = {"default_pine_needles.png"},
785 is_ground_content = false,
786 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
790 {items = {"default:pine_sapling"}, rarity = 20},
791 {items = {"default:pine_needles"}}
794 sounds = default.node_sound_leaves_defaults(),
796 after_place_node = default.after_place_leaves,
799 minetest.register_node("default:pine_sapling", {
800 description = "Pine Sapling",
801 drawtype = "plantlike",
802 tiles = {"default_pine_sapling.png"},
803 inventory_image = "default_pine_sapling.png",
804 wield_image = "default_pine_sapling.png",
806 sunlight_propagates = true,
808 on_timer = default.grow_sapling,
811 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
813 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
814 attached_node = 1, sapling = 1},
815 sounds = default.node_sound_leaves_defaults(),
817 on_construct = function(pos)
818 minetest.get_node_timer(pos):start(math.random(2400,4800))
821 on_place = function(itemstack, placer, pointed_thing)
822 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
823 "default:pine_sapling",
824 -- minp, maxp to be checked, relative to sapling pos
825 -- minp_relative.y = 1 because sapling pos has been checked
826 {x = -2, y = 1, z = -2},
827 {x = 2, y = 12, z = 2},
828 -- maximum interval of interior volume check
836 minetest.register_node("default:acacia_tree", {
837 description = "Acacia Tree",
838 tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
839 "default_acacia_tree.png"},
840 paramtype2 = "facedir",
841 is_ground_content = false,
842 groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
843 sounds = default.node_sound_wood_defaults(),
845 on_place = minetest.rotate_node
848 minetest.register_node("default:acacia_wood", {
849 description = "Acacia Wood Planks",
850 paramtype2 = "facedir",
852 tiles = {"default_acacia_wood.png"},
853 is_ground_content = false,
854 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
855 sounds = default.node_sound_wood_defaults(),
858 minetest.register_node("default:acacia_leaves", {
859 description = "Acacia Leaves",
860 drawtype = "allfaces_optional",
861 tiles = {"default_acacia_leaves.png"},
862 special_tiles = {"default_acacia_leaves_simple.png"},
865 is_ground_content = false,
866 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
870 {items = {"default:acacia_sapling"}, rarity = 20},
871 {items = {"default:acacia_leaves"}}
874 sounds = default.node_sound_leaves_defaults(),
876 after_place_node = default.after_place_leaves,
879 minetest.register_node("default:acacia_sapling", {
880 description = "Acacia Tree Sapling",
881 drawtype = "plantlike",
882 tiles = {"default_acacia_sapling.png"},
883 inventory_image = "default_acacia_sapling.png",
884 wield_image = "default_acacia_sapling.png",
886 sunlight_propagates = true,
888 on_timer = default.grow_sapling,
891 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
893 groups = {snappy = 2, dig_immediate = 3, flammable = 2,
894 attached_node = 1, sapling = 1},
895 sounds = default.node_sound_leaves_defaults(),
897 on_construct = function(pos)
898 minetest.get_node_timer(pos):start(math.random(2400,4800))
901 on_place = function(itemstack, placer, pointed_thing)
902 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
903 "default:acacia_sapling",
904 -- minp, maxp to be checked, relative to sapling pos
905 -- minp_relative.y = 1 because sapling pos has been checked
906 {x = -4, y = 1, z = -4},
907 {x = 4, y = 6, z = 4},
908 -- maximum interval of interior volume check
915 minetest.register_node("default:aspen_tree", {
916 description = "Aspen Tree",
917 tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
918 "default_aspen_tree.png"},
919 paramtype2 = "facedir",
920 is_ground_content = false,
921 groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
922 sounds = default.node_sound_wood_defaults(),
924 on_place = minetest.rotate_node
927 minetest.register_node("default:aspen_wood", {
928 description = "Aspen Wood Planks",
929 paramtype2 = "facedir",
931 tiles = {"default_aspen_wood.png"},
932 is_ground_content = false,
933 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
934 sounds = default.node_sound_wood_defaults(),
937 minetest.register_node("default:aspen_leaves", {
938 description = "Aspen Leaves",
939 drawtype = "allfaces_optional",
940 tiles = {"default_aspen_leaves.png"},
943 is_ground_content = false,
944 groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
948 {items = {"default:aspen_sapling"}, rarity = 20},
949 {items = {"default:aspen_leaves"}}
952 sounds = default.node_sound_leaves_defaults(),
954 after_place_node = default.after_place_leaves,
957 minetest.register_node("default:aspen_sapling", {
958 description = "Aspen Tree Sapling",
959 drawtype = "plantlike",
960 tiles = {"default_aspen_sapling.png"},
961 inventory_image = "default_aspen_sapling.png",
962 wield_image = "default_aspen_sapling.png",
964 sunlight_propagates = true,
966 on_timer = default.grow_sapling,
969 fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
971 groups = {snappy = 2, dig_immediate = 3, flammable = 3,
972 attached_node = 1, sapling = 1},
973 sounds = default.node_sound_leaves_defaults(),
975 on_construct = function(pos)
976 minetest.get_node_timer(pos):start(math.random(2400,4800))
979 on_place = function(itemstack, placer, pointed_thing)
980 itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
981 "default:aspen_sapling",
982 -- minp, maxp to be checked, relative to sapling pos
983 -- minp_relative.y = 1 because sapling pos has been checked
984 {x = -2, y = 1, z = -2},
985 {x = 2, y = 12, z = 2},
986 -- maximum interval of interior volume check
997 minetest.register_node("default:stone_with_coal", {
998 description = "Coal Ore",
999 tiles = {"default_stone.png^default_mineral_coal.png"},
1000 groups = {cracky = 3},
1001 drop = 'default:coal_lump',
1002 sounds = default.node_sound_stone_defaults(),
1005 minetest.register_node("default:coalblock", {
1006 description = "Coal Block",
1007 tiles = {"default_coal_block.png"},
1008 is_ground_content = false,
1009 groups = {cracky = 3},
1010 sounds = default.node_sound_stone_defaults(),
1014 minetest.register_node("default:stone_with_iron", {
1015 description = "Iron Ore",
1016 tiles = {"default_stone.png^default_mineral_iron.png"},
1017 groups = {cracky = 2},
1018 drop = 'default:iron_lump',
1019 sounds = default.node_sound_stone_defaults(),
1022 minetest.register_node("default:steelblock", {
1023 description = "Steel Block",
1024 tiles = {"default_steel_block.png"},
1025 is_ground_content = false,
1026 groups = {cracky = 1, level = 2},
1027 sounds = default.node_sound_metal_defaults(),
1031 minetest.register_node("default:stone_with_copper", {
1032 description = "Copper Ore",
1033 tiles = {"default_stone.png^default_mineral_copper.png"},
1034 groups = {cracky = 2},
1035 drop = 'default:copper_lump',
1036 sounds = default.node_sound_stone_defaults(),
1039 minetest.register_node("default:copperblock", {
1040 description = "Copper Block",
1041 tiles = {"default_copper_block.png"},
1042 is_ground_content = false,
1043 groups = {cracky = 1, level = 2},
1044 sounds = default.node_sound_metal_defaults(),
1047 minetest.register_node("default:bronzeblock", {
1048 description = "Bronze Block",
1049 tiles = {"default_bronze_block.png"},
1050 is_ground_content = false,
1051 groups = {cracky = 1, level = 2},
1052 sounds = default.node_sound_metal_defaults(),
1056 minetest.register_node("default:stone_with_mese", {
1057 description = "Mese Ore",
1058 tiles = {"default_stone.png^default_mineral_mese.png"},
1059 groups = {cracky = 1},
1060 drop = "default:mese_crystal",
1061 sounds = default.node_sound_stone_defaults(),
1064 minetest.register_node("default:mese", {
1065 description = "Mese Block",
1066 tiles = {"default_mese_block.png"},
1067 paramtype = "light",
1068 groups = {cracky = 1, level = 2},
1069 sounds = default.node_sound_stone_defaults(),
1074 minetest.register_node("default:stone_with_gold", {
1075 description = "Gold Ore",
1076 tiles = {"default_stone.png^default_mineral_gold.png"},
1077 groups = {cracky = 2},
1078 drop = "default:gold_lump",
1079 sounds = default.node_sound_stone_defaults(),
1082 minetest.register_node("default:goldblock", {
1083 description = "Gold Block",
1084 tiles = {"default_gold_block.png"},
1085 is_ground_content = false,
1086 groups = {cracky = 1},
1087 sounds = default.node_sound_metal_defaults(),
1091 minetest.register_node("default:stone_with_diamond", {
1092 description = "Diamond Ore",
1093 tiles = {"default_stone.png^default_mineral_diamond.png"},
1094 groups = {cracky = 1},
1095 drop = "default:diamond",
1096 sounds = default.node_sound_stone_defaults(),
1099 minetest.register_node("default:diamondblock", {
1100 description = "Diamond Block",
1101 tiles = {"default_diamond_block.png"},
1102 is_ground_content = false,
1103 groups = {cracky = 1, level = 3},
1104 sounds = default.node_sound_stone_defaults(),
1108 -- Plantlife (non-cubic)
1111 minetest.register_node("default:cactus", {
1112 description = "Cactus",
1113 tiles = {"default_cactus_top.png", "default_cactus_top.png",
1114 "default_cactus_side.png"},
1115 paramtype2 = "facedir",
1116 groups = {choppy = 3},
1117 sounds = default.node_sound_wood_defaults(),
1118 on_place = minetest.rotate_node,
1121 minetest.register_node("default:papyrus", {
1122 description = "Papyrus",
1123 drawtype = "plantlike",
1124 tiles = {"default_papyrus.png"},
1125 inventory_image = "default_papyrus.png",
1126 wield_image = "default_papyrus.png",
1127 paramtype = "light",
1128 sunlight_propagates = true,
1132 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
1134 groups = {snappy = 3, flammable = 2},
1135 sounds = default.node_sound_leaves_defaults(),
1137 after_dig_node = function(pos, node, metadata, digger)
1138 default.dig_up(pos, node, digger)
1142 minetest.register_node("default:dry_shrub", {
1143 description = "Dry Shrub",
1144 drawtype = "plantlike",
1146 tiles = {"default_dry_shrub.png"},
1147 inventory_image = "default_dry_shrub.png",
1148 wield_image = "default_dry_shrub.png",
1149 paramtype = "light",
1150 sunlight_propagates = true,
1152 buildable_to = true,
1153 groups = {snappy = 3, flammable = 3, attached_node = 1},
1154 sounds = default.node_sound_leaves_defaults(),
1157 fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
1161 minetest.register_node("default:junglegrass", {
1162 description = "Jungle Grass",
1163 drawtype = "plantlike",
1165 visual_scale = 1.69,
1166 tiles = {"default_junglegrass.png"},
1167 inventory_image = "default_junglegrass.png",
1168 wield_image = "default_junglegrass.png",
1169 paramtype = "light",
1170 sunlight_propagates = true,
1172 buildable_to = true,
1173 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1174 sounds = default.node_sound_leaves_defaults(),
1177 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
1182 minetest.register_node("default:grass_1", {
1183 description = "Grass",
1184 drawtype = "plantlike",
1186 tiles = {"default_grass_1.png"},
1187 -- Use texture of a taller grass stage in inventory
1188 inventory_image = "default_grass_3.png",
1189 wield_image = "default_grass_3.png",
1190 paramtype = "light",
1191 sunlight_propagates = true,
1193 buildable_to = true,
1194 groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1},
1195 sounds = default.node_sound_leaves_defaults(),
1198 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
1201 on_place = function(itemstack, placer, pointed_thing)
1202 -- place a random grass node
1203 local stack = ItemStack("default:grass_" .. math.random(1,5))
1204 local ret = minetest.item_place(stack, placer, pointed_thing)
1205 return ItemStack("default:grass_1 " ..
1206 itemstack:get_count() - (1 - ret:get_count()))
1211 minetest.register_node("default:grass_" .. i, {
1212 description = "Grass",
1213 drawtype = "plantlike",
1215 tiles = {"default_grass_" .. i .. ".png"},
1216 inventory_image = "default_grass_" .. i .. ".png",
1217 wield_image = "default_grass_" .. i .. ".png",
1218 paramtype = "light",
1219 sunlight_propagates = true,
1221 buildable_to = true,
1222 drop = "default:grass_1",
1223 groups = {snappy = 3, flora = 1, attached_node = 1,
1224 not_in_creative_inventory = 1, grass = 1, flammable = 1},
1225 sounds = default.node_sound_leaves_defaults(),
1228 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1234 minetest.register_node("default:dry_grass_1", {
1235 description = "Dry Grass",
1236 drawtype = "plantlike",
1238 tiles = {"default_dry_grass_1.png"},
1239 inventory_image = "default_dry_grass_3.png",
1240 wield_image = "default_dry_grass_3.png",
1241 paramtype = "light",
1242 sunlight_propagates = true,
1244 buildable_to = true,
1245 groups = {snappy = 3, flammable = 3, flora = 1,
1246 attached_node = 1, dry_grass = 1},
1247 sounds = default.node_sound_leaves_defaults(),
1250 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
1253 on_place = function(itemstack, placer, pointed_thing)
1254 -- place a random dry grass node
1255 local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
1256 local ret = minetest.item_place(stack, placer, pointed_thing)
1257 return ItemStack("default:dry_grass_1 " ..
1258 itemstack:get_count() - (1 - ret:get_count()))
1263 minetest.register_node("default:dry_grass_" .. i, {
1264 description = "Dry Grass",
1265 drawtype = "plantlike",
1267 tiles = {"default_dry_grass_" .. i .. ".png"},
1268 inventory_image = "default_dry_grass_" .. i .. ".png",
1269 wield_image = "default_dry_grass_" .. i .. ".png",
1270 paramtype = "light",
1271 sunlight_propagates = true,
1273 buildable_to = true,
1274 groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
1275 not_in_creative_inventory=1, dry_grass = 1},
1276 drop = "default:dry_grass_1",
1277 sounds = default.node_sound_leaves_defaults(),
1280 fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
1286 minetest.register_node("default:bush_stem", {
1287 description = "Bush Stem",
1288 drawtype = "plantlike",
1289 visual_scale = 1.41,
1290 tiles = {"default_bush_stem.png"},
1291 inventory_image = "default_bush_stem.png",
1292 wield_image = "default_bush_stem.png",
1293 paramtype = "light",
1294 sunlight_propagates = true,
1295 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1296 sounds = default.node_sound_wood_defaults(),
1299 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1303 minetest.register_node("default:bush_leaves", {
1304 description = "Bush Leaves",
1305 drawtype = "allfaces_optional",
1307 tiles = {"default_leaves_simple.png"},
1308 paramtype = "light",
1309 groups = {snappy = 3, flammable = 2, leaves = 1},
1310 sounds = default.node_sound_leaves_defaults(),
1312 after_place_node = default.after_place_leaves,
1315 minetest.register_node("default:acacia_bush_stem", {
1316 description = "Acacia Bush Stem",
1317 drawtype = "plantlike",
1318 visual_scale = 1.41,
1319 tiles = {"default_acacia_bush_stem.png"},
1320 inventory_image = "default_acacia_bush_stem.png",
1321 wield_image = "default_acacia_bush_stem.png",
1322 paramtype = "light",
1323 sunlight_propagates = true,
1324 groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
1325 sounds = default.node_sound_wood_defaults(),
1328 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1332 minetest.register_node("default:acacia_bush_leaves", {
1333 description = "Acacia Bush Leaves",
1334 drawtype = "allfaces_optional",
1336 tiles = {"default_acacia_leaves_simple.png"},
1337 paramtype = "light",
1338 groups = {snappy = 3, flammable = 2, leaves = 1},
1339 sounds = default.node_sound_leaves_defaults(),
1341 after_place_node = default.after_place_leaves,
1349 minetest.register_node("default:coral_brown", {
1350 description = "Brown Coral",
1351 tiles = {"default_coral_brown.png"},
1352 groups = {cracky = 3},
1353 drop = "default:coral_skeleton",
1354 sounds = default.node_sound_stone_defaults(),
1357 minetest.register_node("default:coral_orange", {
1358 description = "Orange Coral",
1359 tiles = {"default_coral_orange.png"},
1360 groups = {cracky = 3},
1361 drop = "default:coral_skeleton",
1362 sounds = default.node_sound_stone_defaults(),
1365 minetest.register_node("default:coral_skeleton", {
1366 description = "Coral Skeleton",
1367 tiles = {"default_coral_skeleton.png"},
1368 groups = {cracky = 3},
1369 sounds = default.node_sound_stone_defaults(),
1377 minetest.register_node("default:water_source", {
1378 description = "Water Source",
1379 drawtype = "liquid",
1382 name = "default_water_source_animated.png",
1384 type = "vertical_frames",
1392 -- New-style water source material (mostly unused)
1394 name = "default_water_source_animated.png",
1396 type = "vertical_frames",
1401 backface_culling = false,
1405 paramtype = "light",
1409 buildable_to = true,
1410 is_ground_content = false,
1413 liquidtype = "source",
1414 liquid_alternative_flowing = "default:water_flowing",
1415 liquid_alternative_source = "default:water_source",
1416 liquid_viscosity = 1,
1417 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1418 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1419 sounds = default.node_sound_water_defaults(),
1422 minetest.register_node("default:water_flowing", {
1423 description = "Flowing Water",
1424 drawtype = "flowingliquid",
1425 tiles = {"default_water.png"},
1428 name = "default_water_flowing_animated.png",
1429 backface_culling = false,
1431 type = "vertical_frames",
1438 name = "default_water_flowing_animated.png",
1439 backface_culling = true,
1441 type = "vertical_frames",
1449 paramtype = "light",
1450 paramtype2 = "flowingliquid",
1454 buildable_to = true,
1455 is_ground_content = false,
1458 liquidtype = "flowing",
1459 liquid_alternative_flowing = "default:water_flowing",
1460 liquid_alternative_source = "default:water_source",
1461 liquid_viscosity = 1,
1462 post_effect_color = {a = 103, r = 30, g = 60, b = 90},
1463 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1464 not_in_creative_inventory = 1, cools_lava = 1},
1465 sounds = default.node_sound_water_defaults(),
1469 minetest.register_node("default:river_water_source", {
1470 description = "River Water Source",
1471 drawtype = "liquid",
1474 name = "default_river_water_source_animated.png",
1476 type = "vertical_frames",
1485 name = "default_river_water_source_animated.png",
1487 type = "vertical_frames",
1492 backface_culling = false,
1496 paramtype = "light",
1500 buildable_to = true,
1501 is_ground_content = false,
1504 liquidtype = "source",
1505 liquid_alternative_flowing = "default:river_water_flowing",
1506 liquid_alternative_source = "default:river_water_source",
1507 liquid_viscosity = 1,
1508 liquid_renewable = false,
1510 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1511 groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
1512 sounds = default.node_sound_water_defaults(),
1515 minetest.register_node("default:river_water_flowing", {
1516 description = "Flowing River Water",
1517 drawtype = "flowingliquid",
1518 tiles = {"default_river_water.png"},
1521 name = "default_river_water_flowing_animated.png",
1522 backface_culling = false,
1524 type = "vertical_frames",
1531 name = "default_river_water_flowing_animated.png",
1532 backface_culling = true,
1534 type = "vertical_frames",
1542 paramtype = "light",
1543 paramtype2 = "flowingliquid",
1547 buildable_to = true,
1548 is_ground_content = false,
1551 liquidtype = "flowing",
1552 liquid_alternative_flowing = "default:river_water_flowing",
1553 liquid_alternative_source = "default:river_water_source",
1554 liquid_viscosity = 1,
1555 liquid_renewable = false,
1557 post_effect_color = {a = 103, r = 30, g = 76, b = 90},
1558 groups = {water = 3, liquid = 3, puts_out_fire = 1,
1559 not_in_creative_inventory = 1, cools_lava = 1},
1560 sounds = default.node_sound_water_defaults(),
1564 minetest.register_node("default:lava_source", {
1565 description = "Lava Source",
1566 drawtype = "liquid",
1569 name = "default_lava_source_animated.png",
1571 type = "vertical_frames",
1579 -- New-style lava source material (mostly unused)
1581 name = "default_lava_source_animated.png",
1583 type = "vertical_frames",
1588 backface_culling = false,
1591 paramtype = "light",
1592 light_source = default.LIGHT_MAX - 1,
1596 buildable_to = true,
1597 is_ground_content = false,
1600 liquidtype = "source",
1601 liquid_alternative_flowing = "default:lava_flowing",
1602 liquid_alternative_source = "default:lava_source",
1603 liquid_viscosity = 7,
1604 liquid_renewable = false,
1605 damage_per_second = 4 * 2,
1606 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1607 groups = {lava = 3, liquid = 2, igniter = 1},
1610 minetest.register_node("default:lava_flowing", {
1611 description = "Flowing Lava",
1612 drawtype = "flowingliquid",
1613 tiles = {"default_lava.png"},
1616 name = "default_lava_flowing_animated.png",
1617 backface_culling = false,
1619 type = "vertical_frames",
1626 name = "default_lava_flowing_animated.png",
1627 backface_culling = true,
1629 type = "vertical_frames",
1636 paramtype = "light",
1637 paramtype2 = "flowingliquid",
1638 light_source = default.LIGHT_MAX - 1,
1642 buildable_to = true,
1643 is_ground_content = false,
1646 liquidtype = "flowing",
1647 liquid_alternative_flowing = "default:lava_flowing",
1648 liquid_alternative_source = "default:lava_source",
1649 liquid_viscosity = 7,
1650 liquid_renewable = false,
1651 damage_per_second = 4 * 2,
1652 post_effect_color = {a = 191, r = 255, g = 64, b = 0},
1653 groups = {lava = 3, liquid = 2, igniter = 1,
1654 not_in_creative_inventory = 1},
1658 -- Tools / "Advanced" crafting / Non-"natural"
1661 local chest_formspec =
1664 default.gui_bg_img ..
1665 default.gui_slots ..
1666 "list[current_name;main;0,0.3;8,4;]" ..
1667 "list[current_player;main;0,4.85;8,1;]" ..
1668 "list[current_player;main;0,6.08;8,3;8]" ..
1669 "listring[current_name;main]" ..
1670 "listring[current_player;main]" ..
1671 default.get_hotbar_bg(0,4.85)
1673 local function get_locked_chest_formspec(pos)
1674 local spos = pos.x .. "," .. pos.y .. "," .. pos.z
1678 default.gui_bg_img ..
1679 default.gui_slots ..
1680 "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" ..
1681 "list[current_player;main;0,4.85;8,1;]" ..
1682 "list[current_player;main;0,6.08;8,3;8]" ..
1683 "listring[nodemeta:" .. spos .. ";main]" ..
1684 "listring[current_player;main]" ..
1685 default.get_hotbar_bg(0,4.85)
1689 minetest.register_node("default:chest", {
1690 description = "Chest",
1691 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1692 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1693 paramtype2 = "facedir",
1694 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1695 legacy_facedir_simple = true,
1696 is_ground_content = false,
1697 sounds = default.node_sound_wood_defaults(),
1699 on_construct = function(pos)
1700 local meta = minetest.get_meta(pos)
1701 meta:set_string("formspec", chest_formspec)
1702 local inv = meta:get_inventory()
1703 inv:set_size("main", 8*4)
1705 can_dig = function(pos,player)
1706 local meta = minetest.get_meta(pos);
1707 local inv = meta:get_inventory()
1708 return inv:is_empty("main")
1710 on_metadata_inventory_move = function(pos, from_list, from_index,
1711 to_list, to_index, count, player)
1712 minetest.log("action", player:get_player_name() ..
1713 " moves stuff in chest at " .. minetest.pos_to_string(pos))
1715 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1716 minetest.log("action", player:get_player_name() ..
1717 " moves " .. stack:get_name() ..
1718 " to chest at " .. minetest.pos_to_string(pos))
1720 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1721 minetest.log("action", player:get_player_name() ..
1722 " takes " .. stack:get_name() ..
1723 " from chest at " .. minetest.pos_to_string(pos))
1725 on_blast = function(pos)
1727 default.get_inventory_drops(pos, "main", drops)
1728 drops[#drops+1] = "default:chest"
1729 minetest.remove_node(pos)
1734 minetest.register_node("default:chest_locked", {
1735 description = "Locked Chest",
1736 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1737 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1738 paramtype2 = "facedir",
1739 groups = {choppy = 2, oddly_breakable_by_hand = 2},
1740 legacy_facedir_simple = true,
1741 is_ground_content = false,
1742 sounds = default.node_sound_wood_defaults(),
1744 after_place_node = function(pos, placer)
1745 local meta = minetest.get_meta(pos)
1746 meta:set_string("owner", placer:get_player_name() or "")
1747 meta:set_string("infotext", "Locked Chest (owned by " ..
1748 meta:get_string("owner") .. ")")
1750 on_construct = function(pos)
1751 local meta = minetest.get_meta(pos)
1752 meta:set_string("owner", "")
1753 local inv = meta:get_inventory()
1754 inv:set_size("main", 8 * 4)
1756 can_dig = function(pos,player)
1757 local meta = minetest.get_meta(pos);
1758 local inv = meta:get_inventory()
1759 return inv:is_empty("main") and default.can_interact_with_node(player, pos)
1761 allow_metadata_inventory_move = function(pos, from_list, from_index,
1762 to_list, to_index, count, player)
1763 if not default.can_interact_with_node(player, pos) then
1768 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1769 if not default.can_interact_with_node(player, pos) then
1772 return stack:get_count()
1774 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1775 if not default.can_interact_with_node(player, pos) then
1778 return stack:get_count()
1780 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1781 minetest.log("action", player:get_player_name() ..
1782 " moves " .. stack:get_name() ..
1783 " to locked chest at " .. minetest.pos_to_string(pos))
1785 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1786 minetest.log("action", player:get_player_name() ..
1787 " takes " .. stack:get_name() ..
1788 " from locked chest at " .. minetest.pos_to_string(pos))
1790 on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
1791 if default.can_interact_with_node(clicker, pos) then
1792 minetest.show_formspec(
1793 clicker:get_player_name(),
1794 "default:chest_locked",
1795 get_locked_chest_formspec(pos)
1800 on_blast = function() end,
1801 on_key_use = function(pos, player)
1802 local secret = minetest.get_meta(pos):get_string("key_lock_secret")
1803 local itemstack = player:get_wielded_item()
1804 local key_meta = itemstack:get_meta()
1806 if key_meta:get_string("secret") == "" then
1807 key_meta:set_string("secret", minetest.parse_json(itemstack:get_metadata()).secret)
1810 if secret ~= key_meta:get_string("secret") then
1814 minetest.show_formspec(
1815 player:get_player_name(),
1816 "default:chest_locked",
1817 get_locked_chest_formspec(pos)
1820 on_skeleton_key_use = function(pos, player, newsecret)
1821 local meta = minetest.get_meta(pos)
1822 local owner = meta:get_string("owner")
1823 local name = player:get_player_name()
1825 -- verify placer is owner of lockable chest
1826 if owner ~= name then
1827 minetest.record_protection_violation(pos, name)
1828 minetest.chat_send_player(name, "You do not own this chest.")
1832 local secret = meta:get_string("key_lock_secret")
1833 if secret == "" then
1835 meta:set_string("key_lock_secret", secret)
1838 return secret, "a locked chest", owner
1843 local bookshelf_formspec =
1846 default.gui_bg_img ..
1847 default.gui_slots ..
1848 "list[context;books;0,0.3;8,2;]" ..
1849 "list[current_player;main;0,2.85;8,1;]" ..
1850 "list[current_player;main;0,4.08;8,3;8]" ..
1851 "listring[context;books]" ..
1852 "listring[current_player;main]" ..
1853 default.get_hotbar_bg(0,2.85)
1855 local function get_bookshelf_formspec(inv)
1856 local formspec = bookshelf_formspec
1857 local invlist = inv and inv:get_list("books")
1858 -- Inventory slots overlay
1859 local bx, by = 0, 0.3
1865 if not invlist or invlist[i]:is_empty() then
1866 formspec = formspec ..
1867 "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
1874 minetest.register_node("default:bookshelf", {
1875 description = "Bookshelf",
1876 tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
1877 "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
1878 paramtype2 = "facedir",
1879 is_ground_content = false,
1880 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
1881 sounds = default.node_sound_wood_defaults(),
1883 on_construct = function(pos)
1884 local meta = minetest.get_meta(pos)
1885 meta:set_string("formspec", get_bookshelf_formspec(nil))
1886 local inv = meta:get_inventory()
1887 inv:set_size("books", 8 * 2)
1889 can_dig = function(pos,player)
1890 local inv = minetest.get_meta(pos):get_inventory()
1891 return inv:is_empty("books")
1893 allow_metadata_inventory_put = function(pos, listname, index, stack)
1894 if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
1895 return stack:get_count()
1899 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1900 minetest.log("action", player:get_player_name() ..
1901 " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
1902 local meta = minetest.get_meta(pos)
1903 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1905 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1906 minetest.log("action", player:get_player_name() ..
1907 " moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
1908 local meta = minetest.get_meta(pos)
1909 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1911 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1912 minetest.log("action", player:get_player_name() ..
1913 " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
1914 local meta = minetest.get_meta(pos)
1915 meta:set_string("formspec", get_bookshelf_formspec(meta:get_inventory()))
1917 on_blast = function(pos)
1919 default.get_inventory_drops(pos, "books", drops)
1920 drops[#drops+1] = "default:bookshelf"
1921 minetest.remove_node(pos)
1926 local function register_sign(material, desc, def)
1927 minetest.register_node("default:sign_wall_" .. material, {
1928 description = desc .. " Sign",
1929 drawtype = "nodebox",
1930 tiles = {"default_sign_wall_" .. material .. ".png"},
1931 inventory_image = "default_sign_" .. material .. ".png",
1932 wield_image = "default_sign_" .. material .. ".png",
1933 paramtype = "light",
1934 paramtype2 = "wallmounted",
1935 sunlight_propagates = true,
1936 is_ground_content = false,
1939 type = "wallmounted",
1940 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1941 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1942 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1944 groups = def.groups,
1945 legacy_wallmounted = true,
1946 sounds = def.sounds,
1948 on_construct = function(pos)
1949 --local n = minetest.get_node(pos)
1950 local meta = minetest.get_meta(pos)
1951 meta:set_string("formspec", "field[text;;${text}]")
1953 on_receive_fields = function(pos, formname, fields, sender)
1954 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1955 local player_name = sender:get_player_name()
1956 if minetest.is_protected(pos, player_name) then
1957 minetest.record_protection_violation(pos, player_name)
1960 local meta = minetest.get_meta(pos)
1961 if not fields.text then return end
1962 minetest.log("action", (player_name or "") .. " wrote \"" ..
1963 fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
1964 meta:set_string("text", fields.text)
1965 meta:set_string("infotext", '"' .. fields.text .. '"')
1970 register_sign("wood", "Wooden", {
1971 sounds = default.node_sound_wood_defaults(),
1972 groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
1975 register_sign("steel", "Steel", {
1976 sounds = default.node_sound_metal_defaults(),
1977 groups = {cracky = 2, attached_node = 1}
1980 minetest.register_node("default:ladder_wood", {
1981 description = "Wooden Ladder",
1982 drawtype = "signlike",
1983 tiles = {"default_ladder_wood.png"},
1984 inventory_image = "default_ladder_wood.png",
1985 wield_image = "default_ladder_wood.png",
1986 paramtype = "light",
1987 paramtype2 = "wallmounted",
1988 sunlight_propagates = true,
1991 is_ground_content = false,
1993 type = "wallmounted",
1994 --wall_top = = <default>
1995 --wall_bottom = = <default>
1996 --wall_side = = <default>
1998 groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
1999 legacy_wallmounted = true,
2000 sounds = default.node_sound_wood_defaults(),
2003 minetest.register_node("default:ladder_steel", {
2004 description = "Steel Ladder",
2005 drawtype = "signlike",
2006 tiles = {"default_ladder_steel.png"},
2007 inventory_image = "default_ladder_steel.png",
2008 wield_image = "default_ladder_steel.png",
2009 paramtype = "light",
2010 paramtype2 = "wallmounted",
2011 sunlight_propagates = true,
2014 is_ground_content = false,
2016 type = "wallmounted",
2017 --wall_top = = <default>
2018 --wall_bottom = = <default>
2019 --wall_side = = <default>
2021 groups = {cracky = 2},
2022 sounds = default.node_sound_metal_defaults(),
2025 default.register_fence("default:fence_wood", {
2026 description = "Wooden Fence",
2027 texture = "default_fence_wood.png",
2028 inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2029 wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2030 material = "default:wood",
2031 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2032 sounds = default.node_sound_wood_defaults()
2035 default.register_fence("default:fence_acacia_wood", {
2036 description = "Acacia Fence",
2037 texture = "default_fence_acacia_wood.png",
2038 inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2039 wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2040 material = "default:acacia_wood",
2041 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2042 sounds = default.node_sound_wood_defaults()
2045 default.register_fence("default:fence_junglewood", {
2046 description = "Junglewood Fence",
2047 texture = "default_fence_junglewood.png",
2048 inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2049 wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
2050 material = "default:junglewood",
2051 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2052 sounds = default.node_sound_wood_defaults()
2055 default.register_fence("default:fence_pine_wood", {
2056 description = "Pine Fence",
2057 texture = "default_fence_pine_wood.png",
2058 inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2059 wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2060 material = "default:pine_wood",
2061 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2062 sounds = default.node_sound_wood_defaults()
2065 default.register_fence("default:fence_aspen_wood", {
2066 description = "Aspen Fence",
2067 texture = "default_fence_aspen_wood.png",
2068 inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2069 wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
2070 material = "default:aspen_wood",
2071 groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
2072 sounds = default.node_sound_wood_defaults()
2075 minetest.register_node("default:glass", {
2076 description = "Glass",
2077 drawtype = "glasslike_framed_optional",
2078 tiles = {"default_glass.png", "default_glass_detail.png"},
2079 paramtype = "light",
2080 sunlight_propagates = true,
2081 is_ground_content = false,
2082 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2083 sounds = default.node_sound_glass_defaults(),
2086 minetest.register_node("default:obsidian_glass", {
2087 description = "Obsidian Glass",
2088 drawtype = "glasslike_framed_optional",
2089 tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
2090 paramtype = "light",
2091 is_ground_content = false,
2092 sunlight_propagates = true,
2093 sounds = default.node_sound_glass_defaults(),
2094 groups = {cracky = 3},
2098 minetest.register_node("default:brick", {
2099 description = "Brick Block",
2100 paramtype2 = "facedir",
2102 tiles = {"default_brick.png"},
2103 is_ground_content = false,
2104 groups = {cracky = 3},
2105 sounds = default.node_sound_stone_defaults(),
2109 minetest.register_node("default:meselamp", {
2110 description = "Mese Lamp",
2111 drawtype = "glasslike",
2112 tiles = {"default_meselamp.png"},
2113 paramtype = "light",
2114 sunlight_propagates = true,
2115 is_ground_content = false,
2116 groups = {cracky = 3, oddly_breakable_by_hand = 3},
2117 sounds = default.node_sound_glass_defaults(),
2118 light_source = default.LIGHT_MAX,
2121 minetest.register_node("default:mese_post_light", {
2122 description = "Mese Post Light",
2123 tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png",
2124 "default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png",
2125 "default_mese_post_light_side.png", "default_mese_post_light_side.png"},
2126 wield_image = "default_mese_post_light_side.png",
2127 drawtype = "nodebox",
2131 {-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16},
2134 paramtype = "light",
2135 light_source = default.LIGHT_MAX,
2136 sunlight_propagates = true,
2137 is_ground_content = false,
2138 groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
2139 sounds = default.node_sound_wood_defaults(),
2146 minetest.register_node("default:cloud", {
2147 description = "Cloud",
2148 tiles = {"default_cloud.png"},
2149 is_ground_content = false,
2150 sounds = default.node_sound_defaults(),
2151 groups = {not_in_creative_inventory = 1},
2155 -- register trees for leafdecay
2158 if minetest.get_mapgen_setting("mg_name") == "v6" then
2159 default.register_leafdecay({
2160 trunks = {"default:tree"},
2161 leaves = {"default:apple", "default:leaves"},
2165 default.register_leafdecay({
2166 trunks = {"default:jungletree"},
2167 leaves = {"default:jungleleaves"},
2171 default.register_leafdecay({
2172 trunks = {"default:pine_tree"},
2173 leaves = {"default:pine_needles"},
2177 default.register_leafdecay({
2178 trunks = {"default:tree"},
2179 leaves = {"default:apple", "default:leaves"},
2183 default.register_leafdecay({
2184 trunks = {"default:jungletree"},
2185 leaves = {"default:jungleleaves"},
2189 default.register_leafdecay({
2190 trunks = {"default:pine_tree"},
2191 leaves = {"default:pine_needles"},
2196 default.register_leafdecay({
2197 trunks = {"default:acacia_tree"},
2198 leaves = {"default:acacia_leaves"},
2202 default.register_leafdecay({
2203 trunks = {"default:aspen_tree"},
2204 leaves = {"default:aspen_leaves"},
2208 default.register_leafdecay({
2209 trunks = {"default:bush_stem"},
2210 leaves = {"default:bush_leaves"},
2214 default.register_leafdecay({
2215 trunks = {"default:acacia_bush_stem"},
2216 leaves = {"default:acacia_bush_leaves"},