diff --git a/api.lua b/api.lua index f948f61..f51c5a4 100644 --- a/api.lua +++ b/api.lua @@ -8,10 +8,13 @@ local use_cmi = minetest.global_exists("cmi") -- MineClone2 check local use_mc2 = minetest.get_modpath("mcl_core") +-- Visual Harm 1ndicator check +local use_vh1 = minetest.get_modpath("visual_harm_1ndicators") + -- Global mobs = { mod = "redo", - version = "20231116", + version = "20231120", translate = S, invis = minetest.global_exists("invisibility") and invisibility or {}, node_snow = minetest.registered_aliases["mapgen_snow"] @@ -827,6 +830,10 @@ function mob_class:check_for_death(cmi_cause) self.old_health = self.health + if use_vh1 then + VH1.update_bar(self.object, self.health) + end + -- still got some health? play hurt sound if self.health > 0 then @@ -2837,6 +2844,10 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage) self.health = self.health - floor(damage) + if use_vh1 then + VH1.update_bar(self.object, self.health) + end + return true end diff --git a/mod.conf b/mod.conf index 7f9ea15..4317e4b 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,4 @@ name = mobs description = Adds a mob api for mods to add animals or monsters etc. -optional_depends = default, tnt, invisibility, lucky_block, cmi, toolranks, pathfinder, player_api, mtobjid +optional_depends = default, tnt, invisibility, lucky_block, cmi, toolranks, pathfinder, player_api, mtobjid, visual_harm_1ndicators min_minetest_version = 5.0 diff --git a/readme.MD b/readme.MD index 899e7ef..233d090 100644 --- a/readme.MD +++ b/readme.MD @@ -24,6 +24,14 @@ https://forum.minetest.net/viewtopic.php?f=11&t=9917 ## Changelog +### Version 1.61 + +* Fixed mob damage when riding mobs +* Added entity:is_inside(itemtable) function (thx cora) +* Added self.attack_patience value so mobs stop attacking unseen players +* Added self.homing so that arrows follow player when visible +* Added support for Visual Harm 1ndicators mod to show health bars + ### Version 1.60 * Move mob and arrow entities to use initial_properties