mineflayer 3.17.0 → 3.18.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/README.md +0 -4
- package/docs/README.md +0 -4
- package/docs/api.md +122 -158
- package/docs/history.md +4 -0
- package/index.d.ts +38 -57
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -197,10 +197,6 @@ The most updated and useful are :
|
|
|
197
197
|
|
|
198
198
|
* [radar](https://github.com/andrewrk/mineflayer-radar/) - web based radar
|
|
199
199
|
interface using canvas and socket.io. [YouTube Demo](https://www.youtube.com/watch?v=FjDmAfcVulQ)
|
|
200
|
-
* [blockfinder](https://github.com/Darthfett/mineflayer-blockFinder) - find blocks in the 3D world
|
|
201
|
-
* [scaffold](https://github.com/andrewrk/mineflayer-scaffold) - get to
|
|
202
|
-
a target destination even if you have to build or break blocks to do so.
|
|
203
|
-
[YouTube Demo](http://youtu.be/jkg6psMUSE0)
|
|
204
200
|
* [auto-auth](https://github.com/G07cha/MineflayerAutoAuth) - chat-based bot authentication
|
|
205
201
|
* [Bloodhound](https://github.com/Nixes/mineflayer-bloodhound) - determine who and what is responsible for damage to another entity
|
|
206
202
|
* [tps](https://github.com/SiebeDW/mineflayer-tps) - get the current tps (processed tps)
|
package/docs/README.md
CHANGED
|
@@ -197,10 +197,6 @@ The most updated and useful are :
|
|
|
197
197
|
|
|
198
198
|
* [radar](https://github.com/andrewrk/mineflayer-radar/) - web based radar
|
|
199
199
|
interface using canvas and socket.io. [YouTube Demo](https://www.youtube.com/watch?v=FjDmAfcVulQ)
|
|
200
|
-
* [blockfinder](https://github.com/Darthfett/mineflayer-blockFinder) - find blocks in the 3D world
|
|
201
|
-
* [scaffold](https://github.com/andrewrk/mineflayer-scaffold) - get to
|
|
202
|
-
a target destination even if you have to build or break blocks to do so.
|
|
203
|
-
[YouTube Demo](http://youtu.be/jkg6psMUSE0)
|
|
204
200
|
* [auto-auth](https://github.com/G07cha/MineflayerAutoAuth) - chat-based bot authentication
|
|
205
201
|
* [Bloodhound](https://github.com/Nixes/mineflayer-bloodhound) - determine who and what is responsible for damage to another entity
|
|
206
202
|
* [tps](https://github.com/SiebeDW/mineflayer-tps) - get the current tps (processed tps)
|
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
|
|
24
|
-
- [window.withdraw(itemType, metadata, count
|
|
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(
|
|
31
|
-
- [furnace.takeFuel(
|
|
32
|
-
- [furnace.takeOutput(
|
|
33
|
-
- [furnace.putInput(itemType, metadata, count
|
|
34
|
-
- [furnace.putFuel(itemType, metadata, count
|
|
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
|
|
46
|
-
- [enchantmentTable.takeTargetItem(
|
|
47
|
-
- [enchantmentTable.putTargetItem(item
|
|
48
|
-
- [enchantmentTable.putLapis(item
|
|
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
|
|
51
|
-
- [anvil.combine(item[, name
|
|
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]
|
|
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(
|
|
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,
|
|
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
|
|
264
|
+
- [bot.sleep(bedBlock)](#botsleepbedblock)
|
|
265
265
|
- [bot.isABed(bedBlock)](#botisabedbedblock)
|
|
266
|
-
- [bot.wake(
|
|
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]
|
|
272
|
-
- [bot.look(yaw, pitch, [force]
|
|
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
|
|
275
|
-
- [bot.unequip(destination
|
|
276
|
-
- [bot.tossStack(item
|
|
277
|
-
- [bot.toss(itemType, metadata, count
|
|
278
|
-
- [bot.dig(block, [forceLook = true], [digFace]
|
|
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
|
|
283
|
+
- [bot.placeBlock(referenceBlock, faceVector)](#botplaceblockreferenceblock-facevector)
|
|
284
284
|
- [bot.placeEntity(referenceBlock, faceVector)](#botplaceentityreferenceblock-facevector)
|
|
285
|
-
- [bot.activateBlock(block
|
|
286
|
-
- [bot.activateEntity(entity
|
|
287
|
-
- [bot.activateEntityAt(entity, position
|
|
288
|
-
- [bot.consume(
|
|
289
|
-
- [bot.fish(
|
|
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
|
|
300
|
-
- [bot.writeBook(slot, pages
|
|
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]
|
|
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
|
|
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
|
|
317
|
+
- [bot.transfer(options)](#bottransferoptions)
|
|
318
318
|
- [bot.openBlock(block)](#botopenblockblock)
|
|
319
319
|
- [bot.openEntity(entity)](#botopenentityentity)
|
|
320
|
-
- [bot.moveSlotItem(sourceSlot, destSlot
|
|
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
|
|
325
|
-
- [bot.creative.flyTo(destination
|
|
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
|
|
421
|
+
#### window.deposit(itemType, metadata, count)
|
|
422
422
|
|
|
423
|
-
This function
|
|
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
|
|
429
|
+
#### window.withdraw(itemType, metadata, count)
|
|
431
430
|
|
|
432
|
-
This function
|
|
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(
|
|
457
|
+
#### furnace.takeInput()
|
|
460
458
|
|
|
461
|
-
This function
|
|
459
|
+
This function returns a `Promise`, with `item` as its argument upon completion.
|
|
462
460
|
|
|
463
|
-
* `callback(err, item)`
|
|
464
461
|
|
|
465
|
-
#### furnace.takeFuel(
|
|
462
|
+
#### furnace.takeFuel()
|
|
466
463
|
|
|
467
|
-
This function
|
|
464
|
+
This function returns a `Promise`, with `item` as its argument upon completion.
|
|
468
465
|
|
|
469
|
-
* `callback(err, item)`
|
|
470
466
|
|
|
471
|
-
#### furnace.takeOutput(
|
|
467
|
+
#### furnace.takeOutput()
|
|
472
468
|
|
|
473
|
-
This function
|
|
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
|
|
472
|
+
#### furnace.putInput(itemType, metadata, count)
|
|
478
473
|
|
|
479
|
-
This function
|
|
474
|
+
This function returns a `Promise`, with `void` as its argument upon completion.
|
|
480
475
|
|
|
481
|
-
#### furnace.putFuel(itemType, metadata, count
|
|
476
|
+
#### furnace.putFuel(itemType, metadata, count)
|
|
482
477
|
|
|
483
|
-
This function
|
|
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
|
|
540
|
+
#### enchantmentTable.enchant(choice)
|
|
546
541
|
|
|
547
|
-
This function
|
|
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(
|
|
546
|
+
#### enchantmentTable.takeTargetItem()
|
|
553
547
|
|
|
554
|
-
This function
|
|
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
|
|
551
|
+
#### enchantmentTable.putTargetItem(item)
|
|
559
552
|
|
|
560
|
-
This function
|
|
553
|
+
This function returns a `Promise`, with `void` as its argument upon completion.
|
|
561
554
|
|
|
562
|
-
* `callback(err)`
|
|
563
555
|
|
|
564
|
-
#### enchantmentTable.putLapis(item
|
|
556
|
+
#### enchantmentTable.putLapis(item)
|
|
565
557
|
|
|
566
|
-
This function
|
|
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
|
|
566
|
+
#### anvil.combine(itemOne, itemTwo[, name])
|
|
576
567
|
|
|
577
|
-
This function
|
|
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
|
|
571
|
+
#### anvil.combine(item[, name])
|
|
582
572
|
|
|
583
|
-
This function
|
|
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]
|
|
630
|
-
Is the same as [bot.trade(villagerInstance, tradeIndex, [times]
|
|
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(
|
|
1432
|
+
#### bot.waitForChunksToLoad()
|
|
1444
1433
|
|
|
1445
|
-
This function
|
|
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,
|
|
1519
|
+
#### bot.tabComplete(str, [assumeCommand], [sendBlockInSight])
|
|
1533
1520
|
|
|
1534
|
-
This function
|
|
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
|
|
1632
|
+
#### bot.sleep(bedBlock)
|
|
1648
1633
|
|
|
1649
|
-
This function
|
|
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.
|
|
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(
|
|
1642
|
+
#### bot.wake()
|
|
1658
1643
|
|
|
1659
|
-
This function
|
|
1644
|
+
This function returns a `Promise`, with `void` as its argument upon completion.
|
|
1660
1645
|
|
|
1661
|
-
Get out of bed.
|
|
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]
|
|
1677
|
+
#### bot.lookAt(point, [force])
|
|
1693
1678
|
|
|
1694
|
-
This function
|
|
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]
|
|
1684
|
+
#### bot.look(yaw, pitch, [force])
|
|
1701
1685
|
|
|
1702
|
-
This function
|
|
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
|
|
1703
|
+
#### bot.equip(item, destination)
|
|
1721
1704
|
|
|
1722
|
-
This function
|
|
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
|
|
1718
|
+
#### bot.unequip(destination)
|
|
1738
1719
|
|
|
1739
|
-
This function
|
|
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
|
|
1724
|
+
#### bot.tossStack(item)
|
|
1744
1725
|
|
|
1745
|
-
This function
|
|
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
|
|
1731
|
+
#### bot.toss(itemType, metadata, count)
|
|
1752
1732
|
|
|
1753
|
-
This function
|
|
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]
|
|
1740
|
+
#### bot.dig(block, [forceLook = true], [digFace])
|
|
1762
1741
|
|
|
1763
|
-
This function
|
|
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
|
|
1772
|
+
#### bot.placeBlock(referenceBlock, faceVector)
|
|
1796
1773
|
|
|
1797
|
-
This function
|
|
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
|
|
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
|
|
1792
|
+
#### bot.activateBlock(block)
|
|
1817
1793
|
|
|
1818
|
-
This function
|
|
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
|
|
1800
|
+
#### bot.activateEntity(entity)
|
|
1826
1801
|
|
|
1827
|
-
This function
|
|
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
|
|
1808
|
+
#### bot.activateEntityAt(entity, position)
|
|
1835
1809
|
|
|
1836
|
-
This function
|
|
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(
|
|
1817
|
+
#### bot.consume()
|
|
1845
1818
|
|
|
1846
|
-
This function
|
|
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(
|
|
1824
|
+
#### bot.fish()
|
|
1853
1825
|
|
|
1854
|
-
This function
|
|
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
|
|
1880
|
+
#### bot.craft(recipe, count, craftingTable)
|
|
1910
1881
|
|
|
1911
|
-
This function
|
|
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
|
|
1892
|
+
#### bot.writeBook(slot, pages)
|
|
1924
1893
|
|
|
1925
|
-
This function
|
|
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]
|
|
1929
|
+
#### bot.trade(villagerInstance, tradeIndex, [times])
|
|
1962
1930
|
|
|
1963
|
-
This function
|
|
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
|
|
1964
|
+
#### bot.clickWindow(slot, mouseButton, mode)
|
|
1997
1965
|
|
|
1998
|
-
This function
|
|
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
|
|
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
|
|
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
|
|
1986
|
+
#### bot.transfer(options)
|
|
2019
1987
|
|
|
2020
|
-
This function
|
|
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
|
|
2012
|
+
#### bot.moveSlotItem(sourceSlot, destSlot)
|
|
2045
2013
|
|
|
2046
|
-
This function
|
|
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
|
|
2040
|
+
#### bot.creative.setInventorySlot(slot, item)
|
|
2073
2041
|
|
|
2074
|
-
This function
|
|
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
|
|
2052
|
+
#### bot.creative.flyTo(destination)
|
|
2087
2053
|
|
|
2088
|
-
This function
|
|
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
|
|
package/docs/history.md
CHANGED
package/index.d.ts
CHANGED
|
@@ -229,7 +229,6 @@ export interface Bot extends TypedEmitter<BotEvents> {
|
|
|
229
229
|
|
|
230
230
|
tabComplete: (
|
|
231
231
|
str: string,
|
|
232
|
-
cb: (matches: string[]) => void,
|
|
233
232
|
assumeCommand?: boolean,
|
|
234
233
|
sendBlockInSight?: boolean
|
|
235
234
|
) => Promise<string[]>
|
|
@@ -248,11 +247,11 @@ export interface Bot extends TypedEmitter<BotEvents> {
|
|
|
248
247
|
|
|
249
248
|
hasPlugin: (plugin: Plugin) => boolean
|
|
250
249
|
|
|
251
|
-
sleep: (bedBlock: Block
|
|
250
|
+
sleep: (bedBlock: Block) => Promise<void>
|
|
252
251
|
|
|
253
252
|
isABed: (bedBlock: Block) => void
|
|
254
253
|
|
|
255
|
-
wake: (
|
|
254
|
+
wake: () => Promise<void>
|
|
256
255
|
|
|
257
256
|
setControlState: (control: ControlState, state: boolean) => void
|
|
258
257
|
|
|
@@ -262,38 +261,34 @@ export interface Bot extends TypedEmitter<BotEvents> {
|
|
|
262
261
|
|
|
263
262
|
getExplosionDamages: (targetEntity: Entity, position: Vec3, radius: number, rawDamages?: boolean) => number | null
|
|
264
263
|
|
|
265
|
-
lookAt: (point: Vec3, force?: boolean
|
|
264
|
+
lookAt: (point: Vec3, force?: boolean) => Promise<void>
|
|
266
265
|
|
|
267
266
|
look: (
|
|
268
267
|
yaw: number,
|
|
269
268
|
pitch: number,
|
|
270
|
-
force?: boolean
|
|
271
|
-
callback?: () => void
|
|
269
|
+
force?: boolean
|
|
272
270
|
) => Promise<void>
|
|
273
271
|
|
|
274
272
|
updateSign: (block: Block, text: string) => void
|
|
275
273
|
|
|
276
274
|
equip: (
|
|
277
275
|
item: Item | number,
|
|
278
|
-
destination: EquipmentDestination | null
|
|
279
|
-
callback?: (error?: Error) => void
|
|
276
|
+
destination: EquipmentDestination | null
|
|
280
277
|
) => Promise<void>
|
|
281
278
|
|
|
282
279
|
unequip: (
|
|
283
|
-
destination: EquipmentDestination | null
|
|
284
|
-
callback?: () => void
|
|
280
|
+
destination: EquipmentDestination | null
|
|
285
281
|
) => Promise<void>
|
|
286
282
|
|
|
287
|
-
tossStack: (item: Item
|
|
283
|
+
tossStack: (item: Item) => Promise<void>
|
|
288
284
|
|
|
289
285
|
toss: (
|
|
290
286
|
itemType: number,
|
|
291
287
|
metadata: number | null,
|
|
292
|
-
count: number | null
|
|
293
|
-
callback?: (err?: Error) => void
|
|
288
|
+
count: number | null
|
|
294
289
|
) => Promise<void>
|
|
295
290
|
|
|
296
|
-
dig: ((block: Block, forceLook?: boolean | 'ignore'
|
|
291
|
+
dig: ((block: Block, forceLook?: boolean | 'ignore') => Promise<void>) & ((block: Block, forceLook: boolean | 'ignore', digFace: 'auto' | Vec3 | 'raycast') => Promise<void>)
|
|
297
292
|
|
|
298
293
|
stopDigging: () => void
|
|
299
294
|
|
|
@@ -303,15 +298,15 @@ export interface Bot extends TypedEmitter<BotEvents> {
|
|
|
303
298
|
|
|
304
299
|
placeEntity: (referenceBlock: Block, faceVector: Vec3) => Promise<Entity>
|
|
305
300
|
|
|
306
|
-
activateBlock: (block: Block
|
|
301
|
+
activateBlock: (block: Block) => Promise<void>
|
|
307
302
|
|
|
308
|
-
activateEntity: (block: Entity
|
|
303
|
+
activateEntity: (block: Entity) => Promise<void>
|
|
309
304
|
|
|
310
|
-
activateEntityAt: (block: Entity, position: Vec3
|
|
305
|
+
activateEntityAt: (block: Entity, position: Vec3) => Promise<void>
|
|
311
306
|
|
|
312
|
-
consume: (
|
|
307
|
+
consume: () => Promise<void>
|
|
313
308
|
|
|
314
|
-
fish: (
|
|
309
|
+
fish: () => Promise<void>
|
|
315
310
|
|
|
316
311
|
activateItem: (offhand?: boolean) => void
|
|
317
312
|
|
|
@@ -334,14 +329,12 @@ export interface Bot extends TypedEmitter<BotEvents> {
|
|
|
334
329
|
craft: (
|
|
335
330
|
recipe: Recipe,
|
|
336
331
|
count: number | null,
|
|
337
|
-
craftingTable: Block
|
|
338
|
-
callback?: () => void
|
|
332
|
+
craftingTable: Block
|
|
339
333
|
) => Promise<void>
|
|
340
334
|
|
|
341
335
|
writeBook: (
|
|
342
336
|
slot: number,
|
|
343
|
-
pages: string[]
|
|
344
|
-
callback?: (err?: Error) => void
|
|
337
|
+
pages: string[]
|
|
345
338
|
) => Promise<void>
|
|
346
339
|
|
|
347
340
|
openContainer: (chest: Block | Entity) => Promise<Chest | Furnace | Dispenser>
|
|
@@ -363,8 +356,7 @@ export interface Bot extends TypedEmitter<BotEvents> {
|
|
|
363
356
|
trade: (
|
|
364
357
|
villagerInstance: Villager,
|
|
365
358
|
tradeIndex: string | number,
|
|
366
|
-
times?: number
|
|
367
|
-
cb?: (err?: Error) => void
|
|
359
|
+
times?: number
|
|
368
360
|
) => Promise<void>
|
|
369
361
|
|
|
370
362
|
setCommandBlock: (pos: Vec3, command: string, trackOutput: boolean) => void
|
|
@@ -372,23 +364,21 @@ export interface Bot extends TypedEmitter<BotEvents> {
|
|
|
372
364
|
clickWindow: (
|
|
373
365
|
slot: number,
|
|
374
366
|
mouseButton: number,
|
|
375
|
-
mode: number
|
|
376
|
-
cb?: (err?: Error) => void
|
|
367
|
+
mode: number
|
|
377
368
|
) => Promise<void>
|
|
378
369
|
|
|
379
370
|
putSelectedItemRange: (
|
|
380
371
|
start: number,
|
|
381
372
|
end: number,
|
|
382
373
|
window: Window,
|
|
383
|
-
slot: any
|
|
384
|
-
cb?: (err?: Error) => void
|
|
374
|
+
slot: any
|
|
385
375
|
) => Promise<void>
|
|
386
376
|
|
|
387
|
-
putAway: (slot: number
|
|
377
|
+
putAway: (slot: number) => Promise<void>
|
|
388
378
|
|
|
389
379
|
closeWindow: (window: Window) => void
|
|
390
380
|
|
|
391
|
-
transfer: (options: TransferOptions
|
|
381
|
+
transfer: (options: TransferOptions) => Promise<void>
|
|
392
382
|
|
|
393
383
|
openBlock: (block: Block, Class: new () => EventEmitter) => Promise<void>
|
|
394
384
|
|
|
@@ -396,15 +386,14 @@ export interface Bot extends TypedEmitter<BotEvents> {
|
|
|
396
386
|
|
|
397
387
|
moveSlotItem: (
|
|
398
388
|
sourceSlot: number,
|
|
399
|
-
destSlot: number
|
|
400
|
-
cb?: (err?: Error) => void
|
|
389
|
+
destSlot: number
|
|
401
390
|
) => Promise<void>
|
|
402
391
|
|
|
403
392
|
updateHeldItem: () => void
|
|
404
393
|
|
|
405
394
|
getEquipmentDestSlot: (destination: string) => number
|
|
406
395
|
|
|
407
|
-
waitForChunksToLoad: (
|
|
396
|
+
waitForChunksToLoad: () => Promise<void>
|
|
408
397
|
|
|
409
398
|
nearestEntity: (filter?: (entity: Entity) => boolean) => Entity | null
|
|
410
399
|
|
|
@@ -579,11 +568,10 @@ export interface TransferOptions {
|
|
|
579
568
|
export interface creativeMethods {
|
|
580
569
|
setInventorySlot: (
|
|
581
570
|
slot: number,
|
|
582
|
-
item: Item | null
|
|
583
|
-
callback?: (error?: Error) => void
|
|
571
|
+
item: Item | null
|
|
584
572
|
) => Promise<void>
|
|
585
573
|
|
|
586
|
-
flyTo: (destination: Vec3
|
|
574
|
+
flyTo: (destination: Vec3) => Promise<void>
|
|
587
575
|
|
|
588
576
|
startFlying: () => void
|
|
589
577
|
|
|
@@ -634,15 +622,13 @@ export class Chest extends (EventEmitter as new () => TypedEmitter<StorageEvents
|
|
|
634
622
|
deposit (
|
|
635
623
|
itemType: number,
|
|
636
624
|
metadata: number | null,
|
|
637
|
-
count: number | null
|
|
638
|
-
cb?: (err?: Error) => void
|
|
625
|
+
count: number | null
|
|
639
626
|
): Promise<void>;
|
|
640
627
|
|
|
641
628
|
withdraw (
|
|
642
629
|
itemType: number,
|
|
643
630
|
metadata: number | null,
|
|
644
|
-
count: number | null
|
|
645
|
-
cb?: (err?: Error) => void
|
|
631
|
+
count: number | null
|
|
646
632
|
): Promise<void>;
|
|
647
633
|
|
|
648
634
|
count (itemType: number, metadata: number | null): number;
|
|
@@ -658,24 +644,22 @@ export class Furnace extends (EventEmitter as new () => TypedEmitter<FurnaceEven
|
|
|
658
644
|
|
|
659
645
|
close (): void;
|
|
660
646
|
|
|
661
|
-
takeInput (
|
|
647
|
+
takeInput (): Promise<Item>;
|
|
662
648
|
|
|
663
|
-
takeFuel (
|
|
649
|
+
takeFuel (): Promise<Item>;
|
|
664
650
|
|
|
665
|
-
takeOutput (
|
|
651
|
+
takeOutput (): Promise<Item>;
|
|
666
652
|
|
|
667
653
|
putInput (
|
|
668
654
|
itemType: number,
|
|
669
655
|
metadata: number | null,
|
|
670
|
-
count: number
|
|
671
|
-
cb?: (err?: Error) => void
|
|
656
|
+
count: number
|
|
672
657
|
): Promise<void>;
|
|
673
658
|
|
|
674
659
|
putFuel (
|
|
675
660
|
itemType: number,
|
|
676
661
|
metadata: number | null,
|
|
677
|
-
count: number
|
|
678
|
-
cb?: (err?: Error) => void
|
|
662
|
+
count: number
|
|
679
663
|
): Promise<void>;
|
|
680
664
|
|
|
681
665
|
inputItem (): Item;
|
|
@@ -693,15 +677,13 @@ export class Dispenser extends (EventEmitter as new () => TypedEmitter<StorageEv
|
|
|
693
677
|
deposit (
|
|
694
678
|
itemType: number,
|
|
695
679
|
metadata: number | null,
|
|
696
|
-
count: number | null
|
|
697
|
-
cb?: (err?: Error) => void
|
|
680
|
+
count: number | null
|
|
698
681
|
): Promise<void>;
|
|
699
682
|
|
|
700
683
|
withdraw (
|
|
701
684
|
itemType: number,
|
|
702
685
|
metadata: number | null,
|
|
703
|
-
count: number | null
|
|
704
|
-
cb?: (err?: Error) => void
|
|
686
|
+
count: number | null
|
|
705
687
|
): Promise<void>;
|
|
706
688
|
|
|
707
689
|
count (itemType: number, metadata: number | null): number;
|
|
@@ -719,15 +701,14 @@ export class EnchantmentTable extends (EventEmitter as new () => TypedEmitter<Co
|
|
|
719
701
|
targetItem (): Item;
|
|
720
702
|
|
|
721
703
|
enchant (
|
|
722
|
-
choice: string | number
|
|
723
|
-
cb?: (err: Error | null, item: Item) => void
|
|
704
|
+
choice: string | number
|
|
724
705
|
): Promise<Item>;
|
|
725
706
|
|
|
726
|
-
takeTargetItem (
|
|
707
|
+
takeTargetItem (): Promise<Item>;
|
|
727
708
|
|
|
728
|
-
putTargetItem (item: Item
|
|
709
|
+
putTargetItem (item: Item): Promise<Item>;
|
|
729
710
|
|
|
730
|
-
putLapis (item: Item
|
|
711
|
+
putLapis (item: Item): Promise<Item>;
|
|
731
712
|
}
|
|
732
713
|
|
|
733
714
|
export class Anvil {
|