module.exports = inject12function inject (bot) {3if (bot.supportFeature('mcDataHasEntityMetadata')) {4// this is handled inside entities.js. We don't yet have entity metadataKeys for all versions but once we do5// we can delete the numerical checks here and in entities.js https://github.com/extremeheat/mineflayer/blob/eb9982aa04973b0086aac68a2847005d77f01a3d/lib/plugins/entities.js#L4696return7}8bot._client.on('entity_metadata', (packet) => {9if (!bot.entity) return10if (bot.entity.id !== packet.entityId) return11for (const metadata of packet.metadata) {12if (metadata.key === 1) {13bot.oxygenLevel = Math.round(metadata.value / 15)14bot.emit('breath')15}16}17})18}192021