minetest_x_bows/nodes.lua

37 lines
1.0 KiB
Lua
Raw Normal View History

2022-10-28 10:51:49 -05:00
local S = minetest.get_translator(minetest.get_current_modname())
2021-03-13 20:39:42 -06:00
minetest.register_node('x_bows:target', {
2022-10-28 10:51:49 -05:00
description = S('Target'),
short_description = S('Target'),
2022-11-03 12:06:43 -05:00
tiles = { 'x_bows_target.png' },
2022-10-16 15:02:04 -05:00
is_ground_content = false,
2022-11-03 12:06:43 -05:00
groups = { snappy = 3, flammable = 4, fall_damage_add_percent = -30 },
2022-10-26 22:59:36 -05:00
sounds = minetest.global_exists('default') and default.node_sound_leaves_defaults() or {},
2022-11-03 12:06:43 -05:00
mesecons = { receptor = { state = 'off' } },
2022-10-20 08:13:35 -05:00
---@param pos Vector
---@param elapsed number
---@return boolean
2022-11-03 12:06:43 -05:00
on_timer = function(pos, elapsed)
2022-10-20 08:13:35 -05:00
if XBows.mesecons then
mesecon.receptor_off(pos)
end
2022-10-16 15:02:04 -05:00
return false
2022-10-20 08:13:35 -05:00
end
2021-03-13 20:39:42 -06:00
})
minetest.register_craft({
2022-10-16 15:02:04 -05:00
type = 'fuel',
recipe = 'x_bows:target',
2022-10-20 08:13:35 -05:00
burntime = 3
2021-03-13 20:39:42 -06:00
})
minetest.register_craft({
2022-10-16 15:02:04 -05:00
output = 'x_bows:target',
recipe = {
2022-11-03 12:06:43 -05:00
{ '', 'default:mese_crystal', '' },
{ 'default:mese_crystal', 'farming:straw', 'default:mese_crystal' },
{ '', 'default:mese_crystal', '' },
2022-10-16 15:02:04 -05:00
}
2021-03-13 20:39:42 -06:00
})