From 220b542cbfe843980d9e7fd4f67289fbbb6f6e83 Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 4 Nov 2022 14:01:24 +0100 Subject: [PATCH] Mooshroom color change with on_lightning_strike --- mods/ENTITIES/mobs_mc/cow+mooshroom.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index d0f7178bdf..4a91e91963 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -153,6 +153,16 @@ mooshroom_def.on_rightclick = function(self, clicker) end mcl_mobs:capture_mob(self, clicker, 0, 5, 60, false, nil) end + +mooshroom_def.on_lightning_strike = function(self, pos, pos2, objects) + if self.base_texture[1] == "mobs_mc_mooshroom_brown.png" then + self.base_texture = { "mobs_mc_mooshroom.png", "mobs_mc_mushroom_red.png" } + else + self.base_texture = { "mobs_mc_mooshroom_brown.png", "mobs_mc_mushroom_brown.png" } + end + self.object:set_properties({ textures = self.base_texture }) + return true +end mcl_mobs:register_mob("mobs_mc:mooshroom", mooshroom_def)