@minecraft/server-gametest 1.0.0-beta.1.20.60-preview.20 → 1.0.0-beta.1.20.60-preview.22
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 +40 -9
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* ```json
|
|
18
18
|
* {
|
|
19
19
|
* "module_name": "@minecraft/server-gametest",
|
|
20
|
-
* "version": "1.0.0-internal.1.20.60-preview.
|
|
20
|
+
* "version": "1.0.0-internal.1.20.60-preview.22"
|
|
21
21
|
* }
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
@@ -37,6 +37,12 @@ export enum GameTestErrorType {
|
|
|
37
37
|
Waiting = 'Waiting',
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
export enum LookDuration {
|
|
41
|
+
Continuous = 'Continuous',
|
|
42
|
+
Instant = 'Instant',
|
|
43
|
+
UntilMove = 'UntilMove',
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
/**
|
|
41
47
|
* Returns information about whether this fence is connected to
|
|
42
48
|
* other fences in several directions.
|
|
@@ -197,6 +203,12 @@ export class GameTestSequence {
|
|
|
197
203
|
thenWaitAfter(delayTicks: number, callback: () => void): GameTestSequence;
|
|
198
204
|
}
|
|
199
205
|
|
|
206
|
+
export class NavigationResult {
|
|
207
|
+
private constructor();
|
|
208
|
+
readonly isFullPath: boolean;
|
|
209
|
+
getPath(): minecraftserver.Vector3[];
|
|
210
|
+
}
|
|
211
|
+
|
|
200
212
|
/**
|
|
201
213
|
* A utility class to set GameTest parameters for a test.
|
|
202
214
|
* Methods can be chained together to set multiple properties.
|
|
@@ -574,7 +586,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
574
586
|
*
|
|
575
587
|
* @throws This function can throw errors.
|
|
576
588
|
*/
|
|
577
|
-
lookAtBlock(blockLocation: minecraftserver.Vector3): void;
|
|
589
|
+
lookAtBlock(blockLocation: minecraftserver.Vector3, duration?: LookDuration): void;
|
|
578
590
|
/**
|
|
579
591
|
* @remarks
|
|
580
592
|
* Rotates the simulated player's head/body to look at the
|
|
@@ -584,7 +596,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
584
596
|
*
|
|
585
597
|
* @throws This function can throw errors.
|
|
586
598
|
*/
|
|
587
|
-
lookAtEntity(entity: minecraftserver.Entity): void;
|
|
599
|
+
lookAtEntity(entity: minecraftserver.Entity, duration?: LookDuration): void;
|
|
588
600
|
/**
|
|
589
601
|
* @remarks
|
|
590
602
|
* Rotates the simulated player's head/body to look at the
|
|
@@ -594,7 +606,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
594
606
|
*
|
|
595
607
|
* @throws This function can throw errors.
|
|
596
608
|
*/
|
|
597
|
-
lookAtLocation(location: minecraftserver.Vector3): void;
|
|
609
|
+
lookAtLocation(location: minecraftserver.Vector3, duration?: LookDuration): void;
|
|
598
610
|
/**
|
|
599
611
|
* @remarks
|
|
600
612
|
* Orders the simulated player to walk in the given direction
|
|
@@ -626,7 +638,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
626
638
|
*
|
|
627
639
|
* @throws This function can throw errors.
|
|
628
640
|
*/
|
|
629
|
-
moveToBlock(blockLocation: minecraftserver.Vector3,
|
|
641
|
+
moveToBlock(blockLocation: minecraftserver.Vector3, options?: MoveToOptions): void;
|
|
630
642
|
/**
|
|
631
643
|
* @remarks
|
|
632
644
|
* Orders the simulated player to move to the given location in
|
|
@@ -637,7 +649,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
637
649
|
*
|
|
638
650
|
* @throws This function can throw errors.
|
|
639
651
|
*/
|
|
640
|
-
moveToLocation(location: minecraftserver.Vector3,
|
|
652
|
+
moveToLocation(location: minecraftserver.Vector3, options?: MoveToOptions): void;
|
|
641
653
|
/**
|
|
642
654
|
* @remarks
|
|
643
655
|
* Orders the simulated player to move to a specific block
|
|
@@ -651,7 +663,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
651
663
|
*
|
|
652
664
|
* @throws This function can throw errors.
|
|
653
665
|
*/
|
|
654
|
-
navigateToBlock(blockLocation: minecraftserver.Vector3, speed?: number):
|
|
666
|
+
navigateToBlock(blockLocation: minecraftserver.Vector3, speed?: number): NavigationResult;
|
|
655
667
|
/**
|
|
656
668
|
* @remarks
|
|
657
669
|
* Will use navigation to follow the selected entity to within
|
|
@@ -662,7 +674,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
662
674
|
*
|
|
663
675
|
* @throws This function can throw errors.
|
|
664
676
|
*/
|
|
665
|
-
navigateToEntity(entity: minecraftserver.Entity, speed?: number):
|
|
677
|
+
navigateToEntity(entity: minecraftserver.Entity, speed?: number): NavigationResult;
|
|
666
678
|
/**
|
|
667
679
|
* @remarks
|
|
668
680
|
* Orders the simulated player to move to a specific location
|
|
@@ -676,7 +688,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
676
688
|
*
|
|
677
689
|
* @throws This function can throw errors.
|
|
678
690
|
*/
|
|
679
|
-
navigateToLocation(location: minecraftserver.Vector3, speed?: number):
|
|
691
|
+
navigateToLocation(location: minecraftserver.Vector3, speed?: number): NavigationResult;
|
|
680
692
|
/**
|
|
681
693
|
* @remarks
|
|
682
694
|
* Use navigation to follow the route provided via the
|
|
@@ -748,6 +760,13 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
748
760
|
* @throws This function can throw errors.
|
|
749
761
|
*/
|
|
750
762
|
setItem(itemStack: minecraftserver.ItemStack, slot: number, selectSlot?: boolean): boolean;
|
|
763
|
+
/**
|
|
764
|
+
* @remarks
|
|
765
|
+
* This function can't be called in read-only mode.
|
|
766
|
+
*
|
|
767
|
+
* @throws This function can throw errors.
|
|
768
|
+
*/
|
|
769
|
+
startBuild(slot?: number): void;
|
|
751
770
|
/**
|
|
752
771
|
* @remarks
|
|
753
772
|
* Stops destroying the block that is currently being hit.
|
|
@@ -757,6 +776,13 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
757
776
|
* @throws This function can throw errors.
|
|
758
777
|
*/
|
|
759
778
|
stopBreakingBlock(): void;
|
|
779
|
+
/**
|
|
780
|
+
* @remarks
|
|
781
|
+
* This function can't be called in read-only mode.
|
|
782
|
+
*
|
|
783
|
+
* @throws This function can throw errors.
|
|
784
|
+
*/
|
|
785
|
+
stopBuild(): void;
|
|
760
786
|
/**
|
|
761
787
|
* @remarks
|
|
762
788
|
* Causes the simulated player to stop flying.
|
|
@@ -2203,6 +2229,11 @@ export interface GameTestErrorContext {
|
|
|
2203
2229
|
tickCount: number;
|
|
2204
2230
|
}
|
|
2205
2231
|
|
|
2232
|
+
export interface MoveToOptions {
|
|
2233
|
+
faceTarget?: boolean;
|
|
2234
|
+
speed?: number;
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2206
2237
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2207
2238
|
export class GameTestError extends Error {
|
|
2208
2239
|
private constructor();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server-gametest",
|
|
3
|
-
"version": "1.0.0-beta.1.20.60-preview.
|
|
3
|
+
"version": "1.0.0-beta.1.20.60-preview.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@minecraft/common": "^1.0.0",
|
|
17
|
-
"@minecraft/server": "^1.
|
|
17
|
+
"@minecraft/server": "^1.8.0-rc.1.20.60-preview.22"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT"
|
|
20
20
|
}
|