2024-12-05 15:47:52 +01:00
local S = core.get_translator ( core.get_current_modname ( ) )
2019-03-07 21:35:02 +01:00
2018-05-07 15:29:17 +02:00
local BOW_DURABILITY = 385
2018-05-07 16:42:51 +02:00
-- Charging time in microseconds
2020-07-21 01:07:10 +02:00
local BOW_CHARGE_TIME_HALF = 200000 -- bow level 1
local BOW_CHARGE_TIME_FULL = 500000 -- bow level 2 (full charge)
2018-05-07 15:29:17 +02:00
2018-05-07 20:31:40 +02:00
-- Factor to multiply with player speed while player uses bow
2018-05-07 20:37:45 +02:00
-- This emulates the sneak speed.
local PLAYER_USE_BOW_SPEED = tonumber ( minetest.settings : get ( " movement_speed_crouch " ) ) / tonumber ( minetest.settings : get ( " movement_speed_walk " ) )
2018-05-07 20:31:40 +02:00
2018-05-07 16:25:46 +02:00
-- TODO: Use Minecraft speed (ca. 53 m/s)
-- Currently nerfed because at full speed the arrow would easily get out of the range of the loaded map.
2020-07-21 01:49:10 +02:00
local BOW_MAX_SPEED = 40
2018-05-07 16:25:46 +02:00
2018-05-07 16:42:51 +02:00
--[[ Store the charging state of each player.
keys : player name
value :
2018-05-07 17:43:39 +02:00
nil = not charging or player not existing
2018-05-07 16:42:51 +02:00
number : currently charging , the number is the time from minetest.get_us_time
in which the charging has started
] ]
2018-05-07 15:29:17 +02:00
local bow_load = { }
2018-05-07 17:43:39 +02:00
-- Another player table, this one stores the wield index of the bow being charged
local bow_index = { }
2024-12-29 04:49:43 +01:00
-- And yet another player table, this one stores the load level of the bow
local bow_load_level = { }
2023-12-03 14:57:13 +01:00
-- define FOV modifier(s)
2023-12-10 00:14:16 +01:00
mcl_fovapi.register_modifier ( {
name = " bowcomplete " ,
fov_factor = 0.8 ,
time = 1 ,
2023-12-10 00:20:43 +01:00
reset_time = 0.3 ,
2023-12-10 00:14:16 +01:00
is_multiplier = true ,
} )
2023-12-03 14:57:13 +01:00
2021-05-28 00:34:58 +02:00
function mcl_bows . shoot_arrow ( arrow_item , pos , dir , yaw , shooter , power , damage , is_critical , bow_stack , collectable )
2024-09-09 13:36:46 +02:00
power = power or BOW_MAX_SPEED
damage = damage or 3
2024-09-16 02:27:18 +02:00
local obj = vl_projectile.create ( arrow_item .. " _entity " , {
2024-09-09 13:36:46 +02:00
pos = pos ,
dir = dir ,
velocity = power ,
owner = shooter ,
} )
2020-11-06 15:05:31 +01:00
local knockback
2020-11-05 15:25:44 +01:00
if bow_stack then
2020-11-06 15:05:31 +01:00
local enchantments = mcl_enchanting.get_enchantments ( bow_stack )
if enchantments.power then
damage = damage + ( enchantments.power + 1 ) / 4
end
if enchantments.punch then
2023-12-18 22:31:38 +01:00
knockback = enchantments.punch * 24
2023-12-17 20:59:18 +01:00
else
knockback = 4.875
2020-11-05 15:25:44 +01:00
end
2021-01-27 20:11:02 +01:00
if enchantments.flame then
mcl_burning.set_on_fire ( obj , math.huge )
end
2020-11-05 15:25:44 +01:00
end
2018-05-07 15:29:17 +02:00
local le = obj : get_luaentity ( )
2021-04-14 15:46:52 +02:00
le._source_object = shooter
2018-05-07 15:29:17 +02:00
le._damage = damage
2020-08-19 14:45:37 +02:00
le._is_critical = is_critical
2020-11-06 15:05:31 +01:00
le._knockback = knockback
2021-01-27 16:01:04 +01:00
le._collectable = collectable
2024-05-23 00:54:39 +02:00
le._arrow_item = arrow_item
2024-12-05 15:47:52 +01:00
local item_def = core.registered_items [ le._arrow_item ]
2024-08-31 00:40:01 +02:00
if item_def and item_def._arrow_image then
2024-12-05 15:57:31 +01:00
obj : set_properties ( { textures = item_def._arrow_image } )
2024-08-31 00:40:01 +02:00
end
2024-12-05 15:47:52 +01:00
core.sound_play ( " mcl_bows_bow_shoot " , { pos = pos , max_hear_distance = 16 } , true )
2021-05-29 16:12:33 +02:00
if shooter and shooter : is_player ( ) then
2024-09-09 13:36:46 +02:00
if le.player == " " then
le.player = shooter
2018-05-07 15:29:17 +02:00
end
2024-09-09 13:36:46 +02:00
le.node = shooter : get_inventory ( ) : get_stack ( " main " , 1 ) : get_name ( )
2018-05-07 15:29:17 +02:00
end
return obj
end
2021-05-28 00:34:58 +02:00
local function get_arrow ( player )
2018-05-07 15:29:17 +02:00
local inv = player : get_inventory ( )
local arrow_stack , arrow_stack_id
for i = 1 , inv : get_size ( " main " ) do
local it = inv : get_stack ( " main " , i )
if not it : is_empty ( ) and minetest.get_item_group ( it : get_name ( ) , " ammo_bow " ) ~= 0 then
arrow_stack = it
arrow_stack_id = i
break
end
end
return arrow_stack , arrow_stack_id
end
2021-05-28 00:34:58 +02:00
local function player_shoot_arrow ( itemstack , player , power , damage , is_critical )
2018-05-07 15:29:17 +02:00
local arrow_stack , arrow_stack_id = get_arrow ( player )
2020-08-19 15:05:23 +02:00
local arrow_itemstring
2020-11-01 13:44:05 +01:00
local has_infinity_enchantment = mcl_enchanting.has_enchantment ( player : get_wielded_item ( ) , " infinity " )
2021-01-27 16:01:04 +01:00
local infinity_used = false
2020-07-20 00:56:18 +02:00
2020-08-19 15:05:23 +02:00
if minetest.is_creative_enabled ( player : get_player_name ( ) ) then
if arrow_stack then
arrow_itemstring = arrow_stack : get_name ( )
else
arrow_itemstring = " mcl_bows:arrow "
end
2024-11-24 13:58:25 +01:00
infinity_used = true
2020-08-19 15:05:23 +02:00
else
2018-05-07 15:29:17 +02:00
if not arrow_stack then
return false
end
2020-08-19 15:05:23 +02:00
arrow_itemstring = arrow_stack : get_name ( )
2021-01-27 16:01:04 +01:00
if has_infinity_enchantment and minetest.get_item_group ( arrow_itemstring , " ammo_bow_regular " ) > 0 then
infinity_used = true
else
2020-10-27 20:02:46 +01:00
arrow_stack : take_item ( )
end
2018-05-07 15:29:17 +02:00
local inv = player : get_inventory ( )
inv : set_stack ( " main " , arrow_stack_id , arrow_stack )
end
2020-08-19 15:05:23 +02:00
if not arrow_itemstring then
return false
end
2019-02-01 06:33:07 +01:00
local playerpos = player : get_pos ( )
2018-05-07 15:29:17 +02:00
local dir = player : get_look_dir ( )
local yaw = player : get_look_horizontal ( )
2021-01-27 16:01:04 +01:00
mcl_bows.shoot_arrow ( arrow_itemstring , { x = playerpos.x , y = playerpos.y + 1.5 , z = playerpos.z } , dir , yaw , player , power , damage , is_critical , player : get_wielded_item ( ) , not infinity_used )
2018-05-07 15:29:17 +02:00
return true
end
2018-05-07 17:56:17 +02:00
-- Bow item, uncharged state
2018-05-07 23:10:49 +02:00
minetest.register_tool ( " mcl_bows:bow " , {
2019-03-07 21:35:02 +01:00
description = S ( " Bow " ) ,
2020-03-12 01:35:11 +01:00
_tt_help = S ( " Launches arrows " ) ,
2019-03-07 21:35:02 +01:00
_doc_items_longdesc = S ( " Bows are ranged weapons to shoot arrows at your foes. " ) .. " \n " ..
S ( " The speed and damage of the arrow increases the longer you charge. The regular damage of the arrow is between 1 and 9. At full charge, there's also a 20% of a critical hit, dealing 10 damage instead. " ) ,
2023-12-25 23:56:39 +01:00
_doc_items_usagehelp = S ( " To use the bow, you first need to have at least one arrow anywhere in your inventory (unless in Creative Mode). Hold down the right mouse button (or the zoom key) to charge, release to shoot. " ) ,
2018-05-07 15:29:17 +02:00
_doc_items_durability = BOW_DURABILITY ,
2018-05-07 23:10:49 +02:00
inventory_image = " mcl_bows_bow.png " ,
2021-04-05 14:32:48 +02:00
wield_scale = mcl_vars.tool_wield_scale ,
2018-05-07 15:29:17 +02:00
stack_max = 1 ,
2020-11-12 11:37:50 +01:00
range = 4 ,
2018-05-07 15:29:17 +02:00
-- Trick to disable digging as well
2020-11-12 11:37:50 +01:00
on_use = function ( ) return end ,
2021-01-06 12:43:09 +01:00
on_place = function ( itemstack , player , pointed_thing )
if pointed_thing and pointed_thing.type == " node " then
-- Call on_rightclick if the pointed node defines it
local node = minetest.get_node ( pointed_thing.under )
if player and not player : get_player_control ( ) . sneak then
if minetest.registered_nodes [ node.name ] and minetest.registered_nodes [ node.name ] . on_rightclick then
return minetest.registered_nodes [ node.name ] . on_rightclick ( pointed_thing.under , node , player , itemstack ) or itemstack
end
end
end
itemstack : get_meta ( ) : set_string ( " active " , " true " )
return itemstack
end ,
on_secondary_use = function ( itemstack )
itemstack : get_meta ( ) : set_string ( " active " , " true " )
return itemstack
end ,
2024-09-17 07:22:05 +02:00
groups = { weapon = 1 , weapon_ranged = 1 , bow = 1 , cannot_block = 1 , enchantability = 1 } ,
2024-09-25 18:30:59 +02:00
touch_interaction = " short_dig_long_place " ,
2020-12-21 15:12:24 +01:00
_mcl_uses = 385 ,
2018-05-07 15:29:17 +02:00
} )
2018-05-07 20:31:40 +02:00
-- Iterates through player inventory and resets all the bows in "charging" state back to their original stage
2021-05-28 00:34:58 +02:00
local function reset_bows ( player )
2018-05-07 20:31:40 +02:00
local inv = player : get_inventory ( )
local list = inv : get_list ( " main " )
for place , stack in pairs ( list ) do
2021-01-06 12:43:09 +01:00
if stack : get_name ( ) == " mcl_bows:bow " or stack : get_name ( ) == " mcl_bows:bow_enchanted " then
stack : get_meta ( ) : set_string ( " active " , " " )
elseif stack : get_name ( ) == " mcl_bows:bow_0 " or stack : get_name ( ) == " mcl_bows:bow_1 " or stack : get_name ( ) == " mcl_bows:bow_2 " then
2018-05-07 23:10:49 +02:00
stack : set_name ( " mcl_bows:bow " )
2021-01-06 12:43:09 +01:00
stack : get_meta ( ) : set_string ( " active " , " " )
2018-05-07 20:31:40 +02:00
list [ place ] = stack
2020-10-27 19:53:49 +01:00
elseif stack : get_name ( ) == " mcl_bows:bow_0_enchanted " or stack : get_name ( ) == " mcl_bows:bow_1_enchanted " or stack : get_name ( ) == " mcl_bows:bow_2_enchanted " then
stack : set_name ( " mcl_bows:bow_enchanted " )
2021-01-06 12:43:09 +01:00
stack : get_meta ( ) : set_string ( " active " , " " )
2020-10-27 19:53:49 +01:00
list [ place ] = stack
2018-05-07 20:31:40 +02:00
end
end
inv : set_list ( " main " , list )
end
-- Resets the bow charging state and player speed. To be used when the player is no longer charging the bow
2021-05-28 00:34:58 +02:00
local function reset_bow_state ( player , also_reset_bows )
2023-12-03 14:57:13 +01:00
-- clear the FOV change from the player.
mcl_fovapi.remove_modifier ( player , " bowcomplete " ) -- for the complete zoom in FOV Modifier.
2018-05-07 20:31:40 +02:00
bow_load [ player : get_player_name ( ) ] = nil
bow_index [ player : get_player_name ( ) ] = nil
2024-12-29 04:49:43 +01:00
bow_load_level [ player : get_player_name ( ) ] = nil
2018-10-23 18:51:19 +02:00
if minetest.get_modpath ( " playerphysics " ) then
playerphysics.remove_physics_factor ( player , " speed " , " mcl_bows:use_bow " )
2018-05-07 20:31:40 +02:00
end
if also_reset_bows then
reset_bows ( player )
end
end
2024-12-29 04:49:43 +01:00
-- Old Bows in charging state, purely for conversion if some accidentally stayed behind
2018-05-07 17:56:17 +02:00
for level = 0 , 2 do
2018-05-07 23:10:49 +02:00
minetest.register_tool ( " mcl_bows:bow_ " .. level , {
2019-03-07 21:35:02 +01:00
description = S ( " Bow " ) ,
2018-05-07 17:56:17 +02:00
_doc_items_create_entry = false ,
2024-12-29 04:49:43 +01:00
inventory_image = " mcl_bows_bow.png^vl_unknown.png " ,
2021-04-05 14:32:48 +02:00
wield_scale = mcl_vars.tool_wield_scale ,
2018-05-07 17:56:17 +02:00
stack_max = 1 ,
range = 0 , -- Pointing range to 0 to prevent punching with bow :D
2024-09-17 07:22:05 +02:00
groups = { not_in_creative_inventory = 1 , not_in_craft_guide = 1 , bow = 1 , cannot_block = 1 , enchantability = 1 } ,
2020-11-12 11:37:50 +01:00
-- Trick to disable digging as well
2024-12-29 04:49:43 +01:00
on_use = function ( _ , user ) reset_bow_state ( user , true ) return end ,
2018-05-07 17:56:17 +02:00
on_drop = function ( itemstack , dropper , pos )
2018-06-13 17:20:10 +02:00
reset_bow_state ( dropper )
2021-01-06 12:43:09 +01:00
itemstack : get_meta ( ) : set_string ( " active " , " " )
2020-11-25 12:47:27 +01:00
if mcl_enchanting.is_enchanted ( itemstack : get_name ( ) ) then
2020-10-27 19:53:49 +01:00
itemstack : set_name ( " mcl_bows:bow_enchanted " )
else
itemstack : set_name ( " mcl_bows:bow " )
end
2018-05-07 17:56:17 +02:00
minetest.item_drop ( itemstack , dropper , pos )
itemstack : take_item ( )
return itemstack
end ,
2018-05-07 23:22:54 +02:00
-- Prevent accidental interaction with itemframes and other nodes
2024-12-29 04:49:43 +01:00
on_place = function ( itemstack , placer )
reset_bow_state ( placer , true )
2018-05-07 23:22:54 +02:00
return itemstack
end ,
2024-09-25 18:30:59 +02:00
touch_interaction = " short_dig_long_place " ,
2020-12-21 15:12:24 +01:00
_mcl_uses = 385 ,
2018-05-07 17:56:17 +02:00
} )
end
2018-05-07 15:29:17 +02:00
2018-05-07 17:46:52 +02:00
2018-05-07 15:29:17 +02:00
controls.register_on_release ( function ( player , key , time )
2023-12-25 23:50:06 +01:00
if key ~= " RMB " and key ~= " zoom " then return end
2018-05-07 15:29:17 +02:00
local wielditem = player : get_wielded_item ( )
2024-12-29 04:49:43 +01:00
local name = wielditem : get_name ( )
if name == " mcl_bows:bow " or name == " mcl_bows:bow_enchanted " then
local meta = wielditem : get_meta ( )
local enchanted = mcl_enchanting.is_enchanted ( name )
2018-05-07 16:25:46 +02:00
local speed , damage
2018-05-07 16:42:51 +02:00
local p_load = bow_load [ player : get_player_name ( ) ]
local charge
-- Type sanity check
if type ( p_load ) == " number " then
charge = minetest.get_us_time ( ) - p_load
else
-- In case something goes wrong ...
-- Just assume minimum charge.
charge = 0
2018-05-07 23:10:49 +02:00
minetest.log ( " warning " , " [mcl_bows] Player " .. player : get_player_name ( ) .. " fires arrow with non-numeric bow_load! " )
2018-05-07 16:42:51 +02:00
end
2018-05-07 16:25:46 +02:00
charge = math.max ( math.min ( charge , BOW_CHARGE_TIME_FULL ) , 0 )
2018-05-07 16:42:51 +02:00
2018-05-07 16:25:46 +02:00
local charge_ratio = charge / BOW_CHARGE_TIME_FULL
charge_ratio = math.max ( math.min ( charge_ratio , 1 ) , 0 )
-- Calculate damage and speed
-- Fully charged
2020-08-19 14:45:37 +02:00
local is_critical = false
2018-05-07 16:25:46 +02:00
if charge >= BOW_CHARGE_TIME_FULL then
speed = BOW_MAX_SPEED
2024-03-21 03:10:05 +01:00
local r = math.random ( 1 , 5 ) + mcl_luck.get_luck ( player : get_player_name ( ) )
if r > 4 then
-- 20% chance for critical hit (by default)
damage = 10 + math.floor ( ( r - 5 ) / 5 ) -- mega crit (over crit) with high luck
2020-08-19 14:45:37 +02:00
is_critical = true
2018-05-07 15:29:17 +02:00
else
2018-05-07 16:25:46 +02:00
damage = 9
2018-05-07 15:29:17 +02:00
end
2018-05-07 16:25:46 +02:00
-- Partially charged
else
-- Linear speed and damage increase
speed = math.max ( 4 , BOW_MAX_SPEED * charge_ratio )
damage = math.max ( 1 , math.floor ( 9 * charge_ratio ) )
2018-05-07 15:29:17 +02:00
end
2018-05-07 16:25:46 +02:00
2021-05-23 01:06:34 +02:00
local has_shot = player_shoot_arrow ( wielditem , player , speed , damage , is_critical )
2021-01-06 12:43:09 +01:00
2020-10-27 19:53:49 +01:00
if enchanted then
2024-12-29 04:49:43 +01:00
meta : set_string ( " inventory_image " , " mcl_bows_bow.png " .. mcl_enchanting.overlay )
2020-10-27 19:53:49 +01:00
else
2024-12-29 04:49:43 +01:00
meta : set_string ( " inventory_image " , " mcl_bows_bow.png " )
2020-10-27 19:53:49 +01:00
end
2021-01-06 12:43:09 +01:00
2020-07-10 16:08:40 +02:00
if has_shot and not minetest.is_creative_enabled ( player : get_player_name ( ) ) then
2020-11-02 15:09:11 +01:00
local durability = BOW_DURABILITY
local unbreaking = mcl_enchanting.get_enchantment ( wielditem , " unbreaking " )
if unbreaking > 0 then
durability = durability * ( unbreaking + 1 )
end
wielditem : add_wear ( 65535 / durability )
2024-05-22 20:55:07 +02:00
tt.reload_itemstack_description ( wielditem ) -- update tooltip
2018-05-07 15:29:17 +02:00
end
player : set_wielded_item ( wielditem )
2018-05-07 20:31:40 +02:00
reset_bow_state ( player , true )
2018-05-07 15:29:17 +02:00
end
end )
controls.register_on_hold ( function ( player , key , time )
2020-08-19 15:05:23 +02:00
local name = player : get_player_name ( )
local creative = minetest.is_creative_enabled ( name )
2023-12-25 23:50:06 +01:00
if ( key ~= " RMB " and key ~= " zoom " ) or not ( creative or get_arrow ( player ) ) then
2018-05-07 15:29:17 +02:00
return
end
local wielditem = player : get_wielded_item ( )
2024-12-29 04:49:43 +01:00
local meta = wielditem : get_meta ( )
2023-12-25 23:50:06 +01:00
if bow_load [ name ] == nil
and ( wielditem : get_name ( ) == " mcl_bows:bow " or wielditem : get_name ( ) == " mcl_bows:bow_enchanted " )
2024-12-29 04:49:43 +01:00
and ( meta : get ( " active " ) or key == " zoom " ) and ( creative or get_arrow ( player ) ) then
2023-12-25 23:50:06 +01:00
local enchanted = mcl_enchanting.is_enchanted ( wielditem : get_name ( ) )
2024-12-29 04:49:43 +01:00
local im_string = " mcl_bows_bow_0.png "
if enchanted then im_string = im_string .. mcl_enchanting.overlay end
meta : set_string ( " inventory_image " , im_string )
2023-12-25 23:50:06 +01:00
player : set_wielded_item ( wielditem )
if minetest.get_modpath ( " playerphysics " ) then
-- Slow player down when using bow
playerphysics.add_physics_factor ( player , " speed " , " mcl_bows:use_bow " , PLAYER_USE_BOW_SPEED )
end
bow_load [ name ] = minetest.get_us_time ( )
2024-12-29 04:49:43 +01:00
bow_load_level [ name ] = 0
2023-12-25 23:50:06 +01:00
bow_index [ name ] = player : get_wield_index ( )
2024-12-29 04:49:43 +01:00
core.chat_send_all ( " init " )
2023-12-03 14:57:13 +01:00
2023-12-25 23:50:06 +01:00
-- begin Bow Zoom.
mcl_fovapi.apply_modifier ( player , " bowcomplete " )
2018-05-07 15:29:17 +02:00
else
2018-05-07 17:43:39 +02:00
if player : get_wield_index ( ) == bow_index [ name ] then
2024-12-29 04:49:43 +01:00
local level = 0
2018-05-07 17:43:39 +02:00
if type ( bow_load [ name ] ) == " number " then
2024-12-29 04:49:43 +01:00
if minetest.get_us_time ( ) - bow_load [ name ] >= BOW_CHARGE_TIME_FULL then
if bow_load_level [ name ] == 2 then return end
level = 2
bow_load_level [ name ] = 2
elseif minetest.get_us_time ( ) - bow_load [ name ] >= BOW_CHARGE_TIME_HALF then
if bow_load_level [ name ] == 1 then return end
level = 1
bow_load_level [ name ] = 1
else return end
2018-05-07 17:43:39 +02:00
else
2024-12-29 04:49:43 +01:00
level = - 1
bow_load_level [ name ] = nil
end
local im_string = level == - 1 and " mcl_bows_bow.png " or " mcl_bows_bow_ " .. level .. " .png "
if wielditem : get_name ( ) == " mcl_bows:bow_enchanted " then
im_string = im_string .. mcl_enchanting.overlay
2018-05-07 15:29:17 +02:00
end
2024-12-29 04:49:43 +01:00
meta : set_string ( " inventory_image " , im_string )
core.chat_send_all ( im_string )
2018-05-07 17:43:39 +02:00
player : set_wielded_item ( wielditem )
2018-05-07 15:29:17 +02:00
else
2018-05-07 20:31:40 +02:00
reset_bow_state ( player , true )
2018-05-07 15:29:17 +02:00
end
end
end )
minetest.register_globalstep ( function ( dtime )
2021-03-16 17:35:46 +01:00
for _ , player in pairs ( minetest.get_connected_players ( ) ) do
2018-05-07 17:43:39 +02:00
local name = player : get_player_name ( )
2018-05-07 15:29:17 +02:00
local wielditem = player : get_wielded_item ( )
2018-05-07 17:43:39 +02:00
local wieldindex = player : get_wield_index ( )
2024-12-29 04:49:43 +01:00
if type ( bow_load [ name ] ) == " number "
and ( ( wielditem : get_name ( ) ~= " mcl_bows:bow " and wielditem : get_name ( ) ~= " mcl_bows:bow_enchanted " )
or wieldindex ~= bow_index [ name ] ) then
2018-05-07 20:31:40 +02:00
reset_bow_state ( player , true )
2018-05-07 15:29:17 +02:00
end
end
end )
2018-05-07 17:43:39 +02:00
minetest.register_on_joinplayer ( function ( player )
reset_bows ( player )
end )
2018-05-07 16:42:51 +02:00
minetest.register_on_leaveplayer ( function ( player )
2018-05-07 20:31:40 +02:00
reset_bow_state ( player , true )
2018-05-07 16:42:51 +02:00
end )
2018-05-07 15:29:17 +02:00
if minetest.get_modpath ( " mcl_core " ) and minetest.get_modpath ( " mcl_mobitems " ) then
minetest.register_craft ( {
2021-05-29 16:12:33 +02:00
output = " mcl_bows:bow " ,
2018-05-07 15:29:17 +02:00
recipe = {
2021-05-29 16:12:33 +02:00
{ " " , " mcl_core:stick " , " mcl_mobitems:string " } ,
{ " mcl_core:stick " , " " , " mcl_mobitems:string " } ,
{ " " , " mcl_core:stick " , " mcl_mobitems:string " } ,
2018-05-07 15:29:17 +02:00
}
} )
minetest.register_craft ( {
2021-05-29 16:12:33 +02:00
output = " mcl_bows:bow " ,
2018-05-07 15:29:17 +02:00
recipe = {
2021-05-29 16:12:33 +02:00
{ " mcl_mobitems:string " , " mcl_core:stick " , " " } ,
{ " mcl_mobitems:string " , " " , " mcl_core:stick " } ,
{ " mcl_mobitems:string " , " mcl_core:stick " , " " } ,
2018-05-07 15:29:17 +02:00
}
} )
end
minetest.register_craft ( {
type = " fuel " ,
2020-11-01 17:24:57 +01:00
recipe = " group:bow " ,
2018-05-07 15:29:17 +02:00
burntime = 15 ,
} )