From 4d922d9edf9938320643c5d8deb519bd835ccf64 Mon Sep 17 00:00:00 2001 From: GuyLiner Date: Sat, 4 Feb 2023 23:21:33 -0500 Subject: [PATCH] Added conditional based on existing fire damage conditional that will apply fire damage to a mob standing on top of a magma node that belongs to the "fire" group. The magma node has also been added to the fire group, making it so that standing on the node will do damage to the mob. In official Minecraft, magma blocks just do fire damage without the fire animation. Source: https://minecraft.fandom.com/wiki/Magma_Block --- mods/ENTITIES/mcl_mobs/physics.lua | 13 +++++++++++++ mods/ITEMS/mcl_nether/init.lua | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/physics.lua b/mods/ENTITIES/mcl_mobs/physics.lua index c7ea98c57..0c908b639 100644 --- a/mods/ENTITIES/mcl_mobs/physics.lua +++ b/mods/ENTITIES/mcl_mobs/physics.lua @@ -644,6 +644,7 @@ function mob_class:do_env_damage() end local nodef = minetest.registered_nodes[self.standing_in] + local nodef2 = minetest.registered_nodes[self.standing_on] -- rain if self.rain_damage > 0 then @@ -675,7 +676,19 @@ function mob_class:do_env_damage() return true end end + -- magma damage + elseif self.fire_damage > 0 + and (nodef2.groups.fire) then + if self.fire_damage ~= 0 then + + self.health = self.health - self.fire_damage + + if self:check_for_death("fire", {type = "environment", + pos = pos, node = self.standing_in}) then + return true + end + end -- lava damage elseif self.lava_damage > 0 and (nodef.groups.lava) then diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index 3f63c4333..548bd90d5 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -130,7 +130,7 @@ minetest.register_node("mcl_nether:magma", { is_ground_content = true, light_source = 3, sunlight_propagates = false, - groups = {pickaxey=1, building_block=1, material_stone=1}, + groups = {pickaxey=1, building_block=1, material_stone=1, fire=1}, sounds = mcl_sounds.node_sound_stone_defaults(), -- From walkover mod on_walk_over = function(loc, nodeiamon, player)