From df73f47285ee651f922e2a273de890aa321a64c8 Mon Sep 17 00:00:00 2001 From: upsilon Date: Wed, 21 Jun 2017 10:51:20 +0200 Subject: [PATCH] Automatically fill the "item" field of the arrow luaentity if not existing --- init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.lua b/init.lua index 2870840..523677b 100644 --- a/init.lua +++ b/init.lua @@ -47,6 +47,9 @@ local function shoot_arrow(itemstack, player, throw_itself) local luaentity = obj:get_luaentity() luaentity.player = player:get_player_name() + if not luaentity.item then + luaentity.item = arrow + end if luaentity.on_throw then if luaentity.on_throw(pos, player, ((player:get_wield_index()+1) % inventory:get_size("main")) + 1, luaentity.data, luaentity) == false then