From 5a7d128861e610f41f723d906eead609168f0ce2 Mon Sep 17 00:00:00 2001 From: epCode Date: Mon, 29 Mar 2021 11:29:39 -0700 Subject: [PATCH] Add wither functions from MC --- .../textures/mobs_mc_wither_half_health.png | Bin 0 -> 1323 bytes mods/ENTITIES/mobs_mc/wither.lua | 10 +++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 mods/ENTITIES/mobs_mc/textures/mobs_mc_wither_half_health.png diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_wither_half_health.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_wither_half_health.png new file mode 100644 index 0000000000000000000000000000000000000000..f6353400cda70d9e14a98ee98082030b9f81f500 GIT binary patch literal 1323 zcmV+`1=RY9P)3llH3nBT`+P)=A*t z;2@1T5QoTB2kwFsV*)AS6b?zWfrwp*wCIY_%e)=U>@V#~ve*yI?wgr?JM-p!@6B4z zLIUjVyCXO*(Cpd%pBXo-g zM4RIRwL0MUfD7M?E5EPRQ8?;NdFA&xv6?tSw|L%XujwZ;#iVA5m8ms2Zoa;yF~B*; z^acp}`TFvLf?rZwVKKmMnBxFt0*cJ)q}DgHMSHg)4M+3|`oOLY9E3t%-;{kcuX+=9 zy{XL_;qjl=bOs3eBG8%od`~WvPkMbbF-016Ixg_~Um^c=4d?=R$7F7xDY2TE=V@X5 zz8wHvN3_-IGF5UNyS7|7wfP=!u?eG&xKyfhc|tpw9N%@!9z&a==m;O~Tk!_aow!UBQ~5}q zp>i?{$P+ky#=3`xkD~6{dJy$Q(;QiUc=#x13{bhK<6{w=c?Y>emYj@ZD2+(+)6vxGyI3+n(SfmsPh@_4IpYe)fBbQMznM1DLp&g^zK3 z*6_=6@;UIN^8cA`u-Hhi&f6`utN zKm3@ifxCFpc)mdGKUqKK8(UZwPy-X&RU^2IYsT9(>;~uzfEy=_>(AM}p?!%E{TfWe=>-pJ**zf5X>W;|58z8R8fcgrq+gYq2IO`IbnV$rwEs-&$O7(d|e|YrN znlA-Rc^;5ENI#11+TwZ;$~Mz3(>WpO95MG85LeqnzZlc6zI@>ap*#qgVue~bmF0{v z_ZTp%5}CPsfZK@fo>H!c`z;K;SE6jK9f*>d&&L>guYmil=vY+`$vW>yQNlKxAXt^i zWGImtjcsLFOH(4V0^bt_k!raMMewAP9*rX}p=Umw;#>KRy(a#APq;ppD^#dZp+bcU h6)IGyP@%%?@judG-R$kK*4Y36002ovPDHLkV1kb7etZA` literal 0 HcmV?d00001 diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index 3fbf65955e..caf5a248d3 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -16,7 +16,7 @@ mobs:register_mob("mobs_mc:wither", { hp_min = 300, xp_min = 50, xp_max = 50, - armor = {undead = 80, fleshy = 80}, + armor = {undead = 80, fleshy = 100}, -- This deviates from MC Wiki's size, which makes no sense collisionbox = {-0.9, 0.4, -0.9, 0.9, 2.45, 0.9}, visual = "mesh", @@ -66,6 +66,14 @@ mobs:register_mob("mobs_mc:wither", { run_start = 0, run_end = 20, }, harmed_by_heal = true, + do_custom = function(self) + if self.health < (self.hp_max / 2) then + self.base_texture = "mobs_mc_wither_half_health.png" + self.fly = false + self.object:set_properties({textures={self.base_texture}}) + self.armor = {undead = 80, fleshy = 80} + end + end, on_spawn = function(self) minetest.sound_play("mobs_mc_wither_spawn", {object=self.object, gain=1.0, max_hear_distance=64}) end,