From 83f17fd9a7845ac3bc9216ea13ef73616c088a14 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 10 Oct 2022 14:43:08 +0200 Subject: [PATCH] Cats keep their color --- mods/ENTITIES/mobs_mc/ocelot.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index 574b5e763..c50067f5f 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -157,6 +157,16 @@ cat.on_rightclick = function(self, clicker) end +cat.on_spawn = function(self) + if self.owner == "!witch!" then + self._texture = {"mobs_mc_cat_black.png"} + end + if not self._texture then + self._texture = cat.textures[math.random(#cat.textures)] + end + self.object:set_properties({textures = {self._texture}}) +end + mcl_mobs:register_mob("mobs_mc:cat", cat) local base_spawn_chance = 5000