Fix possible crash when spawning piglin
This commit is contained in:
parent
d13d50333f
commit
88de3656b1
|
@ -119,8 +119,7 @@ local piglin = {
|
||||||
on_pick_up = function(self, itementity)
|
on_pick_up = function(self, itementity)
|
||||||
local item = itementity.itemstring:split(" ")[1]
|
local item = itementity.itemstring:split(" ")[1]
|
||||||
local it = ItemStack(itementity.itemstring)
|
local it = ItemStack(itementity.itemstring)
|
||||||
--return true --do not pick up
|
if item == "mcl_core:gold_ingot" and self.state ~= "attack" and self.gold_items and self.gold_items < 3 then
|
||||||
if item == "mcl_core:gold_ingot" and self.state ~= "attack" and self.gold_items < 3 then
|
|
||||||
it:take_item(1)
|
it:take_item(1)
|
||||||
self.state = "stand"
|
self.state = "stand"
|
||||||
self.object:set_animation({x=0,y=79})
|
self.object:set_animation({x=0,y=79})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user