@minecraft/server 1.0.0-beta.preview.1.19.50.20 → 1.0.0-beta.release.1.19.40

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 +200 -100
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  * ```json
16
16
  * {
17
17
  * "module_name": "@minecraft/server",
18
- * "version": "1.0.0-internal.preview.1.19.50.20"
18
+ * "version": "0.1.0"
19
19
  * }
20
20
  * ```
21
21
  *
@@ -648,6 +648,10 @@ export class Block {
648
648
  * @throws This property can throw when used.
649
649
  */
650
650
  readonly 'type': BlockType;
651
+ /**
652
+ * Identifier of the type of block for this block.
653
+ * @throws This property can throw when used.
654
+ */
651
655
  readonly typeId: string;
652
656
  /**
653
657
  * X coordinate of the block.
@@ -1909,6 +1913,26 @@ export class BlockProperties {
1909
1913
  static readonly woodType = 'wood_type';
1910
1914
  protected constructor();
1911
1915
  }
1916
+ /**
1917
+ * Contains additional options for configuring a block raycast
1918
+ * query.
1919
+ */
1920
+ export class BlockRaycastOptions {
1921
+ /**
1922
+ * If true, liquid blocks will be considered as blocks that
1923
+ * 'stop' the raycast.
1924
+ */
1925
+ includeLiquidBlocks: boolean;
1926
+ /**
1927
+ * If true, passable blocks like vines and flowers will be
1928
+ * considered as blocks that 'stop' the raycast.
1929
+ */
1930
+ includePassableBlocks: boolean;
1931
+ /**
1932
+ * Maximum distance, in blocks, to process the raycast.
1933
+ */
1934
+ maxDistance: number;
1935
+ }
1912
1936
  /**
1913
1937
  * Represents a block that can play a record.
1914
1938
  */
@@ -1947,10 +1971,28 @@ export class BlockRecordPlayerComponent extends BlockComponent {
1947
1971
  setRecord(recordItemType: ItemType): void;
1948
1972
  protected constructor();
1949
1973
  }
1974
+ /**
1975
+ * Represents a block that can display text on it.
1976
+ */
1950
1977
  export class BlockSignComponent extends BlockComponent {
1978
+ /**
1979
+ * Location of the sign.
1980
+ */
1951
1981
  readonly location: BlockLocation;
1982
+ /**
1983
+ * Text of the sign
1984
+ * @throws This property can throw when used.
1985
+ */
1952
1986
  readonly text: string;
1987
+ /**
1988
+ * Identifier of this component. Should always be
1989
+ * minecraft:sign.
1990
+ */
1953
1991
  readonly typeId: string;
1992
+ /**
1993
+ * Identifier of this component. Should always be
1994
+ * minecraft:sign.
1995
+ */
1954
1996
  static readonly componentId = 'minecraft:sign';
1955
1997
  protected constructor();
1956
1998
  }
@@ -2523,12 +2565,13 @@ export class Dimension {
2523
2565
  * @throws This function can throw errors.
2524
2566
  */
2525
2567
  getPlayers(getPlayers?: EntityQueryOptions): PlayerIterator;
2568
+ runCommand(commandString: string): any;
2526
2569
  /**
2527
2570
  * @remarks
2528
2571
  * Runs a particular command asynchronously from the context of
2529
- * the broader dimension. Where possible - and especially for
2530
- * long-running operations - you should use runCommandAsync
2531
- * over runCommand.
2572
+ * the broader dimension. Note that there is a maximum queue
2573
+ * of 128 asynchronous commands that can be run in a given
2574
+ * tick.
2532
2575
  * @param commandString
2533
2576
  * Command to run. Note that command strings should not start
2534
2577
  * with slash.
@@ -2891,7 +2934,7 @@ export class Entity {
2891
2934
  * Current location of the entity.
2892
2935
  * @throws This property can throw when used.
2893
2936
  */
2894
- readonly location: IVec3;
2937
+ readonly location: Location;
2895
2938
  /**
2896
2939
  * Given name of the entity.
2897
2940
  */
@@ -3077,12 +3120,12 @@ export class Entity {
3077
3120
  * @throws This function can throw errors.
3078
3121
  */
3079
3122
  removeTag(tag: string): boolean;
3123
+ runCommand(commandString: string): any;
3080
3124
  /**
3081
3125
  * @remarks
3082
3126
  * Runs a particular command asynchronously from the context of
3083
- * this entity. Where possible, running a command
3084
- * asynchronously is recommended, especially for long running
3085
- * operations.
3127
+ * this entity. Note that there is a maximum queue of 128
3128
+ * asynchronous commands that can be run in a given tick.
3086
3129
  * @param commandString
3087
3130
  * Command to run. Note that command strings should not start
3088
3131
  * with slash.
@@ -3434,6 +3477,28 @@ export class EntityCreateEventSignal {
3434
3477
  unsubscribe(callback: (arg: EntityCreateEvent) => void): void;
3435
3478
  protected constructor();
3436
3479
  }
3480
+ /**
3481
+ * Specifies additional filters that are used in registering a
3482
+ * data driven trigger event for entities.
3483
+ */
3484
+ export class EntityDataDrivenTriggerEventOptions {
3485
+ /**
3486
+ * If this value is set, this event will only fire for entities
3487
+ * that match the entities within this collection.
3488
+ */
3489
+ entities: Entity[];
3490
+ /**
3491
+ * If this value is set, this event will only fire if the
3492
+ * impacted entities' type matches this parameter.
3493
+ */
3494
+ entityTypes: string[];
3495
+ /**
3496
+ * If this value is set, this event will only fire if the
3497
+ * impacted triggered event matches one of the events listed in
3498
+ * this parameter.
3499
+ */
3500
+ eventTypes: string[];
3501
+ }
3437
3502
  /**
3438
3503
  * As part of the Ageable component, represents a set of items
3439
3504
  * that can be fed to an entity and the rate at which that
@@ -3453,6 +3518,22 @@ export class EntityDefinitionFeedItem {
3453
3518
  readonly item: string;
3454
3519
  protected constructor();
3455
3520
  }
3521
+ /**
3522
+ * Contains optional parameters for registering an entity
3523
+ * event.
3524
+ */
3525
+ export class EntityEventOptions {
3526
+ /**
3527
+ * If this value is set, this event will only fire for entities
3528
+ * that match the entities within this collection.
3529
+ */
3530
+ entities: Entity[];
3531
+ /**
3532
+ * If this value is set, this event will only fire if the
3533
+ * impacted entities' type matches this parameter.
3534
+ */
3535
+ entityTypes: string[];
3536
+ }
3456
3537
  /**
3457
3538
  * When added, this component signifies that this entity
3458
3539
  * doesn't take damage from fire.
@@ -5734,6 +5815,10 @@ export class Events {
5734
5815
  * This event fires when a lever activates or is deactivated.
5735
5816
  */
5736
5817
  readonly leverActivate: LeverActionEventSignal;
5818
+ /**
5819
+ * This event is an internal implementation detail, and is
5820
+ * otherwise not currently functional.
5821
+ */
5737
5822
  readonly messageReceive: ServerMessageSignal;
5738
5823
  /**
5739
5824
  * This event fires when a piston expands or retracts.
@@ -6078,6 +6163,10 @@ export class ItemCooldownComponent {
6078
6163
  * @throws This property can throw when used.
6079
6164
  */
6080
6165
  readonly cooldownTicks: number;
6166
+ /**
6167
+ * Identifier of this component. Should always be
6168
+ * 'minecraft:cooldown'.
6169
+ */
6081
6170
  static readonly componentId = 'minecraft:cooldown';
6082
6171
  /**
6083
6172
  * @remarks
@@ -6152,6 +6241,10 @@ export class ItemDurabilityComponent {
6152
6241
  * @throws This property can throw when used.
6153
6242
  */
6154
6243
  readonly maxDurability: number;
6244
+ /**
6245
+ * Identifier of this component. Should always be
6246
+ * 'minecraft:durability'.
6247
+ */
6155
6248
  static readonly componentId = 'minecraft:durability';
6156
6249
  /**
6157
6250
  * @remarks
@@ -6177,6 +6270,9 @@ export class ItemEnchantsComponent {
6177
6270
  * item stack.
6178
6271
  */
6179
6272
  enchantments: EnchantmentList;
6273
+ /**
6274
+ * Identifier of this component.
6275
+ */
6180
6276
  static readonly componentId = 'minecraft:enchantments';
6181
6277
  /**
6182
6278
  * @remarks
@@ -6217,6 +6313,10 @@ export class ItemFoodComponent {
6217
6313
  * @throws This property can throw when used.
6218
6314
  */
6219
6315
  readonly usingConvertsTo: string;
6316
+ /**
6317
+ * Identifier of this component. Should always be
6318
+ * 'minecraft:food'.
6319
+ */
6220
6320
  static readonly componentId = 'minecraft:food';
6221
6321
  protected constructor();
6222
6322
  }
@@ -6295,6 +6395,11 @@ export class ItemStack {
6295
6395
  * Given name of this stack of items.
6296
6396
  */
6297
6397
  nameTag?: string;
6398
+ /**
6399
+ * Identifier of the type of items for the stack. If a
6400
+ * namespace is not specified, 'minecraft:' is assumed.
6401
+ * Examples include 'wheat' or 'apple'.
6402
+ */
6298
6403
  readonly typeId: string;
6299
6404
  /**
6300
6405
  * @remarks
@@ -6754,7 +6859,6 @@ export class Location {
6754
6859
  export class MessageReceiveEvent {
6755
6860
  readonly id: string;
6756
6861
  readonly message: string;
6757
- readonly player: Player;
6758
6862
  readonly sourceType: MessageSourceType;
6759
6863
  protected constructor();
6760
6864
  }
@@ -12845,7 +12949,7 @@ export class Player extends Entity {
12845
12949
  * Current location of the player.
12846
12950
  * @throws This property can throw when used.
12847
12951
  */
12848
- readonly location: IVec3;
12952
+ readonly location: Location;
12849
12953
  /**
12850
12954
  * Name of the player.
12851
12955
  * @throws This property can throw when used.
@@ -13041,12 +13145,12 @@ export class Player extends Entity {
13041
13145
  * @throws This function can throw errors.
13042
13146
  */
13043
13147
  removeTag(tag: string): boolean;
13148
+ runCommand(commandString: string): any;
13044
13149
  /**
13045
13150
  * @remarks
13046
13151
  * Runs a particular command asynchronously from the context of
13047
- * this entity. Where possible, running a command
13048
- * asynchronously is recommended, especially for long running
13049
- * operations.
13152
+ * this entity. Note that there is a maximum queue of 128
13153
+ * asynchronous commands that can be run in a given tick.
13050
13154
  * @param commandString
13051
13155
  * Command to run. Note that command strings should not start
13052
13156
  * with slash.
@@ -13514,6 +13618,21 @@ export class ScoreboardObjective {
13514
13618
  getScores(): ScoreboardScoreInfo[];
13515
13619
  protected constructor();
13516
13620
  }
13621
+ /**
13622
+ * Contains additional options for how a scoreboard should be
13623
+ * displayed within its display slot.
13624
+ */
13625
+ export class ScoreboardObjectiveDisplayOptions {
13626
+ /**
13627
+ * Objective to be displayed.
13628
+ */
13629
+ readonly objective: ScoreboardObjective;
13630
+ /**
13631
+ * The sort order to display the objective items within.
13632
+ */
13633
+ readonly sortOrder: ObjectiveSortOrder;
13634
+ constructor(objective: ScoreboardObjective, sortOrder?: ObjectiveSortOrder);
13635
+ }
13517
13636
  /**
13518
13637
  * Contains a pair of a scoreboard participant and its
13519
13638
  * respective score.
@@ -13626,16 +13745,24 @@ export class StringBlockProperty extends IBlockProperty {
13626
13745
  * A class that provides system-level events and functions.
13627
13746
  */
13628
13747
  export class System {
13629
- readonly currentTick: number;
13630
13748
  /**
13631
13749
  * Contains a set of events that are applicable for the
13632
13750
  * lifecycle of items in the Minecraft system.
13633
13751
  */
13634
13752
  readonly events: SystemEvents;
13635
- clearRun(runId: number): void;
13636
- clearRunSchedule(runScheduleId: number): void;
13637
- run(callback: () => void, tickDelay?: number): number;
13638
- runSchedule(callback: () => void, tickInterval?: number): number;
13753
+ /**
13754
+ * @remarks
13755
+ * Runs a specified function at a future time. This is
13756
+ * frequently used to implement delayed behaviors and game
13757
+ * loops.
13758
+ * @param callback
13759
+ * Function callback to run when the tickDelay time criteria is
13760
+ * met.
13761
+ * @returns
13762
+ * An opaque identifier that can be used with the `clearRun`
13763
+ * function to cancel the execution of this run.
13764
+ */
13765
+ run(callback: (arg: TickEvent) => void): void;
13639
13766
  protected constructor();
13640
13767
  }
13641
13768
  /**
@@ -13752,7 +13879,7 @@ export class Vector {
13752
13879
  * @param a
13753
13880
  * @param b
13754
13881
  */
13755
- static add(a: IVec3, b: IVec3): Vector;
13882
+ static add(a: Vector, b: Vector): Vector;
13756
13883
  /**
13757
13884
  * @remarks
13758
13885
  * Creates a new instance of an abstract vector.
@@ -13770,21 +13897,21 @@ export class Vector {
13770
13897
  * @param a
13771
13898
  * @param b
13772
13899
  */
13773
- static cross(a: IVec3, b: IVec3): Vector;
13900
+ static cross(a: Vector, b: Vector): Vector;
13774
13901
  /**
13775
13902
  * @remarks
13776
13903
  * Returns the distance between two vectors.
13777
13904
  * @param a
13778
13905
  * @param b
13779
13906
  */
13780
- static distance(a: IVec3, b: IVec3): number;
13907
+ static distance(a: Vector, b: Vector): number;
13781
13908
  /**
13782
13909
  * @remarks
13783
13910
  * Returns the component-wise division of these vectors.
13784
13911
  * @param a
13785
13912
  * @param b
13786
13913
  */
13787
- static divide(a: IVec3, b: number | IVec3): Vector;
13914
+ static divide(a: Vector, b: number | Vector): Vector;
13788
13915
  /**
13789
13916
  * @remarks
13790
13917
  * Compares this vector and another vector to one another.
@@ -13812,7 +13939,7 @@ export class Vector {
13812
13939
  * @param b
13813
13940
  * @param t
13814
13941
  */
13815
- static lerp(a: IVec3, b: IVec3, t: number): Vector;
13942
+ static lerp(a: Vector, b: Vector, t: number): Vector;
13816
13943
  /**
13817
13944
  * @remarks
13818
13945
  * Returns a vector that is made from the largest components of
@@ -13820,7 +13947,7 @@ export class Vector {
13820
13947
  * @param a
13821
13948
  * @param b
13822
13949
  */
13823
- static max(a: IVec3, b: IVec3): Vector;
13950
+ static max(a: Vector, b: Vector): Vector;
13824
13951
  /**
13825
13952
  * @remarks
13826
13953
  * Returns a vector that is made from the smallest components
@@ -13828,14 +13955,14 @@ export class Vector {
13828
13955
  * @param a
13829
13956
  * @param b
13830
13957
  */
13831
- static min(a: IVec3, b: IVec3): Vector;
13958
+ static min(a: Vector, b: Vector): Vector;
13832
13959
  /**
13833
13960
  * @remarks
13834
13961
  * Returns the component-wise product of these vectors.
13835
13962
  * @param a
13836
13963
  * @param b
13837
13964
  */
13838
- static multiply(a: IVec3, b: number | IVec3): Vector;
13965
+ static multiply(a: Vector, b: number | Vector): Vector;
13839
13966
  /**
13840
13967
  * @remarks
13841
13968
  * Returns this vector as a normalized vector.
@@ -13849,14 +13976,14 @@ export class Vector {
13849
13976
  * @param b
13850
13977
  * @param s
13851
13978
  */
13852
- static slerp(a: IVec3, b: IVec3, s: number): Vector;
13979
+ static slerp(a: Vector, b: Vector, s: number): Vector;
13853
13980
  /**
13854
13981
  * @remarks
13855
13982
  * Returns the subtraction of these vectors.
13856
13983
  * @param a
13857
13984
  * @param b
13858
13985
  */
13859
- static subtract(a: IVec3, b: IVec3): Vector;
13986
+ static subtract(a: Vector, b: Vector): Vector;
13860
13987
  }
13861
13988
  /**
13862
13989
  * Contains information related to changes in weather in the
@@ -13912,6 +14039,10 @@ export class World {
13912
14039
  */
13913
14040
  readonly scoreboard: Scoreboard;
13914
14041
  broadcastClientMessage(id: string, value: string): void;
14042
+ /**
14043
+ * @remarks
14044
+ * Returns the absolute time since the start of the world.
14045
+ */
13915
14046
  getAbsoluteTime(): number;
13916
14047
  /**
13917
14048
  * @param dimensionId
@@ -13940,6 +14071,10 @@ export class World {
13940
14071
  * @throws This function can throw errors.
13941
14072
  */
13942
14073
  getPlayers(options?: EntityQueryOptions): PlayerIterator;
14074
+ /**
14075
+ * @remarks
14076
+ * Sets the current game time of the day.
14077
+ */
13943
14078
  getTime(): number;
13944
14079
  /**
13945
14080
  * @remarks
@@ -13987,6 +14122,11 @@ export class World {
13987
14122
  * @throws This function can throw errors.
13988
14123
  */
13989
14124
  setDynamicProperty(identifier: string, value: boolean | number | string): void;
14125
+ /**
14126
+ * @remarks
14127
+ * Returns the current game time of the day.
14128
+ * @param timeOfDay
14129
+ */
13990
14130
  setTime(timeOfDay: number): void;
13991
14131
  /**
13992
14132
  * @remarks
@@ -14064,64 +14204,6 @@ export class XYRotation {
14064
14204
  y: number;
14065
14205
  protected constructor();
14066
14206
  }
14067
- /**
14068
- * Contains additional options for configuring a block raycast
14069
- * query.
14070
- */
14071
- export interface BlockRaycastOptions {
14072
- /**
14073
- * If true, liquid blocks will be considered as blocks that
14074
- * 'stop' the raycast.
14075
- */
14076
- includeLiquidBlocks?: boolean;
14077
- /**
14078
- * If true, passable blocks like vines and flowers will be
14079
- * considered as blocks that 'stop' the raycast.
14080
- */
14081
- includePassableBlocks?: boolean;
14082
- /**
14083
- * Maximum distance, in blocks, to process the raycast.
14084
- */
14085
- maxDistance?: number;
14086
- }
14087
- /**
14088
- * Specifies additional filters that are used in registering a
14089
- * data driven trigger event for entities.
14090
- */
14091
- export interface EntityDataDrivenTriggerEventOptions {
14092
- /**
14093
- * If this value is set, this event will only fire for entities
14094
- * that match the entities within this collection.
14095
- */
14096
- entities?: Entity[];
14097
- /**
14098
- * If this value is set, this event will only fire if the
14099
- * impacted entities' type matches this parameter.
14100
- */
14101
- entityTypes?: string[];
14102
- /**
14103
- * If this value is set, this event will only fire if the
14104
- * impacted triggered event matches one of the events listed in
14105
- * this parameter.
14106
- */
14107
- eventTypes?: string[];
14108
- }
14109
- /**
14110
- * Contains optional parameters for registering an entity
14111
- * event.
14112
- */
14113
- export interface EntityEventOptions {
14114
- /**
14115
- * If this value is set, this event will only fire for entities
14116
- * that match the entities within this collection.
14117
- */
14118
- entities?: Entity[];
14119
- /**
14120
- * If this value is set, this event will only fire if the
14121
- * impacted entities' type matches this parameter.
14122
- */
14123
- entityTypes?: string[];
14124
- }
14125
14207
  /**
14126
14208
  * Contains options for selecting entities within an area.
14127
14209
  */
@@ -14302,17 +14384,49 @@ export interface ExplosionOptions {
14302
14384
  */
14303
14385
  source?: Entity;
14304
14386
  }
14387
+ /**
14388
+ * An interface that describes the signature of a message that
14389
+ * is passed into a say/tell API request.
14390
+ */
14305
14391
  // tslint:disable-next-line:interface-name
14306
14392
  export interface IRawMessage {
14393
+ /**
14394
+ * A list of text objects used to build a message.
14395
+ */
14307
14396
  rawtext?: IRawMessage | string[];
14397
+ /**
14398
+ * Contains plain text to display directly. Only valid when
14399
+ * used as a sub member in a parent _rawtext_ or _with_ member.
14400
+ */
14308
14401
  text?: string;
14402
+ /**
14403
+ * Contains a resource pack translation identifier that can be
14404
+ * used to translate text in the player's selected language.
14405
+ */
14309
14406
  translate?: string;
14407
+ /**
14408
+ * A list of text object arguments that can be used to fill
14409
+ * values in the _translate_ text. Ignored when _translate_ is
14410
+ * not present.
14411
+ */
14310
14412
  with?: IRawMessage | string[];
14311
14413
  }
14414
+ /**
14415
+ * Contains a description of a vector.
14416
+ */
14312
14417
  // tslint:disable-next-line:interface-name
14313
14418
  export interface IVec3 {
14419
+ /**
14420
+ * X component of this vector.
14421
+ */
14314
14422
  x: number;
14423
+ /**
14424
+ * Y component of this vector.
14425
+ */
14315
14426
  y: number;
14427
+ /**
14428
+ * Z component of this vector.
14429
+ */
14316
14430
  z: number;
14317
14431
  }
14318
14432
  /**
@@ -14333,20 +14447,6 @@ export interface MusicOptions {
14333
14447
  */
14334
14448
  volume?: number;
14335
14449
  }
14336
- /**
14337
- * Contains additional options for how a scoreboard should be
14338
- * displayed within its display slot.
14339
- */
14340
- export interface ScoreboardObjectiveDisplayOptions {
14341
- /**
14342
- * Objective to be displayed.
14343
- */
14344
- objective: ScoreboardObjective;
14345
- /**
14346
- * The sort order to display the objective items within.
14347
- */
14348
- sortOrder?: ObjectiveSortOrder;
14349
- }
14350
14450
  /**
14351
14451
  * Additional configuration options for the {@link
14352
14452
  * Player.playSound}/{@link World.playSound} method.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.0.0-beta.preview.1.19.50.20",
3
+ "version": "1.0.0-beta.release.1.19.40",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {