@minecraft/server-gametest 1.0.0-beta.1.20.70-preview.21 → 1.0.0-beta.1.20.70-preview.24

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.
Files changed (2) hide show
  1. package/index.d.ts +93 -76
  2. 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.70-preview.21"
20
+ * "version": "1.0.0-internal.1.20.70-preview.24"
21
21
  * }
22
22
  * ```
23
23
  *
@@ -733,18 +733,6 @@ export class SimulatedPlayer extends minecraftserver.Player {
733
733
  * @throws This function can throw errors.
734
734
  */
735
735
  setBodyRotation(angleInDegrees: number): void;
736
- /**
737
- * @remarks
738
- * Sets the game mode that the simulated player is operating
739
- * under.
740
- *
741
- * This function can't be called in read-only mode.
742
- *
743
- * @param gameMode
744
- * Game mode to set.
745
- * @throws This function can throw errors.
746
- */
747
- setGameMode(gameMode: minecraftserver.GameMode): void;
748
736
  /**
749
737
  * @remarks
750
738
  * Sets a particular item for the simulated player.
@@ -1191,22 +1179,24 @@ export class Test {
1191
1179
  * {@link GameTestError}
1192
1180
  * @example simpleMobTest.ts
1193
1181
  * ```typescript
1194
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1195
- * const attackerId = "fox";
1196
- * const victimId = "chicken";
1182
+ * import * as gameTest from '@minecraft/server-gametest';
1197
1183
  *
1198
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1199
- * let victim = test.spawn(victimId, { x: 2, y: 2, z: 2 });
1184
+ * gameTest
1185
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
1186
+ * const attackerId = 'fox';
1187
+ * const victimId = 'chicken';
1200
1188
  *
1201
- * test.assertEntityInstancePresentInArea(victim, true);
1189
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1190
+ * const victim = test.spawn(victimId, { x: 2, y: 2, z: 2 });
1202
1191
  *
1203
- * test.succeedWhen(() => {
1204
- * test.assertEntityInstancePresentInArea(victim, false);
1205
- * });
1206
- * })
1207
- * .maxTicks(400)
1208
- * .structureName("gametests:mediumglass");
1192
+ * test.assertEntityInstancePresentInArea(victim, true);
1209
1193
  *
1194
+ * test.succeedWhen(() => {
1195
+ * test.assertEntityInstancePresentInArea(victim, false);
1196
+ * });
1197
+ * })
1198
+ * .maxTicks(400)
1199
+ * .structureName('gametests:mediumglass');
1210
1200
  * ```
1211
1201
  */
1212
1202
  assertEntityInstancePresentInArea(entity: minecraftserver.Entity, isPresent?: boolean): void;
@@ -1258,21 +1248,24 @@ export class Test {
1258
1248
  * {@link GameTestError}
1259
1249
  * @example simpleMobTest.ts
1260
1250
  * ```typescript
1261
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1262
- * const attackerId = "fox";
1263
- * const victimId = "chicken";
1251
+ * import * as gameTest from '@minecraft/server-gametest';
1264
1252
  *
1265
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1266
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1253
+ * gameTest
1254
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
1255
+ * const attackerId = 'fox';
1256
+ * const victimId = 'chicken';
1267
1257
  *
1268
- * test.assertEntityPresentInArea(victimId, true);
1258
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1259
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1269
1260
  *
1270
- * test.succeedWhen(() => {
1271
- * test.assertEntityPresentInArea(victimId, false);
1272
- * });
1273
- * })
1261
+ * test.assertEntityPresentInArea(victimId, true);
1262
+ *
1263
+ * test.succeedWhen(() => {
1264
+ * test.assertEntityPresentInArea(victimId, false);
1265
+ * });
1266
+ * })
1274
1267
  * .maxTicks(400)
1275
- * .structureName("gametests:mediumglass");
1268
+ * .structureName('gametests:mediumglass');
1276
1269
  * ```
1277
1270
  */
1278
1271
  assertEntityPresentInArea(entityTypeIdentifier: string, isPresent?: boolean): void;
@@ -1794,21 +1787,24 @@ export class Test {
1794
1787
  * {@link minecraftserver.GameTestError}
1795
1788
  * @example simpleMobTest.ts
1796
1789
  * ```typescript
1797
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1798
- * const attackerId = "fox";
1799
- * const victimId = "chicken";
1790
+ * import * as gameTest from '@minecraft/server-gametest';
1791
+ *
1792
+ * gameTest
1793
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
1794
+ * const attackerId = 'fox';
1795
+ * const victimId = 'chicken';
1800
1796
  *
1801
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1802
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1797
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1798
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1803
1799
  *
1804
- * test.assertEntityPresentInArea(victimId, true);
1800
+ * test.assertEntityPresentInArea(victimId, true);
1805
1801
  *
1806
- * test.succeedWhen(() => {
1807
- * test.assertEntityPresentInArea(victimId, false);
1808
- * });
1809
- * })
1802
+ * test.succeedWhen(() => {
1803
+ * test.assertEntityPresentInArea(victimId, false);
1804
+ * });
1805
+ * })
1810
1806
  * .maxTicks(400)
1811
- * .structureName("gametests:mediumglass");
1807
+ * .structureName('gametests:mediumglass');
1812
1808
  * ```
1813
1809
  * @example spawnAdultPig.js
1814
1810
  * ```typescript
@@ -2021,21 +2017,24 @@ export class Test {
2021
2017
  * @throws This function can throw errors.
2022
2018
  * @example simpleMobTest.ts
2023
2019
  * ```typescript
2024
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
2025
- * const attackerId = "fox";
2026
- * const victimId = "chicken";
2020
+ * import * as gameTest from '@minecraft/server-gametest';
2027
2021
  *
2028
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2029
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2022
+ * gameTest
2023
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
2024
+ * const attackerId = 'fox';
2025
+ * const victimId = 'chicken';
2030
2026
  *
2031
- * test.assertEntityPresentInArea(victimId, true);
2027
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2028
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2032
2029
  *
2033
- * test.succeedWhen(() => {
2034
- * test.assertEntityPresentInArea(victimId, false);
2035
- * });
2036
- * })
2030
+ * test.assertEntityPresentInArea(victimId, true);
2031
+ *
2032
+ * test.succeedWhen(() => {
2033
+ * test.assertEntityPresentInArea(victimId, false);
2034
+ * });
2035
+ * })
2037
2036
  * .maxTicks(400)
2038
- * .structureName("gametests:mediumglass");
2037
+ * .structureName('gametests:mediumglass');
2039
2038
  * ```
2040
2039
  */
2041
2040
  succeedWhen(callback: () => void): void;
@@ -2260,29 +2259,26 @@ export class GameTestError extends Error {
2260
2259
  * Returns a {@link RegistrationBuilder} object where
2261
2260
  * additional options for this test can be specified via
2262
2261
  * builder methods.
2263
- * @example example1.js
2264
- * ```typescript
2265
- * GameTest.register("ExampleTests", "alwaysFail", (test) => {
2266
- * test.fail("This test, runnable via '/gametest run ExampleTests:alwaysFail', will always fail");
2267
- * });
2268
- * ```
2269
2262
  * @example simpleMobTest.ts
2270
2263
  * ```typescript
2271
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
2272
- * const attackerId = "fox";
2273
- * const victimId = "chicken";
2264
+ * import * as gameTest from '@minecraft/server-gametest';
2274
2265
  *
2275
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2276
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2266
+ * gameTest
2267
+ * .register('StarterTests', 'simpleMobTest', (test: gameTest.Test) => {
2268
+ * const attackerId = 'fox';
2269
+ * const victimId = 'chicken';
2277
2270
  *
2278
- * test.assertEntityPresentInArea(victimId, true);
2271
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2272
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2279
2273
  *
2280
- * test.succeedWhen(() => {
2281
- * test.assertEntityPresentInArea(victimId, false);
2282
- * });
2283
- * })
2284
- * .maxTicks(400)
2285
- * .structureName("gametests:mediumglass");
2274
+ * test.assertEntityPresentInArea(victimId, true);
2275
+ *
2276
+ * test.succeedWhen(() => {
2277
+ * test.assertEntityPresentInArea(victimId, false);
2278
+ * });
2279
+ * })
2280
+ * .maxTicks(400)
2281
+ * .structureName('gametests:mediumglass');
2286
2282
  * ```
2287
2283
  */
2288
2284
  export function register(
@@ -2308,6 +2304,27 @@ export function register(
2308
2304
  * Returns a {@link RegistrationBuilder} object where
2309
2305
  * additional options for this test can be specified via
2310
2306
  * builder methods.
2307
+ * @example simpleMobAsyncTest.ts
2308
+ * ```typescript
2309
+ * import * as gameTest from '@minecraft/server-gametest';
2310
+ *
2311
+ * gameTest
2312
+ * .registerAsync('StarterTests', 'simpleMobTest', async (test: gameTest.Test) => {
2313
+ * const attackerId = 'fox';
2314
+ * const victimId = 'chicken';
2315
+ *
2316
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2317
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2318
+ *
2319
+ * test.assertEntityPresentInArea(victimId, true);
2320
+ *
2321
+ * test.succeedWhen(() => {
2322
+ * test.assertEntityPresentInArea(victimId, false);
2323
+ * });
2324
+ * })
2325
+ * .maxTicks(400)
2326
+ * .structureName('gametests:mediumglass');
2327
+ * ```
2311
2328
  */
2312
2329
  export function registerAsync(
2313
2330
  testClassName: string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-gametest",
3
- "version": "1.0.0-beta.1.20.70-preview.21",
3
+ "version": "1.0.0-beta.1.20.70-preview.24",
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.8.0-rc.1.20.70-preview.21"
17
+ "@minecraft/server": "^1.8.0"
18
18
  },
19
19
  "license": "MIT"
20
20
  }