From 0d0cda3e17fdabf267d43240e69c5e196c19bd47 Mon Sep 17 00:00:00 2001 From: u9g <43508353+u9g@users.noreply.github.com> Date: Sun, 14 Mar 2021 07:23:24 -0400 Subject: [PATCH] check hand for item before dropping (#83) prevents spam promise rejection in console when pressing q with empty hand --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c97b8542..62ffd9ba 100644 --- a/index.js +++ b/index.js @@ -237,7 +237,7 @@ async function connect (options) { reloadHotbarSelected(bot, numPressed - 1) } if (e.code === 'KeyQ') { - bot.tossStack(bot.heldItem) + if (bot.heldItem) bot.tossStack(bot.heldItem) } }, false)