From 20cc845940d535e383ba805f593d32c62a1390a1 Mon Sep 17 00:00:00 2001 From: epCode Date: Wed, 16 Dec 2020 10:55:56 -0800 Subject: [PATCH] Transforms wielditem relative to held item --- mods/ITEMS/mcl_armor/armor.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mods/ITEMS/mcl_armor/armor.lua b/mods/ITEMS/mcl_armor/armor.lua index 69801d010..2085635eb 100644 --- a/mods/ITEMS/mcl_armor/armor.lua +++ b/mods/ITEMS/mcl_armor/armor.lua @@ -94,6 +94,16 @@ armor.def = { } armor.update_player_visuals = function(self, player) + + local player_holding = player:get_wielded_item():get_name() + if string.find(player_holding,"mcl_tools:") or player_holding == "mcl_mobitems:bone" or player_holding == "mcl_fishing:fishing_rod" then + player:set_bone_position("Wield_Item", vector.new(0,3.9,1.3), vector.new(90,0,0)) + elseif string.find(player_holding, "mcl_bows:bow") then + player:set_bone_position("Wield_Item", vector.new(.5,4.5,-1.6), vector.new(90,0,20)) + else + player:set_bone_position("Wield_Item", vector.new(-1.5,4.9,1.8), vector.new(135,0,90)) + end + if not player then return end