@minecraft/server-gametest 1.0.0-beta.1.26.2-stable → 1.0.0-beta.1.26.20-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/README.md +8 -8
- package/index.d.ts +102 -92
- package/package.json +19 -19
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# `@minecraft/server-gametest`
|
|
2
|
-
|
|
3
|
-
The @minecraft/server-gametest module provides scriptable APIs for scaffolding and testing content experiences in Minecraft.
|
|
4
|
-
|
|
5
|
-
## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
|
|
6
|
-
|
|
7
|
-
See full documentation for this module here:
|
|
8
|
-
|
|
1
|
+
# `@minecraft/server-gametest`
|
|
2
|
+
|
|
3
|
+
The @minecraft/server-gametest module provides scriptable APIs for scaffolding and testing content experiences in Minecraft.
|
|
4
|
+
|
|
5
|
+
## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
|
|
6
|
+
|
|
7
|
+
See full documentation for this module here:
|
|
8
|
+
|
|
9
9
|
https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/minecraft-server-gametest
|
package/index.d.ts
CHANGED
|
@@ -409,8 +409,8 @@ export class RegistrationBuilder {
|
|
|
409
409
|
* methods can be called.
|
|
410
410
|
* @example phantomsShouldFlyFromCats.ts
|
|
411
411
|
* ```typescript
|
|
412
|
-
* import { Test, register } from
|
|
413
|
-
* import { MinecraftEntityTypes } from
|
|
412
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
413
|
+
* import { MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
414
414
|
*
|
|
415
415
|
* function phantomsShouldFlyFromCats(test: Test) {
|
|
416
416
|
* test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 });
|
|
@@ -419,8 +419,9 @@ export class RegistrationBuilder {
|
|
|
419
419
|
* test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true);
|
|
420
420
|
* }
|
|
421
421
|
*
|
|
422
|
-
* register(
|
|
423
|
-
*
|
|
422
|
+
* register('MobBehaviorTests', 'phantoms_should_fly_from_cats', phantomsShouldFlyFromCats).structureName(
|
|
423
|
+
* 'gametests:glass_cells'
|
|
424
|
+
* );
|
|
424
425
|
* ```
|
|
425
426
|
*/
|
|
426
427
|
structureName(structureName: string): RegistrationBuilder;
|
|
@@ -438,8 +439,8 @@ export class RegistrationBuilder {
|
|
|
438
439
|
* methods can be called.
|
|
439
440
|
* @example phantomsShouldFlyFromCats.ts
|
|
440
441
|
* ```typescript
|
|
441
|
-
* import { Test, register } from
|
|
442
|
-
* import { MinecraftEntityTypes } from
|
|
442
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
443
|
+
* import { MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
443
444
|
*
|
|
444
445
|
* function phantomsShouldFlyFromCats(test: Test) {
|
|
445
446
|
* test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 });
|
|
@@ -448,8 +449,9 @@ export class RegistrationBuilder {
|
|
|
448
449
|
* test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true);
|
|
449
450
|
* }
|
|
450
451
|
*
|
|
451
|
-
* register(
|
|
452
|
-
*
|
|
452
|
+
* register('MobBehaviorTests', 'phantoms_should_fly_from_cats', phantomsShouldFlyFromCats).structureName(
|
|
453
|
+
* 'gametests:glass_cells'
|
|
454
|
+
* );
|
|
453
455
|
* ```
|
|
454
456
|
*/
|
|
455
457
|
tag(tag: string): RegistrationBuilder;
|
|
@@ -754,6 +756,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
754
756
|
*
|
|
755
757
|
* @param speed
|
|
756
758
|
* Defaults to: 1
|
|
759
|
+
* Bounds: [0, 1]
|
|
757
760
|
* @throws This function can throw errors.
|
|
758
761
|
*/
|
|
759
762
|
move(westEast: number, northSouth: number, speed?: number): void;
|
|
@@ -766,6 +769,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
766
769
|
*
|
|
767
770
|
* @param speed
|
|
768
771
|
* Defaults to: 1
|
|
772
|
+
* Bounds: [0, 1]
|
|
769
773
|
* @throws This function can throw errors.
|
|
770
774
|
*/
|
|
771
775
|
moveRelative(leftRight: number, backwardForward: number, speed?: number): void;
|
|
@@ -811,6 +815,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
811
815
|
*
|
|
812
816
|
* @param speed
|
|
813
817
|
* Defaults to: 1
|
|
818
|
+
* Bounds: [0, 1]
|
|
814
819
|
* @throws This function can throw errors.
|
|
815
820
|
*
|
|
816
821
|
* {@link GameTestError}
|
|
@@ -828,6 +833,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
828
833
|
*
|
|
829
834
|
* @param speed
|
|
830
835
|
* Defaults to: 1
|
|
836
|
+
* Bounds: [0, 1]
|
|
831
837
|
* @throws This function can throw errors.
|
|
832
838
|
*
|
|
833
839
|
* {@link minecraftcommon.InvalidArgumentError}
|
|
@@ -848,6 +854,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
848
854
|
*
|
|
849
855
|
* @param speed
|
|
850
856
|
* Defaults to: 1
|
|
857
|
+
* Bounds: [0, 1]
|
|
851
858
|
* @throws This function can throw errors.
|
|
852
859
|
*
|
|
853
860
|
* {@link GameTestError}
|
|
@@ -868,6 +875,7 @@ export class SimulatedPlayer extends minecraftserver.Player {
|
|
|
868
875
|
* @param speed
|
|
869
876
|
* Net speed to use for doing the navigation.
|
|
870
877
|
* Defaults to: 1
|
|
878
|
+
* Bounds: [0, 1]
|
|
871
879
|
* @throws This function can throw errors.
|
|
872
880
|
*
|
|
873
881
|
* {@link GameTestError}
|
|
@@ -1393,21 +1401,21 @@ export class Test {
|
|
|
1393
1401
|
* import * as gameTest from '@minecraft/server-gametest';
|
|
1394
1402
|
*
|
|
1395
1403
|
* gameTest
|
|
1396
|
-
*
|
|
1397
|
-
*
|
|
1398
|
-
*
|
|
1404
|
+
* .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
|
|
1405
|
+
* const attackerId = 'fox';
|
|
1406
|
+
* const victimId = 'chicken';
|
|
1399
1407
|
*
|
|
1400
|
-
*
|
|
1401
|
-
*
|
|
1408
|
+
* test.spawn(attackerId, { x: 5, y: 2, z: 5 });
|
|
1409
|
+
* const victim = test.spawn(victimId, { x: 2, y: 2, z: 2 });
|
|
1402
1410
|
*
|
|
1403
|
-
*
|
|
1411
|
+
* test.assertEntityInstancePresentInArea(victim, true);
|
|
1404
1412
|
*
|
|
1405
|
-
*
|
|
1406
|
-
*
|
|
1407
|
-
*
|
|
1408
|
-
*
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1413
|
+
* test.succeedWhen(() => {
|
|
1414
|
+
* test.assertEntityInstancePresentInArea(victim, false);
|
|
1415
|
+
* });
|
|
1416
|
+
* })
|
|
1417
|
+
* .maxTicks(400)
|
|
1418
|
+
* .structureName('gametests:mediumglass');
|
|
1411
1419
|
* ```
|
|
1412
1420
|
*/
|
|
1413
1421
|
assertEntityInstancePresentInArea(entity: minecraftserver.Entity, isPresent?: boolean): void;
|
|
@@ -1469,26 +1477,26 @@ export class Test {
|
|
|
1469
1477
|
* import * as gameTest from '@minecraft/server-gametest';
|
|
1470
1478
|
*
|
|
1471
1479
|
* gameTest
|
|
1472
|
-
*
|
|
1473
|
-
*
|
|
1474
|
-
*
|
|
1480
|
+
* .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
|
|
1481
|
+
* const attackerId = 'fox';
|
|
1482
|
+
* const victimId = 'chicken';
|
|
1475
1483
|
*
|
|
1476
|
-
*
|
|
1477
|
-
*
|
|
1484
|
+
* test.spawn(attackerId, { x: 5, y: 2, z: 5 });
|
|
1485
|
+
* test.spawn(victimId, { x: 2, y: 2, z: 2 });
|
|
1478
1486
|
*
|
|
1479
|
-
*
|
|
1487
|
+
* test.assertEntityPresentInArea(victimId, true);
|
|
1480
1488
|
*
|
|
1481
|
-
*
|
|
1482
|
-
*
|
|
1483
|
-
*
|
|
1484
|
-
*
|
|
1485
|
-
*
|
|
1486
|
-
*
|
|
1489
|
+
* test.succeedWhen(() => {
|
|
1490
|
+
* test.assertEntityPresentInArea(victimId, false);
|
|
1491
|
+
* });
|
|
1492
|
+
* })
|
|
1493
|
+
* .maxTicks(400)
|
|
1494
|
+
* .structureName('gametests:mediumglass');
|
|
1487
1495
|
* ```
|
|
1488
1496
|
* @example simpleMobGameTest.ts
|
|
1489
1497
|
* ```typescript
|
|
1490
|
-
* import { Test, register } from
|
|
1491
|
-
* import { MinecraftEntityTypes } from
|
|
1498
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
1499
|
+
* import { MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
1492
1500
|
*
|
|
1493
1501
|
* function simpleMobGameTest(test: Test) {
|
|
1494
1502
|
* const attackerId = MinecraftEntityTypes.Fox;
|
|
@@ -1503,7 +1511,7 @@ export class Test {
|
|
|
1503
1511
|
* test.assertEntityPresentInArea(victimId, false);
|
|
1504
1512
|
* });
|
|
1505
1513
|
* }
|
|
1506
|
-
* register(
|
|
1514
|
+
* register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass');
|
|
1507
1515
|
* ```
|
|
1508
1516
|
*/
|
|
1509
1517
|
assertEntityPresentInArea(entityTypeIdentifier: string, isPresent?: boolean): void;
|
|
@@ -2055,9 +2063,9 @@ export class Test {
|
|
|
2055
2063
|
* {@link GameTestError}
|
|
2056
2064
|
* @example minibiomes.ts
|
|
2057
2065
|
* ```typescript
|
|
2058
|
-
* import { EntityComponentTypes } from
|
|
2059
|
-
* import { Test, register } from
|
|
2060
|
-
* import { MinecraftBlockTypes, MinecraftEntityTypes } from
|
|
2066
|
+
* import { EntityComponentTypes } from '@minecraft/server';
|
|
2067
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
2068
|
+
* import { MinecraftBlockTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
2061
2069
|
*
|
|
2062
2070
|
* function minibiomes(test: Test) {
|
|
2063
2071
|
* const minecart = test.spawn(MinecraftEntityTypes.Minecart, { x: 9, y: 7, z: 7 });
|
|
@@ -2071,7 +2079,7 @@ export class Test {
|
|
|
2071
2079
|
*
|
|
2072
2080
|
* test.succeedWhenEntityPresent(MinecraftEntityTypes.Pig, { x: 8, y: 3, z: 1 }, true);
|
|
2073
2081
|
* }
|
|
2074
|
-
* register(
|
|
2082
|
+
* register('ChallengeTests', 'minibiomes', minibiomes).structureName('gametests:minibiomes').maxTicks(160);
|
|
2075
2083
|
* ```
|
|
2076
2084
|
*/
|
|
2077
2085
|
setBlockType(blockType: minecraftserver.BlockType | string, blockLocation: minecraftserver.Vector3): void;
|
|
@@ -2135,26 +2143,26 @@ export class Test {
|
|
|
2135
2143
|
* import * as gameTest from '@minecraft/server-gametest';
|
|
2136
2144
|
*
|
|
2137
2145
|
* gameTest
|
|
2138
|
-
*
|
|
2139
|
-
*
|
|
2140
|
-
*
|
|
2146
|
+
* .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
|
|
2147
|
+
* const attackerId = 'fox';
|
|
2148
|
+
* const victimId = 'chicken';
|
|
2141
2149
|
*
|
|
2142
|
-
*
|
|
2143
|
-
*
|
|
2150
|
+
* test.spawn(attackerId, { x: 5, y: 2, z: 5 });
|
|
2151
|
+
* test.spawn(victimId, { x: 2, y: 2, z: 2 });
|
|
2144
2152
|
*
|
|
2145
|
-
*
|
|
2153
|
+
* test.assertEntityPresentInArea(victimId, true);
|
|
2146
2154
|
*
|
|
2147
|
-
*
|
|
2148
|
-
*
|
|
2149
|
-
*
|
|
2150
|
-
*
|
|
2151
|
-
*
|
|
2152
|
-
*
|
|
2155
|
+
* test.succeedWhen(() => {
|
|
2156
|
+
* test.assertEntityPresentInArea(victimId, false);
|
|
2157
|
+
* });
|
|
2158
|
+
* })
|
|
2159
|
+
* .maxTicks(400)
|
|
2160
|
+
* .structureName('gametests:mediumglass');
|
|
2153
2161
|
* ```
|
|
2154
2162
|
* @example simpleMobGameTest.ts
|
|
2155
2163
|
* ```typescript
|
|
2156
|
-
* import { Test, register } from
|
|
2157
|
-
* import { MinecraftEntityTypes } from
|
|
2164
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
2165
|
+
* import { MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
2158
2166
|
*
|
|
2159
2167
|
* function simpleMobGameTest(test: Test) {
|
|
2160
2168
|
* const attackerId = MinecraftEntityTypes.Fox;
|
|
@@ -2169,12 +2177,12 @@ export class Test {
|
|
|
2169
2177
|
* test.assertEntityPresentInArea(victimId, false);
|
|
2170
2178
|
* });
|
|
2171
2179
|
* }
|
|
2172
|
-
* register(
|
|
2180
|
+
* register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass');
|
|
2173
2181
|
* ```
|
|
2174
2182
|
* @example phantomsShouldFlyFromCats.ts
|
|
2175
2183
|
* ```typescript
|
|
2176
|
-
* import { Test, register } from
|
|
2177
|
-
* import { MinecraftEntityTypes } from
|
|
2184
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
2185
|
+
* import { MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
2178
2186
|
*
|
|
2179
2187
|
* function phantomsShouldFlyFromCats(test: Test) {
|
|
2180
2188
|
* test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 });
|
|
@@ -2183,14 +2191,15 @@ export class Test {
|
|
|
2183
2191
|
* test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true);
|
|
2184
2192
|
* }
|
|
2185
2193
|
*
|
|
2186
|
-
* register(
|
|
2187
|
-
*
|
|
2194
|
+
* register('MobBehaviorTests', 'phantoms_should_fly_from_cats', phantomsShouldFlyFromCats).structureName(
|
|
2195
|
+
* 'gametests:glass_cells'
|
|
2196
|
+
* );
|
|
2188
2197
|
* ```
|
|
2189
2198
|
* @example minibiomes.ts
|
|
2190
2199
|
* ```typescript
|
|
2191
|
-
* import { EntityComponentTypes } from
|
|
2192
|
-
* import { Test, register } from
|
|
2193
|
-
* import { MinecraftBlockTypes, MinecraftEntityTypes } from
|
|
2200
|
+
* import { EntityComponentTypes } from '@minecraft/server';
|
|
2201
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
2202
|
+
* import { MinecraftBlockTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
2194
2203
|
*
|
|
2195
2204
|
* function minibiomes(test: Test) {
|
|
2196
2205
|
* const minecart = test.spawn(MinecraftEntityTypes.Minecart, { x: 9, y: 7, z: 7 });
|
|
@@ -2204,7 +2213,7 @@ export class Test {
|
|
|
2204
2213
|
*
|
|
2205
2214
|
* test.succeedWhenEntityPresent(MinecraftEntityTypes.Pig, { x: 8, y: 3, z: 1 }, true);
|
|
2206
2215
|
* }
|
|
2207
|
-
* register(
|
|
2216
|
+
* register('ChallengeTests', 'minibiomes', minibiomes).structureName('gametests:minibiomes').maxTicks(160);
|
|
2208
2217
|
* ```
|
|
2209
2218
|
*/
|
|
2210
2219
|
spawn(entityTypeIdentifier: string, blockLocation: minecraftserver.Vector3): minecraftserver.Entity;
|
|
@@ -2414,8 +2423,8 @@ export class Test {
|
|
|
2414
2423
|
* @throws This function can throw errors.
|
|
2415
2424
|
* @example simpleMobGameTest.ts
|
|
2416
2425
|
* ```typescript
|
|
2417
|
-
* import { Test, register } from
|
|
2418
|
-
* import { MinecraftEntityTypes } from
|
|
2426
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
2427
|
+
* import { MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
2419
2428
|
*
|
|
2420
2429
|
* function simpleMobGameTest(test: Test) {
|
|
2421
2430
|
* const attackerId = MinecraftEntityTypes.Fox;
|
|
@@ -2430,7 +2439,7 @@ export class Test {
|
|
|
2430
2439
|
* test.assertEntityPresentInArea(victimId, false);
|
|
2431
2440
|
* });
|
|
2432
2441
|
* }
|
|
2433
|
-
* register(
|
|
2442
|
+
* register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass');
|
|
2434
2443
|
* ```
|
|
2435
2444
|
*/
|
|
2436
2445
|
succeedWhen(callback: () => void): void;
|
|
@@ -2514,8 +2523,8 @@ export class Test {
|
|
|
2514
2523
|
* @throws This function can throw errors.
|
|
2515
2524
|
* @example phantomsShouldFlyFromCats.ts
|
|
2516
2525
|
* ```typescript
|
|
2517
|
-
* import { Test, register } from
|
|
2518
|
-
* import { MinecraftEntityTypes } from
|
|
2526
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
2527
|
+
* import { MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
2519
2528
|
*
|
|
2520
2529
|
* function phantomsShouldFlyFromCats(test: Test) {
|
|
2521
2530
|
* test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 });
|
|
@@ -2524,14 +2533,15 @@ export class Test {
|
|
|
2524
2533
|
* test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true);
|
|
2525
2534
|
* }
|
|
2526
2535
|
*
|
|
2527
|
-
* register(
|
|
2528
|
-
*
|
|
2536
|
+
* register('MobBehaviorTests', 'phantoms_should_fly_from_cats', phantomsShouldFlyFromCats).structureName(
|
|
2537
|
+
* 'gametests:glass_cells'
|
|
2538
|
+
* );
|
|
2529
2539
|
* ```
|
|
2530
2540
|
* @example minibiomes.ts
|
|
2531
2541
|
* ```typescript
|
|
2532
|
-
* import { EntityComponentTypes } from
|
|
2533
|
-
* import { Test, register } from
|
|
2534
|
-
* import { MinecraftBlockTypes, MinecraftEntityTypes } from
|
|
2542
|
+
* import { EntityComponentTypes } from '@minecraft/server';
|
|
2543
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
2544
|
+
* import { MinecraftBlockTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
2535
2545
|
*
|
|
2536
2546
|
* function minibiomes(test: Test) {
|
|
2537
2547
|
* const minecart = test.spawn(MinecraftEntityTypes.Minecart, { x: 9, y: 7, z: 7 });
|
|
@@ -2545,7 +2555,7 @@ export class Test {
|
|
|
2545
2555
|
*
|
|
2546
2556
|
* test.succeedWhenEntityPresent(MinecraftEntityTypes.Pig, { x: 8, y: 3, z: 1 }, true);
|
|
2547
2557
|
* }
|
|
2548
|
-
* register(
|
|
2558
|
+
* register('ChallengeTests', 'minibiomes', minibiomes).structureName('gametests:minibiomes').maxTicks(160);
|
|
2549
2559
|
* ```
|
|
2550
2560
|
*/
|
|
2551
2561
|
succeedWhenEntityPresent(
|
|
@@ -2713,7 +2723,7 @@ export class GameTestCompletedError extends Error {
|
|
|
2713
2723
|
* This property can be read in early-execution mode.
|
|
2714
2724
|
*
|
|
2715
2725
|
*/
|
|
2716
|
-
reason: GameTestCompletedErrorReason;
|
|
2726
|
+
readonly reason: GameTestCompletedErrorReason;
|
|
2717
2727
|
}
|
|
2718
2728
|
|
|
2719
2729
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
@@ -2724,19 +2734,19 @@ export class GameTestError extends Error {
|
|
|
2724
2734
|
* This property can be read in early-execution mode.
|
|
2725
2735
|
*
|
|
2726
2736
|
*/
|
|
2727
|
-
context?: GameTestErrorContext;
|
|
2737
|
+
readonly context?: GameTestErrorContext;
|
|
2728
2738
|
/**
|
|
2729
2739
|
* @remarks
|
|
2730
2740
|
* This property can be read in early-execution mode.
|
|
2731
2741
|
*
|
|
2732
2742
|
*/
|
|
2733
|
-
messageParameters: string[];
|
|
2743
|
+
readonly messageParameters: string[];
|
|
2734
2744
|
/**
|
|
2735
2745
|
* @remarks
|
|
2736
2746
|
* This property can be read in early-execution mode.
|
|
2737
2747
|
*
|
|
2738
2748
|
*/
|
|
2739
|
-
type: GameTestErrorType;
|
|
2749
|
+
readonly type: GameTestErrorType;
|
|
2740
2750
|
}
|
|
2741
2751
|
|
|
2742
2752
|
/**
|
|
@@ -2776,8 +2786,8 @@ export function getPlayerSkin(player: minecraftserver.Player): PlayerSkinData;
|
|
|
2776
2786
|
* builder methods.
|
|
2777
2787
|
* @example simpleMobGameTest.ts
|
|
2778
2788
|
* ```typescript
|
|
2779
|
-
* import { Test, register } from
|
|
2780
|
-
* import { MinecraftEntityTypes } from
|
|
2789
|
+
* import { Test, register } from '@minecraft/server-gametest';
|
|
2790
|
+
* import { MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
2781
2791
|
*
|
|
2782
2792
|
* function simpleMobGameTest(test: Test) {
|
|
2783
2793
|
* const attackerId = MinecraftEntityTypes.Fox;
|
|
@@ -2792,7 +2802,7 @@ export function getPlayerSkin(player: minecraftserver.Player): PlayerSkinData;
|
|
|
2792
2802
|
* test.assertEntityPresentInArea(victimId, false);
|
|
2793
2803
|
* });
|
|
2794
2804
|
* }
|
|
2795
|
-
* register(
|
|
2805
|
+
* register('StarterTests', 'simpleMobTest', simpleMobGameTest).maxTicks(400).structureName('gametests:mediumglass');
|
|
2796
2806
|
* ```
|
|
2797
2807
|
*/
|
|
2798
2808
|
export function register(
|
|
@@ -2825,21 +2835,21 @@ export function register(
|
|
|
2825
2835
|
* import * as gameTest from '@minecraft/server-gametest';
|
|
2826
2836
|
*
|
|
2827
2837
|
* gameTest
|
|
2828
|
-
*
|
|
2829
|
-
*
|
|
2830
|
-
*
|
|
2838
|
+
* .registerAsync('StarterTests', 'simpleMobTest', async (test: gameTest.Test) => {
|
|
2839
|
+
* const attackerId = 'fox';
|
|
2840
|
+
* const victimId = 'chicken';
|
|
2831
2841
|
*
|
|
2832
|
-
*
|
|
2833
|
-
*
|
|
2842
|
+
* test.spawn(attackerId, { x: 5, y: 2, z: 5 });
|
|
2843
|
+
* test.spawn(victimId, { x: 2, y: 2, z: 2 });
|
|
2834
2844
|
*
|
|
2835
|
-
*
|
|
2845
|
+
* test.assertEntityPresentInArea(victimId, true);
|
|
2836
2846
|
*
|
|
2837
|
-
*
|
|
2838
|
-
*
|
|
2839
|
-
*
|
|
2840
|
-
*
|
|
2841
|
-
*
|
|
2842
|
-
*
|
|
2847
|
+
* test.succeedWhen(() => {
|
|
2848
|
+
* test.assertEntityPresentInArea(victimId, false);
|
|
2849
|
+
* });
|
|
2850
|
+
* })
|
|
2851
|
+
* .maxTicks(400)
|
|
2852
|
+
* .structureName('gametests:mediumglass');
|
|
2843
2853
|
* ```
|
|
2844
2854
|
*/
|
|
2845
2855
|
export function registerAsync(
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@minecraft/server-gametest",
|
|
3
|
-
"version": "1.0.0-beta.1.26.
|
|
4
|
-
"description": "",
|
|
5
|
-
"contributors": [
|
|
6
|
-
{
|
|
7
|
-
"name": "Jake Shirley",
|
|
8
|
-
"email": "jake@xbox.com"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name": "Mike Ammerlaan",
|
|
12
|
-
"email": "mikeam@microsoft.com"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"peerDependencies": {
|
|
16
|
-
"@minecraft/common": "^1.0.0",
|
|
17
|
-
"@minecraft/server": "^1.17.0 || ^2.0.0 || ^2.
|
|
18
|
-
},
|
|
19
|
-
"license": "MIT"
|
|
1
|
+
{
|
|
2
|
+
"name": "@minecraft/server-gametest",
|
|
3
|
+
"version": "1.0.0-beta.1.26.20-preview.22",
|
|
4
|
+
"description": "",
|
|
5
|
+
"contributors": [
|
|
6
|
+
{
|
|
7
|
+
"name": "Jake Shirley",
|
|
8
|
+
"email": "jake@xbox.com"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "Mike Ammerlaan",
|
|
12
|
+
"email": "mikeam@microsoft.com"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@minecraft/common": "^1.0.0",
|
|
17
|
+
"@minecraft/server": "^1.17.0 || ^2.0.0 || ^2.8.0-beta.1.26.20-preview.22"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT"
|
|
20
20
|
}
|