@minecraft/server 1.6.0-beta.1.20.30-preview.20 → 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.
Files changed (2) hide show
  1. package/index.d.ts +183 -62
  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.6.0-internal.1.20.30-preview.20"
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
- chest = 'chest',
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
- feet = 'feet',
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
- head = 'head',
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
- legs = 'legs',
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
- mainhand = 'mainhand',
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
- offhand = 'offhand',
339
+ Offhand = 'Offhand',
340
340
  }
341
341
 
342
342
  /**
@@ -3084,11 +3084,18 @@ export class DefinitionModifier {
3084
3084
  export class Dimension {
3085
3085
  private constructor();
3086
3086
  /**
3087
+ * @beta
3087
3088
  * @remarks
3088
- * Identifier of the dimension.
3089
+ * Height range of the dimension.
3089
3090
  *
3090
3091
  * @throws This property can throw when used.
3091
3092
  */
3093
+ readonly heightRange: NumberRange;
3094
+ /**
3095
+ * @remarks
3096
+ * Identifier of the dimension.
3097
+ *
3098
+ */
3092
3099
  readonly id: string;
3093
3100
  /**
3094
3101
  * @beta
@@ -3358,8 +3365,13 @@ export class Dimension {
3358
3365
  *
3359
3366
  * @param weatherType
3360
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.
3361
3373
  */
3362
- setWeather(weatherType: WeatherType): void;
3374
+ setWeather(weatherType: WeatherType, duration?: number): void;
3363
3375
  /**
3364
3376
  * @beta
3365
3377
  * @remarks
@@ -3942,7 +3954,6 @@ export class Entity {
3942
3954
  * property is accessible even if {@link Entity.isValid} is
3943
3955
  * false.
3944
3956
  *
3945
- * @throws This property can throw when used.
3946
3957
  */
3947
3958
  readonly id: string;
3948
3959
  /**
@@ -3980,6 +3991,14 @@ export class Entity {
3980
3991
  * @throws This property can throw when used.
3981
3992
  */
3982
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;
3983
4002
  /**
3984
4003
  * @beta
3985
4004
  * @remarks
@@ -4040,6 +4059,7 @@ export class Entity {
4040
4059
  * @beta
4041
4060
  * @remarks
4042
4061
  * Returns a scoreboard identity that represents this entity.
4062
+ * Will remain valid when the entity is killed.
4043
4063
  *
4044
4064
  * @throws This property can throw when used.
4045
4065
  */
@@ -4055,11 +4075,10 @@ export class Entity {
4055
4075
  readonly target: Entity;
4056
4076
  /**
4057
4077
  * @remarks
4058
- * Unique identifier of the type of the entity - for example,
4078
+ * Identifier of the type of the entity - for example,
4059
4079
  * 'minecraft:skeleton'. This property is accessible even if
4060
4080
  * {@link Entity.isValid} is false.
4061
4081
  *
4062
- * @throws This property can throw when used.
4063
4082
  */
4064
4083
  readonly typeId: string;
4065
4084
  /**
@@ -4417,13 +4436,19 @@ export class Entity {
4417
4436
  * @throws This function can throw errors.
4418
4437
  */
4419
4438
  getHeadLocation(): Vector3;
4439
+ /**
4440
+ * @beta
4441
+ * @throws This function can throw errors.
4442
+ */
4443
+ getProperty(identifier: string): boolean | number | string | undefined;
4420
4444
  /**
4421
4445
  * @beta
4422
4446
  * @remarks
4423
4447
  * Returns the current rotation component of this entity.
4424
4448
  *
4425
4449
  * @returns
4426
- * Returns the current rotation component of this entity.
4450
+ * Returns a Vec2 containing the rotation of this entity (in
4451
+ * degrees).
4427
4452
  * @throws This function can throw errors.
4428
4453
  */
4429
4454
  getRotation(): Vector2;
@@ -4602,6 +4627,14 @@ export class Entity {
4602
4627
  * @throws This function can throw errors.
4603
4628
  */
4604
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;
4605
4638
  /**
4606
4639
  * @beta
4607
4640
  * @remarks
@@ -4694,6 +4727,14 @@ export class Entity {
4694
4727
  * ```
4695
4728
  */
4696
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;
4697
4738
  /**
4698
4739
  * @beta
4699
4740
  * @remarks
@@ -4702,9 +4743,9 @@ export class Entity {
4702
4743
  * This function can't be called in read-only mode.
4703
4744
  *
4704
4745
  * @param rotation
4705
- * The x and y rotation of the entity. For most mobs, the x
4706
- * rotation controls the head tilt and the y rotation controls
4707
- * 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.
4708
4749
  * @throws This function can throw errors.
4709
4750
  */
4710
4751
  setRotation(rotation: Vector2): void;
@@ -5201,52 +5242,30 @@ export class EntityDieAfterEventSignal {
5201
5242
 
5202
5243
  /**
5203
5244
  * @beta
5204
- * Provides access to a mob's equipment slots. This component
5205
- * exists for all mob entities.
5206
5245
  */
5207
5246
  // @ts-ignore Class inheritance allowed for native defined classes
5208
- export class EntityEquipmentInventoryComponent extends EntityComponent {
5247
+ export class EntityEquippableComponent extends EntityComponent {
5209
5248
  private constructor();
5210
- static readonly componentId = 'minecraft:equipment_inventory';
5249
+ static readonly componentId = 'minecraft:equippable';
5211
5250
  /**
5212
5251
  * @remarks
5213
- * Gets the equipped item for the given EquipmentSlot.
5214
- *
5215
5252
  * This function can't be called in read-only mode.
5216
5253
  *
5217
- * @param equipmentSlot
5218
- * The equipment slot. e.g. "head", "chest", "offhand"
5219
- * @returns
5220
- * Returns the item equipped to the given EquipmentSlot. If
5221
- * empty, returns undefined.
5222
5254
  * @throws This function can throw errors.
5223
5255
  */
5224
5256
  getEquipment(equipmentSlot: EquipmentSlot): ItemStack | undefined;
5225
5257
  /**
5258
+ * @beta
5226
5259
  * @remarks
5227
- * Gets the ContainerSlot corresponding to the given
5228
- * EquipmentSlot.
5229
- *
5230
5260
  * This function can't be called in read-only mode.
5231
5261
  *
5232
- * @param equipmentSlot
5233
- * The equipment slot. e.g. "head", "chest", "offhand".
5234
- * @returns
5235
- * Returns the ContainerSlot corresponding to the given
5236
- * EquipmentSlot.
5237
5262
  * @throws This function can throw errors.
5238
5263
  */
5239
5264
  getEquipmentSlot(equipmentSlot: EquipmentSlot): ContainerSlot;
5240
5265
  /**
5241
5266
  * @remarks
5242
- * Replaces the item in the given EquipmentSlot.
5243
- *
5244
5267
  * This function can't be called in read-only mode.
5245
5268
  *
5246
- * @param equipmentSlot
5247
- * The equipment slot. e.g. "head", "chest", "offhand".
5248
- * @param itemStack
5249
- * The item to equip. If undefined, clears the slot.
5250
5269
  * @throws This function can throw errors.
5251
5270
  */
5252
5271
  setEquipment(equipmentSlot: EquipmentSlot, itemStack?: ItemStack): boolean;
@@ -6341,14 +6360,21 @@ export class EntityPushThroughComponent extends EntityComponent {
6341
6360
  * from the world (for example, the entity is unloaded because
6342
6361
  * it is not close to players.)
6343
6362
  */
6344
- export class EntityRemovedAfterEvent {
6363
+ export class EntityRemoveAfterEvent {
6345
6364
  private constructor();
6346
6365
  /**
6347
6366
  * @remarks
6348
- * Reference to an entity that was removed.
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'.
6349
6375
  *
6350
6376
  */
6351
- readonly removedEntity: string;
6377
+ readonly typeId: string;
6352
6378
  }
6353
6379
 
6354
6380
  /**
@@ -6357,7 +6383,7 @@ export class EntityRemovedAfterEvent {
6357
6383
  * is removed from the game (for example, unloaded, or a few
6358
6384
  * seconds after they are dead.)
6359
6385
  */
6360
- export class EntityRemovedAfterEventSignal {
6386
+ export class EntityRemoveAfterEventSignal {
6361
6387
  private constructor();
6362
6388
  /**
6363
6389
  * @remarks
@@ -6375,9 +6401,9 @@ export class EntityRemovedAfterEventSignal {
6375
6401
  * operations.
6376
6402
  */
6377
6403
  subscribe(
6378
- callback: (arg: EntityRemovedAfterEvent) => void,
6404
+ callback: (arg: EntityRemoveAfterEvent) => void,
6379
6405
  options?: EntityEventOptions,
6380
- ): (arg: EntityRemovedAfterEvent) => void;
6406
+ ): (arg: EntityRemoveAfterEvent) => void;
6381
6407
  /**
6382
6408
  * @remarks
6383
6409
  * Unsubscribes your function from subsequent calls when an
@@ -6387,7 +6413,57 @@ export class EntityRemovedAfterEventSignal {
6387
6413
  *
6388
6414
  * @throws This function can throw errors.
6389
6415
  */
6390
- unsubscribe(callback: (arg: EntityRemovedAfterEvent) => void): void;
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;
6391
6467
  }
6392
6468
 
6393
6469
  /**
@@ -7603,6 +7679,26 @@ export class ItemStack {
7603
7679
  * Returns a copy of this item stack.
7604
7680
  */
7605
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[];
7606
7702
  /**
7607
7703
  * @remarks
7608
7704
  * Gets a component (that represents additional capabilities)
@@ -7612,7 +7708,7 @@ export class ItemStack {
7612
7708
  * The identifier of the component (e.g., 'minecraft:food') to
7613
7709
  * retrieve. If no namespace prefix is specified, 'minecraft:'
7614
7710
  * is assumed. If the component is not present on the item
7615
- * stack, undefined is returned.
7711
+ * stack or doesn't exist, undefined is returned.
7616
7712
  * @example durability.ts
7617
7713
  * ```typescript
7618
7714
  * // Get the maximum durability of a custom sword item
@@ -7636,7 +7732,7 @@ export class ItemStack {
7636
7732
  * ItemStack.
7637
7733
  *
7638
7734
  * @returns
7639
- * An array of lore strings. If the item does not have lore,
7735
+ * An array of lore lines. If the item does not have lore,
7640
7736
  * returns an empty array.
7641
7737
  */
7642
7738
  getLore(): string[];
@@ -7679,6 +7775,11 @@ export class ItemStack {
7679
7775
  * item stacks. The amount of each item stack is not taken into
7680
7776
  * consideration.
7681
7777
  *
7778
+ * @param itemStack
7779
+ * ItemStack to check stacking compatability with.
7780
+ * @returns
7781
+ * True if the Item Stack is stackable with the itemStack
7782
+ * passed in.
7682
7783
  */
7683
7784
  isStackableWith(itemStack: ItemStack): boolean;
7684
7785
  /**
@@ -7690,6 +7791,8 @@ export class ItemStack {
7690
7791
  *
7691
7792
  * This function can't be called in read-only mode.
7692
7793
  *
7794
+ * @param blockIdentifiers
7795
+ * String list of block types that the item can destroy.
7693
7796
  * @throws
7694
7797
  * Throws if any of the provided block identifiers are invalid.
7695
7798
  * @example example.ts
@@ -7710,6 +7813,8 @@ export class ItemStack {
7710
7813
  *
7711
7814
  * This function can't be called in read-only mode.
7712
7815
  *
7816
+ * @param blockIdentifiers
7817
+ * String list of block types that the item can be placed on.
7713
7818
  * @throws
7714
7819
  * Throws if any of the provided block identifiers are invalid.
7715
7820
  * @example example.ts
@@ -7724,10 +7829,15 @@ export class ItemStack {
7724
7829
  * @beta
7725
7830
  * @remarks
7726
7831
  * Sets the lore value - a secondary display string - for an
7727
- * ItemStack.
7832
+ * ItemStack. The lore list is cleared if set to an empty
7833
+ * string or undefined.
7728
7834
  *
7729
7835
  * This function can't be called in read-only mode.
7730
7836
  *
7837
+ * @param loreList
7838
+ * List of lore lines. Each element in the list represents a
7839
+ * new line. The maximum lore line count is 20. The maximum
7840
+ * lore line length is 50 characters.
7731
7841
  * @throws This function can throw errors.
7732
7842
  * @example diamondAwesomeSword.ts
7733
7843
  * ```typescript
@@ -8639,6 +8749,14 @@ export class Player extends Entity {
8639
8749
  * @throws This property can throw when used.
8640
8750
  */
8641
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;
8642
8760
  /**
8643
8761
  * @beta
8644
8762
  * @remarks
@@ -9420,12 +9538,16 @@ export class Scoreboard {
9420
9538
  *
9421
9539
  * This function can't be called in read-only mode.
9422
9540
  *
9541
+ * @returns
9542
+ * Returns the previous `ScoreboardObjective` set at the
9543
+ * display slot, if no objective was previously set it returns
9544
+ * `undefined`.
9423
9545
  * @throws This function can throw errors.
9424
9546
  */
9425
9547
  setObjectiveAtDisplaySlot(
9426
9548
  displaySlotId: DisplaySlotId,
9427
9549
  objectiveDisplaySetting: ScoreboardObjectiveDisplayOptions,
9428
- ): ScoreboardObjective;
9550
+ ): ScoreboardObjective | undefined;
9429
9551
  }
9430
9552
 
9431
9553
  /**
@@ -9459,7 +9581,7 @@ export class ScoreboardIdentity {
9459
9581
  *
9460
9582
  * @throws This function can throw errors.
9461
9583
  */
9462
- getEntity(): Entity;
9584
+ getEntity(): Entity | undefined;
9463
9585
  isValid(): boolean;
9464
9586
  }
9465
9587
 
@@ -9684,7 +9806,7 @@ export class ScriptEventCommandMessageAfterEvent {
9684
9806
  * that initiated the NPC dialogue.
9685
9807
  *
9686
9808
  */
9687
- readonly initiator: Entity;
9809
+ readonly initiator?: Entity;
9688
9810
  /**
9689
9811
  * @remarks
9690
9812
  * Optional additional data passed in with the script event
@@ -9698,14 +9820,14 @@ export class ScriptEventCommandMessageAfterEvent {
9698
9820
  * (e.g., a commandblock.)
9699
9821
  *
9700
9822
  */
9701
- readonly sourceBlock: Block;
9823
+ readonly sourceBlock?: Block;
9702
9824
  /**
9703
9825
  * @remarks
9704
9826
  * Source entity if this command was triggered by an entity
9705
9827
  * (e.g., a NPC).
9706
9828
  *
9707
9829
  */
9708
- readonly sourceEntity: Entity;
9830
+ readonly sourceEntity?: Entity;
9709
9831
  /**
9710
9832
  * @remarks
9711
9833
  * Returns the type of source that fired this command.
@@ -10926,13 +11048,8 @@ export class WorldAfterEvents {
10926
11048
  readonly entityHurt: EntityHurtAfterEventSignal;
10927
11049
  /**
10928
11050
  * @beta
10929
- * @remarks
10930
- * This event fires when an entity is removed from the game
10931
- * (e.g., is unloaded when it goes out of range; or a few
10932
- * seconds after the death of an entity.)
10933
- *
10934
11051
  */
10935
- readonly entityRemoved: EntityRemovedAfterEventSignal;
11052
+ readonly entityRemove: EntityRemoveAfterEventSignal;
10936
11053
  /**
10937
11054
  * @beta
10938
11055
  * @remarks
@@ -11155,6 +11272,10 @@ export class WorldBeforeEvents {
11155
11272
  *
11156
11273
  */
11157
11274
  readonly dataDrivenEntityTriggerEvent: DataDrivenEntityTriggerBeforeEventSignal;
11275
+ /**
11276
+ * @beta
11277
+ */
11278
+ readonly entityRemove: EntityRemoveBeforeEventSignal;
11158
11279
  /**
11159
11280
  * @beta
11160
11281
  * @remarks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.6.0-beta.1.20.30-preview.20",
3
+ "version": "1.6.0-beta.1.20.30-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {