diff --git a/lib/plugins/inventory.js b/lib/plugins/inventory.js index 70db3128f..62867771b 100644 --- a/lib/plugins/inventory.js +++ b/lib/plugins/inventory.js @@ -1,6 +1,7 @@ const assert = require('assert') const { Vec3 } = require('vec3') const { once, sleep, createDoneTask, createTask, withTimeout } = require('../promise_utils') +const { toNotchianYaw, toNotchianPitch } = require('../conversions') module.exports = inject @@ -128,7 +129,10 @@ function inject (bot, { hideErrors }) { bot._client.write('use_item', { hand: offHand ? 1 : 0, sequence, - rotation: { x: 0, y: 0 } + rotation: { + x: toNotchianYaw(bot.entity.yaw), + y: toNotchianPitch(bot.entity.pitch) + } }) } }