From 23126e1c6944c0d8f64e96a9a6838fca58e2cff9 Mon Sep 17 00:00:00 2001 From: F6CF Date: Tue, 8 Sep 2015 16:26:08 +0500 Subject: [PATCH] Create inventory.js InventoryAPI --- lib/playerPlugins/inventory.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 lib/playerPlugins/inventory.js diff --git a/lib/playerPlugins/inventory.js b/lib/playerPlugins/inventory.js new file mode 100644 index 0000000..104459e --- /dev/null +++ b/lib/playerPlugins/inventory.js @@ -0,0 +1,11 @@ +module.exports=inject; + +function inject(serv, player) +{ + heldItemSlot=0; + player._client.on("held_item_slot", function (packet) { + heldItemSlot = packet.slotId; + }); + + player.heldItemSlot = heldItemSlot; +}