@minecraft/server 2.8.0-rc.1.26.30-preview.25 → 2.9.0-beta.1.26.30-preview.25

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 +2983 -226
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  Copyright (c) Microsoft Corporation.
8
8
  ***************************************************************************** */
9
9
  /**
10
- * @preview
10
+ * @beta
11
11
  * @packageDocumentation
12
12
  * Contains many types related to manipulating a Minecraft
13
13
  * world, including entities, blocks, dimensions, and more.
@@ -16,7 +16,7 @@
16
16
  * ```json
17
17
  * {
18
18
  * "module_name": "@minecraft/server",
19
- * "version": "2.8.0"
19
+ * "version": "2.9.0-beta"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -229,6 +229,55 @@ export enum CommandPermissionLevel {
229
229
  Owner = 4,
230
230
  }
231
231
 
232
+ /**
233
+ * @beta
234
+ * The Action enum determines how the CompoundBlockVolume
235
+ * considers the associated CompoundBlockVolumeItem when
236
+ * performing inside/outside calculations.
237
+ */
238
+ export enum CompoundBlockVolumeAction {
239
+ /**
240
+ * @remarks
241
+ * The associated BlockVolume is considered a positive space,
242
+ * and any intersection tests are considered hits
243
+ *
244
+ */
245
+ Add = 0,
246
+ /**
247
+ * @remarks
248
+ * The associated BlockVolume is considered a negative or void
249
+ * space, and any intersection tests are considered misses.
250
+ * Using the Subtract action, it is possible to `punch holes`
251
+ * in block volumes so that any intersection tests may pass
252
+ * through such spaces
253
+ *
254
+ */
255
+ Subtract = 1,
256
+ }
257
+
258
+ /**
259
+ * @beta
260
+ * An enum describing the relativity of the
261
+ * CompoundBlockVolumeItem, relative to the parent
262
+ * CompoundVolume.
263
+ */
264
+ export enum CompoundBlockVolumePositionRelativity {
265
+ /**
266
+ * @remarks
267
+ * The locations within the associated BlockVolume are relative
268
+ * to the CompoundBlockVolume to which they were added
269
+ *
270
+ */
271
+ Relative = 0,
272
+ /**
273
+ * @remarks
274
+ * The locations within the associated BlockVolume are in
275
+ * absolute world space
276
+ *
277
+ */
278
+ Absolute = 1,
279
+ }
280
+
232
281
  /**
233
282
  * Reasons that the {@link
234
283
  * @minecraft/server.ContainerRulesError} was thrown.
@@ -331,6 +380,13 @@ export enum CustomCommandErrorReason {
331
380
  *
332
381
  */
333
382
  RegistryReadOnly = 'RegistryReadOnly',
383
+ /**
384
+ * @beta
385
+ * @remarks
386
+ * Non enum type command parameters cannot use enumName.
387
+ *
388
+ */
389
+ UnexpectedEnumName = 'UnexpectedEnumName',
334
390
  }
335
391
 
336
392
  /**
@@ -1068,6 +1124,14 @@ export enum EntityComponentTypes {
1068
1124
  *
1069
1125
  */
1070
1126
  NavigationWalk = 'minecraft:navigation.walk',
1127
+ /**
1128
+ * @beta
1129
+ * @remarks
1130
+ * Adds NPC capabilities to an entity such as custom skin,
1131
+ * name, and dialogue interactions.
1132
+ *
1133
+ */
1134
+ Npc = 'minecraft:npc',
1071
1135
  /**
1072
1136
  * @remarks
1073
1137
  * When present on an entity, this entity is on fire.
@@ -1438,6 +1502,13 @@ export enum EntityHealCause {
1438
1502
  *
1439
1503
  */
1440
1504
  SelfHeal = 'SelfHeal',
1505
+ /**
1506
+ * @beta
1507
+ * @remarks
1508
+ * Healing caused when Totem of Undying is activated.
1509
+ *
1510
+ */
1511
+ TotemOfUndying = 'TotemOfUndying',
1441
1512
  }
1442
1513
 
1443
1514
  /**
@@ -1545,6 +1616,14 @@ export enum EntitySwingSource {
1545
1616
  * and mainhand slots.
1546
1617
  */
1547
1618
  export enum EquipmentSlot {
1619
+ /**
1620
+ * @beta
1621
+ * @remarks
1622
+ * The body slot. This slot is used to hold armor for
1623
+ * non-humanoid mobs.
1624
+ *
1625
+ */
1626
+ Body = 'Body',
1548
1627
  /**
1549
1628
  * @remarks
1550
1629
  * The chest slot. This slot is used to hold items such as
@@ -1814,6 +1893,14 @@ export enum GameRule {
1814
1893
  *
1815
1894
  */
1816
1895
  PlayersSleepingPercentage = 'playersSleepingPercentage',
1896
+ /**
1897
+ * @beta
1898
+ * @remarks
1899
+ * Controls which player waypoints are automatically added to
1900
+ * the players locator bar.
1901
+ *
1902
+ */
1903
+ PlayerWaypoints = 'playerWaypoints',
1817
1904
  /**
1818
1905
  * @remarks
1819
1906
  * Controls whether projectiles (entities with a projectile
@@ -2258,6 +2345,34 @@ export enum LiquidType {
2258
2345
  Water = 'Water',
2259
2346
  }
2260
2347
 
2348
+ /**
2349
+ * @beta
2350
+ * Enum representing the different reasons why a locator bar
2351
+ * operation may fail.
2352
+ */
2353
+ export enum LocatorBarErrorReason {
2354
+ /**
2355
+ * @remarks
2356
+ * The waypoint already exists in the locator bar and cannot be
2357
+ * added again.
2358
+ *
2359
+ */
2360
+ WaypointAlreadyExists = 'WaypointAlreadyExists',
2361
+ /**
2362
+ * @remarks
2363
+ * The maximum number of waypoints has been reached and no more
2364
+ * can be added.
2365
+ *
2366
+ */
2367
+ WaypointLimitExceeded = 'WaypointLimitExceeded',
2368
+ /**
2369
+ * @remarks
2370
+ * The specified waypoint does not exist in the locator bar.
2371
+ *
2372
+ */
2373
+ WaypointNotFound = 'WaypointNotFound',
2374
+ }
2375
+
2261
2376
  /**
2262
2377
  * Describes the memory of a device.
2263
2378
  */
@@ -2576,6 +2691,14 @@ export enum PlayerPermissionLevel {
2576
2691
  Custom = 3,
2577
2692
  }
2578
2693
 
2694
+ /**
2695
+ * @beta
2696
+ */
2697
+ export enum PlayerWaypointsMode {
2698
+ Everyone = 'Everyone',
2699
+ Off = 'Off',
2700
+ }
2701
+
2579
2702
  /**
2580
2703
  * Contains objectives and participants for the scoreboard.
2581
2704
  */
@@ -2902,6 +3025,61 @@ export enum TintMethod {
2902
3025
  Water = 'Water',
2903
3026
  }
2904
3027
 
3028
+ /**
3029
+ * @beta
3030
+ * An enumeration with the reason that a watchdog is deciding
3031
+ * to terminate execution of a behavior packs' script.
3032
+ */
3033
+ export enum WatchdogTerminateReason {
3034
+ /**
3035
+ * @remarks
3036
+ * Script runtime for a behavior pack is terminated due to
3037
+ * non-responsiveness from script (a hang or infinite loop).
3038
+ *
3039
+ */
3040
+ Hang = 'Hang',
3041
+ /**
3042
+ * @remarks
3043
+ * Script runtime for a behavior pack is terminated due to a
3044
+ * stack overflow (a long, and potentially infinite) chain of
3045
+ * function calls.
3046
+ *
3047
+ */
3048
+ StackOverflow = 'StackOverflow',
3049
+ }
3050
+
3051
+ /**
3052
+ * @beta
3053
+ * Enum representing different texture icons that can be
3054
+ * displayed for waypoints on the locator bar.
3055
+ */
3056
+ export enum WaypointTexture {
3057
+ /**
3058
+ * @remarks
3059
+ * Circle waypoint icon texture.
3060
+ *
3061
+ */
3062
+ Circle = 'minecraft:circle',
3063
+ /**
3064
+ * @remarks
3065
+ * Small square waypoint icon texture.
3066
+ *
3067
+ */
3068
+ SmallSquare = 'minecraft:small_square',
3069
+ /**
3070
+ * @remarks
3071
+ * Small star waypoint icon texture.
3072
+ *
3073
+ */
3074
+ SmallStar = 'minecraft:small_star',
3075
+ /**
3076
+ * @remarks
3077
+ * Square waypoint icon texture.
3078
+ *
3079
+ */
3080
+ Square = 'minecraft:square',
3081
+ }
3082
+
2905
3083
  /**
2906
3084
  * Used to specify the type of weather condition within the
2907
3085
  * world.
@@ -3055,6 +3233,7 @@ export type EntityComponentTypeMap = {
3055
3233
  'minecraft:navigation.generic': EntityNavigationGenericComponent;
3056
3234
  'minecraft:navigation.hover': EntityNavigationHoverComponent;
3057
3235
  'minecraft:navigation.walk': EntityNavigationWalkComponent;
3236
+ 'minecraft:npc': EntityNpcComponent;
3058
3237
  'minecraft:onfire': EntityOnFireComponent;
3059
3238
  'minecraft:player.exhaustion': EntityExhaustionComponent;
3060
3239
  'minecraft:player.hunger': EntityHungerComponent;
@@ -3088,6 +3267,7 @@ export type EntityComponentTypeMap = {
3088
3267
  'navigation.generic': EntityNavigationGenericComponent;
3089
3268
  'navigation.hover': EntityNavigationHoverComponent;
3090
3269
  'navigation.walk': EntityNavigationWalkComponent;
3270
+ npc: EntityNpcComponent;
3091
3271
  onfire: EntityOnFireComponent;
3092
3272
  'player.exhaustion': EntityExhaustionComponent;
3093
3273
  'player.hunger': EntityHungerComponent;
@@ -3107,6 +3287,15 @@ export type EntityComponentTypeMap = {
3107
3287
  wants_jockey: EntityWantsJockeyComponent;
3108
3288
  };
3109
3289
 
3290
+ /**
3291
+ * @beta
3292
+ */
3293
+ export type EntityIdentifierType<T> = [T] extends [never]
3294
+ ? VanillaEntityIdentifier
3295
+ : T extends string
3296
+ ? VanillaEntityIdentifier | T
3297
+ : never;
3298
+
3110
3299
  export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
3111
3300
  ? ItemComponentTypeMap[T]
3112
3301
  : ItemCustomComponentInstance;
@@ -3132,6 +3321,15 @@ export type ItemComponentTypeMap = {
3132
3321
  potion: ItemPotionComponent;
3133
3322
  };
3134
3323
 
3324
+ /**
3325
+ * @beta
3326
+ */
3327
+ export type VanillaEntityIdentifier =
3328
+ | EntityType
3329
+ | minecraftvanilladata.MinecraftEntityTypes
3330
+ | `${minecraftvanilladata.MinecraftEntityTypes}`
3331
+ | `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
3332
+
3135
3333
  /**
3136
3334
  * Handle to an aim-assist category that exists in the
3137
3335
  * world.aimAssist registry.
@@ -3289,7 +3487,9 @@ export class AimAssistCategorySettings {
3289
3487
  * A record mapping block Ids to their priority settings.
3290
3488
  * Larger numbers have greater priority.
3291
3489
  */
3292
- setBlockPriorities(blockPriorities: Record<string, number>): void;
3490
+ setBlockPriorities(
3491
+ blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
3492
+ ): void;
3293
3493
  /**
3294
3494
  * @remarks
3295
3495
  * Sets the priority settings used for block targeting.
@@ -3308,7 +3508,9 @@ export class AimAssistCategorySettings {
3308
3508
  * A record mapping entity Ids to their priority settings.
3309
3509
  * Larger numbers have greater priority.
3310
3510
  */
3311
- setEntityPriorities(entityPriorities: Record<string, number>): void;
3511
+ setEntityPriorities(
3512
+ entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
3513
+ ): void;
3312
3514
  /**
3313
3515
  * @remarks
3314
3516
  * Sets the priority settings used for entity targeting.
@@ -3507,8 +3709,10 @@ export class AimAssistPresetSettings {
3507
3709
  *
3508
3710
  * This function can't be called in restricted-execution mode.
3509
3711
  *
3712
+ * @param targets
3713
+ * An array of block tags.
3510
3714
  */
3511
- setExcludedBlockTagTargets(blockTagTargets?: string[]): void;
3715
+ setExcludedBlockTagTargets(targets?: string[]): void;
3512
3716
  /**
3513
3717
  * @remarks
3514
3718
  * Sets the list of block Ids to exclude from aim assist
@@ -3516,8 +3720,10 @@ export class AimAssistPresetSettings {
3516
3720
  *
3517
3721
  * This function can't be called in restricted-execution mode.
3518
3722
  *
3723
+ * @param targets
3724
+ * An array of block Ids.
3519
3725
  */
3520
- setExcludedBlockTargets(blockTargets?: string[]): void;
3726
+ setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
3521
3727
  /**
3522
3728
  * @remarks
3523
3729
  * Sets the list of entity Ids to exclude from aim assist
@@ -3525,8 +3731,10 @@ export class AimAssistPresetSettings {
3525
3731
  *
3526
3732
  * This function can't be called in restricted-execution mode.
3527
3733
  *
3734
+ * @param targets
3735
+ * An array of entity Ids.
3528
3736
  */
3529
- setExcludedEntityTargets(entityTargets?: string[]): void;
3737
+ setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
3530
3738
  /**
3531
3739
  * @remarks
3532
3740
  * Sets the list of entity type families to exclude from aim
@@ -3534,8 +3742,10 @@ export class AimAssistPresetSettings {
3534
3742
  *
3535
3743
  * This function can't be called in restricted-execution mode.
3536
3744
  *
3745
+ * @param targets
3746
+ * An array of entity type families.
3537
3747
  */
3538
- setExcludedEntityTypeFamilyTargets(entityTypeFamilyTargets?: string[]): void;
3748
+ setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
3539
3749
  /**
3540
3750
  * @remarks
3541
3751
  * Sets the per-item aim-assist category Ids.
@@ -3546,7 +3756,7 @@ export class AimAssistPresetSettings {
3546
3756
  * A record mapping item Ids to aim-assist category Ids.
3547
3757
  * Category Ids must have a namespace.
3548
3758
  */
3549
- setItemSettings(itemSettings: Record<string, string>): void;
3759
+ setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
3550
3760
  /**
3551
3761
  * @remarks
3552
3762
  * Sets the list of item Ids that will target liquid blocks
@@ -3557,7 +3767,7 @@ export class AimAssistPresetSettings {
3557
3767
  * @param items
3558
3768
  * An array of item Ids.
3559
3769
  */
3560
- setLiquidTargetingItems(items?: string[]): void;
3770
+ setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
3561
3771
  }
3562
3772
 
3563
3773
  /**
@@ -3663,6 +3873,28 @@ export class AimAssistRegistry {
3663
3873
  getPresets(): AimAssistPreset[];
3664
3874
  }
3665
3875
 
3876
+ /**
3877
+ * @beta
3878
+ * Describes a single banner pattern, which includes a colour
3879
+ * and a pattern type.
3880
+ */
3881
+ export class BannerPattern {
3882
+ private constructor();
3883
+ /**
3884
+ * @remarks
3885
+ * The color to apply to this banner pattern.
3886
+ *
3887
+ */
3888
+ readonly color: string;
3889
+ /**
3890
+ * @remarks
3891
+ * The pattern type (e.g. gradient, chevron, cross, etc.) to
3892
+ * apply to the banner.
3893
+ *
3894
+ */
3895
+ readonly pattern: string;
3896
+ }
3897
+
3666
3898
  /**
3667
3899
  * Describes a type of biome.
3668
3900
  */
@@ -3759,6 +3991,20 @@ export class Block {
3759
3991
  * {@link LocationOutOfWorldBoundariesError}
3760
3992
  */
3761
3993
  readonly isLiquid: boolean;
3994
+ /**
3995
+ * @beta
3996
+ * @remarks
3997
+ * Returns true if this block is solid and impassible - (e.g.,
3998
+ * a cobblestone block and a diamond block are solid, while a
3999
+ * ladder block and a fence block are not).
4000
+ *
4001
+ * @throws This property can throw when used.
4002
+ *
4003
+ * {@link LocationInUnloadedChunkError}
4004
+ *
4005
+ * {@link LocationOutOfWorldBoundariesError}
4006
+ */
4007
+ readonly isSolid: boolean;
3762
4008
  /**
3763
4009
  * @remarks
3764
4010
  * Returns true if this reference to a block is still valid
@@ -3924,6 +4170,30 @@ export class Block {
3924
4170
  * {@link LocationOutOfWorldBoundariesError}
3925
4171
  */
3926
4172
  canContainLiquid(liquidType: LiquidType): boolean;
4173
+ /**
4174
+ * @beta
4175
+ * @remarks
4176
+ * Checks to see whether it is valid to place the specified
4177
+ * block type or block permutation, on a specified face on this
4178
+ * block.
4179
+ *
4180
+ * @param blockToPlace
4181
+ * Block type or block permutation to check placement for.
4182
+ * @param faceToPlaceOn
4183
+ * Optional specific face of this block to check placement
4184
+ * against.
4185
+ * @returns
4186
+ * Returns `true` if the block type or permutation can be
4187
+ * placed on this block, else `false`.
4188
+ * @throws This function can throw errors.
4189
+ *
4190
+ * {@link Error}
4191
+ *
4192
+ * {@link LocationInUnloadedChunkError}
4193
+ *
4194
+ * {@link LocationOutOfWorldBoundariesError}
4195
+ */
4196
+ canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
3927
4197
  /**
3928
4198
  * @remarks
3929
4199
  * Returns the {@link Vector3} of the center of this block on
@@ -4020,6 +4290,29 @@ export class Block {
4020
4290
  * {@link LocationInUnloadedChunkError}
4021
4291
  */
4022
4292
  getLightLevel(): number;
4293
+ /**
4294
+ * @beta
4295
+ * @throws This function can throw errors.
4296
+ *
4297
+ * {@link LocationInUnloadedChunkError}
4298
+ *
4299
+ * {@link LocationOutOfWorldBoundariesError}
4300
+ */
4301
+ getMapColor(): RGBA;
4302
+ /**
4303
+ * @beta
4304
+ * @remarks
4305
+ * Returns array of all loaded block parts if this block has
4306
+ * the 'minecraft:multi_block' trait. If it does not have the
4307
+ * trait returns undefined
4308
+ *
4309
+ * @throws This function can throw errors.
4310
+ *
4311
+ * {@link LocationInUnloadedChunkError}
4312
+ *
4313
+ * {@link LocationOutOfWorldBoundariesError}
4314
+ */
4315
+ getParts(): Block[] | undefined;
4023
4316
  /**
4024
4317
  * @remarks
4025
4318
  * Returns the net redstone power of this block.
@@ -4287,6 +4580,27 @@ export class Block {
4287
4580
  * {@link LocationOutOfWorldBoundariesError}
4288
4581
  */
4289
4582
  south(steps?: number): Block | undefined;
4583
+ /**
4584
+ * @beta
4585
+ * @remarks
4586
+ * Tries to set the block in the dimension to the state of the
4587
+ * permutation by first checking if the placement is valid.
4588
+ *
4589
+ * This function can't be called in restricted-execution mode.
4590
+ *
4591
+ * @param permutation
4592
+ * Permutation that contains a set of property states for the
4593
+ * Block.
4594
+ * @returns
4595
+ * Returns `true` if the block permutation data was
4596
+ * successfully set, else `false`.
4597
+ * @throws This function can throw errors.
4598
+ *
4599
+ * {@link LocationInUnloadedChunkError}
4600
+ *
4601
+ * {@link LocationOutOfWorldBoundariesError}
4602
+ */
4603
+ trySetPermutation(permutation: BlockPermutation): boolean;
4290
4604
  /**
4291
4605
  * @remarks
4292
4606
  * Returns the {@link Block} to the west of this block
@@ -4304,6 +4618,137 @@ export class Block {
4304
4618
  west(steps?: number): Block | undefined;
4305
4619
  }
4306
4620
 
4621
+ /**
4622
+ * @beta
4623
+ * Bounding Box Utils is a utility class that provides a number
4624
+ * of useful functions for the creation and utility of {@link
4625
+ * BlockBoundingBox} objects
4626
+ */
4627
+ export class BlockBoundingBoxUtils {
4628
+ private constructor();
4629
+ /**
4630
+ * @remarks
4631
+ * Create a validated instance of a {@link BlockBoundingBox}
4632
+ * where the min and max components are guaranteed to be (min
4633
+ * <= max)
4634
+ *
4635
+ * This function can't be called in restricted-execution mode.
4636
+ *
4637
+ * @param min
4638
+ * A corner world location
4639
+ * @param max
4640
+ * A corner world location diametrically opposite
4641
+ */
4642
+ static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
4643
+ /**
4644
+ * @remarks
4645
+ * Expand a {@link BlockBoundingBox} by a given amount along
4646
+ * each axis.
4647
+ * Sizes can be negative to perform contraction.
4648
+ * Note: corners can be inverted if the contraction size is
4649
+ * greater than the span, but the min/max relationship will
4650
+ * remain correct
4651
+ *
4652
+ * This function can't be called in restricted-execution mode.
4653
+ *
4654
+ * @returns
4655
+ * Return a new {@link BlockBoundingBox} object representing
4656
+ * the changes
4657
+ */
4658
+ static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
4659
+ /**
4660
+ * @remarks
4661
+ * Check if two {@link BlockBoundingBox} objects are identical
4662
+ *
4663
+ * This function can't be called in restricted-execution mode.
4664
+ *
4665
+ */
4666
+ static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4667
+ /**
4668
+ * @remarks
4669
+ * Expand the initial box object bounds to include the 2nd box
4670
+ * argument. The resultant {@link BlockBoundingBox} object
4671
+ * will be a BlockBoundingBox which exactly encompasses the two
4672
+ * boxes.
4673
+ *
4674
+ * This function can't be called in restricted-execution mode.
4675
+ *
4676
+ * @returns
4677
+ * A new {@link BlockBoundingBox} instance representing the
4678
+ * smallest possible bounding box which can encompass both
4679
+ */
4680
+ static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
4681
+ /**
4682
+ * @remarks
4683
+ * Calculate the center block of a given {@link
4684
+ * BlockBoundingBox} object.
4685
+ *
4686
+ * This function can't be called in restricted-execution mode.
4687
+ *
4688
+ * @returns
4689
+ * Note that {@link BlockBoundingBox} objects represent whole
4690
+ * blocks, so the center of boxes which have odd numbered
4691
+ * bounds are not mathematically centered...
4692
+ * i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
4693
+ * center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
4694
+ */
4695
+ static getCenter(box: BlockBoundingBox): Vector3;
4696
+ /**
4697
+ * @remarks
4698
+ * Calculate the BlockBoundingBox which represents the union
4699
+ * area of two intersecting BlockBoundingBoxes
4700
+ *
4701
+ * This function can't be called in restricted-execution mode.
4702
+ *
4703
+ */
4704
+ static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
4705
+ /**
4706
+ * @remarks
4707
+ * Get the Span of each of the BlockBoundingBox Axis components
4708
+ *
4709
+ * This function can't be called in restricted-execution mode.
4710
+ *
4711
+ */
4712
+ static getSpan(box: BlockBoundingBox): Vector3;
4713
+ /**
4714
+ * @remarks
4715
+ * Check to see if two BlockBoundingBox objects intersect
4716
+ *
4717
+ * This function can't be called in restricted-execution mode.
4718
+ *
4719
+ */
4720
+ static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4721
+ /**
4722
+ * @remarks
4723
+ * Check to see if a given coordinate is inside a
4724
+ * BlockBoundingBox
4725
+ *
4726
+ * This function can't be called in restricted-execution mode.
4727
+ *
4728
+ */
4729
+ static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
4730
+ /**
4731
+ * @remarks
4732
+ * Check to see if a BlockBoundingBox is valid (i.e. (min <=
4733
+ * max))
4734
+ *
4735
+ * This function can't be called in restricted-execution mode.
4736
+ *
4737
+ */
4738
+ static isValid(box: BlockBoundingBox): boolean;
4739
+ /**
4740
+ * @remarks
4741
+ * Move a BlockBoundingBox by a given amount
4742
+ *
4743
+ * This function can't be called in restricted-execution mode.
4744
+ *
4745
+ * @returns
4746
+ * Return a new BlockBoundingBox object which represents the
4747
+ * change
4748
+ */
4749
+ static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
4750
+ }
4751
+
4307
4752
  /**
4308
4753
  * Base type for components associated with blocks.
4309
4754
  */
@@ -4347,22 +4792,38 @@ export class BlockComponentBlockBreakEvent extends BlockEvent {
4347
4792
  }
4348
4793
 
4349
4794
  /**
4350
- * Contains information regarding an event sent by an entity to
4351
- * this block in the world.
4795
+ * @beta
4796
+ * Contains information regarding a specific block permutation
4797
+ * that was changed from a previous permutation.
4352
4798
  */
4353
4799
  // @ts-ignore Class inheritance allowed for native defined classes
4354
- export class BlockComponentEntityEvent extends BlockEvent {
4800
+ export class BlockComponentBlockStateChangeEvent extends BlockEvent {
4355
4801
  private constructor();
4356
4802
  /**
4357
4803
  * @remarks
4358
- * Returns permutation information about the block receiving
4359
- * the event.
4804
+ * The previous BlockPermutation.
4360
4805
  *
4361
4806
  */
4362
- readonly blockPermutation: BlockPermutation;
4363
- /**
4364
- * @remarks
4365
- * The entity that sent the event.
4807
+ readonly previousPermutation: BlockPermutation;
4808
+ }
4809
+
4810
+ /**
4811
+ * Contains information regarding an event sent by an entity to
4812
+ * this block in the world.
4813
+ */
4814
+ // @ts-ignore Class inheritance allowed for native defined classes
4815
+ export class BlockComponentEntityEvent extends BlockEvent {
4816
+ private constructor();
4817
+ /**
4818
+ * @remarks
4819
+ * Returns permutation information about the block receiving
4820
+ * the event.
4821
+ *
4822
+ */
4823
+ readonly blockPermutation: BlockPermutation;
4824
+ /**
4825
+ * @remarks
4826
+ * The entity that sent the event.
4366
4827
  *
4367
4828
  */
4368
4829
  readonly entitySource: Entity;
@@ -4511,6 +4972,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
4511
4972
  // @ts-ignore Class inheritance allowed for native defined classes
4512
4973
  export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
4513
4974
  private constructor();
4975
+ /**
4976
+ * @beta
4977
+ * @remarks
4978
+ * The first update event for the redstone component.
4979
+ *
4980
+ */
4981
+ readonly firstUpdate: boolean;
4514
4982
  /**
4515
4983
  * @remarks
4516
4984
  * The redstone signal strength passing through this block. It
@@ -4915,6 +5383,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
4915
5383
  *
4916
5384
  */
4917
5385
  [Symbol.iterator](): Iterator<Vector3>;
5386
+ /**
5387
+ * @beta
5388
+ * @remarks
5389
+ * Checks if the underlining block volume has been invalidated.
5390
+ * Will return false if the block volume was modified between
5391
+ * creating the iterator and iterating it, and true otherwise.
5392
+ *
5393
+ * @throws This function can throw errors.
5394
+ *
5395
+ * {@link minecraftcommon.EngineError}
5396
+ */
5397
+ isValid(): boolean;
4918
5398
  /**
4919
5399
  * @remarks
4920
5400
  * This function can't be called in restricted-execution mode.
@@ -5286,6 +5766,20 @@ export class BlockPrecipitationInteractionsComponent extends BlockComponent {
5286
5766
  * {@link LocationOutOfWorldBoundariesError}
5287
5767
  */
5288
5768
  accumulatesSnow(): boolean;
5769
+ /**
5770
+ * @beta
5771
+ * @remarks
5772
+ * Returns `true` if this block can have snow within it, like a
5773
+ * flower submerged in snow. Returns `false` if this block
5774
+ * cannot have snow within it.
5775
+ *
5776
+ * @throws This function can throw errors.
5777
+ *
5778
+ * {@link LocationInUnloadedChunkError}
5779
+ *
5780
+ * {@link LocationOutOfWorldBoundariesError}
5781
+ */
5782
+ isSnowLoggable(): boolean;
5289
5783
  /**
5290
5784
  * @remarks
5291
5785
  * Returns `true` if rain will not go through the block.
@@ -5817,6 +6311,15 @@ export class BlockVolumeBase {
5817
6311
  *
5818
6312
  */
5819
6313
  getBlockLocationIterator(): BlockLocationIterator;
6314
+ /**
6315
+ * @beta
6316
+ * @remarks
6317
+ * Return a {@link BlockBoundingBox} object which represents
6318
+ * the validated min and max coordinates of the volume
6319
+ *
6320
+ * @throws This function can throw errors.
6321
+ */
6322
+ getBoundingBox(): BlockBoundingBox;
5820
6323
  /**
5821
6324
  * @remarks
5822
6325
  * Return the capacity (volume) of the BlockVolume (W*D*H)
@@ -6047,6 +6550,23 @@ export class Camera {
6047
6550
  | CameraSetRotOptions
6048
6551
  | CameraTargetOptions,
6049
6552
  ): void;
6553
+ /**
6554
+ * @beta
6555
+ * @remarks
6556
+ * Sets the current active camera with easing.
6557
+ *
6558
+ * This function can't be called in restricted-execution mode.
6559
+ *
6560
+ * @param cameraPreset
6561
+ * Identifier of a camera preset file defined within JSON.
6562
+ * @param easeOptions
6563
+ * Options to ease the camera from the previous camera to the
6564
+ * current one.
6565
+ * @throws
6566
+ * Throws when easing to minecraft:first_person presets
6567
+ * currently without the experimental cameras toggle enabled.
6568
+ */
6569
+ setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
6050
6570
  /**
6051
6571
  * @remarks
6052
6572
  * Sets the current active camera for the specified player and
@@ -6086,6 +6606,164 @@ export class CatmullRomSpline {
6086
6606
  controlPoints: Vector3[];
6087
6607
  }
6088
6608
 
6609
+ /**
6610
+ * @beta
6611
+ * An event that fires as players enter chat messages.
6612
+ */
6613
+ export class ChatSendAfterEvent {
6614
+ private constructor();
6615
+ /**
6616
+ * @remarks
6617
+ * Message that is being broadcast.
6618
+ *
6619
+ */
6620
+ readonly message: string;
6621
+ /**
6622
+ * @remarks
6623
+ * Player that sent the chat message.
6624
+ *
6625
+ */
6626
+ readonly sender: Player;
6627
+ /**
6628
+ * @remarks
6629
+ * Optional list of players that will receive this message. If
6630
+ * defined, this message is directly targeted to one or more
6631
+ * players (i.e., is not broadcast.)
6632
+ *
6633
+ */
6634
+ readonly targets?: Player[];
6635
+ }
6636
+
6637
+ /**
6638
+ * @beta
6639
+ * Manages callbacks that are connected to chat messages being
6640
+ * sent.
6641
+ */
6642
+ export class ChatSendAfterEventSignal {
6643
+ private constructor();
6644
+ /**
6645
+ * @remarks
6646
+ * Adds a callback that will be called when new chat messages
6647
+ * are sent.
6648
+ *
6649
+ * This function can't be called in restricted-execution mode.
6650
+ *
6651
+ * This function can be called in early-execution mode.
6652
+ *
6653
+ */
6654
+ subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
6655
+ /**
6656
+ * @remarks
6657
+ * Removes a callback from being called when new chat messages
6658
+ * are sent.
6659
+ *
6660
+ * This function can't be called in restricted-execution mode.
6661
+ *
6662
+ * This function can be called in early-execution mode.
6663
+ *
6664
+ */
6665
+ unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
6666
+ }
6667
+
6668
+ /**
6669
+ * @beta
6670
+ * An event that fires as players enter chat messages.
6671
+ */
6672
+ export class ChatSendBeforeEvent {
6673
+ private constructor();
6674
+ /**
6675
+ * @remarks
6676
+ * If set to true in a beforeChat event handler, this message
6677
+ * is not broadcast out.
6678
+ *
6679
+ */
6680
+ cancel: boolean;
6681
+ /**
6682
+ * @remarks
6683
+ * Message that is being broadcast.
6684
+ *
6685
+ */
6686
+ readonly message: string;
6687
+ /**
6688
+ * @remarks
6689
+ * Player that sent the chat message.
6690
+ *
6691
+ */
6692
+ readonly sender: Player;
6693
+ /**
6694
+ * @remarks
6695
+ * Optional list of players that will receive this message. If
6696
+ * defined, this message is directly targeted to one or more
6697
+ * players (i.e., is not broadcast.)
6698
+ *
6699
+ */
6700
+ readonly targets?: Player[];
6701
+ }
6702
+
6703
+ /**
6704
+ * @beta
6705
+ * Manages callbacks that are connected to an event that fires
6706
+ * before chat messages are sent.
6707
+ * @example customCommand.ts
6708
+ * ```typescript
6709
+ * import { world, DimensionLocation } from '@minecraft/server';
6710
+ *
6711
+ * function customCommand(targetLocation: DimensionLocation) {
6712
+ * const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
6713
+ * if (eventData.message.includes('cancel')) {
6714
+ * // Cancel event if the message contains "cancel"
6715
+ * eventData.cancel = true;
6716
+ * } else {
6717
+ * const args = eventData.message.split(' ');
6718
+ *
6719
+ * if (args.length > 0) {
6720
+ * switch (args[0].toLowerCase()) {
6721
+ * case 'echo':
6722
+ * // Send a modified version of chat message
6723
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
6724
+ * break;
6725
+ * case 'help':
6726
+ * world.sendMessage(`Available commands: echo <message>`);
6727
+ * break;
6728
+ * }
6729
+ * }
6730
+ * }
6731
+ * });
6732
+ * }
6733
+ * ```
6734
+ */
6735
+ export class ChatSendBeforeEventSignal {
6736
+ private constructor();
6737
+ /**
6738
+ * @remarks
6739
+ * Adds a callback that will be called before new chat messages
6740
+ * are sent.
6741
+ *
6742
+ * This function can't be called in restricted-execution mode.
6743
+ *
6744
+ * This function can be called in early-execution mode.
6745
+ *
6746
+ * @param callback
6747
+ * This closure is called with restricted-execution privilege.
6748
+ * @returns
6749
+ * Closure that is called with restricted-execution privilege.
6750
+ */
6751
+ subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
6752
+ /**
6753
+ * @remarks
6754
+ * Removes a callback from being called before new chat
6755
+ * messages are sent.
6756
+ *
6757
+ * This function can't be called in restricted-execution mode.
6758
+ *
6759
+ * This function can be called in early-execution mode.
6760
+ *
6761
+ * @param callback
6762
+ * This closure is called with restricted-execution privilege.
6763
+ */
6764
+ unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
6765
+ }
6766
+
6089
6767
  /**
6090
6768
  * Contains the device information for a client instance.
6091
6769
  */
@@ -6159,125 +6837,377 @@ export class Component {
6159
6837
  }
6160
6838
 
6161
6839
  /**
6162
- * Represents a container that can hold sets of items. Used
6163
- * with entities such as Players, Chest Minecarts, Llamas, and
6164
- * more.
6165
- * @example containers.ts
6166
- * ```typescript
6167
- * import { ItemStack, EntityInventoryComponent, BlockInventoryComponent, DimensionLocation } from '@minecraft/server';
6168
- * import { MinecraftBlockTypes, MinecraftItemTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data';
6169
- *
6170
- * function containers(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
6171
- * const xLocation = targetLocation; // left chest location
6172
- * const xPlusTwoLocation = { x: targetLocation.x + 2, y: targetLocation.y, z: targetLocation.z }; // right chest
6173
- *
6174
- * const chestCart = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.ChestMinecart, {
6175
- * x: targetLocation.x + 4,
6176
- * y: targetLocation.y,
6177
- * z: targetLocation.z,
6178
- * });
6179
- *
6180
- * const xChestBlock = targetLocation.dimension.getBlock(xLocation);
6181
- * const xPlusTwoChestBlock = targetLocation.dimension.getBlock(xPlusTwoLocation);
6182
- *
6183
- * if (!xChestBlock || !xPlusTwoChestBlock) {
6184
- * log('Could not retrieve chest blocks.');
6185
- * return;
6186
- * }
6187
- *
6188
- * xChestBlock.setType(MinecraftBlockTypes.Chest);
6189
- * xPlusTwoChestBlock.setType(MinecraftBlockTypes.Chest);
6190
- *
6191
- * const xPlusTwoChestInventoryComp = xPlusTwoChestBlock.getComponent('inventory') as BlockInventoryComponent;
6192
- * const xChestInventoryComponent = xChestBlock.getComponent('inventory') as BlockInventoryComponent;
6193
- * const chestCartInventoryComp = chestCart.getComponent('inventory') as EntityInventoryComponent;
6194
- *
6195
- * const xPlusTwoChestContainer = xPlusTwoChestInventoryComp.container;
6196
- * const xChestContainer = xChestInventoryComponent.container;
6197
- * const chestCartContainer = chestCartInventoryComp.container;
6198
- *
6199
- * if (!xPlusTwoChestContainer || !xChestContainer || !chestCartContainer) {
6200
- * log('Could not retrieve chest containers.');
6201
- * return;
6202
- * }
6203
- *
6204
- * xPlusTwoChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Apple, 10));
6205
- * if (xPlusTwoChestContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
6206
- * log('Expected apple in x+2 container slot index 0', -1);
6207
- * }
6208
- *
6209
- * xPlusTwoChestContainer.setItem(1, new ItemStack(MinecraftItemTypes.Emerald, 10));
6210
- * if (xPlusTwoChestContainer.getItem(1)?.typeId !== MinecraftItemTypes.Emerald) {
6211
- * log('Expected emerald in x+2 container slot index 1', -1);
6212
- * }
6213
- *
6214
- * if (xPlusTwoChestContainer.size !== 27) {
6215
- * log('Unexpected size: ' + xPlusTwoChestContainer.size, -1);
6216
- * }
6217
- *
6218
- * if (xPlusTwoChestContainer.emptySlotsCount !== 25) {
6219
- * log('Unexpected emptySlotsCount: ' + xPlusTwoChestContainer.emptySlotsCount, -1);
6220
- * }
6221
- *
6222
- * xChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Cake, 10));
6223
- *
6224
- * xPlusTwoChestContainer.transferItem(0, chestCartContainer); // transfer the apple from the xPlusTwo chest to a chest cart
6225
- * xPlusTwoChestContainer.swapItems(1, 0, xChestContainer); // swap the cake from x and the emerald from xPlusTwo
6226
- *
6227
- * if (chestCartContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
6228
- * log('Expected apple in minecraft chest container slot index 0', -1);
6229
- * }
6230
- *
6231
- * if (xChestContainer.getItem(0)?.typeId === MinecraftItemTypes.Emerald) {
6232
- * log('Expected emerald in x container slot index 0', -1);
6233
- * }
6234
- *
6235
- * if (xPlusTwoChestContainer.getItem(1)?.typeId === MinecraftItemTypes.Cake) {
6236
- * log('Expected cake in x+2 container slot index 1', -1);
6237
- * }
6238
- * }
6239
- * ```
6840
+ * @beta
6841
+ * The Compound Block Volume is a collection of individual
6842
+ * block volume definitions which, as a collection, define a
6843
+ * larger volume of (sometimes non-contiguous) irregular
6844
+ * shapes.
6845
+ * This class is loosely based on the concept of CSG
6846
+ * (Computational Solid Geometry) and allows a user to create
6847
+ * complex volumes by building a stack of volumes and voids to
6848
+ * make a larger single volume.
6849
+ * For example - normally a creator would create a hollow cube
6850
+ * by creating 6 "wall" surfaces for each face.
6851
+ * With a Compound Block Volume, a creator can define a hollow
6852
+ * cube by creating a single outer solid cube, and then
6853
+ * defining a further single 'void' cube inside the larger one.
6854
+ * Similarly, the Compound Block Volume can represent irregular
6855
+ * shaped volumes (e.g. a tree consists of a trunk and lots of
6856
+ * leaf cubes which are not necessarily contiguously placed).
6857
+ * Each of the volumes added to the CompoundBlockVolume are (by
6858
+ * default) relative to the origin set (either at construction
6859
+ * or via one of the set functions).
6860
+ * However, it is also possible to push volumes to the compound
6861
+ * collection which are absolute in nature and are not affected
6862
+ * by origin changes.
6240
6863
  */
6241
- export class Container {
6242
- private constructor();
6864
+ export class CompoundBlockVolume {
6243
6865
  /**
6244
6866
  * @remarks
6245
- * If these rules are defined other container operations will
6246
- * throw if they cause these rules to be invalidated. For
6247
- * example, adding a shulker box to a vanilla bundle.
6867
+ * Return the 'capacity' of the bounding rectangle which
6868
+ * represents the collection of volumes in the stack
6248
6869
  *
6249
6870
  */
6250
- readonly containerRules?: ContainerRules;
6871
+ readonly capacity: number;
6872
+ readonly items: CompoundBlockVolumeItem[];
6873
+ readonly itemsAbsolute: CompoundBlockVolumeItem[];
6251
6874
  /**
6252
6875
  * @remarks
6253
- * Count of the slots in the container that are empty.
6876
+ * Return the number of volumes (positive and negative) in the
6877
+ * volume stack
6254
6878
  *
6255
- * @throws
6256
- * Throws if the container is invalid.
6257
6879
  */
6258
- readonly emptySlotsCount: number;
6880
+ readonly volumeCount: number;
6259
6881
  /**
6260
6882
  * @remarks
6261
- * Returns whether a container object (or the entity or block
6262
- * that this container is associated with) is still available
6263
- * for use in this context.
6883
+ * Create a CompoundBlockVolume object
6264
6884
  *
6885
+ * @param origin
6886
+ * An optional world space origin on which to center the
6887
+ * compound volume.
6888
+ * If not specified, the origin is set to (0,0,0)
6265
6889
  */
6266
- readonly isValid: boolean;
6890
+ constructor(origin?: Vector3);
6267
6891
  /**
6268
6892
  * @remarks
6269
- * The number of slots in this container. For example, a
6270
- * standard single-block chest has a size of 27. Note, a
6271
- * player's inventory container contains a total of 36 slots, 9
6272
- * hotbar slots plus 27 inventory slots.
6893
+ * Clear the contents of the volume stack
6894
+ *
6895
+ * This function can't be called in restricted-execution mode.
6273
6896
  *
6274
- * @throws
6275
- * Throws if the container is invalid.
6276
6897
  */
6277
- readonly size: number;
6898
+ clear(): void;
6278
6899
  /**
6279
6900
  * @remarks
6280
- * The combined weight of all items in the container.
6901
+ * Fetch a Block Location Iterator for the Compound Block
6902
+ * Volume. This iterator will allow a creator to iterate
6903
+ * across all of the selected volumes within the larger
6904
+ * bounding area.
6905
+ * Areas of a volume which have been overridden by a
6906
+ * subtractive volume will not be included in the iterator
6907
+ * step.
6908
+ * (i.e. if you push a cube to the stack, and then push a
6909
+ * subtractive volume to the same location, then the iterator
6910
+ * will step over the initial volume because it is considered
6911
+ * negative space)
6912
+ * Note that the Block Locations returned by this iterator are
6913
+ * in absolute world space (irrespective of whether the
6914
+ * compound volume items pushed are absolute or relative)
6915
+ *
6916
+ * This function can't be called in restricted-execution mode.
6917
+ *
6918
+ */
6919
+ getBlockLocationIterator(): BlockLocationIterator;
6920
+ /**
6921
+ * @remarks
6922
+ * Get the largest bounding box that represents a container for
6923
+ * all of the volumes on the stack
6924
+ * Note that the bounding box returned is represented in
6925
+ * absolute world space (irrespective of whether the compound
6926
+ * volume items pushed are absolute or relative)
6927
+ *
6928
+ * This function can't be called in restricted-execution mode.
6929
+ *
6930
+ */
6931
+ getBoundingBox(): BlockBoundingBox;
6932
+ /**
6933
+ * @remarks
6934
+ * Get the max block location of the outermost bounding
6935
+ * rectangle which represents the volumes on the stack.
6936
+ * Note that the max location returned is in absolute world
6937
+ * space (irrespective of whether the compound volume items
6938
+ * pushed are absolute or relative)
6939
+ *
6940
+ * This function can't be called in restricted-execution mode.
6941
+ *
6942
+ */
6943
+ getMax(): Vector3;
6944
+ /**
6945
+ * @remarks
6946
+ * Get the min block location of the outermost bounding
6947
+ * rectangle which represents the volumes on the stack.
6948
+ * Note that the min location returned is in absolute world
6949
+ * space (irrespective of whether the compound volume items
6950
+ * pushed are absolute or relative)
6951
+ *
6952
+ * This function can't be called in restricted-execution mode.
6953
+ *
6954
+ */
6955
+ getMin(): Vector3;
6956
+ /**
6957
+ * @remarks
6958
+ * Fetch the origin in world space of the compound volume
6959
+ *
6960
+ * This function can't be called in restricted-execution mode.
6961
+ *
6962
+ */
6963
+ getOrigin(): Vector3;
6964
+ /**
6965
+ * @remarks
6966
+ * Return a boolean which signals if there are any volume items
6967
+ * pushed to the volume
6968
+ *
6969
+ * This function can't be called in restricted-execution mode.
6970
+ *
6971
+ */
6972
+ isEmpty(): boolean;
6973
+ /**
6974
+ * @remarks
6975
+ * Return a boolean representing whether or not a given
6976
+ * absolute world space block location is inside a positive
6977
+ * block volume.
6978
+ * E.g. if the stack contains a large cube followed by a
6979
+ * slightly smaller negative cube, and the test location is
6980
+ * within the negative cube - the function will return false
6981
+ * because it's not 'inside' a volume (it IS inside the
6982
+ * bounding rectangle, but it is not inside a positively
6983
+ * defined location)
6984
+ *
6985
+ * This function can't be called in restricted-execution mode.
6986
+ *
6987
+ */
6988
+ isInside(worldLocation: Vector3): boolean;
6989
+ /**
6990
+ * @remarks
6991
+ * Inspect the last entry pushed to the volume stack without
6992
+ * affecting the stack contents.
6993
+ *
6994
+ * This function can't be called in restricted-execution mode.
6995
+ *
6996
+ * @param forceRelativity
6997
+ * Determine whether the function returns a
6998
+ * CompoundBlockVolumeItem which is forced into either relative
6999
+ * or absolute coordinate system.
7000
+ * `true` = force returned item to be relative to volume origin
7001
+ * `false` = force returned item to be absolute world space
7002
+ * location
7003
+ *
7004
+ * If no flag is specified, the item returned retains whatever
7005
+ * relativity it had when it was pushed
7006
+ * @returns
7007
+ * Returns undefined if the stack is empty
7008
+ */
7009
+ peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
7010
+ /**
7011
+ * @remarks
7012
+ * Remove the last entry from the volume stack. This will
7013
+ * reduce the stack size by one
7014
+ *
7015
+ * This function can't be called in restricted-execution mode.
7016
+ *
7017
+ */
7018
+ popVolume(): boolean;
7019
+ /**
7020
+ * @remarks
7021
+ * Push a volume item to the stack. The volume item contains
7022
+ * an 'action' parameter which determines whether this volume
7023
+ * is a positive or negative space.
7024
+ * The item also contains a `locationRelativity` which
7025
+ * determines whether it is relative or absolute to the
7026
+ * compound volume origin
7027
+ *
7028
+ * This function can't be called in restricted-execution mode.
7029
+ *
7030
+ * @param item
7031
+ * Item to push to the end of the stack
7032
+ */
7033
+ pushVolume(item: CompoundBlockVolumeItem): void;
7034
+ /**
7035
+ * @remarks
7036
+ * If the volume stack is empty, this function will push the
7037
+ * specified item to the stack.
7038
+ * If the volume stack is NOT empty, this function will replace
7039
+ * the last item on the stack with the new item.
7040
+ *
7041
+ * This function can't be called in restricted-execution mode.
7042
+ *
7043
+ * @param item
7044
+ * Item to add or replace
7045
+ */
7046
+ replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
7047
+ /**
7048
+ * @remarks
7049
+ * Set the origin of the compound volume to an absolute world
7050
+ * space location
7051
+ *
7052
+ * This function can't be called in restricted-execution mode.
7053
+ *
7054
+ * @param preserveExistingVolumes
7055
+ * This optional boolean flag determines whether the relative
7056
+ * `CompoundBlockVolumeItem`'s are frozen in place, or are
7057
+ * affected by the new origin.
7058
+ * Imagine a scenario where you have a series of relative
7059
+ * locations around an origin which make up a sphere; all of
7060
+ * these locations are in the range of -2 to 2.
7061
+ * Push each of these locations to the compound volume as
7062
+ * relative items.
7063
+ * Now, move the origin and all of the locations representing
7064
+ * the sphere move accordingly.
7065
+ * However, let's say you want to add a 2nd sphere next to the
7066
+ * 1st.
7067
+ * In this case, set the new origin a few locations over, but
7068
+ * 'preserveExistingVolumes' = true.
7069
+ * This will set a new origin, but the existing sphere
7070
+ * locations will remain relative to the original origin.
7071
+ * Now, you can push the relative sphere locations again (this
7072
+ * time they will be relative to the new origin) - resulting in
7073
+ * 2 spheres next to each other.
7074
+ */
7075
+ setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
7076
+ /**
7077
+ * @remarks
7078
+ * Similar to {@link CompoundBlockVolume.setOrigin} - this
7079
+ * function will translate the origin by a given delta to a new
7080
+ * position
7081
+ *
7082
+ * This function can't be called in restricted-execution mode.
7083
+ *
7084
+ * @param preserveExistingVolumes
7085
+ * See the description for the arguments to {@link
7086
+ * CompoundBlockVolume.setOrigin}
7087
+ */
7088
+ translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
7089
+ }
7090
+
7091
+ /**
7092
+ * Represents a container that can hold sets of items. Used
7093
+ * with entities such as Players, Chest Minecarts, Llamas, and
7094
+ * more.
7095
+ * @example containers.ts
7096
+ * ```typescript
7097
+ * import { ItemStack, EntityInventoryComponent, BlockInventoryComponent, DimensionLocation } from '@minecraft/server';
7098
+ * import { MinecraftBlockTypes, MinecraftItemTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data';
7099
+ *
7100
+ * function containers(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
7101
+ * const xLocation = targetLocation; // left chest location
7102
+ * const xPlusTwoLocation = { x: targetLocation.x + 2, y: targetLocation.y, z: targetLocation.z }; // right chest
7103
+ *
7104
+ * const chestCart = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.ChestMinecart, {
7105
+ * x: targetLocation.x + 4,
7106
+ * y: targetLocation.y,
7107
+ * z: targetLocation.z,
7108
+ * });
7109
+ *
7110
+ * const xChestBlock = targetLocation.dimension.getBlock(xLocation);
7111
+ * const xPlusTwoChestBlock = targetLocation.dimension.getBlock(xPlusTwoLocation);
7112
+ *
7113
+ * if (!xChestBlock || !xPlusTwoChestBlock) {
7114
+ * log('Could not retrieve chest blocks.');
7115
+ * return;
7116
+ * }
7117
+ *
7118
+ * xChestBlock.setType(MinecraftBlockTypes.Chest);
7119
+ * xPlusTwoChestBlock.setType(MinecraftBlockTypes.Chest);
7120
+ *
7121
+ * const xPlusTwoChestInventoryComp = xPlusTwoChestBlock.getComponent('inventory') as BlockInventoryComponent;
7122
+ * const xChestInventoryComponent = xChestBlock.getComponent('inventory') as BlockInventoryComponent;
7123
+ * const chestCartInventoryComp = chestCart.getComponent('inventory') as EntityInventoryComponent;
7124
+ *
7125
+ * const xPlusTwoChestContainer = xPlusTwoChestInventoryComp.container;
7126
+ * const xChestContainer = xChestInventoryComponent.container;
7127
+ * const chestCartContainer = chestCartInventoryComp.container;
7128
+ *
7129
+ * if (!xPlusTwoChestContainer || !xChestContainer || !chestCartContainer) {
7130
+ * log('Could not retrieve chest containers.');
7131
+ * return;
7132
+ * }
7133
+ *
7134
+ * xPlusTwoChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Apple, 10));
7135
+ * if (xPlusTwoChestContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
7136
+ * log('Expected apple in x+2 container slot index 0', -1);
7137
+ * }
7138
+ *
7139
+ * xPlusTwoChestContainer.setItem(1, new ItemStack(MinecraftItemTypes.Emerald, 10));
7140
+ * if (xPlusTwoChestContainer.getItem(1)?.typeId !== MinecraftItemTypes.Emerald) {
7141
+ * log('Expected emerald in x+2 container slot index 1', -1);
7142
+ * }
7143
+ *
7144
+ * if (xPlusTwoChestContainer.size !== 27) {
7145
+ * log('Unexpected size: ' + xPlusTwoChestContainer.size, -1);
7146
+ * }
7147
+ *
7148
+ * if (xPlusTwoChestContainer.emptySlotsCount !== 25) {
7149
+ * log('Unexpected emptySlotsCount: ' + xPlusTwoChestContainer.emptySlotsCount, -1);
7150
+ * }
7151
+ *
7152
+ * xChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Cake, 10));
7153
+ *
7154
+ * xPlusTwoChestContainer.transferItem(0, chestCartContainer); // transfer the apple from the xPlusTwo chest to a chest cart
7155
+ * xPlusTwoChestContainer.swapItems(1, 0, xChestContainer); // swap the cake from x and the emerald from xPlusTwo
7156
+ *
7157
+ * if (chestCartContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
7158
+ * log('Expected apple in minecraft chest container slot index 0', -1);
7159
+ * }
7160
+ *
7161
+ * if (xChestContainer.getItem(0)?.typeId === MinecraftItemTypes.Emerald) {
7162
+ * log('Expected emerald in x container slot index 0', -1);
7163
+ * }
7164
+ *
7165
+ * if (xPlusTwoChestContainer.getItem(1)?.typeId === MinecraftItemTypes.Cake) {
7166
+ * log('Expected cake in x+2 container slot index 1', -1);
7167
+ * }
7168
+ * }
7169
+ * ```
7170
+ */
7171
+ export class Container {
7172
+ private constructor();
7173
+ /**
7174
+ * @remarks
7175
+ * If these rules are defined other container operations will
7176
+ * throw if they cause these rules to be invalidated. For
7177
+ * example, adding a shulker box to a vanilla bundle.
7178
+ *
7179
+ */
7180
+ readonly containerRules?: ContainerRules;
7181
+ /**
7182
+ * @remarks
7183
+ * Count of the slots in the container that are empty.
7184
+ *
7185
+ * @throws
7186
+ * Throws if the container is invalid.
7187
+ */
7188
+ readonly emptySlotsCount: number;
7189
+ /**
7190
+ * @remarks
7191
+ * Returns whether a container object (or the entity or block
7192
+ * that this container is associated with) is still available
7193
+ * for use in this context.
7194
+ *
7195
+ */
7196
+ readonly isValid: boolean;
7197
+ /**
7198
+ * @remarks
7199
+ * The number of slots in this container. For example, a
7200
+ * standard single-block chest has a size of 27. Note, a
7201
+ * player's inventory container contains a total of 36 slots, 9
7202
+ * hotbar slots plus 27 inventory slots.
7203
+ *
7204
+ * @throws
7205
+ * Throws if the container is invalid.
7206
+ */
7207
+ readonly size: number;
7208
+ /**
7209
+ * @remarks
7210
+ * The combined weight of all items in the container.
6281
7211
  *
6282
7212
  * @throws This property can throw when used.
6283
7213
  *
@@ -6295,7 +7225,9 @@ export class Container {
6295
7225
  *
6296
7226
  * @param itemStack
6297
7227
  * The stack of items to add.
6298
- * @throws This function can throw errors.
7228
+ * @throws
7229
+ * Won't throw {@link ContainerRules} error for over weight
7230
+ * limit but will instead add items up to the weight limit.
6299
7231
  *
6300
7232
  * {@link ContainerRulesError}
6301
7233
  *
@@ -6533,6 +7465,8 @@ export class Container {
6533
7465
  * @throws
6534
7466
  * Throws if either this container or `toContainer` are invalid
6535
7467
  * or if the `fromSlot` or `toSlot` indices out of bounds.
7468
+ * Won't throw {@link ContainerRules} error for over weight
7469
+ * limit but will instead add items up to the weight limit.
6536
7470
  *
6537
7471
  * {@link ContainerRulesError}
6538
7472
  *
@@ -7315,6 +8249,30 @@ export class Dimension {
7315
8249
  block: BlockPermutation | BlockType | string,
7316
8250
  options?: BlockFillOptions,
7317
8251
  ): ListBlockVolume;
8252
+ /**
8253
+ * @beta
8254
+ * @remarks
8255
+ * Finds the location of the closest biome of a particular
8256
+ * type. Note that the findClosestBiome operation can take some
8257
+ * time to complete, so avoid using many of these calls within
8258
+ * a particular tick.
8259
+ *
8260
+ * @param pos
8261
+ * Starting location to look for a biome to find.
8262
+ * @param biomeToFind
8263
+ * Identifier of the biome to look for.
8264
+ * @param options
8265
+ * Additional selection criteria for a biome search.
8266
+ * @returns
8267
+ * Returns a location of the biome, or undefined if a biome
8268
+ * could not be found.
8269
+ * @throws This function can throw errors.
8270
+ *
8271
+ * {@link minecraftcommon.EngineError}
8272
+ *
8273
+ * {@link Error}
8274
+ */
8275
+ findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
7318
8276
  /**
7319
8277
  * @remarks
7320
8278
  * Returns the biome type at the specified location.
@@ -7534,6 +8492,26 @@ export class Dimension {
7534
8492
  * {@link minecraftcommon.UnsupportedFunctionalityError}
7535
8493
  */
7536
8494
  getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
8495
+ /**
8496
+ * @beta
8497
+ * @remarks
8498
+ * Returns a vector of generated structures that contain the
8499
+ * specified location (ex: Pillager Outpost, Mineshaft, etc.).
8500
+ * The vector will be empty if no structures are found.
8501
+ *
8502
+ * @param location
8503
+ * Location at which to check for structures.
8504
+ * @throws
8505
+ * An error will be thrown if the location is out of world
8506
+ * bounds.
8507
+ * An error will be thrown if the location is in an unloaded
8508
+ * chunk.
8509
+ *
8510
+ * {@link LocationInUnloadedChunkError}
8511
+ *
8512
+ * {@link LocationOutOfWorldBoundariesError}
8513
+ */
8514
+ getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
7537
8515
  /**
7538
8516
  * @remarks
7539
8517
  * Returns the total brightness level of light shining on a
@@ -7595,6 +8573,16 @@ export class Dimension {
7595
8573
  * @throws This function can throw errors.
7596
8574
  */
7597
8575
  getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
8576
+ /**
8577
+ * @beta
8578
+ * @remarks
8579
+ * Returns the current weather.
8580
+ *
8581
+ * @returns
8582
+ * Returns a WeatherType that explains the broad category of
8583
+ * weather that is currently going on.
8584
+ */
8585
+ getWeather(): WeatherType;
7598
8586
  /**
7599
8587
  * @remarks
7600
8588
  * Returns true if the chunk at the given location is loaded
@@ -7674,9 +8662,11 @@ export class Dimension {
7674
8662
  * An error will be thrown if pitch is less than 0.01.
7675
8663
  * An error will be thrown if volume is less than 0.0.
7676
8664
  *
8665
+ * {@link minecraftcommon.EngineError}
8666
+ *
7677
8667
  * {@link minecraftcommon.PropertyOutOfBoundsError}
7678
8668
  */
7679
- playSound(soundId: string, location: Vector3, soundOptions?: WorldSoundOptions): void;
8669
+ playSound(soundId: string, location: Vector3, soundOptions?: WorldSoundOptions): SoundInstance;
7680
8670
  /**
7681
8671
  * @remarks
7682
8672
  * Runs a command synchronously using the context of the
@@ -7838,7 +8828,11 @@ export class Dimension {
7838
8828
  * }
7839
8829
  * ```
7840
8830
  */
7841
- spawnEntity(identifier: EntityType | string, location: Vector3, options?: SpawnEntityOptions): Entity;
8831
+ spawnEntity<T = never>(
8832
+ identifier: EntityIdentifierType<NoInfer<T>>,
8833
+ location: Vector3,
8834
+ options?: SpawnEntityOptions,
8835
+ ): Entity;
7842
8836
  /**
7843
8837
  * @remarks
7844
8838
  * Creates a new item stack as an entity at the specified
@@ -7933,26 +8927,103 @@ export class Dimension {
7933
8927
  * ```
7934
8928
  */
7935
8929
  spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
7936
- }
7937
-
7938
- /**
7939
- * Represents a type of dimension. Currently only works with
7940
- * Vanilla dimensions.
7941
- */
7942
- export class DimensionType {
7943
- private constructor();
7944
8930
  /**
8931
+ * @beta
7945
8932
  * @remarks
7946
- * Identifier of the dimension type. Currently only works with
7947
- * Vanilla dimensions.
8933
+ * Spawns an experience orb at a specified location in the
8934
+ * dimension.
7948
8935
  *
7949
- */
7950
- readonly typeId: string;
7951
- }
7952
-
7953
- /**
7954
- * Used for accessing all available dimension types. Currently
7955
- * only works with Vanilla dimensions.
8936
+ * This function can't be called in restricted-execution mode.
8937
+ *
8938
+ * @param location
8939
+ * The location at which to spawn the experience orb.
8940
+ * @param amount
8941
+ * The amount of experience to give the experience orb.
8942
+ * Bounds: [1, 12000]
8943
+ * @throws This function can throw errors.
8944
+ *
8945
+ * {@link LocationInUnloadedChunkError}
8946
+ *
8947
+ * {@link LocationOutOfWorldBoundariesError}
8948
+ */
8949
+ spawnXp(location: Vector3, amount: number): void;
8950
+ /**
8951
+ * @beta
8952
+ * @remarks
8953
+ * Stops all sounds from playing for all players.
8954
+ *
8955
+ * This function can't be called in restricted-execution mode.
8956
+ *
8957
+ */
8958
+ stopAllSounds(): void;
8959
+ /**
8960
+ * @beta
8961
+ * @remarks
8962
+ * Stops a sound from playing for all players.
8963
+ *
8964
+ * This function can't be called in restricted-execution mode.
8965
+ *
8966
+ * @param soundId
8967
+ * Identifier of the sound.
8968
+ */
8969
+ stopSound(soundId: string): void;
8970
+ }
8971
+
8972
+ /**
8973
+ * @beta
8974
+ * Provides the functionality for registering custom
8975
+ * dimensions. Custom dimensions can only be registered during
8976
+ * the system startup event.
8977
+ */
8978
+ export class DimensionRegistry {
8979
+ private constructor();
8980
+ /**
8981
+ * @remarks
8982
+ * Registers a new custom dimension type. Must be called during
8983
+ * the system startup event. The dimension will be created
8984
+ * using the void generator.
8985
+ *
8986
+ * This function can be called in early-execution mode.
8987
+ *
8988
+ * @param typeId
8989
+ * The namespaced identifier for the custom dimension (e.g.,
8990
+ * 'mypack:my_dimension'). Must include a namespace and use
8991
+ * only valid identifier characters.
8992
+ * @throws This function can throw errors.
8993
+ *
8994
+ * {@link CustomDimensionAlreadyRegisteredError}
8995
+ *
8996
+ * {@link CustomDimensionInvalidRegistryError}
8997
+ *
8998
+ * {@link CustomDimensionNameError}
8999
+ *
9000
+ * {@link CustomDimensionReloadNewDimensionError}
9001
+ *
9002
+ * {@link minecraftcommon.EngineError}
9003
+ *
9004
+ * {@link NamespaceNameError}
9005
+ */
9006
+ registerCustomDimension(typeId: string): void;
9007
+ }
9008
+
9009
+ /**
9010
+ * Represents a type of dimension. Currently only works with
9011
+ * Vanilla dimensions.
9012
+ */
9013
+ export class DimensionType {
9014
+ private constructor();
9015
+ /**
9016
+ * @remarks
9017
+ * Identifier of the dimension type. Currently only works with
9018
+ * Vanilla dimensions.
9019
+ *
9020
+ */
9021
+ readonly typeId: string;
9022
+ }
9023
+
9024
+ /**
9025
+ * Used for accessing all available dimension types. Currently
9026
+ * only works with Vanilla dimensions.
7956
9027
  */
7957
9028
  export class DimensionTypes {
7958
9029
  private constructor();
@@ -8447,6 +9518,26 @@ export class Entity {
8447
9518
  * {@link InvalidEntityError}
8448
9519
  */
8449
9520
  readonly location: Vector3;
9521
+ /**
9522
+ * @beta
9523
+ * @remarks
9524
+ * Boolean which determines if the player nameplate should be
9525
+ * depth tested for visibility.
9526
+ *
9527
+ * This property can't be edited in restricted-execution mode.
9528
+ *
9529
+ */
9530
+ nameplateDepthTested: boolean;
9531
+ /**
9532
+ * @beta
9533
+ * @remarks
9534
+ * Float that determines the render distance of this entity's
9535
+ * nameplate.
9536
+ *
9537
+ * This property can't be edited in restricted-execution mode.
9538
+ *
9539
+ */
9540
+ nameplateRenderDistance: number;
8450
9541
  /**
8451
9542
  * @remarks
8452
9543
  * Given name of the entity.
@@ -8462,6 +9553,18 @@ export class Entity {
8462
9553
  *
8463
9554
  */
8464
9555
  readonly scoreboardIdentity?: ScoreboardIdentity;
9556
+ /**
9557
+ * @beta
9558
+ * @remarks
9559
+ * Retrieves or sets an entity that is used as the target of
9560
+ * AI-related behaviors, like attacking. If the entity
9561
+ * currently has no target returns undefined.
9562
+ *
9563
+ * @throws This property can throw when used.
9564
+ *
9565
+ * {@link InvalidEntityError}
9566
+ */
9567
+ readonly target?: Entity;
8465
9568
  /**
8466
9569
  * @remarks
8467
9570
  * Identifier of the type of the entity - for example,
@@ -9703,6 +10806,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
9703
10806
  // @ts-ignore Class inheritance allowed for native defined classes
9704
10807
  export class EntityBreathableComponent extends EntityComponent {
9705
10808
  private constructor();
10809
+ /**
10810
+ * @beta
10811
+ * @remarks
10812
+ * The current air supply of the entity.
10813
+ *
10814
+ * This property can't be edited in restricted-execution mode.
10815
+ *
10816
+ * @throws
10817
+ * Will throw an error if the air supply is out of bounds
10818
+ * [suffocationTime, maxAirSupply].
10819
+ */
10820
+ airSupply: number;
9706
10821
  /**
9707
10822
  * @remarks
9708
10823
  * If true, this entity can breathe in air.
@@ -9731,6 +10846,14 @@ export class EntityBreathableComponent extends EntityComponent {
9731
10846
  * @throws This property can throw when used.
9732
10847
  */
9733
10848
  readonly breathesWater: boolean;
10849
+ /**
10850
+ * @beta
10851
+ * @remarks
10852
+ * If true, the entity is able to breathe.
10853
+ *
10854
+ * @throws This property can throw when used.
10855
+ */
10856
+ readonly canBreathe: boolean;
9734
10857
  /**
9735
10858
  * @remarks
9736
10859
  * If true, this entity will have visible bubbles while in
@@ -11686,6 +12809,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
11686
12809
  static readonly componentId = 'minecraft:navigation.walk';
11687
12810
  }
11688
12811
 
12812
+ /**
12813
+ * @beta
12814
+ * Adds NPC capabilities to an entity such as custom skin,
12815
+ * name, and dialogue interactions.
12816
+ */
12817
+ // @ts-ignore Class inheritance allowed for native defined classes
12818
+ export class EntityNpcComponent extends EntityComponent {
12819
+ private constructor();
12820
+ /**
12821
+ * @remarks
12822
+ * The DialogueScene that is opened when players first interact
12823
+ * with the NPC.
12824
+ *
12825
+ * This property can't be edited in restricted-execution mode.
12826
+ *
12827
+ */
12828
+ defaultScene: string;
12829
+ /**
12830
+ * @remarks
12831
+ * The name of the NPC as it is displayed to players.
12832
+ *
12833
+ * This property can't be edited in restricted-execution mode.
12834
+ *
12835
+ */
12836
+ name: string;
12837
+ /**
12838
+ * @remarks
12839
+ * The index of the skin the NPC will use.
12840
+ *
12841
+ * This property can't be edited in restricted-execution mode.
12842
+ *
12843
+ */
12844
+ skinIndex: number;
12845
+ static readonly componentId = 'minecraft:npc';
12846
+ }
12847
+
11689
12848
  /**
11690
12849
  * When present on an entity, this entity is on fire.
11691
12850
  * @example setOnFire.ts
@@ -12557,7 +13716,7 @@ export class EntityTypes {
12557
13716
  * Retrieves an entity type using a string-based identifier.
12558
13717
  *
12559
13718
  */
12560
- static get(identifier: string): EntityType | undefined;
13719
+ static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
12561
13720
  /**
12562
13721
  * @remarks
12563
13722
  * Retrieves a set of all entity types within this world.
@@ -12576,6 +13735,68 @@ export class EntityUnderwaterMovementComponent extends EntityAttributeComponent
12576
13735
  static readonly componentId = 'minecraft:underwater_movement';
12577
13736
  }
12578
13737
 
13738
+ /**
13739
+ * @beta
13740
+ * Contains information related to firing of a data driven
13741
+ * entity version upgrade.
13742
+ */
13743
+ export class EntityUpgradeAfterEvent {
13744
+ private constructor();
13745
+ /**
13746
+ * @remarks
13747
+ * Entity that the upgrade triggered on.
13748
+ *
13749
+ */
13750
+ readonly entity: Entity;
13751
+ /**
13752
+ * @remarks
13753
+ * Name of the data driven upgrade being triggered.
13754
+ *
13755
+ */
13756
+ readonly upgradeId: string;
13757
+ /**
13758
+ * @remarks
13759
+ * An updateable list of modifications to component state that
13760
+ * are the effect of this triggered upgrade.
13761
+ *
13762
+ */
13763
+ getModifiers(): DefinitionModifier[];
13764
+ }
13765
+
13766
+ /**
13767
+ * @beta
13768
+ * Contains event registration related to firing of a data
13769
+ * driven entity version upgrade.
13770
+ */
13771
+ export class EntityUpgradeAfterEventSignal {
13772
+ private constructor();
13773
+ /**
13774
+ * @remarks
13775
+ * Adds a callback that will be called after a data driven
13776
+ * entity version upgrade is triggered.
13777
+ *
13778
+ * This function can't be called in restricted-execution mode.
13779
+ *
13780
+ * This function can be called in early-execution mode.
13781
+ *
13782
+ */
13783
+ subscribe(
13784
+ callback: (arg0: EntityUpgradeAfterEvent) => void,
13785
+ options?: EntityDataDrivenTriggerEventOptions,
13786
+ ): (arg0: EntityUpgradeAfterEvent) => void;
13787
+ /**
13788
+ * @remarks
13789
+ * Removes a callback that will be called after a data driven
13790
+ * entity version upgrade is triggered.
13791
+ *
13792
+ * This function can't be called in restricted-execution mode.
13793
+ *
13794
+ * This function can be called in early-execution mode.
13795
+ *
13796
+ */
13797
+ unsubscribe(callback: (arg0: EntityUpgradeAfterEvent) => void): void;
13798
+ }
13799
+
12579
13800
  /**
12580
13801
  * Used to differentiate the component group of a variant of an
12581
13802
  * entity from others. (e.g. ocelot, villager).
@@ -12604,6 +13825,51 @@ export class EntityWantsJockeyComponent extends EntityComponent {
12604
13825
  static readonly componentId = 'minecraft:wants_jockey';
12605
13826
  }
12606
13827
 
13828
+ /**
13829
+ * @beta
13830
+ * Waypoint that tracks an entity's position. The waypoint
13831
+ * automatically updates as the entity moves and becomes
13832
+ * invalid when the entity is removed.
13833
+ */
13834
+ // @ts-ignore Class inheritance allowed for native defined classes
13835
+ export class EntityWaypoint extends Waypoint {
13836
+ /**
13837
+ * @remarks
13838
+ * The entity being tracked by this waypoint.
13839
+ *
13840
+ * @throws This property can throw when used.
13841
+ *
13842
+ * {@link InvalidWaypointError}
13843
+ *
13844
+ * {@link InvalidWaypointTextureSelectorError}
13845
+ */
13846
+ readonly entity: Entity;
13847
+ /**
13848
+ * @remarks
13849
+ * The visibility rules that control when the waypoint is shown
13850
+ * based on the entity's state (e.g., sneaking, invisible,
13851
+ * dead).
13852
+ *
13853
+ * @throws This property can throw when used.
13854
+ *
13855
+ * {@link InvalidWaypointError}
13856
+ *
13857
+ * {@link InvalidWaypointTextureSelectorError}
13858
+ */
13859
+ readonly entityRules: EntityVisibilityRules;
13860
+ /**
13861
+ * @throws This function can throw errors.
13862
+ *
13863
+ * {@link InvalidWaypointTextureSelectorError}
13864
+ */
13865
+ constructor(
13866
+ entity: Entity,
13867
+ textureSelector: WaypointTextureSelector,
13868
+ entityRules: EntityVisibilityRules,
13869
+ color?: RGB,
13870
+ );
13871
+ }
13872
+
12607
13873
  /**
12608
13874
  * Loot item function that modifies a dropped treasure map to
12609
13875
  * mark a location.
@@ -13047,6 +14313,13 @@ export class GameRules {
13047
14313
  *
13048
14314
  */
13049
14315
  playersSleepingPercentage: number;
14316
+ /**
14317
+ * @beta
14318
+ * @remarks
14319
+ * This property can't be edited in restricted-execution mode.
14320
+ *
14321
+ */
14322
+ playerWaypoints: PlayerWaypointsMode;
13050
14323
  /**
13051
14324
  * @remarks
13052
14325
  * This property can't be edited in restricted-execution mode.
@@ -15355,56 +16628,225 @@ export class ListBlockVolume extends BlockVolumeBase {
15355
16628
  }
15356
16629
 
15357
16630
  /**
15358
- * Loot item function that drops extra items if the provided
15359
- * tool has the looting enchant.
16631
+ * @beta
16632
+ * Waypoint that points to a fixed location in the world.
16633
+ * Unlike entity waypoints, location waypoints always remain
16634
+ * valid and their position can be updated.
15360
16635
  */
15361
16636
  // @ts-ignore Class inheritance allowed for native defined classes
15362
- export class LootingEnchantFunction extends LootItemFunction {
15363
- private constructor();
16637
+ export class LocationWaypoint extends Waypoint {
16638
+ /**
16639
+ * @throws This function can throw errors.
16640
+ *
16641
+ * {@link InvalidWaypointTextureSelectorError}
16642
+ */
16643
+ constructor(dimensionLocation: DimensionLocation, textureSelector: WaypointTextureSelector, color?: RGB);
15364
16644
  /**
15365
16645
  * @remarks
15366
- * The value range from which the function randomly chooses the
15367
- * number of extra items to drop. Contains minimum and maximum
15368
- * values.
16646
+ * Updates the dimension and location that this waypoint points
16647
+ * to.
15369
16648
  *
16649
+ * This function can't be called in restricted-execution mode.
16650
+ *
16651
+ * @param dimensionLocation
16652
+ * The new {@link DimensionLocation} (dimension and
16653
+ * coordinates) for the waypoint.
15370
16654
  */
15371
- readonly count: minecraftcommon.NumberRange;
16655
+ setDimensionLocation(dimensionLocation: DimensionLocation): void;
15372
16656
  }
15373
16657
 
15374
16658
  /**
15375
- * Represents a loot pool entry containing an item to drop.
16659
+ * @beta
16660
+ * Manages the collection of waypoints displayed on a player's
16661
+ * locator bar. Allows adding, removing, and querying waypoints
16662
+ * with a maximum capacity limit.
16663
+ *
16664
+ * Invalid waypoints in the locator bar will be automatically
16665
+ * removed in the next tick. This includes waypoints tied to
16666
+ * entities that have been removed from the world.
16667
+ *
16668
+ * Note: You can control whether vanilla player waypoints are
16669
+ * automatically added to the locator bar using the
16670
+ * `playerWaypoints` {@link GameRule}. Accepted values are
16671
+ * `off` (players are not shown on the locator bar) and
16672
+ * `everyone` (all players are visible on the locator bar).
16673
+ *
16674
+ * Note: You can only modify, remove, or query waypoints that
16675
+ * were added by this pack.
16676
+ * @example sharedWaypoint.ts
16677
+ * ```typescript
16678
+ * /\*
16679
+ * import { world, LocationWaypoint, WaypointTextureSelector, WaypointTexture } from "@minecraft/server"
16680
+ *
16681
+ * function sharedWaypoint() {
16682
+ * const players = world.getAllPlayers();
16683
+ *
16684
+ * if (players.length < 2) {
16685
+ * console.warn("Need at least 2 players for this example.");
16686
+ * return;
16687
+ * }
16688
+ *
16689
+ * const playerA = players[0];
16690
+ * const playerB = players[1];
16691
+ *
16692
+ * // Create a single waypoint at a specific location
16693
+ * const textureSelector: WaypointTextureSelector = {
16694
+ * textureBoundsList: [
16695
+ * { lowerBound: 0, texture: WaypointTexture.Circle }
16696
+ * ]
16697
+ * };
16698
+ *
16699
+ * const waypoint = new LocationWaypoint(
16700
+ * { dimension: playerA.dimension, x: 100, y: 64, z: 100 },
16701
+ * textureSelector,
16702
+ * { red: 1, green: 0, blue: 0 } // Initially red
16703
+ * );
16704
+ *
16705
+ * // Add the same waypoint to both players' locator bars
16706
+ * playerA.locatorBar.addWaypoint(waypoint);
16707
+ * playerB.locatorBar.addWaypoint(waypoint);
16708
+ *
16709
+ * // Change the color - this affects both players
16710
+ * waypoint.color = { red: 0, green: 1, blue: 0 }; // Now green for both players
16711
+ * }
16712
+ * *\/
16713
+ * ```
15376
16714
  */
15377
- // @ts-ignore Class inheritance allowed for native defined classes
15378
- export class LootItem extends LootPoolEntry {
16715
+ export class LocatorBar {
15379
16716
  private constructor();
15380
- readonly functions: LootItemFunction[];
15381
16717
  /**
15382
16718
  * @remarks
15383
- * The name of the item contained in this entry.
16719
+ * The current number of waypoints in the locator bar.
15384
16720
  *
15385
16721
  */
15386
- readonly name?: ItemType;
15387
- }
15388
-
15389
- /**
15390
- * An abstract base class from which all loot item conditions
15391
- * are derived. A loot item condition is a set of rules or
15392
- * requirements which must be met for a loot drop to happen.
15393
- */
15394
- export class LootItemCondition {
15395
- private constructor();
15396
- }
15397
-
15398
- /**
15399
- * An abstract base class from which all loot item functions
15400
- * are derived. Loot item functions can modify loot drops in a
15401
- * variety of ways as they happen, optionally dependent on a
15402
- * set of conditions which must be met.
15403
- */
15404
- export class LootItemFunction {
15405
- private constructor();
15406
- readonly conditions: LootItemCondition[];
15407
- }
16722
+ readonly count: number;
16723
+ /**
16724
+ * @remarks
16725
+ * The maximum number of waypoints that can be added to the
16726
+ * locator bar.
16727
+ *
16728
+ */
16729
+ readonly maxCount: number;
16730
+ /**
16731
+ * @remarks
16732
+ * Adds a waypoint to the locator bar. Throws an error if the
16733
+ * waypoint already exists, the maximum waypoint limit has been
16734
+ * reached, or the waypoint is invalid.
16735
+ *
16736
+ * This function can't be called in restricted-execution mode.
16737
+ *
16738
+ * @param waypoint
16739
+ * The {@link Waypoint} to add to the locator bar.
16740
+ * @throws This function can throw errors.
16741
+ *
16742
+ * {@link minecraftcommon.EngineError}
16743
+ *
16744
+ * {@link InvalidWaypointError}
16745
+ *
16746
+ * {@link LocatorBarError}
16747
+ */
16748
+ addWaypoint(waypoint: Waypoint): void;
16749
+ /**
16750
+ * @remarks
16751
+ * Returns an array of all waypoints currently in the locator
16752
+ * bar.
16753
+ *
16754
+ * This function can't be called in restricted-execution mode.
16755
+ *
16756
+ */
16757
+ getAllWaypoints(): Waypoint[];
16758
+ /**
16759
+ * @remarks
16760
+ * Checks whether the specified waypoint exists in the locator
16761
+ * bar.
16762
+ *
16763
+ * This function can't be called in restricted-execution mode.
16764
+ *
16765
+ * @param waypoint
16766
+ * The {@link Waypoint} to check for.
16767
+ */
16768
+ hasWaypoint(waypoint: Waypoint): boolean;
16769
+ /**
16770
+ * @remarks
16771
+ * Removes all waypoints from the locator bar, clearing it
16772
+ * completely.
16773
+ *
16774
+ * This function can't be called in restricted-execution mode.
16775
+ *
16776
+ * @throws This function can throw errors.
16777
+ *
16778
+ * {@link minecraftcommon.EngineError}
16779
+ */
16780
+ removeAllWaypoints(): void;
16781
+ /**
16782
+ * @remarks
16783
+ * Removes a specific waypoint from the locator bar. Returns an
16784
+ * error if the waypoint does not exist in the locator bar.
16785
+ *
16786
+ * This function can't be called in restricted-execution mode.
16787
+ *
16788
+ * @param waypoint
16789
+ * The {@link Waypoint} to remove from the locator bar.
16790
+ * @throws This function can throw errors.
16791
+ *
16792
+ * {@link minecraftcommon.EngineError}
16793
+ *
16794
+ * {@link LocatorBarError}
16795
+ */
16796
+ removeWaypoint(waypoint: Waypoint): void;
16797
+ }
16798
+
16799
+ /**
16800
+ * Loot item function that drops extra items if the provided
16801
+ * tool has the looting enchant.
16802
+ */
16803
+ // @ts-ignore Class inheritance allowed for native defined classes
16804
+ export class LootingEnchantFunction extends LootItemFunction {
16805
+ private constructor();
16806
+ /**
16807
+ * @remarks
16808
+ * The value range from which the function randomly chooses the
16809
+ * number of extra items to drop. Contains minimum and maximum
16810
+ * values.
16811
+ *
16812
+ */
16813
+ readonly count: minecraftcommon.NumberRange;
16814
+ }
16815
+
16816
+ /**
16817
+ * Represents a loot pool entry containing an item to drop.
16818
+ */
16819
+ // @ts-ignore Class inheritance allowed for native defined classes
16820
+ export class LootItem extends LootPoolEntry {
16821
+ private constructor();
16822
+ readonly functions: LootItemFunction[];
16823
+ /**
16824
+ * @remarks
16825
+ * The name of the item contained in this entry.
16826
+ *
16827
+ */
16828
+ readonly name?: ItemType;
16829
+ }
16830
+
16831
+ /**
16832
+ * An abstract base class from which all loot item conditions
16833
+ * are derived. A loot item condition is a set of rules or
16834
+ * requirements which must be met for a loot drop to happen.
16835
+ */
16836
+ export class LootItemCondition {
16837
+ private constructor();
16838
+ }
16839
+
16840
+ /**
16841
+ * An abstract base class from which all loot item functions
16842
+ * are derived. Loot item functions can modify loot drops in a
16843
+ * variety of ways as they happen, optionally dependent on a
16844
+ * set of conditions which must be met.
16845
+ */
16846
+ export class LootItemFunction {
16847
+ private constructor();
16848
+ readonly conditions: LootItemCondition[];
16849
+ }
15408
16850
 
15409
16851
  /**
15410
16852
  * A collection of entries which individually determine loot
@@ -15732,6 +17174,33 @@ export class MatchToolCondition extends LootItemCondition {
15732
17174
  readonly itemTagsNone: string[];
15733
17175
  }
15734
17176
 
17177
+ /**
17178
+ * @beta
17179
+ * A specific currently-internal event used for passing
17180
+ * messages from client to server.
17181
+ */
17182
+ export class MessageReceiveAfterEvent {
17183
+ private constructor();
17184
+ /**
17185
+ * @remarks
17186
+ * The message identifier.
17187
+ *
17188
+ */
17189
+ readonly id: string;
17190
+ /**
17191
+ * @remarks
17192
+ * The message.
17193
+ *
17194
+ */
17195
+ readonly message: string;
17196
+ /**
17197
+ * @remarks
17198
+ * The player who sent the message.
17199
+ *
17200
+ */
17201
+ readonly player: Player;
17202
+ }
17203
+
15735
17204
  /**
15736
17205
  * Contains a set of additional variable values for further
15737
17206
  * defining how rendering and animations function.
@@ -15800,6 +17269,49 @@ export class MolangVariableMap {
15800
17269
  setVector3(variableName: string, vector: Vector3): void;
15801
17270
  }
15802
17271
 
17272
+ /**
17273
+ * @beta
17274
+ * Pack setting name and value that changed.
17275
+ */
17276
+ export class PackSettingChangeAfterEvent {
17277
+ private constructor();
17278
+ /**
17279
+ * @remarks
17280
+ * The name of the setting.
17281
+ *
17282
+ */
17283
+ readonly settingName: string;
17284
+ /**
17285
+ * @remarks
17286
+ * The value of the setting.
17287
+ *
17288
+ */
17289
+ readonly settingValue: boolean | number | string;
17290
+ }
17291
+
17292
+ /**
17293
+ * @beta
17294
+ */
17295
+ export class PackSettingChangeAfterEventSignal {
17296
+ private constructor();
17297
+ /**
17298
+ * @remarks
17299
+ * This function can't be called in restricted-execution mode.
17300
+ *
17301
+ * This function can be called in early-execution mode.
17302
+ *
17303
+ */
17304
+ subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
17305
+ /**
17306
+ * @remarks
17307
+ * This function can't be called in restricted-execution mode.
17308
+ *
17309
+ * This function can be called in early-execution mode.
17310
+ *
17311
+ */
17312
+ unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
17313
+ }
17314
+
15803
17315
  /**
15804
17316
  * Loot item condition that checks whether the looting entity
15805
17317
  * is currently a passenger of a specific type of entity.
@@ -15967,6 +17479,62 @@ export class Player extends Entity {
15967
17479
  * @throws This property can throw when used.
15968
17480
  */
15969
17481
  readonly camera: Camera;
17482
+ /**
17483
+ * @beta
17484
+ * @remarks
17485
+ * The player's chat display name, composed from {@link
17486
+ * Player.chatNamePrefix} + {@link Player.name} + {@link
17487
+ * Player.chatNameSuffix}. This is the name shown as the author
17488
+ * of chat messages sent by this player. To change the name
17489
+ * shown above the player's head, use {@link Entity.nameTag}.
17490
+ *
17491
+ * @throws This property can throw when used.
17492
+ *
17493
+ * {@link InvalidEntityError}
17494
+ */
17495
+ readonly chatDisplayName: string;
17496
+ /**
17497
+ * @beta
17498
+ * @remarks
17499
+ * An optional string that, when set, is prepended to the text
17500
+ * of chat messages sent by this player. Useful for applying
17501
+ * formatting or color codes to a player's messages (e.g., '§a'
17502
+ * to make their messages green). Does not affect the player's
17503
+ * name display - use {@link Player.chatNamePrefix} for the
17504
+ * name shown in chat, or {@link Entity.nameTag} for the name
17505
+ * above the player's head. Set to undefined to clear.
17506
+ *
17507
+ * This property can't be edited in restricted-execution mode.
17508
+ *
17509
+ */
17510
+ chatMessagePrefix?: string;
17511
+ /**
17512
+ * @beta
17513
+ * @remarks
17514
+ * An optional string that, when set, is prepended to the
17515
+ * player's name in chat messages. Does not affect the name tag
17516
+ * above the player's head or the player list - use {@link
17517
+ * Entity.nameTag} for that. To prefix the message text itself,
17518
+ * use {@link Player.chatMessagePrefix}. Set to undefined to
17519
+ * clear.
17520
+ *
17521
+ * This property can't be edited in restricted-execution mode.
17522
+ *
17523
+ */
17524
+ chatNamePrefix?: string;
17525
+ /**
17526
+ * @beta
17527
+ * @remarks
17528
+ * An optional string that, when set, is appended to the
17529
+ * player's name in chat messages. Does not affect the name tag
17530
+ * above the player's head or the player list - use {@link
17531
+ * Entity.nameTag} for that. See also {@link
17532
+ * Player.chatNamePrefix}. Set to undefined to clear.
17533
+ *
17534
+ * This property can't be edited in restricted-execution mode.
17535
+ *
17536
+ */
17537
+ chatNameSuffix?: string;
15970
17538
  /**
15971
17539
  * @remarks
15972
17540
  * Contains the player's device information.
@@ -16041,6 +17609,14 @@ export class Player extends Entity {
16041
17609
  * @throws This property can throw when used.
16042
17610
  */
16043
17611
  readonly level: number;
17612
+ /**
17613
+ * @beta
17614
+ * @remarks
17615
+ * The player's Locator Bar. This property is used for managing
17616
+ * waypoints displayed on the HUD.
17617
+ *
17618
+ */
17619
+ readonly locatorBar: LocatorBar;
16044
17620
  /**
16045
17621
  * @remarks
16046
17622
  * Name of the player.
@@ -16056,12 +17632,35 @@ export class Player extends Entity {
16056
17632
  * @throws This property can throw when used.
16057
17633
  */
16058
17634
  readonly onScreenDisplay: ScreenDisplay;
17635
+ /**
17636
+ * @beta
17637
+ * @remarks
17638
+ * The party information for this player, or undefined if the
17639
+ * player is not in a party.
17640
+ *
17641
+ * @throws This property can throw when used.
17642
+ *
17643
+ * {@link InvalidEntityError}
17644
+ */
17645
+ readonly partyInfo?: PartyInfo;
16059
17646
  /**
16060
17647
  * @throws This property can throw when used.
16061
17648
  *
16062
17649
  * {@link InvalidEntityError}
16063
17650
  */
16064
17651
  readonly playerPermissionLevel: PlayerPermissionLevel;
17652
+ /**
17653
+ * @beta
17654
+ * @remarks
17655
+ * Gets the player's Playfab ID.
17656
+ *
17657
+ * @throws This property can throw when used.
17658
+ *
17659
+ * {@link minecraftcommon.EngineError}
17660
+ *
17661
+ * {@link InvalidEntityError}
17662
+ */
17663
+ readonly playfabId: string;
16065
17664
  /**
16066
17665
  * @remarks
16067
17666
  * This property can't be edited in restricted-execution mode.
@@ -16129,6 +17728,20 @@ export class Player extends Entity {
16129
17728
  * Throws if the Entity or Entity ID is invalid.
16130
17729
  */
16131
17730
  clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
17731
+ /**
17732
+ * @beta
17733
+ * @remarks
17734
+ * Eats an item, providing the item's hunger and saturation
17735
+ * effects to the player. Can only be used on food items.
17736
+ *
17737
+ * This function can't be called in restricted-execution mode.
17738
+ *
17739
+ * @param itemStack
17740
+ * The item to eat.
17741
+ * @throws
17742
+ * Throws if the item is not a food item.
17743
+ */
17744
+ eatItem(itemStack: ItemStack): void;
16132
17745
  /**
16133
17746
  * @remarks
16134
17747
  * The player's aim-assist settings.
@@ -16162,6 +17775,22 @@ export class Player extends Entity {
16162
17775
  * @throws This function can throw errors.
16163
17776
  */
16164
17777
  getItemCooldown(cooldownCategory: string): number;
17778
+ /**
17779
+ * @beta
17780
+ * @remarks
17781
+ * Gets the player's ping in milliseconds.
17782
+ *
17783
+ * This function can't be called in restricted-execution mode.
17784
+ *
17785
+ * @returns
17786
+ * The player's ping in milliseconds.
17787
+ * @throws This function can throw errors.
17788
+ *
17789
+ * {@link minecraftcommon.EngineError}
17790
+ *
17791
+ * {@link InvalidEntityError}
17792
+ */
17793
+ getPing(): number;
16165
17794
  /**
16166
17795
  * @remarks
16167
17796
  * Gets the current spawn point of the player.
@@ -16199,6 +17828,10 @@ export class Player extends Entity {
16199
17828
  * @param soundOptions
16200
17829
  * Additional optional options for the sound.
16201
17830
  * @throws This function can throw errors.
17831
+ *
17832
+ * {@link minecraftcommon.EngineError}
17833
+ *
17834
+ * {@link Error}
16202
17835
  * @example playMusicAndSound.ts
16203
17836
  * ```typescript
16204
17837
  * import { world, MusicOptions, WorldSoundOptions, PlayerSoundOptions, DimensionLocation } from '@minecraft/server';
@@ -16228,7 +17861,18 @@ export class Player extends Entity {
16228
17861
  * }
16229
17862
  * ```
16230
17863
  */
16231
- playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
17864
+ playSound(soundId: string, soundOptions?: PlayerSoundOptions): SoundInstance;
17865
+ /**
17866
+ * @beta
17867
+ * @remarks
17868
+ * This is an internal-facing method for posting a system
17869
+ * message to downstream clients.
17870
+ *
17871
+ * This function can't be called in restricted-execution mode.
17872
+ *
17873
+ * @throws This function can throw errors.
17874
+ */
17875
+ postClientMessage(id: string, value: string): void;
16232
17876
  /**
16233
17877
  * @remarks
16234
17878
  * Queues an additional music track that only this particular
@@ -16504,6 +18148,18 @@ export class Player extends Entity {
16504
18148
  * @throws This function can throw errors.
16505
18149
  */
16506
18150
  startItemCooldown(cooldownCategory: string, tickDuration: number): void;
18151
+ /**
18152
+ * @beta
18153
+ * @remarks
18154
+ * Stops all sounds from playing for this particular player.
18155
+ *
18156
+ * This function can't be called in restricted-execution mode.
18157
+ *
18158
+ * @throws This function can throw errors.
18159
+ *
18160
+ * {@link InvalidEntityError}
18161
+ */
18162
+ stopAllSounds(): void;
16507
18163
  /**
16508
18164
  * @remarks
16509
18165
  * Stops any music tracks from playing for this particular
@@ -16514,6 +18170,20 @@ export class Player extends Entity {
16514
18170
  * @throws This function can throw errors.
16515
18171
  */
16516
18172
  stopMusic(): void;
18173
+ /**
18174
+ * @beta
18175
+ * @remarks
18176
+ * Stops a sound from playing for this particular player.
18177
+ *
18178
+ * This function can't be called in restricted-execution mode.
18179
+ *
18180
+ * @param soundId
18181
+ * Identifier of the sound.
18182
+ * @throws This function can throw errors.
18183
+ *
18184
+ * {@link InvalidEntityError}
18185
+ */
18186
+ stopSound(soundId: string): void;
16517
18187
  }
16518
18188
 
16519
18189
  /**
@@ -17798,6 +19468,88 @@ export class PlayerPlaceBlockAfterEventSignal {
17798
19468
  unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
17799
19469
  }
17800
19470
 
19471
+ /**
19472
+ * @beta
19473
+ * Contains information regarding an event before a player
19474
+ * places a block.
19475
+ */
19476
+ // @ts-ignore Class inheritance allowed for native defined classes
19477
+ export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
19478
+ private constructor();
19479
+ /**
19480
+ * @remarks
19481
+ * If set to true, cancels the block place event.
19482
+ *
19483
+ */
19484
+ cancel: boolean;
19485
+ /**
19486
+ * @remarks
19487
+ * The face of the block that the new block is being placed on.
19488
+ *
19489
+ */
19490
+ readonly face: Direction;
19491
+ /**
19492
+ * @remarks
19493
+ * Location relative to the bottom north-west corner of the
19494
+ * block where the new block is being placed onto.
19495
+ *
19496
+ */
19497
+ readonly faceLocation: Vector3;
19498
+ /**
19499
+ * @remarks
19500
+ * The block permutation that will be placed if the event is
19501
+ * not cancelled.
19502
+ *
19503
+ */
19504
+ readonly permutationToPlace: BlockPermutation;
19505
+ /**
19506
+ * @remarks
19507
+ * Player that is placing the block for this event.
19508
+ *
19509
+ */
19510
+ readonly player: Player;
19511
+ }
19512
+
19513
+ /**
19514
+ * @beta
19515
+ * Manages callbacks that are connected to before a block is
19516
+ * placed by a player.
19517
+ */
19518
+ export class PlayerPlaceBlockBeforeEventSignal {
19519
+ private constructor();
19520
+ /**
19521
+ * @remarks
19522
+ * Adds a callback that will be called before a block is placed
19523
+ * by a player.
19524
+ *
19525
+ * This function can't be called in restricted-execution mode.
19526
+ *
19527
+ * This function can be called in early-execution mode.
19528
+ *
19529
+ * @param callback
19530
+ * This closure is called with restricted-execution privilege.
19531
+ * @returns
19532
+ * Closure that is called with restricted-execution privilege.
19533
+ */
19534
+ subscribe(
19535
+ callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
19536
+ options?: BlockEventOptions,
19537
+ ): (arg0: PlayerPlaceBlockBeforeEvent) => void;
19538
+ /**
19539
+ * @remarks
19540
+ * Removes a callback from being called before an block is
19541
+ * placed by a player.
19542
+ *
19543
+ * This function can't be called in restricted-execution mode.
19544
+ *
19545
+ * This function can be called in early-execution mode.
19546
+ *
19547
+ * @param callback
19548
+ * This closure is called with restricted-execution privilege.
19549
+ */
19550
+ unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
19551
+ }
19552
+
17801
19553
  /**
17802
19554
  * An event that contains more information about a player
17803
19555
  * spawning.
@@ -17916,6 +19668,114 @@ export class PlayerSwingStartAfterEventSignal {
17916
19668
  unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
17917
19669
  }
17918
19670
 
19671
+ /**
19672
+ * @beta
19673
+ * Contains information related to when a player successfully
19674
+ * names an Entity with a named Name Tag item.
19675
+ */
19676
+ export class PlayerUseNameTagAfterEvent {
19677
+ private constructor();
19678
+ /**
19679
+ * @remarks
19680
+ * The entity that was named by the player.
19681
+ *
19682
+ * This property can't be edited in restricted-execution mode.
19683
+ *
19684
+ */
19685
+ entityNamed: Entity;
19686
+ /**
19687
+ * @remarks
19688
+ * The new name that the player has given to the entity.
19689
+ *
19690
+ * This property can't be edited in restricted-execution mode.
19691
+ *
19692
+ */
19693
+ newName: string;
19694
+ /**
19695
+ * @remarks
19696
+ * Handle to the player that used the name tag.
19697
+ *
19698
+ * This property can't be edited in restricted-execution mode.
19699
+ *
19700
+ */
19701
+ player: Player;
19702
+ /**
19703
+ * @remarks
19704
+ * The previous name of the entity before the player used the
19705
+ * name tag. This will be undefined if the entity was not
19706
+ * previously named.
19707
+ *
19708
+ * This property can't be edited in restricted-execution mode.
19709
+ *
19710
+ */
19711
+ previousName?: string;
19712
+ }
19713
+
19714
+ /**
19715
+ * @beta
19716
+ * Manages callbacks that are connected to when a player
19717
+ * successfully names an Entity with a named Name Tag item.
19718
+ */
19719
+ export class PlayerUseNameTagAfterEventSignal {
19720
+ private constructor();
19721
+ /**
19722
+ * @remarks
19723
+ * Subscribes the specified callback to a player use name tag
19724
+ * after event.
19725
+ *
19726
+ * This function can't be called in restricted-execution mode.
19727
+ *
19728
+ * This function can be called in early-execution mode.
19729
+ *
19730
+ */
19731
+ subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
19732
+ /**
19733
+ * @remarks
19734
+ * Removes the specified callback from a player use name tag
19735
+ * after event.
19736
+ *
19737
+ * This function can't be called in restricted-execution mode.
19738
+ *
19739
+ * This function can be called in early-execution mode.
19740
+ *
19741
+ */
19742
+ unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
19743
+ }
19744
+
19745
+ /**
19746
+ * @beta
19747
+ * Waypoint that tracks a player's position. Extends {@link
19748
+ * EntityWaypoint} with additional player-specific visibility
19749
+ * rules such as hidden state and spectator mode.
19750
+ */
19751
+ // @ts-ignore Class inheritance allowed for native defined classes
19752
+ export class PlayerWaypoint extends EntityWaypoint {
19753
+ /**
19754
+ * @remarks
19755
+ * The {@link PlayerVisibilityRules} that control when the
19756
+ * waypoint is shown based on the player's state (e.g., hidden,
19757
+ * spectator mode, spectator viewing another spectator).
19758
+ *
19759
+ * @throws This property can throw when used.
19760
+ *
19761
+ * {@link InvalidWaypointError}
19762
+ *
19763
+ * {@link InvalidWaypointTextureSelectorError}
19764
+ */
19765
+ readonly playerRules: PlayerVisibilityRules;
19766
+ /**
19767
+ * @throws This function can throw errors.
19768
+ *
19769
+ * {@link InvalidWaypointTextureSelectorError}
19770
+ */
19771
+ constructor(
19772
+ player: Player,
19773
+ textureSelector: WaypointTextureSelector,
19774
+ playerRules: PlayerVisibilityRules,
19775
+ color?: RGB,
19776
+ );
19777
+ }
19778
+
17919
19779
  /**
17920
19780
  * Represents how the potion effect is delivered.
17921
19781
  */
@@ -17998,10 +19858,10 @@ export class Potions {
17998
19858
  *
17999
19859
  * {@link InvalidPotionEffectTypeError}
18000
19860
  */
18001
- static resolve(
18002
- potionEffectType: PotionEffectType | string,
18003
- potionDeliveryType: PotionDeliveryType | string,
18004
- ): ItemStack;
19861
+ static resolve<
19862
+ T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
19863
+ U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
19864
+ >(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
18005
19865
  }
18006
19866
 
18007
19867
  /**
@@ -18035,85 +19895,230 @@ export class PressurePlatePopAfterEventSignal {
18035
19895
  private constructor();
18036
19896
  /**
18037
19897
  * @remarks
18038
- * Adds a callback that will be called when a pressure plate is
18039
- * popped.
18040
- *
18041
- * This function can't be called in restricted-execution mode.
18042
- *
18043
- * This function can be called in early-execution mode.
19898
+ * Adds a callback that will be called when a pressure plate is
19899
+ * popped.
19900
+ *
19901
+ * This function can't be called in restricted-execution mode.
19902
+ *
19903
+ * This function can be called in early-execution mode.
19904
+ *
19905
+ */
19906
+ subscribe(callback: (arg0: PressurePlatePopAfterEvent) => void): (arg0: PressurePlatePopAfterEvent) => void;
19907
+ /**
19908
+ * @remarks
19909
+ * Removes a callback from being called when a pressure plate
19910
+ * is popped.
19911
+ *
19912
+ * This function can't be called in restricted-execution mode.
19913
+ *
19914
+ * This function can be called in early-execution mode.
19915
+ *
19916
+ */
19917
+ unsubscribe(callback: (arg0: PressurePlatePopAfterEvent) => void): void;
19918
+ }
19919
+
19920
+ /**
19921
+ * Contains information related to changes to a pressure plate
19922
+ * push.
19923
+ */
19924
+ // @ts-ignore Class inheritance allowed for native defined classes
19925
+ export class PressurePlatePushAfterEvent extends BlockEvent {
19926
+ private constructor();
19927
+ /**
19928
+ * @remarks
19929
+ * The redstone power of the pressure plate before it was
19930
+ * pushed.
19931
+ *
19932
+ */
19933
+ readonly previousRedstonePower: number;
19934
+ /**
19935
+ * @remarks
19936
+ * The redstone power of the pressure plate at the time of the
19937
+ * push.
19938
+ *
19939
+ */
19940
+ readonly redstonePower: number;
19941
+ /**
19942
+ * @remarks
19943
+ * Source that triggered the pressure plate push.
19944
+ *
19945
+ */
19946
+ readonly source: Entity;
19947
+ }
19948
+
19949
+ /**
19950
+ * Manages callbacks that are connected to when a pressure
19951
+ * plate is pushed.
19952
+ */
19953
+ export class PressurePlatePushAfterEventSignal {
19954
+ private constructor();
19955
+ /**
19956
+ * @remarks
19957
+ * Adds a callback that will be called when a pressure plate is
19958
+ * pushed.
19959
+ *
19960
+ * This function can't be called in restricted-execution mode.
19961
+ *
19962
+ * This function can be called in early-execution mode.
19963
+ *
19964
+ */
19965
+ subscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): (arg0: PressurePlatePushAfterEvent) => void;
19966
+ /**
19967
+ * @remarks
19968
+ * Removes a callback from being called when a pressure plate
19969
+ * is pushed.
19970
+ *
19971
+ * This function can't be called in restricted-execution mode.
19972
+ *
19973
+ * This function can be called in early-execution mode.
19974
+ *
19975
+ */
19976
+ unsubscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): void;
19977
+ }
19978
+
19979
+ /**
19980
+ * @beta
19981
+ * The base class for a text primitive. Represents an object in
19982
+ * the world and its base properties.
19983
+ */
19984
+ export class PrimitiveShape {
19985
+ private constructor();
19986
+ /**
19987
+ * @remarks
19988
+ * The entity this shape is attached to. When set, this shape
19989
+ * will copy the root location of the attached entity and the
19990
+ * shape's position will be used as an offset.
19991
+ *
19992
+ */
19993
+ attachedTo?: Entity;
19994
+ /**
19995
+ * @remarks
19996
+ * The color of the shape.
19997
+ *
19998
+ */
19999
+ color: RGBA;
20000
+ /**
20001
+ * @remarks
20002
+ * The dimension the shape is visible within. If the dimension
20003
+ * is undefined, it will display in all dimensions.
20004
+ *
20005
+ */
20006
+ readonly dimension: Dimension;
20007
+ /**
20008
+ * @remarks
20009
+ * Returns true if the shape has a limited time span before
20010
+ * being removed.
20011
+ *
20012
+ */
20013
+ readonly hasDuration: boolean;
20014
+ /**
20015
+ * @remarks
20016
+ * The location of the shape.
20017
+ *
20018
+ */
20019
+ readonly location: Vector3;
20020
+ /**
20021
+ * @remarks
20022
+ * If defined, this distance will be used to determine how far
20023
+ * away this primitive will be rendered for each client. By
20024
+ * default the distance will match the client's render distance
20025
+ * setting.
20026
+ *
20027
+ * Minimum Value: 0
20028
+ */
20029
+ maximumRenderDistance?: number;
20030
+ /**
20031
+ * @remarks
20032
+ * The rotation of the shape (Euler angles - [Pitch, Yaw,
20033
+ * Roll]).
18044
20034
  *
18045
20035
  */
18046
- subscribe(callback: (arg0: PressurePlatePopAfterEvent) => void): (arg0: PressurePlatePopAfterEvent) => void;
20036
+ rotation: Vector3;
18047
20037
  /**
18048
20038
  * @remarks
18049
- * Removes a callback from being called when a pressure plate
18050
- * is popped.
20039
+ * The scale of the shape.
18051
20040
  *
18052
- * This function can't be called in restricted-execution mode.
20041
+ * Bounds: [-1000, 1000]
20042
+ */
20043
+ scale: number;
20044
+ /**
20045
+ * @remarks
20046
+ * The time left (in seconds) until this shape is automatically
20047
+ * removed. Returns undefined if the shape does not have a
20048
+ * limited life-span.
18053
20049
  *
18054
- * This function can be called in early-execution mode.
20050
+ */
20051
+ timeLeft?: number;
20052
+ /**
20053
+ * @remarks
20054
+ * The total initial time-span (in seconds) until this shape is
20055
+ * automatically removed. Returns undefined if the shape does
20056
+ * not have a limited life-span.
18055
20057
  *
18056
20058
  */
18057
- unsubscribe(callback: (arg0: PressurePlatePopAfterEvent) => void): void;
18058
- }
18059
-
18060
- /**
18061
- * Contains information related to changes to a pressure plate
18062
- * push.
18063
- */
18064
- // @ts-ignore Class inheritance allowed for native defined classes
18065
- export class PressurePlatePushAfterEvent extends BlockEvent {
18066
- private constructor();
20059
+ readonly totalTimeLeft?: number;
18067
20060
  /**
18068
20061
  * @remarks
18069
- * The redstone power of the pressure plate before it was
18070
- * pushed.
20062
+ * The list of players that this shape will be visible to. If
20063
+ * left empty, the shape will be visible to all players.
18071
20064
  *
18072
20065
  */
18073
- readonly previousRedstonePower: number;
20066
+ visibleTo: Player[];
18074
20067
  /**
18075
20068
  * @remarks
18076
- * The redstone power of the pressure plate at the time of the
18077
- * push.
20069
+ * Removes this shape from the world. The shape can be re-added
20070
+ * via the PrimitiveShapesManager's addText method.
18078
20071
  *
18079
20072
  */
18080
- readonly redstonePower: number;
20073
+ remove(): void;
18081
20074
  /**
18082
20075
  * @remarks
18083
- * Source that triggered the pressure plate push.
20076
+ * Set the location and dimension of the shape. If the
20077
+ * dimension is undefined, it will display in all dimensions.
18084
20078
  *
18085
20079
  */
18086
- readonly source: Entity;
20080
+ setLocation(location: DimensionLocation | Vector3): void;
18087
20081
  }
18088
20082
 
18089
20083
  /**
18090
- * Manages callbacks that are connected to when a pressure
18091
- * plate is pushed.
20084
+ * @beta
20085
+ * Primitive Shapes class used to allow adding and removing
20086
+ * text primitives to the world.
18092
20087
  */
18093
- export class PressurePlatePushAfterEventSignal {
20088
+ export class PrimitiveShapesManager {
18094
20089
  private constructor();
18095
20090
  /**
18096
20091
  * @remarks
18097
- * Adds a callback that will be called when a pressure plate is
18098
- * pushed.
20092
+ * This is the maximum number of allowed primitive shapes.
18099
20093
  *
18100
- * This function can't be called in restricted-execution mode.
20094
+ */
20095
+ readonly maxShapes: number;
20096
+ /**
20097
+ * @remarks
20098
+ * Adds a new text primitive to the world.
18101
20099
  *
18102
- * This function can be called in early-execution mode.
20100
+ * @param text
20101
+ * The text primitive to be added.
20102
+ * @throws This function can throw errors.
20103
+ *
20104
+ * {@link minecraftcommon.EngineError}
18103
20105
  *
20106
+ * {@link PrimitiveShapeError}
18104
20107
  */
18105
- subscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): (arg0: PressurePlatePushAfterEvent) => void;
20108
+ addText(text: TextPrimitive, dimension?: Dimension): void;
18106
20109
  /**
18107
20110
  * @remarks
18108
- * Removes a callback from being called when a pressure plate
18109
- * is pushed.
18110
- *
18111
- * This function can't be called in restricted-execution mode.
20111
+ * Removes all text primitives from the world.
18112
20112
  *
18113
- * This function can be called in early-execution mode.
20113
+ */
20114
+ removeAll(): void;
20115
+ /**
20116
+ * @remarks
20117
+ * Removes an instance of a text primitive from the world. This
20118
+ * is equivalent to calling remove on the text itself.
18114
20119
  *
18115
20120
  */
18116
- unsubscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): void;
20121
+ removeText(text: TextPrimitive): void;
18117
20122
  }
18118
20123
 
18119
20124
  /**
@@ -19065,6 +21070,38 @@ export class Seat {
19065
21070
  readonly seatRotation: number;
19066
21071
  }
19067
21072
 
21073
+ /**
21074
+ * @beta
21075
+ * Manages callbacks that are message passing to a server. This
21076
+ * event is not currently fully implemented, and should not be
21077
+ * used.
21078
+ */
21079
+ export class ServerMessageAfterEventSignal {
21080
+ private constructor();
21081
+ /**
21082
+ * @remarks
21083
+ * Adds a callback that will be called when an internal message
21084
+ * is passed.
21085
+ *
21086
+ * This function can't be called in restricted-execution mode.
21087
+ *
21088
+ * This function can be called in early-execution mode.
21089
+ *
21090
+ */
21091
+ subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
21092
+ /**
21093
+ * @remarks
21094
+ * Removes a callback from being called when an internal
21095
+ * message is passed.
21096
+ *
21097
+ * This function can't be called in restricted-execution mode.
21098
+ *
21099
+ * This function can be called in early-execution mode.
21100
+ *
21101
+ */
21102
+ unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
21103
+ }
21104
+
19068
21105
  /**
19069
21106
  * Loot item function that modifies the trim on a dropped armor
19070
21107
  * item.
@@ -19093,6 +21130,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
19093
21130
  // @ts-ignore Class inheritance allowed for native defined classes
19094
21131
  export class SetBannerDetailsFunction extends LootItemFunction {
19095
21132
  private constructor();
21133
+ /**
21134
+ * @beta
21135
+ * @remarks
21136
+ * The base color for the dropped banner.
21137
+ *
21138
+ */
21139
+ readonly baseColor: string;
21140
+ /**
21141
+ * @beta
21142
+ * @remarks
21143
+ * An array of {@link BannerPattern} objects used to decorate
21144
+ * the banner, including color and pattern type.
21145
+ *
21146
+ */
21147
+ readonly patterns: BannerPattern[];
19096
21148
  /**
19097
21149
  * @remarks
19098
21150
  * The type of banner to drop.
@@ -19337,6 +21389,22 @@ export class SmeltItemFunction extends LootItemFunction {
19337
21389
  private constructor();
19338
21390
  }
19339
21391
 
21392
+ /**
21393
+ * @beta
21394
+ * Represents a handle to a sound that has been played.
21395
+ */
21396
+ export class SoundInstance {
21397
+ private constructor();
21398
+ /**
21399
+ * @remarks
21400
+ * Stops this sound from playing.
21401
+ *
21402
+ * This function can't be called in restricted-execution mode.
21403
+ *
21404
+ */
21405
+ stop(): void;
21406
+ }
21407
+
19340
21408
  /**
19341
21409
  * Loot item function that applies one or several predefined
19342
21410
  * enchants to the dropped item.
@@ -19387,6 +21455,13 @@ export class StartupEvent {
19387
21455
  *
19388
21456
  */
19389
21457
  readonly customCommandRegistry: CustomCommandRegistry;
21458
+ /**
21459
+ * @beta
21460
+ * @remarks
21461
+ * This property can be read in early-execution mode.
21462
+ *
21463
+ */
21464
+ readonly dimensionRegistry: DimensionRegistry;
19390
21465
  /**
19391
21466
  * @remarks
19392
21467
  * This property can be read in early-execution mode.
@@ -20044,6 +22119,19 @@ export class SystemBeforeEvents {
20044
22119
  *
20045
22120
  */
20046
22121
  readonly startup: StartupBeforeEventSignal;
22122
+ /**
22123
+ * @beta
22124
+ * @remarks
22125
+ * Fires when the scripting watchdog shuts down the server. The
22126
+ * can be due to using too much memory, or by causing
22127
+ * significant slowdown or hang.
22128
+ * To prevent shutdown, set the event's cancel property to
22129
+ * true.
22130
+ *
22131
+ * This property can be read in early-execution mode.
22132
+ *
22133
+ */
22134
+ readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
20047
22135
  }
20048
22136
 
20049
22137
  /**
@@ -20122,6 +22210,73 @@ export class TargetBlockHitAfterEventSignal {
20122
22210
  unsubscribe(callback: (arg0: TargetBlockHitAfterEvent) => void): void;
20123
22211
  }
20124
22212
 
22213
+ /**
22214
+ * @beta
22215
+ * A primitive shape class that represents a text label in the
22216
+ * world with a background.
22217
+ */
22218
+ // @ts-ignore Class inheritance allowed for native defined classes
22219
+ export class TextPrimitive extends PrimitiveShape {
22220
+ /**
22221
+ * @remarks
22222
+ * If set to true, the text primitive will render the back-face
22223
+ * of the background. Defaults to true but will always be false
22224
+ * if 'useRotation' is set to false.
22225
+ *
22226
+ */
22227
+ backfaceVisible: boolean;
22228
+ /**
22229
+ * @remarks
22230
+ * The color of the background plate of the text. If set to
22231
+ * undefined, it will use the default color.
22232
+ *
22233
+ */
22234
+ backgroundColorOverride?: RGBA;
22235
+ /**
22236
+ * @remarks
22237
+ * If set to true, the text will be hidden behind blocks or
22238
+ * entities. By default this is set to false (will always
22239
+ * render).
22240
+ *
22241
+ */
22242
+ depthTest: boolean;
22243
+ /**
22244
+ * @remarks
22245
+ * Get the text of the debug text shape. Returns the RawText of
22246
+ * the debug text if `setText` was called with a RawMessage or
22247
+ * a RawText object, otherwise returns a string.
22248
+ *
22249
+ */
22250
+ readonly text: RawMessage | string;
22251
+ /**
22252
+ * @remarks
22253
+ * If set to true, the text primitive will render the back-face
22254
+ * of the text. Defaults to true but will always be false if
22255
+ * 'useRotation' is set to false.
22256
+ *
22257
+ */
22258
+ textBackfaceVisible: boolean;
22259
+ /**
22260
+ * @remarks
22261
+ * If set to true, the text will not face the camera and
22262
+ * instead will use the rotation from the shape.
22263
+ *
22264
+ */
22265
+ useRotation: boolean;
22266
+ constructor(location: DimensionLocation | Vector3, text: RawMessage | string);
22267
+ /**
22268
+ * @remarks
22269
+ * Sets the text to display.
22270
+ *
22271
+ * @throws This function can throw errors.
22272
+ *
22273
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
22274
+ *
22275
+ * {@link RawMessageError}
22276
+ */
22277
+ setText(text: RawMessage | string): void;
22278
+ }
22279
+
20125
22280
  /**
20126
22281
  * This manager is used to add, remove or query temporary
20127
22282
  * ticking areas to a dimension. These ticking areas are
@@ -20363,6 +22518,151 @@ export class TripWireTripAfterEventSignal {
20363
22518
  unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
20364
22519
  }
20365
22520
 
22521
+ /**
22522
+ * @beta
22523
+ * Contains information related to a script watchdog
22524
+ * termination.
22525
+ */
22526
+ export class WatchdogTerminateBeforeEvent {
22527
+ private constructor();
22528
+ /**
22529
+ * @remarks
22530
+ * If set to true, cancels the termination of the script
22531
+ * runtime. Note that depending on server configuration
22532
+ * settings, cancellation of the termination may not be
22533
+ * allowed.
22534
+ *
22535
+ */
22536
+ cancel: boolean;
22537
+ /**
22538
+ * @remarks
22539
+ * Contains the reason why a script runtime is to be
22540
+ * terminated.
22541
+ *
22542
+ */
22543
+ readonly terminateReason: WatchdogTerminateReason;
22544
+ }
22545
+
22546
+ /**
22547
+ * @beta
22548
+ * Manages callbacks that are connected to a callback that will
22549
+ * be called when a script runtime is being terminated due to a
22550
+ * violation of the performance watchdog system.
22551
+ */
22552
+ export class WatchdogTerminateBeforeEventSignal {
22553
+ private constructor();
22554
+ /**
22555
+ * @remarks
22556
+ * Adds a callback that will be called when a script runtime is
22557
+ * being terminated due to a violation of the performance
22558
+ * watchdog system.
22559
+ *
22560
+ * This function can't be called in restricted-execution mode.
22561
+ *
22562
+ * This function can be called in early-execution mode.
22563
+ *
22564
+ * @param callback
22565
+ * This closure is called with restricted-execution privilege.
22566
+ * @returns
22567
+ * Closure that is called with restricted-execution privilege.
22568
+ */
22569
+ subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
22570
+ /**
22571
+ * @remarks
22572
+ * Removes a callback from being called when a script runtime
22573
+ * is being terminated due to a violation of the performance
22574
+ * watchdog system.
22575
+ *
22576
+ * This function can't be called in restricted-execution mode.
22577
+ *
22578
+ * This function can be called in early-execution mode.
22579
+ *
22580
+ * @param callback
22581
+ * This closure is called with restricted-execution privilege.
22582
+ */
22583
+ unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
22584
+ }
22585
+
22586
+ /**
22587
+ * @beta
22588
+ * Base class for waypoints displayed on the player's locator
22589
+ * bar. Waypoints can track locations or entities and are
22590
+ * rendered with customizable textures and colors.
22591
+ *
22592
+ * Waypoints act as shared handles that can be added to
22593
+ * multiple players' locator bars. When you modify a waypoint's
22594
+ * properties (such as color, texture, or enabled state), the
22595
+ * changes are reflected for all players who have that waypoint
22596
+ * in their locator bar. This allows you to efficiently manage
22597
+ * waypoints across multiple players without creating separate
22598
+ * instances for each player.
22599
+ */
22600
+ export class Waypoint {
22601
+ private constructor();
22602
+ /**
22603
+ * @remarks
22604
+ * Optional {@link RGB} color tint applied to the waypoint
22605
+ * icon. If not specified, the waypoint uses its default color.
22606
+ *
22607
+ * This property can't be edited in restricted-execution mode.
22608
+ *
22609
+ */
22610
+ color?: RGB;
22611
+ /**
22612
+ * @remarks
22613
+ * Controls whether the waypoint is currently displayed on the
22614
+ * player's screen. When disabled, the waypoint is hidden but
22615
+ * remains valid.
22616
+ *
22617
+ * This property can't be edited in restricted-execution mode.
22618
+ *
22619
+ */
22620
+ isEnabled: boolean;
22621
+ /**
22622
+ * @remarks
22623
+ * Returns whether the waypoint is currently valid. A waypoint
22624
+ * becomes invalid when its tracked entity is no longer valid.
22625
+ *
22626
+ */
22627
+ readonly isValid: boolean;
22628
+ /**
22629
+ * @remarks
22630
+ * The {@link WaypointTextureSelector} that determines which
22631
+ * icon texture is displayed for the waypoint based on distance
22632
+ * or other criteria.
22633
+ *
22634
+ * This property can't be edited in restricted-execution mode.
22635
+ *
22636
+ */
22637
+ textureSelector: WaypointTextureSelector;
22638
+ /**
22639
+ * @remarks
22640
+ * Gets the current {@link DimensionLocation} of the waypoint.
22641
+ * For entity waypoints, this returns the entity's current
22642
+ * position. For location waypoints, this returns the stored
22643
+ * location.
22644
+ *
22645
+ * This function can't be called in restricted-execution mode.
22646
+ *
22647
+ * @throws This function can throw errors.
22648
+ *
22649
+ * {@link InvalidWaypointError}
22650
+ *
22651
+ * {@link InvalidWaypointTextureSelectorError}
22652
+ */
22653
+ getDimensionLocation(): DimensionLocation;
22654
+ /**
22655
+ * @remarks
22656
+ * Removes the waypoint from all locator bars it has been added
22657
+ * to. This affects all players who have this waypoint in their
22658
+ * locator bar.
22659
+ *
22660
+ * This function can't be called in restricted-execution mode.
22661
+ *
22662
+ */
22663
+ remove(): void;
22664
+ }
22665
+
20366
22666
  /**
20367
22667
  * Contains information related to changes in weather in the
20368
22668
  * environment.
@@ -20499,6 +22799,15 @@ export class World {
20499
22799
  *
20500
22800
  */
20501
22801
  readonly afterEvents: WorldAfterEvents;
22802
+ /**
22803
+ * @beta
22804
+ * @remarks
22805
+ * Enables or disables cheats.
22806
+ *
22807
+ * This property can't be edited in restricted-execution mode.
22808
+ *
22809
+ */
22810
+ allowCheats: boolean;
20502
22811
  /**
20503
22812
  * @remarks
20504
22813
  * Contains a set of events that are applicable to the entirety
@@ -20543,6 +22852,14 @@ export class World {
20543
22852
  */
20544
22853
  readonly gameRules: GameRules;
20545
22854
  readonly isHardcore: boolean;
22855
+ /**
22856
+ * @beta
22857
+ * @remarks
22858
+ * Manager for adding and removing primitive text objects in
22859
+ * the world.
22860
+ *
22861
+ */
22862
+ readonly primitiveShapesManager: PrimitiveShapesManager;
20546
22863
  /**
20547
22864
  * @remarks
20548
22865
  * Returns the general global scoreboard that applies to the
@@ -20568,7 +22885,21 @@ export class World {
20568
22885
  * ticking areas.
20569
22886
  *
20570
22887
  */
20571
- readonly tickingAreaManager: TickingAreaManager;
22888
+ readonly tickingAreaManager: TickingAreaManager;
22889
+ /**
22890
+ * @beta
22891
+ * @remarks
22892
+ * A method that is internal-only, used for broadcasting
22893
+ * specific messages between client and server.
22894
+ *
22895
+ * This function can't be called in restricted-execution mode.
22896
+ *
22897
+ * @param id
22898
+ * The message identifier.
22899
+ * @param value
22900
+ * The message.
22901
+ */
22902
+ broadcastClientMessage(id: string, value: string): void;
20572
22903
  /**
20573
22904
  * @remarks
20574
22905
  * Clears the set of dynamic properties declared for this
@@ -20762,6 +23093,15 @@ export class World {
20762
23093
  *
20763
23094
  */
20764
23095
  getMoonPhase(): MoonPhase;
23096
+ /**
23097
+ * @beta
23098
+ * @remarks
23099
+ * Returns a map of pack setting name and value pairs.
23100
+ *
23101
+ * This function can be called in early-execution mode.
23102
+ *
23103
+ */
23104
+ getPackSettings(): Record<string, boolean | number | string>;
20765
23105
  /**
20766
23106
  * @remarks
20767
23107
  * Returns a set of players based on a set of conditions
@@ -21052,6 +23392,16 @@ export class WorldAfterEvents {
21052
23392
  *
21053
23393
  */
21054
23394
  readonly buttonPush: ButtonPushAfterEventSignal;
23395
+ /**
23396
+ * @beta
23397
+ * @remarks
23398
+ * This event is triggered after a chat message has been
23399
+ * broadcast or sent to players.
23400
+ *
23401
+ * This property can be read in early-execution mode.
23402
+ *
23403
+ */
23404
+ readonly chatSend: ChatSendAfterEventSignal;
21055
23405
  /**
21056
23406
  * @remarks
21057
23407
  * This event is fired when an entity event has been triggered
@@ -21178,6 +23528,13 @@ export class WorldAfterEvents {
21178
23528
  *
21179
23529
  */
21180
23530
  readonly entitySpawn: EntitySpawnAfterEventSignal;
23531
+ /**
23532
+ * @beta
23533
+ * @remarks
23534
+ * This property can be read in early-execution mode.
23535
+ *
23536
+ */
23537
+ readonly entityUpgrade: EntityUpgradeAfterEventSignal;
21181
23538
  /**
21182
23539
  * @remarks
21183
23540
  * This event is fired after an explosion occurs.
@@ -21267,6 +23624,25 @@ export class WorldAfterEvents {
21267
23624
  *
21268
23625
  */
21269
23626
  readonly leverAction: LeverActionAfterEventSignal;
23627
+ /**
23628
+ * @beta
23629
+ * @remarks
23630
+ * This event is an internal implementation detail, and is
23631
+ * otherwise not currently functional.
23632
+ *
23633
+ * This property can be read in early-execution mode.
23634
+ *
23635
+ */
23636
+ readonly messageReceive: ServerMessageAfterEventSignal;
23637
+ /**
23638
+ * @beta
23639
+ * @remarks
23640
+ * This event is triggered when a pack setting is changed.
23641
+ *
23642
+ * This property can be read in early-execution mode.
23643
+ *
23644
+ */
23645
+ readonly packSettingChange: PackSettingChangeAfterEventSignal;
21270
23646
  /**
21271
23647
  * @remarks
21272
23648
  * This event fires when a piston expands or retracts.
@@ -21403,6 +23779,16 @@ export class WorldAfterEvents {
21403
23779
  *
21404
23780
  */
21405
23781
  readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
23782
+ /**
23783
+ * @beta
23784
+ * @remarks
23785
+ * An event for when a player uses a named name tag on an
23786
+ * entity.
23787
+ *
23788
+ * This property can be read in early-execution mode.
23789
+ *
23790
+ */
23791
+ readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
21406
23792
  /**
21407
23793
  * @remarks
21408
23794
  * A pressure plate has popped back up (i.e., there are no
@@ -21479,6 +23865,43 @@ export class WorldAfterEvents {
21479
23865
  */
21480
23866
  export class WorldBeforeEvents {
21481
23867
  private constructor();
23868
+ /**
23869
+ * @beta
23870
+ * @remarks
23871
+ * This event is triggered after a chat message has been
23872
+ * broadcast or sent to players.
23873
+ *
23874
+ * This property can be read in early-execution mode.
23875
+ *
23876
+ * @example customCommand.ts
23877
+ * ```typescript
23878
+ * import { world, DimensionLocation } from '@minecraft/server';
23879
+ *
23880
+ * function customCommand(targetLocation: DimensionLocation) {
23881
+ * const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
23882
+ * if (eventData.message.includes('cancel')) {
23883
+ * // Cancel event if the message contains "cancel"
23884
+ * eventData.cancel = true;
23885
+ * } else {
23886
+ * const args = eventData.message.split(' ');
23887
+ *
23888
+ * if (args.length > 0) {
23889
+ * switch (args[0].toLowerCase()) {
23890
+ * case 'echo':
23891
+ * // Send a modified version of chat message
23892
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
23893
+ * break;
23894
+ * case 'help':
23895
+ * world.sendMessage(`Available commands: echo <message>`);
23896
+ * break;
23897
+ * }
23898
+ * }
23899
+ * }
23900
+ * });
23901
+ * }
23902
+ * ```
23903
+ */
23904
+ readonly chatSend: ChatSendBeforeEventSignal;
21482
23905
  /**
21483
23906
  * @remarks
21484
23907
  * This event is triggered after an event has been added to an
@@ -21572,6 +23995,15 @@ export class WorldBeforeEvents {
21572
23995
  *
21573
23996
  */
21574
23997
  readonly playerLeave: PlayerLeaveBeforeEventSignal;
23998
+ /**
23999
+ * @beta
24000
+ * @remarks
24001
+ * This event fires before a block is placed by a player.
24002
+ *
24003
+ * This property can be read in early-execution mode.
24004
+ *
24005
+ */
24006
+ readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
21575
24007
  /**
21576
24008
  * @remarks
21577
24009
  * This property can be read in early-execution mode.
@@ -21649,13 +24081,27 @@ export interface BiomeFilter {
21649
24081
  includeTags?: string[];
21650
24082
  }
21651
24083
 
24084
+ /**
24085
+ * @beta
24086
+ * Contains additional options for searches for the
24087
+ * dimension.findNearestBiome API.
24088
+ */
24089
+ export interface BiomeSearchOptions {
24090
+ /**
24091
+ * @remarks
24092
+ * Bounding volume size to look within.
24093
+ *
24094
+ */
24095
+ boundingSize?: Vector3;
24096
+ }
24097
+
21652
24098
  /**
21653
24099
  * A BlockBoundingBox is an interface to an object which
21654
24100
  * represents an AABB aligned rectangle.
21655
24101
  * The BlockBoundingBox assumes that it was created in a valid
21656
24102
  * state (min <= max) but cannot guarantee it (unless it was
21657
- * created using the associated {@link
21658
- * @minecraft/server.BlockBoundingBoxUtils} utility functions.
24103
+ * created using the associated {@link BlockBoundingBoxUtils}
24104
+ * utility functions.
21659
24105
  * The min/max coordinates represent the diametrically opposite
21660
24106
  * corners of the rectangle.
21661
24107
  * The BlockBoundingBox is not a representation of blocks - it
@@ -21715,6 +24161,10 @@ export interface BlockCustomComponent {
21715
24161
  *
21716
24162
  */
21717
24163
  beforeOnPlayerPlace?: (arg0: BlockComponentPlayerPlaceBeforeEvent, arg1: CustomComponentParameters) => void;
24164
+ /**
24165
+ * @beta
24166
+ */
24167
+ onBlockStateChange?: (arg0: BlockComponentBlockStateChangeEvent, arg1: CustomComponentParameters) => void;
21718
24168
  /**
21719
24169
  * @remarks
21720
24170
  * This function will be called when a specific block is
@@ -22102,6 +24552,40 @@ export interface CameraTargetOptions {
22102
24552
  targetEntity: Entity;
22103
24553
  }
22104
24554
 
24555
+ /**
24556
+ * @beta
24557
+ * This interface defines an entry into the {@link
24558
+ * CompoundBlockVolume} which represents a volume of positive
24559
+ * or negative space.
24560
+ *
24561
+ */
24562
+ export interface CompoundBlockVolumeItem {
24563
+ /**
24564
+ * @remarks
24565
+ * The 'action' defines how the block volume is represented in
24566
+ * the compound block volume stack.
24567
+ * 'Add' creates a block volume which is positively selected
24568
+ * 'Subtract' creates a block volume which represents a hole or
24569
+ * negative space in the overall compound block volume.
24570
+ *
24571
+ */
24572
+ action?: CompoundBlockVolumeAction;
24573
+ /**
24574
+ * @remarks
24575
+ * The relativity enumeration determines whether the
24576
+ * BlockVolume specified is positioned relative to the parent
24577
+ * compound block volume origin, or in absolute world space.
24578
+ *
24579
+ */
24580
+ locationRelativity?: CompoundBlockVolumePositionRelativity;
24581
+ /**
24582
+ * @remarks
24583
+ * The volume of space
24584
+ *
24585
+ */
24586
+ volume: BlockVolume;
24587
+ }
24588
+
22105
24589
  /**
22106
24590
  * @rc
22107
24591
  * Represents the source of a container access.
@@ -22213,6 +24697,15 @@ export interface CustomCommand {
22213
24697
  * command.
22214
24698
  */
22215
24699
  export interface CustomCommandParameter {
24700
+ /**
24701
+ * @beta
24702
+ * @remarks
24703
+ * Can be used to reference the enum name when {@link
24704
+ * CustomCommandParamType} is 'Enum'. Allows the parameter name
24705
+ * to be different from the enum name.
24706
+ *
24707
+ */
24708
+ enumName?: string;
22216
24709
  /**
22217
24710
  * @remarks
22218
24711
  * The name of parameter as it appears on the command line.
@@ -22246,6 +24739,35 @@ export interface CustomCommandResult {
22246
24739
  status: CustomCommandStatus;
22247
24740
  }
22248
24741
 
24742
+ /**
24743
+ * @beta
24744
+ */
24745
+ export interface CustomTexture {
24746
+ /**
24747
+ * @remarks
24748
+ * The height of the icon, in relative units. Value must be
24749
+ * between 0.0 and 1.0, inclusive.
24750
+ *
24751
+ * Bounds: [0, 1]
24752
+ */
24753
+ iconHeight: number;
24754
+ /**
24755
+ * @remarks
24756
+ * The width of the icon, in relative units. Value must be
24757
+ * between 0.0 and 1.0, inclusive.
24758
+ *
24759
+ * Bounds: [0, 1]
24760
+ */
24761
+ iconWidth: number;
24762
+ /**
24763
+ * @remarks
24764
+ * The resource path to the custom texture. This should be a
24765
+ * valid string path to a texture asset.
24766
+ *
24767
+ */
24768
+ path: string;
24769
+ }
24770
+
22249
24771
  /**
22250
24772
  * Contains a set of updates to the component definition state
22251
24773
  * of an entity.
@@ -22265,6 +24787,14 @@ export interface DefinitionModifier {
22265
24787
  *
22266
24788
  */
22267
24789
  removedComponentGroups: string[];
24790
+ /**
24791
+ * @beta
24792
+ * @remarks
24793
+ * The list of entity definition events that will be fired via
24794
+ * this update.
24795
+ *
24796
+ */
24797
+ triggers: Trigger[];
22268
24798
  }
22269
24799
 
22270
24800
  /**
@@ -23066,6 +25596,37 @@ export interface EntityRaycastOptions extends EntityFilter {
23066
25596
  maxDistance?: number;
23067
25597
  }
23068
25598
 
25599
+ /**
25600
+ * @beta
25601
+ * Controls when a waypoint is visible based on the state of
25602
+ * the entity it tracks. These rules allow filtering waypoint
25603
+ * visibility by entity conditions like sneaking, invisibility,
25604
+ * and death state.
25605
+ */
25606
+ export interface EntityVisibilityRules {
25607
+ /**
25608
+ * @remarks
25609
+ * Controls whether the waypoint is shown when the tracked
25610
+ * entity is dead. If undefined, defaults to true.
25611
+ *
25612
+ */
25613
+ showDead?: boolean;
25614
+ /**
25615
+ * @remarks
25616
+ * Controls whether the waypoint is shown when the tracked
25617
+ * entity is invisible. If undefined, defaults to true.
25618
+ *
25619
+ */
25620
+ showInvisible?: boolean;
25621
+ /**
25622
+ * @remarks
25623
+ * Controls whether the waypoint is shown when the tracked
25624
+ * entity is sneaking. If undefined, defaults to true.
25625
+ *
25626
+ */
25627
+ showSneaking?: boolean;
25628
+ }
25629
+
23069
25630
  /**
23070
25631
  * Equal to operator.
23071
25632
  */
@@ -23472,6 +26033,27 @@ export interface NotEqualsComparison {
23472
26033
  notEquals: boolean | number | string;
23473
26034
  }
23474
26035
 
26036
+ /**
26037
+ * @beta
26038
+ * Contains information about a player's party membership. This
26039
+ * object is a snapshot of the player's party state at the time
26040
+ * it was retrieved and is not kept up to date.
26041
+ */
26042
+ export interface PartyInfo {
26043
+ /**
26044
+ * @remarks
26045
+ * Whether this player is the leader of their party.
26046
+ *
26047
+ */
26048
+ isLeader: boolean;
26049
+ /**
26050
+ * @remarks
26051
+ * The unique identifier of the party this player belongs to.
26052
+ *
26053
+ */
26054
+ partyId: string;
26055
+ }
26056
+
23475
26057
  /**
23476
26058
  * Contains additional options for how an animation is played.
23477
26059
  */
@@ -23591,6 +26173,39 @@ export interface PlayerSwingEventOptions {
23591
26173
  swingSource?: EntitySwingSource;
23592
26174
  }
23593
26175
 
26176
+ /**
26177
+ * @beta
26178
+ * Controls when a waypoint is visible based on player-specific
26179
+ * states. Extends {@link EntityVisibilityRules} with
26180
+ * additional rules for player-only states like hidden mode and
26181
+ * spectator mode.
26182
+ */
26183
+ // @ts-ignore Class inheritance allowed for native defined classes
26184
+ export interface PlayerVisibilityRules extends EntityVisibilityRules {
26185
+ /**
26186
+ * @remarks
26187
+ * Controls whether the waypoint is shown when the tracked
26188
+ * player is hidden. If undefined, defaults to true.
26189
+ *
26190
+ */
26191
+ showHidden?: boolean;
26192
+ /**
26193
+ * @remarks
26194
+ * Controls whether the waypoint is shown when the tracked
26195
+ * player is in spectator mode. If undefined, defaults to true.
26196
+ *
26197
+ */
26198
+ showSpectator?: boolean;
26199
+ /**
26200
+ * @remarks
26201
+ * Controls whether the waypoint is shown when a spectator is
26202
+ * viewing another spectator player. If undefined, defaults to
26203
+ * true.
26204
+ *
26205
+ */
26206
+ showSpectatorToSpectator?: boolean;
26207
+ }
26208
+
23594
26209
  /**
23595
26210
  * Key frame that holds the progress of the camera animation.
23596
26211
  */
@@ -24287,6 +26902,60 @@ export interface VectorXZ {
24287
26902
  z: number;
24288
26903
  }
24289
26904
 
26905
+ /**
26906
+ * @beta
26907
+ * Defines a texture and the distance range in which it should
26908
+ * be displayed. Used within a {@link WaypointTextureSelector}
26909
+ * to create distance-based texture switching.
26910
+ */
26911
+ export interface WaypointTextureBounds {
26912
+ /**
26913
+ * @remarks
26914
+ * The lower distance bound for this texture. The texture is
26915
+ * displayed when the distance to the waypoint is greater than
26916
+ * this value. Value must be greater than or equal to 0.
26917
+ *
26918
+ * Minimum Value: 0
26919
+ */
26920
+ lowerBound: number;
26921
+ /**
26922
+ * @remarks
26923
+ * The {@link WaypointTexture} or {@link CustomTexture} to
26924
+ * display within this distance range.
26925
+ *
26926
+ */
26927
+ texture: CustomTexture | WaypointTexture;
26928
+ /**
26929
+ * @remarks
26930
+ * The upper distance bound for this texture. The texture is
26931
+ * displayed when the distance to the waypoint is less than or
26932
+ * equal to this value. If undefined, there is no upper limit.
26933
+ * Value must be greater than or equal to 0.
26934
+ *
26935
+ * Minimum Value: 0
26936
+ */
26937
+ upperBound?: number;
26938
+ }
26939
+
26940
+ /**
26941
+ * @beta
26942
+ * Defines how waypoint textures change based on distance.
26943
+ * Contains a list of texture bounds that determine which
26944
+ * texture is displayed at different distance ranges.
26945
+ */
26946
+ export interface WaypointTextureSelector {
26947
+ /**
26948
+ * @remarks
26949
+ * An array of {@link WaypointTextureBounds} that define which
26950
+ * textures are displayed at different distance ranges. The
26951
+ * system evaluates these bounds to determine the appropriate
26952
+ * texture based on the current distance to the waypoint. The
26953
+ * list has a maximum size limit of 16.
26954
+ *
26955
+ */
26956
+ textureBoundsList: WaypointTextureBounds[];
26957
+ }
26958
+
24290
26959
  /**
24291
26960
  * Contains additional options for a playSound occurrence.
24292
26961
  */
@@ -24422,6 +27091,48 @@ export class CustomComponentNameError extends Error {
24422
27091
  readonly reason: CustomComponentNameErrorReason;
24423
27092
  }
24424
27093
 
27094
+ /**
27095
+ * @beta
27096
+ * Thrown when trying to register a custom dimension with a
27097
+ * name that has already been registered.
27098
+ */
27099
+ // @ts-ignore Class inheritance allowed for native defined classes
27100
+ export class CustomDimensionAlreadyRegisteredError extends Error {
27101
+ private constructor();
27102
+ }
27103
+
27104
+ /**
27105
+ * @beta
27106
+ * Thrown when trying to register a custom dimension outside of
27107
+ * the system startup event.
27108
+ */
27109
+ // @ts-ignore Class inheritance allowed for native defined classes
27110
+ export class CustomDimensionInvalidRegistryError extends Error {
27111
+ private constructor();
27112
+ }
27113
+
27114
+ /**
27115
+ * @beta
27116
+ * Thrown when trying to register a custom dimension with a
27117
+ * name that contains invalid characters.
27118
+ */
27119
+ // @ts-ignore Class inheritance allowed for native defined classes
27120
+ export class CustomDimensionNameError extends Error {
27121
+ private constructor();
27122
+ }
27123
+
27124
+ /**
27125
+ * @beta
27126
+ * Thrown after using the /reload command when trying to
27127
+ * register a custom dimension that was not previously
27128
+ * registered. New custom dimensions cannot be added during a
27129
+ * reload.
27130
+ */
27131
+ // @ts-ignore Class inheritance allowed for native defined classes
27132
+ export class CustomDimensionReloadNewDimensionError extends Error {
27133
+ private constructor();
27134
+ }
27135
+
24425
27136
  // @ts-ignore Class inheritance allowed for native defined classes
24426
27137
  export class EnchantmentLevelOutOfBoundsError extends Error {
24427
27138
  private constructor();
@@ -24546,6 +27257,25 @@ export class InvalidStructureError extends Error {
24546
27257
  private constructor();
24547
27258
  }
24548
27259
 
27260
+ /**
27261
+ * @beta
27262
+ * Error thrown when attempting to perform operations on an
27263
+ * invalid waypoint. A waypoint becomes invalid when it is
27264
+ * removed or when the entity it tracks is no longer valid.
27265
+ */
27266
+ // @ts-ignore Class inheritance allowed for native defined classes
27267
+ export class InvalidWaypointError extends Error {
27268
+ private constructor();
27269
+ }
27270
+
27271
+ /**
27272
+ * @beta
27273
+ */
27274
+ // @ts-ignore Class inheritance allowed for native defined classes
27275
+ export class InvalidWaypointTextureSelectorError extends Error {
27276
+ private constructor();
27277
+ }
27278
+
24549
27279
  /**
24550
27280
  * Thrown when trying to register an item custom component with
24551
27281
  * a name that has already been registered.
@@ -24602,6 +27332,25 @@ export class LocationOutOfWorldBoundariesError extends Error {
24602
27332
  private constructor();
24603
27333
  }
24604
27334
 
27335
+ /**
27336
+ * @beta
27337
+ * Error thrown when a locator bar operation fails. Contains a
27338
+ * reason code indicating the specific cause of the error.
27339
+ */
27340
+ // @ts-ignore Class inheritance allowed for native defined classes
27341
+ export class LocatorBarError extends Error {
27342
+ private constructor();
27343
+ /**
27344
+ * @remarks
27345
+ * The {@link LocatorBarErrorReason} code that indicates why
27346
+ * the locator bar operation failed.
27347
+ *
27348
+ * This property can be read in early-execution mode.
27349
+ *
27350
+ */
27351
+ readonly reason: LocatorBarErrorReason;
27352
+ }
27353
+
24605
27354
  /**
24606
27355
  * Thrown when a name requires a namespace and an error occurs
24607
27356
  * when validating that namespace
@@ -24622,6 +27371,14 @@ export class PlaceJigsawError extends Error {
24622
27371
  private constructor();
24623
27372
  }
24624
27373
 
27374
+ /**
27375
+ * @beta
27376
+ */
27377
+ // @ts-ignore Class inheritance allowed for native defined classes
27378
+ export class PrimitiveShapeError extends Error {
27379
+ private constructor();
27380
+ }
27381
+
24625
27382
  // @ts-ignore Class inheritance allowed for native defined classes
24626
27383
  export class RawMessageError extends Error {
24627
27384
  private constructor();