@minecraft/server 1.3.0-beta.1.20.0-preview.23 → 1.3.0-beta.1.20.0-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 +482 -88
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * ```json
17
17
  * {
18
18
  * "module_name": "@minecraft/server",
19
- * "version": "1.3.0-internal.1.20.0-preview.23"
19
+ * "version": "1.3.0-internal.1.20.0-preview.24"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -1072,6 +1072,21 @@ export class BlockLiquidContainerComponent extends BlockComponent {
1072
1072
 
1073
1073
  /**
1074
1074
  * @beta
1075
+ * A BlockLocationIterator returns the next block location of
1076
+ * the block volume across which it is iterating.
1077
+ * The BlockLocationIterator is used to abstract the shape of
1078
+ * the block volume it was fetched from (so it can represent
1079
+ * all the block locations that make up rectangles, cubes,
1080
+ * spheres, lines and complex shapes).
1081
+ * Each iteration pass returns the next valid block location in
1082
+ * the parent shape.
1083
+ * Unless otherwise specified by the parent shape - the
1084
+ * BlockLocationIterator will iterate over a 3D space in the
1085
+ * order of increasing X, followed by increasing Z followed by
1086
+ * increasing Y.
1087
+ * (Effectively stepping across the XZ plane, and when all the
1088
+ * locations in that plane are exhausted, increasing the Y
1089
+ * coordinate to the next XZ slice)
1075
1090
  */
1076
1091
  export class BlockLocationIterator implements Iterable<Vector3> {
1077
1092
  protected constructor();
@@ -1575,79 +1590,139 @@ export class BlockType {
1575
1590
 
1576
1591
  /**
1577
1592
  * @beta
1593
+ * Block Volume Utils is a utility class that provides a number
1594
+ * of useful functions for the creation and utility of {@link
1595
+ * @minecraft-server.BlockVolume} objects
1578
1596
  */
1579
1597
  export class BlockVolumeUtils {
1580
1598
  protected constructor();
1581
1599
  /**
1582
1600
  * @remarks
1601
+ * Check to see if the given location is directly adjacent to
1602
+ * the outer surface of a BlockVolume.
1603
+ *
1604
+ *
1583
1605
  * This function can't be called in read-only mode.
1584
1606
  *
1607
+ * @param volume
1608
+ * The volume to test against
1609
+ * @param pos
1610
+ * The world block location to test
1611
+ * @returns
1612
+ * If the location is either inside or more than 0 blocks away,
1613
+ * the function will return false.
1614
+ * If the location is directly contacting the outer surface of
1615
+ * the BlockVolume, the function will return true.
1585
1616
  */
1586
1617
  static doesLocationTouchFaces(volume: BlockVolume, pos: Vector3): boolean;
1587
1618
  /**
1588
1619
  * @remarks
1620
+ * Check to see if a two block volumes are directly adjacent
1621
+ * and two faces touch.
1622
+ *
1589
1623
  * This function can't be called in read-only mode.
1590
1624
  *
1625
+ * @param volume
1626
+ * The volume to test against
1627
+ * @param other
1628
+ * The volume to test
1629
+ * @returns
1630
+ * If the outer faces of both block volumes touch and are
1631
+ * directly adjacent at any point, return true.
1591
1632
  */
1592
1633
  static doesVolumeTouchFaces(volume: BlockVolume, other: BlockVolume): boolean;
1593
1634
  /**
1594
1635
  * @remarks
1636
+ * Test the equality of two block volumes
1637
+ *
1595
1638
  * This function can't be called in read-only mode.
1596
1639
  *
1640
+ * @returns
1641
+ * Return true if two block volumes are identical
1597
1642
  */
1598
1643
  static equals(volume: BlockVolume, other: BlockVolume): boolean;
1599
1644
  /**
1600
1645
  * @remarks
1646
+ * Fetch a {@link BlockLocationIterator} that represents all of
1647
+ * the block world locations within the specified volume
1648
+ *
1601
1649
  * This function can't be called in read-only mode.
1602
1650
  *
1603
1651
  */
1604
1652
  static getBlockLocationIterator(volume: BlockVolume): BlockLocationIterator;
1605
1653
  /**
1606
1654
  * @remarks
1655
+ * Return a {@link BoundingBox} object which represents the
1656
+ * validated min and max coordinates of the volume
1657
+ *
1607
1658
  * This function can't be called in read-only mode.
1608
1659
  *
1609
1660
  */
1610
1661
  static getBoundingBox(volume: BlockVolume): BoundingBox;
1611
1662
  /**
1612
1663
  * @remarks
1664
+ * Return the capacity (volume) of the BlockVolume (W*D*H)
1665
+ *
1613
1666
  * This function can't be called in read-only mode.
1614
1667
  *
1615
1668
  */
1616
1669
  static getCapacity(volume: BlockVolume): number;
1617
1670
  /**
1618
1671
  * @remarks
1672
+ * Get the largest corner position of the volume (guaranteed to
1673
+ * be >= min)
1674
+ *
1619
1675
  * This function can't be called in read-only mode.
1620
1676
  *
1621
1677
  */
1622
1678
  static getMax(volume: BlockVolume): Vector3;
1623
1679
  /**
1624
1680
  * @remarks
1681
+ * Get the smallest corner position of the volume (guaranteed
1682
+ * to be <= max)
1683
+ *
1625
1684
  * This function can't be called in read-only mode.
1626
1685
  *
1627
1686
  */
1628
1687
  static getMin(volume: BlockVolume): Vector3;
1629
1688
  /**
1630
1689
  * @remarks
1690
+ * Get a {@link Vector3} object where each component represents
1691
+ * the number of blocks along that axis
1692
+ *
1631
1693
  * This function can't be called in read-only mode.
1632
1694
  *
1633
1695
  */
1634
1696
  static getSpan(volume: BlockVolume): Vector3;
1635
1697
  /**
1636
1698
  * @remarks
1699
+ * Return an enumeration which represents the intersection
1700
+ * between two BlockVolume objects
1701
+ *
1637
1702
  * This function can't be called in read-only mode.
1638
1703
  *
1639
1704
  */
1640
1705
  static intersects(volume: BlockVolume, other: BlockVolume): BlockVolumeIntersection;
1641
1706
  /**
1642
1707
  * @remarks
1708
+ * Check to see if a given world block location is inside a
1709
+ * BlockVolume
1710
+ *
1643
1711
  * This function can't be called in read-only mode.
1644
1712
  *
1645
1713
  */
1646
1714
  static isInside(volume: BlockVolume, pos: Vector3): number;
1647
1715
  /**
1648
1716
  * @remarks
1717
+ * Move a BlockVolume by a specified amount
1718
+ *
1649
1719
  * This function can't be called in read-only mode.
1650
1720
  *
1721
+ * @param delta
1722
+ * Amount of blocks to move by
1723
+ * @returns
1724
+ * Returns a new BlockVolume object which represents the new
1725
+ * volume
1651
1726
  */
1652
1727
  static translate(volume: BlockVolume, delta: Vector3): BlockVolume;
1653
1728
  }
@@ -1697,41 +1772,86 @@ export class BlockWaterContainerComponent extends BlockLiquidContainerComponent
1697
1772
 
1698
1773
  /**
1699
1774
  * @beta
1775
+ * Bounding Box Utils is a utility class that provides a number
1776
+ * of useful functions for the creation and utility of {@link
1777
+ * @minecraft-server.BoundingBox} objects
1700
1778
  */
1701
1779
  export class BoundingBoxUtils {
1702
1780
  protected constructor();
1703
1781
  /**
1704
1782
  * @remarks
1783
+ * Create a validated instance of a {@link
1784
+ * @minecraft-server.BoundingBox} where the min and max
1785
+ * components are guaranteed to be (min <= max)
1786
+ *
1705
1787
  * This function can't be called in read-only mode.
1706
1788
  *
1789
+ * @param min
1790
+ * A corner world location
1791
+ * @param max
1792
+ * A corner world location diametrically opposite
1707
1793
  */
1708
1794
  static createValid(min: Vector3, max: Vector3): BoundingBox;
1709
1795
  /**
1710
1796
  * @remarks
1797
+ * Expand a {@link @minecraft-server.BoundingBox} by a given
1798
+ * amount along each axis.
1799
+ * Sizes can be negative to perform contraction.
1800
+ * Note: corners can be inverted if the contraction size is
1801
+ * greater than the span, but the min/max relationship will
1802
+ * remain correct
1803
+ *
1711
1804
  * This function can't be called in read-only mode.
1712
1805
  *
1806
+ * @returns
1807
+ * Return a new {@link @minecraft-server.BoundingBox} object
1808
+ * representing the changes
1713
1809
  */
1714
1810
  static dilate(box: BoundingBox, size: Vector3): BoundingBox;
1715
1811
  /**
1716
1812
  * @remarks
1813
+ * Check if two {@link @minecraft-server.BoundingBox} objects
1814
+ * are identical
1815
+ *
1717
1816
  * This function can't be called in read-only mode.
1718
1817
  *
1719
1818
  */
1720
1819
  static equals(box: BoundingBox, other: BoundingBox): boolean;
1721
1820
  /**
1722
1821
  * @remarks
1822
+ * Expand the initial box object bounds to include the 2nd box
1823
+ * argument. The resultant {@link
1824
+ * @minecraft-server.BoundingBox} object will be a BoundingBox
1825
+ * which exactly encompasses the two boxes.
1826
+ *
1723
1827
  * This function can't be called in read-only mode.
1724
1828
  *
1829
+ * @returns
1830
+ * A new {@link @minecraft-server.BoundingBox} instance
1831
+ * representing the smallest possible bounding box which can
1832
+ * encompass both
1725
1833
  */
1726
1834
  static expand(box: BoundingBox, other: BoundingBox): BoundingBox;
1727
1835
  /**
1728
1836
  * @remarks
1837
+ * Calculate the center block of a given {@link
1838
+ * @minecraft-server.BoundingBox} object.
1839
+ *
1729
1840
  * This function can't be called in read-only mode.
1730
1841
  *
1842
+ * @returns
1843
+ * Note that {@link @minecraft-server.BoundingBox} objects
1844
+ * represent whole blocks, so the center of boxes which have
1845
+ * odd numbered bounds are not mathematically centered...
1846
+ * i.e. a BoundingBox( 0,0,0 -> 3,3,3 ) would have a center of
1847
+ * (1,1,1) (not (1.5, 1.5, 1.5) as expected)
1731
1848
  */
1732
1849
  static getCenter(box: BoundingBox): Vector3;
1733
1850
  /**
1734
1851
  * @remarks
1852
+ * Calculate the BoundingBox which represents the union area of
1853
+ * two intersecting BoundingBoxes
1854
+ *
1735
1855
  * This function can't be called in read-only mode.
1736
1856
  *
1737
1857
  * @throws This function can throw errors.
@@ -1739,32 +1859,44 @@ export class BoundingBoxUtils {
1739
1859
  static getIntersection(box: BoundingBox, other: BoundingBox): BoundingBox;
1740
1860
  /**
1741
1861
  * @remarks
1862
+ * Get the Span of each of the BoundingBox Axis components
1863
+ *
1742
1864
  * This function can't be called in read-only mode.
1743
1865
  *
1744
1866
  */
1745
1867
  static getSpan(box: BoundingBox): Vector3;
1746
1868
  /**
1747
1869
  * @remarks
1870
+ * Check to see if two BoundingBox objects intersect
1871
+ *
1748
1872
  * This function can't be called in read-only mode.
1749
1873
  *
1750
1874
  */
1751
1875
  static intersects(box: BoundingBox, other: BoundingBox): boolean;
1752
1876
  /**
1753
1877
  * @remarks
1878
+ * Check to see if a given coordinate is inside a BoundingBox
1879
+ *
1754
1880
  * This function can't be called in read-only mode.
1755
1881
  *
1756
1882
  */
1757
1883
  static isInside(box: BoundingBox, pos: Vector3): boolean;
1758
1884
  /**
1759
1885
  * @remarks
1886
+ * Check to see if a BoundingBox is valid (i.e. (min <= max))
1887
+ *
1760
1888
  * This function can't be called in read-only mode.
1761
1889
  *
1762
1890
  */
1763
1891
  static isValid(box: BoundingBox): boolean;
1764
1892
  /**
1765
1893
  * @remarks
1894
+ * Move a BoundingBox by a given amount
1895
+ *
1766
1896
  * This function can't be called in read-only mode.
1767
1897
  *
1898
+ * @returns
1899
+ * Return a new BoundingBox object which represents the change
1768
1900
  */
1769
1901
  static translate(box: BoundingBox, delta: Vector3): BoundingBox;
1770
1902
  }
@@ -1902,74 +2034,164 @@ export class Component {
1902
2034
 
1903
2035
  /**
1904
2036
  * @beta
2037
+ * The Compound Block Volume is a collection of individual
2038
+ * block volume definitions which, as a collection, define a
2039
+ * larger volume of (sometimes non-contiguous) irregular
2040
+ * shapes.
2041
+ * This class is loosely based on the concept of CSG
2042
+ * (Computational Solid Geometry) and allows a user to create
2043
+ * complex volumes by building a stack of volumes and voids to
2044
+ * make a larger single volume.
2045
+ * For example - normally a creator would create a hollow cube
2046
+ * by creating 6 "wall" surfaces for each face.
2047
+ * With a Compound Block Volume, a creator can define a hollow
2048
+ * cube by creating a single outer solid cube, and then
2049
+ * defining a further single 'void' cube inside the larger one.
2050
+ * Similarly, the Compound Block Volume can represent irregular
2051
+ * shaped volumes (e.g. a tree consists of a trunk and lots of
2052
+ * leaf cubes which are not necessarily contiguously placed)
1905
2053
  */
1906
2054
  export class CompoundBlockVolume {
2055
+ /**
2056
+ * @remarks
2057
+ * Return the 'capacity' of the bounding rectangle which
2058
+ * represents the collection of volumes in the stack
2059
+ *
2060
+ */
1907
2061
  readonly capacity: number;
2062
+ /**
2063
+ * @remarks
2064
+ * Return the number of volumes (positive and negative) in the
2065
+ * volume stack
2066
+ *
2067
+ */
1908
2068
  readonly volumeCount: number;
1909
2069
  /**
1910
2070
  * @remarks
2071
+ * Clear the contents of the volume stack
2072
+ *
1911
2073
  * This function can't be called in read-only mode.
1912
2074
  *
1913
2075
  */
1914
2076
  clear(): void;
1915
2077
  /**
1916
2078
  * @remarks
2079
+ * Fetch a Block Location Iterator for the Compound Block
2080
+ * Volume. This iterator will allow a creator to iterate
2081
+ * across all of the selected volumes within the larger
2082
+ * bounding area.
2083
+ * Areas of a volume which have been overridden by a
2084
+ * subtractive volume will not be included in the iterator
2085
+ * step.
2086
+ * (i.e. if you push a cube to the stack, and then push a
2087
+ * subtractive volume to the same location, then the iterator
2088
+ * will step over the initial volume because it is considered
2089
+ * negative space)
2090
+ *
2091
+ *
1917
2092
  * This function can't be called in read-only mode.
1918
2093
  *
1919
2094
  */
1920
2095
  getBlockLocationIterator(): BlockLocationIterator;
1921
2096
  /**
1922
2097
  * @remarks
2098
+ * Get the largest bounding box that represents a container for
2099
+ * all of the volumes on the stack
2100
+ *
1923
2101
  * This function can't be called in read-only mode.
1924
2102
  *
1925
2103
  */
1926
2104
  getBoundingBox(): BoundingBox;
1927
2105
  /**
1928
2106
  * @remarks
2107
+ * Get the max block location of the outermost bounding
2108
+ * rectangle which represents the volumes on the stack
2109
+ *
1929
2110
  * This function can't be called in read-only mode.
1930
2111
  *
1931
2112
  */
1932
2113
  getMax(): Vector3;
1933
2114
  /**
1934
2115
  * @remarks
2116
+ * Get the min block location of the outermost bounding
2117
+ * rectangle which represents the volumes on the stack
2118
+ *
1935
2119
  * This function can't be called in read-only mode.
1936
2120
  *
1937
2121
  */
1938
2122
  getMin(): Vector3;
1939
2123
  /**
1940
2124
  * @remarks
2125
+ * Return a boolean representing whether or not a given block
2126
+ * location is inside a positive block volume.
2127
+ * E.g. if the stack contains a large cube followed by a
2128
+ * slightly smaller negative cube, and the test location is
2129
+ * within the negative cube - the function will return false
2130
+ * because it's not 'inside' a volume (it IS inside the
2131
+ * bounding rectangle, but it is not inside a positively
2132
+ * defined location)
2133
+ *
1941
2134
  * This function can't be called in read-only mode.
1942
2135
  *
2136
+ * @param delta
2137
+ * block location to test
1943
2138
  */
1944
2139
  isInside(delta: Vector3): boolean;
1945
2140
  /**
1946
2141
  * @remarks
2142
+ * Inspect the last entry pushed to the volume stack without
2143
+ * affecting the stack contents
2144
+ *
1947
2145
  * This function can't be called in read-only mode.
1948
2146
  *
2147
+ * @returns
2148
+ * Returns undefined if the stack is empty
1949
2149
  */
1950
2150
  peekLastVolume(): CompoundBlockVolumeItem | undefined;
1951
2151
  /**
1952
2152
  * @remarks
2153
+ * Remove the last entry from the volume stack. This will
2154
+ * reduce the stack size by one
2155
+ *
1953
2156
  * This function can't be called in read-only mode.
1954
2157
  *
1955
2158
  */
1956
2159
  popVolume(): boolean;
1957
2160
  /**
1958
2161
  * @remarks
2162
+ * Push a volume item to the stack. The volume item contains
2163
+ * an 'action' parameter which determines whether this volume
2164
+ * is a positive or negative space
2165
+ *
1959
2166
  * This function can't be called in read-only mode.
1960
2167
  *
2168
+ * @param item
2169
+ * Item to push to the end of the stack
1961
2170
  */
1962
2171
  pushVolume(item: CompoundBlockVolumeItem): void;
1963
2172
  /**
1964
2173
  * @remarks
2174
+ * If the volume stack is empty, this function will push the
2175
+ * specified item to the stack.
2176
+ * If the volume stack is NOT empty, this function will replace
2177
+ * the last item on the stack with the new item.
2178
+ *
1965
2179
  * This function can't be called in read-only mode.
1966
2180
  *
2181
+ * @param item
2182
+ * Item to add or replace
1967
2183
  */
1968
2184
  replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
1969
2185
  /**
1970
2186
  * @remarks
2187
+ * Move the root block location of the volume by a given
2188
+ * amount. This effectively adds the specified delta to the
2189
+ * block location of all of the volumes in the stack
2190
+ *
1971
2191
  * This function can't be called in read-only mode.
1972
2192
  *
2193
+ * @param delta
2194
+ * Amount to move
1973
2195
  */
1974
2196
  translate(delta: Vector3): void;
1975
2197
  }
@@ -2188,6 +2410,13 @@ export class ContainerSlot {
2188
2410
  * Throws if the slot's container is invalid.
2189
2411
  */
2190
2412
  readonly isStackable: boolean;
2413
+ /**
2414
+ * @remarks
2415
+ * Returns whether the ContainerSlot is valid. The container
2416
+ * slot is valid if the container exists and is loaded, and the
2417
+ * slot index is valid.
2418
+ *
2419
+ */
2191
2420
  readonly isValid: boolean;
2192
2421
  /**
2193
2422
  * @remarks
@@ -2258,10 +2487,23 @@ export class ContainerSlot {
2258
2487
  *
2259
2488
  * This function can't be called in read-only mode.
2260
2489
  *
2490
+ * @returns
2491
+ * Returns a copy of the item in the slot. Returns undefined if
2492
+ * the slot is empty.
2261
2493
  * @throws
2262
2494
  * Throws if the slot's container is invalid.
2263
2495
  */
2264
2496
  clone(): ItemStack;
2497
+ /**
2498
+ * @remarks
2499
+ * Creates an exact copy of the item stack, including any
2500
+ * custom data or properties.
2501
+ *
2502
+ * @returns
2503
+ * Returns a copy of the item in the slot. Returns undefined if
2504
+ * the slot is empty.
2505
+ * @throws This function can throw errors.
2506
+ */
2265
2507
  getItem(): ItemStack | undefined;
2266
2508
  /**
2267
2509
  * @remarks
@@ -2275,7 +2517,27 @@ export class ContainerSlot {
2275
2517
  * Throws if the slot's container is invalid.
2276
2518
  */
2277
2519
  getLore(): string[];
2520
+ /**
2521
+ * @remarks
2522
+ * Returns all tags for the item in the slot.
2523
+ *
2524
+ * @returns
2525
+ * Returns all tags for the item in the slot. Return an empty
2526
+ * array if the the slot is empty.
2527
+ * @throws This function can throw errors.
2528
+ */
2278
2529
  getTags(): string[];
2530
+ /**
2531
+ * @remarks
2532
+ * Returns whether the item in the slot slot has the given tag.
2533
+ *
2534
+ * @param tag
2535
+ * The item tag.
2536
+ * @returns
2537
+ * Returns false when the slot is empty or the item in the slot
2538
+ * does not have the given tag.
2539
+ * @throws This function can throw errors.
2540
+ */
2279
2541
  hasTag(tag: string): boolean;
2280
2542
  /**
2281
2543
  * @remarks
@@ -2285,6 +2547,11 @@ export class ContainerSlot {
2285
2547
  * item stacks. The amount of each item stack is not taken into
2286
2548
  * consideration.
2287
2549
  *
2550
+ * @param itemStack
2551
+ * The ItemStack that is being compared.
2552
+ * @returns
2553
+ * Returns whether this item stack can be stacked with the
2554
+ * given `itemStack`.
2288
2555
  * @throws
2289
2556
  * Throws if the slot's container is invalid.
2290
2557
  */
@@ -2297,6 +2564,8 @@ export class ContainerSlot {
2297
2564
  *
2298
2565
  * This function can't be called in read-only mode.
2299
2566
  *
2567
+ * @param blockIdentifiers
2568
+ * The list of blocks, given by their identifiers.
2300
2569
  * @throws
2301
2570
  * Throws if the slot's container is invalid. Also throws if
2302
2571
  * any of the provided block identifiers are invalid.
@@ -2311,6 +2580,8 @@ export class ContainerSlot {
2311
2580
  *
2312
2581
  * This function can't be called in read-only mode.
2313
2582
  *
2583
+ * @param blockIdentifiers
2584
+ * The list of blocks, given by their identifiers.
2314
2585
  * @throws
2315
2586
  * Throws if the slot's container is invalid. Also throws if
2316
2587
  * any of the provided block identifiers are invalid.
@@ -2318,8 +2589,13 @@ export class ContainerSlot {
2318
2589
  setCanPlaceOn(blockIdentifiers?: string[]): void;
2319
2590
  /**
2320
2591
  * @remarks
2592
+ * Sets the given ItemStack in the slot, replacing any existing
2593
+ * item.
2594
+ *
2321
2595
  * This function can't be called in read-only mode.
2322
2596
  *
2597
+ * @param itemStack
2598
+ * The ItemStack to be placed in the slot.
2323
2599
  * @throws This function can throw errors.
2324
2600
  */
2325
2601
  setItem(itemStack?: ItemStack): void;
@@ -2330,6 +2606,9 @@ export class ContainerSlot {
2330
2606
  *
2331
2607
  * This function can't be called in read-only mode.
2332
2608
  *
2609
+ * @param loreList
2610
+ * A list of lore strings. Setting this argument to undefined
2611
+ * will clear the lore.
2333
2612
  * @throws
2334
2613
  * Throws if the slot's container is invalid.
2335
2614
  */
@@ -3256,9 +3535,14 @@ export class Entity {
3256
3535
  * @param duration
3257
3536
  * Amount of time, in ticks, for the effect to apply. There are
3258
3537
  * 20 ticks per second. Use {@link TicksPerSecond} constant to
3259
- * convert between ticks and seconds.
3538
+ * convert between ticks and seconds. The value must be within
3539
+ * the range [0, 20000000].
3260
3540
  * @param options
3261
3541
  * Additional options for the effect.
3542
+ * @returns
3543
+ * Returns true if the effect was added successfully. This can
3544
+ * fail if the duration or amplifier are outside of the valid
3545
+ * ranges.
3262
3546
  * @throws This function can throw errors.
3263
3547
  * @example addEffect.js
3264
3548
  * ```typescript
@@ -3301,6 +3585,9 @@ export class Entity {
3301
3585
  *
3302
3586
  * @param tag
3303
3587
  * Content of the tag to add.
3588
+ * @returns
3589
+ * Returns true if the tag was added successfully. This can
3590
+ * fail if the tag already exists on the entity.
3304
3591
  * @throws This function can throw errors.
3305
3592
  */
3306
3593
  addTag(tag: string): boolean;
@@ -3317,6 +3604,10 @@ export class Entity {
3317
3604
  * Additional options about the source of damage, which may add
3318
3605
  * additional effects or spur additional behaviors on this
3319
3606
  * entity.
3607
+ * @returns
3608
+ * Whether the entity takes any damage. This can return false
3609
+ * if the entity is invulnerable or if the damage applied is
3610
+ * less than or equal to 0.
3320
3611
  * @throws This function can throw errors.
3321
3612
  */
3322
3613
  applyDamage(amount: number, options?: EntityApplyDamageByProjectileOptions | EntityApplyDamageOptions): boolean;
@@ -3375,6 +3666,8 @@ export class Entity {
3375
3666
  * @param useEffects
3376
3667
  * Whether to show any visual effects connected to the
3377
3668
  * extinguishing.
3669
+ * @returns
3670
+ * Returns whether the entity was on fire.
3378
3671
  * @throws This function can throw errors.
3379
3672
  */
3380
3673
  extinguishFire(useEffects?: boolean): boolean;
@@ -3384,6 +3677,11 @@ export class Entity {
3384
3677
  * Returns the first intersecting block from the direction that
3385
3678
  * this entity is looking at.
3386
3679
  *
3680
+ * @param options
3681
+ * Additional configuration options for the ray cast.
3682
+ * @returns
3683
+ * Returns the first intersecting block from the direction that
3684
+ * this entity is looking at.
3387
3685
  * @throws This function can throw errors.
3388
3686
  */
3389
3687
  getBlockFromViewDirection(options?: BlockRaycastOptions): Block;
@@ -3398,6 +3696,9 @@ export class Entity {
3398
3696
  * to retrieve. If no namespace prefix is specified,
3399
3697
  * 'minecraft:' is assumed. If the component is not present on
3400
3698
  * the entity, undefined is returned.
3699
+ * @returns
3700
+ * Returns the component if it exists on the entity, otherwise
3701
+ * undefined.
3401
3702
  */
3402
3703
  getComponent(componentId: string): EntityComponent | undefined;
3403
3704
  /**
@@ -3406,6 +3707,9 @@ export class Entity {
3406
3707
  * Returns all components that are both present on this entity
3407
3708
  * and supported by the API.
3408
3709
  *
3710
+ * @returns
3711
+ * Returns all components that are both present on this entity
3712
+ * and supported by the API.
3409
3713
  */
3410
3714
  getComponents(): EntityComponent[];
3411
3715
  /**
@@ -3413,6 +3717,8 @@ export class Entity {
3413
3717
  * @remarks
3414
3718
  * Returns a property value.
3415
3719
  *
3720
+ * @param identifier
3721
+ * The property identifier.
3416
3722
  * @returns
3417
3723
  * Returns the value for the property, or undefined if the
3418
3724
  * property has not been set.
@@ -3425,6 +3731,8 @@ export class Entity {
3425
3731
  * Returns the effect for the specified EffectType on the
3426
3732
  * entity, or undefined if the effect is not present.
3427
3733
  *
3734
+ * @param effectType
3735
+ * The effect identifier.
3428
3736
  * @returns
3429
3737
  * Effect object for the specified effect, or undefined if the
3430
3738
  * effect is not present.
@@ -3444,9 +3752,14 @@ export class Entity {
3444
3752
  /**
3445
3753
  * @beta
3446
3754
  * @remarks
3447
- * Returns a potential set of entities from the direction that
3448
- * this entity is looking at.
3755
+ * Gets the entities that this entity is looking at by
3756
+ * performing a ray cast from the view of this entity.
3449
3757
  *
3758
+ * @param options
3759
+ * Additional configuration options for the ray cast.
3760
+ * @returns
3761
+ * Returns a set of entities from the direction that this
3762
+ * entity is looking at.
3450
3763
  * @throws This function can throw errors.
3451
3764
  */
3452
3765
  getEntitiesFromViewDirection(options?: EntityRaycastOptions): Entity[];
@@ -3456,6 +3769,9 @@ export class Entity {
3456
3769
  * Returns the current location of the head component of this
3457
3770
  * entity.
3458
3771
  *
3772
+ * @returns
3773
+ * Returns the current location of the head component of this
3774
+ * entity.
3459
3775
  * @throws This function can throw errors.
3460
3776
  */
3461
3777
  getHeadLocation(): Vector3;
@@ -3464,6 +3780,8 @@ export class Entity {
3464
3780
  * @remarks
3465
3781
  * Returns the current rotation component of this entity.
3466
3782
  *
3783
+ * @returns
3784
+ * Returns the current rotation component of this entity.
3467
3785
  * @throws This function can throw errors.
3468
3786
  */
3469
3787
  getRotation(): Vector2;
@@ -3472,6 +3790,8 @@ export class Entity {
3472
3790
  * @remarks
3473
3791
  * Returns all tags associated with an entity.
3474
3792
  *
3793
+ * @returns
3794
+ * Returns the current rotation component of this entity.
3475
3795
  * @throws This function can throw errors.
3476
3796
  */
3477
3797
  getTags(): string[];
@@ -3480,6 +3800,8 @@ export class Entity {
3480
3800
  * @remarks
3481
3801
  * Returns the current velocity vector of the entity.
3482
3802
  *
3803
+ * @returns
3804
+ * Returns the current velocity vector of the entity.
3483
3805
  * @throws This function can throw errors.
3484
3806
  */
3485
3807
  getVelocity(): Vector3;
@@ -3488,6 +3810,8 @@ export class Entity {
3488
3810
  * @remarks
3489
3811
  * Returns the current view direction of the entity.
3490
3812
  *
3813
+ * @returns
3814
+ * Returns the current view direction of the entity.
3491
3815
  * @throws This function can throw errors.
3492
3816
  */
3493
3817
  getViewDirection(): Vector3;
@@ -3501,15 +3825,20 @@ export class Entity {
3501
3825
  * The identifier of the component (e.g., 'minecraft:rideable')
3502
3826
  * to retrieve. If no namespace prefix is specified,
3503
3827
  * 'minecraft:' is assumed.
3828
+ * @returns
3829
+ * Returns true if the specified component is present on this
3830
+ * entity.
3504
3831
  */
3505
3832
  hasComponent(componentId: string): boolean;
3506
3833
  /**
3507
3834
  * @beta
3508
3835
  * @remarks
3509
- * Tests whether an entity has a particular tag.
3836
+ * Returns whether an entity has a particular tag.
3510
3837
  *
3511
3838
  * @param tag
3512
3839
  * Identifier of the tag to test for.
3840
+ * @returns
3841
+ * Returns whether an entity has a particular tag.
3513
3842
  * @throws This function can throw errors.
3514
3843
  */
3515
3844
  hasTag(tag: string): boolean;
@@ -3529,8 +3858,15 @@ export class Entity {
3529
3858
  /**
3530
3859
  * @beta
3531
3860
  * @remarks
3861
+ * Cause the entity to play the given animation.
3862
+ *
3532
3863
  * This function can't be called in read-only mode.
3533
3864
  *
3865
+ * @param animationName
3866
+ * The animation identifier. e.g. animation.creeper.swelling
3867
+ * @param options
3868
+ * Additional options to control the playback and transitions
3869
+ * of the animation.
3534
3870
  * @throws This function can throw errors.
3535
3871
  */
3536
3872
  playAnimation(animationName: string, options?: PlayAnimationOptions): void;
@@ -3539,6 +3875,10 @@ export class Entity {
3539
3875
  * @remarks
3540
3876
  * Removes a specified property.
3541
3877
  *
3878
+ * @param identifier
3879
+ * The property identifier.
3880
+ * @returns
3881
+ * Returns whether the given property existed on the entity.
3542
3882
  * @throws This function can throw errors.
3543
3883
  */
3544
3884
  removeDynamicProperty(identifier: string): boolean;
@@ -3550,6 +3890,8 @@ export class Entity {
3550
3890
  *
3551
3891
  * This function can't be called in read-only mode.
3552
3892
  *
3893
+ * @param effectType
3894
+ * The effect identifier.
3553
3895
  * @returns
3554
3896
  * Returns true if the effect has been removed and false if the
3555
3897
  * effect is not present.
@@ -3565,6 +3907,8 @@ export class Entity {
3565
3907
  *
3566
3908
  * @param tag
3567
3909
  * Content of the tag to remove.
3910
+ * @returns
3911
+ * Returns whether the tag existed on the entity.
3568
3912
  * @throws This function can throw errors.
3569
3913
  */
3570
3914
  removeTag(tag: string): boolean;
@@ -3575,6 +3919,12 @@ export class Entity {
3575
3919
  *
3576
3920
  * This function can't be called in read-only mode.
3577
3921
  *
3922
+ * @param commandString
3923
+ * The command string. Note: This should not include a leading
3924
+ * forward slash.
3925
+ * @returns
3926
+ * A command result containing whether the command was
3927
+ * successful.
3578
3928
  * @throws This function can throw errors.
3579
3929
  */
3580
3930
  runCommand(commandString: string): CommandResult;
@@ -3598,6 +3948,8 @@ export class Entity {
3598
3948
  * @remarks
3599
3949
  * Sets a specified property to a value.
3600
3950
  *
3951
+ * @param identifier
3952
+ * The property identifier.
3601
3953
  * @param value
3602
3954
  * Data value of the property to set.
3603
3955
  * @throws This function can throw errors.
@@ -3614,6 +3966,14 @@ export class Entity {
3614
3966
  *
3615
3967
  * @param seconds
3616
3968
  * Length of time to set the entity on fire.
3969
+ * @param useEffects
3970
+ * Whether side-effects should be applied (e.g. thawing freeze)
3971
+ * and other conditions such as rain or fire protection should
3972
+ * be taken into consideration.
3973
+ * @returns
3974
+ * Whether the entity was set on fire. This can fail if seconds
3975
+ * is less than or equal to zero, the entity is wet or the
3976
+ * entity is immune to fire.
3617
3977
  * @throws This function can throw errors.
3618
3978
  */
3619
3979
  setOnFire(seconds: number, useEffects?: boolean): boolean;
@@ -3624,6 +3984,10 @@ export class Entity {
3624
3984
  *
3625
3985
  * This function can't be called in read-only mode.
3626
3986
  *
3987
+ * @param rotation
3988
+ * The x and y rotation of the entity. For most mobs, the x
3989
+ * rotation controls the head tilt and the y rotation controls
3990
+ * the body rotation.
3627
3991
  * @throws This function can throw errors.
3628
3992
  */
3629
3993
  setRotation(rotation: Vector2): void;
@@ -3636,6 +4000,8 @@ export class Entity {
3636
4000
  *
3637
4001
  * @param location
3638
4002
  * New location for the entity.
4003
+ * @param teleportOptions
4004
+ * Options regarding the teleport operation.
3639
4005
  * @throws This function can throw errors.
3640
4006
  */
3641
4007
  teleport(location: Vector3, teleportOptions?: TeleportOptions): void;
@@ -3668,6 +4034,10 @@ export class Entity {
3668
4034
  * Location to teleport the entity to.
3669
4035
  * @param teleportOptions
3670
4036
  * Options regarding the teleport operation.
4037
+ * @returns
4038
+ * Returns whether the teleport succeeded. This can fail if the
4039
+ * destination chunk is unloaded or if the teleport would
4040
+ * result in intersecting with blocks.
3671
4041
  * @throws This function can throw errors.
3672
4042
  */
3673
4043
  tryTeleport(location: Vector3, teleportOptions?: TeleportOptions): boolean;
@@ -4025,28 +4395,51 @@ export class EntityDieAfterEventSignal extends IEntityDieAfterEventSignal {
4025
4395
 
4026
4396
  /**
4027
4397
  * @beta
4398
+ * Provides access to a mob's equipment slots. This component
4399
+ * exists for all mob entities.
4028
4400
  */
4029
4401
  export class EntityEquipmentInventoryComponent extends EntityComponent {
4030
4402
  protected constructor();
4031
4403
  static readonly componentId = 'minecraft:equipment_inventory';
4032
4404
  /**
4033
4405
  * @remarks
4406
+ * Gets the equipped item for the given EquipmentSlot.
4407
+ *
4034
4408
  * This function can't be called in read-only mode.
4035
4409
  *
4410
+ * @param equipmentSlot
4411
+ * The equipment slot. e.g. "head", "chest", "offhand"
4412
+ * @returns
4413
+ * Returns the item equipped to the given EquipmentSlot. If
4414
+ * empty, returns undefined.
4036
4415
  * @throws This function can throw errors.
4037
4416
  */
4038
4417
  getEquipment(equipmentSlot: EquipmentSlot): ItemStack | undefined;
4039
4418
  /**
4040
4419
  * @remarks
4420
+ * Gets the ContainerSlot corresponding to the given
4421
+ * EquipmentSlot.
4422
+ *
4041
4423
  * This function can't be called in read-only mode.
4042
4424
  *
4425
+ * @param equipmentSlot
4426
+ * The equipment slot. e.g. "head", "chest", "offhand".
4427
+ * @returns
4428
+ * Returns the ContainerSlot corresponding to the given
4429
+ * EquipmentSlot.
4043
4430
  * @throws This function can throw errors.
4044
4431
  */
4045
4432
  getEquipmentSlot(equipmentSlot: EquipmentSlot): ContainerSlot;
4046
4433
  /**
4047
4434
  * @remarks
4435
+ * Replaces the item in the given EquipmentSlot.
4436
+ *
4048
4437
  * This function can't be called in read-only mode.
4049
4438
  *
4439
+ * @param equipmentSlot
4440
+ * The equipment slot. e.g. "head", "chest", "offhand".
4441
+ * @param itemStack
4442
+ * The item to equip. If undefined, clears the slot.
4050
4443
  * @throws This function can throw errors.
4051
4444
  */
4052
4445
  setEquipment(equipmentSlot: EquipmentSlot, itemStack?: ItemStack): void;
@@ -6603,36 +6996,16 @@ export class IServerMessageAfterEventSignal {
6603
6996
 
6604
6997
  /**
6605
6998
  * @beta
6606
- * Contains information related to a chargeable item completing
6607
- * being charged.
6608
6999
  */
6609
7000
  export class ItemCompleteChargeAfterEvent {
6610
7001
  protected constructor();
6611
- /**
6612
- * @remarks
6613
- * Returns the item stack that has completed charging.
6614
- *
6615
- */
6616
7002
  readonly itemStack: ItemStack;
6617
- /**
6618
- * @remarks
6619
- * Returns the source entity that triggered this item event.
6620
- *
6621
- */
6622
7003
  readonly source: Entity;
6623
- /**
6624
- * @remarks
6625
- * Returns the time, in ticks, for the remaining duration left
6626
- * before the charge completes its cycle.
6627
- *
6628
- */
6629
7004
  readonly useDuration: number;
6630
7005
  }
6631
7006
 
6632
7007
  /**
6633
7008
  * @beta
6634
- * Manages callbacks that are connected to the completion of
6635
- * charging for a chargeable item.
6636
7009
  */
6637
7010
  export class ItemCompleteChargeAfterEventSignal extends IItemCompleteChargeAfterEventSignal {
6638
7011
  protected constructor();
@@ -6887,37 +7260,16 @@ export class ItemFoodComponent extends ItemComponent {
6887
7260
 
6888
7261
  /**
6889
7262
  * @beta
6890
- * Contains information related to a chargeable item when the
6891
- * player has finished using the item and released the build
6892
- * action.
6893
7263
  */
6894
7264
  export class ItemReleaseChargeAfterEvent {
6895
7265
  protected constructor();
6896
- /**
6897
- * @remarks
6898
- * Returns the item stack that triggered this item event.
6899
- *
6900
- */
6901
7266
  readonly itemStack: ItemStack;
6902
- /**
6903
- * @remarks
6904
- * Returns the source entity that triggered this item event.
6905
- *
6906
- */
6907
7267
  readonly source: Entity;
6908
- /**
6909
- * @remarks
6910
- * Returns the time, in ticks, for the remaining duration left
6911
- * before the charge completes its cycle.
6912
- *
6913
- */
6914
7268
  readonly useDuration: number;
6915
7269
  }
6916
7270
 
6917
7271
  /**
6918
7272
  * @beta
6919
- * Manages callbacks that are connected to the releasing of
6920
- * charging for a chargeable item.
6921
7273
  */
6922
7274
  export class ItemReleaseChargeAfterEventSignal extends IItemReleaseChargeAfterEventSignal {
6923
7275
  protected constructor();
@@ -7183,36 +7535,16 @@ export class ItemStack {
7183
7535
 
7184
7536
  /**
7185
7537
  * @beta
7186
- * Contains information related to a chargeable item starting
7187
- * to be charged.
7188
7538
  */
7189
7539
  export class ItemStartChargeAfterEvent {
7190
7540
  protected constructor();
7191
- /**
7192
- * @remarks
7193
- * The impacted item stack that is starting to be charged.
7194
- *
7195
- */
7196
7541
  readonly itemStack: ItemStack;
7197
- /**
7198
- * @remarks
7199
- * Returns the source entity that triggered this item event.
7200
- *
7201
- */
7202
7542
  readonly source: Entity;
7203
- /**
7204
- * @remarks
7205
- * Returns the time, in ticks, for the remaining duration left
7206
- * before the charge completes its cycle.
7207
- *
7208
- */
7209
7543
  readonly useDuration: number;
7210
7544
  }
7211
7545
 
7212
7546
  /**
7213
7547
  * @beta
7214
- * Manages callbacks that are connected to the start of
7215
- * charging for a chargeable item.
7216
7548
  */
7217
7549
  export class ItemStartChargeAfterEventSignal extends IItemStartChargeAfterEventSignal {
7218
7550
  protected constructor();
@@ -7265,38 +7597,16 @@ export class ItemStartUseOnAfterEventSignal extends IItemStartUseOnAfterEventSig
7265
7597
 
7266
7598
  /**
7267
7599
  * @beta
7268
- * Contains information related to a chargeable item has
7269
- * finished an items use cycle, or when the player has released
7270
- * the use action with the item.
7271
7600
  */
7272
7601
  export class ItemStopChargeAfterEvent {
7273
7602
  protected constructor();
7274
- /**
7275
- * @remarks
7276
- * The impacted item stack that is stopping being charged.
7277
- *
7278
- */
7279
7603
  readonly itemStack: ItemStack;
7280
- /**
7281
- * @remarks
7282
- * Returns the source entity that triggered this item event.
7283
- *
7284
- */
7285
7604
  readonly source: Entity;
7286
- /**
7287
- * @remarks
7288
- * Returns the time, in ticks, for the remaining duration left
7289
- * before the charge completes its cycle.
7290
- *
7291
- */
7292
7605
  readonly useDuration: number;
7293
7606
  }
7294
7607
 
7295
7608
  /**
7296
7609
  * @beta
7297
- * Manages callbacks that are connected to the stopping of
7298
- * charging for an item that has a registered
7299
- * minecraft:chargeable component.
7300
7610
  */
7301
7611
  export class ItemStopChargeAfterEventSignal extends IItemStopChargeAfterEventSignal {
7302
7612
  protected constructor();
@@ -17852,17 +18162,83 @@ export interface BlockRaycastOptions {
17852
18162
 
17853
18163
  /**
17854
18164
  * @beta
18165
+ * A BlockVolume is a simple interface to an object which
18166
+ * represents a 3D rectangle of a given size (in blocks) at a
18167
+ * world block location.
18168
+ * Note that these are not analogous to "min" and "max" values,
18169
+ * in that the vector components are not guaranteed to be in
18170
+ * any order.
18171
+ * In addition, these vector positions are not interchangeable
18172
+ * with BlockLocation.
18173
+ * If you want to get this volume represented as range of of
18174
+ * BlockLocations, you can use the getBoundingBox utility
18175
+ * function.
18176
+ * This volume class will maintain the ordering of the corner
18177
+ * indexes as initially set. imagine that each corner is
18178
+ * assigned in Editor - as you move the corner around
18179
+ * (potentially inverting the min/max relationship of the
18180
+ * bounds) - what
18181
+ * you had originally selected as the top/left corner would
18182
+ * traditionally become the bottom/right.
18183
+ * When manually editing these kinds of volumes, you need to
18184
+ * maintain the identity of the corner as you edit - the
18185
+ * BlockVolume utility functions do this.
18186
+ *
18187
+ * Important to note that this measures block sizes (to/from) -
18188
+ * a normal AABB (0,0,0) to (0,0,0) would traditionally be of
18189
+ * size (0,0,0)
18190
+ * However, because we're measuring blocks - the size or span
18191
+ * of a BlockVolume would actually be (1,1,1)
18192
+ *
17855
18193
  */
17856
18194
  export interface BlockVolume {
18195
+ /**
18196
+ * @remarks
18197
+ * A world block location that represents a corner in a 3D
18198
+ * rectangle
18199
+ *
18200
+ */
17857
18201
  from: Vector3;
18202
+ /**
18203
+ * @remarks
18204
+ * A world block location that represents the opposite corner
18205
+ * in a 3D rectangle
18206
+ *
18207
+ */
17858
18208
  to: Vector3;
17859
18209
  }
17860
18210
 
17861
18211
  /**
17862
18212
  * @beta
18213
+ * A BoundingBox is an interface to an object which represents
18214
+ * an AABB aligned rectangle.
18215
+ * The BoundingBox assumes that it was created in a valid state
18216
+ * (min <= max) but cannot guarantee it (unless it was created
18217
+ * using the associated {@link
18218
+ * @minecraft-server.BoundingBoxUtils} utility functions.
18219
+ * The min/max coordinates represent the diametrically opposite
18220
+ * corners of the rectangle.
18221
+ * The BoundingBox is not a representation of blocks - it has
18222
+ * no association with any type, it is just a mathematical
18223
+ * construct - so a rectangle with
18224
+ * ( 0,0,0 ) -> ( 0,0,0 )
18225
+ * has a size of ( 0,0,0 ) (unlike the very similar {@link
18226
+ * BlockVolume} object)
17863
18227
  */
17864
18228
  export interface BoundingBox {
18229
+ /**
18230
+ * @remarks
18231
+ * A {@link @minecraft-server.Vector3} that represents the
18232
+ * largest corner of the rectangle
18233
+ *
18234
+ */
17865
18235
  max: Vector3;
18236
+ /**
18237
+ * @remarks
18238
+ * A {@link @minecraft-server.Vector3} that represents the
18239
+ * smallest corner of the rectangle
18240
+ *
18241
+ */
17866
18242
  min: Vector3;
17867
18243
  }
17868
18244
 
@@ -17903,9 +18279,27 @@ export interface Color {
17903
18279
 
17904
18280
  /**
17905
18281
  * @beta
18282
+ * This interface defines an entry into the {@link
18283
+ * @minecraft-server/CompoundBlockVolume} which represents a
18284
+ * volume of positive or negative space.
18285
+ *
17906
18286
  */
17907
18287
  export interface CompoundBlockVolumeItem {
18288
+ /**
18289
+ * @remarks
18290
+ * The 'action' defines how the block volume is represented in
18291
+ * the compound block volume stack.
18292
+ * 'Add' creates a block volume which is positively selected
18293
+ * 'Subtract' creates a block volume which represents a hole or
18294
+ * negative space in the overall compound block volume.
18295
+ *
18296
+ */
17908
18297
  action: CompoundBlockVolumeAction;
18298
+ /**
18299
+ * @remarks
18300
+ * The volume of space
18301
+ *
18302
+ */
17909
18303
  volume: BlockVolume;
17910
18304
  }
17911
18305
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.3.0-beta.1.20.0-preview.23",
3
+ "version": "1.3.0-beta.1.20.0-preview.24",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {