       hardness ?= 9
 
       # effectiveness of currently held tool, shortens mining time
-      heldItem = inventoryHotbar.held()
+      heldItem = plugins.all['inventory-hotbar']?.held()
       speed = 1.0
       speed = registry.getItemProps(heldItem?.item)?.speed ? 1.0
       finalTimeToMine = Math.max(hardness / speed, 0)

  #playerInventory.give new ItemPile('workbench', 1)
  #toolbar = createToolbar {el: '#tools'}
  #inventoryToolbar = plugins.load 'inventory-toolbar', {toolbar:toolbar, inventory:playerInventory, inventorySize:10, registry:registry}
  inventoryHotbar = plugins.load 'inventory-hotbar', {inventory:playerInventory, inventorySize:10} # TODO: change to preload, but timeToMine below references it

  plugins.preload 'inventory-dialog', {playerInventory:playerInventory}



createGame = require 'voxel-engine'
createPlugins = require 'voxel-plugins'
createDebugUI = require 'voxel-debug'
createPluginsUI = require 'voxel-plugins-ui'
createBindingsUI = require 'kb-bindings-ui'

