Need Help In Mod Development
I am working on a few mods, and I was wondering if there was a way to do some of this:
-----When you dig a chest/furnace, is there a way to make it drop it's contents? Like they appear on the ground where the node was, or it go into your inventory
-----Any GUI modifications for chests/furnaces?
-----Any simple way to make a chest use multiple nodes to work?
-----Any way to restrict a chest/furnace to be opened only by one person at a time?
-----Any way to keep people from looking in a locked chest?
Thanks if you have any answers. I know I could look through the forums, but it takes too much time on my part.
Also, if anyone can help me find my problem in this code, I'd be thankful. (looked in debug and it didn't help)
-----When you dig a chest/furnace, is there a way to make it drop it's contents? Like they appear on the ground where the node was, or it go into your inventory
-----Any GUI modifications for chests/furnaces?
-----Any simple way to make a chest use multiple nodes to work?
-----Any way to restrict a chest/furnace to be opened only by one person at a time?
-----Any way to keep people from looking in a locked chest?
Thanks if you have any answers. I know I could look through the forums, but it takes too much time on my part.
Also, if anyone can help me find my problem in this code, I'd be thankful. (looked in debug and it didn't help)
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_node("obsidiansidian:obsidiansidian_block", {
tile_images = {"obsidiansidian_block.png"},
inventory_image =
minetest.inventorycube("obsidiansidian_block.png"),
is_ground_content = true,
material = minetest.digprop_glasslike
(5.0), -- obsidiansidian is hard, but brittle
extra_dug_item = 'craft "obsidiansidian:obsidiansidian_shard" 1',
extra_dug_item_rarity = 20,
})
minetest.register_craftitem("obsidiansidian:obsidiansidian_shard", {
image =
"obsidiansidian_shard.png",
on_place_on_ground = craftitem_place_item,
})
minetest.register_craft({
output = 'tool
"obsidiansidian:obsidiansidian_knife"',
recipe = {
{'craft "obsidiansidian:obsidiansidian_shard"'},
{'craft "default:Stick"'},
}
})
minetest.register_tool("obsidiansidian:obsidiansidian_knife", {
image =
"obsidiansidian_knife.png",
basetime = 1.0,
dt_weight = 0.5,
dt_crackiness = 2,
dt_crumbliness = 4,
dt_cuttability = -0.5,
basedurability = 80,
dd_weight = 0,
dd_crackiness = 0,
dd_crumbliness = 0,
dd_cuttability =
0,
})
minetest.register_abm(
{nodenames = {"default:lava_source"},
interval = 1.0,
chance = 1,
action = function(pos, node,
active_obsidianject_count, active_obsidianject_count_wider)
for i=-1,1 do
for j=-1,1 do
for k=-
1,1 do
p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
n = minetest.env:get_node(p)
if (n.name=="default:water_flowing") or (n.name == "default:water_source") then
minetest.env:add_node(pos, {name="obsidiansidian:obsidiansidian_block"})
end
end
end
end
end
})
minetest.register_abm(
{nodenames = {"default:lava_flowing"},
interval = 1.0,
chance = 1,
action =
function(pos, node, active_obsidianject_count, active_obsidianject_count_wider)
for i=-1,1 do
for j=-1,1 do
for k=-1,1 do
p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
n =
minetest.env:get_node(p)
if (n.name=="default:water_flowing") or (n.name ==
"default:water_source") then
if (j==-1) then
minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, {name="cobsidianble"})
else
minetest.env:add_node(pos, {name="cobsidianble"})
end
end
end
end
end
end
})
-- Crafting
minetest.register_craft({
output = 'tool "obsidian:obsidian_sword"',
recipe = {
{'node "obsidian:obsidian_block"'},
{'node "obsidian:obsidian_block"'},
{'craft "default:stick"'},
}
})
minetest.register_craft({
output = 'tool "obsidian:obsidian_axe"',
recipe = {
{'node "obsidian:obsidian_block"', 'node "obsidian:obsidian_block"'},
{'node "obsidian:obsidian_block"', 'craft "default:stick"'},
{'', 'craft "default:stick"'},
}
})
minetest.register_craft({
output = 'tool "obsidian:obsidian_shovel"',
recipe = {
{'node "obsidian:obsidian_block"'},
{'craft "default:stick"'},
{'craft "default:stick"'},
}
})
minetest.register_craft({
output = 'tool "obsidian:obsidian_pick"',
recipe = {
{'node "obsidian:obsidian_block"', 'node "obsidian:obsidian_block"', 'node "obsidian:obsidian_block"'},
{'', 'craft "default:stick"', ''},
{'', 'craft "default:stick"', ''},
}
})
-- tools
minetest.register_tool("obsidian:obsidian_sword", {
image = "os.png",
basetime = 0,
dt_weight = 3,
dt_crackiness = 0,
dt_crumbliness = 1,
dt_cuttability = -10,
basedurability = 1000,
dd_weight = 0,
dd_crackiness = 0,
dd_crumbliness = 0,
dd_cuttability = 0,
})
minetest.register_tool("obsidian:obsidian_shovel", {
image = "osh.png",
basetime = 0,
dt_weight = 0.5,
dt_crackiness = 2,
dt_crumbliness = -1.5,
dt_cuttability = 0.0,
basedurability = 330,
dd_weight = 0,
dd_crackiness = 0,
dd_crumbliness = 0,
dd_cuttability = 0,
})
minetest.register_tool("obsidian:obsidian_pick", {
image = "op.png",
basetime = 0,
dt_weight = 0,
dt_crackiness = -0.5,
dt_crumbliness = 2,
dt_cuttability = 0,
basedurability = 333,
dd_weight = 0,
dd_crackiness = 0,
dd_crumbliness = 0,
dd_cuttability = 0,
})
minetest.register_tool("obsidian:obsidian_axe", {
image = "ob.png",
basetime = 0,
dt_weight = 3,
dt_crackiness = 0,
dt_crumbliness = 1,
dt_cuttability = -10,
basedurability = 1000,
dd_weight = 0,
dd_crackiness = 0,
dd_crumbliness = 0,
dd_cuttability = 0,
})
-- end
-- return false
-- end,
--