@minecraft/server 2.2.0-beta.1.21.100-preview.21 → 2.2.0-beta.1.21.100-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 +659 -17
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -132,6 +132,35 @@ export enum BlockVolumeIntersection {
|
|
|
132
132
|
Intersects = 2,
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* @beta
|
|
137
|
+
* An enum of error reasons relating to using {@link
|
|
138
|
+
* ItemBookComponent}.
|
|
139
|
+
*/
|
|
140
|
+
export enum BookErrorReason {
|
|
141
|
+
/**
|
|
142
|
+
* @remarks
|
|
143
|
+
* The requested page content exceeds the max page length of
|
|
144
|
+
* 256.
|
|
145
|
+
*
|
|
146
|
+
*/
|
|
147
|
+
ExceedsMaxPageLength = 'ExceedsMaxPageLength',
|
|
148
|
+
/**
|
|
149
|
+
* @remarks
|
|
150
|
+
* The page could not be created as it would exceed the max
|
|
151
|
+
* page count of 50.
|
|
152
|
+
*
|
|
153
|
+
*/
|
|
154
|
+
ExceedsMaxPages = 'ExceedsMaxPages',
|
|
155
|
+
/**
|
|
156
|
+
* @remarks
|
|
157
|
+
* The title being signed exceeds the maximum title length of
|
|
158
|
+
* 16.
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
ExceedsTitleLength = 'ExceedsTitleLength',
|
|
162
|
+
}
|
|
163
|
+
|
|
135
164
|
/**
|
|
136
165
|
* The state of a button on a keyboard, controller, or touch
|
|
137
166
|
* interface.
|
|
@@ -1050,15 +1079,27 @@ export enum EntityComponentTypes {
|
|
|
1050
1079
|
*/
|
|
1051
1080
|
OnFire = 'minecraft:onfire',
|
|
1052
1081
|
/**
|
|
1053
|
-
* @
|
|
1082
|
+
* @rc
|
|
1083
|
+
* @remarks
|
|
1084
|
+
* Use this component to read the exhaustion of a player. This
|
|
1085
|
+
* is only available on players.
|
|
1086
|
+
*
|
|
1054
1087
|
*/
|
|
1055
1088
|
Exhaustion = 'minecraft:player.exhaustion',
|
|
1056
1089
|
/**
|
|
1057
|
-
* @
|
|
1090
|
+
* @rc
|
|
1091
|
+
* @remarks
|
|
1092
|
+
* Use this component to read the hunger of a player. This is
|
|
1093
|
+
* only available on players.
|
|
1094
|
+
*
|
|
1058
1095
|
*/
|
|
1059
1096
|
Hunger = 'minecraft:player.hunger',
|
|
1060
1097
|
/**
|
|
1061
|
-
* @
|
|
1098
|
+
* @rc
|
|
1099
|
+
* @remarks
|
|
1100
|
+
* Use this component to read the saturation of a player. This
|
|
1101
|
+
* is only available on players.
|
|
1102
|
+
*
|
|
1062
1103
|
*/
|
|
1063
1104
|
Saturation = 'minecraft:player.saturation',
|
|
1064
1105
|
/**
|
|
@@ -2037,6 +2078,13 @@ export enum InputPermissionCategory {
|
|
|
2037
2078
|
* function ItemStack.getComponent.
|
|
2038
2079
|
*/
|
|
2039
2080
|
export enum ItemComponentTypes {
|
|
2081
|
+
/**
|
|
2082
|
+
* @beta
|
|
2083
|
+
* @remarks
|
|
2084
|
+
* The minecraft:book component.
|
|
2085
|
+
*
|
|
2086
|
+
*/
|
|
2087
|
+
Book = 'minecraft:book',
|
|
2040
2088
|
Compostable = 'minecraft:compostable',
|
|
2041
2089
|
/**
|
|
2042
2090
|
* @remarks
|
|
@@ -2983,6 +3031,7 @@ export type ItemComponentReturnType<T extends string> = T extends keyof ItemComp
|
|
|
2983
3031
|
: ItemCustomComponentInstance;
|
|
2984
3032
|
|
|
2985
3033
|
export type ItemComponentTypeMap = {
|
|
3034
|
+
book: ItemBookComponent;
|
|
2986
3035
|
compostable: ItemCompostableComponent;
|
|
2987
3036
|
cooldown: ItemCooldownComponent;
|
|
2988
3037
|
durability: ItemDurabilityComponent;
|
|
@@ -2990,6 +3039,7 @@ export type ItemComponentTypeMap = {
|
|
|
2990
3039
|
enchantable: ItemEnchantableComponent;
|
|
2991
3040
|
food: ItemFoodComponent;
|
|
2992
3041
|
inventory: ItemInventoryComponent;
|
|
3042
|
+
'minecraft:book': ItemBookComponent;
|
|
2993
3043
|
'minecraft:compostable': ItemCompostableComponent;
|
|
2994
3044
|
'minecraft:cooldown': ItemCooldownComponent;
|
|
2995
3045
|
'minecraft:durability': ItemDurabilityComponent;
|
|
@@ -5639,6 +5689,14 @@ export class Camera {
|
|
|
5639
5689
|
* @throws This function can throw errors.
|
|
5640
5690
|
*/
|
|
5641
5691
|
setDefaultCamera(cameraPreset: string, easeOptions?: EaseOptions): void;
|
|
5692
|
+
/**
|
|
5693
|
+
* @beta
|
|
5694
|
+
* @remarks
|
|
5695
|
+
* This function can't be called in read-only mode.
|
|
5696
|
+
*
|
|
5697
|
+
* @throws This function can throw errors.
|
|
5698
|
+
*/
|
|
5699
|
+
setFov(fovCameraOptions?: CameraFovOptions): void;
|
|
5642
5700
|
}
|
|
5643
5701
|
|
|
5644
5702
|
/**
|
|
@@ -6722,6 +6780,21 @@ export class ContainerSlot {
|
|
|
6722
6780
|
* {@link InvalidContainerSlotError}
|
|
6723
6781
|
*/
|
|
6724
6782
|
getLore(): string[];
|
|
6783
|
+
/**
|
|
6784
|
+
* @beta
|
|
6785
|
+
* @remarks
|
|
6786
|
+
* Returns the lore value - a secondary display string - for an
|
|
6787
|
+
* ItemStack. String lore lines will be converted to a {@link
|
|
6788
|
+
* RawMessage} and put under {@link RawMessage.text}.
|
|
6789
|
+
*
|
|
6790
|
+
* @returns
|
|
6791
|
+
* An array of lore lines. If the item does not have lore,
|
|
6792
|
+
* returns an empty array.
|
|
6793
|
+
* @throws This function can throw errors.
|
|
6794
|
+
*
|
|
6795
|
+
* {@link InvalidContainerSlotError}
|
|
6796
|
+
*/
|
|
6797
|
+
getRawLore(): RawMessage[];
|
|
6725
6798
|
/**
|
|
6726
6799
|
* @remarks
|
|
6727
6800
|
* Returns all tags for the item in the slot.
|
|
@@ -6827,9 +6900,11 @@ export class ContainerSlot {
|
|
|
6827
6900
|
* set.
|
|
6828
6901
|
* @throws This function can throw errors.
|
|
6829
6902
|
*
|
|
6830
|
-
* {@link
|
|
6903
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6831
6904
|
*
|
|
6832
6905
|
* {@link InvalidContainerSlotError}
|
|
6906
|
+
*
|
|
6907
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6833
6908
|
*/
|
|
6834
6909
|
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
6835
6910
|
/**
|
|
@@ -6843,9 +6918,11 @@ export class ContainerSlot {
|
|
|
6843
6918
|
* @throws
|
|
6844
6919
|
* Throws if the slot's container is invalid.
|
|
6845
6920
|
*
|
|
6846
|
-
* {@link
|
|
6921
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6847
6922
|
*
|
|
6848
6923
|
* {@link InvalidContainerSlotError}
|
|
6924
|
+
*
|
|
6925
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6849
6926
|
*/
|
|
6850
6927
|
setDynamicProperty(identifier: string, value?: boolean | number | string | Vector3): void;
|
|
6851
6928
|
/**
|
|
@@ -6880,9 +6957,11 @@ export class ContainerSlot {
|
|
|
6880
6957
|
*
|
|
6881
6958
|
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6882
6959
|
*
|
|
6960
|
+
* {@link Error}
|
|
6961
|
+
*
|
|
6883
6962
|
* {@link InvalidContainerSlotError}
|
|
6884
6963
|
*/
|
|
6885
|
-
setLore(loreList?: string[]): void;
|
|
6964
|
+
setLore(loreList?: (RawMessage | string)[]): void;
|
|
6886
6965
|
}
|
|
6887
6966
|
|
|
6888
6967
|
/**
|
|
@@ -7317,6 +7396,10 @@ export class Dimension {
|
|
|
7317
7396
|
* @returns
|
|
7318
7397
|
* An entity array.
|
|
7319
7398
|
* @throws This function can throw errors.
|
|
7399
|
+
*
|
|
7400
|
+
* {@link CommandError}
|
|
7401
|
+
*
|
|
7402
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7320
7403
|
* @example bounceSkeletons.ts
|
|
7321
7404
|
* ```typescript
|
|
7322
7405
|
* import { EntityQueryOptions, DimensionLocation } from "@minecraft/server";
|
|
@@ -7405,6 +7488,14 @@ export class Dimension {
|
|
|
7405
7488
|
* @param options
|
|
7406
7489
|
* Additional options for processing this raycast query.
|
|
7407
7490
|
* @throws This function can throw errors.
|
|
7491
|
+
*
|
|
7492
|
+
* {@link minecraftcommon.EngineError}
|
|
7493
|
+
*
|
|
7494
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7495
|
+
*
|
|
7496
|
+
* {@link InvalidEntityError}
|
|
7497
|
+
*
|
|
7498
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7408
7499
|
*/
|
|
7409
7500
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
7410
7501
|
/**
|
|
@@ -7418,6 +7509,10 @@ export class Dimension {
|
|
|
7418
7509
|
* @returns
|
|
7419
7510
|
* A player array.
|
|
7420
7511
|
* @throws This function can throw errors.
|
|
7512
|
+
*
|
|
7513
|
+
* {@link CommandError}
|
|
7514
|
+
*
|
|
7515
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7421
7516
|
*/
|
|
7422
7517
|
getPlayers(options?: EntityQueryOptions): Player[];
|
|
7423
7518
|
/**
|
|
@@ -7515,6 +7610,8 @@ export class Dimension {
|
|
|
7515
7610
|
* An error will be thrown if fade is less than 0.0.
|
|
7516
7611
|
* An error will be thrown if pitch is less than 0.01.
|
|
7517
7612
|
* An error will be thrown if volume is less than 0.0.
|
|
7613
|
+
*
|
|
7614
|
+
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
7518
7615
|
*/
|
|
7519
7616
|
playSound(soundId: string, location: Vector3, soundOptions?: WorldSoundOptions): void;
|
|
7520
7617
|
/**
|
|
@@ -7614,10 +7711,12 @@ export class Dimension {
|
|
|
7614
7711
|
* Newly created entity at the specified location.
|
|
7615
7712
|
* @throws This function can throw errors.
|
|
7616
7713
|
*
|
|
7617
|
-
* {@link
|
|
7714
|
+
* {@link EntitySpawnError}
|
|
7618
7715
|
*
|
|
7619
7716
|
* {@link minecraftcommon.InvalidArgumentError}
|
|
7620
7717
|
*
|
|
7718
|
+
* {@link InvalidEntityError}
|
|
7719
|
+
*
|
|
7621
7720
|
* {@link LocationInUnloadedChunkError}
|
|
7622
7721
|
*
|
|
7623
7722
|
* {@link LocationOutOfWorldBoundariesError}
|
|
@@ -8101,6 +8200,10 @@ export class Entity {
|
|
|
8101
8200
|
* Dimension that the entity is currently within.
|
|
8102
8201
|
*
|
|
8103
8202
|
* @throws This property can throw when used.
|
|
8203
|
+
*
|
|
8204
|
+
* {@link minecraftcommon.EngineError}
|
|
8205
|
+
*
|
|
8206
|
+
* {@link InvalidEntityError}
|
|
8104
8207
|
*/
|
|
8105
8208
|
readonly dimension: Dimension;
|
|
8106
8209
|
/**
|
|
@@ -8121,6 +8224,8 @@ export class Entity {
|
|
|
8121
8224
|
* stone wall.
|
|
8122
8225
|
*
|
|
8123
8226
|
* @throws This property can throw when used.
|
|
8227
|
+
*
|
|
8228
|
+
* {@link InvalidEntityError}
|
|
8124
8229
|
*/
|
|
8125
8230
|
readonly isClimbing: boolean;
|
|
8126
8231
|
/**
|
|
@@ -8129,6 +8234,8 @@ export class Entity {
|
|
|
8129
8234
|
* greater than 1 while gliding.
|
|
8130
8235
|
*
|
|
8131
8236
|
* @throws This property can throw when used.
|
|
8237
|
+
*
|
|
8238
|
+
* {@link InvalidEntityError}
|
|
8132
8239
|
*/
|
|
8133
8240
|
readonly isFalling: boolean;
|
|
8134
8241
|
/**
|
|
@@ -8136,6 +8243,8 @@ export class Entity {
|
|
|
8136
8243
|
* Whether any part of the entity is inside a water block.
|
|
8137
8244
|
*
|
|
8138
8245
|
* @throws This property can throw when used.
|
|
8246
|
+
*
|
|
8247
|
+
* {@link InvalidEntityError}
|
|
8139
8248
|
*/
|
|
8140
8249
|
readonly isInWater: boolean;
|
|
8141
8250
|
/**
|
|
@@ -8146,6 +8255,8 @@ export class Entity {
|
|
|
8146
8255
|
* no gravity this property may be incorrect.
|
|
8147
8256
|
*
|
|
8148
8257
|
* @throws This property can throw when used.
|
|
8258
|
+
*
|
|
8259
|
+
* {@link InvalidEntityError}
|
|
8149
8260
|
*/
|
|
8150
8261
|
readonly isOnGround: boolean;
|
|
8151
8262
|
/**
|
|
@@ -8153,6 +8264,8 @@ export class Entity {
|
|
|
8153
8264
|
* If true, the entity is currently sleeping.
|
|
8154
8265
|
*
|
|
8155
8266
|
* @throws This property can throw when used.
|
|
8267
|
+
*
|
|
8268
|
+
* {@link InvalidEntityError}
|
|
8156
8269
|
*/
|
|
8157
8270
|
readonly isSleeping: boolean;
|
|
8158
8271
|
/**
|
|
@@ -8171,6 +8284,8 @@ export class Entity {
|
|
|
8171
8284
|
* with Carrot on a Stick.
|
|
8172
8285
|
*
|
|
8173
8286
|
* @throws This property can throw when used.
|
|
8287
|
+
*
|
|
8288
|
+
* {@link InvalidEntityError}
|
|
8174
8289
|
*/
|
|
8175
8290
|
readonly isSprinting: boolean;
|
|
8176
8291
|
/**
|
|
@@ -8179,6 +8294,8 @@ export class Entity {
|
|
|
8179
8294
|
* player using the swim action or a fish in water.
|
|
8180
8295
|
*
|
|
8181
8296
|
* @throws This property can throw when used.
|
|
8297
|
+
*
|
|
8298
|
+
* {@link InvalidEntityError}
|
|
8182
8299
|
*/
|
|
8183
8300
|
readonly isSwimming: boolean;
|
|
8184
8301
|
/**
|
|
@@ -8205,6 +8322,8 @@ export class Entity {
|
|
|
8205
8322
|
* Current location of the entity.
|
|
8206
8323
|
*
|
|
8207
8324
|
* @throws This property can throw when used.
|
|
8325
|
+
*
|
|
8326
|
+
* {@link InvalidEntityError}
|
|
8208
8327
|
*/
|
|
8209
8328
|
readonly location: Vector3;
|
|
8210
8329
|
/**
|
|
@@ -8230,6 +8349,8 @@ export class Entity {
|
|
|
8230
8349
|
* currently has no target returns undefined.
|
|
8231
8350
|
*
|
|
8232
8351
|
* @throws This property can throw when used.
|
|
8352
|
+
*
|
|
8353
|
+
* {@link InvalidEntityError}
|
|
8233
8354
|
*/
|
|
8234
8355
|
readonly target?: Entity;
|
|
8235
8356
|
/**
|
|
@@ -8261,6 +8382,12 @@ export class Entity {
|
|
|
8261
8382
|
* amplifier are outside of the valid ranges, or if the effect
|
|
8262
8383
|
* does not exist.
|
|
8263
8384
|
* @throws This function can throw errors.
|
|
8385
|
+
*
|
|
8386
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
8387
|
+
*
|
|
8388
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
8389
|
+
*
|
|
8390
|
+
* {@link InvalidEntityError}
|
|
8264
8391
|
* @example spawnPoisonedVillager.ts
|
|
8265
8392
|
* ```typescript
|
|
8266
8393
|
* import { DimensionLocation } from "@minecraft/server";
|
|
@@ -8320,6 +8447,10 @@ export class Entity {
|
|
|
8320
8447
|
* Returns true if the tag was added successfully. This can
|
|
8321
8448
|
* fail if the tag already exists on the entity.
|
|
8322
8449
|
* @throws This function can throw errors.
|
|
8450
|
+
*
|
|
8451
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
8452
|
+
*
|
|
8453
|
+
* {@link InvalidEntityError}
|
|
8323
8454
|
* @example tagsQuery.ts
|
|
8324
8455
|
* ```typescript
|
|
8325
8456
|
* import { EntityQueryOptions, DimensionLocation } from "@minecraft/server";
|
|
@@ -8362,6 +8493,12 @@ export class Entity {
|
|
|
8362
8493
|
* if the entity is invulnerable or if the damage applied is
|
|
8363
8494
|
* less than or equal to 0.
|
|
8364
8495
|
* @throws This function can throw errors.
|
|
8496
|
+
*
|
|
8497
|
+
* {@link minecraftcommon.EngineError}
|
|
8498
|
+
*
|
|
8499
|
+
* {@link InvalidEntityError}
|
|
8500
|
+
*
|
|
8501
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
8365
8502
|
* @example applyDamageThenHeal.ts
|
|
8366
8503
|
* ```typescript
|
|
8367
8504
|
* import { system, EntityHealthComponent, EntityComponentTypes, DimensionLocation } from "@minecraft/server";
|
|
@@ -8398,7 +8535,7 @@ export class Entity {
|
|
|
8398
8535
|
*
|
|
8399
8536
|
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
8400
8537
|
*
|
|
8401
|
-
* {@link
|
|
8538
|
+
* {@link InvalidEntityError}
|
|
8402
8539
|
* @example applyImpulse.ts
|
|
8403
8540
|
* ```typescript
|
|
8404
8541
|
* import { DimensionLocation } from "@minecraft/server";
|
|
@@ -8425,6 +8562,10 @@ export class Entity {
|
|
|
8425
8562
|
* @param verticalStrength
|
|
8426
8563
|
* Knockback strength for the vertical vector.
|
|
8427
8564
|
* @throws This function can throw errors.
|
|
8565
|
+
*
|
|
8566
|
+
* {@link InvalidEntityError}
|
|
8567
|
+
*
|
|
8568
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
8428
8569
|
* @example bounceSkeletons.ts
|
|
8429
8570
|
* ```typescript
|
|
8430
8571
|
* import { EntityQueryOptions, DimensionLocation } from "@minecraft/server";
|
|
@@ -8454,6 +8595,8 @@ export class Entity {
|
|
|
8454
8595
|
* entity.
|
|
8455
8596
|
*
|
|
8456
8597
|
* @throws This function can throw errors.
|
|
8598
|
+
*
|
|
8599
|
+
* {@link InvalidEntityError}
|
|
8457
8600
|
*/
|
|
8458
8601
|
clearDynamicProperties(): void;
|
|
8459
8602
|
/**
|
|
@@ -8463,6 +8606,8 @@ export class Entity {
|
|
|
8463
8606
|
* This function can't be called in read-only mode.
|
|
8464
8607
|
*
|
|
8465
8608
|
* @throws This function can throw errors.
|
|
8609
|
+
*
|
|
8610
|
+
* {@link InvalidEntityError}
|
|
8466
8611
|
* @example applyImpulse.ts
|
|
8467
8612
|
* ```typescript
|
|
8468
8613
|
* import { DimensionLocation } from "@minecraft/server";
|
|
@@ -8494,6 +8639,8 @@ export class Entity {
|
|
|
8494
8639
|
* @returns
|
|
8495
8640
|
* Returns whether the entity was on fire.
|
|
8496
8641
|
* @throws This function can throw errors.
|
|
8642
|
+
*
|
|
8643
|
+
* {@link InvalidEntityError}
|
|
8497
8644
|
* @example setOnFire.ts
|
|
8498
8645
|
* ```typescript
|
|
8499
8646
|
* import { system, EntityOnFireComponent, EntityComponentTypes, DimensionLocation } from "@minecraft/server";
|
|
@@ -8526,6 +8673,8 @@ export class Entity {
|
|
|
8526
8673
|
* Returns the first intersecting block from the direction that
|
|
8527
8674
|
* this entity is looking at.
|
|
8528
8675
|
* @throws This function can throw errors.
|
|
8676
|
+
*
|
|
8677
|
+
* {@link InvalidEntityError}
|
|
8529
8678
|
*/
|
|
8530
8679
|
getBlockFromViewDirection(options?: BlockRaycastOptions): BlockRaycastHit | undefined;
|
|
8531
8680
|
/**
|
|
@@ -8569,6 +8718,8 @@ export class Entity {
|
|
|
8569
8718
|
* Returns the value for the property, or undefined if the
|
|
8570
8719
|
* property has not been set.
|
|
8571
8720
|
* @throws This function can throw errors.
|
|
8721
|
+
*
|
|
8722
|
+
* {@link InvalidEntityError}
|
|
8572
8723
|
*/
|
|
8573
8724
|
getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
|
|
8574
8725
|
/**
|
|
@@ -8579,6 +8730,8 @@ export class Entity {
|
|
|
8579
8730
|
* @returns
|
|
8580
8731
|
* A string array of the dynamic properties set on this entity.
|
|
8581
8732
|
* @throws This function can throw errors.
|
|
8733
|
+
*
|
|
8734
|
+
* {@link InvalidEntityError}
|
|
8582
8735
|
*/
|
|
8583
8736
|
getDynamicPropertyIds(): string[];
|
|
8584
8737
|
/**
|
|
@@ -8591,6 +8744,8 @@ export class Entity {
|
|
|
8591
8744
|
* properties, it may be slow to load on various devices.
|
|
8592
8745
|
*
|
|
8593
8746
|
* @throws This function can throw errors.
|
|
8747
|
+
*
|
|
8748
|
+
* {@link InvalidEntityError}
|
|
8594
8749
|
*/
|
|
8595
8750
|
getDynamicPropertyTotalByteCount(): number;
|
|
8596
8751
|
/**
|
|
@@ -8606,6 +8761,10 @@ export class Entity {
|
|
|
8606
8761
|
* effect is not present, or throws an error if the effect does
|
|
8607
8762
|
* not exist.
|
|
8608
8763
|
* @throws This function can throw errors.
|
|
8764
|
+
*
|
|
8765
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
8766
|
+
*
|
|
8767
|
+
* {@link InvalidEntityError}
|
|
8609
8768
|
*/
|
|
8610
8769
|
getEffect(effectType: EffectType | string): Effect | undefined;
|
|
8611
8770
|
/**
|
|
@@ -8615,6 +8774,8 @@ export class Entity {
|
|
|
8615
8774
|
* @returns
|
|
8616
8775
|
* List of effects.
|
|
8617
8776
|
* @throws This function can throw errors.
|
|
8777
|
+
*
|
|
8778
|
+
* {@link InvalidEntityError}
|
|
8618
8779
|
*/
|
|
8619
8780
|
getEffects(): Effect[];
|
|
8620
8781
|
/**
|
|
@@ -8628,6 +8789,14 @@ export class Entity {
|
|
|
8628
8789
|
* Returns a set of entities from the direction that this
|
|
8629
8790
|
* entity is looking at.
|
|
8630
8791
|
* @throws This function can throw errors.
|
|
8792
|
+
*
|
|
8793
|
+
* {@link minecraftcommon.EngineError}
|
|
8794
|
+
*
|
|
8795
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
8796
|
+
*
|
|
8797
|
+
* {@link InvalidEntityError}
|
|
8798
|
+
*
|
|
8799
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
8631
8800
|
*/
|
|
8632
8801
|
getEntitiesFromViewDirection(options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8633
8802
|
/**
|
|
@@ -8639,6 +8808,8 @@ export class Entity {
|
|
|
8639
8808
|
* Returns the current location of the head component of this
|
|
8640
8809
|
* entity.
|
|
8641
8810
|
* @throws This function can throw errors.
|
|
8811
|
+
*
|
|
8812
|
+
* {@link InvalidEntityError}
|
|
8642
8813
|
*/
|
|
8643
8814
|
getHeadLocation(): Vector3;
|
|
8644
8815
|
/**
|
|
@@ -8656,6 +8827,8 @@ export class Entity {
|
|
|
8656
8827
|
* returned.
|
|
8657
8828
|
* @throws
|
|
8658
8829
|
* Throws if the entity is invalid.
|
|
8830
|
+
*
|
|
8831
|
+
* {@link InvalidEntityError}
|
|
8659
8832
|
*/
|
|
8660
8833
|
getProperty(identifier: string): boolean | number | string | undefined;
|
|
8661
8834
|
/**
|
|
@@ -8666,6 +8839,8 @@ export class Entity {
|
|
|
8666
8839
|
* Returns a Vec2 containing the rotation of this entity (in
|
|
8667
8840
|
* degrees).
|
|
8668
8841
|
* @throws This function can throw errors.
|
|
8842
|
+
*
|
|
8843
|
+
* {@link InvalidEntityError}
|
|
8669
8844
|
*/
|
|
8670
8845
|
getRotation(): Vector2;
|
|
8671
8846
|
/**
|
|
@@ -8675,6 +8850,8 @@ export class Entity {
|
|
|
8675
8850
|
* @returns
|
|
8676
8851
|
* An array containing all tags as strings.
|
|
8677
8852
|
* @throws This function can throw errors.
|
|
8853
|
+
*
|
|
8854
|
+
* {@link InvalidEntityError}
|
|
8678
8855
|
*/
|
|
8679
8856
|
getTags(): string[];
|
|
8680
8857
|
/**
|
|
@@ -8684,6 +8861,8 @@ export class Entity {
|
|
|
8684
8861
|
* @returns
|
|
8685
8862
|
* Returns the current velocity vector of the entity.
|
|
8686
8863
|
* @throws This function can throw errors.
|
|
8864
|
+
*
|
|
8865
|
+
* {@link InvalidEntityError}
|
|
8687
8866
|
* @example getFireworkVelocity.ts
|
|
8688
8867
|
* ```typescript
|
|
8689
8868
|
* import { system, DimensionLocation } from "@minecraft/server";
|
|
@@ -8711,6 +8890,8 @@ export class Entity {
|
|
|
8711
8890
|
* @returns
|
|
8712
8891
|
* Returns the current view direction of the entity.
|
|
8713
8892
|
* @throws This function can throw errors.
|
|
8893
|
+
*
|
|
8894
|
+
* {@link InvalidEntityError}
|
|
8714
8895
|
*/
|
|
8715
8896
|
getViewDirection(): Vector3;
|
|
8716
8897
|
/**
|
|
@@ -8739,6 +8920,8 @@ export class Entity {
|
|
|
8739
8920
|
* @returns
|
|
8740
8921
|
* Returns whether an entity has a particular tag.
|
|
8741
8922
|
* @throws This function can throw errors.
|
|
8923
|
+
*
|
|
8924
|
+
* {@link InvalidEntityError}
|
|
8742
8925
|
*/
|
|
8743
8926
|
hasTag(tag: string): boolean;
|
|
8744
8927
|
/**
|
|
@@ -8751,6 +8934,8 @@ export class Entity {
|
|
|
8751
8934
|
* Returns true if entity can be killed (even if it is already
|
|
8752
8935
|
* dead), otherwise it returns false.
|
|
8753
8936
|
* @throws This function can throw errors.
|
|
8937
|
+
*
|
|
8938
|
+
* {@link InvalidEntityError}
|
|
8754
8939
|
* @example tagsQuery.ts
|
|
8755
8940
|
* ```typescript
|
|
8756
8941
|
* import { EntityQueryOptions, DimensionLocation } from "@minecraft/server";
|
|
@@ -8789,6 +8974,10 @@ export class Entity {
|
|
|
8789
8974
|
* The target location that this entity should face/look
|
|
8790
8975
|
* towards.
|
|
8791
8976
|
* @throws This function can throw errors.
|
|
8977
|
+
*
|
|
8978
|
+
* {@link InvalidEntityError}
|
|
8979
|
+
*
|
|
8980
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
8792
8981
|
*/
|
|
8793
8982
|
lookAt(targetLocation: Vector3): void;
|
|
8794
8983
|
/**
|
|
@@ -8804,6 +8993,12 @@ export class Entity {
|
|
|
8804
8993
|
* passed in EntityQueryOptions, otherwise it returns false.
|
|
8805
8994
|
* @throws
|
|
8806
8995
|
* Throws if the query options are misconfigured.
|
|
8996
|
+
*
|
|
8997
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
8998
|
+
*
|
|
8999
|
+
* {@link InvalidEntityError}
|
|
9000
|
+
*
|
|
9001
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
8807
9002
|
*/
|
|
8808
9003
|
matches(options: EntityQueryOptions): boolean;
|
|
8809
9004
|
/**
|
|
@@ -8818,6 +9013,8 @@ export class Entity {
|
|
|
8818
9013
|
* Additional options to control the playback and transitions
|
|
8819
9014
|
* of the animation.
|
|
8820
9015
|
* @throws This function can throw errors.
|
|
9016
|
+
*
|
|
9017
|
+
* {@link InvalidEntityError}
|
|
8821
9018
|
*/
|
|
8822
9019
|
playAnimation(animationName: string, options?: PlayAnimationOptions): void;
|
|
8823
9020
|
/**
|
|
@@ -8829,6 +9026,10 @@ export class Entity {
|
|
|
8829
9026
|
* This function can't be called in read-only mode.
|
|
8830
9027
|
*
|
|
8831
9028
|
* @throws This function can throw errors.
|
|
9029
|
+
*
|
|
9030
|
+
* {@link InvalidEntityError}
|
|
9031
|
+
*
|
|
9032
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
8832
9033
|
*/
|
|
8833
9034
|
remove(): void;
|
|
8834
9035
|
/**
|
|
@@ -8844,6 +9045,10 @@ export class Entity {
|
|
|
8844
9045
|
* Returns true if the effect has been removed. Returns false
|
|
8845
9046
|
* if the effect is not found or does not exist.
|
|
8846
9047
|
* @throws This function can throw errors.
|
|
9048
|
+
*
|
|
9049
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
9050
|
+
*
|
|
9051
|
+
* {@link InvalidEntityError}
|
|
8847
9052
|
*/
|
|
8848
9053
|
removeEffect(effectType: EffectType | string): boolean;
|
|
8849
9054
|
/**
|
|
@@ -8857,6 +9062,8 @@ export class Entity {
|
|
|
8857
9062
|
* @returns
|
|
8858
9063
|
* Returns whether the tag existed on the entity.
|
|
8859
9064
|
* @throws This function can throw errors.
|
|
9065
|
+
*
|
|
9066
|
+
* {@link InvalidEntityError}
|
|
8860
9067
|
*/
|
|
8861
9068
|
removeTag(tag: string): boolean;
|
|
8862
9069
|
/**
|
|
@@ -8880,6 +9087,8 @@ export class Entity {
|
|
|
8880
9087
|
* {@link minecraftcommon.EngineError}
|
|
8881
9088
|
*
|
|
8882
9089
|
* {@link Error}
|
|
9090
|
+
*
|
|
9091
|
+
* {@link InvalidEntityError}
|
|
8883
9092
|
*/
|
|
8884
9093
|
resetProperty(identifier: string): boolean | number | string;
|
|
8885
9094
|
/**
|
|
@@ -8910,6 +9119,10 @@ export class Entity {
|
|
|
8910
9119
|
* A Record of key value pairs of the dynamic properties to
|
|
8911
9120
|
* set.
|
|
8912
9121
|
* @throws This function can throw errors.
|
|
9122
|
+
*
|
|
9123
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
9124
|
+
*
|
|
9125
|
+
* {@link InvalidEntityError}
|
|
8913
9126
|
*/
|
|
8914
9127
|
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
8915
9128
|
/**
|
|
@@ -8921,6 +9134,10 @@ export class Entity {
|
|
|
8921
9134
|
* @param value
|
|
8922
9135
|
* Data value of the property to set.
|
|
8923
9136
|
* @throws This function can throw errors.
|
|
9137
|
+
*
|
|
9138
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
9139
|
+
*
|
|
9140
|
+
* {@link InvalidEntityError}
|
|
8924
9141
|
*/
|
|
8925
9142
|
setDynamicProperty(identifier: string, value?: boolean | number | string | Vector3): void;
|
|
8926
9143
|
/**
|
|
@@ -8943,6 +9160,8 @@ export class Entity {
|
|
|
8943
9160
|
* is less than or equal to zero, the entity is wet or the
|
|
8944
9161
|
* entity is immune to fire.
|
|
8945
9162
|
* @throws This function can throw errors.
|
|
9163
|
+
*
|
|
9164
|
+
* {@link InvalidEntityError}
|
|
8946
9165
|
* @example setOnFire.ts
|
|
8947
9166
|
* ```typescript
|
|
8948
9167
|
* import { system, EntityOnFireComponent, EntityComponentTypes, DimensionLocation } from "@minecraft/server";
|
|
@@ -8985,6 +9204,12 @@ export class Entity {
|
|
|
8985
9204
|
* (int, float properties).
|
|
8986
9205
|
* Throws if the provided string value does not match the set
|
|
8987
9206
|
* of accepted enum values (enum properties
|
|
9207
|
+
*
|
|
9208
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
9209
|
+
*
|
|
9210
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
9211
|
+
*
|
|
9212
|
+
* {@link InvalidEntityError}
|
|
8988
9213
|
*/
|
|
8989
9214
|
setProperty(identifier: string, value: boolean | number | string): void;
|
|
8990
9215
|
/**
|
|
@@ -8998,6 +9223,8 @@ export class Entity {
|
|
|
8998
9223
|
* mobs, the x rotation controls the head tilt and the y
|
|
8999
9224
|
* rotation controls the body rotation.
|
|
9000
9225
|
* @throws This function can throw errors.
|
|
9226
|
+
*
|
|
9227
|
+
* {@link InvalidEntityError}
|
|
9001
9228
|
*/
|
|
9002
9229
|
setRotation(rotation: Vector2): void;
|
|
9003
9230
|
/**
|
|
@@ -9011,6 +9238,10 @@ export class Entity {
|
|
|
9011
9238
|
* @param teleportOptions
|
|
9012
9239
|
* Options regarding the teleport operation.
|
|
9013
9240
|
* @throws This function can throw errors.
|
|
9241
|
+
*
|
|
9242
|
+
* {@link InvalidEntityError}
|
|
9243
|
+
*
|
|
9244
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
9014
9245
|
* @example teleport.ts
|
|
9015
9246
|
* ```typescript
|
|
9016
9247
|
* import { system, DimensionLocation } from "@minecraft/server";
|
|
@@ -9070,6 +9301,10 @@ export class Entity {
|
|
|
9070
9301
|
* @throws
|
|
9071
9302
|
* If the event is not defined in the definition of the entity,
|
|
9072
9303
|
* an error will be thrown.
|
|
9304
|
+
*
|
|
9305
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
9306
|
+
*
|
|
9307
|
+
* {@link InvalidEntityError}
|
|
9073
9308
|
* @example triggerEvent.ts
|
|
9074
9309
|
* ```typescript
|
|
9075
9310
|
* // A function that spawns a creeper and triggers it to explode immediately
|
|
@@ -9112,6 +9347,10 @@ export class Entity {
|
|
|
9112
9347
|
* destination chunk is unloaded or if the teleport would
|
|
9113
9348
|
* result in intersecting with blocks.
|
|
9114
9349
|
* @throws This function can throw errors.
|
|
9350
|
+
*
|
|
9351
|
+
* {@link InvalidEntityError}
|
|
9352
|
+
*
|
|
9353
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
9115
9354
|
*/
|
|
9116
9355
|
tryTeleport(location: Vector3, teleportOptions?: TeleportOptions): boolean;
|
|
9117
9356
|
}
|
|
@@ -9566,7 +9805,7 @@ export class EntityDieAfterEventSignal {
|
|
|
9566
9805
|
|
|
9567
9806
|
/**
|
|
9568
9807
|
* Provides access to a mob's equipment slots. This component
|
|
9569
|
-
* exists
|
|
9808
|
+
* exists on player entities.
|
|
9570
9809
|
* @example givePlayerElytra.ts
|
|
9571
9810
|
* ```typescript
|
|
9572
9811
|
* // Gives the player Elytra
|
|
@@ -9585,7 +9824,7 @@ export class EntityDieAfterEventSignal {
|
|
|
9585
9824
|
export class EntityEquippableComponent extends EntityComponent {
|
|
9586
9825
|
private constructor();
|
|
9587
9826
|
/**
|
|
9588
|
-
* @
|
|
9827
|
+
* @rc
|
|
9589
9828
|
* @remarks
|
|
9590
9829
|
* Returns the total Armor level of the owner.
|
|
9591
9830
|
*
|
|
@@ -9595,7 +9834,7 @@ export class EntityEquippableComponent extends EntityComponent {
|
|
|
9595
9834
|
*/
|
|
9596
9835
|
readonly totalArmor: number;
|
|
9597
9836
|
/**
|
|
9598
|
-
* @
|
|
9837
|
+
* @rc
|
|
9599
9838
|
* @remarks
|
|
9600
9839
|
* Returns the total Toughness level of the owner.
|
|
9601
9840
|
*
|
|
@@ -9646,7 +9885,7 @@ export class EntityEquippableComponent extends EntityComponent {
|
|
|
9646
9885
|
}
|
|
9647
9886
|
|
|
9648
9887
|
/**
|
|
9649
|
-
* @
|
|
9888
|
+
* @rc
|
|
9650
9889
|
* Defines the interactions with this entity for Exhaustion.
|
|
9651
9890
|
* Wraps the `minecraft.player.exhaustion` attribute.
|
|
9652
9891
|
*/
|
|
@@ -9944,7 +10183,7 @@ export class EntityHitEntityAfterEventSignal {
|
|
|
9944
10183
|
}
|
|
9945
10184
|
|
|
9946
10185
|
/**
|
|
9947
|
-
* @
|
|
10186
|
+
* @rc
|
|
9948
10187
|
* Defines the interactions with this entity for hunger. Wraps
|
|
9949
10188
|
* the `minecraft.player.hunger` attribute.
|
|
9950
10189
|
*/
|
|
@@ -11312,7 +11551,7 @@ export class EntityRidingComponent extends EntityComponent {
|
|
|
11312
11551
|
}
|
|
11313
11552
|
|
|
11314
11553
|
/**
|
|
11315
|
-
* @
|
|
11554
|
+
* @rc
|
|
11316
11555
|
* Defines the interactions with this entity for Saturation.
|
|
11317
11556
|
* Wraps the `minecraft.player.saturation` attribute.
|
|
11318
11557
|
*/
|
|
@@ -12232,6 +12471,214 @@ export class InputInfo {
|
|
|
12232
12471
|
getMovementVector(): Vector2;
|
|
12233
12472
|
}
|
|
12234
12473
|
|
|
12474
|
+
/**
|
|
12475
|
+
* @beta
|
|
12476
|
+
* When present on an item, this item is a book item. Can
|
|
12477
|
+
* access and modify the contents of the book and sign it.
|
|
12478
|
+
*/
|
|
12479
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12480
|
+
export class ItemBookComponent extends ItemComponent {
|
|
12481
|
+
private constructor();
|
|
12482
|
+
/**
|
|
12483
|
+
* @remarks
|
|
12484
|
+
* The name of the author of the book if it is signed,
|
|
12485
|
+
* otherwise undefined.
|
|
12486
|
+
*
|
|
12487
|
+
* @throws This property can throw when used.
|
|
12488
|
+
*
|
|
12489
|
+
* {@link InvalidItemStackError}
|
|
12490
|
+
*/
|
|
12491
|
+
readonly author?: string;
|
|
12492
|
+
/**
|
|
12493
|
+
* @remarks
|
|
12494
|
+
* The contents of pages in the book that are in string format.
|
|
12495
|
+
* Entries not in string format will be undefined.
|
|
12496
|
+
*
|
|
12497
|
+
* @throws This property can throw when used.
|
|
12498
|
+
*
|
|
12499
|
+
* {@link InvalidItemStackError}
|
|
12500
|
+
*/
|
|
12501
|
+
readonly contents: (string | undefined)[];
|
|
12502
|
+
/**
|
|
12503
|
+
* @remarks
|
|
12504
|
+
* Determines whether the book has been signed or not.
|
|
12505
|
+
*
|
|
12506
|
+
* @throws This property can throw when used.
|
|
12507
|
+
*
|
|
12508
|
+
* {@link InvalidItemStackError}
|
|
12509
|
+
*/
|
|
12510
|
+
readonly isSigned: boolean;
|
|
12511
|
+
/**
|
|
12512
|
+
* @remarks
|
|
12513
|
+
* The amount of pages the book has.
|
|
12514
|
+
*
|
|
12515
|
+
* @throws This property can throw when used.
|
|
12516
|
+
*
|
|
12517
|
+
* {@link InvalidItemStackError}
|
|
12518
|
+
*/
|
|
12519
|
+
readonly pageCount: number;
|
|
12520
|
+
/**
|
|
12521
|
+
* @remarks
|
|
12522
|
+
* The contents of pages in the book that are in {@link
|
|
12523
|
+
* RawMessage} format. Entries not in {@link RawMessage} format
|
|
12524
|
+
* will be undefined.
|
|
12525
|
+
*
|
|
12526
|
+
* @throws This property can throw when used.
|
|
12527
|
+
*
|
|
12528
|
+
* {@link InvalidItemStackError}
|
|
12529
|
+
*/
|
|
12530
|
+
readonly rawContents: (RawMessage | undefined)[];
|
|
12531
|
+
/**
|
|
12532
|
+
* @remarks
|
|
12533
|
+
* The title of the book if it is signed, otherwise undefined.
|
|
12534
|
+
*
|
|
12535
|
+
* @throws This property can throw when used.
|
|
12536
|
+
*
|
|
12537
|
+
* {@link InvalidItemStackError}
|
|
12538
|
+
*/
|
|
12539
|
+
readonly title?: string;
|
|
12540
|
+
static readonly componentId = 'minecraft:book';
|
|
12541
|
+
/**
|
|
12542
|
+
* @remarks
|
|
12543
|
+
* Gets the string format content of a page for a given index.
|
|
12544
|
+
*
|
|
12545
|
+
* @param pageIndex
|
|
12546
|
+
* The index of the page.
|
|
12547
|
+
* @returns
|
|
12548
|
+
* The content of the page if a valid index is provided and it
|
|
12549
|
+
* is in string format, otherwise returns undefined.
|
|
12550
|
+
* @throws This function can throw errors.
|
|
12551
|
+
*
|
|
12552
|
+
* {@link InvalidItemStackError}
|
|
12553
|
+
*/
|
|
12554
|
+
getPageContent(pageIndex: number): string | undefined;
|
|
12555
|
+
/**
|
|
12556
|
+
* @remarks
|
|
12557
|
+
* Gets the {@link RawMessage} format content of a page for a
|
|
12558
|
+
* given index.
|
|
12559
|
+
*
|
|
12560
|
+
* @param pageIndex
|
|
12561
|
+
* The index of the page.
|
|
12562
|
+
* @returns
|
|
12563
|
+
* The content of the page if a valid index is provided and it
|
|
12564
|
+
* is in {@link RawMessage} format, otherwise returns
|
|
12565
|
+
* undefined.
|
|
12566
|
+
* @throws This function can throw errors.
|
|
12567
|
+
*
|
|
12568
|
+
* {@link InvalidItemStackError}
|
|
12569
|
+
*/
|
|
12570
|
+
getRawPageContent(pageIndex: number): RawMessage | undefined;
|
|
12571
|
+
/**
|
|
12572
|
+
* @remarks
|
|
12573
|
+
* Inserts a page at a given index. Empty pages will be created
|
|
12574
|
+
* if the index is greater than the current book size.
|
|
12575
|
+
* Pages have a maximum limit of 256 characters for strings as
|
|
12576
|
+
* well as the JSON representation of a {@link RawMessage}.
|
|
12577
|
+
* Books have a maximum limit of 50 pages.
|
|
12578
|
+
*
|
|
12579
|
+
* This function can't be called in read-only mode.
|
|
12580
|
+
*
|
|
12581
|
+
* @param pageIndex
|
|
12582
|
+
* The index of the page.
|
|
12583
|
+
* @param content
|
|
12584
|
+
* The content to set for the page. Can be a single string or
|
|
12585
|
+
* {@link RawMessage} or an array of strings and/or {@link
|
|
12586
|
+
* RawMessage}s
|
|
12587
|
+
* @throws This function can throw errors.
|
|
12588
|
+
*
|
|
12589
|
+
* {@link BookError}
|
|
12590
|
+
*
|
|
12591
|
+
* {@link BookPageContentError}
|
|
12592
|
+
*
|
|
12593
|
+
* {@link InvalidItemStackError}
|
|
12594
|
+
*/
|
|
12595
|
+
insertPage(pageIndex: number, content: (RawMessage | string)[] | RawMessage | string): void;
|
|
12596
|
+
/**
|
|
12597
|
+
* @remarks
|
|
12598
|
+
* Removes a page at a given index. Existing pages following
|
|
12599
|
+
* this page will be moved backward to fill the empty space.
|
|
12600
|
+
*
|
|
12601
|
+
* This function can't be called in read-only mode.
|
|
12602
|
+
*
|
|
12603
|
+
* @param pageIndex
|
|
12604
|
+
* The index of the page.
|
|
12605
|
+
* @throws This function can throw errors.
|
|
12606
|
+
*
|
|
12607
|
+
* {@link InvalidItemStackError}
|
|
12608
|
+
*/
|
|
12609
|
+
removePage(pageIndex: number): void;
|
|
12610
|
+
/**
|
|
12611
|
+
* @remarks
|
|
12612
|
+
* Sets the contents of the book's pages. Pre-existing pages
|
|
12613
|
+
* will be cleared.
|
|
12614
|
+
* Pages have a maximum limit of 256 characters for strings as
|
|
12615
|
+
* well as the JSON representation of a {@link RawMessage}.
|
|
12616
|
+
* Books have a maximum limit of 50 pages.
|
|
12617
|
+
*
|
|
12618
|
+
* This function can't be called in read-only mode.
|
|
12619
|
+
*
|
|
12620
|
+
* @param contents
|
|
12621
|
+
* An array of each page's contents. Each page can be a single
|
|
12622
|
+
* string or {@link RawMessage} or an array of strings and/or
|
|
12623
|
+
* {@link RawMessage}s.
|
|
12624
|
+
* @throws This function can throw errors.
|
|
12625
|
+
*
|
|
12626
|
+
* {@link BookError}
|
|
12627
|
+
*
|
|
12628
|
+
* {@link BookPageContentError}
|
|
12629
|
+
*
|
|
12630
|
+
* {@link InvalidItemStackError}
|
|
12631
|
+
*/
|
|
12632
|
+
setContents(contents: ((RawMessage | string)[] | RawMessage | string)[]): void;
|
|
12633
|
+
/**
|
|
12634
|
+
* @remarks
|
|
12635
|
+
* Sets or creates the content of a specific page. Empty pages
|
|
12636
|
+
* will be created if the index is greater than the current
|
|
12637
|
+
* book size.
|
|
12638
|
+
* Pages have a maximum limit of 256 characters for strings as
|
|
12639
|
+
* well as the JSON representation of a {@link RawMessage}.
|
|
12640
|
+
* Books have a maximum limit of 50 pages.
|
|
12641
|
+
*
|
|
12642
|
+
* This function can't be called in read-only mode.
|
|
12643
|
+
*
|
|
12644
|
+
* @param pageIndex
|
|
12645
|
+
* The index of the page.
|
|
12646
|
+
* @param content
|
|
12647
|
+
* The content to set for the page. Can be a single string or
|
|
12648
|
+
* {@link RawMessage} or an array of strings and/or {@link
|
|
12649
|
+
* RawMessage}s
|
|
12650
|
+
* @throws This function can throw errors.
|
|
12651
|
+
*
|
|
12652
|
+
* {@link BookError}
|
|
12653
|
+
*
|
|
12654
|
+
* {@link BookPageContentError}
|
|
12655
|
+
*
|
|
12656
|
+
* {@link InvalidItemStackError}
|
|
12657
|
+
*/
|
|
12658
|
+
setPageContent(pageIndex: number, content: (RawMessage | string)[] | RawMessage | string): void;
|
|
12659
|
+
/**
|
|
12660
|
+
* @remarks
|
|
12661
|
+
* Signs a book giving it a title and author name. Once signed
|
|
12662
|
+
* players can no longer directly edit the book.
|
|
12663
|
+
* Titles have a maximum character limit of 16.
|
|
12664
|
+
*
|
|
12665
|
+
* This function can't be called in read-only mode.
|
|
12666
|
+
*
|
|
12667
|
+
* @param title
|
|
12668
|
+
* The title to give the book.
|
|
12669
|
+
* @param author
|
|
12670
|
+
* The name of the book's author.
|
|
12671
|
+
* @throws This function can throw errors.
|
|
12672
|
+
*
|
|
12673
|
+
* {@link BookError}
|
|
12674
|
+
*
|
|
12675
|
+
* {@link InvalidEntityError}
|
|
12676
|
+
*
|
|
12677
|
+
* {@link InvalidItemStackError}
|
|
12678
|
+
*/
|
|
12679
|
+
signBook(title: string, author: string): void;
|
|
12680
|
+
}
|
|
12681
|
+
|
|
12235
12682
|
/**
|
|
12236
12683
|
* Contains information related to a chargeable item completing
|
|
12237
12684
|
* being charged.
|
|
@@ -13337,6 +13784,18 @@ export class ItemStack {
|
|
|
13337
13784
|
* returns an empty array.
|
|
13338
13785
|
*/
|
|
13339
13786
|
getLore(): string[];
|
|
13787
|
+
/**
|
|
13788
|
+
* @beta
|
|
13789
|
+
* @remarks
|
|
13790
|
+
* Returns the lore value - a secondary display string - for an
|
|
13791
|
+
* ItemStack. String lore lines will be converted to a {@link
|
|
13792
|
+
* RawMessage} and put under {@link RawMessage.text}.
|
|
13793
|
+
*
|
|
13794
|
+
* @returns
|
|
13795
|
+
* An array of lore lines. If the item does not have lore,
|
|
13796
|
+
* returns an empty array.
|
|
13797
|
+
*/
|
|
13798
|
+
getRawLore(): RawMessage[];
|
|
13340
13799
|
/**
|
|
13341
13800
|
* @remarks
|
|
13342
13801
|
* Returns a set of tags associated with this item stack.
|
|
@@ -13476,6 +13935,10 @@ export class ItemStack {
|
|
|
13476
13935
|
* A Record of key value pairs of the dynamic properties to
|
|
13477
13936
|
* set.
|
|
13478
13937
|
* @throws This function can throw errors.
|
|
13938
|
+
*
|
|
13939
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
13940
|
+
*
|
|
13941
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
13479
13942
|
*/
|
|
13480
13943
|
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
13481
13944
|
/**
|
|
@@ -13489,6 +13952,10 @@ export class ItemStack {
|
|
|
13489
13952
|
* Data value of the property to set.
|
|
13490
13953
|
* @throws
|
|
13491
13954
|
* Throws if the item stack is stackable.
|
|
13955
|
+
*
|
|
13956
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
13957
|
+
*
|
|
13958
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
13492
13959
|
*/
|
|
13493
13960
|
setDynamicProperty(identifier: string, value?: boolean | number | string | Vector3): void;
|
|
13494
13961
|
/**
|
|
@@ -13506,6 +13973,8 @@ export class ItemStack {
|
|
|
13506
13973
|
* @throws This function can throw errors.
|
|
13507
13974
|
*
|
|
13508
13975
|
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
13976
|
+
*
|
|
13977
|
+
* {@link Error}
|
|
13509
13978
|
* @example diamondAwesomeSword.ts
|
|
13510
13979
|
* ```typescript
|
|
13511
13980
|
* import { EntityComponentTypes, ItemStack, Player } from '@minecraft/server';
|
|
@@ -13528,7 +13997,7 @@ export class ItemStack {
|
|
|
13528
13997
|
* }
|
|
13529
13998
|
* ```
|
|
13530
13999
|
*/
|
|
13531
|
-
setLore(loreList?: string[]): void;
|
|
14000
|
+
setLore(loreList?: (RawMessage | string)[]): void;
|
|
13532
14001
|
/**
|
|
13533
14002
|
* @beta
|
|
13534
14003
|
* @remarks
|
|
@@ -14095,6 +14564,92 @@ export class ListBlockVolume extends BlockVolumeBase {
|
|
|
14095
14564
|
remove(locations: Vector3[]): void;
|
|
14096
14565
|
}
|
|
14097
14566
|
|
|
14567
|
+
/**
|
|
14568
|
+
* @beta
|
|
14569
|
+
* Manager for Loot Table related APIs. Allows for generation
|
|
14570
|
+
* of drops from blocks and entities according to their loot
|
|
14571
|
+
* tables.
|
|
14572
|
+
*/
|
|
14573
|
+
export class LootTableManager {
|
|
14574
|
+
private constructor();
|
|
14575
|
+
/**
|
|
14576
|
+
* @remarks
|
|
14577
|
+
* Generates loot from a given block as if it had been mined.
|
|
14578
|
+
*
|
|
14579
|
+
* @param block
|
|
14580
|
+
* The block to generate loot from.
|
|
14581
|
+
* @param tool
|
|
14582
|
+
* Optional. The tool to use in the looting operation.
|
|
14583
|
+
* @returns
|
|
14584
|
+
* An array of item stacks dropped from the loot drop event.
|
|
14585
|
+
* Can be empty if no loot dropped, or undefined if the
|
|
14586
|
+
* provided tool is insufficient to mine the block.
|
|
14587
|
+
* @throws
|
|
14588
|
+
* Throws if the block is in an unloaded chunk, or if the
|
|
14589
|
+
* block's position is outside of world bounds.
|
|
14590
|
+
*
|
|
14591
|
+
* {@link LocationInUnloadedChunkError}
|
|
14592
|
+
*
|
|
14593
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
14594
|
+
*
|
|
14595
|
+
* {@link UnloadedChunksError}
|
|
14596
|
+
*/
|
|
14597
|
+
generateLootFromBlock(block: Block, tool?: ItemStack): ItemStack[] | undefined;
|
|
14598
|
+
/**
|
|
14599
|
+
* @remarks
|
|
14600
|
+
* Generates loot from a given block permutation as if it had
|
|
14601
|
+
* been mined.
|
|
14602
|
+
*
|
|
14603
|
+
* @param tool
|
|
14604
|
+
* Optional. The tool to use in the looting operation.
|
|
14605
|
+
* @returns
|
|
14606
|
+
* An array of item stacks dropped from the loot drop event.
|
|
14607
|
+
* Can be empty if no loot dropped, or undefined if the
|
|
14608
|
+
* provided tool is insufficient to mine the block.
|
|
14609
|
+
*/
|
|
14610
|
+
generateLootFromBlockPermutation(blockPermutation: BlockPermutation, tool?: ItemStack): ItemStack[] | undefined;
|
|
14611
|
+
/**
|
|
14612
|
+
* @remarks
|
|
14613
|
+
* Generates loot from a given block type as if it had been
|
|
14614
|
+
* mined.
|
|
14615
|
+
*
|
|
14616
|
+
* @param tool
|
|
14617
|
+
* Optional. The tool to use in the looting operation.
|
|
14618
|
+
* @returns
|
|
14619
|
+
* An array of item stacks dropped from the loot drop event.
|
|
14620
|
+
* Can be empty if no loot dropped, or undefined if the
|
|
14621
|
+
* provided tool is insufficient to mine the block.
|
|
14622
|
+
*/
|
|
14623
|
+
generateLootFromBlockType(scriptBlockType: BlockType, tool?: ItemStack): ItemStack[] | undefined;
|
|
14624
|
+
/**
|
|
14625
|
+
* @remarks
|
|
14626
|
+
* Generates loot from given a entity as if it had been killed.
|
|
14627
|
+
*
|
|
14628
|
+
* @param tool
|
|
14629
|
+
* Optional. The tool to use in the looting operation.
|
|
14630
|
+
* @returns
|
|
14631
|
+
* An array of item stacks dropped from the loot drop event.
|
|
14632
|
+
* Can be empty if no loot dropped, or undefined if the entity
|
|
14633
|
+
* was invalid.
|
|
14634
|
+
* @throws This function can throw errors.
|
|
14635
|
+
*
|
|
14636
|
+
* {@link InvalidEntityError}
|
|
14637
|
+
*/
|
|
14638
|
+
generateLootFromEntity(entity: Entity, tool?: ItemStack): ItemStack[] | undefined;
|
|
14639
|
+
/**
|
|
14640
|
+
* @remarks
|
|
14641
|
+
* Generates loot from given a entity type as if it had been
|
|
14642
|
+
* killed.
|
|
14643
|
+
*
|
|
14644
|
+
* @param tool
|
|
14645
|
+
* Optional. The tool to use in the looting operation.
|
|
14646
|
+
* @returns
|
|
14647
|
+
* An array of item stacks dropped from the loot drop event.
|
|
14648
|
+
* Can be empty if no loot dropped.
|
|
14649
|
+
*/
|
|
14650
|
+
generateLootFromEntityType(entityType: EntityType, tool?: ItemStack): ItemStack[] | undefined;
|
|
14651
|
+
}
|
|
14652
|
+
|
|
14098
14653
|
/**
|
|
14099
14654
|
* @beta
|
|
14100
14655
|
* A specific currently-internal event used for passing
|
|
@@ -17983,8 +18538,7 @@ export class System {
|
|
|
17983
18538
|
* @param message
|
|
17984
18539
|
* Data component of the message to send. This is custom and
|
|
17985
18540
|
* dependent on the kinds of behavior packs and content you may
|
|
17986
|
-
* have installed within the world.
|
|
17987
|
-
* characters in length.
|
|
18541
|
+
* have installed within the world.
|
|
17988
18542
|
* @throws This function can throw errors.
|
|
17989
18543
|
*
|
|
17990
18544
|
* {@link minecraftcommon.EngineError}
|
|
@@ -18567,6 +19121,10 @@ export class World {
|
|
|
18567
19121
|
* Returns an array of all active players within the world.
|
|
18568
19122
|
*
|
|
18569
19123
|
* @throws This function can throw errors.
|
|
19124
|
+
*
|
|
19125
|
+
* {@link CommandError}
|
|
19126
|
+
*
|
|
19127
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
18570
19128
|
*/
|
|
18571
19129
|
getAllPlayers(): Player[];
|
|
18572
19130
|
/**
|
|
@@ -18718,6 +19276,10 @@ export class World {
|
|
|
18718
19276
|
* Throws if the given entity id is invalid.
|
|
18719
19277
|
*/
|
|
18720
19278
|
getEntity(id: string): Entity | undefined;
|
|
19279
|
+
/**
|
|
19280
|
+
* @beta
|
|
19281
|
+
*/
|
|
19282
|
+
getLootTableManager(): LootTableManager;
|
|
18721
19283
|
/**
|
|
18722
19284
|
* @remarks
|
|
18723
19285
|
* Returns the MoonPhase for the current time.
|
|
@@ -18736,6 +19298,10 @@ export class World {
|
|
|
18736
19298
|
* A player array.
|
|
18737
19299
|
* @throws
|
|
18738
19300
|
* Throws if the provided EntityQueryOptions are invalid.
|
|
19301
|
+
*
|
|
19302
|
+
* {@link CommandError}
|
|
19303
|
+
*
|
|
19304
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
18739
19305
|
*/
|
|
18740
19306
|
getPlayers(options?: EntityQueryOptions): Player[];
|
|
18741
19307
|
/**
|
|
@@ -18753,6 +19319,8 @@ export class World {
|
|
|
18753
19319
|
* This function can't be called in read-only mode.
|
|
18754
19320
|
*
|
|
18755
19321
|
* @throws This function can throw errors.
|
|
19322
|
+
*
|
|
19323
|
+
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
18756
19324
|
* @example playMusicAndSound.ts
|
|
18757
19325
|
* ```typescript
|
|
18758
19326
|
* import { world, MusicOptions, WorldSoundOptions, PlayerSoundOptions, DimensionLocation } from "@minecraft/server";
|
|
@@ -18798,6 +19366,8 @@ export class World {
|
|
|
18798
19366
|
* An error will be thrown if volume is less than 0.0.
|
|
18799
19367
|
* An error will be thrown if fade is less than 0.0.
|
|
18800
19368
|
*
|
|
19369
|
+
*
|
|
19370
|
+
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
18801
19371
|
*/
|
|
18802
19372
|
queueMusic(trackId: string, musicOptions?: MusicOptions): void;
|
|
18803
19373
|
/**
|
|
@@ -18858,6 +19428,8 @@ export class World {
|
|
|
18858
19428
|
* A Record of key value pairs of the dynamic properties to
|
|
18859
19429
|
* set.
|
|
18860
19430
|
* @throws This function can throw errors.
|
|
19431
|
+
*
|
|
19432
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
18861
19433
|
*/
|
|
18862
19434
|
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
18863
19435
|
/**
|
|
@@ -18871,6 +19443,8 @@ export class World {
|
|
|
18871
19443
|
* @throws
|
|
18872
19444
|
* Throws if the given dynamic property identifier is not
|
|
18873
19445
|
* defined.
|
|
19446
|
+
*
|
|
19447
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
18874
19448
|
* @example incrementDynamicProperty.ts
|
|
18875
19449
|
* ```typescript
|
|
18876
19450
|
* import { world, DimensionLocation } from "@minecraft/server";
|
|
@@ -19884,6 +20458,24 @@ export interface CameraFixedBoomOptions {
|
|
|
19884
20458
|
viewOffset?: Vector2;
|
|
19885
20459
|
}
|
|
19886
20460
|
|
|
20461
|
+
/**
|
|
20462
|
+
* @beta
|
|
20463
|
+
* Used to change the field of view of the current camera.
|
|
20464
|
+
*
|
|
20465
|
+
* Required Experiments:
|
|
20466
|
+
* - Required Experiment Toggle: Experimental Creator Cameras
|
|
20467
|
+
*
|
|
20468
|
+
*/
|
|
20469
|
+
export interface CameraFovOptions {
|
|
20470
|
+
easeOptions?: EaseOptions;
|
|
20471
|
+
/**
|
|
20472
|
+
* @remarks
|
|
20473
|
+
* Set a value for the field of view.
|
|
20474
|
+
*
|
|
20475
|
+
*/
|
|
20476
|
+
fov?: number;
|
|
20477
|
+
}
|
|
20478
|
+
|
|
19887
20479
|
export interface CameraSetFacingOptions {
|
|
19888
20480
|
easeOptions?: EaseOptions;
|
|
19889
20481
|
facingEntity: Entity;
|
|
@@ -21877,6 +22469,51 @@ export class BlockCustomComponentReloadVersionError extends Error {
|
|
|
21877
22469
|
private constructor();
|
|
21878
22470
|
}
|
|
21879
22471
|
|
|
22472
|
+
/**
|
|
22473
|
+
* @beta
|
|
22474
|
+
* Errors that can be thrown when using {@link
|
|
22475
|
+
* ItemBookComponent}.
|
|
22476
|
+
*/
|
|
22477
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
22478
|
+
export class BookError extends Error {
|
|
22479
|
+
private constructor();
|
|
22480
|
+
/**
|
|
22481
|
+
* @remarks
|
|
22482
|
+
* The reason for the error.
|
|
22483
|
+
*
|
|
22484
|
+
* This property can be read in early-execution mode.
|
|
22485
|
+
*
|
|
22486
|
+
*/
|
|
22487
|
+
reason: BookErrorReason;
|
|
22488
|
+
}
|
|
22489
|
+
|
|
22490
|
+
/**
|
|
22491
|
+
* @beta
|
|
22492
|
+
* The error called if page content being set on an {@link
|
|
22493
|
+
* ItemBookComponent} are invalid ie. exceeding the maximum
|
|
22494
|
+
* page length.
|
|
22495
|
+
*/
|
|
22496
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
22497
|
+
export class BookPageContentError extends Error {
|
|
22498
|
+
private constructor();
|
|
22499
|
+
/**
|
|
22500
|
+
* @remarks
|
|
22501
|
+
* The index of the page requested to be modified.
|
|
22502
|
+
*
|
|
22503
|
+
* This property can be read in early-execution mode.
|
|
22504
|
+
*
|
|
22505
|
+
*/
|
|
22506
|
+
pageIndex: number;
|
|
22507
|
+
/**
|
|
22508
|
+
* @remarks
|
|
22509
|
+
* The reason for the error.
|
|
22510
|
+
*
|
|
22511
|
+
* This property can be read in early-execution mode.
|
|
22512
|
+
*
|
|
22513
|
+
*/
|
|
22514
|
+
reason: BookErrorReason;
|
|
22515
|
+
}
|
|
22516
|
+
|
|
21880
22517
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21881
22518
|
export class CommandError extends Error {
|
|
21882
22519
|
private constructor();
|
|
@@ -21948,6 +22585,11 @@ export class EnchantmentTypeUnknownIdError extends Error {
|
|
|
21948
22585
|
private constructor();
|
|
21949
22586
|
}
|
|
21950
22587
|
|
|
22588
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
22589
|
+
export class EntitySpawnError extends Error {
|
|
22590
|
+
private constructor();
|
|
22591
|
+
}
|
|
22592
|
+
|
|
21951
22593
|
/**
|
|
21952
22594
|
* @rc
|
|
21953
22595
|
* The container is invalid. This can occur if the container is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server",
|
|
3
|
-
"version": "2.2.0-beta.1.21.100-preview.
|
|
3
|
+
"version": "2.2.0-beta.1.21.100-preview.23",
|
|
4
4
|
"description": "",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@minecraft/common": "^1.
|
|
16
|
+
"@minecraft/common": "^1.2.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@minecraft/vanilla-data": ">=1.20.70"
|
|
19
|
+
"@minecraft/vanilla-data": ">=1.20.70 || 1.21.100-preview.23"
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT"
|
|
22
22
|
}
|