From 382951e60b76afb0b1ac09ec429353c00fa6a3ff Mon Sep 17 00:00:00 2001 From: wAIfu-DEV <132222556+wAIfu-DEV@users.noreply.github.com> Date: Sat, 28 Dec 2024 19:53:14 +0100 Subject: [PATCH] Fix out of bounds access leading to crash at spawn More information about the issue at #3534 --- lib/plugins/breath.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/breath.js b/lib/plugins/breath.js index 7ac316824..137140366 100644 --- a/lib/plugins/breath.js +++ b/lib/plugins/breath.js @@ -11,7 +11,7 @@ function inject (bot) { if (bot.entity.id !== packet.entityId) return for (const metadata of packet.metadata) { if (metadata.key === 1) { - bot.oxygenLevel = Math.round(packet.metadata[1].value / 15) + bot.oxygenLevel = Math.round(metadata.value / 15) bot.emit('breath') } }