From 219db764bf434a217312d0f412ef10b480c28510 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Wed, 2 Oct 2024 15:51:05 +0100 Subject: [PATCH] forgot def.loudness check --- api.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 2a1ecba..1e105d3 100644 --- a/api.lua +++ b/api.lua @@ -4812,7 +4812,9 @@ if settings:get_bool("mobs_can_hear") ~= false then def.distance = get_distance(def.pos, ps[n]) def.loudness = def.gain - (bit * def.distance) - if ndef and ndef.on_sound then ndef.on_sound(ps[n], def) end + if def.loudness > 0 and ndef and ndef.on_sound then + ndef.on_sound(ps[n], def) + end end end