@minecraft/server 1.18.0 → 1.19.0-rc.1.21.80-preview.27

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 +3 -1
  2. package/index.d.ts +430 -35
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,8 @@
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
+
5
7
  See full documentation for this module here:
6
8
 
7
- https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/minecraft-server
9
+ https://learn.microsoft.com/en-us/minecraft/creator/legacyscriptapi/minecraft/server-1xx/minecraft-server
package/index.d.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  Copyright (c) Microsoft Corporation.
8
8
  ***************************************************************************** */
9
9
  /**
10
+ * @preview
10
11
  * @packageDocumentation
11
12
  * Contains many types related to manipulating a Minecraft
12
13
  * world, including entities, blocks, dimensions, and more.
@@ -15,7 +16,7 @@
15
16
  * ```json
16
17
  * {
17
18
  * "module_name": "@minecraft/server",
18
- * "version": "1.18.0"
19
+ * "version": "1.19.0"
19
20
  * }
20
21
  * ```
21
22
  *
@@ -126,6 +127,38 @@ export enum CustomComponentNameErrorReason {
126
127
  DisallowedNamespace = 2,
127
128
  }
128
129
 
130
+ /**
131
+ * @rc
132
+ * An enumeration for the various difficulty levels of
133
+ * Minecraft.
134
+ */
135
+ export enum Difficulty {
136
+ /**
137
+ * @remarks
138
+ * Easy difficulty level.
139
+ *
140
+ */
141
+ Easy = 'Easy',
142
+ /**
143
+ * @remarks
144
+ * Hard difficulty level.
145
+ *
146
+ */
147
+ Hard = 'Hard',
148
+ /**
149
+ * @remarks
150
+ * Normal difficulty level.
151
+ *
152
+ */
153
+ Normal = 'Normal',
154
+ /**
155
+ * @remarks
156
+ * Peaceful difficulty level.
157
+ *
158
+ */
159
+ Peaceful = 'Peaceful',
160
+ }
161
+
129
162
  /**
130
163
  * A general purpose relative direction enumeration.
131
164
  */
@@ -451,6 +484,8 @@ export enum EntityComponentTypes {
451
484
  */
452
485
  FrictionModifier = 'minecraft:friction_modifier',
453
486
  /**
487
+ * @deprecated This property is deprecated and will be removed in 2.0.0.
488
+ *
454
489
  * @remarks
455
490
  * Sets the offset from the ground that the entity is actually
456
491
  * at.
@@ -2542,6 +2577,7 @@ export class Block {
2542
2577
  *
2543
2578
  * @param steps
2544
2579
  * Number of steps above to step before returning.
2580
+ * Defaults to: 1
2545
2581
  * @throws This function can throw errors.
2546
2582
  *
2547
2583
  * {@link LocationInUnloadedChunkError}
@@ -2556,6 +2592,7 @@ export class Block {
2556
2592
  *
2557
2593
  * @param steps
2558
2594
  * Number of steps below to step before returning.
2595
+ * Defaults to: 1
2559
2596
  * @throws This function can throw errors.
2560
2597
  *
2561
2598
  * {@link LocationInUnloadedChunkError}
@@ -2620,6 +2657,7 @@ export class Block {
2620
2657
  *
2621
2658
  * @param steps
2622
2659
  * Number of steps to the east to step before returning.
2660
+ * Defaults to: 1
2623
2661
  * @throws This function can throw errors.
2624
2662
  *
2625
2663
  * {@link LocationInUnloadedChunkError}
@@ -2636,8 +2674,9 @@ export class Block {
2636
2674
  * @param componentId
2637
2675
  * The identifier of the component (e.g.,
2638
2676
  * 'minecraft:inventory'). If no namespace prefix is specified,
2639
- * 'minecraft:' is assumed. Available component IDs can be
2640
- * found as part of the {@link BlockComponentTypes} enum.
2677
+ * 'minecraft:' is assumed. Available component IDs are those
2678
+ * in the {@link BlockComponentTypes} enum and custom component
2679
+ * IDs registered with the {@link BlockComponentRegistry}.
2641
2680
  * @returns
2642
2681
  * Returns the component if it exists on the block, otherwise
2643
2682
  * undefined.
@@ -2656,9 +2695,11 @@ export class Block {
2656
2695
  * @param amount
2657
2696
  * Number of instances of this block to place in the item
2658
2697
  * stack.
2698
+ * Defaults to: 1
2659
2699
  * @param withData
2660
2700
  * Whether additional data facets of the item stack are
2661
2701
  * included.
2702
+ * Defaults to: false
2662
2703
  * @returns
2663
2704
  * An itemStack with the specified amount of items and data.
2664
2705
  * Returns undefined if block type is incompatible.
@@ -2822,6 +2863,7 @@ export class Block {
2822
2863
  *
2823
2864
  * @param steps
2824
2865
  * Number of steps to the north to step before returning.
2866
+ * Defaults to: 1
2825
2867
  * @throws This function can throw errors.
2826
2868
  *
2827
2869
  * {@link LocationInUnloadedChunkError}
@@ -2907,6 +2949,7 @@ export class Block {
2907
2949
  *
2908
2950
  * @param steps
2909
2951
  * Number of steps to the south to step before returning.
2952
+ * Defaults to: 1
2910
2953
  * @throws This function can throw errors.
2911
2954
  *
2912
2955
  * {@link LocationInUnloadedChunkError}
@@ -2921,6 +2964,7 @@ export class Block {
2921
2964
  *
2922
2965
  * @param steps
2923
2966
  * Number of steps to the west to step before returning.
2967
+ * Defaults to: 1
2924
2968
  * @throws This function can throw errors.
2925
2969
  *
2926
2970
  * {@link LocationInUnloadedChunkError}
@@ -3238,8 +3282,6 @@ export class BlockFluidContainerComponent extends BlockComponent {
3238
3282
  * This function can't be called in read-only mode.
3239
3283
  *
3240
3284
  * @throws This function can throw errors.
3241
- *
3242
- * {@link Error}
3243
3285
  */
3244
3286
  addDye(dye: ItemType): void;
3245
3287
  /**
@@ -3249,8 +3291,6 @@ export class BlockFluidContainerComponent extends BlockComponent {
3249
3291
  * This function can't be called in read-only mode.
3250
3292
  *
3251
3293
  * @throws This function can throw errors.
3252
- *
3253
- * {@link Error}
3254
3294
  */
3255
3295
  getFluidType(): FluidType;
3256
3296
  /**
@@ -3260,8 +3300,6 @@ export class BlockFluidContainerComponent extends BlockComponent {
3260
3300
  * This function can't be called in read-only mode.
3261
3301
  *
3262
3302
  * @throws This function can throw errors.
3263
- *
3264
- * {@link Error}
3265
3303
  */
3266
3304
  setFluidType(fluidType: FluidType): void;
3267
3305
  /**
@@ -3272,8 +3310,6 @@ export class BlockFluidContainerComponent extends BlockComponent {
3272
3310
  * This function can't be called in read-only mode.
3273
3311
  *
3274
3312
  * @throws This function can throw errors.
3275
- *
3276
- * {@link Error}
3277
3313
  */
3278
3314
  setPotion(itemStack: ItemStack): void;
3279
3315
  }
@@ -3408,8 +3444,6 @@ export class BlockPermutation {
3408
3444
  * @returns
3409
3445
  * Whether this block is removed when touched by liquid.
3410
3446
  * @throws This function can throw errors.
3411
- *
3412
- * {@link Error}
3413
3447
  */
3414
3448
  canBeDestroyedByLiquidSpread(liquidType: LiquidType): boolean;
3415
3449
  /**
@@ -3422,8 +3456,6 @@ export class BlockPermutation {
3422
3456
  * @returns
3423
3457
  * Whether this block can have a liquid placed over it.
3424
3458
  * @throws This function can throw errors.
3425
- *
3426
- * {@link Error}
3427
3459
  */
3428
3460
  canContainLiquid(liquidType: LiquidType): boolean;
3429
3461
  /**
@@ -3445,6 +3477,7 @@ export class BlockPermutation {
3445
3477
  * @param amount
3446
3478
  * Number of instances of this block to place in the prototype
3447
3479
  * item stack.
3480
+ * Defaults to: 1
3448
3481
  */
3449
3482
  getItemStack(amount?: number): ItemStack | undefined;
3450
3483
  /**
@@ -3499,8 +3532,6 @@ export class BlockPermutation {
3499
3532
  * @returns
3500
3533
  * Whether this block stops liquid from flowing.
3501
3534
  * @throws This function can throw errors.
3502
- *
3503
- * {@link Error}
3504
3535
  */
3505
3536
  isLiquidBlocking(liquidType: LiquidType): boolean;
3506
3537
  /**
@@ -3514,8 +3545,6 @@ export class BlockPermutation {
3514
3545
  * Whether this block is removed and spawns its item when
3515
3546
  * touched by liquid.
3516
3547
  * @throws This function can throw errors.
3517
- *
3518
- * {@link Error}
3519
3548
  */
3520
3549
  liquidSpreadCausesSpawn(liquidType: LiquidType): boolean;
3521
3550
  /**
@@ -3702,6 +3731,8 @@ export class BlockRecordPlayerComponent extends BlockComponent {
3702
3731
  *
3703
3732
  * This function can't be called in read-only mode.
3704
3733
  *
3734
+ * @param startPlaying
3735
+ * Defaults to: true
3705
3736
  * @throws This function can throw errors.
3706
3737
  */
3707
3738
  setRecord(recordItemType?: ItemType | string, startPlaying?: boolean): void;
@@ -3842,6 +3873,7 @@ export class BlockSignComponent extends BlockComponent {
3842
3873
  * The side of the sign to read the message from. If not
3843
3874
  * provided, this will return the message from the front side
3844
3875
  * of the sign.
3876
+ * Defaults to: 0
3845
3877
  * @throws This function can throw errors.
3846
3878
  */
3847
3879
  getRawText(side?: SignSide): RawText | undefined;
@@ -3854,6 +3886,7 @@ export class BlockSignComponent extends BlockComponent {
3854
3886
  * The side of the sign to read the message from. If not
3855
3887
  * provided, this will return the message from the front side
3856
3888
  * of the sign.
3889
+ * Defaults to: 0
3857
3890
  * @throws This function can throw errors.
3858
3891
  */
3859
3892
  getText(side?: SignSide): string | undefined;
@@ -3865,6 +3898,7 @@ export class BlockSignComponent extends BlockComponent {
3865
3898
  * @param side
3866
3899
  * The side of the sign to read the dye from. If not provided,
3867
3900
  * this will return the dye on the front side of the sign.
3901
+ * Defaults to: 0
3868
3902
  * @throws This function can throw errors.
3869
3903
  */
3870
3904
  getTextDyeColor(side?: SignSide): DyeColor | undefined;
@@ -3884,6 +3918,7 @@ export class BlockSignComponent extends BlockComponent {
3884
3918
  * The side of the sign the message will be set on. If not
3885
3919
  * provided, the message will be set on the front side of the
3886
3920
  * sign.
3921
+ * Defaults to: 0
3887
3922
  * @throws
3888
3923
  * Throws if the provided message is greater than 512
3889
3924
  * characters in length.
@@ -3898,10 +3933,12 @@ export class BlockSignComponent extends BlockComponent {
3898
3933
  * @param color
3899
3934
  * The dye color to apply to the sign or undefined to clear the
3900
3935
  * dye on the sign.
3936
+ * Defaults to: null
3901
3937
  * @param side
3902
3938
  * The side of the sign the color will be set on. If not
3903
3939
  * provided, the color will be set on the front side of the
3904
3940
  * sign.
3941
+ * Defaults to: 0
3905
3942
  * @throws This function can throw errors.
3906
3943
  */
3907
3944
  setTextDyeColor(color?: DyeColor, side?: SignSide): void;
@@ -5113,6 +5150,7 @@ export class Dimension {
5113
5150
  * or all of the block volume is outside of the loaded chunks.
5114
5151
  * Will only check the block locations that are within the
5115
5152
  * loaded chunks in the volume.
5153
+ * Defaults to: false
5116
5154
  * @returns
5117
5155
  * Returns true if at least one block in the volume satisfies
5118
5156
  * the filter, false otherwise.
@@ -5265,6 +5303,7 @@ export class Dimension {
5265
5303
  * or all of the block volume is outside of the loaded chunks.
5266
5304
  * Will only check the block locations that are within the
5267
5305
  * loaded chunks in the volume.
5306
+ * Defaults to: false
5268
5307
  * @returns
5269
5308
  * Returns the ListBlockVolume that contains all the block
5270
5309
  * locations that satisfied the block filter.
@@ -5403,6 +5442,59 @@ export class Dimension {
5403
5442
  * @throws This function can throw errors.
5404
5443
  */
5405
5444
  getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
5445
+ /**
5446
+ * @rc
5447
+ * @remarks
5448
+ * Places the given feature into the dimension at the specified
5449
+ * location.
5450
+ *
5451
+ * This function can't be called in read-only mode.
5452
+ *
5453
+ * @param featureName
5454
+ * The string identifier for the feature.
5455
+ * @param location
5456
+ * Location to place the feature.
5457
+ * @param shouldThrow
5458
+ * Specifies if the function call will throw an error if the
5459
+ * feature could not be placed.
5460
+ * Note: The function call will always throw an error if using
5461
+ * an unknown feature name or trying to place in a unloaded
5462
+ * chunk.
5463
+ * Defaults to: false
5464
+ * @throws
5465
+ * An error will be thrown if the feature name is invalid.
5466
+ * An error will be thrown if the location is in an unloaded
5467
+ * chunk.
5468
+ *
5469
+ * {@link Error}
5470
+ *
5471
+ * {@link minecraftcommon.InvalidArgumentError}
5472
+ *
5473
+ * {@link LocationInUnloadedChunkError}
5474
+ */
5475
+ placeFeature(featureName: string, location: Vector3, shouldThrow?: boolean): boolean;
5476
+ /**
5477
+ * @rc
5478
+ * @remarks
5479
+ * Places the given feature rule into the dimension at the
5480
+ * specified location.
5481
+ *
5482
+ * This function can't be called in read-only mode.
5483
+ *
5484
+ * @param featureRuleName
5485
+ * The string identifier for the feature rule.
5486
+ * @param location
5487
+ * Location to place the feature rule.
5488
+ * @throws
5489
+ * An error will be thrown if the feature rule name is invalid.
5490
+ * An error will be thrown if the location is in an unloaded
5491
+ * chunk.
5492
+ *
5493
+ * {@link minecraftcommon.InvalidArgumentError}
5494
+ *
5495
+ * {@link LocationInUnloadedChunkError}
5496
+ */
5497
+ placeFeatureRule(featureRuleName: string, location: Vector3): boolean;
5406
5498
  /**
5407
5499
  * @remarks
5408
5500
  * Plays a sound for all players.
@@ -5525,20 +5617,22 @@ export class Dimension {
5525
5617
  * Newly created entity at the specified location.
5526
5618
  * @throws This function can throw errors.
5527
5619
  *
5620
+ * {@link Error}
5621
+ *
5528
5622
  * {@link LocationInUnloadedChunkError}
5529
5623
  *
5530
5624
  * {@link LocationOutOfWorldBoundariesError}
5531
5625
  * @example spawnAdultHorse.ts
5532
5626
  * ```typescript
5533
- * import { DimensionLocation } from "@minecraft/server";
5534
- * import { Vector3Utils } from "@minecraft/math";
5627
+ * import { DimensionLocation } from '@minecraft/server';
5628
+ * import { Vector3Utils } from '@minecraft/math';
5535
5629
  *
5536
5630
  * function spawnAdultHorse(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
5537
- * log("Create a horse and triggering the ageable_grow_up event, ensuring the horse is created as an adult");
5538
- * targetLocation.dimension.spawnEntity(
5539
- * "minecraft:horse<minecraft:ageable_grow_up>",
5540
- * Vector3Utils.add(targetLocation, { x: 0, y: 1, z: 0 })
5541
- * );
5631
+ * log('Create a horse and triggering the ageable_grow_up event, ensuring the horse is created as an adult');
5632
+ * targetLocation.dimension.spawnEntity(
5633
+ * 'minecraft:horse<minecraft:ageable_grow_up>',
5634
+ * Vector3Utils.add(targetLocation, { x: 0, y: 1, z: 0 })
5635
+ * );
5542
5636
  * }
5543
5637
  * ```
5544
5638
  * @example quickFoxLazyDog.ts
@@ -6349,6 +6443,7 @@ export class Entity {
6349
6443
  * @param useEffects
6350
6444
  * Whether to show any visual effects connected to the
6351
6445
  * extinguishing.
6446
+ * Defaults to: true
6352
6447
  * @returns
6353
6448
  * Returns whether the entity was on fire.
6354
6449
  * @throws This function can throw errors.
@@ -6744,7 +6839,7 @@ export class Entity {
6744
6839
  *
6745
6840
  * {@link CommandError}
6746
6841
  *
6747
- * {@link Error}
6842
+ * {@link InvalidEntityError}
6748
6843
  */
6749
6844
  runCommand(commandString: string): CommandResult;
6750
6845
  /**
@@ -6777,6 +6872,7 @@ export class Entity {
6777
6872
  * Whether side-effects should be applied (e.g. thawing freeze)
6778
6873
  * and other conditions such as rain or fire protection should
6779
6874
  * be taken into consideration.
6875
+ * Defaults to: true
6780
6876
  * @returns
6781
6877
  * Whether the entity was set on fire. This can fail if seconds
6782
6878
  * is less than or equal to zero, the entity is wet or the
@@ -7492,6 +7588,8 @@ export class EntityFrictionModifierComponent extends EntityComponent {
7492
7588
  }
7493
7589
 
7494
7590
  /**
7591
+ * @deprecated This class is deprecated and will be removed in 2.0.0.
7592
+ *
7495
7593
  * Sets the offset from the ground that the entity is actually
7496
7594
  * at.
7497
7595
  */
@@ -7499,6 +7597,8 @@ export class EntityFrictionModifierComponent extends EntityComponent {
7499
7597
  export class EntityGroundOffsetComponent extends EntityComponent {
7500
7598
  private constructor();
7501
7599
  /**
7600
+ * @deprecated This property is deprecated and will be removed in 2.0.0.
7601
+ *
7502
7602
  * @remarks
7503
7603
  * Value of this particular ground offset. Note that this value
7504
7604
  * is effectively read only; setting the ground offset value
@@ -10424,8 +10524,6 @@ export class ItemCompostableComponent extends ItemComponent {
10424
10524
  *
10425
10525
  * @throws
10426
10526
  * Throws if value outside the range [1 - 100]
10427
- *
10428
- * {@link Error}
10429
10527
  */
10430
10528
  readonly compostingChance: number;
10431
10529
  static readonly componentId = 'minecraft:compostable';
@@ -10549,6 +10647,7 @@ export class ItemDurabilityComponent extends ItemComponent {
10549
10647
  * Unbreaking factor to consider in factoring the damage
10550
10648
  * chance. Incoming unbreaking parameter must be within the
10551
10649
  * range [0, 3].
10650
+ * Defaults to: 0
10552
10651
  * @throws This function can throw errors.
10553
10652
  */
10554
10653
  getDamageChance(unbreakingEnchantmentLevel?: number): number;
@@ -10992,6 +11091,7 @@ export class ItemStack {
10992
11091
  * provided value will be clamped to the item's maximum stack
10993
11092
  * size. Note that certain items can only have one item in the
10994
11093
  * stack.
11094
+ * Defaults to: 1
10995
11095
  * @throws
10996
11096
  * Throws if `itemType` is invalid, or if `amount` is outside
10997
11097
  * the range of 1-255.
@@ -11039,8 +11139,9 @@ export class ItemStack {
11039
11139
  * @param componentId
11040
11140
  * The identifier of the component (e.g., 'minecraft:food'). If
11041
11141
  * no namespace prefix is specified, 'minecraft:' is assumed.
11042
- * Available component IDs can be found as part of the {@link
11043
- * ItemComponentTypes} enum.
11142
+ * Available component IDs are those in the {@link
11143
+ * ItemComponentTypes} enum and custom component IDs registered
11144
+ * with the {@link ItemComponentRegistry}.
11044
11145
  * @returns
11045
11146
  * Returns the component if it exists on the item stack,
11046
11147
  * otherwise undefined.
@@ -12274,8 +12375,6 @@ export class Player extends Entity {
12274
12375
  * Contains the player's device information.
12275
12376
  *
12276
12377
  * @throws This property can throw when used.
12277
- *
12278
- * {@link Error}
12279
12378
  */
12280
12379
  readonly clientSystemInfo: ClientSystemInfo;
12281
12380
  /**
@@ -12393,6 +12492,22 @@ export class Player extends Entity {
12393
12492
  * @throws This function can throw errors.
12394
12493
  */
12395
12494
  addLevels(amount: number): number;
12495
+ /**
12496
+ * @rc
12497
+ * @remarks
12498
+ * For this player, removes all overrides of any Entity
12499
+ * Properties on the target Entity. This change is not applied
12500
+ * until the next tick and will not apply to other players.
12501
+ *
12502
+ * This function can't be called in read-only mode.
12503
+ *
12504
+ * @param targetEntity
12505
+ * The Entity whose Entity Property overrides are being
12506
+ * cleared.
12507
+ * @throws
12508
+ * Throws if the entity is invalid.
12509
+ */
12510
+ clearPropertyOverridesForEntity(targetEntity: Entity): void;
12396
12511
  /**
12397
12512
  * @remarks
12398
12513
  * Retrieves the active gamemode for this player, if specified.
@@ -12496,6 +12611,26 @@ export class Player extends Entity {
12496
12611
  *
12497
12612
  */
12498
12613
  queueMusic(trackId: string, musicOptions?: MusicOptions): void;
12614
+ /**
12615
+ * @rc
12616
+ * @remarks
12617
+ * For this player, removes the override on an Entity Property.
12618
+ * This change is not applied until the next tick and will not
12619
+ * apply to other players.
12620
+ *
12621
+ * This function can't be called in read-only mode.
12622
+ *
12623
+ * @param targetEntity
12624
+ * The Entity whose Entity Property override is being removed.
12625
+ * @param identifier
12626
+ * The Entity Property identifier.
12627
+ * @throws
12628
+ * Throws if the entity is invalid.
12629
+ * Throws if an invalid identifier is provided.
12630
+ * Throws if the provided value type does not match the
12631
+ * property type.
12632
+ */
12633
+ removePropertyOverrideForEntity(targetEntity: Entity, identifier: string): void;
12499
12634
  /**
12500
12635
  * @remarks
12501
12636
  * Resets the level of the player.
@@ -12515,6 +12650,10 @@ export class Player extends Entity {
12515
12650
  * This method can throw if the provided {@link RawMessage} is
12516
12651
  * in an invalid format. For example, if an empty `name` string
12517
12652
  * is provided to `score`.
12653
+ *
12654
+ * {@link InvalidEntityError}
12655
+ *
12656
+ * {@link RawMessageError}
12518
12657
  * @example nestedTranslation.ts
12519
12658
  * ```typescript
12520
12659
  * import { world, DimensionLocation } from "@minecraft/server";
@@ -12602,6 +12741,34 @@ export class Player extends Entity {
12602
12741
  * @throws This function can throw errors.
12603
12742
  */
12604
12743
  setGameMode(gameMode?: GameMode): void;
12744
+ /**
12745
+ * @rc
12746
+ * @remarks
12747
+ * For this player, overrides an Entity Property on the target
12748
+ * Entity to the provided value. This property must be client
12749
+ * synced. This change is not applied until the next tick and
12750
+ * will not apply to other players.
12751
+ *
12752
+ * This function can't be called in read-only mode.
12753
+ *
12754
+ * @param targetEntity
12755
+ * The Entity whose Entity Property is being overriden.
12756
+ * @param identifier
12757
+ * The Entity Property identifier.
12758
+ * @param value
12759
+ * The override value. The provided type must be compatible
12760
+ * with the type specified in the entity's definition.
12761
+ * @throws
12762
+ * Throws if the entity is invalid.
12763
+ * Throws if an invalid identifier is provided.
12764
+ * Throws if the provided value type does not match the
12765
+ * property type.
12766
+ * Throws if the provided value is outside the expected range
12767
+ * (int, float properties).
12768
+ * Throws if the provided string value does not match the set
12769
+ * of accepted enum values (enum properties)
12770
+ */
12771
+ setPropertyOverrideForEntity(targetEntity: Entity, identifier: string, value: boolean | number | string): void;
12605
12772
  /**
12606
12773
  * @remarks
12607
12774
  * Sets the current starting spawn point for this particular
@@ -13265,8 +13432,6 @@ export class PlayerInputPermissions {
13265
13432
  * This function can't be called in read-only mode.
13266
13433
  *
13267
13434
  * @throws This function can throw errors.
13268
- *
13269
- * {@link Error}
13270
13435
  */
13271
13436
  isPermissionCategoryEnabled(permissionCategory: InputPermissionCategory): boolean;
13272
13437
  /**
@@ -14420,6 +14585,8 @@ export class ScreenDisplay {
14420
14585
  * This function can't be called in read-only mode.
14421
14586
  *
14422
14587
  * @throws This function can throw errors.
14588
+ *
14589
+ * {@link InvalidEntityError}
14423
14590
  */
14424
14591
  getHiddenHudElements(): HudElement[];
14425
14592
  /**
@@ -14427,6 +14594,8 @@ export class ScreenDisplay {
14427
14594
  * This function can't be called in read-only mode.
14428
14595
  *
14429
14596
  * @throws This function can throw errors.
14597
+ *
14598
+ * {@link InvalidEntityError}
14430
14599
  */
14431
14600
  hideAllExcept(hudElements?: HudElement[]): void;
14432
14601
  /**
@@ -14434,6 +14603,8 @@ export class ScreenDisplay {
14434
14603
  * This function can't be called in read-only mode.
14435
14604
  *
14436
14605
  * @throws This function can throw errors.
14606
+ *
14607
+ * {@link InvalidEntityError}
14437
14608
  */
14438
14609
  isForcedHidden(hudElement: HudElement): boolean;
14439
14610
  /**
@@ -14446,10 +14617,14 @@ export class ScreenDisplay {
14446
14617
  */
14447
14618
  isValid(): boolean;
14448
14619
  /**
14620
+ * @deprecated This function is deprecated and will be removed in 2.0.0.
14621
+ *
14449
14622
  * @remarks
14450
14623
  * This function can't be called in read-only mode.
14451
14624
  *
14452
14625
  * @throws This function can throw errors.
14626
+ *
14627
+ * {@link InvalidEntityError}
14453
14628
  */
14454
14629
  resetHudElements(): void;
14455
14630
  /**
@@ -14462,6 +14637,10 @@ export class ScreenDisplay {
14462
14637
  * @param text
14463
14638
  * New value for the action bar text.
14464
14639
  * @throws This function can throw errors.
14640
+ *
14641
+ * {@link InvalidEntityError}
14642
+ *
14643
+ * {@link RawMessageError}
14465
14644
  */
14466
14645
  setActionBar(text: (RawMessage | string)[] | RawMessage | string): void;
14467
14646
  /**
@@ -14477,6 +14656,8 @@ export class ScreenDisplay {
14477
14656
  * @param hudElements
14478
14657
  * Optional list of HUD elements to configure visibility for.
14479
14658
  * @throws This function can throw errors.
14659
+ *
14660
+ * {@link InvalidEntityError}
14480
14661
  */
14481
14662
  setHudVisibility(visible: HudVisibility, hudElements?: HudElement[]): void;
14482
14663
  /**
@@ -14489,6 +14670,12 @@ export class ScreenDisplay {
14489
14670
  * This function can't be called in read-only mode.
14490
14671
  *
14491
14672
  * @throws This function can throw errors.
14673
+ *
14674
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
14675
+ *
14676
+ * {@link InvalidEntityError}
14677
+ *
14678
+ * {@link RawMessageError}
14492
14679
  * @example setTitle.ts
14493
14680
  * ```typescript
14494
14681
  * import { world, DimensionLocation } from "@minecraft/server";
@@ -14554,6 +14741,10 @@ export class ScreenDisplay {
14554
14741
  * This function can't be called in read-only mode.
14555
14742
  *
14556
14743
  * @throws This function can throw errors.
14744
+ *
14745
+ * {@link InvalidEntityError}
14746
+ *
14747
+ * {@link RawMessageError}
14557
14748
  * @example countdown.ts
14558
14749
  * ```typescript
14559
14750
  * import { world, system, DimensionLocation } from "@minecraft/server";
@@ -14791,6 +14982,7 @@ export class Structure {
14791
14982
  * @param saveMode
14792
14983
  * Determines how the Structure should be saved. Defaults to
14793
14984
  * saving to the world.
14985
+ * Defaults to: 1
14794
14986
  * @returns
14795
14987
  * Returns the newly created structure.
14796
14988
  * @throws
@@ -14827,9 +15019,11 @@ export class Structure {
14827
15019
  * The block location relative to the Structure's origin.
14828
15020
  * @param blockPermutation
14829
15021
  * The BlockPermutation to set.
15022
+ * Defaults to: null
14830
15023
  * @param waterlogged
14831
15024
  * Specifies whether the block should be waterlogged. Air and
14832
15025
  * undefined blocks cannot be waterlogged.
15026
+ * Defaults to: false
14833
15027
  * @throws
14834
15028
  * Throws if the type of block is StructureVoid.
14835
15029
  * Throws if the block is undefined and waterlogged is set to
@@ -14868,6 +15062,7 @@ export class StructureManager {
14868
15062
  * @param saveMode
14869
15063
  * How the Structure should be saved upon creation. Defaults to
14870
15064
  * StructureSaveMode.Memory.
15065
+ * Defaults to: 0
14871
15066
  * @returns
14872
15067
  * Returns the newly created Structure.
14873
15068
  * @throws
@@ -14984,6 +15179,87 @@ export class StructureManager {
14984
15179
  location: Vector3,
14985
15180
  options?: StructurePlaceOptions,
14986
15181
  ): void;
15182
+ /**
15183
+ * @rc
15184
+ * @remarks
15185
+ * Places a partial jigsaw structure in the world. This is
15186
+ * useful for debugging connections between jigsaw blocks.
15187
+ *
15188
+ * This function can't be called in read-only mode.
15189
+ *
15190
+ * @param pool
15191
+ * The identifier of the template pool to start from.
15192
+ * @param targetJigsaw
15193
+ * The name of the jigsaw block to start from. This block must
15194
+ * be included in at least one of the starting pool structure
15195
+ * templates.
15196
+ * @param maxDepth
15197
+ * The maximum recursion depth for the jigsaw structure.
15198
+ * @param dimension
15199
+ * The dimension to place the jigsaw structure in.
15200
+ * @param location
15201
+ * The location where the jigsaw structure will begin
15202
+ * generating relative to the targetJigsaw block.
15203
+ * @param options
15204
+ * Optional settings to use when generating the jigsaw
15205
+ * structure.
15206
+ * @returns
15207
+ * Returns a {@link BlockBoundingBox} object which represents
15208
+ * the maximum bounds of the jigsaw structure.
15209
+ * @throws
15210
+ * Throws if maxDepth is outside of the range [1,20]
15211
+ * Throws if generation fails due to invalid parameters or
15212
+ * jigsaw configuration.
15213
+ * Throws if the placement location contains blocks that are
15214
+ * outside the world bounds.
15215
+ *
15216
+ * {@link PlaceJigsawError}
15217
+ */
15218
+ placeJigsaw(
15219
+ pool: string,
15220
+ targetJigsaw: string,
15221
+ maxDepth: number,
15222
+ dimension: Dimension,
15223
+ location: Vector3,
15224
+ options?: JigsawPlaceOptions,
15225
+ ): BlockBoundingBox;
15226
+ /**
15227
+ * @rc
15228
+ * @remarks
15229
+ * Places a jigsaw structure in the world.
15230
+ *
15231
+ * This function can't be called in read-only mode.
15232
+ *
15233
+ * @param identifier
15234
+ * The identifier of the jigsaw structure.
15235
+ * @param dimension
15236
+ * The dimension to place the jigsaw structure in.
15237
+ * @param location
15238
+ * The location where the jigsaw structure will begin
15239
+ * generating. Note that the y value will be overridden by the
15240
+ * structure's start height unless the
15241
+ * ignoreStarJigsawStructurePlaceOptions ignoreStartHeight
15242
+ * option is set.
15243
+ * @param options
15244
+ * Optional settings to use when generating the jigsaw
15245
+ * structure.
15246
+ * @returns
15247
+ * Returns a {@link BlockBoundingBox} object which represents
15248
+ * the maximum bounds of the jigsaw structure.
15249
+ * @throws
15250
+ * Throws if generation fails due to invalid parameters or
15251
+ * jigsaw configuration.
15252
+ * Throws if the placement location contains blocks that are
15253
+ * outside the world bounds.
15254
+ *
15255
+ * {@link PlaceJigsawError}
15256
+ */
15257
+ placeJigsawStructure(
15258
+ identifier: string,
15259
+ dimension: Dimension,
15260
+ location: Vector3,
15261
+ options?: JigsawStructurePlaceOptions,
15262
+ ): BlockBoundingBox;
14987
15263
  }
14988
15264
 
14989
15265
  /**
@@ -15658,6 +15934,15 @@ export class World {
15658
15934
  * not fixed and will be determined by surrounding blocks.
15659
15935
  */
15660
15936
  getDefaultSpawnLocation(): Vector3;
15937
+ /**
15938
+ * @rc
15939
+ * @remarks
15940
+ * Gets the difficulty from the world.
15941
+ *
15942
+ * @returns
15943
+ * Returns the world difficulty.
15944
+ */
15945
+ getDifficulty(): Difficulty;
15661
15946
  /**
15662
15947
  * @remarks
15663
15948
  * Returns a dimension object.
@@ -15945,6 +16230,17 @@ export class World {
15945
16230
  * {@link LocationOutOfWorldBoundariesError}
15946
16231
  */
15947
16232
  setDefaultSpawnLocation(spawnLocation: Vector3): void;
16233
+ /**
16234
+ * @rc
16235
+ * @remarks
16236
+ * Sets the worlds difficulty.
16237
+ *
16238
+ * This function can't be called in read-only mode.
16239
+ *
16240
+ * @param difficulty
16241
+ * The difficulty we want to set the world to.
16242
+ */
16243
+ setDifficulty(difficulty: Difficulty): void;
15948
16244
  /**
15949
16245
  * @remarks
15950
16246
  * Sets a specified property to a value.
@@ -16654,6 +16950,40 @@ export class WorldInitializeBeforeEventSignal {
16654
16950
  unsubscribe(callback: (arg0: WorldInitializeBeforeEvent) => void): void;
16655
16951
  }
16656
16952
 
16953
+ /**
16954
+ * @rc
16955
+ * A BlockBoundingBox is an interface to an object which
16956
+ * represents an AABB aligned rectangle.
16957
+ * The BlockBoundingBox assumes that it was created in a valid
16958
+ * state (min <= max) but cannot guarantee it (unless it was
16959
+ * created using the associated {@link
16960
+ * @minecraft/server.BlockBoundingBoxUtils} utility functions.
16961
+ * The min/max coordinates represent the diametrically opposite
16962
+ * corners of the rectangle.
16963
+ * The BlockBoundingBox is not a representation of blocks - it
16964
+ * has no association with any type, it is just a mathematical
16965
+ * construct - so a rectangle with
16966
+ * ( 0,0,0 ) -> ( 0,0,0 )
16967
+ * has a size of ( 0,0,0 ) (unlike the very similar {@link
16968
+ * BlockVolume} object)
16969
+ */
16970
+ export interface BlockBoundingBox {
16971
+ /**
16972
+ * @remarks
16973
+ * A {@link Vector3} that represents the largest corner of the
16974
+ * rectangle
16975
+ *
16976
+ */
16977
+ max: Vector3;
16978
+ /**
16979
+ * @remarks
16980
+ * A {@link Vector3} that represents the smallest corner of the
16981
+ * rectangle
16982
+ *
16983
+ */
16984
+ min: Vector3;
16985
+ }
16986
+
16657
16987
  /**
16658
16988
  * Contains a set of events that will be raised for a block.
16659
16989
  * This object must be bound using the BlockRegistry.
@@ -17868,6 +18198,58 @@ export interface ItemCustomComponent {
17868
18198
  onUseOn?: (arg0: ItemComponentUseOnEvent) => void;
17869
18199
  }
17870
18200
 
18201
+ /**
18202
+ * @rc
18203
+ * Provides additional options for {@link
18204
+ * StructureManager.placeJigsaw}.
18205
+ */
18206
+ export interface JigsawPlaceOptions {
18207
+ /**
18208
+ * @remarks
18209
+ * Whether entities should be included in the structure.
18210
+ * Defaults to true.
18211
+ *
18212
+ */
18213
+ includeEntities?: boolean;
18214
+ /**
18215
+ * @remarks
18216
+ * Whether the jigsaw blocks should be kept when generating the
18217
+ * structure. Defaults to false.
18218
+ *
18219
+ */
18220
+ keepJigsaws?: boolean;
18221
+ }
18222
+
18223
+ /**
18224
+ * @rc
18225
+ * Provides additional options for {@link
18226
+ * StructureManager.placeJigsawStructure}.
18227
+ */
18228
+ export interface JigsawStructurePlaceOptions {
18229
+ /**
18230
+ * @remarks
18231
+ * Whether the start height defined in the jigsaw structure
18232
+ * definition should be ignored and overridden with the
18233
+ * specified y coordinate. Defaults to false.
18234
+ *
18235
+ */
18236
+ ignoreStartHeight?: boolean;
18237
+ /**
18238
+ * @remarks
18239
+ * Whether entities should be included in the structure.
18240
+ * Defaults to true.
18241
+ *
18242
+ */
18243
+ includeEntities?: boolean;
18244
+ /**
18245
+ * @remarks
18246
+ * Whether the jigsaw blocks should be kept when generating the
18247
+ * structure. Defaults to false.
18248
+ *
18249
+ */
18250
+ keepJigsaws?: boolean;
18251
+ }
18252
+
17871
18253
  /**
17872
18254
  * Less than operator.
17873
18255
  */
@@ -18723,6 +19105,19 @@ export class NamespaceNameError extends Error {
18723
19105
  reason: NamespaceNameErrorReason;
18724
19106
  }
18725
19107
 
19108
+ /**
19109
+ * @rc
19110
+ */
19111
+ // @ts-ignore Class inheritance allowed for native defined classes
19112
+ export class PlaceJigsawError extends Error {
19113
+ private constructor();
19114
+ }
19115
+
19116
+ // @ts-ignore Class inheritance allowed for native defined classes
19117
+ export class RawMessageError extends Error {
19118
+ private constructor();
19119
+ }
19120
+
18726
19121
  /**
18727
19122
  * Error thrown when the specified area contains one or more
18728
19123
  * unloaded chunks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.18.0",
3
+ "version": "1.19.0-rc.1.21.80-preview.27",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {