From bde53c347523c3dc090dba66e67f068a9d86dc1b Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sat, 16 Nov 2024 08:16:55 +0000 Subject: [PATCH] add mobs:is_invisible() function, update api.txt --- api.lua | 6 +++++- api.txt | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 0d66b08..6dbd6e8 100644 --- a/api.lua +++ b/api.lua @@ -19,7 +19,7 @@ end mobs = { mod = "redo", - version = "20241114", + version = "20241116", spawning_mobs = {}, translate = S, node_snow = has(minetest.registered_aliases["mapgen_snow"]) @@ -1217,6 +1217,10 @@ local function is_invisible(self, player_name) end end +function mobs:is_invisible(self, player_name) + return is_invisible(self, player_name) +end + -- should mob follow what I'm holding ? function mob_class:follow_holding(clicker) diff --git a/api.txt b/api.txt index 9a50e83..a5830ef 100644 --- a/api.txt +++ b/api.txt @@ -904,3 +904,17 @@ Rideable Horse Example Mob -------------------------- See mob_horse mod https://codeberg.org/tenplus1/mob_horse + + +External Functions +------------------ + +These are a list of utility functions that can be called from 3rd party mods. + +mobs:alias_mob(old_name, new_name) +mobs:is_invisible(self, player_name) +mobs:is_dangerous(self, nodename) +mobs:yaw_to_pos(self, target, rotation_steps) +mobs:line_of_sight(self, pos1, pos2) +mobs:set_animation(self, animation) +mobs:yaw(self, yaw, rotation_steps)