diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index b9e4c9e63..13206ec6e 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3593,6 +3593,13 @@ local mob_activate = function(self, staticdata, def, dtime) if not self.nametag then self.nametag = def.nametag end + if not self.custom_visual_size then + -- Remove saved visual_size on old existing entites. + -- Old entities were 3 now it's 1. + self.visual_size = nil + self.object:set_properties({visual_size = self.visual_size}) + self.base_size = self.visual_size + end -- set anything changed above self.object:set_properties(self) diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index b9b6613b6..b3d414526 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -259,6 +259,7 @@ functions needed for the mob to work properly which contains the following: that are bred in a different way. 'pick_up' table of itemstrings the mob will pick up (e.g. for breeding) 'on_pick_up' function that will be called on item pickup - return true to not pickup the item + 'custom_visual_size' will not reset visual_size from the base class on reload mobs:gopath(self,target,callback_arrived) pathfind a way to target and run callback on arrival @@ -433,7 +434,7 @@ true the mob will not spawn. MineClone 2 extensions ---------------------- -mobs:spawn_child(pos, mob_type) +mcl_mobs:spawn_child(pos, mob_type) This function spawns a mob as a child. The parameter mob_type is the entitystring of the new mob. @@ -443,6 +444,7 @@ mobs:death_effect(pos, collisionbox) Create death particles at pos with the given collisionbox. +mcl_mobs.spawn(pos,name/entity name) Making Arrows ------------- diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 5ae7e922f..d7c6563b9 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -94,13 +94,6 @@ local zombie = { view_range = 16, attack_type = "dogfight", harmed_by_heal = true, - on_spawn = function(self) - -- Remove saved visual_size on old existing entites. - -- Old entities were 3 now it's 1. - self.visual_size = nil - self.object:set_properties({visual_size = self.visual_size}) - self.base_size = self.visual_size - end, attack_npcs = true, }