mineflayer 3.17.0 → 4.1.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, nbt)](#windowdeposititemtype-metadata-count-nbt)
24
+ - [window.withdraw(itemType, metadata, count, nbt)](#windowwithdrawitemtype-metadata-count-nbt)
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)
@@ -94,6 +94,8 @@
94
94
  - [bot.game.hardcore](#botgamehardcore)
95
95
  - [bot.game.maxPlayers](#botgamemaxplayers)
96
96
  - [bot.game.serverBrand](#botgameserverbrand)
97
+ - [bot.game.minY](#botgameminy)
98
+ - [bot.game.height](#botgameheight)
97
99
  - [bot.physicsEnabled](#botphysicsenabled)
98
100
  - [bot.player](#botplayer)
99
101
  - [bot.players](#botplayers)
@@ -113,6 +115,8 @@
113
115
  - [bot.settings.skinParts.showLeftPants - boolean](#botsettingsskinpartsshowleftpants---boolean)
114
116
  - [bot.settings.skinParts.showRightPants - boolean](#botsettingsskinpartsshowrightpants---boolean)
115
117
  - [bot.settings.skinParts.showHat - boolean](#botsettingsskinpartsshowhat---boolean)
118
+ - [bot.settings.enableTextFiltering - boolean](#botsettingsenabletextfiltering---boolean)
119
+ - [bot.settings.enableServerListing - boolean](#botsettingsenableserverlisting---boolean)
116
120
  - [bot.experience.level](#botexperiencelevel)
117
121
  - [bot.experience.points](#botexperiencepoints)
118
122
  - [bot.experience.progress](#botexperienceprogress)
@@ -235,7 +239,7 @@
235
239
  - ["chat:name" (matches)](#chatname-matches)
236
240
  - [Functions](#functions)
237
241
  - [bot.blockAt(point, extraInfos=true)](#botblockatpoint-extrainfostrue)
238
- - [bot.waitForChunksToLoad(cb)](#botwaitforchunkstoloadcb)
242
+ - [bot.waitForChunksToLoad()](#botwaitforchunkstoload)
239
243
  - [bot.blockInSight(maxSteps, vectorLength)](#botblockinsightmaxsteps-vectorlength)
240
244
  - [bot.blockAtCursor(maxDistance=256)](#botblockatcursormaxdistance256)
241
245
  - [bot.blockAtEntityCursor(entity=bot.entity, maxDistance=256)](#botblockatentitycursorentitybotentity-maxdistance256)
@@ -249,7 +253,7 @@
249
253
  - [Methods](#methods)
250
254
  - [bot.end(reason)](#botendreason)
251
255
  - [bot.quit(reason)](#botquitreason)
252
- - [bot.tabComplete(str, cb, [assumeCommand], [sendBlockInSight])](#bottabcompletestr-cb-assumecommand-sendblockinsight)
256
+ - [bot.tabComplete(str, [assumeCommand], [sendBlockInSight])](#bottabcompletestr-assumecommand-sendblockinsight)
253
257
  - [bot.chat(message)](#botchatmessage)
254
258
  - [bot.whisper(username, message)](#botwhisperusername-message)
255
259
  - [bot.chatAddPattern(pattern, chatType, description)](#botchataddpatternpattern-chattype-description)
@@ -261,32 +265,32 @@
261
265
  - [bot.loadPlugin(plugin)](#botloadpluginplugin)
262
266
  - [bot.loadPlugins(plugins)](#botloadpluginsplugins)
263
267
  - [bot.hasPlugin(plugin)](#bothaspluginplugin)
264
- - [bot.sleep(bedBlock, [cb])](#botsleepbedblock-cb)
268
+ - [bot.sleep(bedBlock)](#botsleepbedblock)
265
269
  - [bot.isABed(bedBlock)](#botisabedbedblock)
266
- - [bot.wake([cb])](#botwakecb)
270
+ - [bot.wake()](#botwake)
267
271
  - [bot.setControlState(control, state)](#botsetcontrolstatecontrol-state)
268
272
  - [bot.getControlState(control)](#botgetcontrolstatecontrol)
269
273
  - [bot.clearControlStates()](#botclearcontrolstates)
270
274
  - [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)
275
+ - [bot.lookAt(point, [force])](#botlookatpoint-force)
276
+ - [bot.look(yaw, pitch, [force])](#botlookyaw-pitch-force)
273
277
  - [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)
278
+ - [bot.equip(item, destination)](#botequipitem-destination)
279
+ - [bot.unequip(destination)](#botunequipdestination)
280
+ - [bot.tossStack(item)](#bottossstackitem)
281
+ - [bot.toss(itemType, metadata, count)](#bottossitemtype-metadata-count)
282
+ - [bot.dig(block, [forceLook = true], [digFace])](#botdigblock-forcelook--true-digface)
279
283
  - [bot.stopDigging()](#botstopdigging)
280
284
  - [bot.digTime(block)](#botdigtimeblock)
281
285
  - [bot.acceptResourcePack()](#botacceptresourcepack)
282
286
  - [bot.denyResourcePack()](#botdenyresourcepack)
283
- - [bot.placeBlock(referenceBlock, faceVector, cb)](#botplaceblockreferenceblock-facevector-cb)
287
+ - [bot.placeBlock(referenceBlock, faceVector)](#botplaceblockreferenceblock-facevector)
284
288
  - [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)
289
+ - [bot.activateBlock(block)](#botactivateblockblock)
290
+ - [bot.activateEntity(entity)](#botactivateentityentity)
291
+ - [bot.activateEntityAt(entity, position)](#botactivateentityatentity-position)
292
+ - [bot.consume()](#botconsume)
293
+ - [bot.fish()](#botfish)
290
294
  - [bot.activateItem(offHand=false)](#botactivateitemoffhandfalse)
291
295
  - [bot.deactivateItem()](#botdeactivateitem)
292
296
  - [bot.useOn(targetEntity)](#botuseontargetentity)
@@ -296,8 +300,8 @@
296
300
  - [bot.dismount()](#botdismount)
297
301
  - [bot.moveVehicle(left,forward)](#botmovevehicleleftforward)
298
302
  - [bot.setQuickBarSlot(slot)](#botsetquickbarslotslot)
299
- - [bot.craft(recipe, count, craftingTable, [callback])](#botcraftrecipe-count-craftingtable-callback)
300
- - [bot.writeBook(slot, pages, [callback])](#botwritebookslot-pages-callback)
303
+ - [bot.craft(recipe, count, craftingTable)](#botcraftrecipe-count-craftingtable)
304
+ - [bot.writeBook(slot, pages)](#botwritebookslot-pages)
301
305
  - [bot.openContainer(containerBlock or containerEntity)](#botopencontainercontainerblock-or-containerentity)
302
306
  - [bot.openChest(chestBlock or minecartchestEntity)](#botopenchestchestblock-or-minecartchestentity)
303
307
  - [bot.openFurnace(furnaceBlock)](#botopenfurnacefurnaceblock)
@@ -305,24 +309,24 @@
305
309
  - [bot.openEnchantmentTable(enchantmentTableBlock)](#botopenenchantmenttableenchantmenttableblock)
306
310
  - [bot.openAnvil(anvilBlock)](#botopenanvilanvilblock)
307
311
  - [bot.openVillager(villagerEntity)](#botopenvillagervillagerentity)
308
- - [bot.trade(villagerInstance, tradeIndex, [times], [cb])](#bottradevillagerinstance-tradeindex-times-cb)
312
+ - [bot.trade(villagerInstance, tradeIndex, [times])](#bottradevillagerinstance-tradeindex-times)
309
313
  - [bot.setCommandBlock(pos, command, [options])](#botsetcommandblockpos-command-options)
310
314
  - [bot.supportFeature(name)](#botsupportfeaturename)
311
315
  - [bot.waitForTicks(ticks)](#botwaitforticksticks)
312
316
  - [Lower level inventory methods](#lower-level-inventory-methods)
313
- - [bot.clickWindow(slot, mouseButton, mode, cb)](#botclickwindowslot-mousebutton-mode-cb)
317
+ - [bot.clickWindow(slot, mouseButton, mode)](#botclickwindowslot-mousebutton-mode)
314
318
  - [bot.putSelectedItemRange(start, end, window, slot)](#botputselecteditemrangestart-end-window-slot)
315
319
  - [bot.putAway(slot)](#botputawayslot)
316
320
  - [bot.closeWindow(window)](#botclosewindowwindow)
317
- - [bot.transfer(options, cb)](#bottransferoptions-cb)
321
+ - [bot.transfer(options)](#bottransferoptions)
318
322
  - [bot.openBlock(block)](#botopenblockblock)
319
323
  - [bot.openEntity(entity)](#botopenentityentity)
320
- - [bot.moveSlotItem(sourceSlot, destSlot, cb)](#botmoveslotitemsourceslot-destslot-cb)
324
+ - [bot.moveSlotItem(sourceSlot, destSlot)](#botmoveslotitemsourceslot-destslot)
321
325
  - [bot.updateHeldItem()](#botupdatehelditem)
322
326
  - [bot.getEquipmentDestSlot(destination)](#botgetequipmentdestslotdestination)
323
327
  - [bot.creative](#botcreative)
324
- - [bot.creative.setInventorySlot(slot, item, [callback])](#botcreativesetinventoryslotslot-item-callback)
325
- - [bot.creative.flyTo(destination, [cb])](#botcreativeflytodestination-cb)
328
+ - [bot.creative.setInventorySlot(slot, item)](#botcreativesetinventoryslotslot-item)
329
+ - [bot.creative.flyTo(destination)](#botcreativeflytodestination)
326
330
  - [bot.creative.startFlying()](#botcreativestartflying)
327
331
  - [bot.creative.stopFlying()](#botcreativestopflying)
328
332
 
@@ -418,23 +422,23 @@ See [prismarine-item](https://github.com/PrismarineJS/prismarine-item)
418
422
 
419
423
  See [prismarine-windows](https://github.com/PrismarineJS/prismarine-windows)
420
424
 
421
- #### window.deposit(itemType, metadata, count, [callback])
425
+ #### window.deposit(itemType, metadata, count, nbt)
422
426
 
423
- This function also returns a `Promise`, with `void` as its argument upon completion.
427
+ This function returns a `Promise`, with `void` as its argument when done depositing.
424
428
 
425
429
  * `itemType` - numerical item id
426
430
  * `metadata` - numerical value. `null` means match anything.
427
431
  * `count` - how many to deposit. `null` is an alias to 1.
428
- * `callback(err)` - (optional) - called when done depositing
432
+ * `nbt` - match nbt data. `null` is do not match nbt.
429
433
 
430
- #### window.withdraw(itemType, metadata, count, [callback])
434
+ #### window.withdraw(itemType, metadata, count, nbt)
431
435
 
432
- This function also returns a `Promise`, with `void` as its argument upon completion.
436
+ This function returns a `Promise`, with `void` as its argument when done withdrawing. Throws and error if the bot has no free room in its inventory.
433
437
 
434
438
  * `itemType` - numerical item id
435
439
  * `metadata` - numerical value. `null` means match anything.
436
440
  * `count` - how many to withdraw. `null` is an alias to 1.
437
- * `callback(err)` - (optional) - called when done withdrawing
441
+ * `nbt` - match nbt data. `null` is do not match nbt.
438
442
 
439
443
  #### window.close()
440
444
 
@@ -456,31 +460,28 @@ See `bot.openFurnace(furnaceBlock)`.
456
460
 
457
461
  Fires when `furnace.fuel` and/or `furnace.progress` update.
458
462
 
459
- #### furnace.takeInput([callback])
463
+ #### furnace.takeInput()
460
464
 
461
- This function also returns a `Promise`, with `item` as its argument upon completion.
465
+ This function returns a `Promise`, with `item` as its argument upon completion.
462
466
 
463
- * `callback(err, item)`
464
467
 
465
- #### furnace.takeFuel([callback])
468
+ #### furnace.takeFuel()
466
469
 
467
- This function also returns a `Promise`, with `item` as its argument upon completion.
470
+ This function returns a `Promise`, with `item` as its argument upon completion.
468
471
 
469
- * `callback(err, item)`
470
472
 
471
- #### furnace.takeOutput([callback])
473
+ #### furnace.takeOutput()
472
474
 
473
- This function also returns a `Promise`, with `item` as its argument upon completion.
475
+ This function returns a `Promise`, with `item` as its argument upon completion.
474
476
 
475
- * `callback(err, item)`
476
477
 
477
- #### furnace.putInput(itemType, metadata, count, [cb])
478
+ #### furnace.putInput(itemType, metadata, count)
478
479
 
479
- This function also returns a `Promise`, with `void` as its argument upon completion.
480
+ This function returns a `Promise`, with `void` as its argument upon completion.
480
481
 
481
- #### furnace.putFuel(itemType, metadata, count, [cb])
482
+ #### furnace.putFuel(itemType, metadata, count)
482
483
 
483
- This function also returns a `Promise`, with `void` as its argument upon completion.
484
+ This function returns a `Promise`, with `void` as its argument upon completion.
484
485
 
485
486
  #### furnace.inputItem()
486
487
 
@@ -542,47 +543,41 @@ Looks like:
542
543
  ]
543
544
  ```
544
545
 
545
- #### enchantmentTable.enchant(choice, [callback])
546
+ #### enchantmentTable.enchant(choice)
546
547
 
547
- This function also returns a `Promise`, with `item` as its argument upon completion.
548
+ This function returns a `Promise`, with `item` as its argument when the item has been enchanted.
548
549
 
549
550
  * `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
551
 
552
- #### enchantmentTable.takeTargetItem([callback])
552
+ #### enchantmentTable.takeTargetItem()
553
553
 
554
- This function also returns a `Promise`, with `item` as its argument upon completion.
554
+ This function returns a `Promise`, with `item` as its argument upon completion.
555
555
 
556
- * `callback(err, item)`
557
556
 
558
- #### enchantmentTable.putTargetItem(item, [callback])
557
+ #### enchantmentTable.putTargetItem(item)
559
558
 
560
- This function also returns a `Promise`, with `void` as its argument upon completion.
559
+ This function returns a `Promise`, with `void` as its argument upon completion.
561
560
 
562
- * `callback(err)`
563
561
 
564
- #### enchantmentTable.putLapis(item, [callback])
562
+ #### enchantmentTable.putLapis(item)
565
563
 
566
- This function also returns a `Promise`, with `void` as its argument upon completion.
564
+ This function returns a `Promise`, with `void` as its argument upon completion.
567
565
 
568
- * `callback(err)`
569
566
 
570
567
  ### mineflayer.anvil
571
568
 
572
569
  Extends windows.Window for anvils
573
570
  See `bot.openAnvil(anvilBlock)`.
574
571
 
575
- #### anvil.combine(itemOne, itemTwo[, name, callback])
572
+ #### anvil.combine(itemOne, itemTwo[, name])
576
573
 
577
- This function also returns a `Promise`, with `void` as its argument upon completion.
574
+ This function returns a `Promise`, with `void` as its argument upon completion.
578
575
 
579
- * `callback(err)` - in order to use callback, pass an empty string ('') for name
580
576
 
581
- #### anvil.combine(item[, name, callback])
577
+ #### anvil.combine(item[, name])
582
578
 
583
- This function also returns a `Promise`, with `void` as its argument upon completion.
579
+ This function returns a `Promise`, with `void` as its argument upon completion.
584
580
 
585
- * `callback(err)`
586
581
 
587
582
  #### villager "ready"
588
583
 
@@ -626,8 +621,8 @@ Looks like:
626
621
  ]
627
622
  ```
628
623
 
629
- #### villager.trade(tradeIndex, [times], [cb])
630
- Is the same as [bot.trade(villagerInstance, tradeIndex, [times], [cb])](#bottradevillagerinstance-tradeindex-times-cb)
624
+ #### villager.trade(tradeIndex, [times])
625
+ Is the same as [bot.trade(villagerInstance, tradeIndex, [times])](#bottradevillagerinstance-tradeindex-times)
631
626
 
632
627
  ### mineflayer.ScoreBoard
633
628
 
@@ -756,6 +751,8 @@ Create and return an instance of the class bot.
756
751
  * [viewDistance](#bot.settings.viewDistance)
757
752
  * [difficulty](#bot.settings.difficulty)
758
753
  * [skinParts](#bot.settings.skinParts)
754
+ * [enableTextFiltering](#bot.settings.enableTextFiltering)
755
+ * [enableServerListing](#bot.settings.enableServerListing)
759
756
  * chatLengthLimit : the maximum amount of characters that can be sent in a single message. If this is not set, it will be 100 in < 1.11 and 256 in >= 1.11.
760
757
  * defaultChatPatterns: defaults to true, set to false to not add the patterns such as chat and whisper
761
758
 
@@ -892,6 +889,7 @@ Default true, whether or not you receive color codes in chats from the server.
892
889
 
893
890
  #### bot.settings.viewDistance
894
891
 
892
+ Can be a string listed below or a postive number.
895
893
  Choices:
896
894
  * `far` (default)
897
895
  * `normal`
@@ -922,7 +920,10 @@ If you have a cape you can turn it off by setting this to false.
922
920
 
923
921
  ##### bot.settings.skinParts.showHat - boolean
924
922
 
925
-
923
+ #### bot.settings.enableTextFiltering - boolean
924
+ Unused, defaults to false in Notchian (Vanilla) client.
925
+ #### bot.settings.enableServerListing - boolean
926
+ This setting is sent to the server to determine whether the player should show up in server listings
926
927
  #### bot.experience.level
927
928
 
928
929
  #### bot.experience.points
@@ -1440,11 +1441,9 @@ Fires when the all of a chat pattern's regexs have matches
1440
1441
  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
1442
  See `Block`.
1442
1443
 
1443
- #### bot.waitForChunksToLoad(cb)
1444
-
1445
- This function also returns a `Promise`, with `void` as its argument upon completion.
1444
+ #### bot.waitForChunksToLoad()
1446
1445
 
1447
- The cb gets called when many chunks have loaded.
1446
+ This function returns a `Promise`, with `void` as its argument when many chunks have loaded.
1448
1447
 
1449
1448
  #### bot.blockInSight(maxSteps, vectorLength)
1450
1449
 
@@ -1529,14 +1528,12 @@ End the connection with the server.
1529
1528
 
1530
1529
  Gracefully disconnect from the server with the given reason (defaults to 'disconnect.quitting').
1531
1530
 
1532
- #### bot.tabComplete(str, cb, [assumeCommand], [sendBlockInSight])
1531
+ #### bot.tabComplete(str, [assumeCommand], [sendBlockInSight])
1533
1532
 
1534
- This function also returns a `Promise`, with `matches` as its argument upon completion.
1533
+ This function returns a `Promise`, with `matches` as its argument upon completion.
1535
1534
 
1536
1535
  Requests chat completion from the server.
1537
1536
  * `str` - String to complete.
1538
- * `callback(matches)`
1539
- - `matches` - Array of matching strings.
1540
1537
  * `assumeCommand` - Field sent to server, defaults to false.
1541
1538
  * `sendBlockInSight` - Field sent to server, defaults to true. Set this option to false if you want more performance.
1542
1539
 
@@ -1644,21 +1641,21 @@ Injects plugins see `bot.loadPlugin`.
1644
1641
 
1645
1642
  Checks if the given plugin is loaded (or scheduled to be loaded) on this bot.
1646
1643
 
1647
- #### bot.sleep(bedBlock, [cb])
1644
+ #### bot.sleep(bedBlock)
1648
1645
 
1649
- This function also returns a `Promise`, with `void` as its argument upon completion.
1646
+ This function returns a `Promise`, with `void` as its argument upon completion.
1650
1647
 
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.
1648
+ Sleep in a bed. `bedBlock` should be a `Block` instance which is a bed.
1652
1649
 
1653
1650
  #### bot.isABed(bedBlock)
1654
1651
 
1655
1652
  Return true if `bedBlock` is a bed
1656
1653
 
1657
- #### bot.wake([cb])
1654
+ #### bot.wake()
1658
1655
 
1659
- This function also returns a `Promise`, with `void` as its argument upon completion.
1656
+ This function returns a `Promise`, with `void` as its argument upon completion.
1660
1657
 
1661
- Get out of bed. `cb` can have an err parameter if the bot cannot wake up.
1658
+ Get out of bed.
1662
1659
 
1663
1660
  #### bot.setControlState(control, state)
1664
1661
 
@@ -1689,17 +1686,16 @@ It will return `null` if the entity has no armor and rawDamages is not set to tr
1689
1686
  * `radius` - the explosion radius as a number
1690
1687
  * `rawDamages` - optional, if true it ignores armor in the calculation
1691
1688
 
1692
- #### bot.lookAt(point, [force], [callback])
1689
+ #### bot.lookAt(point, [force])
1693
1690
 
1694
- This function also returns a `Promise`, with `void` as its argument upon completion.
1691
+ This function returns a `Promise`, with `void` as its argument when you are looking at `point`.
1695
1692
 
1696
1693
  * `point` [Vec3](https://github.com/andrewrk/node-vec3) instance - tilts your head so that it is directly facing this point.
1697
1694
  * `force` - See `force` in `bot.look`
1698
- * `callback()` optional, called when you are looking at `point`
1699
1695
 
1700
- #### bot.look(yaw, pitch, [force], [callback])
1696
+ #### bot.look(yaw, pitch, [force])
1701
1697
 
1702
- This function also returns a `Promise`, with `void` as its argument upon completion.
1698
+ This function returns a `Promise`, with `void` as its argument called when you are looking at `yaw` and `pitch`.
1703
1699
 
1704
1700
  Set the direction your head is facing.
1705
1701
 
@@ -1711,15 +1707,14 @@ Set the direction your head is facing.
1711
1707
  Specify this to true if you need the server to know exactly where you
1712
1708
  are looking, such as for dropping items or shooting arrows. This is not
1713
1709
  needed for client-side calculation such as walking direction.
1714
- * `callback()` optional, called when you are looking at `yaw` and `pitch`
1715
1710
 
1716
1711
  #### bot.updateSign(block, text)
1717
1712
 
1718
1713
  Changes the text on the sign.
1719
1714
 
1720
- #### bot.equip(item, destination, [callback])
1715
+ #### bot.equip(item, destination)
1721
1716
 
1722
- This function also returns a `Promise`, with `void` as its argument upon completion.
1717
+ 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
1718
 
1724
1719
  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
1720
 
@@ -1731,36 +1726,32 @@ Equips an item from your inventory. If the argument `item` is of Instance `Item`
1731
1726
  - `"legs"`
1732
1727
  - `"feet"`
1733
1728
  - `"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
1729
 
1737
- #### bot.unequip(destination, [callback])
1730
+ #### bot.unequip(destination)
1738
1731
 
1739
- This function also returns a `Promise`, with `void` as its argument upon completion.
1732
+ This function returns a `Promise`, with `void` as its argument upon completion.
1740
1733
 
1741
1734
  Remove an article of equipment.
1742
1735
 
1743
- #### bot.tossStack(item, [callback])
1736
+ #### bot.tossStack(item)
1744
1737
 
1745
- This function also returns a `Promise`, with `void` as its argument upon completion.
1738
+ This function returns a `Promise`, with `void` as its argument when tossing is done.
1746
1739
 
1747
1740
  * `item` - the stack of items you wish to toss
1748
- * `callback(error)` - optional, called when tossing is done. if error is
1749
1741
  truthy, you were not able to complete the toss.
1750
1742
 
1751
- #### bot.toss(itemType, metadata, count, [callback])
1743
+ #### bot.toss(itemType, metadata, count)
1752
1744
 
1753
- This function also returns a `Promise`, with `void` as its argument upon completion.
1745
+ This function returns a `Promise`, with `void` as its argument once tossing is complete.
1754
1746
 
1755
1747
  * `itemType` - numerical id of the item you wish to toss
1756
1748
  * `metadata` - metadata of the item you wish to toss. Use `null`
1757
1749
  to match any metadata
1758
1750
  * `count` - how many you want to toss. `null` is an alias for `1`.
1759
- * `callback(err)` - (optional) called once tossing is complete
1760
1751
 
1761
- #### bot.dig(block, [forceLook = true], [digFace], [callback])
1752
+ #### bot.dig(block, [forceLook = true], [digFace])
1762
1753
 
1763
- This function also returns a `Promise`, with `void` as its argument upon completion.
1754
+ This function returns a `Promise`, with `void` as its argument when the block is broken or you are interrupted.
1764
1755
 
1765
1756
  Begin digging into `block` with the currently equipped item.
1766
1757
  See also "diggingCompleted" and "diggingAborted" events.
@@ -1773,8 +1764,6 @@ dig any other blocks until the block has been broken, or you call
1773
1764
  * `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
1765
  * `digFace` - (optional) Default is 'auto' looks at the center of the block and mines the top face. Can also be a vec3 vector
1775
1766
  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
1767
 
1779
1768
  If you call bot.dig twice before the first dig is finished, you will get a fatal 'diggingAborted' error.
1780
1769
 
@@ -1792,20 +1781,19 @@ Accepts resource pack.
1792
1781
 
1793
1782
  Denies resource pack.
1794
1783
 
1795
- #### bot.placeBlock(referenceBlock, faceVector, cb)
1784
+ #### bot.placeBlock(referenceBlock, faceVector)
1796
1785
 
1797
- This function also returns a `Promise`, with `void` as its argument upon completion.
1786
+ This function returns a `Promise`, with `void` as its argument when the server confirms that the block has indeed been placed.
1798
1787
 
1799
1788
  * `referenceBlock` - the block you want to place a new block next to
1800
1789
  * `faceVector` - one of the six cardinal directions, such as `new Vec3(0, 1, 0)` for the top face,
1801
1790
  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
1791
 
1804
1792
  The new block will be placed at `referenceBlock.position.plus(faceVector)`.
1805
1793
 
1806
1794
  #### bot.placeEntity(referenceBlock, faceVector)
1807
1795
 
1808
- This function also returns a `Promise`, with `Entity` as its argument upon completion.
1796
+ This function returns a `Promise`, with `Entity` as its argument upon completion.
1809
1797
 
1810
1798
  * `referenceBlock` - the block you want to place the entity next to
1811
1799
  * `faceVector` - one of the six cardinal directions, such as `new Vec3(0, 1, 0)` for the top face,
@@ -1813,49 +1801,44 @@ This function also returns a `Promise`, with `Entity` as its argument upon compl
1813
1801
 
1814
1802
  The new block will be placed at `referenceBlock.position.plus(faceVector)`.
1815
1803
 
1816
- #### bot.activateBlock(block, [callback])
1804
+ #### bot.activateBlock(block)
1817
1805
 
1818
- This function also returns a `Promise`, with `void` as its argument upon completion.
1806
+ This function returns a `Promise`, with `void` as its argument upon completion.
1819
1807
 
1820
1808
  Punch a note block, open a door, etc.
1821
1809
 
1822
1810
  * `block` - the block to activate
1823
- * `callback(err)` - (optional) called when the block has been activated
1824
1811
 
1825
- #### bot.activateEntity(entity, [callback])
1812
+ #### bot.activateEntity(entity)
1826
1813
 
1827
- This function also returns a `Promise`, with `void` as its argument upon completion.
1814
+ This function returns a `Promise`, with `void` as its argument upon completion.
1828
1815
 
1829
1816
  Activate an entity, useful for villager for example.
1830
1817
 
1831
1818
  * `entity` - the entity to activate
1832
- * `callback(err)` - (optional) called when the entity has been activated
1833
1819
 
1834
- #### bot.activateEntityAt(entity, position, [callback])
1820
+ #### bot.activateEntityAt(entity, position)
1835
1821
 
1836
- This function also returns a `Promise`, with `void` as its argument upon completion.
1822
+ This function returns a `Promise`, with `void` as its argument upon completion.
1837
1823
 
1838
1824
  Activate an entity at the given position, useful for armor stands.
1839
1825
 
1840
1826
  * `entity` - the entity to activate
1841
1827
  * `position` - the world position to click at
1842
- * `callback(err)` - (optional) called when the entity has been activated
1843
1828
 
1844
- #### bot.consume(callback)
1829
+ #### bot.consume()
1845
1830
 
1846
- This function also returns a `Promise`, with `void` as its argument upon completion.
1831
+ This function returns a `Promise`, with `void` as its argument when consume ends.
1847
1832
 
1848
1833
  Eat / drink currently held item
1849
1834
 
1850
- * `callback(error)` - called when consume ends
1851
1835
 
1852
- #### bot.fish(callback)
1836
+ #### bot.fish()
1853
1837
 
1854
- This function also returns a `Promise`, with `void` as its argument upon completion.
1838
+ This function returns a `Promise`, with `void` as its argument when fishing ends.
1855
1839
 
1856
1840
  Use fishing rod
1857
1841
 
1858
- * `callback(error)` - called when fishing ends
1859
1842
 
1860
1843
  #### bot.activateItem(offHand=false)
1861
1844
 
@@ -1906,9 +1889,9 @@ All the direction are relative to where the bot is looking at
1906
1889
 
1907
1890
  * `slot` - 0-8 the quick bar slot to select.
1908
1891
 
1909
- #### bot.craft(recipe, count, craftingTable, [callback])
1892
+ #### bot.craft(recipe, count, craftingTable)
1910
1893
 
1911
- 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 crafting is complete and your inventory is updated.
1912
1895
 
1913
1896
  * `recipe` - A `Recipe` instance. See `bot.recipesFor`.
1914
1897
  * `count` - How many times you wish to perform the operation.
@@ -1917,16 +1900,13 @@ This function also returns a `Promise`, with `void` as its argument upon complet
1917
1900
  * `craftingTable` - A `Block` instance, the crafting table you wish to
1918
1901
  use. If the recipe does not require a crafting table, you may use
1919
1902
  `null` for this argument.
1920
- * `callback` - (optional) Called when the crafting is complete and your
1921
- inventory is updated.
1922
1903
 
1923
- #### bot.writeBook(slot, pages, [callback])
1904
+ #### bot.writeBook(slot, pages)
1924
1905
 
1925
- This function also returns a `Promise`, with `void` as its argument upon completion.
1906
+ This function returns a `Promise`, with `void` as its argument when the writing was successfully or an error occurred.
1926
1907
 
1927
1908
  * `slot` is in inventory window coordinates (where 36 is the first quickbar slot, etc.).
1928
1909
  * `pages` is an array of strings represents the pages.
1929
- * `callback(error)` - optional. called when the writing was successfully or an error occurred.
1930
1910
 
1931
1911
  #### bot.openContainer(containerBlock or containerEntity)
1932
1912
 
@@ -1958,9 +1938,9 @@ Returns a promise on an `anvil` instance which represents the anvil you are open
1958
1938
  Returns a promise on a `Villager` instance which represents the trading window you are opening.
1959
1939
  You can listen to the `ready` event on this `Villager` to know when it's ready
1960
1940
 
1961
- #### bot.trade(villagerInstance, tradeIndex, [times], [cb])
1941
+ #### bot.trade(villagerInstance, tradeIndex, [times])
1962
1942
 
1963
- This function also returns a `Promise`, with `void` as its argument upon completion.
1943
+ This function returns a `Promise`, with `void` as its argument upon completion.
1964
1944
 
1965
1945
  Uses the open `villagerInstance` to trade.
1966
1946
 
@@ -1993,21 +1973,21 @@ This is a promise-based function that waits for a given number of in-game ticks
1993
1973
 
1994
1974
  These are lower level methods for the inventory, they can be useful sometimes but prefer the inventory methods presented above if you can.
1995
1975
 
1996
- #### bot.clickWindow(slot, mouseButton, mode, cb)
1976
+ #### bot.clickWindow(slot, mouseButton, mode)
1997
1977
 
1998
- 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.
1999
1979
 
2000
1980
  Click on the current window. See details at https://wiki.vg/Protocol#Click_Window
2001
1981
 
2002
1982
  #### bot.putSelectedItemRange(start, end, window, slot)
2003
1983
 
2004
- This function also returns a `Promise`, with `void` as its argument upon completion.
1984
+ This function returns a `Promise`, with `void` as its argument upon completion.
2005
1985
 
2006
1986
  Put the item at `slot` in the specified range.
2007
1987
 
2008
1988
  #### bot.putAway(slot)
2009
1989
 
2010
- This function also returns a `Promise`, with `void` as its argument upon completion.
1990
+ This function returns a `Promise`, with `void` as its argument upon completion.
2011
1991
 
2012
1992
  Put the item at `slot` in the inventory.
2013
1993
 
@@ -2015,9 +1995,9 @@ Put the item at `slot` in the inventory.
2015
1995
 
2016
1996
  Close the `window`.
2017
1997
 
2018
- #### bot.transfer(options, cb)
1998
+ #### bot.transfer(options)
2019
1999
 
2020
- This function also returns a `Promise`, with `void` as its argument upon completion.
2000
+ This function returns a `Promise`, with `void` as its argument upon completion.
2021
2001
 
2022
2002
  Transfer some kind of item from one range to an other. `options` is an object containing :
2023
2003
 
@@ -2041,9 +2021,9 @@ Open an entity with an inventory, for example a villager, returns a promise on t
2041
2021
 
2042
2022
  * `entity` is the entity the bot will open
2043
2023
 
2044
- #### bot.moveSlotItem(sourceSlot, destSlot, cb)
2024
+ #### bot.moveSlotItem(sourceSlot, destSlot)
2045
2025
 
2046
- This function also returns a `Promise`, with `void` as its argument upon completion.
2026
+ This function returns a `Promise`, with `void` as its argument upon completion.
2047
2027
 
2048
2028
  Move an item from `sourceSlot` to `destSlot` in the current window.
2049
2029
 
@@ -2069,31 +2049,27 @@ This collection of apis is useful in creative mode.
2069
2049
  Detecting and changing gamemodes is not implemented here,
2070
2050
  but it is assumed and often required that the bot be in creative mode for these features to work.
2071
2051
 
2072
- #### bot.creative.setInventorySlot(slot, item, [callback])
2052
+ #### bot.creative.setInventorySlot(slot, item)
2073
2053
 
2074
- 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 gets fired when the servers sets the slot.
2075
2055
 
2076
2056
  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
2057
 
2079
2058
  * `slot` is in inventory window coordinates (where 36 is the first quickbar slot, etc.).
2080
2059
  * `item` is a [prismarine-item](https://github.com/PrismarineJS/prismarine-item) instance specified with arbitrary metadata, nbtdata, etc.
2081
2060
  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
2061
 
2084
2062
  If this method changes anything, you can be notified via `bot.inventory.on("updateSlot")`.
2085
2063
 
2086
- #### bot.creative.flyTo(destination, [cb])
2064
+ #### bot.creative.flyTo(destination)
2087
2065
 
2088
- This function also returns a `Promise`, with `void` as its argument upon completion.
2066
+ This function returns a `Promise`, with `void` as its argument when the bot arrives at the destination.
2089
2067
 
2090
2068
  Calls `startFlying()` and moves at a constant speed through 3d space in a straight line to the destination.
2091
2069
  `destination` is a `Vec3`, and often the `x` and `z` coordinates will end with `.5`.
2092
2070
  This operation will not work if there is an obstacle in the way,
2093
2071
  so it is advised to fly very short distances at a time.
2094
2072
 
2095
- When the bot arrives at the destination, `cb` is called.
2096
-
2097
2073
  This method does not attempt any path finding.
2098
2074
  It is expected that a path finding implementation will use this method to move < 2 blocks at a time.
2099
2075