@minecraft/server 1.1.0-beta.1.19.70-preview.24 → 1.1.0-beta.1.19.70-stable

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 (3) hide show
  1. package/README.md +0 -2
  2. package/index.d.ts +285 -9
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Contains many types related to manipulating a Minecraft world, including entities, blocks, dimensions, and more.
4
4
 
5
- ## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
6
-
7
5
  See full documentation for this module here:
8
6
 
9
7
  https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/@minecraft/server/@minecraft/server
package/index.d.ts CHANGED
@@ -7,7 +7,6 @@
7
7
  Copyright (c) Microsoft Corporation.
8
8
  ***************************************************************************** */
9
9
  /**
10
- * @beta
11
10
  * @packageDocumentation
12
11
  * Contains many types related to manipulating a Minecraft
13
12
  * world, including entities, blocks, dimensions, and more.
@@ -16,7 +15,7 @@
16
15
  * ```json
17
16
  * {
18
17
  * "module_name": "@minecraft/server",
19
- * "version": "1.1.0-internal.1.19.70-preview.24"
18
+ * "version": "1.0.0"
20
19
  * }
21
20
  * ```
22
21
  *
@@ -1278,10 +1277,6 @@ export class BlockRecordPlayerComponent extends BlockComponent {
1278
1277
  */
1279
1278
  export class BlockSignComponent extends BlockComponent {
1280
1279
  protected constructor();
1281
- /**
1282
- * Text of the sign
1283
- * @throws This property can throw when used.
1284
- */
1285
1280
  readonly text: string;
1286
1281
  /**
1287
1282
  * Identifier of this component. Should always be
@@ -1882,6 +1877,24 @@ export class Dimension {
1882
1877
  * ```
1883
1878
  */
1884
1879
  createExplosion(location: Vector3, radius: number, explosionOptions?: ExplosionOptions): void;
1880
+ /**
1881
+ * @beta
1882
+ * @remarks
1883
+ * Fills an area between begin and end with block of type
1884
+ * block.
1885
+ * @param begin
1886
+ * The lower northwest starting corner of the area.
1887
+ * @param end
1888
+ * The upper southeast ending corner of the area.
1889
+ * @param block
1890
+ * Type of block to fill the volume with.
1891
+ * @param options
1892
+ * A set of additional options, such as a matching block to
1893
+ * potentially replace this fill block with.
1894
+ * @returns
1895
+ * Returns number of blocks placed.
1896
+ * @throws This function can throw errors.
1897
+ */
1885
1898
  fillBlocks(begin: Vector3, end: Vector3, block: BlockPermutation | BlockType, options?: BlockFillOptions): number;
1886
1899
  /**
1887
1900
  * @beta
@@ -2116,21 +2129,21 @@ export class DirectionBlockProperty {
2116
2129
  export class DynamicPropertiesDefinition {
2117
2130
  /**
2118
2131
  * @remarks
2119
- * Defines a new boolean dynamic property.
2132
+ * Defines a boolean dynamic property.
2120
2133
  * @param identifier
2121
2134
  * @throws This function can throw errors.
2122
2135
  */
2123
2136
  defineBoolean(identifier: string): void;
2124
2137
  /**
2125
2138
  * @remarks
2126
- * Defines a new number dynamic property.
2139
+ * Defines a number dynamic property.
2127
2140
  * @param identifier
2128
2141
  * @throws This function can throw errors.
2129
2142
  */
2130
2143
  defineNumber(identifier: string): void;
2131
2144
  /**
2132
2145
  * @remarks
2133
- * Defines a new string dynamic property.
2146
+ * Defines a string dynamic property.
2134
2147
  * @param identifier
2135
2148
  * @param maxLength
2136
2149
  * @throws This function can throw errors.
@@ -2256,6 +2269,11 @@ export class EnchantmentList implements Iterable<Enchantment> {
2256
2269
  * The item slot/type that this collection is applied to.
2257
2270
  */
2258
2271
  readonly slot: number;
2272
+ /**
2273
+ * @remarks
2274
+ * Creates a new EnchantmentList.
2275
+ * @param enchantmentSlot
2276
+ */
2259
2277
  constructor(enchantmentSlot: number);
2260
2278
  [Symbol.iterator](): Iterator<Enchantment>;
2261
2279
  /**
@@ -2454,10 +2472,33 @@ export class Entity {
2454
2472
  * @throws This function can throw errors.
2455
2473
  */
2456
2474
  addTag(tag: string): boolean;
2475
+ /**
2476
+ * @beta
2477
+ * @remarks
2478
+ * Applies a set of damage to an entity.
2479
+ * @param amount
2480
+ * Amount of damage to apply.
2481
+ * @param source
2482
+ * Additional option about the source of damage, which may add
2483
+ * additional effects or spur additional behaviors on this
2484
+ * entity.
2485
+ * @throws This function can throw errors.
2486
+ */
2457
2487
  applyDamage(amount: number, source?: EntityDamageSource): boolean;
2458
2488
  applyImpulse(vector: Vector3): void;
2459
2489
  applyKnockback(directionX: number, directionZ: number, horizontalStrength: number, verticalStrength: number): void;
2460
2490
  clearVelocity(): void;
2491
+ /**
2492
+ * @beta
2493
+ * @remarks
2494
+ * Extinguishes the fire if the entity is on fire. Note that
2495
+ * you can call getComponent('minecraft:onfire') and, if
2496
+ * present, the entity is on fire.
2497
+ * @param useEffects
2498
+ * Whether to show any visual effects connected to the
2499
+ * extinguishing.
2500
+ * @throws This function can throw errors.
2501
+ */
2461
2502
  extinguishFire(useEffects?: boolean): boolean;
2462
2503
  /**
2463
2504
  * @beta
@@ -2510,6 +2551,14 @@ export class Entity {
2510
2551
  * @throws This function can throw errors.
2511
2552
  */
2512
2553
  getEffect(effectType: EffectType): Effect;
2554
+ /**
2555
+ * @beta
2556
+ * @remarks
2557
+ * Returns a set of effects applied to this item.
2558
+ * @returns
2559
+ * List of effects.
2560
+ * @throws This function can throw errors.
2561
+ */
2513
2562
  getEffects(): Effect[];
2514
2563
  /**
2515
2564
  * @beta
@@ -2600,6 +2649,17 @@ export class Entity {
2600
2649
  * @throws This function can throw errors.
2601
2650
  */
2602
2651
  setDynamicProperty(identifier: string, value: boolean | number | string): void;
2652
+ /**
2653
+ * @beta
2654
+ * @remarks
2655
+ * Sets an entity on fire (if it is not in water or rain). Note
2656
+ * that you can call getComponent('minecraft:onfire') and, if
2657
+ * present, the entity is on fire.
2658
+ * @param seconds
2659
+ * Length of time to set the entity on fire.
2660
+ * @param useEffects
2661
+ * @throws This function can throw errors.
2662
+ */
2603
2663
  setOnFire(seconds: number, useEffects?: boolean): boolean;
2604
2664
  /**
2605
2665
  * @beta
@@ -3147,6 +3207,10 @@ export class EntityHurtEvent {
3147
3207
  * Describes the amount of damage caused.
3148
3208
  */
3149
3209
  readonly damage: number;
3210
+ /**
3211
+ * Source information on the entity that may have applied this
3212
+ * damage.
3213
+ */
3150
3214
  readonly damageSource: EntityDamageSource;
3151
3215
  /**
3152
3216
  * Entity that was hurt.
@@ -4700,9 +4764,19 @@ export class EntityNavigationWalkComponent extends IEntityComponent {
4700
4764
  */
4701
4765
  static readonly componentId = 'minecraft:navigation.walk';
4702
4766
  }
4767
+ /**
4768
+ * @beta
4769
+ * When present on an entity, this entity is on fire.
4770
+ */
4703
4771
  export class EntityOnFireComponent extends IEntityComponent {
4704
4772
  protected constructor();
4773
+ /**
4774
+ * The number of ticks remaining before the fire goes out.
4775
+ */
4705
4776
  readonly onFireTicksRemaining: number;
4777
+ /**
4778
+ * Should be 'minecraft:onfire'.
4779
+ */
4706
4780
  readonly typeId: string;
4707
4781
  static readonly componentId = 'minecraft:onfire';
4708
4782
  }
@@ -9450,6 +9524,10 @@ export class MinecraftEffectTypes {
9450
9524
  static readonly weakness: EffectType;
9451
9525
  static readonly wither: EffectType;
9452
9526
  }
9527
+ /**
9528
+ * @beta
9529
+ * Describes a set of enchantment types.
9530
+ */
9453
9531
  // tslint:disable-next-line:no-unnecessary-class
9454
9532
  export class MinecraftEnchantmentTypes {
9455
9533
  protected constructor();
@@ -12496,7 +12574,29 @@ export class Player extends Entity {
12496
12574
  * @throws This function can throw errors.
12497
12575
  */
12498
12576
  addEffect(effectType: EffectType, duration: number, amplifier?: number, showParticles?: boolean): void;
12577
+ /**
12578
+ * @beta
12579
+ * @remarks
12580
+ * Adds/removes experience to/from the Player and returns the
12581
+ * current experience of the Player.
12582
+ * @param amount
12583
+ * Amount of experience to add. Note that this can be negative.
12584
+ * @returns
12585
+ * Returns the current experience of the Player.
12586
+ * @throws This function can throw errors.
12587
+ */
12499
12588
  addExperience(amount: number): number;
12589
+ /**
12590
+ * @beta
12591
+ * @remarks
12592
+ * Adds/removes level to/from the Player and returns the
12593
+ * current level of the Player.
12594
+ * @param amount
12595
+ * Amount to add to the player.
12596
+ * @returns
12597
+ * Returns the current level of the Player.
12598
+ * @throws This function can throw errors.
12599
+ */
12500
12600
  addLevels(amount: number): number;
12501
12601
  /**
12502
12602
  * @beta
@@ -12507,11 +12607,33 @@ export class Player extends Entity {
12507
12607
  * @throws This function can throw errors.
12508
12608
  */
12509
12609
  addTag(tag: string): boolean;
12610
+ /**
12611
+ * @beta
12612
+ * @remarks
12613
+ * Applies damage to the player.
12614
+ * @param amount
12615
+ * Amount of damage to apply.
12616
+ * @param source
12617
+ * Additional information around the source of damage that can
12618
+ * apply to the player.
12619
+ * @throws This function can throw errors.
12620
+ */
12510
12621
  applyDamage(amount: number, source?: EntityDamageSource): boolean;
12511
12622
  applyImpulse(vector: Vector3): void;
12512
12623
  applyKnockback(directionX: number, directionZ: number, horizontalStrength: number, verticalStrength: number): void;
12513
12624
  clearSpawn(): void;
12514
12625
  clearVelocity(): void;
12626
+ /**
12627
+ * @beta
12628
+ * @remarks
12629
+ * Extinguishes the fire if the player is on fire. Note that
12630
+ * you can call getComponent('minecraft:onfire') and, if
12631
+ * present, the player is on fire."
12632
+ * @param useEffects
12633
+ * Whether to show any visual effects connected to the
12634
+ * extinguishing.
12635
+ * @throws This function can throw errors.
12636
+ */
12515
12637
  extinguishFire(useEffects?: boolean): boolean;
12516
12638
  /**
12517
12639
  * @beta
@@ -12564,6 +12686,12 @@ export class Player extends Entity {
12564
12686
  * @throws This function can throw errors.
12565
12687
  */
12566
12688
  getEffect(effectType: EffectType): Effect;
12689
+ /**
12690
+ * @beta
12691
+ * @remarks
12692
+ * Returns a set of effects applied to this player.
12693
+ * @throws This function can throw errors.
12694
+ */
12567
12695
  getEffects(): Effect[];
12568
12696
  /**
12569
12697
  * @beta
@@ -12595,6 +12723,12 @@ export class Player extends Entity {
12595
12723
  * @throws This function can throw errors.
12596
12724
  */
12597
12725
  getTags(): string[];
12726
+ /**
12727
+ * @beta
12728
+ * @remarks
12729
+ * Gets the total experience of the Player.
12730
+ * @throws This function can throw errors.
12731
+ */
12598
12732
  getTotalXp(): number;
12599
12733
  getVelocity(): Vector3;
12600
12734
  getViewDirection(): Vector3;
@@ -12671,6 +12805,12 @@ export class Player extends Entity {
12671
12805
  * @throws This function can throw errors.
12672
12806
  */
12673
12807
  removeTag(tag: string): boolean;
12808
+ /**
12809
+ * @beta
12810
+ * @remarks
12811
+ * Resets the level of the player.
12812
+ * @throws This function can throw errors.
12813
+ */
12674
12814
  resetLevel(): void;
12675
12815
  /**
12676
12816
  * @remarks
@@ -12738,6 +12878,17 @@ export class Player extends Entity {
12738
12878
  * @throws This function can throw errors.
12739
12879
  */
12740
12880
  setDynamicProperty(identifier: string, value: boolean | number | string): void;
12881
+ /**
12882
+ * @beta
12883
+ * @remarks
12884
+ * Sets a player on fire (if it is not in water or rain). Note
12885
+ * that you can call getComponent('minecraft:onfire') and, if
12886
+ * present, the player is on fire.
12887
+ * @param seconds
12888
+ * Length of time to set the player on fire.
12889
+ * @param useEffects
12890
+ * @throws This function can throw errors.
12891
+ */
12741
12892
  setOnFire(seconds: number, useEffects?: boolean): boolean;
12742
12893
  /**
12743
12894
  * @beta
@@ -13078,6 +13229,7 @@ export class Scoreboard {
13078
13229
  * @remarks
13079
13230
  * Returns a specific objective (by id).
13080
13231
  * @param objectiveId
13232
+ * Identifier of the objective.
13081
13233
  * @throws This function can throw errors.
13082
13234
  */
13083
13235
  getObjective(objectiveId: string): ScoreboardObjective;
@@ -13101,6 +13253,17 @@ export class Scoreboard {
13101
13253
  * @throws This function can throw errors.
13102
13254
  */
13103
13255
  getParticipants(): ScoreboardIdentity[];
13256
+ /**
13257
+ * @remarks
13258
+ * Returns a score given an objective and participant.
13259
+ * @param objective
13260
+ * Objective to retrieve the score for.
13261
+ * @param participant
13262
+ * Participant to retrieve the score for.
13263
+ * @returns
13264
+ * Score value.
13265
+ * @throws This function can throw errors.
13266
+ */
13104
13267
  getScore(objective: ScoreboardObjective, participant: ScoreboardIdentity): number;
13105
13268
  /**
13106
13269
  * @remarks
@@ -13121,6 +13284,16 @@ export class Scoreboard {
13121
13284
  displaySlotId: string,
13122
13285
  objectiveDisplaySetting: ScoreboardObjectiveDisplayOptions,
13123
13286
  ): ScoreboardObjective;
13287
+ /**
13288
+ * @remarks
13289
+ * Sets the score given a participant and objective.
13290
+ * @param objective
13291
+ * Objective to use for the scoreboard.
13292
+ * @param participant
13293
+ * Participant to apply the scoreboard value to.
13294
+ * @param score
13295
+ * @throws This function can throw errors.
13296
+ */
13124
13297
  setScore(objective: ScoreboardObjective, participant: ScoreboardIdentity, score: number): boolean;
13125
13298
  }
13126
13299
  /**
@@ -13148,8 +13321,35 @@ export class ScoreboardIdentity {
13148
13321
  * @throws This function can throw errors.
13149
13322
  */
13150
13323
  getEntity(): Entity;
13324
+ /**
13325
+ * @remarks
13326
+ * Gets the current score for this participant based on an
13327
+ * objective.
13328
+ * @param objective
13329
+ * The objective to retrieve the score for.
13330
+ * @returns
13331
+ * Score value.
13332
+ * @throws This function can throw errors.
13333
+ */
13151
13334
  getScore(objective: ScoreboardObjective): number;
13335
+ /**
13336
+ * @remarks
13337
+ * Removes this participant from an objective.
13338
+ * @param objective
13339
+ * The objective to remove this participant from.
13340
+ * @throws This function can throw errors.
13341
+ */
13152
13342
  removeFromObjective(objective: ScoreboardObjective): boolean;
13343
+ /**
13344
+ * @remarks
13345
+ * Sets a score for this participant for a particular
13346
+ * objective.
13347
+ * @param objective
13348
+ * Objective to apply the score to.
13349
+ * @param score
13350
+ * Score value.
13351
+ * @throws This function can throw errors.
13352
+ */
13153
13353
  setScore(objective: ScoreboardObjective, score: number): boolean;
13154
13354
  }
13155
13355
  /**
@@ -13179,6 +13379,7 @@ export class ScoreboardObjective {
13179
13379
  * @remarks
13180
13380
  * Returns a specific score for a participant.
13181
13381
  * @param participant
13382
+ * Identifier of the participant to retrieve a score for.
13182
13383
  * @throws This function can throw errors.
13183
13384
  */
13184
13385
  getScore(participant: ScoreboardIdentity): number;
@@ -13189,7 +13390,24 @@ export class ScoreboardObjective {
13189
13390
  * @throws This function can throw errors.
13190
13391
  */
13191
13392
  getScores(): ScoreboardScoreInfo[];
13393
+ /**
13394
+ * @remarks
13395
+ * Removes a participant from this scoreboard objective.
13396
+ * @param participant
13397
+ * Participant to remove from being tracked with this
13398
+ * objective.
13399
+ * @throws This function can throw errors.
13400
+ */
13192
13401
  removeParticipant(participant: ScoreboardIdentity): boolean;
13402
+ /**
13403
+ * @remarks
13404
+ * Sets a score for a participant.
13405
+ * @param participant
13406
+ * Identity of the participant.
13407
+ * @param score
13408
+ * New value of the score.
13409
+ * @throws This function can throw errors.
13410
+ */
13193
13411
  setScore(participant: ScoreboardIdentity, score: number): boolean;
13194
13412
  }
13195
13413
  /**
@@ -13248,13 +13466,40 @@ export class ScreenDisplay {
13248
13466
  */
13249
13467
  updateSubtitle(subtitle: string): void;
13250
13468
  }
13469
+ /**
13470
+ * @beta
13471
+ * Returns additional data about a /scriptevent command
13472
+ * invocation.
13473
+ */
13251
13474
  export class ScriptEventCommandMessageEvent {
13252
13475
  protected constructor();
13476
+ /**
13477
+ * Identifier of this ScriptEvent command message.
13478
+ */
13253
13479
  readonly id: string;
13480
+ /**
13481
+ * If this command was initiated via an NPC, returns the entity
13482
+ * that initiated the NPC dialogue.
13483
+ */
13254
13484
  readonly initiator: Entity;
13485
+ /**
13486
+ * Optional additional data passed in with the script event
13487
+ * command.
13488
+ */
13255
13489
  readonly message: string;
13490
+ /**
13491
+ * Source block if this command was triggered via a block
13492
+ * (e.g., a commandblock.)
13493
+ */
13256
13494
  readonly sourceBlock: Block;
13495
+ /**
13496
+ * Source entity if this command was triggered by an entity
13497
+ * (e.g., a NPC).
13498
+ */
13257
13499
  readonly sourceEntity: Entity;
13500
+ /**
13501
+ * Returns the type of source that fired this command.
13502
+ */
13258
13503
  readonly sourceType: MessageSourceType;
13259
13504
  }
13260
13505
  /**
@@ -13370,7 +13615,33 @@ export class System {
13370
13615
  * function to cancel the execution of this run.
13371
13616
  */
13372
13617
  run(callback: () => void): number;
13618
+ /**
13619
+ * @beta
13620
+ * @remarks
13621
+ * Runs a set of code on an interval.
13622
+ * @param callback
13623
+ * Functional code that will run when this interval occurs.
13624
+ * @param tickInterval
13625
+ * An interval of every N ticks that the callback will be
13626
+ * called upon.
13627
+ * @returns
13628
+ * An opaque handle that can be used with the clearRun method
13629
+ * to stop the run of this function on an interval.
13630
+ */
13373
13631
  runInterval(callback: () => void, tickInterval?: number): number;
13632
+ /**
13633
+ * @beta
13634
+ * @remarks
13635
+ * Runs a set of code at a future time specified by tickDelay.
13636
+ * @param callback
13637
+ * Functional code that will run when this timeout occurs.
13638
+ * @param tickDelay
13639
+ * Amount of time, in ticks, before the interval will be
13640
+ * called.
13641
+ * @returns
13642
+ * An opaque handle that can be used with the clearRun method
13643
+ * to stop the run of this function on an interval.
13644
+ */
13374
13645
  runTimeout(callback: () => void, tickDelay?: number): number;
13375
13646
  }
13376
13647
  /**
@@ -13440,6 +13711,11 @@ export class Trigger {
13440
13711
  * Event name of the trigger.
13441
13712
  */
13442
13713
  eventName: string;
13714
+ /**
13715
+ * @remarks
13716
+ * Creates a new trigger.
13717
+ * @param eventName
13718
+ */
13443
13719
  constructor(eventName: string);
13444
13720
  }
13445
13721
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.1.0-beta.1.19.70-preview.24",
3
+ "version": "1.1.0-beta.1.19.70-stable",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {