lucky block added

This commit is contained in:
Kacper Kostka 2023-01-12 18:13:21 +01:00
parent 07d868dece
commit 343886f6ee
8 changed files with 49 additions and 1 deletions

View File

@ -183,5 +183,29 @@ minetest.register_node("amogus_blocks:dirt", {
--}),
})
minetest.register_alias("mapgen_water_source", "amogus_blocks:water")
--minetest.register_alias("mapgen_water_source", "amogus_blocks:water")
-- add lucky block with array of loot that can be easly edited
local loot = {
"amogus_items:amogus",
"amogus_items:sprite",
"amogus_items:coke",
"amogus_items:fanta",
"amogus_items:tomato",
"amogus_items:lightsaber_blue",
"amogus_items:lightsaber_red",
"amogus_items:lightsaber_green",
}
minetest.register_node("amogus_blocks:lucky_block", {
description = "Lucky Block",
tiles = {"luckyblock.png"},
groups = {cracky = 3},
on_punch = function(pos, node, puncher, pointed_thing)
local item = loot[math.random(#loot)]
minetest.add_item(pos, item)
minetest.remove_node(pos)
end
})
minetest.register_alias("mapgen_stone", "amogus_blocks:grass")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

View File

@ -100,3 +100,27 @@ minetest.register_tool("amogus_items:lightsaber_green", {
},
sound = {breaks = "amogus_sound"},
})
-- add lucky block with array of loot that can be easly edited
local loot = {
"amogus_items:amogus",
"amogus_items:sprite",
"amogus_items:coke",
"amogus_items:fanta",
"amogus_items:tomato",
"amogus_items:lightsaber_blue",
"amogus_items:lightsaber_red",
"amogus_items:lightsaber_green",
}
minetest.register_node("amogus_items:lucky_block", {
description = "Lucky Block",
tiles = {"luckyblock.png"},
groups = {cracky = 3},
on_punch = function(pos, node, puncher, pointed_thing)
local item = loot[math.random(#loot)]
minetest.add_item(pos, item)
minetest.remove_node(pos)
end
})