@minecraft/server-gametest 1.0.0-beta.1.21.95-stable → 1.0.0-beta.1.26.0-preview.25
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/index.d.ts +455 -109
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import * as minecraftcommon from '@minecraft/common';
|
|
26
26
|
import * as minecraftserver from '@minecraft/server';
|
|
27
|
+
export enum GameTestCompletedErrorReason {
|
|
28
|
+
Cleanup = 'Cleanup',
|
|
29
|
+
Done = 'Done',
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
export enum GameTestErrorType {
|
|
28
33
|
Assert = 'Assert',
|
|
29
34
|
AssertAtPosition = 'AssertAtPosition',
|
|
@@ -43,6 +48,39 @@ export enum LookDuration {
|
|
|
43
48
|
UntilMove = 'UntilMove',
|
|
44
49
|
}
|
|
45
50
|
|
|
51
|
+
export enum PersonaArmSize {
|
|
52
|
+
Slim = 'Slim',
|
|
53
|
+
Wide = 'Wide',
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export enum PersonaPieceType {
|
|
57
|
+
Arms = 'Arms',
|
|
58
|
+
Back = 'Back',
|
|
59
|
+
Body = 'Body',
|
|
60
|
+
Bottom = 'Bottom',
|
|
61
|
+
Capes = 'Capes',
|
|
62
|
+
Dress = 'Dress',
|
|
63
|
+
Eyes = 'Eyes',
|
|
64
|
+
FaceAccessory = 'FaceAccessory',
|
|
65
|
+
FacialHair = 'FacialHair',
|
|
66
|
+
Feet = 'Feet',
|
|
67
|
+
Hair = 'Hair',
|
|
68
|
+
Hands = 'Hands',
|
|
69
|
+
Head = 'Head',
|
|
70
|
+
HighPants = 'HighPants',
|
|
71
|
+
Hood = 'Hood',
|
|
72
|
+
LeftArm = 'LeftArm',
|
|
73
|
+
LeftLeg = 'LeftLeg',
|
|
74
|
+
Legs = 'Legs',
|
|
75
|
+
Mouth = 'Mouth',
|
|
76
|
+
Outerwear = 'Outerwear',
|
|
77
|
+
RightArm = 'RightArm',
|
|
78
|
+
RightLeg = 'RightLeg',
|
|
79
|
+
Skeleton = 'Skeleton',
|
|
80
|
+
Skin = 'Skin',
|
|
81
|
+
Top = 'Top',
|
|
82
|
+
}
|
|
83
|
+
|
|
46
84
|
/**
|
|
47
85
|
* Returns information about whether this fence is connected to
|
|
48
86
|
* other fences in several directions.
|
|
@@ -92,7 +130,7 @@ export class GameTestSequence {
|
|
|
92
130
|
* sequence. Exceptions thrown within the callback will end
|
|
93
131
|
* sequence execution.
|
|
94
132
|
*
|
|
95
|
-
* This function can't be called in
|
|
133
|
+
* This function can't be called in restricted-execution mode.
|
|
96
134
|
*
|
|
97
135
|
* @param callback
|
|
98
136
|
* Callback function to execute.
|
|
@@ -107,7 +145,7 @@ export class GameTestSequence {
|
|
|
107
145
|
* GameTest sequence. Exceptions thrown within the callback
|
|
108
146
|
* will end sequence execution.
|
|
109
147
|
*
|
|
110
|
-
* This function can't be called in
|
|
148
|
+
* This function can't be called in restricted-execution mode.
|
|
111
149
|
*
|
|
112
150
|
* @param delayTicks
|
|
113
151
|
* Number of ticks to wait before executing the callback.
|
|
@@ -123,7 +161,7 @@ export class GameTestSequence {
|
|
|
123
161
|
* Runs the given callback every tick for the given number of
|
|
124
162
|
* ticks.
|
|
125
163
|
*
|
|
126
|
-
* This function can't be called in
|
|
164
|
+
* This function can't be called in restricted-execution mode.
|
|
127
165
|
*
|
|
128
166
|
* @param callback
|
|
129
167
|
* Callback function to execute.
|
|
@@ -137,7 +175,7 @@ export class GameTestSequence {
|
|
|
137
175
|
* Causes the test to fail if this step in the GameTest
|
|
138
176
|
* sequence is reached.
|
|
139
177
|
*
|
|
140
|
-
* This function can't be called in
|
|
178
|
+
* This function can't be called in restricted-execution mode.
|
|
141
179
|
*
|
|
142
180
|
* @param errorMessage
|
|
143
181
|
* Error message summarizing the failure condition.
|
|
@@ -147,7 +185,7 @@ export class GameTestSequence {
|
|
|
147
185
|
* @remarks
|
|
148
186
|
* Idles the GameTest sequence for the specified delayTicks.
|
|
149
187
|
*
|
|
150
|
-
* This function can't be called in
|
|
188
|
+
* This function can't be called in restricted-execution mode.
|
|
151
189
|
*
|
|
152
190
|
* @param delayTicks
|
|
153
191
|
* Number of ticks to delay for this step in the GameTest
|
|
@@ -162,7 +200,7 @@ export class GameTestSequence {
|
|
|
162
200
|
* Marks the GameTest a success if this step is reached in the
|
|
163
201
|
* GameTest sequence.
|
|
164
202
|
*
|
|
165
|
-
* This function can't be called in
|
|
203
|
+
* This function can't be called in restricted-execution mode.
|
|
166
204
|
*
|
|
167
205
|
*/
|
|
168
206
|
thenSucceed(): void;
|
|
@@ -172,7 +210,7 @@ export class GameTestSequence {
|
|
|
172
210
|
* Exceptions thrown within the callback will end sequence
|
|
173
211
|
* execution.
|
|
174
212
|
*
|
|
175
|
-
* This function can't be called in
|
|
213
|
+
* This function can't be called in restricted-execution mode.
|
|
176
214
|
*
|
|
177
215
|
* @param callback
|
|
178
216
|
* Testing callback function to execute. Typically, this
|
|
@@ -188,7 +226,7 @@ export class GameTestSequence {
|
|
|
188
226
|
* callback every tick until it succeeds. Exceptions thrown
|
|
189
227
|
* within the callback will end sequence execution.
|
|
190
228
|
*
|
|
191
|
-
* This function can't be called in
|
|
229
|
+
* This function can't be called in restricted-execution mode.
|
|
192
230
|
*
|
|
193
231
|
* @param delayTicks
|
|
194
232
|
* Tick (after the previous step in the GameTest sequence) to
|
|
@@ -219,7 +257,7 @@ export class RegistrationBuilder {
|
|
|
219
257
|
* @remarks
|
|
220
258
|
* Sets the batch for the test to run in.
|
|
221
259
|
*
|
|
222
|
-
* This function can't be called in
|
|
260
|
+
* This function can't be called in restricted-execution mode.
|
|
223
261
|
*
|
|
224
262
|
* This function can be called in early-execution mode.
|
|
225
263
|
*
|
|
@@ -235,7 +273,7 @@ export class RegistrationBuilder {
|
|
|
235
273
|
* Sets the maximum number of times a test will try to rerun if
|
|
236
274
|
* it fails.
|
|
237
275
|
*
|
|
238
|
-
* This function can't be called in
|
|
276
|
+
* This function can't be called in restricted-execution mode.
|
|
239
277
|
*
|
|
240
278
|
* This function can be called in early-execution mode.
|
|
241
279
|
*
|
|
@@ -249,7 +287,7 @@ export class RegistrationBuilder {
|
|
|
249
287
|
* Sets the maximum number of ticks a test will run for before
|
|
250
288
|
* timing out and failing.
|
|
251
289
|
*
|
|
252
|
-
* This function can't be called in
|
|
290
|
+
* This function can't be called in restricted-execution mode.
|
|
253
291
|
*
|
|
254
292
|
* This function can be called in early-execution mode.
|
|
255
293
|
*
|
|
@@ -263,7 +301,7 @@ export class RegistrationBuilder {
|
|
|
263
301
|
* Size around the GameTest, in blocks, that should be reserved
|
|
264
302
|
* for the test when running multiple tests together.
|
|
265
303
|
*
|
|
266
|
-
* This function can't be called in
|
|
304
|
+
* This function can't be called in restricted-execution mode.
|
|
267
305
|
*
|
|
268
306
|
* This function can be called in early-execution mode.
|
|
269
307
|
*
|
|
@@ -280,7 +318,7 @@ export class RegistrationBuilder {
|
|
|
280
318
|
* Whether this test is required to pass as part of its broader
|
|
281
319
|
* set of tests.
|
|
282
320
|
*
|
|
283
|
-
* This function can't be called in
|
|
321
|
+
* This function can't be called in restricted-execution mode.
|
|
284
322
|
*
|
|
285
323
|
* This function can be called in early-execution mode.
|
|
286
324
|
*
|
|
@@ -297,7 +335,7 @@ export class RegistrationBuilder {
|
|
|
297
335
|
* Sets the number of successful test runs to be considered
|
|
298
336
|
* successful.
|
|
299
337
|
*
|
|
300
|
-
* This function can't be called in
|
|
338
|
+
* This function can't be called in restricted-execution mode.
|
|
301
339
|
*
|
|
302
340
|
* This function can be called in early-execution mode.
|
|
303
341
|
*
|
|
@@ -311,7 +349,7 @@ export class RegistrationBuilder {
|
|
|
311
349
|
* If true, runs the test in all four rotations when run via
|
|
312
350
|
* /gametest runset.
|
|
313
351
|
*
|
|
314
|
-
* This function can't be called in
|
|
352
|
+
* This function can't be called in restricted-execution mode.
|
|
315
353
|
*
|
|
316
354
|
* This function can be called in early-execution mode.
|
|
317
355
|
*
|
|
@@ -322,7 +360,7 @@ export class RegistrationBuilder {
|
|
|
322
360
|
* Sets the number of ticks for a test to wait before executing
|
|
323
361
|
* when the structure is spawned.
|
|
324
362
|
*
|
|
325
|
-
* This function can't be called in
|
|
363
|
+
* This function can't be called in restricted-execution mode.
|
|
326
364
|
*
|
|
327
365
|
* This function can be called in early-execution mode.
|
|
328
366
|
*
|
|
@@ -339,7 +377,7 @@ export class RegistrationBuilder {
|
|
|
339
377
|
* ground. If the dimension is not specified, it will run in
|
|
340
378
|
* the dimension the command was run from.
|
|
341
379
|
*
|
|
342
|
-
* This function can't be called in
|
|
380
|
+
* This function can't be called in restricted-execution mode.
|
|
343
381
|
*
|
|
344
382
|
* This function can be called in early-execution mode.
|
|
345
383
|
*
|
|
@@ -362,7 +400,7 @@ export class RegistrationBuilder {
|
|
|
362
400
|
* will load `/structures/xyz/bar.mcstructure` from the
|
|
363
401
|
* behavior pack stack.
|
|
364
402
|
*
|
|
365
|
-
* This function can't be called in
|
|
403
|
+
* This function can't be called in restricted-execution mode.
|
|
366
404
|
*
|
|
367
405
|
* This function can be called in early-execution mode.
|
|
368
406
|
*
|
|
@@ -391,7 +429,7 @@ export class RegistrationBuilder {
|
|
|
391
429
|
* Adds a tag to a test. You can run all tests with a given tag
|
|
392
430
|
* with `/gametest runset <tag>`.
|
|
393
431
|
*
|
|
394
|
-
* This function can't be called in
|
|
432
|
+
* This function can't be called in restricted-execution mode.
|
|
395
433
|
*
|
|
396
434
|
* This function can be called in early-execution mode.
|
|
397
435
|
*
|
|
@@ -436,7 +474,7 @@ export class SculkSpreader {
|
|
|
436
474
|
* Adds a cursor - which is a notional waypoint that the sculk
|
|
437
475
|
* will spread in the direction of.
|
|
438
476
|
*
|
|
439
|
-
* This function can't be called in
|
|
477
|
+
* This function can't be called in restricted-execution mode.
|
|
440
478
|
*
|
|
441
479
|
*/
|
|
442
480
|
addCursorsWithOffset(offset: minecraftserver.Vector3, charge: number): void;
|
|
@@ -444,7 +482,7 @@ export class SculkSpreader {
|
|
|
444
482
|
* @remarks
|
|
445
483
|
* Retrieves the current position of the specified cursor.
|
|
446
484
|
*
|
|
447
|
-
* This function can't be called in
|
|
485
|
+
* This function can't be called in restricted-execution mode.
|
|
448
486
|
*
|
|
449
487
|
* @throws This function can throw errors.
|
|
450
488
|
*/
|
|
@@ -453,7 +491,7 @@ export class SculkSpreader {
|
|
|
453
491
|
* @remarks
|
|
454
492
|
* Returns a number of overall cursors for this sculk spreader.
|
|
455
493
|
*
|
|
456
|
-
* This function can't be called in
|
|
494
|
+
* This function can't be called in restricted-execution mode.
|
|
457
495
|
*
|
|
458
496
|
* @throws This function can throw errors.
|
|
459
497
|
*/
|
|
@@ -462,7 +500,7 @@ export class SculkSpreader {
|
|
|
462
500
|
* @remarks
|
|
463
501
|
* Gets the total current charge of the sculk spreader.
|
|
464
502
|
*
|
|
465
|
-
* This function can't be called in
|
|
503
|
+
* This function can't be called in restricted-execution mode.
|
|
466
504
|
*
|
|
467
505
|
* @throws This function can throw errors.
|
|
468
506
|
*/
|
|
@@ -493,7 +531,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
493
531
|
* @remarks
|
|
494
532
|
* Returns whether the simulated player is sprinting.
|
|
495
533
|
*
|
|
496
|
-
* This property can't be edited in
|
|
534
|
+
* This property can't be edited in restricted-execution mode.
|
|
497
535
|
*
|
|
498
536
|
*/
|
|
499
537
|
isSprinting: boolean;
|
|
@@ -504,7 +542,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
504
542
|
* player was not on cooldown and had a valid target. Target
|
|
505
543
|
* selection is performed by raycasting from the player's head.
|
|
506
544
|
*
|
|
507
|
-
* This function can't be called in
|
|
545
|
+
* This function can't be called in restricted-execution mode.
|
|
508
546
|
*
|
|
509
547
|
* @throws This function can throw errors.
|
|
510
548
|
*/
|
|
@@ -517,7 +555,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
517
555
|
* attack can be performed at any distance and does not require
|
|
518
556
|
* line of sight to the target entity.
|
|
519
557
|
*
|
|
520
|
-
* This function can't be called in
|
|
558
|
+
* This function can't be called in restricted-execution mode.
|
|
521
559
|
*
|
|
522
560
|
* @throws This function can throw errors.
|
|
523
561
|
*/
|
|
@@ -529,7 +567,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
529
567
|
* broken, an item is used or stopBreakingBlock is called.
|
|
530
568
|
* Returns true if the block at blockLocation is solid.
|
|
531
569
|
*
|
|
532
|
-
* This function can't be called in
|
|
570
|
+
* This function can't be called in restricted-execution mode.
|
|
533
571
|
*
|
|
534
572
|
* @param blockLocation
|
|
535
573
|
* Location of the block to interact with.
|
|
@@ -537,11 +575,15 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
537
575
|
* Direction to place the specified item within.
|
|
538
576
|
* Defaults to: 1
|
|
539
577
|
* @throws This function can throw errors.
|
|
578
|
+
*
|
|
579
|
+
* {@link GameTestError}
|
|
580
|
+
*
|
|
581
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
540
582
|
*/
|
|
541
583
|
breakBlock(blockLocation: minecraftserver.Vector3, direction?: minecraftserver.Direction): boolean;
|
|
542
584
|
/**
|
|
543
585
|
* @remarks
|
|
544
|
-
* This function can't be called in
|
|
586
|
+
* This function can't be called in restricted-execution mode.
|
|
545
587
|
*
|
|
546
588
|
* @throws This function can throw errors.
|
|
547
589
|
*/
|
|
@@ -551,7 +593,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
551
593
|
* Simulates and performs a disconnection of the simulated
|
|
552
594
|
* player from the world.
|
|
553
595
|
*
|
|
554
|
-
* This function can't be called in
|
|
596
|
+
* This function can't be called in restricted-execution mode.
|
|
555
597
|
*
|
|
556
598
|
* @throws This function can throw errors.
|
|
557
599
|
*/
|
|
@@ -560,7 +602,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
560
602
|
* @remarks
|
|
561
603
|
* Drops the simulated player's selected item
|
|
562
604
|
*
|
|
563
|
-
* This function can't be called in
|
|
605
|
+
* This function can't be called in restricted-execution mode.
|
|
564
606
|
*
|
|
565
607
|
* @throws This function can throw errors.
|
|
566
608
|
*/
|
|
@@ -571,7 +613,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
571
613
|
* were flying in creative mode. For flying with Elytra, see
|
|
572
614
|
* function glide.
|
|
573
615
|
*
|
|
574
|
-
* This function can't be called in
|
|
616
|
+
* This function can't be called in restricted-execution mode.
|
|
575
617
|
*
|
|
576
618
|
* @throws This function can throw errors.
|
|
577
619
|
*/
|
|
@@ -580,7 +622,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
580
622
|
* @remarks
|
|
581
623
|
* Gives the simulated player a particular item stack.
|
|
582
624
|
*
|
|
583
|
-
* This function can't be called in
|
|
625
|
+
* This function can't be called in restricted-execution mode.
|
|
584
626
|
*
|
|
585
627
|
* @param itemStack
|
|
586
628
|
* Item to give.
|
|
@@ -595,7 +637,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
595
637
|
* Causes the simulated player to start gliding. Elytra must be
|
|
596
638
|
* equipped and the player must be in the air.
|
|
597
639
|
*
|
|
598
|
-
* This function can't be called in
|
|
640
|
+
* This function can't be called in restricted-execution mode.
|
|
599
641
|
*
|
|
600
642
|
* @returns
|
|
601
643
|
* Returns true if the simulated player begins to glide.
|
|
@@ -611,7 +653,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
611
653
|
* the first intersected block or entity. Returns true if the
|
|
612
654
|
* interaction was successful. Maximum range is 6 blocks.
|
|
613
655
|
*
|
|
614
|
-
* This function can't be called in
|
|
656
|
+
* This function can't be called in restricted-execution mode.
|
|
615
657
|
*
|
|
616
658
|
* @throws This function can throw errors.
|
|
617
659
|
*/
|
|
@@ -622,7 +664,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
622
664
|
* block at the specified block location must be solid. Returns
|
|
623
665
|
* true if the interaction was performed.
|
|
624
666
|
*
|
|
625
|
-
* This function can't be called in
|
|
667
|
+
* This function can't be called in restricted-execution mode.
|
|
626
668
|
*
|
|
627
669
|
* @param blockLocation
|
|
628
670
|
* Location of the block to interact with.
|
|
@@ -630,6 +672,10 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
630
672
|
* Direction to place the specified item within.
|
|
631
673
|
* Defaults to: 1
|
|
632
674
|
* @throws This function can throw errors.
|
|
675
|
+
*
|
|
676
|
+
* {@link GameTestError}
|
|
677
|
+
*
|
|
678
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
633
679
|
*/
|
|
634
680
|
interactWithBlock(blockLocation: minecraftserver.Vector3, direction?: minecraftserver.Direction): boolean;
|
|
635
681
|
/**
|
|
@@ -637,18 +683,22 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
637
683
|
* Causes the simulated player to interact with a mob. Returns
|
|
638
684
|
* true if the interaction was performed.
|
|
639
685
|
*
|
|
640
|
-
* This function can't be called in
|
|
686
|
+
* This function can't be called in restricted-execution mode.
|
|
641
687
|
*
|
|
642
688
|
* @param entity
|
|
643
689
|
* Entity to interact with.
|
|
644
690
|
* @throws This function can throw errors.
|
|
691
|
+
*
|
|
692
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
693
|
+
*
|
|
694
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
645
695
|
*/
|
|
646
696
|
interactWithEntity(entity: minecraftserver.Entity): boolean;
|
|
647
697
|
/**
|
|
648
698
|
* @remarks
|
|
649
699
|
* Causes the simulated player to jump.
|
|
650
700
|
*
|
|
651
|
-
* This function can't be called in
|
|
701
|
+
* This function can't be called in restricted-execution mode.
|
|
652
702
|
*
|
|
653
703
|
* @returns
|
|
654
704
|
* True if a jump was performed.
|
|
@@ -660,11 +710,15 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
660
710
|
* Rotates the simulated player's head/body to look at the
|
|
661
711
|
* given block location.
|
|
662
712
|
*
|
|
663
|
-
* This function can't be called in
|
|
713
|
+
* This function can't be called in restricted-execution mode.
|
|
664
714
|
*
|
|
665
715
|
* @param duration
|
|
666
716
|
* Defaults to: 2
|
|
667
717
|
* @throws This function can throw errors.
|
|
718
|
+
*
|
|
719
|
+
* {@link GameTestError}
|
|
720
|
+
*
|
|
721
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
668
722
|
*/
|
|
669
723
|
lookAtBlock(blockLocation: minecraftserver.Vector3, duration?: LookDuration): void;
|
|
670
724
|
/**
|
|
@@ -672,7 +726,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
672
726
|
* Rotates the simulated player's head/body to look at the
|
|
673
727
|
* given entity.
|
|
674
728
|
*
|
|
675
|
-
* This function can't be called in
|
|
729
|
+
* This function can't be called in restricted-execution mode.
|
|
676
730
|
*
|
|
677
731
|
* @param duration
|
|
678
732
|
* Defaults to: 2
|
|
@@ -684,7 +738,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
684
738
|
* Rotates the simulated player's head/body to look at the
|
|
685
739
|
* given location.
|
|
686
740
|
*
|
|
687
|
-
* This function can't be called in
|
|
741
|
+
* This function can't be called in restricted-execution mode.
|
|
688
742
|
*
|
|
689
743
|
* @param duration
|
|
690
744
|
* Defaults to: 2
|
|
@@ -696,7 +750,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
696
750
|
* Orders the simulated player to walk in the given direction
|
|
697
751
|
* relative to the GameTest.
|
|
698
752
|
*
|
|
699
|
-
* This function can't be called in
|
|
753
|
+
* This function can't be called in restricted-execution mode.
|
|
700
754
|
*
|
|
701
755
|
* @param speed
|
|
702
756
|
* Defaults to: 1
|
|
@@ -708,7 +762,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
708
762
|
* Orders the simulated player to walk in the given direction
|
|
709
763
|
* relative to the player's current rotation.
|
|
710
764
|
*
|
|
711
|
-
* This function can't be called in
|
|
765
|
+
* This function can't be called in restricted-execution mode.
|
|
712
766
|
*
|
|
713
767
|
* @param speed
|
|
714
768
|
* Defaults to: 1
|
|
@@ -722,7 +776,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
722
776
|
* already playing, this will override the last
|
|
723
777
|
* move/navigation.
|
|
724
778
|
*
|
|
725
|
-
* This function can't be called in
|
|
779
|
+
* This function can't be called in restricted-execution mode.
|
|
726
780
|
*
|
|
727
781
|
* @throws This function can throw errors.
|
|
728
782
|
*/
|
|
@@ -733,9 +787,15 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
733
787
|
* a straight line. If a move or navigation is already playing,
|
|
734
788
|
* this will override the last move/navigation.
|
|
735
789
|
*
|
|
736
|
-
* This function can't be called in
|
|
790
|
+
* This function can't be called in restricted-execution mode.
|
|
737
791
|
*
|
|
738
792
|
* @throws This function can throw errors.
|
|
793
|
+
*
|
|
794
|
+
* {@link Error}
|
|
795
|
+
*
|
|
796
|
+
* {@link GameTestError}
|
|
797
|
+
*
|
|
798
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
739
799
|
*/
|
|
740
800
|
moveToLocation(location: minecraftserver.Vector3, options?: MoveToOptions): void;
|
|
741
801
|
/**
|
|
@@ -747,11 +807,15 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
747
807
|
* player will stop. The player must be touching the ground in
|
|
748
808
|
* order to start navigation.
|
|
749
809
|
*
|
|
750
|
-
* This function can't be called in
|
|
810
|
+
* This function can't be called in restricted-execution mode.
|
|
751
811
|
*
|
|
752
812
|
* @param speed
|
|
753
813
|
* Defaults to: 1
|
|
754
814
|
* @throws This function can throw errors.
|
|
815
|
+
*
|
|
816
|
+
* {@link GameTestError}
|
|
817
|
+
*
|
|
818
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
755
819
|
*/
|
|
756
820
|
navigateToBlock(blockLocation: minecraftserver.Vector3, speed?: number): NavigationResult;
|
|
757
821
|
/**
|
|
@@ -760,11 +824,15 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
760
824
|
* a one block radius. If a move or navigation is already
|
|
761
825
|
* playing, this will override the last move/navigation.
|
|
762
826
|
*
|
|
763
|
-
* This function can't be called in
|
|
827
|
+
* This function can't be called in restricted-execution mode.
|
|
764
828
|
*
|
|
765
829
|
* @param speed
|
|
766
830
|
* Defaults to: 1
|
|
767
831
|
* @throws This function can throw errors.
|
|
832
|
+
*
|
|
833
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
834
|
+
*
|
|
835
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
768
836
|
*/
|
|
769
837
|
navigateToEntity(entity: minecraftserver.Entity, speed?: number): NavigationResult;
|
|
770
838
|
/**
|
|
@@ -776,11 +844,15 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
776
844
|
* stop. The player must be touching the ground in order to
|
|
777
845
|
* start navigation.
|
|
778
846
|
*
|
|
779
|
-
* This function can't be called in
|
|
847
|
+
* This function can't be called in restricted-execution mode.
|
|
780
848
|
*
|
|
781
849
|
* @param speed
|
|
782
850
|
* Defaults to: 1
|
|
783
851
|
* @throws This function can throw errors.
|
|
852
|
+
*
|
|
853
|
+
* {@link GameTestError}
|
|
854
|
+
*
|
|
855
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
784
856
|
*/
|
|
785
857
|
navigateToLocation(location: minecraftserver.Vector3, speed?: number): NavigationResult;
|
|
786
858
|
/**
|
|
@@ -789,7 +861,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
789
861
|
* locations parameter. If a move or navigation is already
|
|
790
862
|
* playing, this will override the last move/navigation.
|
|
791
863
|
*
|
|
792
|
-
* This function can't be called in
|
|
864
|
+
* This function can't be called in restricted-execution mode.
|
|
793
865
|
*
|
|
794
866
|
* @param locations
|
|
795
867
|
* A list of locations to use for routing.
|
|
@@ -797,13 +869,17 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
797
869
|
* Net speed to use for doing the navigation.
|
|
798
870
|
* Defaults to: 1
|
|
799
871
|
* @throws This function can throw errors.
|
|
872
|
+
*
|
|
873
|
+
* {@link GameTestError}
|
|
874
|
+
*
|
|
875
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
800
876
|
*/
|
|
801
877
|
navigateToLocations(locations: minecraftserver.Vector3[], speed?: number): void;
|
|
802
878
|
/**
|
|
803
879
|
* @remarks
|
|
804
880
|
* Respawns the particular simulated player.
|
|
805
881
|
*
|
|
806
|
-
* This function can't be called in
|
|
882
|
+
* This function can't be called in restricted-execution mode.
|
|
807
883
|
*
|
|
808
884
|
* @throws This function can throw errors.
|
|
809
885
|
*/
|
|
@@ -813,7 +889,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
813
889
|
* Causes the simulated player to turn by the provided angle,
|
|
814
890
|
* relative to the player's current rotation.
|
|
815
891
|
*
|
|
816
|
-
* This function can't be called in
|
|
892
|
+
* This function can't be called in restricted-execution mode.
|
|
817
893
|
*
|
|
818
894
|
* @throws This function can throw errors.
|
|
819
895
|
*/
|
|
@@ -823,7 +899,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
823
899
|
* Causes the simulated player to turn to face the provided
|
|
824
900
|
* angle, relative to the GameTest.
|
|
825
901
|
*
|
|
826
|
-
* This function can't be called in
|
|
902
|
+
* This function can't be called in restricted-execution mode.
|
|
827
903
|
*
|
|
828
904
|
* @throws This function can throw errors.
|
|
829
905
|
*/
|
|
@@ -832,7 +908,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
832
908
|
* @remarks
|
|
833
909
|
* Sets a particular item for the simulated player.
|
|
834
910
|
*
|
|
835
|
-
* This function can't be called in
|
|
911
|
+
* This function can't be called in restricted-execution mode.
|
|
836
912
|
*
|
|
837
913
|
* @param itemStack
|
|
838
914
|
* Item to set.
|
|
@@ -846,7 +922,20 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
846
922
|
setItem(itemStack: minecraftserver.ItemStack, slot: number, selectSlot?: boolean): boolean;
|
|
847
923
|
/**
|
|
848
924
|
* @remarks
|
|
849
|
-
*
|
|
925
|
+
* Updates information about the player's skin.
|
|
926
|
+
*
|
|
927
|
+
* This function can't be called in restricted-execution mode.
|
|
928
|
+
*
|
|
929
|
+
* @param options
|
|
930
|
+
* Options for the skin to set on the player.
|
|
931
|
+
* @throws This function can throw errors.
|
|
932
|
+
*
|
|
933
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
934
|
+
*/
|
|
935
|
+
setSkin(options: PlayerSkinData): void;
|
|
936
|
+
/**
|
|
937
|
+
* @remarks
|
|
938
|
+
* This function can't be called in restricted-execution mode.
|
|
850
939
|
*
|
|
851
940
|
* @param slot
|
|
852
941
|
* Defaults to: 0
|
|
@@ -857,14 +946,14 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
857
946
|
* @remarks
|
|
858
947
|
* Stops destroying the block that is currently being hit.
|
|
859
948
|
*
|
|
860
|
-
* This function can't be called in
|
|
949
|
+
* This function can't be called in restricted-execution mode.
|
|
861
950
|
*
|
|
862
951
|
* @throws This function can throw errors.
|
|
863
952
|
*/
|
|
864
953
|
stopBreakingBlock(): void;
|
|
865
954
|
/**
|
|
866
955
|
* @remarks
|
|
867
|
-
* This function can't be called in
|
|
956
|
+
* This function can't be called in restricted-execution mode.
|
|
868
957
|
*
|
|
869
958
|
* @throws This function can throw errors.
|
|
870
959
|
*/
|
|
@@ -873,7 +962,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
873
962
|
* @remarks
|
|
874
963
|
* Causes the simulated player to stop flying.
|
|
875
964
|
*
|
|
876
|
-
* This function can't be called in
|
|
965
|
+
* This function can't be called in restricted-execution mode.
|
|
877
966
|
*
|
|
878
967
|
* @throws This function can throw errors.
|
|
879
968
|
*/
|
|
@@ -882,7 +971,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
882
971
|
* @remarks
|
|
883
972
|
* Causes the simulated player to stop gliding.
|
|
884
973
|
*
|
|
885
|
-
* This function can't be called in
|
|
974
|
+
* This function can't be called in restricted-execution mode.
|
|
886
975
|
*
|
|
887
976
|
* @throws This function can throw errors.
|
|
888
977
|
*/
|
|
@@ -891,7 +980,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
891
980
|
* @remarks
|
|
892
981
|
* Stops interacting with entities or blocks.
|
|
893
982
|
*
|
|
894
|
-
* This function can't be called in
|
|
983
|
+
* This function can't be called in restricted-execution mode.
|
|
895
984
|
*
|
|
896
985
|
* @throws This function can throw errors.
|
|
897
986
|
*/
|
|
@@ -901,7 +990,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
901
990
|
* Stops moving/walking/following if the simulated player is
|
|
902
991
|
* moving.
|
|
903
992
|
*
|
|
904
|
-
* This function can't be called in
|
|
993
|
+
* This function can't be called in restricted-execution mode.
|
|
905
994
|
*
|
|
906
995
|
* @throws This function can throw errors.
|
|
907
996
|
*/
|
|
@@ -910,7 +999,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
910
999
|
* @remarks
|
|
911
1000
|
* Causes the simulated player to stop swimming.
|
|
912
1001
|
*
|
|
913
|
-
* This function can't be called in
|
|
1002
|
+
* This function can't be called in restricted-execution mode.
|
|
914
1003
|
*
|
|
915
1004
|
* @throws This function can throw errors.
|
|
916
1005
|
*/
|
|
@@ -919,7 +1008,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
919
1008
|
* @remarks
|
|
920
1009
|
* Stops using the currently active item.
|
|
921
1010
|
*
|
|
922
|
-
* This function can't be called in
|
|
1011
|
+
* This function can't be called in restricted-execution mode.
|
|
923
1012
|
*
|
|
924
1013
|
* @returns
|
|
925
1014
|
* Returns the item that was in use. Undefined if no item was
|
|
@@ -931,7 +1020,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
931
1020
|
* @remarks
|
|
932
1021
|
* Causes the simulated player to start swimming.
|
|
933
1022
|
*
|
|
934
|
-
* This function can't be called in
|
|
1023
|
+
* This function can't be called in restricted-execution mode.
|
|
935
1024
|
*
|
|
936
1025
|
* @throws This function can throw errors.
|
|
937
1026
|
*/
|
|
@@ -941,7 +1030,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
941
1030
|
* Causes the simulated player to use an item. Does not consume
|
|
942
1031
|
* the item. Returns false if the item is on cooldown.
|
|
943
1032
|
*
|
|
944
|
-
* This function can't be called in
|
|
1033
|
+
* This function can't be called in restricted-execution mode.
|
|
945
1034
|
*
|
|
946
1035
|
* @param itemStack
|
|
947
1036
|
* Item to use.
|
|
@@ -953,7 +1042,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
953
1042
|
* Causes the simulated player to hold and use an item in their
|
|
954
1043
|
* inventory.
|
|
955
1044
|
*
|
|
956
|
-
* This function can't be called in
|
|
1045
|
+
* This function can't be called in restricted-execution mode.
|
|
957
1046
|
*
|
|
958
1047
|
* @param slot
|
|
959
1048
|
* Index of the inventory slot.
|
|
@@ -966,7 +1055,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
966
1055
|
* inventory on a block. The block at the specified block
|
|
967
1056
|
* location must be solid. Returns true if the item was used.
|
|
968
1057
|
*
|
|
969
|
-
* This function can't be called in
|
|
1058
|
+
* This function can't be called in restricted-execution mode.
|
|
970
1059
|
*
|
|
971
1060
|
* @param slot
|
|
972
1061
|
* Index of the slot to use.
|
|
@@ -980,6 +1069,10 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
980
1069
|
* block where the item is placed.
|
|
981
1070
|
* Defaults to: null
|
|
982
1071
|
* @throws This function can throw errors.
|
|
1072
|
+
*
|
|
1073
|
+
* {@link GameTestError}
|
|
1074
|
+
*
|
|
1075
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
983
1076
|
*/
|
|
984
1077
|
useItemInSlotOnBlock(
|
|
985
1078
|
slot: number,
|
|
@@ -993,7 +1086,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
993
1086
|
* block at the specified block location must be solid. Returns
|
|
994
1087
|
* true if the item was used.
|
|
995
1088
|
*
|
|
996
|
-
* This function can't be called in
|
|
1089
|
+
* This function can't be called in restricted-execution mode.
|
|
997
1090
|
*
|
|
998
1091
|
* @param itemStack
|
|
999
1092
|
* Item to use.
|
|
@@ -1007,6 +1100,10 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
1007
1100
|
* block where the item is placed.
|
|
1008
1101
|
* Defaults to: null
|
|
1009
1102
|
* @throws This function can throw errors.
|
|
1103
|
+
*
|
|
1104
|
+
* {@link GameTestError}
|
|
1105
|
+
*
|
|
1106
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
1010
1107
|
*/
|
|
1011
1108
|
useItemOnBlock(
|
|
1012
1109
|
itemStack: minecraftserver.ItemStack,
|
|
@@ -1073,6 +1170,8 @@ export class Test {
|
|
|
1073
1170
|
* to true.
|
|
1074
1171
|
* @throws This function can throw errors.
|
|
1075
1172
|
*
|
|
1173
|
+
* {@link GameTestCompletedError}
|
|
1174
|
+
*
|
|
1076
1175
|
* {@link GameTestError}
|
|
1077
1176
|
*/
|
|
1078
1177
|
assert(condition: boolean, message: string): void;
|
|
@@ -1092,6 +1191,8 @@ export class Test {
|
|
|
1092
1191
|
* Defaults to: true
|
|
1093
1192
|
* @throws This function can throw errors.
|
|
1094
1193
|
*
|
|
1194
|
+
* {@link GameTestCompletedError}
|
|
1195
|
+
*
|
|
1095
1196
|
* {@link GameTestError}
|
|
1096
1197
|
*/
|
|
1097
1198
|
assertBlockPresent(
|
|
@@ -1112,6 +1213,8 @@ export class Test {
|
|
|
1112
1213
|
* the block at the specified location.
|
|
1113
1214
|
* @throws This function can throw errors.
|
|
1114
1215
|
*
|
|
1216
|
+
* {@link GameTestCompletedError}
|
|
1217
|
+
*
|
|
1115
1218
|
* {@link GameTestError}
|
|
1116
1219
|
*/
|
|
1117
1220
|
assertBlockState(blockLocation: minecraftserver.Vector3, callback: (arg0: minecraftserver.Block) => boolean): void;
|
|
@@ -1133,6 +1236,8 @@ export class Test {
|
|
|
1133
1236
|
* Defaults to: true
|
|
1134
1237
|
* @throws This function can throw errors.
|
|
1135
1238
|
*
|
|
1239
|
+
* {@link GameTestCompletedError}
|
|
1240
|
+
*
|
|
1136
1241
|
* {@link GameTestError}
|
|
1137
1242
|
*/
|
|
1138
1243
|
assertCanReachLocation(
|
|
@@ -1155,6 +1260,8 @@ export class Test {
|
|
|
1155
1260
|
* chest) to test the contents of.
|
|
1156
1261
|
* @throws This function can throw errors.
|
|
1157
1262
|
*
|
|
1263
|
+
* {@link GameTestCompletedError}
|
|
1264
|
+
*
|
|
1158
1265
|
* {@link GameTestError}
|
|
1159
1266
|
*/
|
|
1160
1267
|
assertContainerContains(itemStack: minecraftserver.ItemStack, blockLocation: minecraftserver.Vector3): void;
|
|
@@ -1168,6 +1275,8 @@ export class Test {
|
|
|
1168
1275
|
* chest) to test is empty of contents.
|
|
1169
1276
|
* @throws This function can throw errors.
|
|
1170
1277
|
*
|
|
1278
|
+
* {@link GameTestCompletedError}
|
|
1279
|
+
*
|
|
1171
1280
|
* {@link GameTestError}
|
|
1172
1281
|
*/
|
|
1173
1282
|
assertContainerEmpty(blockLocation: minecraftserver.Vector3): void;
|
|
@@ -1193,6 +1302,8 @@ export class Test {
|
|
|
1193
1302
|
* Defaults to: true
|
|
1194
1303
|
* @throws This function can throw errors.
|
|
1195
1304
|
*
|
|
1305
|
+
* {@link GameTestCompletedError}
|
|
1306
|
+
*
|
|
1196
1307
|
* {@link GameTestError}
|
|
1197
1308
|
*/
|
|
1198
1309
|
assertEntityHasArmor(
|
|
@@ -1224,6 +1335,8 @@ export class Test {
|
|
|
1224
1335
|
* Defaults to: true
|
|
1225
1336
|
* @throws This function can throw errors.
|
|
1226
1337
|
*
|
|
1338
|
+
* {@link GameTestCompletedError}
|
|
1339
|
+
*
|
|
1227
1340
|
* {@link GameTestError}
|
|
1228
1341
|
*/
|
|
1229
1342
|
assertEntityHasComponent(
|
|
@@ -1249,6 +1362,8 @@ export class Test {
|
|
|
1249
1362
|
* Defaults to: true
|
|
1250
1363
|
* @throws This function can throw errors.
|
|
1251
1364
|
*
|
|
1365
|
+
* {@link GameTestCompletedError}
|
|
1366
|
+
*
|
|
1252
1367
|
* {@link GameTestError}
|
|
1253
1368
|
*/
|
|
1254
1369
|
assertEntityInstancePresent(
|
|
@@ -1270,6 +1385,8 @@ export class Test {
|
|
|
1270
1385
|
* Defaults to: true
|
|
1271
1386
|
* @throws This function can throw errors.
|
|
1272
1387
|
*
|
|
1388
|
+
* {@link GameTestCompletedError}
|
|
1389
|
+
*
|
|
1273
1390
|
* {@link GameTestError}
|
|
1274
1391
|
* @example simpleMobTest.ts
|
|
1275
1392
|
* ```typescript
|
|
@@ -1318,6 +1435,8 @@ export class Test {
|
|
|
1318
1435
|
* Defaults to: true
|
|
1319
1436
|
* @throws This function can throw errors.
|
|
1320
1437
|
*
|
|
1438
|
+
* {@link GameTestCompletedError}
|
|
1439
|
+
*
|
|
1321
1440
|
* {@link GameTestError}
|
|
1322
1441
|
*/
|
|
1323
1442
|
assertEntityPresent(
|
|
@@ -1342,6 +1461,8 @@ export class Test {
|
|
|
1342
1461
|
* Defaults to: true
|
|
1343
1462
|
* @throws This function can throw errors.
|
|
1344
1463
|
*
|
|
1464
|
+
* {@link GameTestCompletedError}
|
|
1465
|
+
*
|
|
1345
1466
|
* {@link GameTestError}
|
|
1346
1467
|
* @example simpleMobTest.ts
|
|
1347
1468
|
* ```typescript
|
|
@@ -1405,6 +1526,8 @@ export class Test {
|
|
|
1405
1526
|
* is thrown.
|
|
1406
1527
|
* @throws This function can throw errors.
|
|
1407
1528
|
*
|
|
1529
|
+
* {@link GameTestCompletedError}
|
|
1530
|
+
*
|
|
1408
1531
|
* {@link GameTestError}
|
|
1409
1532
|
*/
|
|
1410
1533
|
assertEntityState(
|
|
@@ -1431,6 +1554,8 @@ export class Test {
|
|
|
1431
1554
|
* Defaults to: true
|
|
1432
1555
|
* @throws This function can throw errors.
|
|
1433
1556
|
*
|
|
1557
|
+
* {@link GameTestCompletedError}
|
|
1558
|
+
*
|
|
1434
1559
|
* {@link GameTestError}
|
|
1435
1560
|
*/
|
|
1436
1561
|
assertEntityTouching(entityTypeIdentifier: string, location: minecraftserver.Vector3, isTouching?: boolean): void;
|
|
@@ -1449,6 +1574,8 @@ export class Test {
|
|
|
1449
1574
|
* Defaults to: true
|
|
1450
1575
|
* @throws This function can throw errors.
|
|
1451
1576
|
*
|
|
1577
|
+
* {@link GameTestCompletedError}
|
|
1578
|
+
*
|
|
1452
1579
|
* {@link GameTestError}
|
|
1453
1580
|
*/
|
|
1454
1581
|
assertIsWaterlogged(blockLocation: minecraftserver.Vector3, isWaterlogged?: boolean): void;
|
|
@@ -1468,6 +1595,8 @@ export class Test {
|
|
|
1468
1595
|
* Number of items, at minimum, to look and test for.
|
|
1469
1596
|
* @throws This function can throw errors.
|
|
1470
1597
|
*
|
|
1598
|
+
* {@link GameTestCompletedError}
|
|
1599
|
+
*
|
|
1471
1600
|
* {@link GameTestError}
|
|
1472
1601
|
*/
|
|
1473
1602
|
assertItemEntityCountIs(
|
|
@@ -1497,6 +1626,8 @@ export class Test {
|
|
|
1497
1626
|
* Defaults to: true
|
|
1498
1627
|
* @throws This function can throw errors.
|
|
1499
1628
|
*
|
|
1629
|
+
* {@link GameTestCompletedError}
|
|
1630
|
+
*
|
|
1500
1631
|
* {@link GameTestError}
|
|
1501
1632
|
*/
|
|
1502
1633
|
assertItemEntityPresent(
|
|
@@ -1516,6 +1647,8 @@ export class Test {
|
|
|
1516
1647
|
* Expected power level.
|
|
1517
1648
|
* @throws This function can throw errors.
|
|
1518
1649
|
*
|
|
1650
|
+
* {@link GameTestCompletedError}
|
|
1651
|
+
*
|
|
1519
1652
|
* {@link GameTestError}
|
|
1520
1653
|
*/
|
|
1521
1654
|
assertRedstonePower(blockLocation: minecraftserver.Vector3, power: number): void;
|
|
@@ -1523,7 +1656,7 @@ export class Test {
|
|
|
1523
1656
|
* @remarks
|
|
1524
1657
|
* Destroys a block at a particular location.
|
|
1525
1658
|
*
|
|
1526
|
-
* This function can't be called in
|
|
1659
|
+
* This function can't be called in restricted-execution mode.
|
|
1527
1660
|
*
|
|
1528
1661
|
* @param blockLocation
|
|
1529
1662
|
* Location of the block to destroy.
|
|
@@ -1532,6 +1665,8 @@ export class Test {
|
|
|
1532
1665
|
* Defaults to: false
|
|
1533
1666
|
* @throws This function can throw errors.
|
|
1534
1667
|
*
|
|
1668
|
+
* {@link GameTestCompletedError}
|
|
1669
|
+
*
|
|
1535
1670
|
* {@link GameTestError}
|
|
1536
1671
|
*/
|
|
1537
1672
|
destroyBlock(blockLocation: minecraftserver.Vector3, dropResources?: boolean): void;
|
|
@@ -1560,12 +1695,14 @@ export class Test {
|
|
|
1560
1695
|
* @remarks
|
|
1561
1696
|
* Gets a block at the specified block location.
|
|
1562
1697
|
*
|
|
1563
|
-
* This function can't be called in
|
|
1698
|
+
* This function can't be called in restricted-execution mode.
|
|
1564
1699
|
*
|
|
1565
1700
|
* @param blockLocation
|
|
1566
1701
|
* Location of the block to retrieve.
|
|
1567
1702
|
* @throws This function can throw errors.
|
|
1568
1703
|
*
|
|
1704
|
+
* {@link GameTestCompletedError}
|
|
1705
|
+
*
|
|
1569
1706
|
* {@link GameTestError}
|
|
1570
1707
|
*/
|
|
1571
1708
|
getBlock(blockLocation: minecraftserver.Vector3): minecraftserver.Block;
|
|
@@ -1575,6 +1712,8 @@ export class Test {
|
|
|
1575
1712
|
*
|
|
1576
1713
|
* @throws This function can throw errors.
|
|
1577
1714
|
*
|
|
1715
|
+
* {@link GameTestCompletedError}
|
|
1716
|
+
*
|
|
1578
1717
|
* {@link GameTestError}
|
|
1579
1718
|
*/
|
|
1580
1719
|
getDimension(): minecraftserver.Dimension;
|
|
@@ -1584,12 +1723,14 @@ export class Test {
|
|
|
1584
1723
|
* this returns a helper object with details on how a fence is
|
|
1585
1724
|
* connected.
|
|
1586
1725
|
*
|
|
1587
|
-
* This function can't be called in
|
|
1726
|
+
* This function can't be called in restricted-execution mode.
|
|
1588
1727
|
*
|
|
1589
1728
|
* @param blockLocation
|
|
1590
1729
|
* Location of the block to retrieve.
|
|
1591
1730
|
* @throws This function can throw errors.
|
|
1592
1731
|
*
|
|
1732
|
+
* {@link GameTestCompletedError}
|
|
1733
|
+
*
|
|
1593
1734
|
* {@link GameTestError}
|
|
1594
1735
|
*/
|
|
1595
1736
|
getFenceConnectivity(blockLocation: minecraftserver.Vector3): FenceConnectivity;
|
|
@@ -1598,7 +1739,7 @@ export class Test {
|
|
|
1598
1739
|
* Retrieves a sculk spreader object that can be used to
|
|
1599
1740
|
* control and manage how sculk grows from a block.
|
|
1600
1741
|
*
|
|
1601
|
-
* This function can't be called in
|
|
1742
|
+
* This function can't be called in restricted-execution mode.
|
|
1602
1743
|
*
|
|
1603
1744
|
* @param blockLocation
|
|
1604
1745
|
* Location of the block to retrieve a sculk spreader from.
|
|
@@ -1607,6 +1748,8 @@ export class Test {
|
|
|
1607
1748
|
* is present on the block.
|
|
1608
1749
|
* @throws This function can throw errors.
|
|
1609
1750
|
*
|
|
1751
|
+
* {@link GameTestCompletedError}
|
|
1752
|
+
*
|
|
1610
1753
|
* {@link GameTestError}
|
|
1611
1754
|
*/
|
|
1612
1755
|
getSculkSpreader(blockLocation: minecraftserver.Vector3): SculkSpreader | undefined;
|
|
@@ -1616,6 +1759,9 @@ export class Test {
|
|
|
1616
1759
|
* minecraftserver.Direction} enum for more information on
|
|
1617
1760
|
* potential values (north, east, south, west - values 2-5).
|
|
1618
1761
|
*
|
|
1762
|
+
* @throws This function can throw errors.
|
|
1763
|
+
*
|
|
1764
|
+
* {@link GameTestCompletedError}
|
|
1619
1765
|
*/
|
|
1620
1766
|
getTestDirection(): minecraftserver.Direction;
|
|
1621
1767
|
/**
|
|
@@ -1623,29 +1769,53 @@ export class Test {
|
|
|
1623
1769
|
* This asynchronous function will wait for the specified time
|
|
1624
1770
|
* in ticks before continuing execution.
|
|
1625
1771
|
*
|
|
1626
|
-
* This function can't be called in
|
|
1772
|
+
* This function can't be called in restricted-execution mode.
|
|
1627
1773
|
*
|
|
1628
1774
|
* @param tickDelay
|
|
1629
1775
|
* Amount of time to wait, in ticks.
|
|
1776
|
+
* @throws This function can throw errors.
|
|
1777
|
+
*
|
|
1778
|
+
* {@link GameTestCompletedError}
|
|
1630
1779
|
*/
|
|
1631
1780
|
idle(tickDelay: number): Promise<void>;
|
|
1781
|
+
/**
|
|
1782
|
+
* @remarks
|
|
1783
|
+
* Returns whether or not the test is currently in the Clean Up
|
|
1784
|
+
* step after running.
|
|
1785
|
+
*
|
|
1786
|
+
* This function can't be called in restricted-execution mode.
|
|
1787
|
+
*
|
|
1788
|
+
*/
|
|
1789
|
+
isCleaningUp(): boolean;
|
|
1790
|
+
/**
|
|
1791
|
+
* @remarks
|
|
1792
|
+
* Returns whether or not the test has already completed
|
|
1793
|
+
*
|
|
1794
|
+
* This function can't be called in restricted-execution mode.
|
|
1795
|
+
*
|
|
1796
|
+
*/
|
|
1797
|
+
isCompleted(): boolean;
|
|
1632
1798
|
/**
|
|
1633
1799
|
* @remarks
|
|
1634
1800
|
* Kills all entities within the GameTest structure.
|
|
1635
1801
|
*
|
|
1636
|
-
* This function can't be called in
|
|
1802
|
+
* This function can't be called in restricted-execution mode.
|
|
1637
1803
|
*
|
|
1638
1804
|
* @throws This function can throw errors.
|
|
1639
1805
|
*
|
|
1806
|
+
* {@link GameTestCompletedError}
|
|
1807
|
+
*
|
|
1640
1808
|
* {@link GameTestError}
|
|
1641
1809
|
*/
|
|
1642
1810
|
killAllEntities(): void;
|
|
1643
1811
|
/**
|
|
1644
1812
|
* @remarks
|
|
1645
|
-
* This function can't be called in
|
|
1813
|
+
* This function can't be called in restricted-execution mode.
|
|
1646
1814
|
*
|
|
1647
1815
|
* @throws This function can throw errors.
|
|
1648
1816
|
*
|
|
1817
|
+
* {@link GameTestCompletedError}
|
|
1818
|
+
*
|
|
1649
1819
|
* {@link GameTestError}
|
|
1650
1820
|
*/
|
|
1651
1821
|
onPlayerJump(mob: minecraftserver.Entity, jumpAmount: number): void;
|
|
@@ -1653,7 +1823,7 @@ export class Test {
|
|
|
1653
1823
|
* @remarks
|
|
1654
1824
|
* Presses a button at a block location.
|
|
1655
1825
|
*
|
|
1656
|
-
* This function can't be called in
|
|
1826
|
+
* This function can't be called in restricted-execution mode.
|
|
1657
1827
|
*
|
|
1658
1828
|
* @param blockLocation
|
|
1659
1829
|
* Location to push the button at.
|
|
@@ -1661,6 +1831,8 @@ export class Test {
|
|
|
1661
1831
|
* Will throw an error if a button is not present at the
|
|
1662
1832
|
* specified position.
|
|
1663
1833
|
*
|
|
1834
|
+
* {@link GameTestCompletedError}
|
|
1835
|
+
*
|
|
1664
1836
|
* {@link GameTestError}
|
|
1665
1837
|
*/
|
|
1666
1838
|
pressButton(blockLocation: minecraftserver.Vector3): void;
|
|
@@ -1668,12 +1840,14 @@ export class Test {
|
|
|
1668
1840
|
* @remarks
|
|
1669
1841
|
* Displays the specified message to all players.
|
|
1670
1842
|
*
|
|
1671
|
-
* This function can't be called in
|
|
1843
|
+
* This function can't be called in restricted-execution mode.
|
|
1672
1844
|
*
|
|
1673
1845
|
* @param text
|
|
1674
1846
|
* Message to display.
|
|
1675
1847
|
* @throws This function can throw errors.
|
|
1676
1848
|
*
|
|
1849
|
+
* {@link GameTestCompletedError}
|
|
1850
|
+
*
|
|
1677
1851
|
* {@link GameTestError}
|
|
1678
1852
|
*/
|
|
1679
1853
|
print(text: string): void;
|
|
@@ -1681,7 +1855,7 @@ export class Test {
|
|
|
1681
1855
|
* @remarks
|
|
1682
1856
|
* Pulls a lever at a block location.
|
|
1683
1857
|
*
|
|
1684
|
-
* This function can't be called in
|
|
1858
|
+
* This function can't be called in restricted-execution mode.
|
|
1685
1859
|
*
|
|
1686
1860
|
* @param blockLocation
|
|
1687
1861
|
* Location to pull the lever at.
|
|
@@ -1689,6 +1863,8 @@ export class Test {
|
|
|
1689
1863
|
* Will throw an error if a lever is not present at the
|
|
1690
1864
|
* specified position.
|
|
1691
1865
|
*
|
|
1866
|
+
* {@link GameTestCompletedError}
|
|
1867
|
+
*
|
|
1692
1868
|
* {@link GameTestError}
|
|
1693
1869
|
*/
|
|
1694
1870
|
pullLever(blockLocation: minecraftserver.Vector3): void;
|
|
@@ -1697,7 +1873,7 @@ export class Test {
|
|
|
1697
1873
|
* Sends a Redstone pulse at a particular location by creating
|
|
1698
1874
|
* a temporary Redstone block.
|
|
1699
1875
|
*
|
|
1700
|
-
* This function can't be called in
|
|
1876
|
+
* This function can't be called in restricted-execution mode.
|
|
1701
1877
|
*
|
|
1702
1878
|
* @param blockLocation
|
|
1703
1879
|
* Location to pulse Redstone at.
|
|
@@ -1705,6 +1881,8 @@ export class Test {
|
|
|
1705
1881
|
* Number of ticks to pulse Redstone.
|
|
1706
1882
|
* @throws This function can throw errors.
|
|
1707
1883
|
*
|
|
1884
|
+
* {@link GameTestCompletedError}
|
|
1885
|
+
*
|
|
1708
1886
|
* {@link GameTestError}
|
|
1709
1887
|
*/
|
|
1710
1888
|
pulseRedstone(blockLocation: minecraftserver.Vector3, duration: number): void;
|
|
@@ -1723,6 +1901,8 @@ export class Test {
|
|
|
1723
1901
|
* A location relative to the GameTest command block.
|
|
1724
1902
|
* @throws This function can throw errors.
|
|
1725
1903
|
*
|
|
1904
|
+
* {@link GameTestCompletedError}
|
|
1905
|
+
*
|
|
1726
1906
|
* {@link GameTestError}
|
|
1727
1907
|
*/
|
|
1728
1908
|
relativeBlockLocation(worldBlockLocation: minecraftserver.Vector3): minecraftserver.Vector3;
|
|
@@ -1734,7 +1914,7 @@ export class Test {
|
|
|
1734
1914
|
* structure block are (0, 1, 0). Rotation of the GameTest
|
|
1735
1915
|
* structure is also taken into account.
|
|
1736
1916
|
*
|
|
1737
|
-
* This function can't be called in
|
|
1917
|
+
* This function can't be called in restricted-execution mode.
|
|
1738
1918
|
*
|
|
1739
1919
|
* @param worldLocation
|
|
1740
1920
|
* Absolute location in the world to convert to a relative
|
|
@@ -1743,6 +1923,8 @@ export class Test {
|
|
|
1743
1923
|
* A location relative to the GameTest command block.
|
|
1744
1924
|
* @throws This function can throw errors.
|
|
1745
1925
|
*
|
|
1926
|
+
* {@link GameTestCompletedError}
|
|
1927
|
+
*
|
|
1746
1928
|
* {@link GameTestError}
|
|
1747
1929
|
*/
|
|
1748
1930
|
relativeLocation(worldLocation: minecraftserver.Vector3): minecraftserver.Vector3;
|
|
@@ -1750,10 +1932,13 @@ export class Test {
|
|
|
1750
1932
|
* @remarks
|
|
1751
1933
|
* Removes a simulated player from the world.
|
|
1752
1934
|
*
|
|
1753
|
-
* This function can't be called in
|
|
1935
|
+
* This function can't be called in restricted-execution mode.
|
|
1754
1936
|
*
|
|
1755
1937
|
* @param simulatedPlayer
|
|
1756
1938
|
* Simulated player to remove.
|
|
1939
|
+
* @throws This function can throw errors.
|
|
1940
|
+
*
|
|
1941
|
+
* {@link GameTestCompletedError}
|
|
1757
1942
|
*/
|
|
1758
1943
|
removeSimulatedPlayer(simulatedPlayer: SimulatedPlayer): void;
|
|
1759
1944
|
/**
|
|
@@ -1763,7 +1948,7 @@ export class Test {
|
|
|
1763
1948
|
* test direction; Passing in Direction.north will return the
|
|
1764
1949
|
* opposite of the test direction, and so on.
|
|
1765
1950
|
*
|
|
1766
|
-
* This function can't be called in
|
|
1951
|
+
* This function can't be called in restricted-execution mode.
|
|
1767
1952
|
*
|
|
1768
1953
|
* @param direction
|
|
1769
1954
|
* Direction to translate into a direction relative to the
|
|
@@ -1772,15 +1957,19 @@ export class Test {
|
|
|
1772
1957
|
* opposite of the test direction, and so on.
|
|
1773
1958
|
* @throws This function can throw errors.
|
|
1774
1959
|
*
|
|
1960
|
+
* {@link GameTestCompletedError}
|
|
1961
|
+
*
|
|
1775
1962
|
* {@link GameTestError}
|
|
1776
1963
|
*/
|
|
1777
1964
|
rotateDirection(direction: minecraftserver.Direction): minecraftserver.Direction;
|
|
1778
1965
|
/**
|
|
1779
1966
|
* @remarks
|
|
1780
|
-
* This function can't be called in
|
|
1967
|
+
* This function can't be called in restricted-execution mode.
|
|
1781
1968
|
*
|
|
1782
1969
|
* @throws This function can throw errors.
|
|
1783
1970
|
*
|
|
1971
|
+
* {@link GameTestCompletedError}
|
|
1972
|
+
*
|
|
1784
1973
|
* {@link GameTestError}
|
|
1785
1974
|
*/
|
|
1786
1975
|
rotateVector(vector: minecraftserver.Vector3): minecraftserver.Vector3;
|
|
@@ -1788,7 +1977,7 @@ export class Test {
|
|
|
1788
1977
|
* @remarks
|
|
1789
1978
|
* Runs a specific callback after a specified delay of ticks
|
|
1790
1979
|
*
|
|
1791
|
-
* This function can't be called in
|
|
1980
|
+
* This function can't be called in restricted-execution mode.
|
|
1792
1981
|
*
|
|
1793
1982
|
* @param delayTicks
|
|
1794
1983
|
* Number of ticks to delay before running the specified
|
|
@@ -1803,7 +1992,7 @@ export class Test {
|
|
|
1803
1992
|
* Runs the given callback after a delay of _tick_ ticks from
|
|
1804
1993
|
* the start of the GameTest.
|
|
1805
1994
|
*
|
|
1806
|
-
* This function can't be called in
|
|
1995
|
+
* This function can't be called in restricted-execution mode.
|
|
1807
1996
|
*
|
|
1808
1997
|
* @param tick
|
|
1809
1998
|
* Tick (after the start of the GameTest) to run the callback
|
|
@@ -1813,12 +2002,28 @@ export class Test {
|
|
|
1813
2002
|
* @throws This function can throw errors.
|
|
1814
2003
|
*/
|
|
1815
2004
|
runAtTickTime(tick: number, callback: () => void): void;
|
|
2005
|
+
/**
|
|
2006
|
+
* @remarks
|
|
2007
|
+
* Runs the given callback after the GameTest has completed
|
|
2008
|
+
* regardless if the test passed, failed, or timed out.
|
|
2009
|
+
*
|
|
2010
|
+
* This function can't be called in restricted-execution mode.
|
|
2011
|
+
*
|
|
2012
|
+
* @param callback
|
|
2013
|
+
* Callback to execute.
|
|
2014
|
+
* @throws This function can throw errors.
|
|
2015
|
+
*
|
|
2016
|
+
* {@link GameTestCompletedError}
|
|
2017
|
+
*
|
|
2018
|
+
* {@link GameTestError}
|
|
2019
|
+
*/
|
|
2020
|
+
runOnFinish(callback: () => void): void;
|
|
1816
2021
|
/**
|
|
1817
2022
|
* @remarks
|
|
1818
2023
|
* Sets a block to a particular configuration (a
|
|
1819
2024
|
* BlockPermutation) at the specified block location.
|
|
1820
2025
|
*
|
|
1821
|
-
* This function can't be called in
|
|
2026
|
+
* This function can't be called in restricted-execution mode.
|
|
1822
2027
|
*
|
|
1823
2028
|
* @param blockData
|
|
1824
2029
|
* Permutation that contains the configuration data for a
|
|
@@ -1827,6 +2032,8 @@ export class Test {
|
|
|
1827
2032
|
* Location of the block to set.
|
|
1828
2033
|
* @throws This function can throw errors.
|
|
1829
2034
|
*
|
|
2035
|
+
* {@link GameTestCompletedError}
|
|
2036
|
+
*
|
|
1830
2037
|
* {@link GameTestError}
|
|
1831
2038
|
*/
|
|
1832
2039
|
setBlockPermutation(blockData: minecraftserver.BlockPermutation, blockLocation: minecraftserver.Vector3): void;
|
|
@@ -1835,7 +2042,7 @@ export class Test {
|
|
|
1835
2042
|
* Sets a block to a particular type at the specified block
|
|
1836
2043
|
* location.
|
|
1837
2044
|
*
|
|
1838
|
-
* This function can't be called in
|
|
2045
|
+
* This function can't be called in restricted-execution mode.
|
|
1839
2046
|
*
|
|
1840
2047
|
* @param blockType
|
|
1841
2048
|
* Type of block to set.
|
|
@@ -1843,6 +2050,8 @@ export class Test {
|
|
|
1843
2050
|
* Location of the block to set.
|
|
1844
2051
|
* @throws This function can throw errors.
|
|
1845
2052
|
*
|
|
2053
|
+
* {@link GameTestCompletedError}
|
|
2054
|
+
*
|
|
1846
2055
|
* {@link GameTestError}
|
|
1847
2056
|
* @example minibiomes.ts
|
|
1848
2057
|
* ```typescript
|
|
@@ -1871,7 +2080,7 @@ export class Test {
|
|
|
1871
2080
|
* For blocks that are fluid containers - like a cauldron -
|
|
1872
2081
|
* changes the type of fluid within that container.
|
|
1873
2082
|
*
|
|
1874
|
-
* This function can't be called in
|
|
2083
|
+
* This function can't be called in restricted-execution mode.
|
|
1875
2084
|
*
|
|
1876
2085
|
* @param location
|
|
1877
2086
|
* Location of the fluid container block.
|
|
@@ -1880,6 +2089,8 @@ export class Test {
|
|
|
1880
2089
|
* for a list of values.
|
|
1881
2090
|
* @throws This function can throw errors.
|
|
1882
2091
|
*
|
|
2092
|
+
* {@link GameTestCompletedError}
|
|
2093
|
+
*
|
|
1883
2094
|
* {@link GameTestError}
|
|
1884
2095
|
*/
|
|
1885
2096
|
setFluidContainer(location: minecraftserver.Vector3, type: minecraftserver.FluidType): void;
|
|
@@ -1887,7 +2098,7 @@ export class Test {
|
|
|
1887
2098
|
* @remarks
|
|
1888
2099
|
* Sets the fuse of an explodable entity.
|
|
1889
2100
|
*
|
|
1890
|
-
* This function can't be called in
|
|
2101
|
+
* This function can't be called in restricted-execution mode.
|
|
1891
2102
|
*
|
|
1892
2103
|
* @param entity
|
|
1893
2104
|
* Entity that is explodable.
|
|
@@ -1895,6 +2106,8 @@ export class Test {
|
|
|
1895
2106
|
* Length of time, in ticks, before the entity explodes.
|
|
1896
2107
|
* @throws This function can throw errors.
|
|
1897
2108
|
*
|
|
2109
|
+
* {@link GameTestCompletedError}
|
|
2110
|
+
*
|
|
1898
2111
|
* {@link GameTestError}
|
|
1899
2112
|
*/
|
|
1900
2113
|
setTntFuse(entity: minecraftserver.Entity, fuseLength: number): void;
|
|
@@ -1902,7 +2115,7 @@ export class Test {
|
|
|
1902
2115
|
* @remarks
|
|
1903
2116
|
* Spawns an entity at a location.
|
|
1904
2117
|
*
|
|
1905
|
-
* This function can't be called in
|
|
2118
|
+
* This function can't be called in restricted-execution mode.
|
|
1906
2119
|
*
|
|
1907
2120
|
* @param entityTypeIdentifier
|
|
1908
2121
|
* Type of entity to create. If no namespace is provided,
|
|
@@ -1914,6 +2127,8 @@ export class Test {
|
|
|
1914
2127
|
* undefined.
|
|
1915
2128
|
* @throws This function can throw errors.
|
|
1916
2129
|
*
|
|
2130
|
+
* {@link GameTestCompletedError}
|
|
2131
|
+
*
|
|
1917
2132
|
* {@link GameTestError}
|
|
1918
2133
|
* @example simpleMobTest.ts
|
|
1919
2134
|
* ```typescript
|
|
@@ -1997,7 +2212,7 @@ export class Test {
|
|
|
1997
2212
|
* @remarks
|
|
1998
2213
|
* Spawns an entity at a location.
|
|
1999
2214
|
*
|
|
2000
|
-
* This function can't be called in
|
|
2215
|
+
* This function can't be called in restricted-execution mode.
|
|
2001
2216
|
*
|
|
2002
2217
|
* @param entityTypeIdentifier
|
|
2003
2218
|
* Type of entity to create. If no namespace is provided,
|
|
@@ -2009,6 +2224,8 @@ export class Test {
|
|
|
2009
2224
|
* undefined.
|
|
2010
2225
|
* @throws This function can throw errors.
|
|
2011
2226
|
*
|
|
2227
|
+
* {@link GameTestCompletedError}
|
|
2228
|
+
*
|
|
2012
2229
|
* {@link GameTestError}
|
|
2013
2230
|
*/
|
|
2014
2231
|
spawnAtLocation(entityTypeIdentifier: string, location: minecraftserver.Vector3): minecraftserver.Entity;
|
|
@@ -2016,7 +2233,7 @@ export class Test {
|
|
|
2016
2233
|
* @remarks
|
|
2017
2234
|
* Spawns an item entity at a specified location.
|
|
2018
2235
|
*
|
|
2019
|
-
* This function can't be called in
|
|
2236
|
+
* This function can't be called in restricted-execution mode.
|
|
2020
2237
|
*
|
|
2021
2238
|
* @param itemStack
|
|
2022
2239
|
* ItemStack that describes the item entity to create.
|
|
@@ -2024,6 +2241,8 @@ export class Test {
|
|
|
2024
2241
|
* Location to create the item entity at.
|
|
2025
2242
|
* @throws This function can throw errors.
|
|
2026
2243
|
*
|
|
2244
|
+
* {@link GameTestCompletedError}
|
|
2245
|
+
*
|
|
2027
2246
|
* {@link GameTestError}
|
|
2028
2247
|
*/
|
|
2029
2248
|
spawnItem(itemStack: minecraftserver.ItemStack, location: minecraftserver.Vector3): minecraftserver.Entity;
|
|
@@ -2031,7 +2250,7 @@ export class Test {
|
|
|
2031
2250
|
* @remarks
|
|
2032
2251
|
* Creates a new simulated player within the world.
|
|
2033
2252
|
*
|
|
2034
|
-
* This function can't be called in
|
|
2253
|
+
* This function can't be called in restricted-execution mode.
|
|
2035
2254
|
*
|
|
2036
2255
|
* @param blockLocation
|
|
2037
2256
|
* Location where to spawn the simulated player.
|
|
@@ -2042,6 +2261,8 @@ export class Test {
|
|
|
2042
2261
|
* Defaults to: 0
|
|
2043
2262
|
* @throws This function can throw errors.
|
|
2044
2263
|
*
|
|
2264
|
+
* {@link GameTestCompletedError}
|
|
2265
|
+
*
|
|
2045
2266
|
* {@link GameTestError}
|
|
2046
2267
|
*/
|
|
2047
2268
|
spawnSimulatedPlayer(
|
|
@@ -2055,12 +2276,14 @@ export class Test {
|
|
|
2055
2276
|
* This method is frequently used in conjunction with methods
|
|
2056
2277
|
* like .walkTo to create predictable mob actions.
|
|
2057
2278
|
*
|
|
2058
|
-
* This function can't be called in
|
|
2279
|
+
* This function can't be called in restricted-execution mode.
|
|
2059
2280
|
*
|
|
2060
2281
|
* @param blockLocation
|
|
2061
2282
|
* Location where the entity should be spawned.
|
|
2062
2283
|
* @throws This function can throw errors.
|
|
2063
2284
|
*
|
|
2285
|
+
* {@link GameTestCompletedError}
|
|
2286
|
+
*
|
|
2064
2287
|
* {@link GameTestError}
|
|
2065
2288
|
*/
|
|
2066
2289
|
spawnWithoutBehaviors(entityTypeIdentifier: string, blockLocation: minecraftserver.Vector3): minecraftserver.Entity;
|
|
@@ -2070,12 +2293,14 @@ export class Test {
|
|
|
2070
2293
|
* This method is frequently used in conjunction with methods
|
|
2071
2294
|
* like .walkTo to create predictable mob actions.
|
|
2072
2295
|
*
|
|
2073
|
-
* This function can't be called in
|
|
2296
|
+
* This function can't be called in restricted-execution mode.
|
|
2074
2297
|
*
|
|
2075
2298
|
* @param location
|
|
2076
2299
|
* Location where the entity should be spawned.
|
|
2077
2300
|
* @throws This function can throw errors.
|
|
2078
2301
|
*
|
|
2302
|
+
* {@link GameTestCompletedError}
|
|
2303
|
+
*
|
|
2079
2304
|
* {@link GameTestError}
|
|
2080
2305
|
*/
|
|
2081
2306
|
spawnWithoutBehaviorsAtLocation(
|
|
@@ -2087,7 +2312,7 @@ export class Test {
|
|
|
2087
2312
|
* Tests that a particular item entity is present at a
|
|
2088
2313
|
* particular location. If not, an exception is thrown.
|
|
2089
2314
|
*
|
|
2090
|
-
* This function can't be called in
|
|
2315
|
+
* This function can't be called in restricted-execution mode.
|
|
2091
2316
|
*
|
|
2092
2317
|
* @param blockLocation
|
|
2093
2318
|
* BlockLocation containing a multiface block.
|
|
@@ -2098,6 +2323,8 @@ export class Test {
|
|
|
2098
2323
|
* specify a direction.
|
|
2099
2324
|
* @throws This function can throw errors.
|
|
2100
2325
|
*
|
|
2326
|
+
* {@link GameTestCompletedError}
|
|
2327
|
+
*
|
|
2101
2328
|
* {@link GameTestError}
|
|
2102
2329
|
*/
|
|
2103
2330
|
spreadFromFaceTowardDirection(
|
|
@@ -2110,18 +2337,21 @@ export class Test {
|
|
|
2110
2337
|
* Creates a new GameTestSequence - A set of steps that play
|
|
2111
2338
|
* out sequentially within a GameTest.
|
|
2112
2339
|
*
|
|
2113
|
-
* This function can't be called in
|
|
2340
|
+
* This function can't be called in restricted-execution mode.
|
|
2114
2341
|
*
|
|
2115
2342
|
* @returns
|
|
2116
2343
|
* A new GameTestSequence with chaining methods that facilitate
|
|
2117
2344
|
* creating a set of steps.
|
|
2345
|
+
* @throws This function can throw errors.
|
|
2346
|
+
*
|
|
2347
|
+
* {@link GameTestCompletedError}
|
|
2118
2348
|
*/
|
|
2119
2349
|
startSequence(): GameTestSequence;
|
|
2120
2350
|
/**
|
|
2121
2351
|
* @remarks
|
|
2122
2352
|
* Marks the current test as a success case.
|
|
2123
2353
|
*
|
|
2124
|
-
* This function can't be called in
|
|
2354
|
+
* This function can't be called in restricted-execution mode.
|
|
2125
2355
|
*
|
|
2126
2356
|
* @throws This function can throw errors.
|
|
2127
2357
|
*/
|
|
@@ -2131,7 +2361,7 @@ export class Test {
|
|
|
2131
2361
|
* Runs the given callback. If the callback does not throw an
|
|
2132
2362
|
* exception, the test is marked as a success.
|
|
2133
2363
|
*
|
|
2134
|
-
* This function can't be called in
|
|
2364
|
+
* This function can't be called in restricted-execution mode.
|
|
2135
2365
|
*
|
|
2136
2366
|
* @param callback
|
|
2137
2367
|
* Callback function that runs. If the function runs
|
|
@@ -2144,7 +2374,7 @@ export class Test {
|
|
|
2144
2374
|
* @remarks
|
|
2145
2375
|
* Marks the test as a success at the specified tick.
|
|
2146
2376
|
*
|
|
2147
|
-
* This function can't be called in
|
|
2377
|
+
* This function can't be called in restricted-execution mode.
|
|
2148
2378
|
*
|
|
2149
2379
|
* @param tick
|
|
2150
2380
|
* Tick after the start of the GameTest to mark the test as
|
|
@@ -2158,7 +2388,7 @@ export class Test {
|
|
|
2158
2388
|
* the test. If the callback does not throw an exception, the
|
|
2159
2389
|
* test is marked as a failure.
|
|
2160
2390
|
*
|
|
2161
|
-
* This function can't be called in
|
|
2391
|
+
* This function can't be called in restricted-execution mode.
|
|
2162
2392
|
*
|
|
2163
2393
|
* @param tick
|
|
2164
2394
|
* Tick after the start of the GameTest to run the testing
|
|
@@ -2176,7 +2406,7 @@ export class Test {
|
|
|
2176
2406
|
* Specifically, the test will succeed when the callback does
|
|
2177
2407
|
* not throw an exception.
|
|
2178
2408
|
*
|
|
2179
|
-
* This function can't be called in
|
|
2409
|
+
* This function can't be called in restricted-execution mode.
|
|
2180
2410
|
*
|
|
2181
2411
|
* @param callback
|
|
2182
2412
|
* Testing callback function that runs. If the function runs
|
|
@@ -2211,7 +2441,7 @@ export class Test {
|
|
|
2211
2441
|
* the specified block of a type is found or not found
|
|
2212
2442
|
* (depending on isPresent), the test is marked as a success.
|
|
2213
2443
|
*
|
|
2214
|
-
* This function can't be called in
|
|
2444
|
+
* This function can't be called in restricted-execution mode.
|
|
2215
2445
|
*
|
|
2216
2446
|
* @param blockType
|
|
2217
2447
|
* Type of block to test for.
|
|
@@ -2224,6 +2454,8 @@ export class Test {
|
|
|
2224
2454
|
* Defaults to: true
|
|
2225
2455
|
* @throws This function can throw errors.
|
|
2226
2456
|
*
|
|
2457
|
+
* {@link GameTestCompletedError}
|
|
2458
|
+
*
|
|
2227
2459
|
* {@link GameTestError}
|
|
2228
2460
|
*/
|
|
2229
2461
|
succeedWhenBlockPresent(
|
|
@@ -2237,7 +2469,7 @@ export class Test {
|
|
|
2237
2469
|
* Depending on the value of hasComponent, when the specified
|
|
2238
2470
|
* component is found, the test is marked as a success.
|
|
2239
2471
|
*
|
|
2240
|
-
* This function can't be called in
|
|
2472
|
+
* This function can't be called in restricted-execution mode.
|
|
2241
2473
|
*
|
|
2242
2474
|
* @param entityTypeIdentifier
|
|
2243
2475
|
* Type of entity to look for. If no namespace is specified,
|
|
@@ -2266,7 +2498,7 @@ export class Test {
|
|
|
2266
2498
|
* type is found or not found (depending on isPresent), the
|
|
2267
2499
|
* test is marked as a success.
|
|
2268
2500
|
*
|
|
2269
|
-
* This function can't be called in
|
|
2501
|
+
* This function can't be called in restricted-execution mode.
|
|
2270
2502
|
*
|
|
2271
2503
|
* @param entityTypeIdentifier
|
|
2272
2504
|
* Type of entity to test for (e.g., 'minecraft:skeleton'). If
|
|
@@ -2326,7 +2558,7 @@ export class Test {
|
|
|
2326
2558
|
* Triggers a block event from a fixed list of available block
|
|
2327
2559
|
* events.
|
|
2328
2560
|
*
|
|
2329
|
-
* This function can't be called in
|
|
2561
|
+
* This function can't be called in restricted-execution mode.
|
|
2330
2562
|
*
|
|
2331
2563
|
* @param event
|
|
2332
2564
|
* Event to trigger. Valid values include minecraft:drip,
|
|
@@ -2337,6 +2569,8 @@ export class Test {
|
|
|
2337
2569
|
* Defaults to: []
|
|
2338
2570
|
* @throws This function can throw errors.
|
|
2339
2571
|
*
|
|
2572
|
+
* {@link GameTestCompletedError}
|
|
2573
|
+
*
|
|
2340
2574
|
* {@link GameTestError}
|
|
2341
2575
|
*/
|
|
2342
2576
|
triggerInternalBlockEvent(blockLocation: minecraftserver.Vector3, event: string, eventParameters?: number[]): void;
|
|
@@ -2347,10 +2581,13 @@ export class Test {
|
|
|
2347
2581
|
* in conjunction with .assert functions to evaluate that a
|
|
2348
2582
|
* condition is true.
|
|
2349
2583
|
*
|
|
2350
|
-
* This function can't be called in
|
|
2584
|
+
* This function can't be called in restricted-execution mode.
|
|
2351
2585
|
*
|
|
2352
2586
|
* @param callback
|
|
2353
2587
|
* Function with code to evaluate.
|
|
2588
|
+
* @throws This function can throw errors.
|
|
2589
|
+
*
|
|
2590
|
+
* {@link GameTestCompletedError}
|
|
2354
2591
|
*/
|
|
2355
2592
|
until(callback: () => void): Promise<void>;
|
|
2356
2593
|
/**
|
|
@@ -2360,7 +2597,7 @@ export class Test {
|
|
|
2360
2597
|
* have more predictable mob behaviors. Mobs will stop
|
|
2361
2598
|
* navigation as soon as they intersect the target location.
|
|
2362
2599
|
*
|
|
2363
|
-
* This function can't be called in
|
|
2600
|
+
* This function can't be called in restricted-execution mode.
|
|
2364
2601
|
*
|
|
2365
2602
|
* @param mob
|
|
2366
2603
|
* Mob entity to give orders to.
|
|
@@ -2371,6 +2608,8 @@ export class Test {
|
|
|
2371
2608
|
* Defaults to: 1
|
|
2372
2609
|
* @throws This function can throw errors.
|
|
2373
2610
|
*
|
|
2611
|
+
* {@link GameTestCompletedError}
|
|
2612
|
+
*
|
|
2374
2613
|
* {@link GameTestError}
|
|
2375
2614
|
*/
|
|
2376
2615
|
walkTo(mob: minecraftserver.Entity, blockLocation: minecraftserver.Vector3, speedModifier?: number): void;
|
|
@@ -2381,7 +2620,7 @@ export class Test {
|
|
|
2381
2620
|
* have more predictable mob behaviors. Mobs will stop
|
|
2382
2621
|
* navigation as soon as they intersect the target location.
|
|
2383
2622
|
*
|
|
2384
|
-
* This function can't be called in
|
|
2623
|
+
* This function can't be called in restricted-execution mode.
|
|
2385
2624
|
*
|
|
2386
2625
|
* @param mob
|
|
2387
2626
|
* Mob entity to give orders to.
|
|
@@ -2392,6 +2631,8 @@ export class Test {
|
|
|
2392
2631
|
* Defaults to: 1
|
|
2393
2632
|
* @throws This function can throw errors.
|
|
2394
2633
|
*
|
|
2634
|
+
* {@link GameTestCompletedError}
|
|
2635
|
+
*
|
|
2395
2636
|
* {@link GameTestError}
|
|
2396
2637
|
*/
|
|
2397
2638
|
walkToLocation(mob: minecraftserver.Entity, location: minecraftserver.Vector3, speedModifier?: number): void;
|
|
@@ -2408,6 +2649,8 @@ export class Test {
|
|
|
2408
2649
|
* An absolute location relative to the GameTest command block.
|
|
2409
2650
|
* @throws This function can throw errors.
|
|
2410
2651
|
*
|
|
2652
|
+
* {@link GameTestCompletedError}
|
|
2653
|
+
*
|
|
2411
2654
|
* {@link GameTestError}
|
|
2412
2655
|
*/
|
|
2413
2656
|
worldBlockLocation(relativeBlockLocation: minecraftserver.Vector3): minecraftserver.Vector3;
|
|
@@ -2424,6 +2667,8 @@ export class Test {
|
|
|
2424
2667
|
* An absolute location relative to the GameTest command block.
|
|
2425
2668
|
* @throws This function can throw errors.
|
|
2426
2669
|
*
|
|
2670
|
+
* {@link GameTestCompletedError}
|
|
2671
|
+
*
|
|
2427
2672
|
* {@link GameTestError}
|
|
2428
2673
|
*/
|
|
2429
2674
|
worldLocation(relativeLocation: minecraftserver.Vector3): minecraftserver.Vector3;
|
|
@@ -2440,6 +2685,37 @@ export interface MoveToOptions {
|
|
|
2440
2685
|
speed?: number;
|
|
2441
2686
|
}
|
|
2442
2687
|
|
|
2688
|
+
/**
|
|
2689
|
+
* Data pertaining to a specific player Persona piece.
|
|
2690
|
+
*/
|
|
2691
|
+
export interface PlayerPersonaPiece {
|
|
2692
|
+
id: string;
|
|
2693
|
+
isDefaultPiece?: boolean;
|
|
2694
|
+
packId: string;
|
|
2695
|
+
productId: string;
|
|
2696
|
+
type: PersonaPieceType;
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
/**
|
|
2700
|
+
* Data pertaining to a player's configured skin.
|
|
2701
|
+
*/
|
|
2702
|
+
export interface PlayerSkinData {
|
|
2703
|
+
armSize?: PersonaArmSize;
|
|
2704
|
+
personaPieces?: PlayerPersonaPiece[];
|
|
2705
|
+
skinColor?: minecraftserver.RGB;
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2709
|
+
export class GameTestCompletedError extends Error {
|
|
2710
|
+
private constructor();
|
|
2711
|
+
/**
|
|
2712
|
+
* @remarks
|
|
2713
|
+
* This property can be read in early-execution mode.
|
|
2714
|
+
*
|
|
2715
|
+
*/
|
|
2716
|
+
reason: GameTestCompletedErrorReason;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2443
2719
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2444
2720
|
export class GameTestError extends Error {
|
|
2445
2721
|
private constructor();
|
|
@@ -2463,13 +2739,28 @@ export class GameTestError extends Error {
|
|
|
2463
2739
|
type: GameTestErrorType;
|
|
2464
2740
|
}
|
|
2465
2741
|
|
|
2742
|
+
/**
|
|
2743
|
+
* @remarks
|
|
2744
|
+
* Returns data about a player's skin.
|
|
2745
|
+
*
|
|
2746
|
+
* This function can't be called in restricted-execution mode.
|
|
2747
|
+
*
|
|
2748
|
+
* @param player
|
|
2749
|
+
* The player who's skin is returned.
|
|
2750
|
+
* @throws This function can throw errors.
|
|
2751
|
+
*
|
|
2752
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
2753
|
+
*
|
|
2754
|
+
* {@link minecraftserver.InvalidEntityError}
|
|
2755
|
+
*/
|
|
2756
|
+
export function getPlayerSkin(player: minecraftserver.Player): PlayerSkinData;
|
|
2466
2757
|
/**
|
|
2467
2758
|
* @remarks
|
|
2468
2759
|
* Registers a new GameTest function. This GameTest will become
|
|
2469
2760
|
* available in Minecraft via /gametest run
|
|
2470
2761
|
* [testClassName]:[testName].
|
|
2471
2762
|
*
|
|
2472
|
-
* This function can't be called in
|
|
2763
|
+
* This function can't be called in restricted-execution mode.
|
|
2473
2764
|
*
|
|
2474
2765
|
* This function can be called in early-execution mode.
|
|
2475
2766
|
*
|
|
@@ -2515,7 +2806,7 @@ export function register(
|
|
|
2515
2806
|
* asynchronous execution. This GameTest will become available
|
|
2516
2807
|
* in Minecraft via /gametest run [testClassName]:[testName].
|
|
2517
2808
|
*
|
|
2518
|
-
* This function can't be called in
|
|
2809
|
+
* This function can't be called in restricted-execution mode.
|
|
2519
2810
|
*
|
|
2520
2811
|
* This function can be called in early-execution mode.
|
|
2521
2812
|
*
|
|
@@ -2556,3 +2847,58 @@ export function registerAsync(
|
|
|
2556
2847
|
testName: string,
|
|
2557
2848
|
testFunction: (arg0: Test) => Promise<void>,
|
|
2558
2849
|
): RegistrationBuilder;
|
|
2850
|
+
/**
|
|
2851
|
+
* @remarks
|
|
2852
|
+
* Sets a callback that is called after the batch gets called.
|
|
2853
|
+
* This will overwrite previously set callbacks for this batch.
|
|
2854
|
+
*
|
|
2855
|
+
* This function can't be called in restricted-execution mode.
|
|
2856
|
+
*
|
|
2857
|
+
* This function can be called in early-execution mode.
|
|
2858
|
+
*
|
|
2859
|
+
* @param batchName
|
|
2860
|
+
* Name of the batch of tests the callback will run after.
|
|
2861
|
+
* @throws This function can throw errors.
|
|
2862
|
+
*
|
|
2863
|
+
* {@link GameTestError}
|
|
2864
|
+
*/
|
|
2865
|
+
export function setAfterBatchCallback(batchName: string, batchCallback: () => void): void;
|
|
2866
|
+
/**
|
|
2867
|
+
* @remarks
|
|
2868
|
+
* Sets a callback that is called before the batch gets called.
|
|
2869
|
+
* This will overwrite previously set callbacks for this batch.
|
|
2870
|
+
*
|
|
2871
|
+
* This function can't be called in restricted-execution mode.
|
|
2872
|
+
*
|
|
2873
|
+
* This function can be called in early-execution mode.
|
|
2874
|
+
*
|
|
2875
|
+
* @param batchName
|
|
2876
|
+
* Name of the batch of tests the callback will run before.
|
|
2877
|
+
* @throws This function can throw errors.
|
|
2878
|
+
*
|
|
2879
|
+
* {@link GameTestError}
|
|
2880
|
+
*/
|
|
2881
|
+
export function setBeforeBatchCallback(batchName: string, batchCallback: () => void): void;
|
|
2882
|
+
/**
|
|
2883
|
+
* @remarks
|
|
2884
|
+
* Spawns a simulated player that isn't associated to a
|
|
2885
|
+
* specific {@link Test}. You can use {@link
|
|
2886
|
+
* SimulatedPlayer.remove} to remove the player from the world.
|
|
2887
|
+
*
|
|
2888
|
+
* This function can't be called in restricted-execution mode.
|
|
2889
|
+
*
|
|
2890
|
+
* @param location
|
|
2891
|
+
* The location in which to spawn the player.
|
|
2892
|
+
* @param name
|
|
2893
|
+
* The name for the player.
|
|
2894
|
+
* @param gameMode
|
|
2895
|
+
* The game mode for the player.
|
|
2896
|
+
* @throws This function can throw errors.
|
|
2897
|
+
*
|
|
2898
|
+
* {@link minecraftcommon.EngineError}
|
|
2899
|
+
*/
|
|
2900
|
+
export function spawnSimulatedPlayer(
|
|
2901
|
+
location: minecraftserver.DimensionLocation,
|
|
2902
|
+
name: string,
|
|
2903
|
+
gameMode: minecraftserver.GameMode,
|
|
2904
|
+
): SimulatedPlayer;
|