@minecraft/server 2.0.0-rc.1.21.90-preview.21 → 2.0.0-rc.1.21.90-preview.23
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/index.d.ts +81 -27
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -128,7 +128,6 @@ export enum CustomComponentNameErrorReason {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
* @rc
|
|
132
131
|
* An enumeration for the various difficulty levels of
|
|
133
132
|
* Minecraft.
|
|
134
133
|
*/
|
|
@@ -4457,7 +4456,6 @@ export class Camera {
|
|
|
4457
4456
|
setCamera(
|
|
4458
4457
|
cameraPreset: string,
|
|
4459
4458
|
setOptions?:
|
|
4460
|
-
| CameraDefaultOptions
|
|
4461
4459
|
| CameraFixedBoomOptions
|
|
4462
4460
|
| CameraSetFacingOptions
|
|
4463
4461
|
| CameraSetLocationOptions
|
|
@@ -4465,6 +4463,23 @@ export class Camera {
|
|
|
4465
4463
|
| CameraSetRotOptions
|
|
4466
4464
|
| CameraTargetOptions,
|
|
4467
4465
|
): void;
|
|
4466
|
+
/**
|
|
4467
|
+
* @rc
|
|
4468
|
+
* @remarks
|
|
4469
|
+
* Sets the current active camera for the specified player and
|
|
4470
|
+
* resets the position and rotation to the values defined in
|
|
4471
|
+
* the JSON.
|
|
4472
|
+
*
|
|
4473
|
+
* This function can't be called in read-only mode.
|
|
4474
|
+
*
|
|
4475
|
+
* @param cameraPreset
|
|
4476
|
+
* Identifier of a camera preset file defined within JSON.
|
|
4477
|
+
* @param easeOptions
|
|
4478
|
+
* Options to ease the camera back to its original position and
|
|
4479
|
+
* rotation.
|
|
4480
|
+
* @throws This function can throw errors.
|
|
4481
|
+
*/
|
|
4482
|
+
setDefaultCamera(cameraPreset: string, easeOptions?: CameraEaseOptions): void;
|
|
4468
4483
|
}
|
|
4469
4484
|
|
|
4470
4485
|
/**
|
|
@@ -4647,6 +4662,10 @@ export class Container {
|
|
|
4647
4662
|
* @param itemStack
|
|
4648
4663
|
* The stack of items to add.
|
|
4649
4664
|
* @throws This function can throw errors.
|
|
4665
|
+
*
|
|
4666
|
+
* {@link ContainerRulesError}
|
|
4667
|
+
*
|
|
4668
|
+
* {@link Error}
|
|
4650
4669
|
*/
|
|
4651
4670
|
addItem(itemStack: ItemStack): ItemStack | undefined;
|
|
4652
4671
|
/**
|
|
@@ -4726,6 +4745,10 @@ export class Container {
|
|
|
4726
4745
|
* @throws
|
|
4727
4746
|
* Throws if either this container or `toContainer` are invalid
|
|
4728
4747
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
4748
|
+
*
|
|
4749
|
+
* {@link ContainerRulesError}
|
|
4750
|
+
*
|
|
4751
|
+
* {@link Error}
|
|
4729
4752
|
* @example moveBetweenContainers.ts
|
|
4730
4753
|
* ```typescript
|
|
4731
4754
|
* import { world, EntityInventoryComponent, EntityComponentTypes, DimensionLocation } from "@minecraft/server";
|
|
@@ -4770,6 +4793,10 @@ export class Container {
|
|
|
4770
4793
|
* @throws
|
|
4771
4794
|
* Throws if the container is invalid or if the `slot` index is
|
|
4772
4795
|
* out of bounds.
|
|
4796
|
+
*
|
|
4797
|
+
* {@link ContainerRulesError}
|
|
4798
|
+
*
|
|
4799
|
+
* {@link Error}
|
|
4773
4800
|
*/
|
|
4774
4801
|
setItem(slot: number, itemStack?: ItemStack): void;
|
|
4775
4802
|
/**
|
|
@@ -4788,6 +4815,10 @@ export class Container {
|
|
|
4788
4815
|
* @throws
|
|
4789
4816
|
* Throws if either this container or `otherContainer` are
|
|
4790
4817
|
* invalid or if the `slot` or `otherSlot` are out of bounds.
|
|
4818
|
+
*
|
|
4819
|
+
* {@link ContainerRulesError}
|
|
4820
|
+
*
|
|
4821
|
+
* {@link Error}
|
|
4791
4822
|
*/
|
|
4792
4823
|
swapItems(slot: number, otherSlot: number, otherContainer: Container): void;
|
|
4793
4824
|
/**
|
|
@@ -4809,6 +4840,10 @@ export class Container {
|
|
|
4809
4840
|
* @throws
|
|
4810
4841
|
* Throws if either this container or `toContainer` are invalid
|
|
4811
4842
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
4843
|
+
*
|
|
4844
|
+
* {@link ContainerRulesError}
|
|
4845
|
+
*
|
|
4846
|
+
* {@link Error}
|
|
4812
4847
|
* @example transferBetweenContainers.ts
|
|
4813
4848
|
* ```typescript
|
|
4814
4849
|
* import { world, EntityInventoryComponent, EntityComponentTypes, DimensionLocation } from "@minecraft/server";
|
|
@@ -5174,6 +5209,8 @@ export class ContainerSlot {
|
|
|
5174
5209
|
* @throws
|
|
5175
5210
|
* Throws if the slot's container is invalid.
|
|
5176
5211
|
*
|
|
5212
|
+
* {@link ContainerRulesError}
|
|
5213
|
+
*
|
|
5177
5214
|
* {@link InvalidContainerSlotError}
|
|
5178
5215
|
*/
|
|
5179
5216
|
setItem(itemStack?: ItemStack): void;
|
|
@@ -5433,6 +5470,38 @@ export class Dimension {
|
|
|
5433
5470
|
* {@link LocationOutOfWorldBoundariesError}
|
|
5434
5471
|
*/
|
|
5435
5472
|
getBlock(location: Vector3): Block | undefined;
|
|
5473
|
+
/**
|
|
5474
|
+
* @rc
|
|
5475
|
+
* @remarks
|
|
5476
|
+
* Gets the first block found above a given block location
|
|
5477
|
+
* based on the given options (by default will find the first
|
|
5478
|
+
* solid block above).
|
|
5479
|
+
*
|
|
5480
|
+
* This function can't be called in read-only mode.
|
|
5481
|
+
*
|
|
5482
|
+
* @param location
|
|
5483
|
+
* Location to retrieve the block above from.
|
|
5484
|
+
* @param options
|
|
5485
|
+
* The options to decide if a block is a valid result.
|
|
5486
|
+
* @throws This function can throw errors.
|
|
5487
|
+
*/
|
|
5488
|
+
getBlockAbove(location: Vector3, options?: BlockRaycastOptions): Block | undefined;
|
|
5489
|
+
/**
|
|
5490
|
+
* @rc
|
|
5491
|
+
* @remarks
|
|
5492
|
+
* Gets the first block found below a given block location
|
|
5493
|
+
* based on the given options (by default will find the first
|
|
5494
|
+
* solid block below).
|
|
5495
|
+
*
|
|
5496
|
+
* This function can't be called in read-only mode.
|
|
5497
|
+
*
|
|
5498
|
+
* @param location
|
|
5499
|
+
* Location to retrieve the block below from.
|
|
5500
|
+
* @param options
|
|
5501
|
+
* The options to decide if a block is a valid result.
|
|
5502
|
+
* @throws This function can throw errors.
|
|
5503
|
+
*/
|
|
5504
|
+
getBlockBelow(location: Vector3, options?: BlockRaycastOptions): Block | undefined;
|
|
5436
5505
|
/**
|
|
5437
5506
|
* @remarks
|
|
5438
5507
|
* Gets the first block that intersects with a vector emanating
|
|
@@ -5601,7 +5670,6 @@ export class Dimension {
|
|
|
5601
5670
|
*/
|
|
5602
5671
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
5603
5672
|
/**
|
|
5604
|
-
* @rc
|
|
5605
5673
|
* @remarks
|
|
5606
5674
|
* Places the given feature into the dimension at the specified
|
|
5607
5675
|
* location.
|
|
@@ -5632,7 +5700,6 @@ export class Dimension {
|
|
|
5632
5700
|
*/
|
|
5633
5701
|
placeFeature(featureName: string, location: Vector3, shouldThrow?: boolean): boolean;
|
|
5634
5702
|
/**
|
|
5635
|
-
* @rc
|
|
5636
5703
|
* @remarks
|
|
5637
5704
|
* Places the given feature rule into the dimension at the
|
|
5638
5705
|
* specified location.
|
|
@@ -12301,7 +12368,6 @@ export class Player extends Entity {
|
|
|
12301
12368
|
*/
|
|
12302
12369
|
addLevels(amount: number): number;
|
|
12303
12370
|
/**
|
|
12304
|
-
* @rc
|
|
12305
12371
|
* @remarks
|
|
12306
12372
|
* For this player, removes all overrides of any Entity
|
|
12307
12373
|
* Properties on the target Entity. This change is not applied
|
|
@@ -12420,7 +12486,6 @@ export class Player extends Entity {
|
|
|
12420
12486
|
*/
|
|
12421
12487
|
queueMusic(trackId: string, musicOptions?: MusicOptions): void;
|
|
12422
12488
|
/**
|
|
12423
|
-
* @rc
|
|
12424
12489
|
* @remarks
|
|
12425
12490
|
* For this player, removes the override on an Entity Property.
|
|
12426
12491
|
* This change is not applied until the next tick and will not
|
|
@@ -12550,7 +12615,6 @@ export class Player extends Entity {
|
|
|
12550
12615
|
*/
|
|
12551
12616
|
setGameMode(gameMode?: GameMode): void;
|
|
12552
12617
|
/**
|
|
12553
|
-
* @rc
|
|
12554
12618
|
* @remarks
|
|
12555
12619
|
* For this player, overrides an Entity Property on the target
|
|
12556
12620
|
* Entity to the provided value. This property must be client
|
|
@@ -15119,7 +15183,6 @@ export class StructureManager {
|
|
|
15119
15183
|
options?: StructurePlaceOptions,
|
|
15120
15184
|
): void;
|
|
15121
15185
|
/**
|
|
15122
|
-
* @rc
|
|
15123
15186
|
* @remarks
|
|
15124
15187
|
* Places a partial jigsaw structure in the world. This is
|
|
15125
15188
|
* useful for debugging connections between jigsaw blocks.
|
|
@@ -15163,7 +15226,6 @@ export class StructureManager {
|
|
|
15163
15226
|
options?: JigsawPlaceOptions,
|
|
15164
15227
|
): BlockBoundingBox;
|
|
15165
15228
|
/**
|
|
15166
|
-
* @rc
|
|
15167
15229
|
* @remarks
|
|
15168
15230
|
* Places a jigsaw structure in the world.
|
|
15169
15231
|
*
|
|
@@ -15918,7 +15980,6 @@ export class World {
|
|
|
15918
15980
|
*/
|
|
15919
15981
|
getDefaultSpawnLocation(): Vector3;
|
|
15920
15982
|
/**
|
|
15921
|
-
* @rc
|
|
15922
15983
|
* @remarks
|
|
15923
15984
|
* Gets the difficulty from the world.
|
|
15924
15985
|
*
|
|
@@ -16170,7 +16231,6 @@ export class World {
|
|
|
16170
16231
|
*/
|
|
16171
16232
|
setDefaultSpawnLocation(spawnLocation: Vector3): void;
|
|
16172
16233
|
/**
|
|
16173
|
-
* @rc
|
|
16174
16234
|
* @remarks
|
|
16175
16235
|
* Sets the worlds difficulty.
|
|
16176
16236
|
*
|
|
@@ -16783,7 +16843,6 @@ export class WorldLoadAfterEventSignal {
|
|
|
16783
16843
|
}
|
|
16784
16844
|
|
|
16785
16845
|
/**
|
|
16786
|
-
* @rc
|
|
16787
16846
|
* A BlockBoundingBox is an interface to an object which
|
|
16788
16847
|
* represents an AABB aligned rectangle.
|
|
16789
16848
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
@@ -17054,15 +17113,6 @@ export interface BlockRaycastOptions extends BlockFilter {
|
|
|
17054
17113
|
maxDistance?: number;
|
|
17055
17114
|
}
|
|
17056
17115
|
|
|
17057
|
-
export interface CameraDefaultOptions {
|
|
17058
|
-
/**
|
|
17059
|
-
* @remarks
|
|
17060
|
-
* Sets a set of easing options for the camera.
|
|
17061
|
-
*
|
|
17062
|
-
*/
|
|
17063
|
-
easeOptions: CameraEaseOptions;
|
|
17064
|
-
}
|
|
17065
|
-
|
|
17066
17116
|
/**
|
|
17067
17117
|
* Contains options associated with a camera ease operation.
|
|
17068
17118
|
*/
|
|
@@ -18031,7 +18081,6 @@ export interface ItemCustomComponent {
|
|
|
18031
18081
|
}
|
|
18032
18082
|
|
|
18033
18083
|
/**
|
|
18034
|
-
* @rc
|
|
18035
18084
|
* Provides additional options for {@link
|
|
18036
18085
|
* StructureManager.placeJigsaw}.
|
|
18037
18086
|
*/
|
|
@@ -18053,7 +18102,6 @@ export interface JigsawPlaceOptions {
|
|
|
18053
18102
|
}
|
|
18054
18103
|
|
|
18055
18104
|
/**
|
|
18056
|
-
* @rc
|
|
18057
18105
|
* Provides additional options for {@link
|
|
18058
18106
|
* StructureManager.placeJigsawStructure}.
|
|
18059
18107
|
*/
|
|
@@ -18171,7 +18219,7 @@ export interface PlayAnimationOptions {
|
|
|
18171
18219
|
* A list of players the animation will be visible to.
|
|
18172
18220
|
*
|
|
18173
18221
|
*/
|
|
18174
|
-
players?:
|
|
18222
|
+
players?: Player[];
|
|
18175
18223
|
/**
|
|
18176
18224
|
* @remarks
|
|
18177
18225
|
* Specifies a Molang expression for when this animation should
|
|
@@ -18801,6 +18849,15 @@ export class CommandError extends Error {
|
|
|
18801
18849
|
private constructor();
|
|
18802
18850
|
}
|
|
18803
18851
|
|
|
18852
|
+
/**
|
|
18853
|
+
* Error thrown if {@link @minecraft/server.ContainerRules} are
|
|
18854
|
+
* broken on container operations.
|
|
18855
|
+
*/
|
|
18856
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18857
|
+
export class ContainerRulesError extends Error {
|
|
18858
|
+
private constructor();
|
|
18859
|
+
}
|
|
18860
|
+
|
|
18804
18861
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18805
18862
|
export class CustomComponentInvalidRegistryError extends Error {
|
|
18806
18863
|
private constructor();
|
|
@@ -18951,9 +19008,6 @@ export class NamespaceNameError extends Error {
|
|
|
18951
19008
|
reason: NamespaceNameErrorReason;
|
|
18952
19009
|
}
|
|
18953
19010
|
|
|
18954
|
-
/**
|
|
18955
|
-
* @rc
|
|
18956
|
-
*/
|
|
18957
19011
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18958
19012
|
export class PlaceJigsawError extends Error {
|
|
18959
19013
|
private constructor();
|