From 94a17f59d2fdc59ac4ebd38ad2561dfd82fbeb29 Mon Sep 17 00:00:00 2001 From: Doge Date: Sun, 8 Oct 2023 21:25:19 +0300 Subject: [PATCH] fix(Entity): `broadcastSound()` not firing `WorldSoundEvent` (#6069) --- src/entity/Entity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 8a406924e..7e4d7cbde 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -1686,7 +1686,7 @@ abstract class Entity{ */ public function broadcastSound(Sound $sound, ?array $targets = null) : void{ if(!$this->silent){ - NetworkBroadcastUtils::broadcastPackets($targets ?? $this->getViewers(), $sound->encode($this->location)); + $this->getWorld()->addSound($this->location->asVector3(), $sound, $targets ?? $this->getViewers()); } }