@minecraft/server 1.6.0-beta.1.20.30-preview.21 → 1.6.0-beta.1.20.30-preview.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +161 -28
- 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.6.0-internal.1.20.30-preview.
|
|
19
|
+
* "version": "1.6.0-internal.1.20.30-preview.22"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -296,7 +296,7 @@ export enum EquipmentSlot {
|
|
|
296
296
|
* Chestplate or Elytra.
|
|
297
297
|
*
|
|
298
298
|
*/
|
|
299
|
-
|
|
299
|
+
Chest = 'Chest',
|
|
300
300
|
/**
|
|
301
301
|
* @beta
|
|
302
302
|
* @remarks
|
|
@@ -304,7 +304,7 @@ export enum EquipmentSlot {
|
|
|
304
304
|
* Boots.
|
|
305
305
|
*
|
|
306
306
|
*/
|
|
307
|
-
|
|
307
|
+
Feet = 'Feet',
|
|
308
308
|
/**
|
|
309
309
|
* @beta
|
|
310
310
|
* @remarks
|
|
@@ -312,7 +312,7 @@ export enum EquipmentSlot {
|
|
|
312
312
|
* Helmets or Carved Pumpkins.
|
|
313
313
|
*
|
|
314
314
|
*/
|
|
315
|
-
|
|
315
|
+
Head = 'Head',
|
|
316
316
|
/**
|
|
317
317
|
* @beta
|
|
318
318
|
* @remarks
|
|
@@ -320,7 +320,7 @@ export enum EquipmentSlot {
|
|
|
320
320
|
* Leggings.
|
|
321
321
|
*
|
|
322
322
|
*/
|
|
323
|
-
|
|
323
|
+
Legs = 'Legs',
|
|
324
324
|
/**
|
|
325
325
|
* @beta
|
|
326
326
|
* @remarks
|
|
@@ -328,7 +328,7 @@ export enum EquipmentSlot {
|
|
|
328
328
|
* the currently active hotbar slot.
|
|
329
329
|
*
|
|
330
330
|
*/
|
|
331
|
-
|
|
331
|
+
Mainhand = 'Mainhand',
|
|
332
332
|
/**
|
|
333
333
|
* @beta
|
|
334
334
|
* @remarks
|
|
@@ -336,7 +336,7 @@ export enum EquipmentSlot {
|
|
|
336
336
|
* shields and maps.
|
|
337
337
|
*
|
|
338
338
|
*/
|
|
339
|
-
|
|
339
|
+
Offhand = 'Offhand',
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
/**
|
|
@@ -3083,6 +3083,14 @@ export class DefinitionModifier {
|
|
|
3083
3083
|
*/
|
|
3084
3084
|
export class Dimension {
|
|
3085
3085
|
private constructor();
|
|
3086
|
+
/**
|
|
3087
|
+
* @beta
|
|
3088
|
+
* @remarks
|
|
3089
|
+
* Height range of the dimension.
|
|
3090
|
+
*
|
|
3091
|
+
* @throws This property can throw when used.
|
|
3092
|
+
*/
|
|
3093
|
+
readonly heightRange: NumberRange;
|
|
3086
3094
|
/**
|
|
3087
3095
|
* @remarks
|
|
3088
3096
|
* Identifier of the dimension.
|
|
@@ -3357,8 +3365,13 @@ export class Dimension {
|
|
|
3357
3365
|
*
|
|
3358
3366
|
* @param weatherType
|
|
3359
3367
|
* Set the type of weather to apply.
|
|
3368
|
+
* @param duration
|
|
3369
|
+
* Sets the duration of the weather (in ticks). If no duration
|
|
3370
|
+
* is provided, the duration will be set to a random duration
|
|
3371
|
+
* between 300 and 900 seconds.
|
|
3372
|
+
* @throws This function can throw errors.
|
|
3360
3373
|
*/
|
|
3361
|
-
setWeather(weatherType: WeatherType): void;
|
|
3374
|
+
setWeather(weatherType: WeatherType, duration?: number): void;
|
|
3362
3375
|
/**
|
|
3363
3376
|
* @beta
|
|
3364
3377
|
* @remarks
|
|
@@ -3978,6 +3991,14 @@ export class Entity {
|
|
|
3978
3991
|
* @throws This property can throw when used.
|
|
3979
3992
|
*/
|
|
3980
3993
|
readonly isOnGround: boolean;
|
|
3994
|
+
/**
|
|
3995
|
+
* @beta
|
|
3996
|
+
* @remarks
|
|
3997
|
+
* If true, the entity is currently sleeping.
|
|
3998
|
+
*
|
|
3999
|
+
* @throws This property can throw when used.
|
|
4000
|
+
*/
|
|
4001
|
+
readonly isSleeping: boolean;
|
|
3981
4002
|
/**
|
|
3982
4003
|
* @beta
|
|
3983
4004
|
* @remarks
|
|
@@ -4038,6 +4059,7 @@ export class Entity {
|
|
|
4038
4059
|
* @beta
|
|
4039
4060
|
* @remarks
|
|
4040
4061
|
* Returns a scoreboard identity that represents this entity.
|
|
4062
|
+
* Will remain valid when the entity is killed.
|
|
4041
4063
|
*
|
|
4042
4064
|
* @throws This property can throw when used.
|
|
4043
4065
|
*/
|
|
@@ -4053,7 +4075,7 @@ export class Entity {
|
|
|
4053
4075
|
readonly target: Entity;
|
|
4054
4076
|
/**
|
|
4055
4077
|
* @remarks
|
|
4056
|
-
*
|
|
4078
|
+
* Identifier of the type of the entity - for example,
|
|
4057
4079
|
* 'minecraft:skeleton'. This property is accessible even if
|
|
4058
4080
|
* {@link Entity.isValid} is false.
|
|
4059
4081
|
*
|
|
@@ -4414,13 +4436,19 @@ export class Entity {
|
|
|
4414
4436
|
* @throws This function can throw errors.
|
|
4415
4437
|
*/
|
|
4416
4438
|
getHeadLocation(): Vector3;
|
|
4439
|
+
/**
|
|
4440
|
+
* @beta
|
|
4441
|
+
* @throws This function can throw errors.
|
|
4442
|
+
*/
|
|
4443
|
+
getProperty(identifier: string): boolean | number | string | undefined;
|
|
4417
4444
|
/**
|
|
4418
4445
|
* @beta
|
|
4419
4446
|
* @remarks
|
|
4420
4447
|
* Returns the current rotation component of this entity.
|
|
4421
4448
|
*
|
|
4422
4449
|
* @returns
|
|
4423
|
-
* Returns the
|
|
4450
|
+
* Returns a Vec2 containing the rotation of this entity (in
|
|
4451
|
+
* degrees).
|
|
4424
4452
|
* @throws This function can throw errors.
|
|
4425
4453
|
*/
|
|
4426
4454
|
getRotation(): Vector2;
|
|
@@ -4599,6 +4627,14 @@ export class Entity {
|
|
|
4599
4627
|
* @throws This function can throw errors.
|
|
4600
4628
|
*/
|
|
4601
4629
|
removeTag(tag: string): boolean;
|
|
4630
|
+
/**
|
|
4631
|
+
* @beta
|
|
4632
|
+
* @remarks
|
|
4633
|
+
* This function can't be called in read-only mode.
|
|
4634
|
+
*
|
|
4635
|
+
* @throws This function can throw errors.
|
|
4636
|
+
*/
|
|
4637
|
+
resetProperty(identifier: string): boolean | number | string;
|
|
4602
4638
|
/**
|
|
4603
4639
|
* @beta
|
|
4604
4640
|
* @remarks
|
|
@@ -4691,6 +4727,14 @@ export class Entity {
|
|
|
4691
4727
|
* ```
|
|
4692
4728
|
*/
|
|
4693
4729
|
setOnFire(seconds: number, useEffects?: boolean): boolean;
|
|
4730
|
+
/**
|
|
4731
|
+
* @beta
|
|
4732
|
+
* @remarks
|
|
4733
|
+
* This function can't be called in read-only mode.
|
|
4734
|
+
*
|
|
4735
|
+
* @throws This function can throw errors.
|
|
4736
|
+
*/
|
|
4737
|
+
setProperty(identifier: string, value: boolean | number | string): void;
|
|
4694
4738
|
/**
|
|
4695
4739
|
* @beta
|
|
4696
4740
|
* @remarks
|
|
@@ -4699,9 +4743,9 @@ export class Entity {
|
|
|
4699
4743
|
* This function can't be called in read-only mode.
|
|
4700
4744
|
*
|
|
4701
4745
|
* @param rotation
|
|
4702
|
-
* The x and y rotation of the entity. For most
|
|
4703
|
-
* rotation controls the head tilt and the y
|
|
4704
|
-
* the body rotation.
|
|
4746
|
+
* The x and y rotation of the entity (in degrees). For most
|
|
4747
|
+
* mobs, the x rotation controls the head tilt and the y
|
|
4748
|
+
* rotation controls the body rotation.
|
|
4705
4749
|
* @throws This function can throw errors.
|
|
4706
4750
|
*/
|
|
4707
4751
|
setRotation(rotation: Vector2): void;
|
|
@@ -5211,6 +5255,7 @@ export class EntityEquippableComponent extends EntityComponent {
|
|
|
5211
5255
|
*/
|
|
5212
5256
|
getEquipment(equipmentSlot: EquipmentSlot): ItemStack | undefined;
|
|
5213
5257
|
/**
|
|
5258
|
+
* @beta
|
|
5214
5259
|
* @remarks
|
|
5215
5260
|
* This function can't be called in read-only mode.
|
|
5216
5261
|
*
|
|
@@ -6315,14 +6360,21 @@ export class EntityPushThroughComponent extends EntityComponent {
|
|
|
6315
6360
|
* from the world (for example, the entity is unloaded because
|
|
6316
6361
|
* it is not close to players.)
|
|
6317
6362
|
*/
|
|
6318
|
-
export class
|
|
6363
|
+
export class EntityRemoveAfterEvent {
|
|
6319
6364
|
private constructor();
|
|
6320
6365
|
/**
|
|
6321
6366
|
* @remarks
|
|
6322
|
-
*
|
|
6367
|
+
* Id of the entity that was removed.
|
|
6368
|
+
*
|
|
6369
|
+
*/
|
|
6370
|
+
readonly removedEntityId: string;
|
|
6371
|
+
/**
|
|
6372
|
+
* @remarks
|
|
6373
|
+
* Identifier of the type of the entity removed - for example,
|
|
6374
|
+
* 'minecraft:skeleton'.
|
|
6323
6375
|
*
|
|
6324
6376
|
*/
|
|
6325
|
-
readonly
|
|
6377
|
+
readonly typeId: string;
|
|
6326
6378
|
}
|
|
6327
6379
|
|
|
6328
6380
|
/**
|
|
@@ -6331,7 +6383,7 @@ export class EntityRemovedAfterEvent {
|
|
|
6331
6383
|
* is removed from the game (for example, unloaded, or a few
|
|
6332
6384
|
* seconds after they are dead.)
|
|
6333
6385
|
*/
|
|
6334
|
-
export class
|
|
6386
|
+
export class EntityRemoveAfterEventSignal {
|
|
6335
6387
|
private constructor();
|
|
6336
6388
|
/**
|
|
6337
6389
|
* @remarks
|
|
@@ -6349,9 +6401,9 @@ export class EntityRemovedAfterEventSignal {
|
|
|
6349
6401
|
* operations.
|
|
6350
6402
|
*/
|
|
6351
6403
|
subscribe(
|
|
6352
|
-
callback: (arg:
|
|
6404
|
+
callback: (arg: EntityRemoveAfterEvent) => void,
|
|
6353
6405
|
options?: EntityEventOptions,
|
|
6354
|
-
): (arg:
|
|
6406
|
+
): (arg: EntityRemoveAfterEvent) => void;
|
|
6355
6407
|
/**
|
|
6356
6408
|
* @remarks
|
|
6357
6409
|
* Unsubscribes your function from subsequent calls when an
|
|
@@ -6361,7 +6413,57 @@ export class EntityRemovedAfterEventSignal {
|
|
|
6361
6413
|
*
|
|
6362
6414
|
* @throws This function can throw errors.
|
|
6363
6415
|
*/
|
|
6364
|
-
unsubscribe(callback: (arg:
|
|
6416
|
+
unsubscribe(callback: (arg: EntityRemoveAfterEvent) => void): void;
|
|
6417
|
+
}
|
|
6418
|
+
|
|
6419
|
+
/**
|
|
6420
|
+
* @beta
|
|
6421
|
+
* Data for an event that happens when an entity is being
|
|
6422
|
+
* removed from the world (for example, the entity is unloaded
|
|
6423
|
+
* because it is not close to players.)
|
|
6424
|
+
*/
|
|
6425
|
+
export class EntityRemoveBeforeEvent {
|
|
6426
|
+
private constructor();
|
|
6427
|
+
/**
|
|
6428
|
+
* @remarks
|
|
6429
|
+
* Reference to an entity that is being removed.
|
|
6430
|
+
*
|
|
6431
|
+
*/
|
|
6432
|
+
readonly removedEntity: Entity;
|
|
6433
|
+
}
|
|
6434
|
+
|
|
6435
|
+
/**
|
|
6436
|
+
* @beta
|
|
6437
|
+
* Allows registration for an event that fires when an entity
|
|
6438
|
+
* is being removed from the game (for example, unloaded, or a
|
|
6439
|
+
* few seconds after they are dead.)
|
|
6440
|
+
*/
|
|
6441
|
+
export class EntityRemoveBeforeEventSignal {
|
|
6442
|
+
private constructor();
|
|
6443
|
+
/**
|
|
6444
|
+
* @remarks
|
|
6445
|
+
* Will call your function every time an entity is being
|
|
6446
|
+
* removed from the game.
|
|
6447
|
+
*
|
|
6448
|
+
* This function can't be called in read-only mode.
|
|
6449
|
+
*
|
|
6450
|
+
* @param callback
|
|
6451
|
+
* Function to call.
|
|
6452
|
+
* @returns
|
|
6453
|
+
* Returns a closure that can be used in subsequent unsubscribe
|
|
6454
|
+
* operations.
|
|
6455
|
+
*/
|
|
6456
|
+
subscribe(callback: (arg: EntityRemoveBeforeEvent) => void): (arg: EntityRemoveBeforeEvent) => void;
|
|
6457
|
+
/**
|
|
6458
|
+
* @remarks
|
|
6459
|
+
* Unsubscribes your function from subsequent calls when an
|
|
6460
|
+
* entity is being removed.
|
|
6461
|
+
*
|
|
6462
|
+
* This function can't be called in read-only mode.
|
|
6463
|
+
*
|
|
6464
|
+
* @throws This function can throw errors.
|
|
6465
|
+
*/
|
|
6466
|
+
unsubscribe(callback: (arg: EntityRemoveBeforeEvent) => void): void;
|
|
6365
6467
|
}
|
|
6366
6468
|
|
|
6367
6469
|
/**
|
|
@@ -7577,6 +7679,26 @@ export class ItemStack {
|
|
|
7577
7679
|
* Returns a copy of this item stack.
|
|
7578
7680
|
*/
|
|
7579
7681
|
clone(): ItemStack;
|
|
7682
|
+
/**
|
|
7683
|
+
* @beta
|
|
7684
|
+
* @remarks
|
|
7685
|
+
* Get the list of block types this item can break in Adventure
|
|
7686
|
+
* mode.
|
|
7687
|
+
*
|
|
7688
|
+
* This function can't be called in read-only mode.
|
|
7689
|
+
*
|
|
7690
|
+
*/
|
|
7691
|
+
getCanDestroy(): string[];
|
|
7692
|
+
/**
|
|
7693
|
+
* @beta
|
|
7694
|
+
* @remarks
|
|
7695
|
+
* Get the list of block types this item can be placed on in
|
|
7696
|
+
* Adventure mode.
|
|
7697
|
+
*
|
|
7698
|
+
* This function can't be called in read-only mode.
|
|
7699
|
+
*
|
|
7700
|
+
*/
|
|
7701
|
+
getCanPlaceOn(): string[];
|
|
7580
7702
|
/**
|
|
7581
7703
|
* @remarks
|
|
7582
7704
|
* Gets a component (that represents additional capabilities)
|
|
@@ -8627,6 +8749,14 @@ export class Player extends Entity {
|
|
|
8627
8749
|
* @throws This property can throw when used.
|
|
8628
8750
|
*/
|
|
8629
8751
|
readonly camera: Camera;
|
|
8752
|
+
/**
|
|
8753
|
+
* @beta
|
|
8754
|
+
* @remarks
|
|
8755
|
+
* If true, the player is currently emoting.
|
|
8756
|
+
*
|
|
8757
|
+
* @throws This property can throw when used.
|
|
8758
|
+
*/
|
|
8759
|
+
readonly isEmoting: boolean;
|
|
8630
8760
|
/**
|
|
8631
8761
|
* @beta
|
|
8632
8762
|
* @remarks
|
|
@@ -9408,12 +9538,16 @@ export class Scoreboard {
|
|
|
9408
9538
|
*
|
|
9409
9539
|
* This function can't be called in read-only mode.
|
|
9410
9540
|
*
|
|
9541
|
+
* @returns
|
|
9542
|
+
* Returns the previous `ScoreboardObjective` set at the
|
|
9543
|
+
* display slot, if no objective was previously set it returns
|
|
9544
|
+
* `undefined`.
|
|
9411
9545
|
* @throws This function can throw errors.
|
|
9412
9546
|
*/
|
|
9413
9547
|
setObjectiveAtDisplaySlot(
|
|
9414
9548
|
displaySlotId: DisplaySlotId,
|
|
9415
9549
|
objectiveDisplaySetting: ScoreboardObjectiveDisplayOptions,
|
|
9416
|
-
): ScoreboardObjective;
|
|
9550
|
+
): ScoreboardObjective | undefined;
|
|
9417
9551
|
}
|
|
9418
9552
|
|
|
9419
9553
|
/**
|
|
@@ -9447,7 +9581,7 @@ export class ScoreboardIdentity {
|
|
|
9447
9581
|
*
|
|
9448
9582
|
* @throws This function can throw errors.
|
|
9449
9583
|
*/
|
|
9450
|
-
getEntity(): Entity;
|
|
9584
|
+
getEntity(): Entity | undefined;
|
|
9451
9585
|
isValid(): boolean;
|
|
9452
9586
|
}
|
|
9453
9587
|
|
|
@@ -10914,13 +11048,8 @@ export class WorldAfterEvents {
|
|
|
10914
11048
|
readonly entityHurt: EntityHurtAfterEventSignal;
|
|
10915
11049
|
/**
|
|
10916
11050
|
* @beta
|
|
10917
|
-
* @remarks
|
|
10918
|
-
* This event fires when an entity is removed from the game
|
|
10919
|
-
* (e.g., is unloaded when it goes out of range; or a few
|
|
10920
|
-
* seconds after the death of an entity.)
|
|
10921
|
-
*
|
|
10922
11051
|
*/
|
|
10923
|
-
readonly
|
|
11052
|
+
readonly entityRemove: EntityRemoveAfterEventSignal;
|
|
10924
11053
|
/**
|
|
10925
11054
|
* @beta
|
|
10926
11055
|
* @remarks
|
|
@@ -11143,6 +11272,10 @@ export class WorldBeforeEvents {
|
|
|
11143
11272
|
*
|
|
11144
11273
|
*/
|
|
11145
11274
|
readonly dataDrivenEntityTriggerEvent: DataDrivenEntityTriggerBeforeEventSignal;
|
|
11275
|
+
/**
|
|
11276
|
+
* @beta
|
|
11277
|
+
*/
|
|
11278
|
+
readonly entityRemove: EntityRemoveBeforeEventSignal;
|
|
11146
11279
|
/**
|
|
11147
11280
|
* @beta
|
|
11148
11281
|
* @remarks
|