Skip to content

Commit

Permalink
Fix out of bounds access leading to crash at spawn
Browse files Browse the repository at this point in the history
More information about the issue at PrismarineJS#3534
  • Loading branch information
wAIfu-DEV authored Dec 28, 2024
1 parent f6187f6 commit 382951e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/breath.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
Expand Down

0 comments on commit 382951e

Please sign in to comment.