Skip to content

Instantly share code, notes, and snippets.

@Andrey2470T
Last active July 26, 2018 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Andrey2470T/63cf365e5057ede739580eb127882d7d to your computer and use it in GitHub Desktop.
Save Andrey2470T/63cf365e5057ede739580eb127882d7d to your computer and use it in GitHub Desktop.
minetest.register_node("medicine:medical_bag", {
description = "Medical Bag",
visual_scale = 0.5,
mesh = "medicine_bag.obj",
tiles = {"medical_bag.png"},
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy = 2},
drawtype = "mesh",
collision_box = {
type = "fixed",
fixed = {-0.5, -0.52, -0.24, 0.5, 0.23, 0.24}
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.52, -0.24, 0.5, 0.23, 0.24}
},
sounds = default.node_sound_leaves_defaults(),
on_construct = function (pos)
local meta = minetest.get_meta(pos)
meta:set_string("medical_bag_formspec",
"size[6, 5]" ..
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0, 1;6, 3]")
local inv = meta:get_inventory()
inv:set_size("main", 6*3)
end,
on_rightclick = function (pos, node, player, itemstack, pointed_thing)
minetest.show_formspec(player:get_player_name(), "medical_bag_inventory", minetest.get_meta(pos):get_string("medical_bag_formspec"))
end
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment