diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 4324aa69d..0cb272fb2 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -1101,8 +1101,7 @@ end -- find and replace what mob is looking for (grass, wheat etc.) local replace = function(self, pos) - if not mobs_griefing - or not self.replace_rate + if not self.replace_rate or not self.replace_what or self.child == true or self.object:get_velocity().y ~= 0 @@ -1139,7 +1138,9 @@ local replace = function(self, pos) if on_replace_return ~= false then - minetest.set_node(pos, {name = with}) + if mobs_griefing then + minetest.set_node(pos, {name = with}) + end -- when cow/sheep eats grass, replace wool and milk if self.gotten == true then diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index b3e2f03e7..999ba4a85 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -243,8 +243,9 @@ eating. 'replace_rate' how random should the replace rate be (typically 10) 'replace_offset' +/- value to check specific node to replace - 'on_replace(self, pos, oldnode, newnode)' is called when mob is about to - replace a node. + 'on_replace(self, pos, oldnode, newnode)' + is called when mob is about to replace a node. Also called + when not actually replacing due to mobs_griefing setting being false. 'self' ObjectRef of mob 'pos' Position of node to replace 'oldnode' Current node