mineflayer 3.15.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/api.md CHANGED
@@ -20,18 +20,18 @@
20
20
  - [Biome](#biome)
21
21
  - [Item](#item)
22
22
  - [windows.Window (base class)](#windowswindow-base-class)
23
- - [window.deposit(itemType, metadata, count, [callback])](#windowdeposititemtype-metadata-count-callback)
24
- - [window.withdraw(itemType, metadata, count, [callback])](#windowwithdrawitemtype-metadata-count-callback)
23
+ - [window.deposit(itemType, metadata, count)](#windowdeposititemtype-metadata-count)
24
+ - [window.withdraw(itemType, metadata, count)](#windowwithdrawitemtype-metadata-count)
25
25
  - [window.close()](#windowclose)
26
26
  - [Recipe](#recipe)
27
27
  - [mineflayer.Container](#mineflayercontainer)
28
28
  - [mineflayer.Furnace](#mineflayerfurnace)
29
29
  - [furnace "update"](#furnace-update)
30
- - [furnace.takeInput([callback])](#furnacetakeinputcallback)
31
- - [furnace.takeFuel([callback])](#furnacetakefuelcallback)
32
- - [furnace.takeOutput([callback])](#furnacetakeoutputcallback)
33
- - [furnace.putInput(itemType, metadata, count, [cb])](#furnaceputinputitemtype-metadata-count-cb)
34
- - [furnace.putFuel(itemType, metadata, count, [cb])](#furnaceputfuelitemtype-metadata-count-cb)
30
+ - [furnace.takeInput()](#furnacetakeinput)
31
+ - [furnace.takeFuel()](#furnacetakefuel)
32
+ - [furnace.takeOutput()](#furnacetakeoutput)
33
+ - [furnace.putInput(itemType, metadata, count)](#furnaceputinputitemtype-metadata-count)
34
+ - [furnace.putFuel(itemType, metadata, count)](#furnaceputfuelitemtype-metadata-count)
35
35
  - [furnace.inputItem()](#furnaceinputitem)
36
36
  - [furnace.fuelItem()](#furnacefuelitem)
37
37
  - [furnace.outputItem()](#furnaceoutputitem)
@@ -42,16 +42,16 @@
42
42
  - [enchantmentTable.targetItem()](#enchantmenttabletargetitem)
43
43
  - [enchantmentTable.xpseed](#enchantmenttablexpseed)
44
44
  - [enchantmentTable.enchantments](#enchantmenttableenchantments)
45
- - [enchantmentTable.enchant(choice, [callback])](#enchantmenttableenchantchoice-callback)
46
- - [enchantmentTable.takeTargetItem([callback])](#enchantmenttabletaketargetitemcallback)
47
- - [enchantmentTable.putTargetItem(item, [callback])](#enchantmenttableputtargetitemitem-callback)
48
- - [enchantmentTable.putLapis(item, [callback])](#enchantmenttableputlapisitem-callback)
45
+ - [enchantmentTable.enchant(choice)](#enchantmenttableenchantchoice)
46
+ - [enchantmentTable.takeTargetItem()](#enchantmenttabletaketargetitem)
47
+ - [enchantmentTable.putTargetItem(item)](#enchantmenttableputtargetitemitem)
48
+ - [enchantmentTable.putLapis(item)](#enchantmenttableputlapisitem)
49
49
  - [mineflayer.anvil](#mineflayeranvil)
50
- - [anvil.combine(itemOne, itemTwo[, name, callback])](#anvilcombineitemone-itemtwo-name-callback)
51
- - [anvil.combine(item[, name, callback])](#anvilcombineitem-name-callback)
50
+ - [anvil.combine(itemOne, itemTwo[, name])](#anvilcombineitemone-itemtwo-name)
51
+ - [anvil.combine(item[, name])](#anvilcombineitem-name)
52
52
  - [villager "ready"](#villager-ready)
53
53
  - [villager.trades](#villagertrades)
54
- - [villager.trade(tradeIndex, [times], [cb])](#villagertradetradeindex-times-cb)
54
+ - [villager.trade(tradeIndex, [times])](#villagertradetradeindex-times)
55
55
  - [mineflayer.ScoreBoard](#mineflayerscoreboard)
56
56
  - [ScoreBoard.name](#scoreboardname)
57
57
  - [ScoreBoard.title](#scoreboardtitle)
@@ -235,7 +235,7 @@
235
235
  - ["chat:name" (matches)](#chatname-matches)
236
236
  - [Functions](#functions)
237
237
  - [bot.blockAt(point, extraInfos=true)](#botblockatpoint-extrainfostrue)
238
- - [bot.waitForChunksToLoad(cb)](#botwaitforchunkstoloadcb)
238
+ - [bot.waitForChunksToLoad()](#botwaitforchunkstoload)
239
239
  - [bot.blockInSight(maxSteps, vectorLength)](#botblockinsightmaxsteps-vectorlength)
240
240
  - [bot.blockAtCursor(maxDistance=256)](#botblockatcursormaxdistance256)
241
241
  - [bot.blockAtEntityCursor(entity=bot.entity, maxDistance=256)](#botblockatentitycursorentitybotentity-maxdistance256)
@@ -249,7 +249,7 @@
249
249
  - [Methods](#methods)
250
250
  - [bot.end(reason)](#botendreason)
251
251
  - [bot.quit(reason)](#botquitreason)
252
- - [bot.tabComplete(str, cb, [assumeCommand], [sendBlockInSight])](#bottabcompletestr-cb-assumecommand-sendblockinsight)
252
+ - [bot.tabComplete(str, [assumeCommand], [sendBlockInSight])](#bottabcompletestr-assumecommand-sendblockinsight)
253
253
  - [bot.chat(message)](#botchatmessage)
254
254
  - [bot.whisper(username, message)](#botwhisperusername-message)
255
255
  - [bot.chatAddPattern(pattern, chatType, description)](#botchataddpatternpattern-chattype-description)
@@ -261,32 +261,32 @@
261
261
  - [bot.loadPlugin(plugin)](#botloadpluginplugin)
262
262
  - [bot.loadPlugins(plugins)](#botloadpluginsplugins)
263
263
  - [bot.hasPlugin(plugin)](#bothaspluginplugin)
264
- - [bot.sleep(bedBlock, [cb])](#botsleepbedblock-cb)
264
+ - [bot.sleep(bedBlock)](#botsleepbedblock)
265
265
  - [bot.isABed(bedBlock)](#botisabedbedblock)
266
- - [bot.wake([cb])](#botwakecb)
266
+ - [bot.wake()](#botwake)
267
267
  - [bot.setControlState(control, state)](#botsetcontrolstatecontrol-state)
268
268
  - [bot.getControlState(control)](#botgetcontrolstatecontrol)
269
269
  - [bot.clearControlStates()](#botclearcontrolstates)
270
270
  - [bot.getExplosionDamages(entity, position, radius, [rawDamages])](#botgetexplosiondamagesentity-position-radius-rawdamages)
271
- - [bot.lookAt(point, [force], [callback])](#botlookatpoint-force-callback)
272
- - [bot.look(yaw, pitch, [force], [callback])](#botlookyaw-pitch-force-callback)
271
+ - [bot.lookAt(point, [force])](#botlookatpoint-force)
272
+ - [bot.look(yaw, pitch, [force])](#botlookyaw-pitch-force)
273
273
  - [bot.updateSign(block, text)](#botupdatesignblock-text)
274
- - [bot.equip(item, destination, [callback])](#botequipitem-destination-callback)
275
- - [bot.unequip(destination, [callback])](#botunequipdestination-callback)
276
- - [bot.tossStack(item, [callback])](#bottossstackitem-callback)
277
- - [bot.toss(itemType, metadata, count, [callback])](#bottossitemtype-metadata-count-callback)
278
- - [bot.dig(block, [forceLook = true], [digFace], [callback])](#botdigblock-forcelook--true-digface-callback)
274
+ - [bot.equip(item, destination)](#botequipitem-destination)
275
+ - [bot.unequip(destination)](#botunequipdestination)
276
+ - [bot.tossStack(item)](#bottossstackitem)
277
+ - [bot.toss(itemType, metadata, count)](#bottossitemtype-metadata-count)
278
+ - [bot.dig(block, [forceLook = true], [digFace])](#botdigblock-forcelook--true-digface)
279
279
  - [bot.stopDigging()](#botstopdigging)
280
280
  - [bot.digTime(block)](#botdigtimeblock)
281
281
  - [bot.acceptResourcePack()](#botacceptresourcepack)
282
282
  - [bot.denyResourcePack()](#botdenyresourcepack)
283
- - [bot.placeBlock(referenceBlock, faceVector, cb)](#botplaceblockreferenceblock-facevector-cb)
283
+ - [bot.placeBlock(referenceBlock, faceVector)](#botplaceblockreferenceblock-facevector)
284
284
  - [bot.placeEntity(referenceBlock, faceVector)](#botplaceentityreferenceblock-facevector)
285
- - [bot.activateBlock(block, [callback])](#botactivateblockblock-callback)
286
- - [bot.activateEntity(entity, [callback])](#botactivateentityentity-callback)
287
- - [bot.activateEntityAt(entity, position, [callback])](#botactivateentityatentity-position-callback)
288
- - [bot.consume(callback)](#botconsumecallback)
289
- - [bot.fish(callback)](#botfishcallback)
285
+ - [bot.activateBlock(block)](#botactivateblockblock)
286
+ - [bot.activateEntity(entity)](#botactivateentityentity)
287
+ - [bot.activateEntityAt(entity, position)](#botactivateentityatentity-position)
288
+ - [bot.consume()](#botconsume)
289
+ - [bot.fish()](#botfish)
290
290
  - [bot.activateItem(offHand=false)](#botactivateitemoffhandfalse)
291
291
  - [bot.deactivateItem()](#botdeactivateitem)
292
292
  - [bot.useOn(targetEntity)](#botuseontargetentity)
@@ -296,8 +296,8 @@
296
296
  - [bot.dismount()](#botdismount)
297
297
  - [bot.moveVehicle(left,forward)](#botmovevehicleleftforward)
298
298
  - [bot.setQuickBarSlot(slot)](#botsetquickbarslotslot)
299
- - [bot.craft(recipe, count, craftingTable, [callback])](#botcraftrecipe-count-craftingtable-callback)
300
- - [bot.writeBook(slot, pages, [callback])](#botwritebookslot-pages-callback)
299
+ - [bot.craft(recipe, count, craftingTable)](#botcraftrecipe-count-craftingtable)
300
+ - [bot.writeBook(slot, pages)](#botwritebookslot-pages)
301
301
  - [bot.openContainer(containerBlock or containerEntity)](#botopencontainercontainerblock-or-containerentity)
302
302
  - [bot.openChest(chestBlock or minecartchestEntity)](#botopenchestchestblock-or-minecartchestentity)
303
303
  - [bot.openFurnace(furnaceBlock)](#botopenfurnacefurnaceblock)
@@ -305,24 +305,24 @@
305
305
  - [bot.openEnchantmentTable(enchantmentTableBlock)](#botopenenchantmenttableenchantmenttableblock)
306
306
  - [bot.openAnvil(anvilBlock)](#botopenanvilanvilblock)
307
307
  - [bot.openVillager(villagerEntity)](#botopenvillagervillagerentity)
308
- - [bot.trade(villagerInstance, tradeIndex, [times], [cb])](#bottradevillagerinstance-tradeindex-times-cb)
308
+ - [bot.trade(villagerInstance, tradeIndex, [times])](#bottradevillagerinstance-tradeindex-times)
309
309
  - [bot.setCommandBlock(pos, command, [options])](#botsetcommandblockpos-command-options)
310
310
  - [bot.supportFeature(name)](#botsupportfeaturename)
311
311
  - [bot.waitForTicks(ticks)](#botwaitforticksticks)
312
312
  - [Lower level inventory methods](#lower-level-inventory-methods)
313
- - [bot.clickWindow(slot, mouseButton, mode, cb)](#botclickwindowslot-mousebutton-mode-cb)
313
+ - [bot.clickWindow(slot, mouseButton, mode)](#botclickwindowslot-mousebutton-mode)
314
314
  - [bot.putSelectedItemRange(start, end, window, slot)](#botputselecteditemrangestart-end-window-slot)
315
315
  - [bot.putAway(slot)](#botputawayslot)
316
316
  - [bot.closeWindow(window)](#botclosewindowwindow)
317
- - [bot.transfer(options, cb)](#bottransferoptions-cb)
317
+ - [bot.transfer(options)](#bottransferoptions)
318
318
  - [bot.openBlock(block)](#botopenblockblock)
319
319
  - [bot.openEntity(entity)](#botopenentityentity)
320
- - [bot.moveSlotItem(sourceSlot, destSlot, cb)](#botmoveslotitemsourceslot-destslot-cb)
320
+ - [bot.moveSlotItem(sourceSlot, destSlot)](#botmoveslotitemsourceslot-destslot)
321
321
  - [bot.updateHeldItem()](#botupdatehelditem)
322
322
  - [bot.getEquipmentDestSlot(destination)](#botgetequipmentdestslotdestination)
323
323
  - [bot.creative](#botcreative)
324
- - [bot.creative.setInventorySlot(slot, item, [callback])](#botcreativesetinventoryslotslot-item-callback)
325
- - [bot.creative.flyTo(destination, [cb])](#botcreativeflytodestination-cb)
324
+ - [bot.creative.setInventorySlot(slot, item)](#botcreativesetinventoryslotslot-item)
325
+ - [bot.creative.flyTo(destination)](#botcreativeflytodestination)
326
326
  - [bot.creative.startFlying()](#botcreativestartflying)
327
327
  - [bot.creative.stopFlying()](#botcreativestopflying)
328
328
 
@@ -418,23 +418,21 @@ See [prismarine-item](https://github.com/PrismarineJS/prismarine-item)
418
418
 
419
419
  See [prismarine-windows](https://github.com/PrismarineJS/prismarine-windows)
420
420
 
421
- #### window.deposit(itemType, metadata, count, [callback])
421
+ #### window.deposit(itemType, metadata, count)
422
422
 
423
- This function also returns a `Promise`, with `void` as its argument upon completion.
423
+ This function returns a `Promise`, with `void` as its argument when done depositing.
424
424
 
425
425
  * `itemType` - numerical item id
426
426
  * `metadata` - numerical value. `null` means match anything.
427
427
  * `count` - how many to deposit. `null` is an alias to 1.
428
- * `callback(err)` - (optional) - called when done depositing
429
428
 
430
- #### window.withdraw(itemType, metadata, count, [callback])
429
+ #### window.withdraw(itemType, metadata, count)
431
430
 
432
- This function also returns a `Promise`, with `void` as its argument upon completion.
431
+ This function returns a `Promise`, with `void` as its argument when done withdrawing.
433
432
 
434
433
  * `itemType` - numerical item id
435
434
  * `metadata` - numerical value. `null` means match anything.
436
435
  * `count` - how many to withdraw. `null` is an alias to 1.
437
- * `callback(err)` - (optional) - called when done withdrawing
438
436
 
439
437
  #### window.close()
440
438
 
@@ -456,31 +454,28 @@ See `bot.openFurnace(furnaceBlock)`.
456
454
 
457
455
  Fires when `furnace.fuel` and/or `furnace.progress` update.
458
456
 
459
- #### furnace.takeInput([callback])
457
+ #### furnace.takeInput()
460
458
 
461
- This function also returns a `Promise`, with `item` as its argument upon completion.
459
+ This function returns a `Promise`, with `item` as its argument upon completion.
462
460
 
463
- * `callback(err, item)`
464
461
 
465
- #### furnace.takeFuel([callback])
462
+ #### furnace.takeFuel()
466
463
 
467
- This function also returns a `Promise`, with `item` as its argument upon completion.
464
+ This function returns a `Promise`, with `item` as its argument upon completion.
468
465
 
469
- * `callback(err, item)`
470
466
 
471
- #### furnace.takeOutput([callback])
467
+ #### furnace.takeOutput()
472
468
 
473
- This function also returns a `Promise`, with `item` as its argument upon completion.
469
+ This function returns a `Promise`, with `item` as its argument upon completion.
474
470
 
475
- * `callback(err, item)`
476
471
 
477
- #### furnace.putInput(itemType, metadata, count, [cb])
472
+ #### furnace.putInput(itemType, metadata, count)
478
473
 
479
- This function also returns a `Promise`, with `void` as its argument upon completion.
474
+ This function returns a `Promise`, with `void` as its argument upon completion.
480
475
 
481
- #### furnace.putFuel(itemType, metadata, count, [cb])
476
+ #### furnace.putFuel(itemType, metadata, count)
482
477
 
483
- This function also returns a `Promise`, with `void` as its argument upon completion.
478
+ This function returns a `Promise`, with `void` as its argument upon completion.
484
479
 
485
480
  #### furnace.inputItem()
486
481
 
@@ -542,47 +537,41 @@ Looks like:
542
537
  ]
543
538
  ```
544
539
 
545
- #### enchantmentTable.enchant(choice, [callback])
540
+ #### enchantmentTable.enchant(choice)
546
541
 
547
- This function also returns a `Promise`, with `item` as its argument upon completion.
542
+ This function returns a `Promise`, with `item` as its argument when the item has been enchanted.
548
543
 
549
544
  * `choice` - [0-2], the index of the enchantment you want to pick.
550
- * `callback(err, item)` - (optional) called when the item has been enchanted
551
545
 
552
- #### enchantmentTable.takeTargetItem([callback])
546
+ #### enchantmentTable.takeTargetItem()
553
547
 
554
- This function also returns a `Promise`, with `item` as its argument upon completion.
548
+ This function returns a `Promise`, with `item` as its argument upon completion.
555
549
 
556
- * `callback(err, item)`
557
550
 
558
- #### enchantmentTable.putTargetItem(item, [callback])
551
+ #### enchantmentTable.putTargetItem(item)
559
552
 
560
- This function also returns a `Promise`, with `void` as its argument upon completion.
553
+ This function returns a `Promise`, with `void` as its argument upon completion.
561
554
 
562
- * `callback(err)`
563
555
 
564
- #### enchantmentTable.putLapis(item, [callback])
556
+ #### enchantmentTable.putLapis(item)
565
557
 
566
- This function also returns a `Promise`, with `void` as its argument upon completion.
558
+ This function returns a `Promise`, with `void` as its argument upon completion.
567
559
 
568
- * `callback(err)`
569
560
 
570
561
  ### mineflayer.anvil
571
562
 
572
563
  Extends windows.Window for anvils
573
564
  See `bot.openAnvil(anvilBlock)`.
574
565
 
575
- #### anvil.combine(itemOne, itemTwo[, name, callback])
566
+ #### anvil.combine(itemOne, itemTwo[, name])
576
567
 
577
- This function also returns a `Promise`, with `void` as its argument upon completion.
568
+ This function returns a `Promise`, with `void` as its argument upon completion.
578
569
 
579
- * `callback(err)` - in order to use callback, pass an empty string ('') for name
580
570
 
581
- #### anvil.combine(item[, name, callback])
571
+ #### anvil.combine(item[, name])
582
572
 
583
- This function also returns a `Promise`, with `void` as its argument upon completion.
573
+ This function returns a `Promise`, with `void` as its argument upon completion.
584
574
 
585
- * `callback(err)`
586
575
 
587
576
  #### villager "ready"
588
577
 
@@ -626,8 +615,8 @@ Looks like:
626
615
  ]
627
616
  ```
628
617
 
629
- #### villager.trade(tradeIndex, [times], [cb])
630
- Is the same as [bot.trade(villagerInstance, tradeIndex, [times], [cb])](#bottradevillagerinstance-tradeindex-times-cb)
618
+ #### villager.trade(tradeIndex, [times])
619
+ Is the same as [bot.trade(villagerInstance, tradeIndex, [times])](#bottradevillagerinstance-tradeindex-times)
631
620
 
632
621
  ### mineflayer.ScoreBoard
633
622
 
@@ -1440,11 +1429,9 @@ Fires when the all of a chat pattern's regexs have matches
1440
1429
  Returns the block at `point` or `null` if that point is not loaded. If `extraInfos` set to true, also returns informations about signs, paintings and block entities (slower).
1441
1430
  See `Block`.
1442
1431
 
1443
- #### bot.waitForChunksToLoad(cb)
1432
+ #### bot.waitForChunksToLoad()
1444
1433
 
1445
- This function also returns a `Promise`, with `void` as its argument upon completion.
1446
-
1447
- The cb gets called when many chunks have loaded.
1434
+ This function returns a `Promise`, with `void` as its argument when many chunks have loaded.
1448
1435
 
1449
1436
  #### bot.blockInSight(maxSteps, vectorLength)
1450
1437
 
@@ -1529,14 +1516,12 @@ End the connection with the server.
1529
1516
 
1530
1517
  Gracefully disconnect from the server with the given reason (defaults to 'disconnect.quitting').
1531
1518
 
1532
- #### bot.tabComplete(str, cb, [assumeCommand], [sendBlockInSight])
1519
+ #### bot.tabComplete(str, [assumeCommand], [sendBlockInSight])
1533
1520
 
1534
- This function also returns a `Promise`, with `matches` as its argument upon completion.
1521
+ This function returns a `Promise`, with `matches` as its argument upon completion.
1535
1522
 
1536
1523
  Requests chat completion from the server.
1537
1524
  * `str` - String to complete.
1538
- * `callback(matches)`
1539
- - `matches` - Array of matching strings.
1540
1525
  * `assumeCommand` - Field sent to server, defaults to false.
1541
1526
  * `sendBlockInSight` - Field sent to server, defaults to true. Set this option to false if you want more performance.
1542
1527
 
@@ -1644,21 +1629,21 @@ Injects plugins see `bot.loadPlugin`.
1644
1629
 
1645
1630
  Checks if the given plugin is loaded (or scheduled to be loaded) on this bot.
1646
1631
 
1647
- #### bot.sleep(bedBlock, [cb])
1632
+ #### bot.sleep(bedBlock)
1648
1633
 
1649
- This function also returns a `Promise`, with `void` as its argument upon completion.
1634
+ This function returns a `Promise`, with `void` as its argument upon completion.
1650
1635
 
1651
- Sleep in a bed. `bedBlock` should be a `Block` instance which is a bed. `cb` can have an err parameter if the bot cannot sleep.
1636
+ Sleep in a bed. `bedBlock` should be a `Block` instance which is a bed.
1652
1637
 
1653
1638
  #### bot.isABed(bedBlock)
1654
1639
 
1655
1640
  Return true if `bedBlock` is a bed
1656
1641
 
1657
- #### bot.wake([cb])
1642
+ #### bot.wake()
1658
1643
 
1659
- This function also returns a `Promise`, with `void` as its argument upon completion.
1644
+ This function returns a `Promise`, with `void` as its argument upon completion.
1660
1645
 
1661
- Get out of bed. `cb` can have an err parameter if the bot cannot wake up.
1646
+ Get out of bed.
1662
1647
 
1663
1648
  #### bot.setControlState(control, state)
1664
1649
 
@@ -1689,17 +1674,16 @@ It will return `null` if the entity has no armor and rawDamages is not set to tr
1689
1674
  * `radius` - the explosion radius as a number
1690
1675
  * `rawDamages` - optional, if true it ignores armor in the calculation
1691
1676
 
1692
- #### bot.lookAt(point, [force], [callback])
1677
+ #### bot.lookAt(point, [force])
1693
1678
 
1694
- This function also returns a `Promise`, with `void` as its argument upon completion.
1679
+ This function returns a `Promise`, with `void` as its argument when you are looking at `point`.
1695
1680
 
1696
1681
  * `point` [Vec3](https://github.com/andrewrk/node-vec3) instance - tilts your head so that it is directly facing this point.
1697
1682
  * `force` - See `force` in `bot.look`
1698
- * `callback()` optional, called when you are looking at `point`
1699
1683
 
1700
- #### bot.look(yaw, pitch, [force], [callback])
1684
+ #### bot.look(yaw, pitch, [force])
1701
1685
 
1702
- This function also returns a `Promise`, with `void` as its argument upon completion.
1686
+ This function returns a `Promise`, with `void` as its argument called when you are looking at `yaw` and `pitch`.
1703
1687
 
1704
1688
  Set the direction your head is facing.
1705
1689
 
@@ -1711,15 +1695,14 @@ Set the direction your head is facing.
1711
1695
  Specify this to true if you need the server to know exactly where you
1712
1696
  are looking, such as for dropping items or shooting arrows. This is not
1713
1697
  needed for client-side calculation such as walking direction.
1714
- * `callback()` optional, called when you are looking at `yaw` and `pitch`
1715
1698
 
1716
1699
  #### bot.updateSign(block, text)
1717
1700
 
1718
1701
  Changes the text on the sign.
1719
1702
 
1720
- #### bot.equip(item, destination, [callback])
1703
+ #### bot.equip(item, destination)
1721
1704
 
1722
- This function also returns a `Promise`, with `void` as its argument upon completion.
1705
+ This function returns a `Promise`, with `void` as its argument when you have successfully equipped the item or when you learn that you have failed to equip the item.
1723
1706
 
1724
1707
  Equips an item from your inventory. If the argument `item` is of Instance `Item` equip will equip this specific item from its window slot. If the argument `item` is of type `number` equip will equip the first item found with that id searched by rising slot id (Hotbar is searched last. Armor, crafting, crafting result and off-hand slots are excluded).
1725
1708
 
@@ -1731,36 +1714,32 @@ Equips an item from your inventory. If the argument `item` is of Instance `Item`
1731
1714
  - `"legs"`
1732
1715
  - `"feet"`
1733
1716
  - `"off-hand"` - when available
1734
- * `callback(error)` - optional. called when you have successfully equipped
1735
- the item or when you learn that you have failed to equip the item.
1736
1717
 
1737
- #### bot.unequip(destination, [callback])
1718
+ #### bot.unequip(destination)
1738
1719
 
1739
- This function also returns a `Promise`, with `void` as its argument upon completion.
1720
+ This function returns a `Promise`, with `void` as its argument upon completion.
1740
1721
 
1741
1722
  Remove an article of equipment.
1742
1723
 
1743
- #### bot.tossStack(item, [callback])
1724
+ #### bot.tossStack(item)
1744
1725
 
1745
- This function also returns a `Promise`, with `void` as its argument upon completion.
1726
+ This function returns a `Promise`, with `void` as its argument when tossing is done.
1746
1727
 
1747
1728
  * `item` - the stack of items you wish to toss
1748
- * `callback(error)` - optional, called when tossing is done. if error is
1749
1729
  truthy, you were not able to complete the toss.
1750
1730
 
1751
- #### bot.toss(itemType, metadata, count, [callback])
1731
+ #### bot.toss(itemType, metadata, count)
1752
1732
 
1753
- This function also returns a `Promise`, with `void` as its argument upon completion.
1733
+ This function returns a `Promise`, with `void` as its argument once tossing is complete.
1754
1734
 
1755
1735
  * `itemType` - numerical id of the item you wish to toss
1756
1736
  * `metadata` - metadata of the item you wish to toss. Use `null`
1757
1737
  to match any metadata
1758
1738
  * `count` - how many you want to toss. `null` is an alias for `1`.
1759
- * `callback(err)` - (optional) called once tossing is complete
1760
1739
 
1761
- #### bot.dig(block, [forceLook = true], [digFace], [callback])
1740
+ #### bot.dig(block, [forceLook = true], [digFace])
1762
1741
 
1763
- This function also returns a `Promise`, with `void` as its argument upon completion.
1742
+ This function returns a `Promise`, with `void` as its argument when the block is broken or you are interrupted.
1764
1743
 
1765
1744
  Begin digging into `block` with the currently equipped item.
1766
1745
  See also "diggingCompleted" and "diggingAborted" events.
@@ -1773,8 +1752,6 @@ dig any other blocks until the block has been broken, or you call
1773
1752
  * `forceLook` - (optional) if true, look at the block and start mining instantly. If false, the bot will slowly turn to the block to mine. Additionally, this can be assigned to 'ignore' to prevent the bot from moving it's head at all. Also, this can be assigned to 'raycast' to raycast from the bots head to place where the bot is looking.
1774
1753
  * `digFace` - (optional) Default is 'auto' looks at the center of the block and mines the top face. Can also be a vec3 vector
1775
1754
  of the face the bot should be looking at when digging the block. For example: ```vec3(0, 1, 0)``` when mining the top. Can also be 'raycast' raycast checks if there is a face visible by the bot and mines that face. Useful for servers with anti cheat.
1776
- * `callback(err)` - (optional) called when the block is broken or you
1777
- are interrupted.
1778
1755
 
1779
1756
  If you call bot.dig twice before the first dig is finished, you will get a fatal 'diggingAborted' error.
1780
1757
 
@@ -1792,20 +1769,19 @@ Accepts resource pack.
1792
1769
 
1793
1770
  Denies resource pack.
1794
1771
 
1795
- #### bot.placeBlock(referenceBlock, faceVector, cb)
1772
+ #### bot.placeBlock(referenceBlock, faceVector)
1796
1773
 
1797
- This function also returns a `Promise`, with `void` as its argument upon completion.
1774
+ This function returns a `Promise`, with `void` as its argument when the server confirms that the block has indeed been placed.
1798
1775
 
1799
1776
  * `referenceBlock` - the block you want to place a new block next to
1800
1777
  * `faceVector` - one of the six cardinal directions, such as `new Vec3(0, 1, 0)` for the top face,
1801
1778
  indicating which face of the `referenceBlock` to place the block against.
1802
- * `cb` will be called when the server confirms that the block has indeed been placed
1803
1779
 
1804
1780
  The new block will be placed at `referenceBlock.position.plus(faceVector)`.
1805
1781
 
1806
1782
  #### bot.placeEntity(referenceBlock, faceVector)
1807
1783
 
1808
- This function also returns a `Promise`, with `Entity` as its argument upon completion.
1784
+ This function returns a `Promise`, with `Entity` as its argument upon completion.
1809
1785
 
1810
1786
  * `referenceBlock` - the block you want to place the entity next to
1811
1787
  * `faceVector` - one of the six cardinal directions, such as `new Vec3(0, 1, 0)` for the top face,
@@ -1813,49 +1789,44 @@ This function also returns a `Promise`, with `Entity` as its argument upon compl
1813
1789
 
1814
1790
  The new block will be placed at `referenceBlock.position.plus(faceVector)`.
1815
1791
 
1816
- #### bot.activateBlock(block, [callback])
1792
+ #### bot.activateBlock(block)
1817
1793
 
1818
- This function also returns a `Promise`, with `void` as its argument upon completion.
1794
+ This function returns a `Promise`, with `void` as its argument upon completion.
1819
1795
 
1820
1796
  Punch a note block, open a door, etc.
1821
1797
 
1822
1798
  * `block` - the block to activate
1823
- * `callback(err)` - (optional) called when the block has been activated
1824
1799
 
1825
- #### bot.activateEntity(entity, [callback])
1800
+ #### bot.activateEntity(entity)
1826
1801
 
1827
- This function also returns a `Promise`, with `void` as its argument upon completion.
1802
+ This function returns a `Promise`, with `void` as its argument upon completion.
1828
1803
 
1829
1804
  Activate an entity, useful for villager for example.
1830
1805
 
1831
1806
  * `entity` - the entity to activate
1832
- * `callback(err)` - (optional) called when the entity has been activated
1833
1807
 
1834
- #### bot.activateEntityAt(entity, position, [callback])
1808
+ #### bot.activateEntityAt(entity, position)
1835
1809
 
1836
- This function also returns a `Promise`, with `void` as its argument upon completion.
1810
+ This function returns a `Promise`, with `void` as its argument upon completion.
1837
1811
 
1838
1812
  Activate an entity at the given position, useful for armor stands.
1839
1813
 
1840
1814
  * `entity` - the entity to activate
1841
1815
  * `position` - the world position to click at
1842
- * `callback(err)` - (optional) called when the entity has been activated
1843
1816
 
1844
- #### bot.consume(callback)
1817
+ #### bot.consume()
1845
1818
 
1846
- This function also returns a `Promise`, with `void` as its argument upon completion.
1819
+ This function returns a `Promise`, with `void` as its argument when consume ends.
1847
1820
 
1848
1821
  Eat / drink currently held item
1849
1822
 
1850
- * `callback(error)` - called when consume ends
1851
1823
 
1852
- #### bot.fish(callback)
1824
+ #### bot.fish()
1853
1825
 
1854
- This function also returns a `Promise`, with `void` as its argument upon completion.
1826
+ This function returns a `Promise`, with `void` as its argument when fishing ends.
1855
1827
 
1856
1828
  Use fishing rod
1857
1829
 
1858
- * `callback(error)` - called when fishing ends
1859
1830
 
1860
1831
  #### bot.activateItem(offHand=false)
1861
1832
 
@@ -1906,9 +1877,9 @@ All the direction are relative to where the bot is looking at
1906
1877
 
1907
1878
  * `slot` - 0-8 the quick bar slot to select.
1908
1879
 
1909
- #### bot.craft(recipe, count, craftingTable, [callback])
1880
+ #### bot.craft(recipe, count, craftingTable)
1910
1881
 
1911
- This function also returns a `Promise`, with `void` as its argument upon completion.
1882
+ This function returns a `Promise`, with `void` as its argument when the crafting is complete and your inventory is updated.
1912
1883
 
1913
1884
  * `recipe` - A `Recipe` instance. See `bot.recipesFor`.
1914
1885
  * `count` - How many times you wish to perform the operation.
@@ -1917,16 +1888,13 @@ This function also returns a `Promise`, with `void` as its argument upon complet
1917
1888
  * `craftingTable` - A `Block` instance, the crafting table you wish to
1918
1889
  use. If the recipe does not require a crafting table, you may use
1919
1890
  `null` for this argument.
1920
- * `callback` - (optional) Called when the crafting is complete and your
1921
- inventory is updated.
1922
1891
 
1923
- #### bot.writeBook(slot, pages, [callback])
1892
+ #### bot.writeBook(slot, pages)
1924
1893
 
1925
- This function also returns a `Promise`, with `void` as its argument upon completion.
1894
+ This function returns a `Promise`, with `void` as its argument when the writing was successfully or an error occurred.
1926
1895
 
1927
1896
  * `slot` is in inventory window coordinates (where 36 is the first quickbar slot, etc.).
1928
1897
  * `pages` is an array of strings represents the pages.
1929
- * `callback(error)` - optional. called when the writing was successfully or an error occurred.
1930
1898
 
1931
1899
  #### bot.openContainer(containerBlock or containerEntity)
1932
1900
 
@@ -1958,9 +1926,9 @@ Returns a promise on an `anvil` instance which represents the anvil you are open
1958
1926
  Returns a promise on a `Villager` instance which represents the trading window you are opening.
1959
1927
  You can listen to the `ready` event on this `Villager` to know when it's ready
1960
1928
 
1961
- #### bot.trade(villagerInstance, tradeIndex, [times], [cb])
1929
+ #### bot.trade(villagerInstance, tradeIndex, [times])
1962
1930
 
1963
- This function also returns a `Promise`, with `void` as its argument upon completion.
1931
+ This function returns a `Promise`, with `void` as its argument upon completion.
1964
1932
 
1965
1933
  Uses the open `villagerInstance` to trade.
1966
1934
 
@@ -1993,21 +1961,21 @@ This is a promise-based function that waits for a given number of in-game ticks
1993
1961
 
1994
1962
  These are lower level methods for the inventory, they can be useful sometimes but prefer the inventory methods presented above if you can.
1995
1963
 
1996
- #### bot.clickWindow(slot, mouseButton, mode, cb)
1964
+ #### bot.clickWindow(slot, mouseButton, mode)
1997
1965
 
1998
- This function also returns a `Promise`, with `void` as its argument upon completion.
1966
+ This function returns a `Promise`, with `void` as its argument upon completion.
1999
1967
 
2000
1968
  Click on the current window. See details at https://wiki.vg/Protocol#Click_Window
2001
1969
 
2002
1970
  #### bot.putSelectedItemRange(start, end, window, slot)
2003
1971
 
2004
- This function also returns a `Promise`, with `void` as its argument upon completion.
1972
+ This function returns a `Promise`, with `void` as its argument upon completion.
2005
1973
 
2006
1974
  Put the item at `slot` in the specified range.
2007
1975
 
2008
1976
  #### bot.putAway(slot)
2009
1977
 
2010
- This function also returns a `Promise`, with `void` as its argument upon completion.
1978
+ This function returns a `Promise`, with `void` as its argument upon completion.
2011
1979
 
2012
1980
  Put the item at `slot` in the inventory.
2013
1981
 
@@ -2015,9 +1983,9 @@ Put the item at `slot` in the inventory.
2015
1983
 
2016
1984
  Close the `window`.
2017
1985
 
2018
- #### bot.transfer(options, cb)
1986
+ #### bot.transfer(options)
2019
1987
 
2020
- This function also returns a `Promise`, with `void` as its argument upon completion.
1988
+ This function returns a `Promise`, with `void` as its argument upon completion.
2021
1989
 
2022
1990
  Transfer some kind of item from one range to an other. `options` is an object containing :
2023
1991
 
@@ -2041,9 +2009,9 @@ Open an entity with an inventory, for example a villager, returns a promise on t
2041
2009
 
2042
2010
  * `entity` is the entity the bot will open
2043
2011
 
2044
- #### bot.moveSlotItem(sourceSlot, destSlot, cb)
2012
+ #### bot.moveSlotItem(sourceSlot, destSlot)
2045
2013
 
2046
- This function also returns a `Promise`, with `void` as its argument upon completion.
2014
+ This function returns a `Promise`, with `void` as its argument upon completion.
2047
2015
 
2048
2016
  Move an item from `sourceSlot` to `destSlot` in the current window.
2049
2017
 
@@ -2069,31 +2037,27 @@ This collection of apis is useful in creative mode.
2069
2037
  Detecting and changing gamemodes is not implemented here,
2070
2038
  but it is assumed and often required that the bot be in creative mode for these features to work.
2071
2039
 
2072
- #### bot.creative.setInventorySlot(slot, item, [callback])
2040
+ #### bot.creative.setInventorySlot(slot, item)
2073
2041
 
2074
- This function also returns a `Promise`, with `void` as its argument upon completion.
2042
+ This function returns a `Promise`, with `void` as its argument when gets fired when the servers sets the slot.
2075
2043
 
2076
2044
  Gives the bot the specified item in the specified inventory slot.
2077
- If called twice on the same slot before first callback exceeds, first callback will have an error parameter
2078
2045
 
2079
2046
  * `slot` is in inventory window coordinates (where 36 is the first quickbar slot, etc.).
2080
2047
  * `item` is a [prismarine-item](https://github.com/PrismarineJS/prismarine-item) instance specified with arbitrary metadata, nbtdata, etc.
2081
2048
  If `item` is `null`, the item at the specified slot is deleted.
2082
- * `callback(err)` (optional) is a callback which gets fired when the servers sets the slot
2083
2049
 
2084
2050
  If this method changes anything, you can be notified via `bot.inventory.on("updateSlot")`.
2085
2051
 
2086
- #### bot.creative.flyTo(destination, [cb])
2052
+ #### bot.creative.flyTo(destination)
2087
2053
 
2088
- This function also returns a `Promise`, with `void` as its argument upon completion.
2054
+ This function returns a `Promise`, with `void` as its argument when the bot arrives at the destination.
2089
2055
 
2090
2056
  Calls `startFlying()` and moves at a constant speed through 3d space in a straight line to the destination.
2091
2057
  `destination` is a `Vec3`, and often the `x` and `z` coordinates will end with `.5`.
2092
2058
  This operation will not work if there is an obstacle in the way,
2093
2059
  so it is advised to fly very short distances at a time.
2094
2060
 
2095
- When the bot arrives at the destination, `cb` is called.
2096
-
2097
2061
  This method does not attempt any path finding.
2098
2062
  It is expected that a path finding implementation will use this method to move < 2 blocks at a time.
2099
2063