From 12a943e22210467f6ad23196a5cc8fe0e4ea95e7 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 9 May 2022 11:57:51 +0200 Subject: [PATCH] Make villagers homeless when bed is gone on return --- mods/ENTITIES/mobs_mc/villager.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 28a489e75..774cdb48c 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -946,6 +946,10 @@ local function go_home(entity) if vector.distance(b,s) < 10 then entity.state = "stand" set_velocity(entity,0) + local n=minetest.get_node(b) + if n and n.name ~= "mcl_beds:bed_red_bottom" then + entity.bed=nil --bed is gone, make villager homeless + end end end