From 915f88f21e70a84ebd4ecfc9dfd9aa3eae61d4f9 Mon Sep 17 00:00:00 2001 From: epCode Date: Thu, 25 Mar 2021 16:59:00 -0700 Subject: [PATCH] fix drops and taking whole stack while trading --- piglin.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/piglin.lua b/piglin.lua index 544f498..f2dbbca 100644 --- a/piglin.lua +++ b/piglin.lua @@ -108,10 +108,10 @@ local piglin = { on_rightclick = function(self, clicker) if clicker:is_player() and clicker:get_wielded_item():get_name() == "mcl_core:gold_ingot" and self.state ~= "attack" and self.gold_items < 3 then local item_gold = clicker:get_wielded_item() + item_gold:take_item(1) + clicker:set_wielded_item(item_gold) self.state = "stand" self.object:set_animation({x=0,y=79}) - item_gold:take_item(1) - clicker:set_wielded_item(item) self.trading = true self.gold_items = self.gold_items + 1 self.object:set_bone_position("Wield_Item", vector.new(-1.5,4.9,1.8), vector.new(135,0,90)) @@ -160,6 +160,12 @@ sword_piglin.on_spawn = function(self) self.weapon = self.base_texture[2] self.object:set_bone_position("Wield_Item", vector.new(0,3.9,1.3), vector.new(90,0,0)) end +sword_piglin.drops = { + {name = "mcl_tools:sword_gold", + chance = 10, + min = 1, + max = 1,}, +} sword_piglin.attack_type = "dogfight" sword_piglin.animation = { stand_speed = 30,