From 9f272940f602c9175d95caa09a89f099012a165b Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sat, 3 Aug 2024 11:35:57 +0100 Subject: [PATCH] add on_sound example --- init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.lua b/init.lua index a9eb847..51fae16 100644 --- a/init.lua +++ b/init.lua @@ -222,7 +222,15 @@ mobs:register_mob("mob_horse:horse", { if self.saddle and self.owner == player_name then mobs.attach(self, clicker) end + end, +--[[ + on_sound = function(self, def) + + if def.loudness > 0.2 then -- if loud enough make horse jump with fright + self.object:set_velocity({x=0, y=5, z=0}) + end end +]] })