1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-05-18 09:10:36 +02:00

tweak general_attack

This commit is contained in:
tenplus1 2025-05-15 14:34:38 +01:00
parent f5817061ce
commit c0c4c3ea48
2 changed files with 5 additions and 3 deletions

View File

@ -18,7 +18,7 @@ end
-- global table -- global table
mobs = { mobs = {
mod = "redo", version = "20250511", mod = "redo", version = "20250515",
spawning_mobs = {}, translate = S, spawning_mobs = {}, translate = S,
node_snow = has(core.registered_aliases["mapgen_snow"]) node_snow = has(core.registered_aliases["mapgen_snow"])
or has("mcl_core:snow") or has("default:snow") or "air", or has("mcl_core:snow") or has("default:snow") or "air",
@ -1692,7 +1692,8 @@ function mob_class:general_attack()
-- remove from list if invisible or unable to attack -- remove from list if invisible or unable to attack
if not damage_enabled or self.attack_players == false if not damage_enabled or self.attack_players == false
or (self.owner and self.type ~= "monster") or self.owner == objs[n]:get_player_name()
-- or (self.owner and self.type ~= "monster")
or is_invisible(self, objs[n]:get_player_name()) or is_invisible(self, objs[n]:get_player_name())
or (self.specific_attack and not check_for("player", self.specific_attack)) then or (self.specific_attack and not check_for("player", self.specific_attack)) then
objs[n] = nil objs[n] = nil

View File

@ -102,7 +102,8 @@ functions needed for the mob to work properly which contains the following:
'docile_by_day' when true has mobs wandering around during daylight 'docile_by_day' when true has mobs wandering around during daylight
hours and only attacking player at night or when hours and only attacking player at night or when
provoked. provoked.
'attack_chance' 0 to 100 chance the mob will attack (default is 5). 'attack_chance' 0 to 100 chance the mob will attack (default is 5),
set to 100 so that mob needs to be provoked to attack.
'attack_patience' Time in seconds before mob gives up attacking if 'attack_patience' Time in seconds before mob gives up attacking if
player isn't seen (Defaults to 11). player isn't seen (Defaults to 11).
'attack_monsters' when true mob will attack monsters. 'attack_monsters' when true mob will attack monsters.