Add event for pick block / middle mouse button click

Minecraft uses player.inventoryContainer.inventorySlots.size() to calculate the hotbar slot for pickblock. Extending the player inventory container slots causes the game to create ghost items in the hotbar