Hoglins transform into zoglins after 15 seconds consecutively spent in the overworld.
The new zoglin gets the nausea effect for 10 seconds (but no particles appear at the moment because not all effects are properly applied to mobs)
This commit is contained in:
WillConker 2024-06-05 20:00:16 +00:00
parent 65d6cb1d83
commit c14f2a325c
1 changed files with 13 additions and 4 deletions

View File

@ -77,11 +77,20 @@ local hoglin = {
}, nil)
end
end,
do_custom = function(self)
do_custom = function(self, dtime)
if self.object:get_pos().y > -100 then
local zog = minetest.add_entity(self.object:get_pos(), "mobs_mc:zoglin")
zog:set_rotation(self.object:get_rotation())
self.object:remove()
if self._zoglin_transform_timer == nil then
self._zoglin_transform_timer = 15
elseif self._zoglin_transform_timer <= 0 then
local zog = minetest.add_entity(self.object:get_pos(), "mobs_mc:zoglin")
zog:set_rotation(self.object:get_rotation())
mcl_potions.give_effect("nausea", zog, 1, 10)
self.object:remove()
else
self._zoglin_transform_timer = self._zoglin_transform_timer - dtime
end
else
self._zoglin_transform_timer = nil
end
end,
attack_animals = true,