From 95db11836180d3bd22865c75856a6a2039973bc8 Mon Sep 17 00:00:00 2001 From: codiac Date: Fri, 22 Sep 2023 09:09:35 +1000 Subject: [PATCH] Add rules for blaze, wither skeleton, silverfish --- mods/ENTITIES/mobs_mc/blaze.lua | 4 ++++ mods/ENTITIES/mobs_mc/piglin.lua | 5 +++++ mods/ENTITIES/mobs_mc/silverfish.lua | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/mods/ENTITIES/mobs_mc/blaze.lua b/mods/ENTITIES/mobs_mc/blaze.lua index 6d92de210..98cf4728a 100644 --- a/mods/ENTITIES/mobs_mc/blaze.lua +++ b/mods/ENTITIES/mobs_mc/blaze.lua @@ -11,6 +11,9 @@ local mod_target = minetest.get_modpath("mcl_target") --################### BLAZE --################### +local function spawn_check(pos, environmental_light, artificial_light, sky_light) + return artificial_light <= 11 +end mcl_mobs.register_mob("mobs_mc:blaze", { description = S("Blaze"), @@ -137,6 +140,7 @@ mcl_mobs.register_mob("mobs_mc:blaze", { }, }) end, + spawn_check = spawn_check, }) mcl_mobs:spawn_specific( diff --git a/mods/ENTITIES/mobs_mc/piglin.lua b/mods/ENTITIES/mobs_mc/piglin.lua index 4f701b3e9..27f5a72f4 100644 --- a/mods/ENTITIES/mobs_mc/piglin.lua +++ b/mods/ENTITIES/mobs_mc/piglin.lua @@ -219,6 +219,10 @@ mcl_mobs.register_mob("mobs_mc:sword_piglin", sword_piglin) -- Zombified Piglin -- +local function spawn_check(pos, environmental_light, artificial_light, sky_light) + return artificial_light <= 11 +end + local zombified_piglin = { description = S("Zombie Piglin"), -- type="animal", passive=false: This combination is needed for a neutral mob which becomes hostile, if attacked @@ -256,6 +260,7 @@ local zombified_piglin = { }, jump = true, makes_footstep_sound = true, + spawn_check = spawn_check, walk_velocity = .8, run_velocity = 2.6, pathfinding = 1, diff --git a/mods/ENTITIES/mobs_mc/silverfish.lua b/mods/ENTITIES/mobs_mc/silverfish.lua index ab659a2a0..ec8ee19bb 100644 --- a/mods/ENTITIES/mobs_mc/silverfish.lua +++ b/mods/ENTITIES/mobs_mc/silverfish.lua @@ -4,6 +4,10 @@ local S = minetest.get_translator("mobs_mc") +local function spawn_check(pos, environmental_light, artificial_light, sky_light) + return artificial_light <= 11 +end + mcl_mobs.register_mob("mobs_mc:silverfish", { description = S("Silverfish"), type = "monster", @@ -53,6 +57,7 @@ mcl_mobs.register_mob("mobs_mc:silverfish", { view_range = 16, attack_type = "dogfight", damage = 1, + spawn_check = spawn_check, }) mcl_mobs.register_egg("mobs_mc:silverfish", S("Silverfish"), "#6d6d6d", "#313131", 0)