1 -- mods/default/nodes.lua
7 (1. Material 2. Cobble variant 3. Brick variant [4. Modified forms])
16 default:desert_stonebrick
19 default:sandstonebrick
26 (1. Material [2. Modified forms])
29 default:dirt_with_grass
30 default:dirt_with_grass_footsteps
31 default:dirt_with_snow
47 (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling [5. Fruits])
67 (1. In stone 2. Block)
69 default:stone_with_coal
72 default:stone_with_iron
75 default:stone_with_copper
79 default:stone_with_gold
82 default:stone_with_mese
85 default:stone_with_diamond
102 (1. Source 2. Flowing)
105 default:water_flowing
110 Tools / "Advanced" crafting / Non-"natural"
111 -------------------------------------------
124 default:obsidian_glass
134 default:nyancat_rainbow
142 minetest.register_node("default:stone", {
143 description = "Stone",
144 tiles = {"default_stone.png"},
145 is_ground_content = true,
146 groups = {cracky=3, stone=1},
147 drop = 'default:cobble',
148 legacy_mineral = true,
149 sounds = default.node_sound_stone_defaults(),
152 minetest.register_node("default:cobble", {
153 description = "Cobblestone",
154 tiles = {"default_cobble.png"},
155 is_ground_content = true,
156 groups = {cracky=3, stone=2},
157 sounds = default.node_sound_stone_defaults(),
160 minetest.register_node("default:stonebrick", {
161 description = "Stone Brick",
162 tiles = {"default_stone_brick.png"},
163 groups = {cracky=2, stone=1},
164 sounds = default.node_sound_stone_defaults(),
167 minetest.register_node("default:mossycobble", {
168 description = "Mossy Cobblestone",
169 tiles = {"default_mossycobble.png"},
170 is_ground_content = true,
171 groups = {cracky=3, stone=1},
172 sounds = default.node_sound_stone_defaults(),
177 minetest.register_node("default:desert_stone", {
178 description = "Desert Stone",
179 tiles = {"default_desert_stone.png"},
180 is_ground_content = true,
181 groups = {cracky=3, stone=1},
182 drop = 'default:desert_cobble',
183 legacy_mineral = true,
184 sounds = default.node_sound_stone_defaults(),
187 minetest.register_node("default:desert_cobble", {
188 description = "Desert Cobblestone",
189 tiles = {"default_desert_cobble.png"},
190 is_ground_content = true,
191 groups = {cracky=3, stone=2},
192 sounds = default.node_sound_stone_defaults(),
195 minetest.register_node("default:desert_stonebrick", {
196 description = "Desert Stone Brick",
197 tiles = {"default_desert_stone_brick.png"},
198 groups = {cracky=2, stone=1},
199 sounds = default.node_sound_stone_defaults(),
204 minetest.register_node("default:sandstone", {
205 description = "Sandstone",
206 tiles = {"default_sandstone.png"},
207 is_ground_content = true,
208 groups = {crumbly=2,cracky=3},
209 sounds = default.node_sound_stone_defaults(),
212 minetest.register_node("default:sandstonebrick", {
213 description = "Sandstone Brick",
214 tiles = {"default_sandstone_brick.png"},
215 is_ground_content = true,
217 sounds = default.node_sound_stone_defaults(),
222 minetest.register_node("default:obsidian", {
223 description = "Obsidian",
224 tiles = {"default_obsidian.png"},
225 is_ground_content = true,
226 sounds = default.node_sound_stone_defaults(),
227 groups = {cracky=1,level=2},
230 minetest.register_node("default:obsidianbrick", {
231 description = "Obsidian Brick",
232 tiles = {"default_obsidian_brick.png"},
233 sounds = default.node_sound_stone_defaults(),
234 groups = {cracky=1,level=2},
241 minetest.register_node("default:dirt", {
242 description = "Dirt",
243 tiles = {"default_dirt.png"},
244 is_ground_content = true,
245 groups = {crumbly=3,soil=1},
246 sounds = default.node_sound_dirt_defaults(),
249 minetest.register_node("default:dirt_with_grass", {
250 description = "Dirt with Grass",
251 tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
252 is_ground_content = true,
253 groups = {crumbly=3,soil=1},
254 drop = 'default:dirt',
255 sounds = default.node_sound_dirt_defaults({
256 footstep = {name="default_grass_footstep", gain=0.25},
260 minetest.register_node("default:dirt_with_grass_footsteps", {
261 description = "Dirt with Grass and Footsteps",
262 tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
263 is_ground_content = true,
264 groups = {crumbly=3,soil=1,not_in_creative_inventory=1},
265 drop = 'default:dirt',
266 sounds = default.node_sound_dirt_defaults({
267 footstep = {name="default_grass_footstep", gain=0.25},
271 minetest.register_node("default:dirt_with_snow", {
272 description = "Dirt with Snow",
273 tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"},
274 is_ground_content = true,
275 groups = {crumbly=3,soil=1},
276 drop = 'default:dirt',
277 sounds = default.node_sound_dirt_defaults({
278 footstep = {name="default_snow_footstep", gain=0.25},
284 minetest.register_node("default:sand", {
285 description = "Sand",
286 tiles = {"default_sand.png"},
287 is_ground_content = true,
288 groups = {crumbly=3, falling_node=1, sand=1},
289 sounds = default.node_sound_sand_defaults(),
292 minetest.register_node("default:desert_sand", {
293 description = "Desert Sand",
294 tiles = {"default_desert_sand.png"},
295 is_ground_content = true,
296 groups = {crumbly=3, falling_node=1, sand=1},
297 sounds = default.node_sound_sand_defaults(),
302 minetest.register_node("default:gravel", {
303 description = "Gravel",
304 tiles = {"default_gravel.png"},
305 is_ground_content = true,
306 groups = {crumbly=2, falling_node=1},
307 sounds = default.node_sound_dirt_defaults({
308 footstep = {name="default_gravel_footstep", gain=0.5},
309 dug = {name="default_gravel_footstep", gain=1.0},
315 minetest.register_node("default:clay", {
316 description = "Clay",
317 tiles = {"default_clay.png"},
318 is_ground_content = true,
319 groups = {crumbly=3},
320 drop = 'default:clay_lump 4',
321 sounds = default.node_sound_dirt_defaults(),
326 minetest.register_node("default:snow", {
327 description = "Snow",
328 tiles = {"default_snow.png"},
329 inventory_image = "default_snowball.png",
330 wield_image = "default_snowball.png",
331 is_ground_content = true,
334 drawtype = "nodebox",
338 {-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5},
341 groups = {crumbly=3,falling_node=1},
342 sounds = default.node_sound_dirt_defaults({
343 footstep = {name="default_snow_footstep", gain=0.25},
344 dug = {name="default_snow_footstep", gain=0.75},
347 on_construct = function(pos)
349 if minetest.get_node(pos).name == "default:dirt_with_grass" then
350 minetest.set_node(pos, {name="default:dirt_with_snow"})
354 minetest.register_alias("snow", "default:snow")
356 minetest.register_node("default:snowblock", {
357 description = "Snow Block",
358 tiles = {"default_snow.png"},
359 is_ground_content = true,
360 groups = {crumbly=3},
361 sounds = default.node_sound_dirt_defaults({
362 footstep = {name="default_snow_footstep", gain=0.25},
363 dug = {name="default_snow_footstep", gain=0.75},
369 minetest.register_node("default:ice", {
371 tiles = {"default_ice.png"},
372 is_ground_content = true,
375 sounds = default.node_sound_glass_defaults(),
382 minetest.register_node("default:tree", {
383 description = "Tree",
384 tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
385 paramtype2 = "facedir",
386 is_ground_content = false,
387 groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
388 sounds = default.node_sound_wood_defaults(),
390 on_place = minetest.rotate_node
393 minetest.register_node("default:wood", {
394 description = "Wooden Planks",
395 tiles = {"default_wood.png"},
396 groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
397 sounds = default.node_sound_wood_defaults(),
400 minetest.register_node("default:sapling", {
401 description = "Sapling",
402 drawtype = "plantlike",
404 tiles = {"default_sapling.png"},
405 inventory_image = "default_sapling.png",
406 wield_image = "default_sapling.png",
409 is_ground_content = true,
412 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
414 groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
415 sounds = default.node_sound_leaves_defaults(),
418 minetest.register_node("default:leaves", {
419 description = "Leaves",
420 drawtype = "allfaces_optional",
423 tiles = {"default_leaves.png"},
425 is_ground_content = false,
426 groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
431 -- player will get sapling with 1/20 chance
432 items = {'default:sapling'},
436 -- player will get leaves only if he get no saplings,
437 -- this is because max_items is 1
438 items = {'default:leaves'},
442 sounds = default.node_sound_leaves_defaults(),
444 after_place_node = default.after_place_leaves,
447 minetest.register_node("default:apple", {
448 description = "Apple",
449 drawtype = "plantlike",
451 tiles = {"default_apple.png"},
452 inventory_image = "default_apple.png",
454 sunlight_propagates = true,
456 is_ground_content = true,
459 fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
461 groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1},
462 on_use = minetest.item_eat(1),
463 sounds = default.node_sound_leaves_defaults(),
465 after_place_node = function(pos, placer, itemstack)
466 if placer:is_player() then
467 minetest.set_node(pos, {name="default:apple", param2=1})
474 minetest.register_node("default:jungletree", {
475 description = "Jungle Tree",
476 tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
477 paramtype2 = "facedir",
478 is_ground_content = false,
479 groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
480 sounds = default.node_sound_wood_defaults(),
482 on_place = minetest.rotate_node
485 minetest.register_node("default:junglewood", {
486 description = "Junglewood Planks",
487 tiles = {"default_junglewood.png"},
488 groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
489 sounds = default.node_sound_wood_defaults(),
492 minetest.register_node("default:jungleleaves", {
493 description = "Jungle Leaves",
494 drawtype = "allfaces_optional",
497 tiles = {"default_jungleleaves.png"},
499 is_ground_content = false,
500 groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
505 -- player will get sapling with 1/20 chance
506 items = {'default:junglesapling'},
510 -- player will get leaves only if he get no saplings,
511 -- this is because max_items is 1
512 items = {'default:jungleleaves'},
516 sounds = default.node_sound_leaves_defaults(),
518 after_place_node = default.after_place_leaves,
521 minetest.register_node("default:junglesapling", {
522 description = "Jungle Sapling",
523 drawtype = "plantlike",
525 tiles = {"default_junglesapling.png"},
526 inventory_image = "default_junglesapling.png",
527 wield_image = "default_junglesapling.png",
532 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
534 groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
535 sounds = default.node_sound_leaves_defaults(),
540 minetest.register_node("default:pinetree", {
541 description = "Pine Tree",
542 tiles = {"default_pinetree_top.png", "default_pinetree_top.png", "default_pinetree.png"},
543 paramtype2 = "facedir",
544 is_ground_content = false,
545 groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
546 sounds = default.node_sound_wood_defaults(),
548 on_place = minetest.rotate_node
551 minetest.register_node("default:pinewood", {
552 description = "Pinewood Planks",
553 tiles = {"default_pinewood.png"},
554 groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
555 sounds = default.node_sound_wood_defaults(),
558 minetest.register_node("default:pine_needles",{
559 description = "Pine Needles",
560 drawtype = "allfaces_optional",
562 tiles = {"default_pine_needles.png"},
565 is_ground_content = false,
566 groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
571 -- player will get sapling with 1/20 chance
572 items = {"default:pine_sapling"},
576 -- player will get leaves only if he get no saplings,
577 -- this is because max_items is 1
578 items = {"default:pine_needles"},
582 sounds = default.node_sound_leaves_defaults(),
584 after_place_node = default.after_place_leaves,
587 minetest.register_node("default:pine_sapling", {
588 description = "Pine Sapling",
589 drawtype = "plantlike",
591 tiles = {"default_pine_sapling.png"},
592 inventory_image = "default_pine_sapling.png",
593 wield_image = "default_pine_sapling.png",
596 is_ground_content = true,
599 fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
601 groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
602 sounds = default.node_sound_leaves_defaults(),
609 minetest.register_node("default:stone_with_coal", {
610 description = "Coal Ore",
611 tiles = {"default_stone.png^default_mineral_coal.png"},
612 is_ground_content = true,
614 drop = 'default:coal_lump',
615 sounds = default.node_sound_stone_defaults(),
618 minetest.register_node("default:coalblock", {
619 description = "Coal Block",
620 tiles = {"default_coal_block.png"},
621 is_ground_content = true,
623 sounds = default.node_sound_stone_defaults(),
628 minetest.register_node("default:stone_with_iron", {
629 description = "Iron Ore",
630 tiles = {"default_stone.png^default_mineral_iron.png"},
631 is_ground_content = true,
633 drop = 'default:iron_lump',
634 sounds = default.node_sound_stone_defaults(),
637 minetest.register_node("default:steelblock", {
638 description = "Steel Block",
639 tiles = {"default_steel_block.png"},
640 is_ground_content = true,
641 groups = {cracky=1,level=2},
642 sounds = default.node_sound_stone_defaults(),
647 minetest.register_node("default:stone_with_copper", {
648 description = "Copper Ore",
649 tiles = {"default_stone.png^default_mineral_copper.png"},
650 is_ground_content = true,
652 drop = 'default:copper_lump',
653 sounds = default.node_sound_stone_defaults(),
656 minetest.register_node("default:copperblock", {
657 description = "Copper Block",
658 tiles = {"default_copper_block.png"},
659 is_ground_content = true,
660 groups = {cracky=1,level=2},
661 sounds = default.node_sound_stone_defaults(),
664 minetest.register_node("default:bronzeblock", {
665 description = "Bronze Block",
666 tiles = {"default_bronze_block.png"},
667 is_ground_content = true,
668 groups = {cracky=1,level=2},
669 sounds = default.node_sound_stone_defaults(),
674 minetest.register_node("default:stone_with_mese", {
675 description = "Mese Ore",
676 tiles = {"default_stone.png^default_mineral_mese.png"},
677 is_ground_content = true,
679 drop = "default:mese_crystal",
680 sounds = default.node_sound_stone_defaults(),
683 minetest.register_node("default:mese", {
684 description = "Mese Block",
685 tiles = {"default_mese_block.png"},
686 is_ground_content = true,
687 groups = {cracky=1,level=2},
688 sounds = default.node_sound_stone_defaults(),
690 minetest.register_alias("default:mese_block", "default:mese")
694 minetest.register_node("default:stone_with_gold", {
695 description = "Gold Ore",
696 tiles = {"default_stone.png^default_mineral_gold.png"},
697 is_ground_content = true,
699 drop = "default:gold_lump",
700 sounds = default.node_sound_stone_defaults(),
703 minetest.register_node("default:goldblock", {
704 description = "Gold Block",
705 tiles = {"default_gold_block.png"},
706 is_ground_content = true,
708 sounds = default.node_sound_stone_defaults(),
713 minetest.register_node("default:stone_with_diamond", {
714 description = "Diamond Ore",
715 tiles = {"default_stone.png^default_mineral_diamond.png"},
716 is_ground_content = true,
718 drop = "default:diamond",
719 sounds = default.node_sound_stone_defaults(),
722 minetest.register_node("default:diamondblock", {
723 description = "Diamond Block",
724 tiles = {"default_diamond_block.png"},
725 is_ground_content = true,
726 groups = {cracky=1,level=3},
727 sounds = default.node_sound_stone_defaults(),
731 -- Plantlife (non-cubic)
734 minetest.register_node("default:cactus", {
735 description = "Cactus",
736 tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
737 paramtype2 = "facedir",
738 is_ground_content = true,
739 groups = {snappy=1,choppy=3,flammable=2},
740 sounds = default.node_sound_wood_defaults(),
741 on_place = minetest.rotate_node,
743 after_dig_node = function(pos, node, metadata, digger)
744 default.dig_up(pos, node, digger)
748 minetest.register_node("default:papyrus", {
749 description = "Papyrus",
750 drawtype = "plantlike",
751 tiles = {"default_papyrus.png"},
752 inventory_image = "default_papyrus.png",
753 wield_image = "default_papyrus.png",
756 is_ground_content = true,
759 fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
761 groups = {snappy=3,flammable=2},
762 sounds = default.node_sound_leaves_defaults(),
764 after_dig_node = function(pos, node, metadata, digger)
765 default.dig_up(pos, node, digger)
769 minetest.register_node("default:dry_shrub", {
770 description = "Dry Shrub",
771 drawtype = "plantlike",
774 tiles = {"default_dry_shrub.png"},
775 inventory_image = "default_dry_shrub.png",
776 wield_image = "default_dry_shrub.png",
779 is_ground_content = true,
781 groups = {snappy=3,flammable=3,attached_node=1},
782 sounds = default.node_sound_leaves_defaults(),
785 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
789 minetest.register_node("default:junglegrass", {
790 description = "Jungle Grass",
791 drawtype = "plantlike",
794 tiles = {"default_junglegrass.png"},
795 inventory_image = "default_junglegrass.png",
796 wield_image = "default_junglegrass.png",
800 is_ground_content = true,
801 groups = {snappy=3,flammable=2,flora=1,attached_node=1},
802 sounds = default.node_sound_leaves_defaults(),
805 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
809 minetest.register_node("default:grass_1", {
810 description = "Grass",
811 drawtype = "plantlike",
813 tiles = {"default_grass_1.png"},
814 -- Use texture of a taller grass stage in inventory
815 inventory_image = "default_grass_3.png",
816 wield_image = "default_grass_3.png",
819 is_ground_content = true,
821 groups = {snappy=3,flammable=3,flora=1,attached_node=1},
822 sounds = default.node_sound_leaves_defaults(),
825 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
828 on_place = function(itemstack, placer, pointed_thing)
829 -- place a random grass node
830 local stack = ItemStack("default:grass_"..math.random(1,5))
831 local ret = minetest.item_place(stack, placer, pointed_thing)
832 return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
837 minetest.register_node("default:grass_"..i, {
838 description = "Grass",
839 drawtype = "plantlike",
841 tiles = {"default_grass_"..i..".png"},
842 inventory_image = "default_grass_"..i..".png",
843 wield_image = "default_grass_"..i..".png",
847 is_ground_content = true,
848 drop = "default:grass_1",
849 groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
850 sounds = default.node_sound_leaves_defaults(),
853 fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
862 minetest.register_node("default:water_source", {
863 description = "Water Source",
864 inventory_image = minetest.inventorycube("default_water.png"),
868 name = "default_water_source_animated.png",
870 type = "vertical_frames",
878 -- New-style water source material (mostly unused)
880 name = "default_water_source_animated.png",
882 type = "vertical_frames",
887 backface_culling = false,
898 liquidtype = "source",
899 liquid_alternative_flowing = "default:water_flowing",
900 liquid_alternative_source = "default:water_source",
901 liquid_viscosity = 1,
902 post_effect_color = {a=64, r=100, g=100, b=200},
903 groups = {water=3, liquid=3, puts_out_fire=1},
906 minetest.register_node("default:water_flowing", {
907 description = "Flowing Water",
908 inventory_image = minetest.inventorycube("default_water.png"),
909 drawtype = "flowingliquid",
910 tiles = {"default_water.png"},
913 name = "default_water_flowing_animated.png",
914 backface_culling = false,
916 type = "vertical_frames",
923 name = "default_water_flowing_animated.png",
924 backface_culling = true,
926 type = "vertical_frames",
935 paramtype2 = "flowingliquid",
942 liquidtype = "flowing",
943 liquid_alternative_flowing = "default:water_flowing",
944 liquid_alternative_source = "default:water_source",
945 liquid_viscosity = 1,
946 post_effect_color = {a=64, r=100, g=100, b=200},
947 groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
952 minetest.register_node("default:lava_source", {
953 description = "Lava Source",
954 inventory_image = minetest.inventorycube("default_lava.png"),
958 name = "default_lava_source_animated.png",
960 type = "vertical_frames",
968 -- New-style lava source material (mostly unused)
970 name = "default_lava_source_animated.png",
972 type = "vertical_frames",
977 backface_culling = false,
981 light_source = default.LIGHT_MAX - 1,
988 liquidtype = "source",
989 liquid_alternative_flowing = "default:lava_flowing",
990 liquid_alternative_source = "default:lava_source",
991 liquid_viscosity = 7,
992 liquid_renewable = false,
993 damage_per_second = 4 * 2,
994 post_effect_color = {a=192, r=255, g=64, b=0},
995 groups = {lava=3, liquid=2, hot=3, igniter=1},
998 minetest.register_node("default:lava_flowing", {
999 description = "Flowing Lava",
1000 inventory_image = minetest.inventorycube("default_lava.png"),
1001 drawtype = "flowingliquid",
1002 tiles = {"default_lava.png"},
1005 name = "default_lava_flowing_animated.png",
1006 backface_culling = false,
1008 type = "vertical_frames",
1015 name = "default_lava_flowing_animated.png",
1016 backface_culling = true,
1018 type = "vertical_frames",
1025 paramtype = "light",
1026 paramtype2 = "flowingliquid",
1027 light_source = default.LIGHT_MAX - 1,
1031 buildable_to = true,
1034 liquidtype = "flowing",
1035 liquid_alternative_flowing = "default:lava_flowing",
1036 liquid_alternative_source = "default:lava_source",
1037 liquid_viscosity = 7,
1038 liquid_renewable = false,
1039 damage_per_second = 4 * 2,
1040 post_effect_color = {a=192, r=255, g=64, b=0},
1041 groups = {lava=3, liquid=2, hot=3, igniter=1, not_in_creative_inventory=1},
1045 -- Tools / "Advanced" crafting / Non-"natural"
1048 minetest.register_node("default:torch", {
1049 description = "Torch",
1050 drawtype = "torchlike",
1053 name = "default_torch_on_floor_animated.png",
1055 type = "vertical_frames",
1062 name="default_torch_on_ceiling_animated.png",
1064 type = "vertical_frames",
1071 name="default_torch_animated.png",
1073 type = "vertical_frames",
1080 inventory_image = "default_torch_on_floor.png",
1081 wield_image = "default_torch_on_floor.png",
1082 paramtype = "light",
1083 paramtype2 = "wallmounted",
1084 sunlight_propagates = true,
1085 is_ground_content = false,
1087 light_source = default.LIGHT_MAX - 1,
1089 type = "wallmounted",
1090 wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1},
1091 wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
1092 wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
1094 groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1},
1095 legacy_wallmounted = true,
1096 sounds = default.node_sound_defaults(),
1101 local chest_formspec =
1104 default.gui_bg_img..
1106 "list[current_name;main;0,0.3;8,4;]"..
1107 "list[current_player;main;0,4.85;8,1;]"..
1108 "list[current_player;main;0,6.08;8,3;8]"..
1109 default.get_hotbar_bg(0,4.85)
1111 local function get_locked_chest_formspec(pos)
1112 local spos = pos.x .. "," .. pos.y .. "," ..pos.z
1116 default.gui_bg_img..
1118 "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"..
1119 "list[current_player;main;0,4.85;8,1;]"..
1120 "list[current_player;main;0,6.08;8,3;8]"..
1121 default.get_hotbar_bg(0,4.85)
1125 local function has_locked_chest_privilege(meta, player)
1126 if player:get_player_name() ~= meta:get_string("owner") then
1132 minetest.register_node("default:chest", {
1133 description = "Chest",
1134 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1135 "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
1136 paramtype2 = "facedir",
1137 groups = {choppy=2,oddly_breakable_by_hand=2},
1138 legacy_facedir_simple = true,
1139 is_ground_content = false,
1140 sounds = default.node_sound_wood_defaults(),
1142 on_construct = function(pos)
1143 local meta = minetest.get_meta(pos)
1144 meta:set_string("formspec", chest_formspec)
1145 meta:set_string("infotext", "Chest")
1146 local inv = meta:get_inventory()
1147 inv:set_size("main", 8*4)
1149 can_dig = function(pos,player)
1150 local meta = minetest.get_meta(pos);
1151 local inv = meta:get_inventory()
1152 return inv:is_empty("main")
1154 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1155 minetest.log("action", player:get_player_name()..
1156 " moves stuff in chest at "..minetest.pos_to_string(pos))
1158 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1159 minetest.log("action", player:get_player_name()..
1160 " moves stuff to chest at "..minetest.pos_to_string(pos))
1162 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1163 minetest.log("action", player:get_player_name()..
1164 " takes stuff from chest at "..minetest.pos_to_string(pos))
1170 minetest.register_node("default:chest_locked", {
1171 description = "Locked Chest",
1172 tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
1173 "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
1174 paramtype2 = "facedir",
1175 groups = {choppy=2,oddly_breakable_by_hand=2},
1176 legacy_facedir_simple = true,
1177 is_ground_content = false,
1178 sounds = default.node_sound_wood_defaults(),
1180 after_place_node = function(pos, placer)
1181 local meta = minetest.get_meta(pos)
1182 meta:set_string("owner", placer:get_player_name() or "")
1183 meta:set_string("infotext", "Locked Chest (owned by "..
1184 meta:get_string("owner")..")")
1186 on_construct = function(pos)
1187 local meta = minetest.get_meta(pos)
1188 meta:set_string("infotext", "Locked Chest")
1189 meta:set_string("owner", "")
1190 local inv = meta:get_inventory()
1191 inv:set_size("main", 8*4)
1193 can_dig = function(pos,player)
1194 local meta = minetest.get_meta(pos);
1195 local inv = meta:get_inventory()
1196 return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
1198 allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1199 local meta = minetest.get_meta(pos)
1200 if not has_locked_chest_privilege(meta, player) then
1205 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1206 local meta = minetest.get_meta(pos)
1207 if not has_locked_chest_privilege(meta, player) then
1210 return stack:get_count()
1212 allow_metadata_inventory_take = function(pos, listname, index, stack, player)
1213 local meta = minetest.get_meta(pos)
1214 if not has_locked_chest_privilege(meta, player) then
1217 return stack:get_count()
1219 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1220 minetest.log("action", player:get_player_name()..
1221 " moves stuff to locked chest at "..minetest.pos_to_string(pos))
1223 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1224 minetest.log("action", player:get_player_name()..
1225 " takes stuff from locked chest at "..minetest.pos_to_string(pos))
1227 on_rightclick = function(pos, node, clicker)
1228 local meta = minetest.get_meta(pos)
1229 if has_locked_chest_privilege(meta, clicker) then
1230 minetest.show_formspec(
1231 clicker:get_player_name(),
1232 "default:chest_locked",
1233 get_locked_chest_formspec(pos)
1241 local bookshelf_formspec =
1244 default.gui_bg_img..
1246 "list[context;books;0,0.3;8,2;]"..
1247 "list[current_player;main;0,2.85;8,1;]"..
1248 "list[current_player;main;0,4.08;8,3;8]"..
1249 default.get_hotbar_bg(0,2.85)
1251 minetest.register_node("default:bookshelf", {
1252 description = "Bookshelf",
1253 tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
1254 is_ground_content = false,
1255 groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
1256 sounds = default.node_sound_wood_defaults(),
1258 on_construct = function(pos)
1259 local meta = minetest.get_meta(pos)
1260 meta:set_string("formspec", bookshelf_formspec)
1261 local inv = meta:get_inventory()
1262 inv:set_size("books", 8*2)
1264 can_dig = function(pos,player)
1265 local meta = minetest.get_meta(pos);
1266 local inv = meta:get_inventory()
1267 return inv:is_empty("books")
1270 allow_metadata_inventory_put = function(pos, listname, index, stack, player)
1271 local meta = minetest.get_meta(pos)
1272 local inv = meta:get_inventory()
1273 local to_stack = inv:get_stack(listname, index)
1274 if listname == "books" then
1275 if minetest.get_item_group(stack:get_name(), "book") ~= 0
1276 and to_stack:is_empty() then
1284 allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1285 local meta = minetest.get_meta(pos)
1286 local inv = meta:get_inventory()
1287 local stack = inv:get_stack(from_list, from_index)
1288 local to_stack = inv:get_stack(to_list, to_index)
1289 if to_list == "books" then
1290 if stack:get_name() == "default:book" and to_stack:is_empty() then
1298 on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
1299 minetest.log("action", player:get_player_name()..
1300 " moves stuff in bookshelf at "..minetest.pos_to_string(pos))
1302 on_metadata_inventory_put = function(pos, listname, index, stack, player)
1303 minetest.log("action", player:get_player_name()..
1304 " moves stuff to bookshelf at "..minetest.pos_to_string(pos))
1306 on_metadata_inventory_take = function(pos, listname, index, stack, player)
1307 minetest.log("action", player:get_player_name()..
1308 " takes stuff from bookshelf at "..minetest.pos_to_string(pos))
1314 minetest.register_node("default:sign_wall", {
1315 description = "Sign",
1316 drawtype = "nodebox",
1317 tiles = {"default_sign.png"},
1318 inventory_image = "default_sign_wall.png",
1319 wield_image = "default_sign_wall.png",
1320 paramtype = "light",
1321 paramtype2 = "wallmounted",
1322 sunlight_propagates = true,
1323 is_ground_content = false,
1326 type = "wallmounted",
1327 wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
1328 wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
1329 wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
1331 groups = {choppy=2,dig_immediate=2,attached_node=1},
1332 legacy_wallmounted = true,
1333 sounds = default.node_sound_defaults(),
1335 on_construct = function(pos)
1336 --local n = minetest.get_node(pos)
1337 local meta = minetest.get_meta(pos)
1338 meta:set_string("formspec", "field[text;;${text}]")
1339 meta:set_string("infotext", "\"\"")
1341 on_receive_fields = function(pos, formname, fields, sender)
1342 --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
1343 if minetest.is_protected(pos, sender:get_player_name()) then
1344 minetest.record_protection_violation(pos, sender:get_player_name())
1347 local meta = minetest.get_meta(pos)
1348 if not fields.text then return end
1349 minetest.log("action", (sender:get_player_name() or "").." wrote \""..fields.text..
1350 "\" to sign at "..minetest.pos_to_string(pos))
1351 meta:set_string("text", fields.text)
1352 meta:set_string("infotext", '"'..fields.text..'"')
1356 minetest.register_node("default:ladder", {
1357 description = "Ladder",
1358 drawtype = "signlike",
1359 tiles = {"default_ladder.png"},
1360 inventory_image = "default_ladder.png",
1361 wield_image = "default_ladder.png",
1362 paramtype = "light",
1363 paramtype2 = "wallmounted",
1366 is_ground_content = false,
1368 type = "wallmounted",
1369 --wall_top = = <default>
1370 --wall_bottom = = <default>
1371 --wall_side = = <default>
1373 groups = {choppy=2,oddly_breakable_by_hand=3,flammable=2},
1374 legacy_wallmounted = true,
1375 sounds = default.node_sound_wood_defaults(),
1378 local fence_texture = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126"
1379 minetest.register_node("default:fence_wood", {
1380 description = "Wooden Fence",
1381 drawtype = "fencelike",
1382 tiles = {"default_wood.png"},
1383 inventory_image = fence_texture,
1384 wield_image = fence_texture,
1385 paramtype = "light",
1386 is_ground_content = false,
1389 fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
1391 groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2},
1392 sounds = default.node_sound_wood_defaults(),
1397 minetest.register_node("default:glass", {
1398 description = "Glass",
1399 drawtype = "glasslike_framed_optional",
1400 tiles = {"default_glass.png", "default_glass_detail.png"},
1401 inventory_image = minetest.inventorycube("default_glass.png"),
1402 paramtype = "light",
1403 sunlight_propagates = true,
1404 is_ground_content = false,
1405 groups = {cracky=3,oddly_breakable_by_hand=3},
1406 sounds = default.node_sound_glass_defaults(),
1409 minetest.register_node("default:obsidian_glass", {
1410 description = "Obsidian Glass",
1411 drawtype = "glasslike",
1412 tiles = {"default_obsidian_glass.png"},
1413 paramtype = "light",
1414 is_ground_content = false,
1415 sunlight_propagates = true,
1416 sounds = default.node_sound_glass_defaults(),
1417 groups = {cracky=3,oddly_breakable_by_hand=3},
1422 minetest.register_node("default:rail", {
1423 description = "Rail",
1424 drawtype = "raillike",
1425 tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
1426 inventory_image = "default_rail.png",
1427 wield_image = "default_rail.png",
1428 paramtype = "light",
1430 is_ground_content = false,
1433 -- but how to specify the dimensions for curved and sideways rails?
1434 fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
1436 groups = {bendy=2,dig_immediate=2,attached_node=1},
1441 minetest.register_node("default:brick", {
1442 description = "Brick Block",
1443 tiles = {"default_brick.png"},
1444 is_ground_content = false,
1445 groups = {cracky=3},
1446 sounds = default.node_sound_stone_defaults(),
1453 minetest.register_node("default:cloud", {
1454 description = "Cloud",
1455 tiles = {"default_cloud.png"},
1456 sounds = default.node_sound_defaults(),
1457 groups = {not_in_creative_inventory=1},
1460 minetest.register_node("default:nyancat", {
1461 description = "Nyan Cat",
1462 tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png",
1463 "default_nc_side.png", "default_nc_back.png", "default_nc_front.png"},
1464 paramtype2 = "facedir",
1465 groups = {cracky=2},
1466 is_ground_content = false,
1467 legacy_facedir_simple = true,
1468 sounds = default.node_sound_defaults(),
1471 minetest.register_node("default:nyancat_rainbow", {
1472 description = "Nyan Cat Rainbow",
1474 "default_nc_rb.png^[transformR90", "default_nc_rb.png^[transformR90",
1475 "default_nc_rb.png", "default_nc_rb.png"
1477 paramtype2 = "facedir",
1478 groups = {cracky=2},
1479 is_ground_content = false,
1480 sounds = default.node_sound_defaults(),