-
-
Notifications
You must be signed in to change notification settings - Fork 924
/
index.d.ts
897 lines (715 loc) · 22.5 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
import { EventEmitter } from 'events'
import TypedEmitter from 'typed-emitter'
import { Client, ClientOptions } from 'minecraft-protocol'
import { Vec3 } from 'vec3'
import { Item } from 'prismarine-item'
import { Window } from 'prismarine-windows'
import { Recipe } from 'prismarine-recipe'
import { Block } from 'prismarine-block'
import { Entity } from 'prismarine-entity'
import { ChatMessage } from 'prismarine-chat'
import { world } from 'prismarine-world'
import { Registry } from 'prismarine-registry'
import { IndexedData } from 'minecraft-data'
export function createBot (options: { client: Client } & Partial<BotOptions>): Bot
export function createBot (options: BotOptions): Bot
export interface BotOptions extends ClientOptions {
logErrors?: boolean
hideErrors?: boolean
loadInternalPlugins?: boolean
plugins?: PluginOptions
chat?: ChatLevel
colorsEnabled?: boolean
viewDistance?: ViewDistance
mainHand?: MainHands
difficulty?: number
chatLengthLimit?: number
physicsEnabled?: boolean
/** @default 4 */
maxCatchupTicks?: number
client?: Client
brand?: string
defaultChatPatterns?: boolean
respawn?: boolean
}
export type ChatLevel = 'enabled' | 'commandsOnly' | 'disabled'
export type ViewDistance = 'far' | 'normal' | 'short' | 'tiny' | number
export type MainHands = 'left' | 'right'
export interface PluginOptions {
[plugin: string]: boolean | Plugin
}
export type Plugin = (bot: Bot, options: BotOptions) => void
export interface BotEvents {
chat: (
username: string,
message: string,
translate: string | null,
jsonMsg: ChatMessage,
matches: string[] | null
) => Promise<void> | void
whisper: (
username: string,
message: string,
translate: string | null,
jsonMsg: ChatMessage,
matches: string[] | null
) => Promise<void> | void
actionBar: (jsonMsg: ChatMessage) => Promise<void> | void
error: (err: Error) => Promise<void> | void
message: (jsonMsg: ChatMessage, position: string) => Promise<void> | void
messagestr: (message: string, position: string, jsonMsg: ChatMessage) => Promise<void> | void
unmatchedMessage: (stringMsg: string, jsonMsg: ChatMessage) => Promise<void> | void
inject_allowed: () => Promise<void> | void
login: () => Promise<void> | void
/** When `respawn` option is disabled, you can call this method manually to respawn. */
spawn: () => Promise<void> | void
respawn: () => Promise<void> | void
game: () => Promise<void> | void
title: (text: string, type: "subtitle" | "title") => Promise<void> | void
rain: () => Promise<void> | void
time: () => Promise<void> | void
kicked: (reason: string, loggedIn: boolean) => Promise<void> | void
end: (reason: string) => Promise<void> | void
spawnReset: () => Promise<void> | void
death: () => Promise<void> | void
health: () => Promise<void> | void
breath: () => Promise<void> | void
entitySwingArm: (entity: Entity) => Promise<void> | void
entityHurt: (entity: Entity) => Promise<void> | void
entityDead: (entity: Entity) => Promise<void> | void
entityTaming: (entity: Entity) => Promise<void> | void
entityTamed: (entity: Entity) => Promise<void> | void
entityShakingOffWater: (entity: Entity) => Promise<void> | void
entityEatingGrass: (entity: Entity) => Promise<void> | void
entityHandSwap: (entity: Entity) => Promise<void> | void
entityWake: (entity: Entity) => Promise<void> | void
entityEat: (entity: Entity) => Promise<void> | void
entityCriticalEffect: (entity: Entity) => Promise<void> | void
entityMagicCriticalEffect: (entity: Entity) => Promise<void> | void
entityCrouch: (entity: Entity) => Promise<void> | void
entityUncrouch: (entity: Entity) => Promise<void> | void
entityEquip: (entity: Entity) => Promise<void> | void
entitySleep: (entity: Entity) => Promise<void> | void
entitySpawn: (entity: Entity) => Promise<void> | void
entityElytraFlew: (entity: Entity) => Promise<void> | void
usedFirework: () => Promise<void> | void
itemDrop: (entity: Entity) => Promise<void> | void
playerCollect: (collector: Entity, collected: Entity) => Promise<void> | void
entityAttributes: (entity: Entity) => Promise<void> | void
entityGone: (entity: Entity) => Promise<void> | void
entityMoved: (entity: Entity) => Promise<void> | void
entityDetach: (entity: Entity, vehicle: Entity) => Promise<void> | void
entityAttach: (entity: Entity, vehicle: Entity) => Promise<void> | void
entityUpdate: (entity: Entity) => Promise<void> | void
entityEffect: (entity: Entity, effect: Effect) => Promise<void> | void
entityEffectEnd: (entity: Entity, effect: Effect) => Promise<void> | void
playerJoined: (player: Player) => Promise<void> | void
playerUpdated: (player: Player) => Promise<void> | void
playerLeft: (entity: Player) => Promise<void> | void
blockUpdate: (oldBlock: Block | null, newBlock: Block) => Promise<void> | void
'blockUpdate:(x, y, z)': (oldBlock: Block | null, newBlock: Block | null) => Promise<void> | void
chunkColumnLoad: (entity: Vec3) => Promise<void> | void
chunkColumnUnload: (entity: Vec3) => Promise<void> | void
soundEffectHeard: (
soundName: string,
position: Vec3,
volume: number,
pitch: number
) => Promise<void> | void
hardcodedSoundEffectHeard: (
soundId: number,
soundCategory: number,
position: Vec3,
volume: number,
pitch: number
) => Promise<void> | void
noteHeard: (block: Block, instrument: Instrument, pitch: number) => Promise<void> | void
pistonMove: (block: Block, isPulling: number, direction: number) => Promise<void> | void
chestLidMove: (block: Block, isOpen: number, block2: Block | null) => Promise<void> | void
blockBreakProgressObserved: (block: Block, destroyStage: number) => Promise<void> | void
blockBreakProgressEnd: (block: Block) => Promise<void> | void
diggingCompleted: (block: Block) => Promise<void> | void
diggingAborted: (block: Block) => Promise<void> | void
move: (position: Vec3) => Promise<void> | void
forcedMove: () => Promise<void> | void
mount: () => Promise<void> | void
dismount: (vehicle: Entity) => Promise<void> | void
windowOpen: (window: Window) => Promise<void> | void
windowClose: (window: Window) => Promise<void> | void
sleep: () => Promise<void> | void
wake: () => Promise<void> | void
experience: () => Promise<void> | void
physicsTick: () => Promise<void> | void
physicTick: () => Promise<void> | void
scoreboardCreated: (scoreboard: ScoreBoard) => Promise<void> | void
scoreboardDeleted: (scoreboard: ScoreBoard) => Promise<void> | void
scoreboardTitleChanged: (scoreboard: ScoreBoard) => Promise<void> | void
scoreUpdated: (scoreboard: ScoreBoard, item: number) => Promise<void> | void
scoreRemoved: (scoreboard: ScoreBoard, item: number) => Promise<void> | void
scoreboardPosition: (position: DisplaySlot, scoreboard: ScoreBoard) => Promise<void> | void
teamCreated: (team: Team) => Promise<void> | void
teamRemoved: (team: Team) => Promise<void> | void
teamUpdated: (team: Team) => Promise<void> | void
teamMemberAdded: (team: Team) => Promise<void> | void
teamMemberRemoved: (team: Team) => Promise<void> | void
bossBarCreated: (bossBar: BossBar) => Promise<void> | void
bossBarDeleted: (bossBar: BossBar) => Promise<void> | void
bossBarUpdated: (bossBar: BossBar) => Promise<void> | void
resourcePack: (url: string, hash?: string, uuid?: string) => Promise<void> | void
particle: (particle: Particle) => Promise<void> | void
}
export interface CommandBlockOptions {
mode: number,
trackOutput: boolean,
conditional: boolean,
alwaysActive: boolean
}
export interface Bot extends TypedEmitter<BotEvents> {
username: string
protocolVersion: string
majorVersion: string
version: string
entity: Entity
entities: { [id: string]: Entity }
fireworkRocketDuration: number
spawnPoint: Vec3
game: GameState
player: Player
players: { [username: string]: Player }
isRaining: boolean
thunderState: number
chatPatterns: ChatPattern[]
settings: GameSettings
experience: Experience
health: number
food: number
foodSaturation: number
oxygenLevel: number
physics: PhysicsOptions
physicsEnabled: boolean
time: Time
quickBarSlot: number
inventory: Window<StorageEvents>
targetDigBlock: Block
isSleeping: boolean
scoreboards: { [name: string]: ScoreBoard }
scoreboard: { [slot in DisplaySlot]: ScoreBoard }
teams: { [name: string]: Team }
teamMap: { [name: string]: Team }
controlState: ControlStateStatus
creative: creativeMethods
world: world.WorldSync
_client: Client
heldItem: Item | null
usingHeldItem: boolean
currentWindow: Window | null
simpleClick: simpleClick
tablist: Tablist
registry: Registry
connect: (options: BotOptions) => void
supportFeature: IndexedData['supportFeature']
end: (reason?: string) => void
blockAt: (point: Vec3, extraInfos?: boolean) => Block | null
blockInSight: (maxSteps: number, vectorLength: number) => Block | null
blockAtCursor: (maxDistance?: number, matcher?: Function) => Block | null
blockAtEntityCursor: (entity?: Entity, maxDistance?: number, matcher?: Function) => Block | null
canSeeBlock: (block: Block) => boolean
findBlock: (options: FindBlockOptions) => Block | null
findBlocks: (options: FindBlockOptions) => Vec3[]
canDigBlock: (block: Block) => boolean
recipesFor: (
itemType: number,
metadata: number | null,
minResultCount: number | null,
craftingTable: Block | boolean | null
) => Recipe[]
recipesAll: (
itemType: number,
metadata: number | null,
craftingTable: Block | boolean | null
) => Recipe[]
quit: (reason?: string) => void
tabComplete: (
str: string,
assumeCommand?: boolean,
sendBlockInSight?: boolean,
timeout?: number
) => Promise<string[]>
chat: (message: string) => void
whisper: (username: string, message: string) => void
chatAddPattern: (pattern: RegExp, chatType: string, description?: string) => number
setSettings: (options: Partial<GameSettings>) => void
loadPlugin: (plugin: Plugin) => void
loadPlugins: (plugins: Plugin[]) => void
hasPlugin: (plugin: Plugin) => boolean
sleep: (bedBlock: Block) => Promise<void>
isABed: (bedBlock: Block) => boolean
wake: () => Promise<void>
elytraFly: () => Promise<void>
setControlState: (control: ControlState, state: boolean) => void
getControlState: (control: ControlState) => boolean
clearControlStates: () => void
getExplosionDamages: (targetEntity: Entity, position: Vec3, radius: number, rawDamages?: boolean) => number | null
lookAt: (point: Vec3, force?: boolean) => Promise<void>
look: (
yaw: number,
pitch: number,
force?: boolean
) => Promise<void>
updateSign: (block: Block, text: string, back?: boolean) => void
equip: (
item: Item | number,
destination: EquipmentDestination | null
) => Promise<void>
unequip: (
destination: EquipmentDestination | null
) => Promise<void>
tossStack: (item: Item) => Promise<void>
toss: (
itemType: number,
metadata: number | null,
count: number | null
) => Promise<void>
dig: ((block: Block, forceLook?: boolean | 'ignore') => Promise<void>) & ((block: Block, forceLook: boolean | 'ignore', digFace: 'auto' | Vec3 | 'raycast') => Promise<void>)
stopDigging: () => void
digTime: (block: Block) => number
placeBlock: (referenceBlock: Block, faceVector: Vec3) => Promise<void>
placeEntity: (referenceBlock: Block, faceVector: Vec3) => Promise<Entity>
activateBlock: (block: Block, direction?: Vec3, cursorPos?: Vec3) => Promise<void>
activateEntity: (entity: Entity) => Promise<void>
activateEntityAt: (entity: Entity, position: Vec3) => Promise<void>
consume: () => Promise<void>
fish: () => Promise<void>
activateItem: (offhand?: boolean) => void
deactivateItem: () => void
useOn: (targetEntity: Entity) => void
attack: (entity: Entity) => void
swingArm: (hand: 'left' | 'right' | undefined, showHand?: boolean) => void
mount: (entity: Entity) => void
dismount: () => void
moveVehicle: (left: number, forward: number) => void
setQuickBarSlot: (slot: number) => void
craft: (
recipe: Recipe,
count?: number,
craftingTable?: Block
) => Promise<void>
writeBook: (
slot: number,
pages: string[]
) => Promise<void>
openContainer: (chest: Block | Entity, direction?: Vec3, cursorPos?: Vec3) => Promise<Chest | Dispenser>
openChest: (chest: Block | Entity, direction?: number, cursorPos?: Vec3) => Promise<Chest>
openFurnace: (furnace: Block) => Promise<Furnace>
openDispenser: (dispenser: Block) => Promise<Dispenser>
openEnchantmentTable: (enchantmentTable: Block) => Promise<EnchantmentTable>
openAnvil: (anvil: Block) => Promise<Anvil>
openVillager: (
villager: Entity
) => Promise<Villager>
trade: (
villagerInstance: Villager,
tradeIndex: string | number,
times?: number
) => Promise<void>
setCommandBlock: (pos: Vec3, command: string, options: CommandBlockOptions) => void
clickWindow: (
slot: number,
mouseButton: number,
mode: number
) => Promise<void>
putSelectedItemRange: (
start: number,
end: number,
window: Window,
slot: any
) => Promise<void>
putAway: (slot: number) => Promise<void>
closeWindow: (window: Window) => void
transfer: (options: TransferOptions) => Promise<void>
openBlock: (block: Block, direction?: Vec3, cursorPos?: Vec3) => Promise<Window>
openEntity: (block: Entity, Class: new () => EventEmitter) => Promise<Window>
moveSlotItem: (
sourceSlot: number,
destSlot: number
) => Promise<void>
updateHeldItem: () => void
getEquipmentDestSlot: (destination: string) => number
waitForChunksToLoad: () => Promise<void>
entityAtCursor: (maxDistance?: number) => Entity | null
nearestEntity: (filter?: (entity: Entity) => boolean) => Entity | null
waitForTicks: (ticks: number) => Promise<void>
addChatPattern: (name: string, pattern: RegExp, options?: chatPatternOptions) => number
addChatPatternSet: (name: string, patterns: RegExp[], options?: chatPatternOptions) => number
removeChatPattern: (name: string | number) => void
awaitMessage: (...args: string[] | RegExp[]) => Promise<string>
acceptResourcePack: () => void
denyResourcePack: () => void
respawn: () => void
}
export interface simpleClick {
leftMouse: (slot: number) => Promise<void>
rightMouse: (slot: number) => Promise<void>
}
export interface Tablist {
header: ChatMessage
footer: ChatMessage
}
export interface chatPatternOptions {
repeat: boolean
parse: boolean
}
export interface GameState {
levelType: LevelType
gameMode: GameMode
hardcore: boolean
dimension: Dimension
difficulty: Difficulty
maxPlayers: number
serverBrand: string
}
export type LevelType =
| 'default'
| 'flat'
| 'largeBiomes'
| 'amplified'
| 'customized'
| 'buffet'
| 'default_1_1'
export type GameMode = 'survival' | 'creative' | 'adventure' | 'spectator'
export type Dimension = 'the_nether' | 'overworld' | 'the_end'
export type Difficulty = 'peaceful' | 'easy' | 'normal' | 'hard'
export interface Player {
uuid: string
username: string
displayName: ChatMessage
gamemode: number
ping: number
entity: Entity
skinData: SkinData | undefined
profileKeys?: {
publicKey: Buffer
signature: Buffer
}
}
export interface SkinData {
url: string
model: string | null
}
export interface ChatPattern {
pattern: RegExp
type: string
description: string
}
export interface SkinParts {
showCape: boolean
showJacket: boolean
showLeftSleeve: boolean
showRightSleeve: boolean
showLeftPants: boolean
showRightPants: boolean
showHat: boolean
}
export interface GameSettings {
chat: ChatLevel
colorsEnabled: boolean
viewDistance: ViewDistance
difficulty: number
skinParts: SkinParts
mainHand: MainHands
}
export interface Experience {
level: number
points: number
progress: number
}
export interface PhysicsOptions {
maxGroundSpeed: number
terminalVelocity: number
walkingAcceleration: number
gravity: number
groundFriction: number
playerApothem: number
playerHeight: number
jumpSpeed: number
yawSpeed: number
pitchSpeed: number
sprintSpeed: number
maxGroundSpeedSoulSand: number
maxGroundSpeedWater: number
}
export interface Time {
doDaylightCycle: boolean
bigTime: BigInt
time: number
timeOfDay: number
day: number
isDay: boolean
moonPhase: number
bigAge: BigInt
age: number
}
export interface ControlStateStatus {
forward: boolean
back: boolean
left: boolean
right: boolean
jump: boolean
sprint: boolean
sneak: boolean
}
export type ControlState =
| 'forward'
| 'back'
| 'left'
| 'right'
| 'jump'
| 'sprint'
| 'sneak'
export interface Effect {
id: number
amplifier: number
duration: number
}
export interface Instrument {
id: number
name: 'harp' | 'doubleBass' | 'snareDrum' | 'sticks' | 'bassDrum'
}
export interface FindBlockOptions {
point?: Vec3
matching: number | number[] | ((block: Block) => boolean)
maxDistance?: number
count?: number
useExtraInfo?: boolean | ((block: Block) => boolean)
}
export type EquipmentDestination = 'hand' | 'head' | 'torso' | 'legs' | 'feet' | 'off-hand'
export interface TransferOptions {
window: Window
itemType: number
metadata: number | null
count?: number,
sourceStart: number
sourceEnd: number
destStart: number
destEnd: number
}
export interface creativeMethods {
setInventorySlot: (
slot: number,
item: Item | null
) => Promise<void>
clearSlot: (slot: number) => Promise<void>
clearInventory: () => Promise<void>
flyTo: (destination: Vec3) => Promise<void>
startFlying: () => void
stopFlying: () => void
}
export class Location {
floored: Vec3
blockPoint: Vec3
chunkCorner: Vec3
blockIndex: number
biomeBlockIndex: number
chunkYIndex: number
constructor (absoluteVector: Vec3);
}
export class Painting {
id: number
position: Vec3
name: string
direction: Vec3
constructor (id: number, position: Vec3, name: string, direction: Vec3);
}
interface StorageEvents {
open: () => void
close: () => void
updateSlot: (slot: number, oldItem: Item | null, newItem: Item | null) => void
}
interface FurnaceEvents extends StorageEvents {
update: () => void
}
interface ConditionalStorageEvents extends StorageEvents {
ready: () => void
}
export class Chest extends Window<StorageEvents> {
constructor ();
close (): void;
deposit (
itemType: number,
metadata: number | null,
count: number | null
): Promise<void>;
withdraw (
itemType: number,
metadata: number | null,
count: number | null
): Promise<void>;
}
export class Furnace extends Window<FurnaceEvents> {
fuel: number
progress: number
constructor ();
close (): void;
takeInput (): Promise<Item>;
takeFuel (): Promise<Item>;
takeOutput (): Promise<Item>;
putInput (
itemType: number,
metadata: number | null,
count: number
): Promise<void>;
putFuel (
itemType: number,
metadata: number | null,
count: number
): Promise<void>;
inputItem (): Item;
fuelItem (): Item;
outputItem (): Item;
}
export class Dispenser extends Window<StorageEvents> {
constructor ();
close (): void;
deposit (
itemType: number,
metadata: number | null,
count: number | null
): Promise<void>;
withdraw (
itemType: number,
metadata: number | null,
count: number | null
): Promise<void>;
}
export class EnchantmentTable extends Window<ConditionalStorageEvents> {
enchantments: Enchantment[]
constructor ();
close (): void;
targetItem (): Item;
enchant (
choice: string | number
): Promise<Item>;
takeTargetItem (): Promise<Item>;
putTargetItem (item: Item): Promise<Item>;
putLapis (item: Item): Promise<Item>;
}
export class Anvil {
combine (itemOne: Item, itemTwo: Item, name?: string): Promise<void>
rename (item: Item, name?: string): Promise<void>
}
export interface Enchantment {
level: number
expected: { enchant: number, level: number }
}
export class Villager extends Window<ConditionalStorageEvents> {
trades: VillagerTrade[]
constructor ();
close (): void;
}
export interface VillagerTrade {
inputItem1: Item
outputItem: Item
inputItem2: Item | null
hasItem2: boolean
tradeDisabled: boolean
nbTradeUses: number
maximumNbTradeUses: number
xp?: number
specialPrice?: number
priceMultiplier?: number
demand?: number
realPrice?: number
}
export class ScoreBoard {
name: string
title: string
itemsMap: { [name: string]: ScoreBoardItem }
items: ScoreBoardItem[]
constructor (packet: object);
setTitle (title: string): void;
add(name: string, value: number): ScoreBoardItem;
remove (name: string): ScoreBoardItem;
}
export interface ScoreBoardItem {
name: string
displayName: ChatMessage
value: number
}
export class Team {
team: string
name: ChatMessage
friendlyFire: number
nameTagVisibility: string
collisionRule: string
color: string
prefix: ChatMessage
suffix: ChatMessage
memberMap: { [name: string]: '' }
members: string[]
constructor(team: string, name: string, friendlyFire: boolean, nameTagVisibility: string, collisionRule: string, formatting: number, prefix: string, suffix: string);
parseMessage (value: string): ChatMessage;
add (name: string, value: number): void;
remove (name: string): void;
update (name: string, friendlyFire: boolean, nameTagVisibility: string, collisionRule: string, formatting: number, prefix: string, suffix: string): void;
displayName (member: string): ChatMessage;
}
export type DisplaySlot =
| 'list'
| 'sidebar'
| 'belowName'
| 3
| 4
| 5
| 6
| 7
| 8
| 9
| 10
| 11
| 12
| 13
| 14
| 15
| 16
| 17
| 18
export class BossBar {
entityUUID: string
title: ChatMessage
health: number
dividers: number
color: 'pink' | 'blue' | 'red' | 'green' | 'yellow' | 'purple' | 'white'
shouldDarkenSky: boolean
isDragonBar: boolean
createFog: boolean
shouldCreateFog: boolean
constructor (
uuid: string,
title: string,
health: number,
dividers: number,
color: number,
flags: number
);
}
export class Particle {
id: number
position: Vec3
offset: Vec3
count: number
movementSpeed: number
longDistanceRender: boolean
static fromNetwork(packet: Object): Particle
constructor(
id: number,
position: Vec3,
offset: Vec3,
count?: number,
movementSpeed?: number,
longDistanceRender?: boolean
);
}
export let testedVersions: string[]
export let latestSupportedVersion: string
export let oldestSupportedVersion: string
export function supportFeature (feature: string, version: string): boolean