From 9245c85296f33c14a4fec4741c2557534d437124 Mon Sep 17 00:00:00 2001 From: cora Date: Wed, 19 Oct 2022 22:38:05 +0200 Subject: [PATCH] Fix crash when golem tries to pickup item --- mods/ENTITIES/mobs_mc/iron_golem.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/iron_golem.lua b/mods/ENTITIES/mobs_mc/iron_golem.lua index 9f5a049b7..a55bba81d 100644 --- a/mods/ENTITIES/mobs_mc/iron_golem.lua +++ b/mods/ENTITIES/mobs_mc/iron_golem.lua @@ -48,13 +48,14 @@ mcl_mobs:register_mob("mobs_mc:iron_golem", { _got_poppy = false, pick_up = {"mcl_flowers:poppy"}, on_pick_up = function(self,n) - if n.itemstring:find("mcl_flowers:poppy") then + local it = ItemStack(n.itemstring) + if it:get_name() == "mcl_flowers:poppy" then if not self._got_poppy then self._got_poppy=true - return + it:take_item(1) end - return true end + return it end, replace_what = {"mcl_flowers:poppy"}, replace_with = {"air"},