From 3d13000599f9aa69847a79424f1bed36497e8d54 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 22 May 2022 19:47:53 +0200 Subject: [PATCH] tweak detaching behavior --- mods/ENTITIES/mobs_mc/parrot.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/parrot.lua b/mods/ENTITIES/mobs_mc/parrot.lua index cf380e1c9..ee1a08de8 100644 --- a/mods/ENTITIES/mobs_mc/parrot.lua +++ b/mods/ENTITIES/mobs_mc/parrot.lua @@ -128,7 +128,10 @@ mcl_mobs:register_mob("mobs_mc:parrot", { for _,o in pairs(p:get_children()) do local l = o:get_luaentity() if l and l.name == "mobs_mc:parrot" then - if minetest.get_node(vector.offset(p:get_pos(),0,-1,0)).name == "air" then + local n1 = minetest.get_node(vector.offset(p:get_pos(),0,-0.6,0)).name + local n2 = minetest.get_node(vector.offset(p:get_pos(),0,0,0)).name + local n3 = minetest.get_node(vector.offset(p:get_pos(),0,1,0)).name + if n1 == "air" or minetest.get_item_group(n2,"water") ~= 0 or minetest.get_item_group(n2,"lava") ~= 0 then o:set_detach() end end