diff --git a/mods/ENTITIES/mobs_mc/iron_golem.lua b/mods/ENTITIES/mobs_mc/iron_golem.lua index 2d081e4fe..b79971b9b 100644 --- a/mods/ENTITIES/mobs_mc/iron_golem.lua +++ b/mods/ENTITIES/mobs_mc/iron_golem.lua @@ -4,6 +4,7 @@ --License for code WTFPL and otherwise stated in readmes local S = minetest.get_translator("mobs_mc") +local allow_nav_hacks = minetest.settings:get_bool("mcl_mob_allow_nav_hacks ",false) --################### --################### IRON GOLEM @@ -93,7 +94,7 @@ mcl_mobs.register_mob("mobs_mc:iron_golem", { self.home_timer = 0 if self._home and self.state ~= "attack" then local dist = vector.distance(self._home,self.object:get_pos()) - if dist >= tele_dist then + if allow_nav_hacks and dist >= tele_dist then self.object:set_pos(self._home) self.state = "stand" self.order = "follow" diff --git a/settingtypes.txt b/settingtypes.txt index c5d5d32c1..2054bb12a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -173,6 +173,10 @@ mcl_mob_active_range (Active mob range) int 48 0 256 # Zombie siege raid (default:false) mcl_raids_zombie_siege (Zombie siege raid) bool false +# Enable workarounds for faulty mob navigation. +# Hack 1: teleport golems home if they are very far from home +mcl_mob_allow_nav_hacks (Mob navigation hacks) bool false + [Audio] # Enable flame sound. flame_sound (Flame sound) bool true