@minecraft/server-gametest 1.0.0-beta.1.20.40-preview.20 → 1.0.0-beta.1.20.40-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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +109 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -6,4 +6,4 @@ The @minecraft/server-gametest module provides scriptable APIs for scaffolding a
6
6
 
7
7
  See full documentation for this module here:
8
8
 
9
- https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/@minecraft/server-gametest/@minecraft/server-gametest
9
+ https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/minecraft-server-gametest
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.40-preview.20"
20
+ * "version": "1.0.0-internal.1.20.40-preview.22"
21
21
  * }
22
22
  * ```
23
23
  *
@@ -386,7 +386,10 @@ export class SculkSpreader {
386
386
  * how a player moves throughout the world and to support
387
387
  * testing of how entities and the environment will react to a
388
388
  * player. This type derives much of its structure and methods
389
- * from the {@link @minecraft/server.Player} type.
389
+ * from the {@link @minecraft/server.Player} type. Note that
390
+ * many types of events that may be available for entities more
391
+ * broadly, such as item use events, may not fire in the same
392
+ * capacity for simulated players.
390
393
  */
391
394
  // @ts-ignore Class inheritance allowed for native defined classes
392
395
  export class SimulatedPlayer extends minecraftserver.Player {
@@ -905,6 +908,7 @@ export class Tags {
905
908
  *
906
909
  */
907
910
  static readonly suiteDisabled = 'suite:disabled';
911
+ static readonly suiteNextUpdate = 'suite:nextupdate';
908
912
  }
909
913
 
910
914
  /**
@@ -926,6 +930,8 @@ export class Test {
926
930
  * Message that is passed if the _condition_ does not evaluate
927
931
  * to true.
928
932
  * @throws This function can throw errors.
933
+ *
934
+ * {@link GameTestError}
929
935
  */
930
936
  assert(condition: boolean, message: string): void;
931
937
  /**
@@ -942,6 +948,8 @@ export class Test {
942
948
  * specified type is at the location. If false, tests that a
943
949
  * block of the specified type is not present.
944
950
  * @throws This function can throw errors.
951
+ *
952
+ * {@link GameTestError}
945
953
  */
946
954
  assertBlockPresent(
947
955
  blockType: minecraftserver.BlockType | string,
@@ -960,6 +968,8 @@ export class Test {
960
968
  * Callback function that contains additional tests based on
961
969
  * the block at the specified location.
962
970
  * @throws This function can throw errors.
971
+ *
972
+ * {@link GameTestError}
963
973
  * @example testIfButtonNotPressed.js
964
974
  * ```typescript
965
975
  * test.assertBlockState(buttonPos, (block) => {
@@ -984,6 +994,8 @@ export class Test {
984
994
  * false, tests whether the mob is not able to reach the
985
995
  * location.
986
996
  * @throws This function can throw errors.
997
+ *
998
+ * {@link GameTestError}
987
999
  */
988
1000
  assertCanReachLocation(
989
1001
  mob: minecraftserver.Entity,
@@ -1004,6 +1016,8 @@ export class Test {
1004
1016
  * Location of the block with a container (for example, a
1005
1017
  * chest) to test the contents of.
1006
1018
  * @throws This function can throw errors.
1019
+ *
1020
+ * {@link GameTestError}
1007
1021
  */
1008
1022
  assertContainerContains(itemStack: minecraftserver.ItemStack, blockLocation: minecraftserver.Vector3): void;
1009
1023
  /**
@@ -1015,6 +1029,8 @@ export class Test {
1015
1029
  * Location of the block with a container (for example, a
1016
1030
  * chest) to test is empty of contents.
1017
1031
  * @throws This function can throw errors.
1032
+ *
1033
+ * {@link GameTestError}
1018
1034
  */
1019
1035
  assertContainerEmpty(blockLocation: minecraftserver.Vector3): void;
1020
1036
  /**
@@ -1037,6 +1053,8 @@ export class Test {
1037
1053
  * Whether or not the entity is expected to have the specified
1038
1054
  * armor equipped.
1039
1055
  * @throws This function can throw errors.
1056
+ *
1057
+ * {@link GameTestError}
1040
1058
  * @example horseArmorTest.js
1041
1059
  * ```typescript
1042
1060
  * test.assertEntityHasArmor("minecraft:horse", armorSlotTorso, "diamond_horse_armor", 0, horseLocation, true);
@@ -1069,6 +1087,8 @@ export class Test {
1069
1087
  * Determines whether to test that the component exists, or
1070
1088
  * does not.
1071
1089
  * @throws This function can throw errors.
1090
+ *
1091
+ * {@link GameTestError}
1072
1092
  * @example sheepShearedTest.js
1073
1093
  * ```typescript
1074
1094
  * test.assertEntityHasComponent("minecraft:sheep", "minecraft:is_sheared", entityLoc, false);
@@ -1095,6 +1115,8 @@ export class Test {
1095
1115
  * Whether to test that an entity is present or not present at
1096
1116
  * the specified location.
1097
1117
  * @throws This function can throw errors.
1118
+ *
1119
+ * {@link GameTestError}
1098
1120
  */
1099
1121
  assertEntityInstancePresent(
1100
1122
  entity: minecraftserver.Entity,
@@ -1113,6 +1135,8 @@ export class Test {
1113
1135
  * present in the GameTest area. If false, tests that the
1114
1136
  * specified entity is not present.
1115
1137
  * @throws This function can throw errors.
1138
+ *
1139
+ * {@link GameTestError}
1116
1140
  * @example simpleMobTest.ts
1117
1141
  * ```typescript
1118
1142
  * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
@@ -1155,6 +1179,8 @@ export class Test {
1155
1179
  * specified type is present. If false, tests that an entity of
1156
1180
  * the specified type is not present.
1157
1181
  * @throws This function can throw errors.
1182
+ *
1183
+ * {@link GameTestError}
1158
1184
  */
1159
1185
  assertEntityPresent(
1160
1186
  entityTypeIdentifier: string,
@@ -1176,6 +1202,8 @@ export class Test {
1176
1202
  * specified type is present in the GameTest area. If false,
1177
1203
  * tests that an entity of the specified type is not present.
1178
1204
  * @throws This function can throw errors.
1205
+ *
1206
+ * {@link GameTestError}
1179
1207
  * @example simpleMobTest.ts
1180
1208
  * ```typescript
1181
1209
  * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
@@ -1214,6 +1242,8 @@ export class Test {
1214
1242
  * entity with the specified identifier is found, an exception
1215
1243
  * is thrown.
1216
1244
  * @throws This function can throw errors.
1245
+ *
1246
+ * {@link GameTestError}
1217
1247
  * @example villagerEffectTest.js
1218
1248
  * ```typescript
1219
1249
  * test.assertEntityState(
@@ -1245,6 +1275,8 @@ export class Test {
1245
1275
  * the specified location. If false, tests that an entity is
1246
1276
  * not testing the specified location.
1247
1277
  * @throws This function can throw errors.
1278
+ *
1279
+ * {@link GameTestError}
1248
1280
  */
1249
1281
  assertEntityTouching(entityTypeIdentifier: string, location: minecraftserver.Vector3, isTouching?: boolean): void;
1250
1282
  /**
@@ -1260,6 +1292,8 @@ export class Test {
1260
1292
  * Whether to test that the block at _position_ is expected to
1261
1293
  * be waterlogged.
1262
1294
  * @throws This function can throw errors.
1295
+ *
1296
+ * {@link GameTestError}
1263
1297
  */
1264
1298
  assertIsWaterlogged(blockLocation: minecraftserver.Vector3, isWaterlogged?: boolean): void;
1265
1299
  /**
@@ -1277,6 +1311,8 @@ export class Test {
1277
1311
  * @param count
1278
1312
  * Number of items, at minimum, to look and test for.
1279
1313
  * @throws This function can throw errors.
1314
+ *
1315
+ * {@link GameTestError}
1280
1316
  * @example findFeathers.js
1281
1317
  * ```typescript
1282
1318
  * test.assertItemEntityCountIs(Items.feather, expectedFeatherLoc, 0, 1);
@@ -1306,6 +1342,8 @@ export class Test {
1306
1342
  * specified type is present. If false, tests that an item
1307
1343
  * entity of the specified type is not present.
1308
1344
  * @throws This function can throw errors.
1345
+ *
1346
+ * {@link GameTestError}
1309
1347
  */
1310
1348
  assertItemEntityPresent(
1311
1349
  itemType: minecraftserver.ItemType | string,
@@ -1323,6 +1361,8 @@ export class Test {
1323
1361
  * @param power
1324
1362
  * Expected power level.
1325
1363
  * @throws This function can throw errors.
1364
+ *
1365
+ * {@link GameTestError}
1326
1366
  */
1327
1367
  assertRedstonePower(blockLocation: minecraftserver.Vector3, power: number): void;
1328
1368
  /**
@@ -1336,6 +1376,8 @@ export class Test {
1336
1376
  * @param dropResources
1337
1377
  * Whether to add resources exposed with a particular drop.
1338
1378
  * @throws This function can throw errors.
1379
+ *
1380
+ * {@link GameTestError}
1339
1381
  */
1340
1382
  destroyBlock(blockLocation: minecraftserver.Vector3, dropResources?: boolean): void;
1341
1383
  /**
@@ -1368,6 +1410,8 @@ export class Test {
1368
1410
  * @param blockLocation
1369
1411
  * Location of the block to retrieve.
1370
1412
  * @throws This function can throw errors.
1413
+ *
1414
+ * {@link minecraftserver.GameTestError}
1371
1415
  */
1372
1416
  getBlock(blockLocation: minecraftserver.Vector3): minecraftserver.Block;
1373
1417
  /**
@@ -1375,6 +1419,8 @@ export class Test {
1375
1419
  * Gets the dimension of this test.
1376
1420
  *
1377
1421
  * @throws This function can throw errors.
1422
+ *
1423
+ * {@link minecraftserver.GameTestError}
1378
1424
  */
1379
1425
  getDimension(): minecraftserver.Dimension;
1380
1426
  /**
@@ -1388,6 +1434,8 @@ export class Test {
1388
1434
  * @param blockLocation
1389
1435
  * Location of the block to retrieve.
1390
1436
  * @throws This function can throw errors.
1437
+ *
1438
+ * {@link GameTestError}
1391
1439
  */
1392
1440
  getFenceConnectivity(blockLocation: minecraftserver.Vector3): FenceConnectivity;
1393
1441
  /**
@@ -1399,7 +1447,12 @@ export class Test {
1399
1447
  *
1400
1448
  * @param blockLocation
1401
1449
  * Location of the block to retrieve a sculk spreader from.
1450
+ * @returns
1451
+ * Returns the SculkSpreader or undefined if no SculkSpreader
1452
+ * is present on the block.
1402
1453
  * @throws This function can throw errors.
1454
+ *
1455
+ * {@link GameTestError}
1403
1456
  */
1404
1457
  getSculkSpreader(blockLocation: minecraftserver.Vector3): SculkSpreader | undefined;
1405
1458
  /**
@@ -1428,6 +1481,8 @@ export class Test {
1428
1481
  * This function can't be called in read-only mode.
1429
1482
  *
1430
1483
  * @throws This function can throw errors.
1484
+ *
1485
+ * {@link GameTestError}
1431
1486
  */
1432
1487
  killAllEntities(): void;
1433
1488
  /**
@@ -1435,6 +1490,8 @@ export class Test {
1435
1490
  * This function can't be called in read-only mode.
1436
1491
  *
1437
1492
  * @throws This function can throw errors.
1493
+ *
1494
+ * {@link GameTestError}
1438
1495
  */
1439
1496
  onPlayerJump(mob: minecraftserver.Entity, jumpAmount: number): void;
1440
1497
  /**
@@ -1448,6 +1505,8 @@ export class Test {
1448
1505
  * @throws
1449
1506
  * Will throw an error if a button is not present at the
1450
1507
  * specified position.
1508
+ *
1509
+ * {@link GameTestError}
1451
1510
  */
1452
1511
  pressButton(blockLocation: minecraftserver.Vector3): void;
1453
1512
  /**
@@ -1459,6 +1518,8 @@ export class Test {
1459
1518
  * @param text
1460
1519
  * Message to display.
1461
1520
  * @throws This function can throw errors.
1521
+ *
1522
+ * {@link GameTestError}
1462
1523
  */
1463
1524
  print(text: string): void;
1464
1525
  /**
@@ -1472,6 +1533,8 @@ export class Test {
1472
1533
  * @throws
1473
1534
  * Will throw an error if a lever is not present at the
1474
1535
  * specified position.
1536
+ *
1537
+ * {@link GameTestError}
1475
1538
  */
1476
1539
  pullLever(blockLocation: minecraftserver.Vector3): void;
1477
1540
  /**
@@ -1486,6 +1549,8 @@ export class Test {
1486
1549
  * @param duration
1487
1550
  * Number of ticks to pulse Redstone.
1488
1551
  * @throws This function can throw errors.
1552
+ *
1553
+ * {@link GameTestError}
1489
1554
  */
1490
1555
  pulseRedstone(blockLocation: minecraftserver.Vector3, duration: number): void;
1491
1556
  /**
@@ -1502,6 +1567,8 @@ export class Test {
1502
1567
  * @returns
1503
1568
  * A location relative to the GameTest command block.
1504
1569
  * @throws This function can throw errors.
1570
+ *
1571
+ * {@link minecraftserver.GameTestError}
1505
1572
  */
1506
1573
  relativeBlockLocation(worldBlockLocation: minecraftserver.Vector3): minecraftserver.Vector3;
1507
1574
  /**
@@ -1520,6 +1587,8 @@ export class Test {
1520
1587
  * @returns
1521
1588
  * A location relative to the GameTest command block.
1522
1589
  * @throws This function can throw errors.
1590
+ *
1591
+ * {@link minecraftserver.GameTestError}
1523
1592
  */
1524
1593
  relativeLocation(worldLocation: minecraftserver.Vector3): minecraftserver.Vector3;
1525
1594
  /**
@@ -1547,6 +1616,8 @@ export class Test {
1547
1616
  * test direction; Passing in Direction.north will return the
1548
1617
  * opposite of the test direction, and so on.
1549
1618
  * @throws This function can throw errors.
1619
+ *
1620
+ * {@link minecraftserver.GameTestError}
1550
1621
  */
1551
1622
  rotateDirection(direction: minecraftserver.Direction): minecraftserver.Direction;
1552
1623
  /**
@@ -1554,6 +1625,8 @@ export class Test {
1554
1625
  * This function can't be called in read-only mode.
1555
1626
  *
1556
1627
  * @throws This function can throw errors.
1628
+ *
1629
+ * {@link minecraftserver.GameTestError}
1557
1630
  */
1558
1631
  rotateVector(vector: minecraftserver.Vector3): minecraftserver.Vector3;
1559
1632
  /**
@@ -1598,6 +1671,8 @@ export class Test {
1598
1671
  * @param blockLocation
1599
1672
  * Location of the block to set.
1600
1673
  * @throws This function can throw errors.
1674
+ *
1675
+ * {@link GameTestError}
1601
1676
  */
1602
1677
  setBlockPermutation(blockData: minecraftserver.BlockPermutation, blockLocation: minecraftserver.Vector3): void;
1603
1678
  /**
@@ -1612,6 +1687,8 @@ export class Test {
1612
1687
  * @param blockLocation
1613
1688
  * Location of the block to set.
1614
1689
  * @throws This function can throw errors.
1690
+ *
1691
+ * {@link GameTestError}
1615
1692
  */
1616
1693
  setBlockType(blockType: minecraftserver.BlockType | string, blockLocation: minecraftserver.Vector3): void;
1617
1694
  /**
@@ -1627,6 +1704,8 @@ export class Test {
1627
1704
  * Type of fluid to set. See {@link
1628
1705
  * @minecraft/server-gametest.FluidType} for a list of values.
1629
1706
  * @throws This function can throw errors.
1707
+ *
1708
+ * {@link GameTestError}
1630
1709
  */
1631
1710
  setFluidContainer(location: minecraftserver.Vector3, type: minecraftserver.FluidType): void;
1632
1711
  /**
@@ -1640,6 +1719,8 @@ export class Test {
1640
1719
  * @param fuseLength
1641
1720
  * Length of time, in ticks, before the entity explodes.
1642
1721
  * @throws This function can throw errors.
1722
+ *
1723
+ * {@link GameTestError}
1643
1724
  */
1644
1725
  setTntFuse(entity: minecraftserver.Entity, fuseLength: number): void;
1645
1726
  /**
@@ -1657,6 +1738,8 @@ export class Test {
1657
1738
  * The spawned entity. If the entity cannot be spawned, returns
1658
1739
  * undefined.
1659
1740
  * @throws This function can throw errors.
1741
+ *
1742
+ * {@link minecraftserver.GameTestError}
1660
1743
  * @example simpleMobTest.ts
1661
1744
  * ```typescript
1662
1745
  * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
@@ -1697,6 +1780,8 @@ export class Test {
1697
1780
  * The spawned entity. If the entity cannot be spawned, returns
1698
1781
  * undefined.
1699
1782
  * @throws This function can throw errors.
1783
+ *
1784
+ * {@link minecraftserver.GameTestError}
1700
1785
  * @example spawnAdultPig.js
1701
1786
  * ```typescript
1702
1787
  * test.spawn("minecraft:pig<minecraft:ageable_grow_up>", { x: 1.5, y: 2, z: 1.5 });
@@ -1714,6 +1799,8 @@ export class Test {
1714
1799
  * @param location
1715
1800
  * Location to create the item entity at.
1716
1801
  * @throws This function can throw errors.
1802
+ *
1803
+ * {@link minecraftserver.GameTestError}
1717
1804
  * @example spawnEmeralds.js
1718
1805
  * ```typescript
1719
1806
  * const oneEmerald = new ItemStack(MinecraftItemTypes.Emerald, 1, 0);
@@ -1735,6 +1822,8 @@ export class Test {
1735
1822
  * @param name
1736
1823
  * Name to give the new simulated player.
1737
1824
  * @throws This function can throw errors.
1825
+ *
1826
+ * {@link GameTestError}
1738
1827
  */
1739
1828
  spawnSimulatedPlayer(
1740
1829
  blockLocation: minecraftserver.Vector3,
@@ -1752,6 +1841,8 @@ export class Test {
1752
1841
  * @param blockLocation
1753
1842
  * Location where the entity should be spawned.
1754
1843
  * @throws This function can throw errors.
1844
+ *
1845
+ * {@link minecraftserver.GameTestError}
1755
1846
  */
1756
1847
  spawnWithoutBehaviors(entityTypeIdentifier: string, blockLocation: minecraftserver.Vector3): minecraftserver.Entity;
1757
1848
  /**
@@ -1765,6 +1856,8 @@ export class Test {
1765
1856
  * @param location
1766
1857
  * Location where the entity should be spawned.
1767
1858
  * @throws This function can throw errors.
1859
+ *
1860
+ * {@link minecraftserver.GameTestError}
1768
1861
  */
1769
1862
  spawnWithoutBehaviorsAtLocation(
1770
1863
  entityTypeIdentifier: string,
@@ -1785,6 +1878,8 @@ export class Test {
1785
1878
  * Direction to spread. Use the Minecraft.Direction enum to
1786
1879
  * specify a direction.
1787
1880
  * @throws This function can throw errors.
1881
+ *
1882
+ * {@link GameTestError}
1788
1883
  * @example spreadFromFaceTowardDirection.js
1789
1884
  * ```typescript
1790
1885
  * test.spreadFromFaceTowardDirection({ x: 1, y: 2, z: 1 }, Direction.south, Direction.down);
@@ -1910,6 +2005,8 @@ export class Test {
1910
2005
  * specified type is present. If false, tests that a block of
1911
2006
  * the specified type is not present.
1912
2007
  * @throws This function can throw errors.
2008
+ *
2009
+ * {@link GameTestError}
1913
2010
  */
1914
2011
  succeedWhenBlockPresent(
1915
2012
  blockType: minecraftserver.BlockType | string,
@@ -1983,6 +2080,8 @@ export class Test {
1983
2080
  * minecraft:grow_up, minecraft:grow_down and
1984
2081
  * minecraft:grow_sideways.
1985
2082
  * @throws This function can throw errors.
2083
+ *
2084
+ * {@link GameTestError}
1986
2085
  */
1987
2086
  triggerInternalBlockEvent(blockLocation: minecraftserver.Vector3, event: string, eventParameters?: number[]): void;
1988
2087
  /**
@@ -2014,6 +2113,8 @@ export class Test {
2014
2113
  * @param speedModifier
2015
2114
  * Adjustable modifier to the mob's walking speed.
2016
2115
  * @throws This function can throw errors.
2116
+ *
2117
+ * {@link GameTestError}
2017
2118
  */
2018
2119
  walkTo(mob: minecraftserver.Entity, blockLocation: minecraftserver.Vector3, speedModifier?: number): void;
2019
2120
  /**
@@ -2032,6 +2133,8 @@ export class Test {
2032
2133
  * @param speedModifier
2033
2134
  * Adjustable modifier to the mob's walking speed.
2034
2135
  * @throws This function can throw errors.
2136
+ *
2137
+ * {@link GameTestError}
2035
2138
  */
2036
2139
  walkToLocation(mob: minecraftserver.Entity, location: minecraftserver.Vector3, speedModifier?: number): void;
2037
2140
  /**
@@ -2046,6 +2149,8 @@ export class Test {
2046
2149
  * @returns
2047
2150
  * An absolute location relative to the GameTest command block.
2048
2151
  * @throws This function can throw errors.
2152
+ *
2153
+ * {@link minecraftserver.GameTestError}
2049
2154
  */
2050
2155
  worldBlockLocation(relativeBlockLocation: minecraftserver.Vector3): minecraftserver.Vector3;
2051
2156
  /**
@@ -2060,6 +2165,8 @@ export class Test {
2060
2165
  * @returns
2061
2166
  * An absolute location relative to the GameTest command block.
2062
2167
  * @throws This function can throw errors.
2168
+ *
2169
+ * {@link minecraftserver.GameTestError}
2063
2170
  */
2064
2171
  worldLocation(relativeLocation: minecraftserver.Vector3): minecraftserver.Vector3;
2065
2172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-gametest",
3
- "version": "1.0.0-beta.1.20.40-preview.20",
3
+ "version": "1.0.0-beta.1.20.40-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/server": "^1.6.0-beta.1.20.40-preview.20"
16
+ "@minecraft/server": "^1.7.0-beta.1.20.40-preview.22"
17
17
  },
18
18
  "license": "MIT"
19
19
  }