2023-01-07 21:26:50 +01:00
|
|
|
minetest.register_craftitem("amogus_items:amogus", {
|
|
|
|
description = "Amogus",
|
|
|
|
inventory_image = "amogus_item.png",
|
2023-01-08 00:11:47 +01:00
|
|
|
|
2023-01-07 21:26:50 +01:00
|
|
|
on_use = function(itemstack, user)
|
|
|
|
minetest.sound_play("amogus_sound", {
|
|
|
|
pos = user:get_pos(),
|
|
|
|
gain = 1.0,
|
|
|
|
max_hear_distance = 5
|
|
|
|
})
|
2023-01-08 00:11:47 +01:00
|
|
|
end,
|
|
|
|
|
|
|
|
--on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
-- local pos = pointed_thing.above
|
|
|
|
-- local dir = placer:get_look_dir()
|
|
|
|
-- local yaw = math.atan(dir.x/dir.z)
|
|
|
|
-- if dir.z > 0 then
|
|
|
|
-- yaw = yaw + math.pi
|
|
|
|
-- end
|
|
|
|
-- minetest.add_entity(pos, "amogus_entities:amogus", yaw)
|
|
|
|
--end
|
|
|
|
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
if pointed_thing.type == "node" then
|
|
|
|
local pos = pointed_thing.above
|
|
|
|
minetest.add_entity(pos, "amogus_entities:amogus")
|
|
|
|
end
|
|
|
|
return itemstack
|
|
|
|
end
|
2023-01-07 21:26:50 +01:00
|
|
|
})
|