@minecraft/server-gametest 1.0.0-beta.1.20.0-preview.23 → 1.0.0-beta.1.20.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.
Files changed (2) hide show
  1. package/index.d.ts +82 -97
  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.0-preview.23"
20
+ * "version": "1.0.0-internal.1.20.0-preview.25"
21
21
  * }
22
22
  * ```
23
23
  *
@@ -903,10 +903,9 @@ export class Test {
903
903
  * @throws This function can throw errors.
904
904
  * @example testIfButtonNotPressed.js
905
905
  * ```typescript
906
- * test.assertBlockState(buttonPos, (block) => {
907
- * return block.permutation.getProperty("button_pressed_bit") == 0;
908
- * });
909
- *
906
+ * test.assertBlockState(buttonPos, (block) => {
907
+ * return block.permutation.getProperty("button_pressed_bit") == 0;
908
+ * });
910
909
  * ```
911
910
  */
912
911
  assertBlockState(blockLocation: minecraftserver.Vector3, callback: (arg: minecraftserver.Block) => boolean): void;
@@ -981,8 +980,7 @@ export class Test {
981
980
  * @throws This function can throw errors.
982
981
  * @example horseArmorTest.js
983
982
  * ```typescript
984
- * test.assertEntityHasArmor("minecraft:horse", armorSlotTorso, "diamond_horse_armor", 0, horseLocation, true);
985
- *
983
+ * test.assertEntityHasArmor("minecraft:horse", armorSlotTorso, "diamond_horse_armor", 0, horseLocation, true);
986
984
  * ```
987
985
  */
988
986
  assertEntityHasArmor(
@@ -1014,8 +1012,7 @@ export class Test {
1014
1012
  * @throws This function can throw errors.
1015
1013
  * @example sheepShearedTest.js
1016
1014
  * ```typescript
1017
- * test.assertEntityHasComponent("minecraft:sheep", "minecraft:is_sheared", entityLoc, false);
1018
- *
1015
+ * test.assertEntityHasComponent("minecraft:sheep", "minecraft:is_sheared", entityLoc, false);
1019
1016
  * ```
1020
1017
  */
1021
1018
  assertEntityHasComponent(
@@ -1059,22 +1056,21 @@ export class Test {
1059
1056
  * @throws This function can throw errors.
1060
1057
  * @example simpleMobTest.ts
1061
1058
  * ```typescript
1062
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1063
- * const attackerId = "fox";
1064
- * const victimId = "chicken";
1065
- *
1066
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1067
- * let victim = test.spawn(victimId, { x: 2, y: 2, z: 2 });
1059
+ * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1060
+ * const attackerId = "fox";
1061
+ * const victimId = "chicken";
1068
1062
  *
1069
- * test.assertEntityInstancePresentInArea(victim, true);
1063
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1064
+ * let victim = test.spawn(victimId, { x: 2, y: 2, z: 2 });
1070
1065
  *
1071
- * test.succeedWhen(() => {
1072
- * test.assertEntityInstancePresentInArea(victim, false);
1073
- * });
1074
- * })
1075
- * .maxTicks(400)
1076
- * .structureName("gametests:mediumglass");
1066
+ * test.assertEntityInstancePresentInArea(victim, true);
1077
1067
  *
1068
+ * test.succeedWhen(() => {
1069
+ * test.assertEntityInstancePresentInArea(victim, false);
1070
+ * });
1071
+ * })
1072
+ * .maxTicks(400)
1073
+ * .structureName("gametests:mediumglass");
1078
1074
  *
1079
1075
  * ```
1080
1076
  */
@@ -1123,22 +1119,21 @@ export class Test {
1123
1119
  * @throws This function can throw errors.
1124
1120
  * @example simpleMobTest.ts
1125
1121
  * ```typescript
1126
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1127
- * const attackerId = "fox";
1128
- * const victimId = "chicken";
1122
+ * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1123
+ * const attackerId = "fox";
1124
+ * const victimId = "chicken";
1129
1125
  *
1130
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1131
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1126
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1127
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1132
1128
  *
1133
- * test.assertEntityPresentInArea(victimId, true);
1134
- *
1135
- * test.succeedWhen(() => {
1136
- * test.assertEntityPresentInArea(victimId, false);
1137
- * });
1138
- * })
1139
- * .maxTicks(400)
1140
- * .structureName("gametests:mediumglass");
1129
+ * test.assertEntityPresentInArea(victimId, true);
1141
1130
  *
1131
+ * test.succeedWhen(() => {
1132
+ * test.assertEntityPresentInArea(victimId, false);
1133
+ * });
1134
+ * })
1135
+ * .maxTicks(400)
1136
+ * .structureName("gametests:mediumglass");
1142
1137
  *
1143
1138
  * ```
1144
1139
  */
@@ -1163,12 +1158,11 @@ export class Test {
1163
1158
  * @throws This function can throw errors.
1164
1159
  * @example villagerEffectTest.js
1165
1160
  * ```typescript
1166
- * test.assertEntityState(
1167
- * villagerPos,
1168
- * "minecraft:villager_v2",
1169
- * (entity) => entity.getEffect(MinecraftEffectTypes.regeneration).duration > 120
1170
- * ); // At least 6 seconds remaining in the villagers' effect
1171
- *
1161
+ * test.assertEntityState(
1162
+ * villagerPos,
1163
+ * "minecraft:villager_v2",
1164
+ * (entity) => entity.getEffect(MinecraftEffectTypes.regeneration).duration > 120
1165
+ * ); // At least 6 seconds remaining in the villagers' effect
1172
1166
  * ```
1173
1167
  */
1174
1168
  assertEntityState(
@@ -1227,8 +1221,7 @@ export class Test {
1227
1221
  * @throws This function can throw errors.
1228
1222
  * @example findFeathers.js
1229
1223
  * ```typescript
1230
- * test.assertItemEntityCountIs(Items.feather, expectedFeatherLoc, 0, 1);
1231
- *
1224
+ * test.assertItemEntityCountIs(Items.feather, expectedFeatherLoc, 0, 1);
1232
1225
  * ```
1233
1226
  */
1234
1227
  assertItemEntityCountIs(
@@ -1608,27 +1601,25 @@ export class Test {
1608
1601
  * @throws This function can throw errors.
1609
1602
  * @example simpleMobTest.ts
1610
1603
  * ```typescript
1611
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1612
- * const attackerId = "fox";
1613
- * const victimId = "chicken";
1614
- *
1615
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1616
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1604
+ * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1605
+ * const attackerId = "fox";
1606
+ * const victimId = "chicken";
1617
1607
  *
1618
- * test.assertEntityPresentInArea(victimId, true);
1608
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1609
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1619
1610
  *
1620
- * test.succeedWhen(() => {
1621
- * test.assertEntityPresentInArea(victimId, false);
1622
- * });
1623
- * })
1624
- * .maxTicks(400)
1625
- * .structureName("gametests:mediumglass");
1611
+ * test.assertEntityPresentInArea(victimId, true);
1626
1612
  *
1613
+ * test.succeedWhen(() => {
1614
+ * test.assertEntityPresentInArea(victimId, false);
1615
+ * });
1616
+ * })
1617
+ * .maxTicks(400)
1618
+ * .structureName("gametests:mediumglass");
1627
1619
  * ```
1628
1620
  * @example spawnAdultPig.js
1629
1621
  * ```typescript
1630
- * test.spawn("minecraft:pig<minecraft:ageable_grow_up>", { x: 1, y: 2, z: 1 });
1631
- *
1622
+ * test.spawn("minecraft:pig<minecraft:ageable_grow_up>", { x: 1, y: 2, z: 1 });
1632
1623
  *
1633
1624
  * ```
1634
1625
  */
@@ -1650,8 +1641,7 @@ export class Test {
1650
1641
  * @throws This function can throw errors.
1651
1642
  * @example spawnAdultPig.js
1652
1643
  * ```typescript
1653
- * test.spawn("minecraft:pig<minecraft:ageable_grow_up>", { x: 1.5, y: 2, z: 1.5 });
1654
- *
1644
+ * test.spawn("minecraft:pig<minecraft:ageable_grow_up>", { x: 1.5, y: 2, z: 1.5 });
1655
1645
  * ```
1656
1646
  */
1657
1647
  spawnAtLocation(entityTypeIdentifier: string, location: minecraftserver.Vector3): minecraftserver.Entity;
@@ -1668,12 +1658,11 @@ export class Test {
1668
1658
  * @throws This function can throw errors.
1669
1659
  * @example spawnEmeralds.js
1670
1660
  * ```typescript
1671
- * const oneEmerald = new ItemStack(MinecraftItemTypes.emerald, 1, 0);
1672
- * const fiveEmeralds = new ItemStack(MinecraftItemTypes.emerald, 5, 0);
1673
- *
1674
- * test.spawnItem(oneEmerald, { x: 3.5, y: 3, z: 1.5 });
1675
- * test.spawnItem(fiveEmeralds, { x: 1.5, y: 3, z: 1.5 });
1661
+ * const oneEmerald = new ItemStack(MinecraftItemTypes.emerald, 1, 0);
1662
+ * const fiveEmeralds = new ItemStack(MinecraftItemTypes.emerald, 5, 0);
1676
1663
  *
1664
+ * test.spawnItem(oneEmerald, { x: 3.5, y: 3, z: 1.5 });
1665
+ * test.spawnItem(fiveEmeralds, { x: 1.5, y: 3, z: 1.5 });
1677
1666
  *
1678
1667
  * ```
1679
1668
  */
@@ -1741,8 +1730,7 @@ export class Test {
1741
1730
  * @throws This function can throw errors.
1742
1731
  * @example spreadFromFaceTowardDirection.js
1743
1732
  * ```typescript
1744
- * test.spreadFromFaceTowardDirection({ x: 1, y: 2, z: 1 }, Direction.south, Direction.down);
1745
- *
1733
+ * test.spreadFromFaceTowardDirection({ x: 1, y: 2, z: 1 }, Direction.south, Direction.down);
1746
1734
  * ```
1747
1735
  */
1748
1736
  spreadFromFaceTowardDirection(
@@ -1829,22 +1817,21 @@ export class Test {
1829
1817
  * @throws This function can throw errors.
1830
1818
  * @example simpleMobTest.ts
1831
1819
  * ```typescript
1832
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1833
- * const attackerId = "fox";
1834
- * const victimId = "chicken";
1820
+ * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
1821
+ * const attackerId = "fox";
1822
+ * const victimId = "chicken";
1835
1823
  *
1836
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1837
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1824
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
1825
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
1838
1826
  *
1839
- * test.assertEntityPresentInArea(victimId, true);
1840
- *
1841
- * test.succeedWhen(() => {
1842
- * test.assertEntityPresentInArea(victimId, false);
1843
- * });
1844
- * })
1845
- * .maxTicks(400)
1846
- * .structureName("gametests:mediumglass");
1827
+ * test.assertEntityPresentInArea(victimId, true);
1847
1828
  *
1829
+ * test.succeedWhen(() => {
1830
+ * test.assertEntityPresentInArea(victimId, false);
1831
+ * });
1832
+ * })
1833
+ * .maxTicks(400)
1834
+ * .structureName("gametests:mediumglass");
1848
1835
  *
1849
1836
  * ```
1850
1837
  */
@@ -2054,29 +2041,27 @@ export class GameTestError extends Error {
2054
2041
  * builder methods.
2055
2042
  * @example example1.js
2056
2043
  * ```typescript
2057
- * GameTest.register("ExampleTests", "alwaysFail", (test) => {
2058
- * test.fail("This test, runnable via '/gametest run ExampleTests:alwaysFail', will always fail");
2059
- * });
2060
- *
2044
+ * GameTest.register("ExampleTests", "alwaysFail", (test) => {
2045
+ * test.fail("This test, runnable via '/gametest run ExampleTests:alwaysFail', will always fail");
2046
+ * });
2061
2047
  * ```
2062
2048
  * @example simpleMobTest.ts
2063
2049
  * ```typescript
2064
- * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
2065
- * const attackerId = "fox";
2066
- * const victimId = "chicken";
2067
- *
2068
- * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2069
- * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2050
+ * gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
2051
+ * const attackerId = "fox";
2052
+ * const victimId = "chicken";
2070
2053
  *
2071
- * test.assertEntityPresentInArea(victimId, true);
2054
+ * test.spawn(attackerId, { x: 5, y: 2, z: 5 });
2055
+ * test.spawn(victimId, { x: 2, y: 2, z: 2 });
2072
2056
  *
2073
- * test.succeedWhen(() => {
2074
- * test.assertEntityPresentInArea(victimId, false);
2075
- * });
2076
- * })
2077
- * .maxTicks(400)
2078
- * .structureName("gametests:mediumglass");
2057
+ * test.assertEntityPresentInArea(victimId, true);
2079
2058
  *
2059
+ * test.succeedWhen(() => {
2060
+ * test.assertEntityPresentInArea(victimId, false);
2061
+ * });
2062
+ * })
2063
+ * .maxTicks(400)
2064
+ * .structureName("gametests:mediumglass");
2080
2065
  * ```
2081
2066
  */
2082
2067
  export function register(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-gametest",
3
- "version": "1.0.0-beta.1.20.0-preview.23",
3
+ "version": "1.0.0-beta.1.20.0-preview.25",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/server": "1.3.0-beta.1.20.0-preview.23"
16
+ "@minecraft/server": "1.3.0-beta.1.20.0-preview.25"
17
17
  },
18
18
  "license": "MIT"
19
19
  }