@minecraft/server 2.10.0-rc.1.26.50-preview.20 → 2.11.0-beta.1.26.50-preview.20

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 +2256 -64
  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.10.0"
19
+ * "version": "2.11.0-beta"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -47,6 +47,10 @@ export enum AimAssistTargetMode {
47
47
  * function Block.getComponent.
48
48
  */
49
49
  export enum BlockComponentTypes {
50
+ /**
51
+ * @beta
52
+ */
53
+ DynamicProperties = 'minecraft:dynamic_properties',
50
54
  FluidContainer = 'minecraft:fluid_container',
51
55
  /**
52
56
  * @rc
@@ -216,6 +220,34 @@ export enum CameraShakeType {
216
220
  Rotational = 'Rotational',
217
221
  }
218
222
 
223
+ /**
224
+ * @beta
225
+ * An enumeration for the clone modes used when cloning blocks.
226
+ */
227
+ export enum CloneMode {
228
+ /**
229
+ * @remarks
230
+ * Clones the blocks from the source region to the destination,
231
+ * leaving the source intact.
232
+ *
233
+ */
234
+ Copy = 0,
235
+ /**
236
+ * @remarks
237
+ * Clones the blocks from the source region to the destination,
238
+ * allowing the source and destination regions to overlap.
239
+ *
240
+ */
241
+ ForceCopy = 1,
242
+ /**
243
+ * @remarks
244
+ * Clones the blocks from the source region to the destination
245
+ * and replaces the source region with air.
246
+ *
247
+ */
248
+ Move = 2,
249
+ }
250
+
219
251
  /**
220
252
  * The required permission level to execute the custom command.
221
253
  */
@@ -354,6 +386,13 @@ export enum CustomCommandErrorReason {
354
386
  *
355
387
  */
356
388
  RegistryReadOnly = 'RegistryReadOnly',
389
+ /**
390
+ * @beta
391
+ * @remarks
392
+ * Non enum type command parameters cannot use enumName.
393
+ *
394
+ */
395
+ UnexpectedEnumName = 'UnexpectedEnumName',
357
396
  }
358
397
 
359
398
  /**
@@ -1090,6 +1129,14 @@ export enum EntityComponentTypes {
1090
1129
  *
1091
1130
  */
1092
1131
  NavigationWalk = 'minecraft:navigation.walk',
1132
+ /**
1133
+ * @beta
1134
+ * @remarks
1135
+ * Adds NPC capabilities to an entity such as custom skin,
1136
+ * name, and dialogue interactions.
1137
+ *
1138
+ */
1139
+ Npc = 'minecraft:npc',
1093
1140
  /**
1094
1141
  * @remarks
1095
1142
  * When present on an entity, this entity is on fire.
@@ -1573,6 +1620,14 @@ export enum EntitySwingSource {
1573
1620
  * and mainhand slots.
1574
1621
  */
1575
1622
  export enum EquipmentSlot {
1623
+ /**
1624
+ * @beta
1625
+ * @remarks
1626
+ * The body slot. This slot is used to hold armor for
1627
+ * non-humanoid mobs.
1628
+ *
1629
+ */
1630
+ Body = 'Body',
1576
1631
  /**
1577
1632
  * @remarks
1578
1633
  * The chest slot. This slot is used to hold items such as
@@ -1842,6 +1897,14 @@ export enum GameRule {
1842
1897
  *
1843
1898
  */
1844
1899
  PlayersSleepingPercentage = 'playersSleepingPercentage',
1900
+ /**
1901
+ * @beta
1902
+ * @remarks
1903
+ * Controls which player waypoints are automatically added to
1904
+ * the players locator bar.
1905
+ *
1906
+ */
1907
+ PlayerWaypoints = 'playerWaypoints',
1845
1908
  /**
1846
1909
  * @remarks
1847
1910
  * Controls whether projectiles (entities with a projectile
@@ -2191,6 +2254,10 @@ export enum InputPermissionCategory {
2191
2254
  * function ItemStack.getComponent.
2192
2255
  */
2193
2256
  export enum ItemComponentTypes {
2257
+ /**
2258
+ * @beta
2259
+ */
2260
+ BlockDynamicProperties = 'minecraft:block_actor_dynamic_properties',
2194
2261
  /**
2195
2262
  * @remarks
2196
2263
  * The minecraft:book component.
@@ -2663,6 +2730,14 @@ export enum PlayerSplitScreenSlot {
2663
2730
  Third = 'Third',
2664
2731
  }
2665
2732
 
2733
+ /**
2734
+ * @beta
2735
+ */
2736
+ export enum PlayerWaypointsMode {
2737
+ Everyone = 'Everyone',
2738
+ Off = 'Off',
2739
+ }
2740
+
2666
2741
  /**
2667
2742
  * Contains objectives and participants for the scoreboard.
2668
2743
  */
@@ -2989,6 +3064,29 @@ export enum TintMethod {
2989
3064
  Water = 'Water',
2990
3065
  }
2991
3066
 
3067
+ /**
3068
+ * @beta
3069
+ * An enumeration with the reason that a watchdog is deciding
3070
+ * to terminate execution of a behavior packs' script.
3071
+ */
3072
+ export enum WatchdogTerminateReason {
3073
+ /**
3074
+ * @remarks
3075
+ * Script runtime for a behavior pack is terminated due to
3076
+ * non-responsiveness from script (a hang or infinite loop).
3077
+ *
3078
+ */
3079
+ Hang = 'Hang',
3080
+ /**
3081
+ * @remarks
3082
+ * Script runtime for a behavior pack is terminated due to a
3083
+ * stack overflow (a long, and potentially infinite) chain of
3084
+ * function calls.
3085
+ *
3086
+ */
3087
+ StackOverflow = 'StackOverflow',
3088
+ }
3089
+
2992
3090
  /**
2993
3091
  * Enum representing different texture icons that can be
2994
3092
  * displayed for waypoints on the locator bar.
@@ -3050,10 +3148,12 @@ export type BlockComponentReturnType<T extends string> = T extends keyof BlockCo
3050
3148
  : BlockCustomComponentInstance;
3051
3149
 
3052
3150
  export type BlockComponentTypeMap = {
3151
+ dynamic_properties: BlockDynamicPropertiesComponent;
3053
3152
  fluid_container: BlockFluidContainerComponent;
3054
3153
  instrument_sound: BlockInstrumentComponent;
3055
3154
  inventory: BlockInventoryComponent;
3056
3155
  map_color: BlockMapColorComponent;
3156
+ 'minecraft:dynamic_properties': BlockDynamicPropertiesComponent;
3057
3157
  'minecraft:fluid_container': BlockFluidContainerComponent;
3058
3158
  'minecraft:instrument_sound': BlockInstrumentComponent;
3059
3159
  'minecraft:inventory': BlockInventoryComponent;
@@ -3175,6 +3275,7 @@ export type EntityComponentTypeMap = {
3175
3275
  'minecraft:navigation.generic': EntityNavigationGenericComponent;
3176
3276
  'minecraft:navigation.hover': EntityNavigationHoverComponent;
3177
3277
  'minecraft:navigation.walk': EntityNavigationWalkComponent;
3278
+ 'minecraft:npc': EntityNpcComponent;
3178
3279
  'minecraft:onfire': EntityOnFireComponent;
3179
3280
  'minecraft:player.exhaustion': EntityExhaustionComponent;
3180
3281
  'minecraft:player.hunger': EntityHungerComponent;
@@ -3208,6 +3309,7 @@ export type EntityComponentTypeMap = {
3208
3309
  'navigation.generic': EntityNavigationGenericComponent;
3209
3310
  'navigation.hover': EntityNavigationHoverComponent;
3210
3311
  'navigation.walk': EntityNavigationWalkComponent;
3312
+ npc: EntityNpcComponent;
3211
3313
  onfire: EntityOnFireComponent;
3212
3314
  'player.exhaustion': EntityExhaustionComponent;
3213
3315
  'player.hunger': EntityHungerComponent;
@@ -3227,11 +3329,21 @@ export type EntityComponentTypeMap = {
3227
3329
  wants_jockey: EntityWantsJockeyComponent;
3228
3330
  };
3229
3331
 
3332
+ /**
3333
+ * @beta
3334
+ */
3335
+ export type EntityIdentifierType<T> = [T] extends [never]
3336
+ ? VanillaEntityIdentifier
3337
+ : T extends string
3338
+ ? VanillaEntityIdentifier | T
3339
+ : never;
3340
+
3230
3341
  export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
3231
3342
  ? ItemComponentTypeMap[T]
3232
3343
  : ItemCustomComponentInstance;
3233
3344
 
3234
3345
  export type ItemComponentTypeMap = {
3346
+ block_actor_dynamic_properties: ItemBlockDynamicPropertiesComponent;
3235
3347
  book: ItemBookComponent;
3236
3348
  compostable: ItemCompostableComponent;
3237
3349
  cooldown: ItemCooldownComponent;
@@ -3240,6 +3352,7 @@ export type ItemComponentTypeMap = {
3240
3352
  enchantable: ItemEnchantableComponent;
3241
3353
  food: ItemFoodComponent;
3242
3354
  inventory: ItemInventoryComponent;
3355
+ 'minecraft:block_actor_dynamic_properties': ItemBlockDynamicPropertiesComponent;
3243
3356
  'minecraft:book': ItemBookComponent;
3244
3357
  'minecraft:compostable': ItemCompostableComponent;
3245
3358
  'minecraft:cooldown': ItemCooldownComponent;
@@ -3252,6 +3365,15 @@ export type ItemComponentTypeMap = {
3252
3365
  potion: ItemPotionComponent;
3253
3366
  };
3254
3367
 
3368
+ /**
3369
+ * @beta
3370
+ */
3371
+ export type VanillaEntityIdentifier =
3372
+ | EntityType
3373
+ | minecraftvanilladata.MinecraftEntityTypes
3374
+ | `${minecraftvanilladata.MinecraftEntityTypes}`
3375
+ | `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
3376
+
3255
3377
  /**
3256
3378
  * Handle to an aim-assist category that exists in the
3257
3379
  * world.aimAssist registry.
@@ -3409,7 +3531,9 @@ export class AimAssistCategorySettings {
3409
3531
  * A record mapping block Ids to their priority settings.
3410
3532
  * Larger numbers have greater priority.
3411
3533
  */
3412
- setBlockPriorities(blockPriorities: Record<string, number>): void;
3534
+ setBlockPriorities(
3535
+ blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
3536
+ ): void;
3413
3537
  /**
3414
3538
  * @remarks
3415
3539
  * Sets the priority settings used for block targeting.
@@ -3428,7 +3552,9 @@ export class AimAssistCategorySettings {
3428
3552
  * A record mapping entity Ids to their priority settings.
3429
3553
  * Larger numbers have greater priority.
3430
3554
  */
3431
- setEntityPriorities(entityPriorities: Record<string, number>): void;
3555
+ setEntityPriorities(
3556
+ entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
3557
+ ): void;
3432
3558
  /**
3433
3559
  * @remarks
3434
3560
  * Sets the priority settings used for entity targeting.
@@ -3627,8 +3753,10 @@ export class AimAssistPresetSettings {
3627
3753
  *
3628
3754
  * This function can't be called in restricted-execution mode.
3629
3755
  *
3756
+ * @param targets
3757
+ * An array of block tags.
3630
3758
  */
3631
- setExcludedBlockTagTargets(blockTagTargets?: string[]): void;
3759
+ setExcludedBlockTagTargets(targets?: string[]): void;
3632
3760
  /**
3633
3761
  * @remarks
3634
3762
  * Sets the list of block Ids to exclude from aim assist
@@ -3636,8 +3764,10 @@ export class AimAssistPresetSettings {
3636
3764
  *
3637
3765
  * This function can't be called in restricted-execution mode.
3638
3766
  *
3767
+ * @param targets
3768
+ * An array of block Ids.
3639
3769
  */
3640
- setExcludedBlockTargets(blockTargets?: string[]): void;
3770
+ setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
3641
3771
  /**
3642
3772
  * @remarks
3643
3773
  * Sets the list of entity Ids to exclude from aim assist
@@ -3645,8 +3775,10 @@ export class AimAssistPresetSettings {
3645
3775
  *
3646
3776
  * This function can't be called in restricted-execution mode.
3647
3777
  *
3778
+ * @param targets
3779
+ * An array of entity Ids.
3648
3780
  */
3649
- setExcludedEntityTargets(entityTargets?: string[]): void;
3781
+ setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
3650
3782
  /**
3651
3783
  * @remarks
3652
3784
  * Sets the list of entity type families to exclude from aim
@@ -3654,8 +3786,10 @@ export class AimAssistPresetSettings {
3654
3786
  *
3655
3787
  * This function can't be called in restricted-execution mode.
3656
3788
  *
3789
+ * @param targets
3790
+ * An array of entity type families.
3657
3791
  */
3658
- setExcludedEntityTypeFamilyTargets(entityTypeFamilyTargets?: string[]): void;
3792
+ setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
3659
3793
  /**
3660
3794
  * @remarks
3661
3795
  * Sets the per-item aim-assist category Ids.
@@ -3666,7 +3800,7 @@ export class AimAssistPresetSettings {
3666
3800
  * A record mapping item Ids to aim-assist category Ids.
3667
3801
  * Category Ids must have a namespace.
3668
3802
  */
3669
- setItemSettings(itemSettings: Record<string, string>): void;
3803
+ setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
3670
3804
  /**
3671
3805
  * @remarks
3672
3806
  * Sets the list of item Ids that will target liquid blocks
@@ -3677,7 +3811,7 @@ export class AimAssistPresetSettings {
3677
3811
  * @param items
3678
3812
  * An array of item Ids.
3679
3813
  */
3680
- setLiquidTargetingItems(items?: string[]): void;
3814
+ setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
3681
3815
  }
3682
3816
 
3683
3817
  /**
@@ -3783,6 +3917,28 @@ export class AimAssistRegistry {
3783
3917
  getPresets(): AimAssistPreset[];
3784
3918
  }
3785
3919
 
3920
+ /**
3921
+ * @beta
3922
+ * Describes a single banner pattern, which includes a colour
3923
+ * and a pattern type.
3924
+ */
3925
+ export class BannerPattern {
3926
+ private constructor();
3927
+ /**
3928
+ * @remarks
3929
+ * The color to apply to this banner pattern.
3930
+ *
3931
+ */
3932
+ readonly color: string;
3933
+ /**
3934
+ * @remarks
3935
+ * The pattern type (e.g. gradient, chevron, cross, etc.) to
3936
+ * apply to the banner.
3937
+ *
3938
+ */
3939
+ readonly pattern: string;
3940
+ }
3941
+
3786
3942
  /**
3787
3943
  * Describes a type of biome.
3788
3944
  */
@@ -3876,6 +4032,20 @@ export class Block {
3876
4032
  * {@link LocationOutOfWorldBoundariesError}
3877
4033
  */
3878
4034
  readonly isLiquid: boolean;
4035
+ /**
4036
+ * @beta
4037
+ * @remarks
4038
+ * Returns true if this block is solid and impassible - (e.g.,
4039
+ * a cobblestone block and a diamond block are solid, while a
4040
+ * ladder block and a fence block are not).
4041
+ *
4042
+ * @throws This property can throw when used.
4043
+ *
4044
+ * {@link LocationInUnloadedChunkError}
4045
+ *
4046
+ * {@link LocationOutOfWorldBoundariesError}
4047
+ */
4048
+ readonly isSolid: boolean;
3879
4049
  /**
3880
4050
  * @remarks
3881
4051
  * Returns true if this reference to a block is still valid
@@ -4041,6 +4211,30 @@ export class Block {
4041
4211
  * {@link LocationOutOfWorldBoundariesError}
4042
4212
  */
4043
4213
  canContainLiquid(liquidType: LiquidType): boolean;
4214
+ /**
4215
+ * @beta
4216
+ * @remarks
4217
+ * Checks to see whether it is valid to place the specified
4218
+ * block type or block permutation, on a specified face on this
4219
+ * block.
4220
+ *
4221
+ * @param blockToPlace
4222
+ * Block type or block permutation to check placement for.
4223
+ * @param faceToPlaceOn
4224
+ * Optional specific face of this block to check placement
4225
+ * against.
4226
+ * @returns
4227
+ * Returns `true` if the block type or permutation can be
4228
+ * placed on this block, else `false`.
4229
+ * @throws This function can throw errors.
4230
+ *
4231
+ * {@link Error}
4232
+ *
4233
+ * {@link LocationInUnloadedChunkError}
4234
+ *
4235
+ * {@link LocationOutOfWorldBoundariesError}
4236
+ */
4237
+ canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
4044
4238
  /**
4045
4239
  * @remarks
4046
4240
  * Returns the {@link Vector3} of the center of this block on
@@ -4137,6 +4331,15 @@ export class Block {
4137
4331
  * {@link LocationInUnloadedChunkError}
4138
4332
  */
4139
4333
  getLightLevel(): number;
4334
+ /**
4335
+ * @beta
4336
+ * @throws This function can throw errors.
4337
+ *
4338
+ * {@link LocationInUnloadedChunkError}
4339
+ *
4340
+ * {@link LocationOutOfWorldBoundariesError}
4341
+ */
4342
+ getMapColor(): RGBA;
4140
4343
  /**
4141
4344
  * @rc
4142
4345
  * @remarks
@@ -4418,6 +4621,27 @@ export class Block {
4418
4621
  * {@link LocationOutOfWorldBoundariesError}
4419
4622
  */
4420
4623
  south(steps?: number): Block | undefined;
4624
+ /**
4625
+ * @beta
4626
+ * @remarks
4627
+ * Tries to set the block in the dimension to the state of the
4628
+ * permutation by first checking if the placement is valid.
4629
+ *
4630
+ * This function can't be called in restricted-execution mode.
4631
+ *
4632
+ * @param permutation
4633
+ * Permutation that contains a set of property states for the
4634
+ * Block.
4635
+ * @returns
4636
+ * Returns `true` if the block permutation data was
4637
+ * successfully set, else `false`.
4638
+ * @throws This function can throw errors.
4639
+ *
4640
+ * {@link LocationInUnloadedChunkError}
4641
+ *
4642
+ * {@link LocationOutOfWorldBoundariesError}
4643
+ */
4644
+ trySetPermutation(permutation: BlockPermutation): boolean;
4421
4645
  /**
4422
4646
  * @remarks
4423
4647
  * Returns the {@link Block} to the west of this block
@@ -4435,6 +4659,137 @@ export class Block {
4435
4659
  west(steps?: number): Block | undefined;
4436
4660
  }
4437
4661
 
4662
+ /**
4663
+ * @beta
4664
+ * Bounding Box Utils is a utility class that provides a number
4665
+ * of useful functions for the creation and utility of {@link
4666
+ * BlockBoundingBox} objects
4667
+ */
4668
+ export class BlockBoundingBoxUtils {
4669
+ private constructor();
4670
+ /**
4671
+ * @remarks
4672
+ * Create a validated instance of a {@link BlockBoundingBox}
4673
+ * where the min and max components are guaranteed to be (min
4674
+ * <= max)
4675
+ *
4676
+ * This function can't be called in restricted-execution mode.
4677
+ *
4678
+ * @param min
4679
+ * A corner world location
4680
+ * @param max
4681
+ * A corner world location diametrically opposite
4682
+ */
4683
+ static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
4684
+ /**
4685
+ * @remarks
4686
+ * Expand a {@link BlockBoundingBox} by a given amount along
4687
+ * each axis.
4688
+ * Sizes can be negative to perform contraction.
4689
+ * Note: corners can be inverted if the contraction size is
4690
+ * greater than the span, but the min/max relationship will
4691
+ * remain correct
4692
+ *
4693
+ * This function can't be called in restricted-execution mode.
4694
+ *
4695
+ * @returns
4696
+ * Return a new {@link BlockBoundingBox} object representing
4697
+ * the changes
4698
+ */
4699
+ static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
4700
+ /**
4701
+ * @remarks
4702
+ * Check if two {@link BlockBoundingBox} objects are identical
4703
+ *
4704
+ * This function can't be called in restricted-execution mode.
4705
+ *
4706
+ */
4707
+ static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4708
+ /**
4709
+ * @remarks
4710
+ * Expand the initial box object bounds to include the 2nd box
4711
+ * argument. The resultant {@link BlockBoundingBox} object
4712
+ * will be a BlockBoundingBox which exactly encompasses the two
4713
+ * boxes.
4714
+ *
4715
+ * This function can't be called in restricted-execution mode.
4716
+ *
4717
+ * @returns
4718
+ * A new {@link BlockBoundingBox} instance representing the
4719
+ * smallest possible bounding box which can encompass both
4720
+ */
4721
+ static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
4722
+ /**
4723
+ * @remarks
4724
+ * Calculate the center block of a given {@link
4725
+ * BlockBoundingBox} object.
4726
+ *
4727
+ * This function can't be called in restricted-execution mode.
4728
+ *
4729
+ * @returns
4730
+ * Note that {@link BlockBoundingBox} objects represent whole
4731
+ * blocks, so the center of boxes which have odd numbered
4732
+ * bounds are not mathematically centered...
4733
+ * i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
4734
+ * center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
4735
+ */
4736
+ static getCenter(box: BlockBoundingBox): Vector3;
4737
+ /**
4738
+ * @remarks
4739
+ * Calculate the BlockBoundingBox which represents the union
4740
+ * area of two intersecting BlockBoundingBoxes
4741
+ *
4742
+ * This function can't be called in restricted-execution mode.
4743
+ *
4744
+ */
4745
+ static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
4746
+ /**
4747
+ * @remarks
4748
+ * Get the Span of each of the BlockBoundingBox Axis components
4749
+ *
4750
+ * This function can't be called in restricted-execution mode.
4751
+ *
4752
+ */
4753
+ static getSpan(box: BlockBoundingBox): Vector3;
4754
+ /**
4755
+ * @remarks
4756
+ * Check to see if two BlockBoundingBox objects intersect
4757
+ *
4758
+ * This function can't be called in restricted-execution mode.
4759
+ *
4760
+ */
4761
+ static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4762
+ /**
4763
+ * @remarks
4764
+ * Check to see if a given coordinate is inside a
4765
+ * BlockBoundingBox
4766
+ *
4767
+ * This function can't be called in restricted-execution mode.
4768
+ *
4769
+ */
4770
+ static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
4771
+ /**
4772
+ * @remarks
4773
+ * Check to see if a BlockBoundingBox is valid (i.e. (min <=
4774
+ * max))
4775
+ *
4776
+ * This function can't be called in restricted-execution mode.
4777
+ *
4778
+ */
4779
+ static isValid(box: BlockBoundingBox): boolean;
4780
+ /**
4781
+ * @remarks
4782
+ * Move a BlockBoundingBox by a given amount
4783
+ *
4784
+ * This function can't be called in restricted-execution mode.
4785
+ *
4786
+ * @returns
4787
+ * Return a new BlockBoundingBox object which represents the
4788
+ * change
4789
+ */
4790
+ static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
4791
+ }
4792
+
4438
4793
  /**
4439
4794
  * Base type for components associated with blocks.
4440
4795
  */
@@ -4657,6 +5012,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
4657
5012
  // @ts-ignore Class inheritance allowed for native defined classes
4658
5013
  export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
4659
5014
  private constructor();
5015
+ /**
5016
+ * @beta
5017
+ * @remarks
5018
+ * The first update event for the redstone component.
5019
+ *
5020
+ */
5021
+ readonly firstUpdate: boolean;
4660
5022
  /**
4661
5023
  * @remarks
4662
5024
  * The redstone signal strength passing through this block. It
@@ -4849,45 +5211,149 @@ export class BlockCustomComponentInstance extends BlockComponent {
4849
5211
  }
4850
5212
 
4851
5213
  /**
4852
- * Contains information regarding an event that impacts a
4853
- * specific block.
5214
+ * @beta
5215
+ * Represents the dynamic properties of a block in the world.
5216
+ * Only available with block entities. Up to 1KB per content
5217
+ * pack, per block entity in their dynamic properties storage.
5218
+ * @example rememberPlayerInteraction.ts
5219
+ * ```typescript
5220
+ * import { system } from '@minecraft/server-v2';
5221
+ *
5222
+ * system.beforeEvents.startup.subscribe(initEvent => {
5223
+ * initEvent.blockComponentRegistry.registerCustomComponent('scripting_demo_pack:block_entity_onPlayerInteract', {
5224
+ * onPlayerInteract: e => {
5225
+ * if (e.player === undefined) {
5226
+ * return;
5227
+ * }
5228
+ *
5229
+ * const dynamicProperties = e.block.getComponent('minecraft:dynamic_properties');
5230
+ * if (!dynamicProperties) {
5231
+ * return;
5232
+ * }
5233
+ *
5234
+ * const lastInteractorValue = dynamicProperties.get('last_interactor');
5235
+ * const lastVisitor = typeof lastInteractorValue === 'string' ? lastInteractorValue : 'unknown';
5236
+ * const lastTick = Number(dynamicProperties.get('last_interact_tick') ?? system.currentTick);
5237
+ * const ticksAgo = Math.max(0, system.currentTick - lastTick);
5238
+ *
5239
+ * if (lastVisitor === e.player.name) {
5240
+ * e.player.sendMessage("do you remember that player? I 'member, it was here " + String(ticksAgo) + ' ticks ago!');
5241
+ * } else {
5242
+ * e.player.sendMessage("oh, I don't remember that player");
5243
+ * }
5244
+ *
5245
+ * dynamicProperties.set('last_interactor', e.player.name);
5246
+ * dynamicProperties.set('last_interact_tick', system.currentTick);
5247
+ * },
5248
+ * });
5249
+ * });
5250
+ * ```
4854
5251
  */
4855
- export class BlockEvent {
5252
+ // @ts-ignore Class inheritance allowed for native defined classes
5253
+ export class BlockDynamicPropertiesComponent extends BlockComponent {
4856
5254
  private constructor();
5255
+ static readonly componentId = 'minecraft:dynamic_properties';
4857
5256
  /**
4858
5257
  * @remarks
4859
- * Block currently in the world at the location of this event.
5258
+ * Returns a DynamicProperty that was stored with the provided
5259
+ * key. Keys are unique to each content pack and cannot be used
5260
+ * to retrieve dynamic properties set from other content packs.
5261
+ * Returns undefined if the key was not found.
4860
5262
  *
4861
- */
4862
- readonly block: Block;
4863
- /**
4864
- * @remarks
4865
- * Dimension that contains the block that is the subject of
4866
- * this event.
5263
+ * @throws This function can throw errors.
5264
+ *
5265
+ * {@link Error}
5266
+ *
5267
+ * {@link InvalidBlockComponentError}
5268
+ *
5269
+ * {@link LocationInUnloadedChunkError}
4867
5270
  *
5271
+ * {@link LocationOutOfWorldBoundariesError}
4868
5272
  */
4869
- readonly dimension: Dimension;
4870
- }
4871
-
4872
- /**
4873
- * Contains information regarding an explosion that has
4874
- * occurred for a specific block.
4875
- */
4876
- // @ts-ignore Class inheritance allowed for native defined classes
4877
- export class BlockExplodeAfterEvent extends BlockEvent {
4878
- private constructor();
5273
+ get(key: string): boolean | number | string | Vector3 | undefined;
4879
5274
  /**
4880
5275
  * @remarks
4881
- * Description of the block that has exploded.
5276
+ * Sets a dynamic property with the provided key and value.
5277
+ * Keys are unique to each content pack and cannot be used to
5278
+ * set dynamic properties for other content packs. Values can
5279
+ * be either a Number, a String or a Vector3. Setting a
5280
+ * property with an undefined value will remove it from the
5281
+ * storage. Storage size usage is counted towards the 1KBytes
5282
+ * limit per content pack.
5283
+ *
5284
+ * This function can't be called in restricted-execution mode.
5285
+ *
5286
+ * @throws This function can throw errors.
5287
+ *
5288
+ * {@link Error}
5289
+ *
5290
+ * {@link InvalidBlockComponentError}
5291
+ *
5292
+ * {@link LocationInUnloadedChunkError}
4882
5293
  *
5294
+ * {@link LocationOutOfWorldBoundariesError}
4883
5295
  */
4884
- readonly explodedBlockPermutation: BlockPermutation;
5296
+ set(key: string, value?: boolean | number | string | Vector3): void;
4885
5297
  /**
4886
5298
  * @remarks
4887
- * Optional source of the explosion.
5299
+ * Returns the current size, in bytes, of the dynamic
5300
+ * properties storage for this block entity. The byte count
5301
+ * only accounts for properties set by your content pack. The
5302
+ * 1KBytes limit is per content pack.
4888
5303
  *
4889
- */
4890
- readonly source?: Entity;
5304
+ * @throws This function can throw errors.
5305
+ *
5306
+ * {@link Error}
5307
+ *
5308
+ * {@link InvalidBlockComponentError}
5309
+ *
5310
+ * {@link LocationInUnloadedChunkError}
5311
+ *
5312
+ * {@link LocationOutOfWorldBoundariesError}
5313
+ */
5314
+ totalByteCount(): number;
5315
+ }
5316
+
5317
+ /**
5318
+ * Contains information regarding an event that impacts a
5319
+ * specific block.
5320
+ */
5321
+ export class BlockEvent {
5322
+ private constructor();
5323
+ /**
5324
+ * @remarks
5325
+ * Block currently in the world at the location of this event.
5326
+ *
5327
+ */
5328
+ readonly block: Block;
5329
+ /**
5330
+ * @remarks
5331
+ * Dimension that contains the block that is the subject of
5332
+ * this event.
5333
+ *
5334
+ */
5335
+ readonly dimension: Dimension;
5336
+ }
5337
+
5338
+ /**
5339
+ * Contains information regarding an explosion that has
5340
+ * occurred for a specific block.
5341
+ */
5342
+ // @ts-ignore Class inheritance allowed for native defined classes
5343
+ export class BlockExplodeAfterEvent extends BlockEvent {
5344
+ private constructor();
5345
+ /**
5346
+ * @remarks
5347
+ * Description of the block that has exploded.
5348
+ *
5349
+ */
5350
+ readonly explodedBlockPermutation: BlockPermutation;
5351
+ /**
5352
+ * @remarks
5353
+ * Optional source of the explosion.
5354
+ *
5355
+ */
5356
+ readonly source?: Entity;
4891
5357
  }
4892
5358
 
4893
5359
  /**
@@ -5109,6 +5575,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
5109
5575
  *
5110
5576
  */
5111
5577
  [Symbol.iterator](): Iterator<Vector3>;
5578
+ /**
5579
+ * @beta
5580
+ * @remarks
5581
+ * Checks if the underlining block volume has been invalidated.
5582
+ * Will return false if the block volume was modified between
5583
+ * creating the iterator and iterating it, and true otherwise.
5584
+ *
5585
+ * @throws This function can throw errors.
5586
+ *
5587
+ * {@link minecraftcommon.EngineError}
5588
+ */
5589
+ isValid(): boolean;
5112
5590
  /**
5113
5591
  * @remarks
5114
5592
  * This function can't be called in restricted-execution mode.
@@ -6024,6 +6502,15 @@ export class BlockVolumeBase {
6024
6502
  *
6025
6503
  */
6026
6504
  getBlockLocationIterator(): BlockLocationIterator;
6505
+ /**
6506
+ * @beta
6507
+ * @remarks
6508
+ * Return a {@link BlockBoundingBox} object which represents
6509
+ * the validated min and max coordinates of the volume
6510
+ *
6511
+ * @throws This function can throw errors.
6512
+ */
6513
+ getBoundingBox(): BlockBoundingBox;
6027
6514
  /**
6028
6515
  * @remarks
6029
6516
  * Return the capacity (volume) of the BlockVolume (W*D*H)
@@ -6298,6 +6785,23 @@ export class Camera {
6298
6785
  | CameraSetRotOptions
6299
6786
  | CameraTargetOptions,
6300
6787
  ): void;
6788
+ /**
6789
+ * @beta
6790
+ * @remarks
6791
+ * Sets the current active camera with easing.
6792
+ *
6793
+ * This function can't be called in restricted-execution mode.
6794
+ *
6795
+ * @param cameraPreset
6796
+ * Identifier of a camera preset file defined within JSON.
6797
+ * @param easeOptions
6798
+ * Options to ease the camera from the previous camera to the
6799
+ * current one.
6800
+ * @throws
6801
+ * Throws when easing to minecraft:first_person presets
6802
+ * currently without the experimental cameras toggle enabled.
6803
+ */
6804
+ setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
6301
6805
  /**
6302
6806
  * @remarks
6303
6807
  * Sets the current active camera for the specified player and
@@ -6333,6 +6837,24 @@ export class Camera {
6333
6837
  stopShaking(): void;
6334
6838
  }
6335
6839
 
6840
+ /**
6841
+ * @beta
6842
+ * Loot item function that will try to copy the block entity
6843
+ * data from the destroyed block to the dropped item.
6844
+ */
6845
+ // @ts-ignore Class inheritance allowed for native defined classes
6846
+ export class CarryOverBlockEntityDataFunction extends LootItemFunction {
6847
+ private constructor();
6848
+ /**
6849
+ * @remarks
6850
+ * If true, and if the block entity had dynamic_properties, the
6851
+ * function will copy the dynamic properties from the block
6852
+ * entity to the dropped item.
6853
+ *
6854
+ */
6855
+ readonly dynamicProperties: boolean;
6856
+ }
6857
+
6336
6858
  /**
6337
6859
  * CatmullRom spline creation.
6338
6860
  */
@@ -6347,6 +6869,164 @@ export class CatmullRomSpline {
6347
6869
  controlPoints: Vector3[];
6348
6870
  }
6349
6871
 
6872
+ /**
6873
+ * @beta
6874
+ * An event that fires as players enter chat messages.
6875
+ */
6876
+ export class ChatSendAfterEvent {
6877
+ private constructor();
6878
+ /**
6879
+ * @remarks
6880
+ * Message that is being broadcast.
6881
+ *
6882
+ */
6883
+ readonly message: string;
6884
+ /**
6885
+ * @remarks
6886
+ * Player that sent the chat message.
6887
+ *
6888
+ */
6889
+ readonly sender: Player;
6890
+ /**
6891
+ * @remarks
6892
+ * Optional list of players that will receive this message. If
6893
+ * defined, this message is directly targeted to one or more
6894
+ * players (i.e., is not broadcast.)
6895
+ *
6896
+ */
6897
+ readonly targets?: Player[];
6898
+ }
6899
+
6900
+ /**
6901
+ * @beta
6902
+ * Manages callbacks that are connected to chat messages being
6903
+ * sent.
6904
+ */
6905
+ export class ChatSendAfterEventSignal {
6906
+ private constructor();
6907
+ /**
6908
+ * @remarks
6909
+ * Adds a callback that will be called when new chat messages
6910
+ * are sent.
6911
+ *
6912
+ * This function can't be called in restricted-execution mode.
6913
+ *
6914
+ * This function can be called in early-execution mode.
6915
+ *
6916
+ */
6917
+ subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
6918
+ /**
6919
+ * @remarks
6920
+ * Removes a callback from being called when new chat messages
6921
+ * are sent.
6922
+ *
6923
+ * This function can't be called in restricted-execution mode.
6924
+ *
6925
+ * This function can be called in early-execution mode.
6926
+ *
6927
+ */
6928
+ unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
6929
+ }
6930
+
6931
+ /**
6932
+ * @beta
6933
+ * An event that fires as players enter chat messages.
6934
+ */
6935
+ export class ChatSendBeforeEvent {
6936
+ private constructor();
6937
+ /**
6938
+ * @remarks
6939
+ * If set to true in a beforeChat event handler, this message
6940
+ * is not broadcast out.
6941
+ *
6942
+ */
6943
+ cancel: boolean;
6944
+ /**
6945
+ * @remarks
6946
+ * Message that is being broadcast.
6947
+ *
6948
+ */
6949
+ readonly message: string;
6950
+ /**
6951
+ * @remarks
6952
+ * Player that sent the chat message.
6953
+ *
6954
+ */
6955
+ readonly sender: Player;
6956
+ /**
6957
+ * @remarks
6958
+ * Optional list of players that will receive this message. If
6959
+ * defined, this message is directly targeted to one or more
6960
+ * players (i.e., is not broadcast.)
6961
+ *
6962
+ */
6963
+ readonly targets?: Player[];
6964
+ }
6965
+
6966
+ /**
6967
+ * @beta
6968
+ * Manages callbacks that are connected to an event that fires
6969
+ * before chat messages are sent.
6970
+ * @example customCommand.ts
6971
+ * ```typescript
6972
+ * import { world, DimensionLocation } from '@minecraft/server';
6973
+ *
6974
+ * function customCommand(targetLocation: DimensionLocation) {
6975
+ * const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
6976
+ * if (eventData.message.includes('cancel')) {
6977
+ * // Cancel event if the message contains "cancel"
6978
+ * eventData.cancel = true;
6979
+ * } else {
6980
+ * const args = eventData.message.split(' ');
6981
+ *
6982
+ * if (args.length > 0) {
6983
+ * switch (args[0].toLowerCase()) {
6984
+ * case 'echo':
6985
+ * // Send a modified version of chat message
6986
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
6987
+ * break;
6988
+ * case 'help':
6989
+ * world.sendMessage(`Available commands: echo <message>`);
6990
+ * break;
6991
+ * }
6992
+ * }
6993
+ * }
6994
+ * });
6995
+ * }
6996
+ * ```
6997
+ */
6998
+ export class ChatSendBeforeEventSignal {
6999
+ private constructor();
7000
+ /**
7001
+ * @remarks
7002
+ * Adds a callback that will be called before new chat messages
7003
+ * are sent.
7004
+ *
7005
+ * This function can't be called in restricted-execution mode.
7006
+ *
7007
+ * This function can be called in early-execution mode.
7008
+ *
7009
+ * @param callback
7010
+ * This closure is called with restricted-execution privilege.
7011
+ * @returns
7012
+ * Closure that is called with restricted-execution privilege.
7013
+ */
7014
+ subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
7015
+ /**
7016
+ * @remarks
7017
+ * Removes a callback from being called before new chat
7018
+ * messages are sent.
7019
+ *
7020
+ * This function can't be called in restricted-execution mode.
7021
+ *
7022
+ * This function can be called in early-execution mode.
7023
+ *
7024
+ * @param callback
7025
+ * This closure is called with restricted-execution privilege.
7026
+ */
7027
+ unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
7028
+ }
7029
+
6350
7030
  /**
6351
7031
  * Contains the device information for a client instance.
6352
7032
  */
@@ -6555,7 +7235,9 @@ export class Container {
6555
7235
  *
6556
7236
  * @param itemStack
6557
7237
  * The stack of items to add.
6558
- * @throws This function can throw errors.
7238
+ * @throws
7239
+ * Won't throw {@link ContainerRules} error for over weight
7240
+ * limit but will instead add items up to the weight limit.
6559
7241
  *
6560
7242
  * {@link ContainerRulesError}
6561
7243
  *
@@ -6793,6 +7475,8 @@ export class Container {
6793
7475
  * @throws
6794
7476
  * Throws if either this container or `toContainer` are invalid
6795
7477
  * or if the `fromSlot` or `toSlot` indices out of bounds.
7478
+ * Won't throw {@link ContainerRules} error for over weight
7479
+ * limit but will instead add items up to the weight limit.
6796
7480
  *
6797
7481
  * {@link ContainerRulesError}
6798
7482
  *
@@ -7451,6 +8135,40 @@ export class Dimension {
7451
8135
  biomeToFind: BiomeType | string,
7452
8136
  options?: BiomeSearchOptions,
7453
8137
  ): Vector3 | undefined;
8138
+ /**
8139
+ * @beta
8140
+ * @remarks
8141
+ * Clones a region of blocks from one area of the dimension to
8142
+ * another.
8143
+ *
8144
+ * This function can't be called in restricted-execution mode.
8145
+ *
8146
+ * @param beginLocation
8147
+ * The lower northwest starting corner of the area to clone
8148
+ * from.
8149
+ * @param endLocation
8150
+ * The upper southeast ending corner of the area to clone from.
8151
+ * @param destination
8152
+ * The lower northwest starting corner of the area to clone to.
8153
+ * @param cloneMode
8154
+ * Specifies how the cloned blocks should be placed at the
8155
+ * destination.
8156
+ * @param filter
8157
+ * An optional block filter used to include only matching
8158
+ * blocks from the source area.
8159
+ * @throws This function can throw errors.
8160
+ *
8161
+ * {@link Error}
8162
+ *
8163
+ * {@link LocationOutOfWorldBoundariesError}
8164
+ */
8165
+ cloneBlocks(
8166
+ beginLocation: Vector3,
8167
+ endLocation: Vector3,
8168
+ destination: Vector3,
8169
+ cloneMode: CloneMode,
8170
+ filter?: BlockFilter,
8171
+ ): void;
7454
8172
  /**
7455
8173
  * @remarks
7456
8174
  * Checks if an area contains the specified biomes. If the area
@@ -7691,10 +8409,14 @@ export class Dimension {
7691
8409
  /**
7692
8410
  * @rc
7693
8411
  * @remarks
7694
- * Gets all the blocks in a volume that satisfy the filter.
8412
+ * Gets all the blocks in a volume that satisfy the block query
8413
+ * options.
7695
8414
  *
7696
8415
  * @param volume
7697
8416
  * Volume of blocks that will be checked.
8417
+ * @param options
8418
+ * Block query options including filter criteria and optional
8419
+ * closest/farthest distance sorting from a location.
7698
8420
  * @param allowUnloadedChunks
7699
8421
  * If set to true will suppress the UnloadedChunksError if some
7700
8422
  * or all of the block volume is outside of the loaded chunks.
@@ -7703,7 +8425,7 @@ export class Dimension {
7703
8425
  * Defaults to: false
7704
8426
  * @returns
7705
8427
  * Returns the ListBlockVolume that contains all the block
7706
- * locations that satisfied the block filter.
8428
+ * locations that satisfied the block query options.
7707
8429
  * @throws This function can throw errors.
7708
8430
  *
7709
8431
  * {@link minecraftcommon.ArgumentOutOfBoundsError}
@@ -7828,6 +8550,26 @@ export class Dimension {
7828
8550
  * {@link minecraftcommon.UnsupportedFunctionalityError}
7829
8551
  */
7830
8552
  getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
8553
+ /**
8554
+ * @beta
8555
+ * @remarks
8556
+ * Returns a vector of generated structures that contain the
8557
+ * specified location (ex: Pillager Outpost, Mineshaft, etc.).
8558
+ * The vector will be empty if no structures are found.
8559
+ *
8560
+ * @param location
8561
+ * Location at which to check for structures.
8562
+ * @throws
8563
+ * An error will be thrown if the location is out of world
8564
+ * bounds.
8565
+ * An error will be thrown if the location is in an unloaded
8566
+ * chunk.
8567
+ *
8568
+ * {@link LocationInUnloadedChunkError}
8569
+ *
8570
+ * {@link LocationOutOfWorldBoundariesError}
8571
+ */
8572
+ getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
7831
8573
  /**
7832
8574
  * @remarks
7833
8575
  * Returns the total brightness level of light shining on a
@@ -7889,6 +8631,16 @@ export class Dimension {
7889
8631
  * @throws This function can throw errors.
7890
8632
  */
7891
8633
  getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
8634
+ /**
8635
+ * @beta
8636
+ * @remarks
8637
+ * Returns the current weather.
8638
+ *
8639
+ * @returns
8640
+ * Returns a WeatherType that explains the broad category of
8641
+ * weather that is currently going on.
8642
+ */
8643
+ getWeather(): WeatherType;
7892
8644
  /**
7893
8645
  * @remarks
7894
8646
  * Returns true if the chunk at the given location is loaded
@@ -8134,7 +8886,11 @@ export class Dimension {
8134
8886
  * }
8135
8887
  * ```
8136
8888
  */
8137
- spawnEntity(identifier: EntityType | string, location: Vector3, options?: SpawnEntityOptions): Entity;
8889
+ spawnEntity<T = never>(
8890
+ identifier: EntityIdentifierType<NoInfer<T>>,
8891
+ location: Vector3,
8892
+ options?: SpawnEntityOptions,
8893
+ ): Entity;
8138
8894
  /**
8139
8895
  * @remarks
8140
8896
  * Creates a new item stack as an entity at the specified
@@ -8229,6 +8985,46 @@ export class Dimension {
8229
8985
  * ```
8230
8986
  */
8231
8987
  spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
8988
+ /**
8989
+ * @beta
8990
+ * @remarks
8991
+ * Spawns an experience orb at a specified location in the
8992
+ * dimension.
8993
+ *
8994
+ * This function can't be called in restricted-execution mode.
8995
+ *
8996
+ * @param location
8997
+ * The location at which to spawn the experience orb.
8998
+ * @param amount
8999
+ * The amount of experience to give the experience orb.
9000
+ * Bounds: [1, 12000]
9001
+ * @throws This function can throw errors.
9002
+ *
9003
+ * {@link LocationInUnloadedChunkError}
9004
+ *
9005
+ * {@link LocationOutOfWorldBoundariesError}
9006
+ */
9007
+ spawnXp(location: Vector3, amount: number): void;
9008
+ /**
9009
+ * @beta
9010
+ * @remarks
9011
+ * Stops all sounds from playing for all players.
9012
+ *
9013
+ * This function can't be called in restricted-execution mode.
9014
+ *
9015
+ */
9016
+ stopAllSounds(): void;
9017
+ /**
9018
+ * @beta
9019
+ * @remarks
9020
+ * Stops a sound from playing for all players.
9021
+ *
9022
+ * This function can't be called in restricted-execution mode.
9023
+ *
9024
+ * @param soundId
9025
+ * Identifier of the sound.
9026
+ */
9027
+ stopSound(soundId: string): void;
8232
9028
  }
8233
9029
 
8234
9030
  /**
@@ -8808,6 +9604,18 @@ export class Entity {
8808
9604
  *
8809
9605
  */
8810
9606
  readonly scoreboardIdentity?: ScoreboardIdentity;
9607
+ /**
9608
+ * @beta
9609
+ * @remarks
9610
+ * Retrieves or sets an entity that is used as the target of
9611
+ * AI-related behaviors, like attacking. If the entity
9612
+ * currently has no target returns undefined.
9613
+ *
9614
+ * @throws This property can throw when used.
9615
+ *
9616
+ * {@link InvalidEntityError}
9617
+ */
9618
+ readonly target?: Entity;
8811
9619
  /**
8812
9620
  * @remarks
8813
9621
  * Identifier of the type of the entity - for example,
@@ -10049,11 +10857,23 @@ export class EntityBaseMovementComponent extends EntityComponent {
10049
10857
  export class EntityBreathableComponent extends EntityComponent {
10050
10858
  private constructor();
10051
10859
  /**
10860
+ * @beta
10052
10861
  * @remarks
10053
- * If true, this entity can breathe in air.
10862
+ * The current air supply of the entity.
10054
10863
  *
10055
- * @throws This property can throw when used.
10056
- */
10864
+ * This property can't be edited in restricted-execution mode.
10865
+ *
10866
+ * @throws
10867
+ * Will throw an error if the air supply is out of bounds
10868
+ * [suffocationTime, maxAirSupply].
10869
+ */
10870
+ airSupply: number;
10871
+ /**
10872
+ * @remarks
10873
+ * If true, this entity can breathe in air.
10874
+ *
10875
+ * @throws This property can throw when used.
10876
+ */
10057
10877
  readonly breathesAir: boolean;
10058
10878
  /**
10059
10879
  * @remarks
@@ -10076,6 +10896,14 @@ export class EntityBreathableComponent extends EntityComponent {
10076
10896
  * @throws This property can throw when used.
10077
10897
  */
10078
10898
  readonly breathesWater: boolean;
10899
+ /**
10900
+ * @beta
10901
+ * @remarks
10902
+ * If true, the entity is able to breathe.
10903
+ *
10904
+ * @throws This property can throw when used.
10905
+ */
10906
+ readonly canBreathe: boolean;
10079
10907
  /**
10080
10908
  * @remarks
10081
10909
  * If true, this entity will have visible bubbles while in
@@ -12026,6 +12854,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
12026
12854
  static readonly componentId = 'minecraft:navigation.walk';
12027
12855
  }
12028
12856
 
12857
+ /**
12858
+ * @beta
12859
+ * Adds NPC capabilities to an entity such as custom skin,
12860
+ * name, and dialogue interactions.
12861
+ */
12862
+ // @ts-ignore Class inheritance allowed for native defined classes
12863
+ export class EntityNpcComponent extends EntityComponent {
12864
+ private constructor();
12865
+ /**
12866
+ * @remarks
12867
+ * The DialogueScene that is opened when players first interact
12868
+ * with the NPC.
12869
+ *
12870
+ * This property can't be edited in restricted-execution mode.
12871
+ *
12872
+ */
12873
+ defaultScene: string;
12874
+ /**
12875
+ * @remarks
12876
+ * The name of the NPC as it is displayed to players.
12877
+ *
12878
+ * This property can't be edited in restricted-execution mode.
12879
+ *
12880
+ */
12881
+ name: string;
12882
+ /**
12883
+ * @remarks
12884
+ * The index of the skin the NPC will use.
12885
+ *
12886
+ * This property can't be edited in restricted-execution mode.
12887
+ *
12888
+ */
12889
+ skinIndex: number;
12890
+ static readonly componentId = 'minecraft:npc';
12891
+ }
12892
+
12029
12893
  /**
12030
12894
  * When present on an entity, this entity is on fire.
12031
12895
  * @example setOnFire.ts
@@ -12698,6 +13562,102 @@ export class EntitySpawnAfterEventSignal {
12698
13562
  unsubscribe(callback: (arg0: EntitySpawnAfterEvent) => void): void;
12699
13563
  }
12700
13564
 
13565
+ /**
13566
+ * @beta
13567
+ * Contains data related to an entity beginning to sneak.
13568
+ */
13569
+ export class EntityStartSneakingAfterEvent {
13570
+ private constructor();
13571
+ /**
13572
+ * @remarks
13573
+ * Entity that has started sneaking.
13574
+ *
13575
+ */
13576
+ readonly entity: Entity;
13577
+ }
13578
+
13579
+ /**
13580
+ * @beta
13581
+ * Manages callbacks that are connected to when an entity
13582
+ * begins sneaking.
13583
+ */
13584
+ export class EntityStartSneakingAfterEventSignal {
13585
+ private constructor();
13586
+ /**
13587
+ * @remarks
13588
+ * Adds a callback that will be called when an entity begins
13589
+ * sneaking.
13590
+ *
13591
+ * This function can't be called in restricted-execution mode.
13592
+ *
13593
+ * This function can be called in early-execution mode.
13594
+ *
13595
+ */
13596
+ subscribe(
13597
+ callback: (arg0: EntityStartSneakingAfterEvent) => void,
13598
+ options?: EntitySneakingChangedEventOptions,
13599
+ ): (arg0: EntityStartSneakingAfterEvent) => void;
13600
+ /**
13601
+ * @remarks
13602
+ * Removes a callback from being called when an entity begins
13603
+ * sneaking.
13604
+ *
13605
+ * This function can't be called in restricted-execution mode.
13606
+ *
13607
+ * This function can be called in early-execution mode.
13608
+ *
13609
+ */
13610
+ unsubscribe(callback: (arg0: EntityStartSneakingAfterEvent) => void): void;
13611
+ }
13612
+
13613
+ /**
13614
+ * @beta
13615
+ * Contains data related to an entity stopping sneaking.
13616
+ */
13617
+ export class EntityStopSneakingAfterEvent {
13618
+ private constructor();
13619
+ /**
13620
+ * @remarks
13621
+ * Entity that has stopped sneaking.
13622
+ *
13623
+ */
13624
+ readonly entity: Entity;
13625
+ }
13626
+
13627
+ /**
13628
+ * @beta
13629
+ * Manages callbacks that are connected to when an entity stops
13630
+ * sneaking.
13631
+ */
13632
+ export class EntityStopSneakingAfterEventSignal {
13633
+ private constructor();
13634
+ /**
13635
+ * @remarks
13636
+ * Adds a callback that will be called when an entity stops
13637
+ * sneaking.
13638
+ *
13639
+ * This function can't be called in restricted-execution mode.
13640
+ *
13641
+ * This function can be called in early-execution mode.
13642
+ *
13643
+ */
13644
+ subscribe(
13645
+ callback: (arg0: EntityStopSneakingAfterEvent) => void,
13646
+ options?: EntitySneakingChangedEventOptions,
13647
+ ): (arg0: EntityStopSneakingAfterEvent) => void;
13648
+ /**
13649
+ * @remarks
13650
+ * Removes a callback from being called when an entity stops
13651
+ * sneaking.
13652
+ *
13653
+ * This function can't be called in restricted-execution mode.
13654
+ *
13655
+ * This function can be called in early-execution mode.
13656
+ *
13657
+ */
13658
+ unsubscribe(callback: (arg0: EntityStopSneakingAfterEvent) => void): void;
13659
+ }
13660
+
12701
13661
  /**
12702
13662
  * Defines the entity's ability to carry items. An entity with
12703
13663
  * a higher strength would have higher potential carry capacity
@@ -12996,7 +13956,7 @@ export class EntityTypes {
12996
13956
  * Retrieves an entity type using a string-based identifier.
12997
13957
  *
12998
13958
  */
12999
- static get(identifier: string): EntityType | undefined;
13959
+ static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
13000
13960
  /**
13001
13961
  * @remarks
13002
13962
  * Retrieves a set of all entity types within this world.
@@ -13401,6 +14361,138 @@ export class FluidContainer {
13401
14361
  static readonly minFillLevel = 0;
13402
14362
  }
13403
14363
 
14364
+ /**
14365
+ * @beta
14366
+ * Provides access to the fog definitions stack of a player
14367
+ * entity, allowing scripts to push, pop, remove, and query
14368
+ * active fog definitions.
14369
+ */
14370
+ export class FogSettings {
14371
+ private constructor();
14372
+ /**
14373
+ * @remarks
14374
+ * Returns the list of fog identifiers currently on the
14375
+ * player's fog stack, ordered from bottom to top.
14376
+ *
14377
+ * This function can't be called in restricted-execution mode.
14378
+ *
14379
+ * @returns
14380
+ * An array of fog definition identifiers currently on the
14381
+ * stack.
14382
+ * @throws
14383
+ * Throws if the entity is invalid.
14384
+ *
14385
+ * {@link InvalidEntityError}
14386
+ */
14387
+ getStack(): string[];
14388
+ /**
14389
+ * @remarks
14390
+ * Returns the list of tags currently present on the player's
14391
+ * fog stack.
14392
+ *
14393
+ * This function can't be called in restricted-execution mode.
14394
+ *
14395
+ * @returns
14396
+ * An array of tag strings associated with fog settings on the
14397
+ * stack.
14398
+ * @throws
14399
+ * Throws if the entity is invalid.
14400
+ *
14401
+ * {@link InvalidEntityError}
14402
+ */
14403
+ getTags(): string[];
14404
+ /**
14405
+ * @remarks
14406
+ * Removes the most recently pushed fog definition from the
14407
+ * player's fog stack.
14408
+ *
14409
+ * This function can't be called in restricted-execution mode.
14410
+ *
14411
+ * @param tag
14412
+ * An optional tag identifying which entry to pop. If provided,
14413
+ * searches the stack from top to bottom and removes the most
14414
+ * recently pushed entry with this tag. If omitted, removes the
14415
+ * most recently pushed entry regardless of tag.
14416
+ * @returns
14417
+ * Returns the identifier of the popped fog definition, or
14418
+ * undefined if the stack was unchanged.
14419
+ * @throws
14420
+ * Throws if the entity is invalid.
14421
+ *
14422
+ * {@link InvalidEntityError}
14423
+ */
14424
+ pop(tag?: string): string | undefined;
14425
+ /**
14426
+ * @remarks
14427
+ * Pushes a new fog definition onto the player's fog stack.
14428
+ *
14429
+ * This function can't be called in restricted-execution mode.
14430
+ *
14431
+ * @param fogId
14432
+ * The identifier of the fog definition to push onto the stack
14433
+ * (e.g. 'minecraft:fog_bamboo_jungle').
14434
+ * @param tag
14435
+ * An optional tag used to label this fog definition on the
14436
+ * stack, allowing it to be targeted by pop or remove. If
14437
+ * omitted, the entry is stored with the tag 'untagged'.
14438
+ * @returns
14439
+ * Returns the zero-based index at which the fog definition was
14440
+ * inserted into the stack.
14441
+ * @throws
14442
+ * Throws if the entity is invalid, the fog identifier is
14443
+ * invalid, or if the stack limit of 16 has been exceeded.
14444
+ *
14445
+ * {@link FogSettingsError}
14446
+ *
14447
+ * {@link InvalidEntityError}
14448
+ */
14449
+ push(fogId: string, tag?: string): number;
14450
+ /**
14451
+ * @remarks
14452
+ * Removes all fog definitions with the given tag from the
14453
+ * player's fog stack. If no tag is provided, clears all fog
14454
+ * definitions.
14455
+ *
14456
+ * This function can't be called in restricted-execution mode.
14457
+ *
14458
+ * @param tag
14459
+ * An optional tag identifying which the entries to remove. If
14460
+ * omitted, clears all fog definitions regardless of tag.
14461
+ * @returns
14462
+ * Returns true if at least one entry was removed, or false if
14463
+ * the stack was unchanged.
14464
+ * @throws
14465
+ * Throws if the entity is invalid.
14466
+ *
14467
+ * {@link InvalidEntityError}
14468
+ */
14469
+ remove(tag?: string): boolean;
14470
+ /**
14471
+ * @remarks
14472
+ * Sets the player's fog stack to the given list of fog
14473
+ * identifiers, replacing any existing entries.
14474
+ *
14475
+ * This function can't be called in restricted-execution mode.
14476
+ *
14477
+ * @param fogIds
14478
+ * A stack of fog definition identifiers to set on the player's
14479
+ * fog stack (e.g. ['minecraft:fog_bamboo_jungle']). Maximum of
14480
+ * 16 entries.
14481
+ * @param tag
14482
+ * An optional tag to associate with the new entries, used to
14483
+ * target them with pop or remove.
14484
+ * @throws
14485
+ * Throws if the entity is invalid, if more than 16 fog
14486
+ * identifiers are provided, or if any fog identifier is
14487
+ * invalid.
14488
+ *
14489
+ * {@link FogSettingsError}
14490
+ *
14491
+ * {@link InvalidEntityError}
14492
+ */
14493
+ setStack(fogIds: string[], tag?: string): void;
14494
+ }
14495
+
13404
14496
  /**
13405
14497
  * Contains information regarding a changed world.gameRules
13406
14498
  * property.
@@ -13590,6 +14682,13 @@ export class GameRules {
13590
14682
  *
13591
14683
  */
13592
14684
  playersSleepingPercentage: number;
14685
+ /**
14686
+ * @beta
14687
+ * @remarks
14688
+ * This property can't be edited in restricted-execution mode.
14689
+ *
14690
+ */
14691
+ playerWaypoints: PlayerWaypointsMode;
13593
14692
  /**
13594
14693
  * @remarks
13595
14694
  * This property can't be edited in restricted-execution mode.
@@ -13737,6 +14836,62 @@ export class ISerializable {
13737
14836
  private constructor();
13738
14837
  }
13739
14838
 
14839
+ /**
14840
+ * @beta
14841
+ * Represents the dynamic properties of a block. Only available
14842
+ * from block entities. Up to 1KBytes of data can be stored per
14843
+ * content pack per block entity in their dynamic properties
14844
+ * storage.
14845
+ */
14846
+ // @ts-ignore Class inheritance allowed for native defined classes
14847
+ export class ItemBlockDynamicPropertiesComponent extends ItemComponent {
14848
+ private constructor();
14849
+ static readonly componentId = 'minecraft:block_actor_dynamic_properties';
14850
+ /**
14851
+ * @remarks
14852
+ * Returns a DynamicProperty that was stored with the provided
14853
+ * key. Keys are unique to each content pack and cannot be used
14854
+ * to retrieve dynamic properties set from other content packs.
14855
+ * Returns undefined if the key was not found.
14856
+ *
14857
+ * @throws This function can throw errors.
14858
+ *
14859
+ * {@link Error}
14860
+ *
14861
+ * {@link InvalidItemStackError}
14862
+ */
14863
+ get(key: string): boolean | number | string | Vector3 | undefined;
14864
+ /**
14865
+ * @remarks
14866
+ * Sets a dynamic property with the provided key and value.
14867
+ * Keys are unique to each content pack and cannot be used to
14868
+ * set dynamic properties for other content packs. Values can
14869
+ * be either a Number, a String or a Vector3. Setting a
14870
+ * property with an undefined value will remove it from the
14871
+ * storage. Storage size usage is counted towards the 1KBytes
14872
+ * limit per content pack.
14873
+ *
14874
+ * @throws This function can throw errors.
14875
+ *
14876
+ * {@link Error}
14877
+ *
14878
+ * {@link InvalidItemStackError}
14879
+ */
14880
+ set(key: string, value?: boolean | number | string | Vector3): void;
14881
+ /**
14882
+ * @remarks
14883
+ * Returns the current size, in bytes, of the dynamic
14884
+ * properties storage for this block. The byte count only
14885
+ * accounts for properties set by your content pack. The
14886
+ * 1KBytes limit is per content pack.
14887
+ *
14888
+ * @throws This function can throw errors.
14889
+ *
14890
+ * {@link InvalidItemStackError}
14891
+ */
14892
+ totalByteCount(): number;
14893
+ }
14894
+
13740
14895
  /**
13741
14896
  * When present on an item, this item is a book item. Can
13742
14897
  * access and modify the contents of the book and sign it.
@@ -16450,6 +17605,33 @@ export class MatchToolCondition extends LootItemCondition {
16450
17605
  readonly itemTagsNone: string[];
16451
17606
  }
16452
17607
 
17608
+ /**
17609
+ * @beta
17610
+ * A specific currently-internal event used for passing
17611
+ * messages from client to server.
17612
+ */
17613
+ export class MessageReceiveAfterEvent {
17614
+ private constructor();
17615
+ /**
17616
+ * @remarks
17617
+ * The message identifier.
17618
+ *
17619
+ */
17620
+ readonly id: string;
17621
+ /**
17622
+ * @remarks
17623
+ * The message.
17624
+ *
17625
+ */
17626
+ readonly message: string;
17627
+ /**
17628
+ * @remarks
17629
+ * The player who sent the message.
17630
+ *
17631
+ */
17632
+ readonly player: Player;
17633
+ }
17634
+
16453
17635
  /**
16454
17636
  * Contains a set of additional variable values for further
16455
17637
  * defining how rendering and animations function.
@@ -16519,29 +17701,72 @@ export class MolangVariableMap {
16519
17701
  }
16520
17702
 
16521
17703
  /**
16522
- * Loot item condition that checks whether the looting entity
16523
- * is currently a passenger of a specific type of entity.
17704
+ * @beta
17705
+ * Pack setting name and value that changed.
16524
17706
  */
16525
- // @ts-ignore Class inheritance allowed for native defined classes
16526
- export class PassengerOfEntityCondition extends LootItemCondition {
17707
+ export class PackSettingChangeAfterEvent {
16527
17708
  private constructor();
16528
17709
  /**
16529
17710
  * @remarks
16530
- * The entity type required for this condition to pass.
17711
+ * The name of the setting.
16531
17712
  *
16532
17713
  */
16533
- readonly entityType: string;
17714
+ readonly settingName: string;
17715
+ /**
17716
+ * @remarks
17717
+ * The value of the setting.
17718
+ *
17719
+ */
17720
+ readonly settingValue: boolean | number | string;
16534
17721
  }
16535
17722
 
16536
17723
  /**
16537
- * Contains information related to changes to a piston
16538
- * expanding or retracting.
16539
- * @example pistonAfterEvent.ts
16540
- * ```typescript
16541
- * import {
16542
- * world,
16543
- * system,
16544
- * BlockPermutation,
17724
+ * @beta
17725
+ */
17726
+ export class PackSettingChangeAfterEventSignal {
17727
+ private constructor();
17728
+ /**
17729
+ * @remarks
17730
+ * This function can't be called in restricted-execution mode.
17731
+ *
17732
+ * This function can be called in early-execution mode.
17733
+ *
17734
+ */
17735
+ subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
17736
+ /**
17737
+ * @remarks
17738
+ * This function can't be called in restricted-execution mode.
17739
+ *
17740
+ * This function can be called in early-execution mode.
17741
+ *
17742
+ */
17743
+ unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
17744
+ }
17745
+
17746
+ /**
17747
+ * Loot item condition that checks whether the looting entity
17748
+ * is currently a passenger of a specific type of entity.
17749
+ */
17750
+ // @ts-ignore Class inheritance allowed for native defined classes
17751
+ export class PassengerOfEntityCondition extends LootItemCondition {
17752
+ private constructor();
17753
+ /**
17754
+ * @remarks
17755
+ * The entity type required for this condition to pass.
17756
+ *
17757
+ */
17758
+ readonly entityType: string;
17759
+ }
17760
+
17761
+ /**
17762
+ * Contains information related to changes to a piston
17763
+ * expanding or retracting.
17764
+ * @example pistonAfterEvent.ts
17765
+ * ```typescript
17766
+ * import {
17767
+ * world,
17768
+ * system,
17769
+ * BlockPermutation,
16545
17770
  * BlockPistonState,
16546
17771
  * PistonActivateAfterEvent,
16547
17772
  * DimensionLocation,
@@ -16685,6 +17910,62 @@ export class Player extends Entity {
16685
17910
  * @throws This property can throw when used.
16686
17911
  */
16687
17912
  readonly camera: Camera;
17913
+ /**
17914
+ * @beta
17915
+ * @remarks
17916
+ * The player's chat display name, composed from {@link
17917
+ * Player.chatNamePrefix} + {@link Player.name} + {@link
17918
+ * Player.chatNameSuffix}. This is the name shown as the author
17919
+ * of chat messages sent by this player. To change the name
17920
+ * shown above the player's head, use {@link Entity.nameTag}.
17921
+ *
17922
+ * @throws This property can throw when used.
17923
+ *
17924
+ * {@link InvalidEntityError}
17925
+ */
17926
+ readonly chatDisplayName: string;
17927
+ /**
17928
+ * @beta
17929
+ * @remarks
17930
+ * An optional string that, when set, is prepended to the text
17931
+ * of chat messages sent by this player. Useful for applying
17932
+ * formatting or color codes to a player's messages (e.g., '§a'
17933
+ * to make their messages green). Does not affect the player's
17934
+ * name display - use {@link Player.chatNamePrefix} for the
17935
+ * name shown in chat, or {@link Entity.nameTag} for the name
17936
+ * above the player's head. Set to undefined to clear.
17937
+ *
17938
+ * This property can't be edited in restricted-execution mode.
17939
+ *
17940
+ */
17941
+ chatMessagePrefix?: string;
17942
+ /**
17943
+ * @beta
17944
+ * @remarks
17945
+ * An optional string that, when set, is prepended to the
17946
+ * player's name in chat messages. Does not affect the name tag
17947
+ * above the player's head or the player list - use {@link
17948
+ * Entity.nameTag} for that. To prefix the message text itself,
17949
+ * use {@link Player.chatMessagePrefix}. Set to undefined to
17950
+ * clear.
17951
+ *
17952
+ * This property can't be edited in restricted-execution mode.
17953
+ *
17954
+ */
17955
+ chatNamePrefix?: string;
17956
+ /**
17957
+ * @beta
17958
+ * @remarks
17959
+ * An optional string that, when set, is appended to the
17960
+ * player's name in chat messages. Does not affect the name tag
17961
+ * above the player's head or the player list - use {@link
17962
+ * Entity.nameTag} for that. See also {@link
17963
+ * Player.chatNamePrefix}. Set to undefined to clear.
17964
+ *
17965
+ * This property can't be edited in restricted-execution mode.
17966
+ *
17967
+ */
17968
+ chatNameSuffix?: string;
16688
17969
  /**
16689
17970
  * @remarks
16690
17971
  * Contains the player's device information.
@@ -16698,6 +17979,14 @@ export class Player extends Entity {
16698
17979
  *
16699
17980
  */
16700
17981
  commandPermissionLevel: CommandPermissionLevel;
17982
+ /**
17983
+ * @beta
17984
+ * @remarks
17985
+ * Contains methods for manipulating the render distance fog
17986
+ * settings of a Player.
17987
+ *
17988
+ */
17989
+ readonly fogSettings: FogSettings;
16701
17990
  /**
16702
17991
  * @remarks
16703
17992
  * Gets the current graphics mode of the player's client. This
@@ -16781,6 +18070,19 @@ export class Player extends Entity {
16781
18070
  * @throws This property can throw when used.
16782
18071
  */
16783
18072
  readonly onScreenDisplay: ScreenDisplay;
18073
+ /**
18074
+ * @beta
18075
+ * @remarks
18076
+ * An identifier that can be used to identify a player across
18077
+ * sessions.
18078
+ *
18079
+ * @throws This property can throw when used.
18080
+ *
18081
+ * {@link minecraftcommon.EngineError}
18082
+ *
18083
+ * {@link InvalidEntityError}
18084
+ */
18085
+ readonly persistentId: string;
16784
18086
  /**
16785
18087
  * @throws This property can throw when used.
16786
18088
  *
@@ -16854,6 +18156,20 @@ export class Player extends Entity {
16854
18156
  * Throws if the Entity or Entity ID is invalid.
16855
18157
  */
16856
18158
  clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
18159
+ /**
18160
+ * @beta
18161
+ * @remarks
18162
+ * Eats an item, providing the item's hunger and saturation
18163
+ * effects to the player. Can only be used on food items.
18164
+ *
18165
+ * This function can't be called in restricted-execution mode.
18166
+ *
18167
+ * @param itemStack
18168
+ * The item to eat.
18169
+ * @throws
18170
+ * Throws if the item is not a food item.
18171
+ */
18172
+ eatItem(itemStack: ItemStack): void;
16857
18173
  /**
16858
18174
  * @remarks
16859
18175
  * The player's aim-assist settings.
@@ -16887,6 +18203,20 @@ export class Player extends Entity {
16887
18203
  * @throws This function can throw errors.
16888
18204
  */
16889
18205
  getItemCooldown(cooldownCategory: string): number;
18206
+ /**
18207
+ * @beta
18208
+ * @remarks
18209
+ * Gets the player's ping in milliseconds.
18210
+ *
18211
+ * @returns
18212
+ * The player's ping in milliseconds.
18213
+ * @throws This function can throw errors.
18214
+ *
18215
+ * {@link minecraftcommon.EngineError}
18216
+ *
18217
+ * {@link InvalidEntityError}
18218
+ */
18219
+ getPing(): number;
16890
18220
  /**
16891
18221
  * @remarks
16892
18222
  * Gets the current spawn point of the player.
@@ -16894,6 +18224,21 @@ export class Player extends Entity {
16894
18224
  * @throws This function can throw errors.
16895
18225
  */
16896
18226
  getSpawnPoint(): DimensionLocation | undefined;
18227
+ /**
18228
+ * @beta
18229
+ * @remarks
18230
+ * Returns the split screen slot of the player.
18231
+ *
18232
+ * @returns
18233
+ * The split screen slot of the player or undefined if the
18234
+ * player is not in a split screen session.
18235
+ * @throws This function can throw errors.
18236
+ *
18237
+ * {@link minecraftcommon.EngineError}
18238
+ *
18239
+ * {@link InvalidEntityError}
18240
+ */
18241
+ getSplitScreenSlot(): PlayerSplitScreenSlot | undefined;
16897
18242
  /**
16898
18243
  * @remarks
16899
18244
  * Gets the total experience of the Player.
@@ -16957,7 +18302,18 @@ export class Player extends Entity {
16957
18302
  * }
16958
18303
  * ```
16959
18304
  */
16960
- playSound(soundId: string, soundOptions?: PlayerSoundOptions): SoundInstance;
18305
+ playSound(soundId: SoundDefinition | string, soundOptions?: PlayerSoundOptions): SoundInstance;
18306
+ /**
18307
+ * @beta
18308
+ * @remarks
18309
+ * This is an internal-facing method for posting a system
18310
+ * message to downstream clients.
18311
+ *
18312
+ * This function can't be called in restricted-execution mode.
18313
+ *
18314
+ * @throws This function can throw errors.
18315
+ */
18316
+ postClientMessage(id: string, value: string): void;
16961
18317
  /**
16962
18318
  * @remarks
16963
18319
  * Queues an additional music track that only this particular
@@ -17233,6 +18589,18 @@ export class Player extends Entity {
17233
18589
  * @throws This function can throw errors.
17234
18590
  */
17235
18591
  startItemCooldown(cooldownCategory: string, tickDuration: number): void;
18592
+ /**
18593
+ * @beta
18594
+ * @remarks
18595
+ * Stops all sounds from playing for this particular player.
18596
+ *
18597
+ * This function can't be called in restricted-execution mode.
18598
+ *
18599
+ * @throws This function can throw errors.
18600
+ *
18601
+ * {@link InvalidEntityError}
18602
+ */
18603
+ stopAllSounds(): void;
17236
18604
  /**
17237
18605
  * @remarks
17238
18606
  * Stops any music tracks from playing for this particular
@@ -17243,6 +18611,20 @@ export class Player extends Entity {
17243
18611
  * @throws This function can throw errors.
17244
18612
  */
17245
18613
  stopMusic(): void;
18614
+ /**
18615
+ * @beta
18616
+ * @remarks
18617
+ * Stops a sound from playing for this particular player.
18618
+ *
18619
+ * This function can't be called in restricted-execution mode.
18620
+ *
18621
+ * @param soundId
18622
+ * Identifier of the sound.
18623
+ * @throws This function can throw errors.
18624
+ *
18625
+ * {@link InvalidEntityError}
18626
+ */
18627
+ stopSound(soundId: string): void;
17246
18628
  }
17247
18629
 
17248
18630
  /**
@@ -18604,6 +19986,88 @@ export class PlayerPlaceBlockAfterEventSignal {
18604
19986
  unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
18605
19987
  }
18606
19988
 
19989
+ /**
19990
+ * @beta
19991
+ * Contains information regarding an event before a player
19992
+ * places a block.
19993
+ */
19994
+ // @ts-ignore Class inheritance allowed for native defined classes
19995
+ export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
19996
+ private constructor();
19997
+ /**
19998
+ * @remarks
19999
+ * If set to true, cancels the block place event.
20000
+ *
20001
+ */
20002
+ cancel: boolean;
20003
+ /**
20004
+ * @remarks
20005
+ * The face of the block that the new block is being placed on.
20006
+ *
20007
+ */
20008
+ readonly face: Direction;
20009
+ /**
20010
+ * @remarks
20011
+ * Location relative to the bottom north-west corner of the
20012
+ * block where the new block is being placed onto.
20013
+ *
20014
+ */
20015
+ readonly faceLocation: Vector3;
20016
+ /**
20017
+ * @remarks
20018
+ * The block permutation that will be placed if the event is
20019
+ * not cancelled.
20020
+ *
20021
+ */
20022
+ readonly permutationToPlace: BlockPermutation;
20023
+ /**
20024
+ * @remarks
20025
+ * Player that is placing the block for this event.
20026
+ *
20027
+ */
20028
+ readonly player: Player;
20029
+ }
20030
+
20031
+ /**
20032
+ * @beta
20033
+ * Manages callbacks that are connected to before a block is
20034
+ * placed by a player.
20035
+ */
20036
+ export class PlayerPlaceBlockBeforeEventSignal {
20037
+ private constructor();
20038
+ /**
20039
+ * @remarks
20040
+ * Adds a callback that will be called before a block is placed
20041
+ * by a player.
20042
+ *
20043
+ * This function can't be called in restricted-execution mode.
20044
+ *
20045
+ * This function can be called in early-execution mode.
20046
+ *
20047
+ * @param callback
20048
+ * This closure is called with restricted-execution privilege.
20049
+ * @returns
20050
+ * Closure that is called with restricted-execution privilege.
20051
+ */
20052
+ subscribe(
20053
+ callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
20054
+ options?: BlockEventOptions,
20055
+ ): (arg0: PlayerPlaceBlockBeforeEvent) => void;
20056
+ /**
20057
+ * @remarks
20058
+ * Removes a callback from being called before an block is
20059
+ * placed by a player.
20060
+ *
20061
+ * This function can't be called in restricted-execution mode.
20062
+ *
20063
+ * This function can be called in early-execution mode.
20064
+ *
20065
+ * @param callback
20066
+ * This closure is called with restricted-execution privilege.
20067
+ */
20068
+ unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
20069
+ }
20070
+
18607
20071
  /**
18608
20072
  * An event that contains more information about a player
18609
20073
  * spawning.
@@ -18792,6 +20256,80 @@ export class PlayerSwingStartAfterEventSignal {
18792
20256
  unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
18793
20257
  }
18794
20258
 
20259
+ /**
20260
+ * @beta
20261
+ * Contains information related to when a player successfully
20262
+ * names an Entity with a named Name Tag item.
20263
+ */
20264
+ export class PlayerUseNameTagAfterEvent {
20265
+ private constructor();
20266
+ /**
20267
+ * @remarks
20268
+ * The entity that was named by the player.
20269
+ *
20270
+ * This property can't be edited in restricted-execution mode.
20271
+ *
20272
+ */
20273
+ entityNamed: Entity;
20274
+ /**
20275
+ * @remarks
20276
+ * The new name that the player has given to the entity.
20277
+ *
20278
+ * This property can't be edited in restricted-execution mode.
20279
+ *
20280
+ */
20281
+ newName: string;
20282
+ /**
20283
+ * @remarks
20284
+ * Handle to the player that used the name tag.
20285
+ *
20286
+ * This property can't be edited in restricted-execution mode.
20287
+ *
20288
+ */
20289
+ player: Player;
20290
+ /**
20291
+ * @remarks
20292
+ * The previous name of the entity before the player used the
20293
+ * name tag. This will be undefined if the entity was not
20294
+ * previously named.
20295
+ *
20296
+ * This property can't be edited in restricted-execution mode.
20297
+ *
20298
+ */
20299
+ previousName?: string;
20300
+ }
20301
+
20302
+ /**
20303
+ * @beta
20304
+ * Manages callbacks that are connected to when a player
20305
+ * successfully names an Entity with a named Name Tag item.
20306
+ */
20307
+ export class PlayerUseNameTagAfterEventSignal {
20308
+ private constructor();
20309
+ /**
20310
+ * @remarks
20311
+ * Subscribes the specified callback to a player use name tag
20312
+ * after event.
20313
+ *
20314
+ * This function can't be called in restricted-execution mode.
20315
+ *
20316
+ * This function can be called in early-execution mode.
20317
+ *
20318
+ */
20319
+ subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
20320
+ /**
20321
+ * @remarks
20322
+ * Removes the specified callback from a player use name tag
20323
+ * after event.
20324
+ *
20325
+ * This function can't be called in restricted-execution mode.
20326
+ *
20327
+ * This function can be called in early-execution mode.
20328
+ *
20329
+ */
20330
+ unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
20331
+ }
20332
+
18795
20333
  /**
18796
20334
  * Waypoint that tracks a player's position. Extends {@link
18797
20335
  * EntityWaypoint} with additional player-specific visibility
@@ -18907,10 +20445,10 @@ export class Potions {
18907
20445
  *
18908
20446
  * {@link InvalidPotionEffectTypeError}
18909
20447
  */
18910
- static resolve(
18911
- potionEffectType: PotionEffectType | string,
18912
- potionDeliveryType: PotionDeliveryType | string,
18913
- ): ItemStack;
20448
+ static resolve<
20449
+ T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
20450
+ U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
20451
+ >(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
18914
20452
  }
18915
20453
 
18916
20454
  /**
@@ -19153,6 +20691,18 @@ export class PrimitiveShapesManager {
19153
20691
  * {@link PrimitiveShapeError}
19154
20692
  */
19155
20693
  addText(text: TextPrimitive, dimension?: Dimension): void;
20694
+ /**
20695
+ * @beta
20696
+ * @remarks
20697
+ * Fetches and queries all primitive shapes stored in the
20698
+ * manager and returns the results as an array of shape
20699
+ * handles.
20700
+ *
20701
+ * @param options
20702
+ * Optional options for querying existing shapes to narrow down
20703
+ * the results.
20704
+ */
20705
+ getShapes(options?: PrimitiveShapeQueryOptions): PrimitiveShape[];
19156
20706
  /**
19157
20707
  * @remarks
19158
20708
  * Removes all text primitives from the world.
@@ -20117,6 +21667,38 @@ export class Seat {
20117
21667
  readonly seatRotation: number;
20118
21668
  }
20119
21669
 
21670
+ /**
21671
+ * @beta
21672
+ * Manages callbacks that are message passing to a server. This
21673
+ * event is not currently fully implemented, and should not be
21674
+ * used.
21675
+ */
21676
+ export class ServerMessageAfterEventSignal {
21677
+ private constructor();
21678
+ /**
21679
+ * @remarks
21680
+ * Adds a callback that will be called when an internal message
21681
+ * is passed.
21682
+ *
21683
+ * This function can't be called in restricted-execution mode.
21684
+ *
21685
+ * This function can be called in early-execution mode.
21686
+ *
21687
+ */
21688
+ subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
21689
+ /**
21690
+ * @remarks
21691
+ * Removes a callback from being called when an internal
21692
+ * message is passed.
21693
+ *
21694
+ * This function can't be called in restricted-execution mode.
21695
+ *
21696
+ * This function can be called in early-execution mode.
21697
+ *
21698
+ */
21699
+ unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
21700
+ }
21701
+
20120
21702
  /**
20121
21703
  * Loot item function that modifies the trim on a dropped armor
20122
21704
  * item.
@@ -20145,6 +21727,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
20145
21727
  // @ts-ignore Class inheritance allowed for native defined classes
20146
21728
  export class SetBannerDetailsFunction extends LootItemFunction {
20147
21729
  private constructor();
21730
+ /**
21731
+ * @beta
21732
+ * @remarks
21733
+ * The base color for the dropped banner.
21734
+ *
21735
+ */
21736
+ readonly baseColor: string;
21737
+ /**
21738
+ * @beta
21739
+ * @remarks
21740
+ * An array of {@link BannerPattern} objects used to decorate
21741
+ * the banner, including color and pattern type.
21742
+ *
21743
+ */
21744
+ readonly patterns: BannerPattern[];
20148
21745
  /**
20149
21746
  * @remarks
20150
21747
  * The type of banner to drop.
@@ -20437,6 +22034,73 @@ export class SoundCompletedAfterEventSignal {
20437
22034
  unsubscribe(callback: (arg0: SoundCompletedAfterEvent) => void): void;
20438
22035
  }
20439
22036
 
22037
+ /**
22038
+ * @beta
22039
+ * Static metadata about a sound declared in a
22040
+ * sound_definitions.json file.
22041
+ */
22042
+ export class SoundDefinition {
22043
+ private constructor();
22044
+ /**
22045
+ * @remarks
22046
+ * Duration metadata declared for this sound. Undefined when
22047
+ * the sound definition does not specify a duration.
22048
+ *
22049
+ */
22050
+ readonly durationInfo?: SoundDefinitionDurationInfo;
22051
+ /**
22052
+ * @remarks
22053
+ * Music metadata declared for this sound. Undefined when the
22054
+ * sound definition does not specify a music_info block.
22055
+ *
22056
+ */
22057
+ readonly musicInfo?: SoundDefinitionMusicInfo;
22058
+ /**
22059
+ * @remarks
22060
+ * Identifier of the sound event this definition declares, in
22061
+ * the form 'namespace:name'.
22062
+ *
22063
+ */
22064
+ readonly soundEventId: string;
22065
+ /**
22066
+ * @remarks
22067
+ * Tag metadata declared for this sound, as a record mapping
22068
+ * each tag name to its declared values. A tag declared with a
22069
+ * single string value is exposed as a single-element array.
22070
+ * Undefined when the sound definition does not specify any
22071
+ * tags.
22072
+ *
22073
+ */
22074
+ readonly tags?: Record<string, string[]>;
22075
+ }
22076
+
22077
+ /**
22078
+ * @beta
22079
+ * Provides read-only access to the sound definitions loaded
22080
+ * for the current world.
22081
+ */
22082
+ export class SoundDefinitionRegistry {
22083
+ private constructor();
22084
+ /**
22085
+ * @remarks
22086
+ * Returns the sound definitions in the registry, optionally
22087
+ * narrowed by a filter.
22088
+ *
22089
+ * @param filter
22090
+ * Optional filter applied to each definition. When omitted,
22091
+ * every definition is returned.
22092
+ * @returns
22093
+ * All sound definitions matching the filter, or every sound
22094
+ * definition when no filter is supplied.
22095
+ * @throws
22096
+ * An error will be thrown if filter.minDuration is greater
22097
+ * than filter.maxDuration.
22098
+ *
22099
+ * {@link minecraftcommon.InvalidArgumentError}
22100
+ */
22101
+ getDefinitions(filter?: SoundDefinitionFilter): SoundDefinition[];
22102
+ }
22103
+
20440
22104
  /**
20441
22105
  * @rc
20442
22106
  * Provides duration and playback information for a sound whose
@@ -20510,6 +22174,84 @@ export class SoundInstance {
20510
22174
  *
20511
22175
  */
20512
22176
  readonly soundEventId: string;
22177
+ /**
22178
+ * @beta
22179
+ * @remarks
22180
+ * Fades this sound instance from its current volume to the
22181
+ * target volume over the specified duration. To fade in from
22182
+ * silence, call `setVolume(0.0)` first; to fade out, pass a
22183
+ * target volume of `0.0`.
22184
+ *
22185
+ * This function can't be called in restricted-execution mode.
22186
+ *
22187
+ * @param duration
22188
+ * Duration of the fade in seconds. Must be non-negative.
22189
+ * Minimum value: 0
22190
+ * @param targetVolume
22191
+ * Volume to fade to. Must be non-negative.
22192
+ * Minimum value: 0
22193
+ */
22194
+ fade(duration: number, targetVolume: number): void;
22195
+ /**
22196
+ * @beta
22197
+ * @remarks
22198
+ * Pauses this sound.
22199
+ *
22200
+ * This function can't be called in restricted-execution mode.
22201
+ *
22202
+ */
22203
+ pause(): void;
22204
+ /**
22205
+ * @beta
22206
+ * @remarks
22207
+ * Resumes this sound after a pause.
22208
+ *
22209
+ * This function can't be called in restricted-execution mode.
22210
+ *
22211
+ */
22212
+ resume(): void;
22213
+ /**
22214
+ * @beta
22215
+ * @remarks
22216
+ * Sets the playback position of this sound instance.
22217
+ *
22218
+ * This function can't be called in restricted-execution mode.
22219
+ *
22220
+ * @param seconds
22221
+ * Position to seek to in seconds. Must be non-negative.
22222
+ * Bounds: [0, 107374184]
22223
+ * @throws
22224
+ * Throws if `seconds` is negative, or if the sound has a known
22225
+ * duration and `seconds` is greater than that duration.
22226
+ *
22227
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
22228
+ */
22229
+ seekTo(seconds: number): void;
22230
+ /**
22231
+ * @beta
22232
+ * @remarks
22233
+ * Sets the pitch of this sound instance.
22234
+ *
22235
+ * This function can't be called in restricted-execution mode.
22236
+ *
22237
+ * @param pitch
22238
+ * Pitch multiplier between 0.01 and 10.0. A value of 1.0 is
22239
+ * normal pitch.
22240
+ * Bounds: [0.009999999776482582, 10]
22241
+ */
22242
+ setPitch(pitch: number): void;
22243
+ /**
22244
+ * @beta
22245
+ * @remarks
22246
+ * Sets the volume of this sound instance.
22247
+ *
22248
+ * This function can't be called in restricted-execution mode.
22249
+ *
22250
+ * @param volume
22251
+ * Volume level between 0.0 and 10.0.
22252
+ * Bounds: [0, 10]
22253
+ */
22254
+ setVolume(volume: number): void;
20513
22255
  /**
20514
22256
  * @rc
20515
22257
  * @remarks
@@ -21234,6 +22976,19 @@ export class SystemBeforeEvents {
21234
22976
  *
21235
22977
  */
21236
22978
  readonly startup: StartupBeforeEventSignal;
22979
+ /**
22980
+ * @beta
22981
+ * @remarks
22982
+ * Fires when the scripting watchdog shuts down the server. The
22983
+ * can be due to using too much memory, or by causing
22984
+ * significant slowdown or hang.
22985
+ * To prevent shutdown, set the event's cancel property to
22986
+ * true.
22987
+ *
22988
+ * This property can be read in early-execution mode.
22989
+ *
22990
+ */
22991
+ readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
21237
22992
  }
21238
22993
 
21239
22994
  /**
@@ -21341,6 +23096,14 @@ export class TextPrimitive extends PrimitiveShape {
21341
23096
  *
21342
23097
  */
21343
23098
  depthTest: boolean;
23099
+ /**
23100
+ * @beta
23101
+ * @remarks
23102
+ * This value determines the gap between lines for the
23103
+ * TextPrimitive. By default the line gap height is 0.
23104
+ *
23105
+ */
23106
+ lineGapHeight: number;
21344
23107
  /**
21345
23108
  * @remarks
21346
23109
  * Get the text of the debug text shape. Returns the RawText of
@@ -21619,6 +23382,71 @@ export class TripWireTripAfterEventSignal {
21619
23382
  unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
21620
23383
  }
21621
23384
 
23385
+ /**
23386
+ * @beta
23387
+ * Contains information related to a script watchdog
23388
+ * termination.
23389
+ */
23390
+ export class WatchdogTerminateBeforeEvent {
23391
+ private constructor();
23392
+ /**
23393
+ * @remarks
23394
+ * If set to true, cancels the termination of the script
23395
+ * runtime. Note that depending on server configuration
23396
+ * settings, cancellation of the termination may not be
23397
+ * allowed.
23398
+ *
23399
+ */
23400
+ cancel: boolean;
23401
+ /**
23402
+ * @remarks
23403
+ * Contains the reason why a script runtime is to be
23404
+ * terminated.
23405
+ *
23406
+ */
23407
+ readonly terminateReason: WatchdogTerminateReason;
23408
+ }
23409
+
23410
+ /**
23411
+ * @beta
23412
+ * Manages callbacks that are connected to a callback that will
23413
+ * be called when a script runtime is being terminated due to a
23414
+ * violation of the performance watchdog system.
23415
+ */
23416
+ export class WatchdogTerminateBeforeEventSignal {
23417
+ private constructor();
23418
+ /**
23419
+ * @remarks
23420
+ * Adds a callback that will be called when a script runtime is
23421
+ * being terminated due to a violation of the performance
23422
+ * watchdog system.
23423
+ *
23424
+ * This function can't be called in restricted-execution mode.
23425
+ *
23426
+ * This function can be called in early-execution mode.
23427
+ *
23428
+ * @param callback
23429
+ * This closure is called with restricted-execution privilege.
23430
+ * @returns
23431
+ * Closure that is called with restricted-execution privilege.
23432
+ */
23433
+ subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
23434
+ /**
23435
+ * @remarks
23436
+ * Removes a callback from being called when a script runtime
23437
+ * is being terminated due to a violation of the performance
23438
+ * watchdog system.
23439
+ *
23440
+ * This function can't be called in restricted-execution mode.
23441
+ *
23442
+ * This function can be called in early-execution mode.
23443
+ *
23444
+ * @param callback
23445
+ * This closure is called with restricted-execution privilege.
23446
+ */
23447
+ unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
23448
+ }
23449
+
21622
23450
  /**
21623
23451
  * Base class for waypoints displayed on the player's locator
21624
23452
  * bar. Waypoints can track locations or entities and are
@@ -21834,6 +23662,15 @@ export class World {
21834
23662
  *
21835
23663
  */
21836
23664
  readonly afterEvents: WorldAfterEvents;
23665
+ /**
23666
+ * @beta
23667
+ * @remarks
23668
+ * Enables or disables cheats.
23669
+ *
23670
+ * This property can't be edited in restricted-execution mode.
23671
+ *
23672
+ */
23673
+ allowCheats: boolean;
21837
23674
  /**
21838
23675
  * @remarks
21839
23676
  * Contains a set of events that are applicable to the entirety
@@ -21898,6 +23735,14 @@ export class World {
21898
23735
  *
21899
23736
  */
21900
23737
  readonly seed: string;
23738
+ /**
23739
+ * @beta
23740
+ * @remarks
23741
+ * Provides read-only access to the sound definitions loaded
23742
+ * for this world.
23743
+ *
23744
+ */
23745
+ readonly soundDefinitionRegistry: SoundDefinitionRegistry;
21901
23746
  /**
21902
23747
  * @remarks
21903
23748
  * Returns the manager for {@link Structure} related APIs.
@@ -21911,6 +23756,20 @@ export class World {
21911
23756
  *
21912
23757
  */
21913
23758
  readonly tickingAreaManager: TickingAreaManager;
23759
+ /**
23760
+ * @beta
23761
+ * @remarks
23762
+ * A method that is internal-only, used for broadcasting
23763
+ * specific messages between client and server.
23764
+ *
23765
+ * This function can't be called in restricted-execution mode.
23766
+ *
23767
+ * @param id
23768
+ * The message identifier.
23769
+ * @param value
23770
+ * The message.
23771
+ */
23772
+ broadcastClientMessage(id: string, value: string): void;
21914
23773
  /**
21915
23774
  * @remarks
21916
23775
  * Clears the set of dynamic properties declared for this
@@ -22400,6 +24259,16 @@ export class WorldAfterEvents {
22400
24259
  *
22401
24260
  */
22402
24261
  readonly buttonPush: ButtonPushAfterEventSignal;
24262
+ /**
24263
+ * @beta
24264
+ * @remarks
24265
+ * This event is triggered after a chat message has been
24266
+ * broadcast or sent to players.
24267
+ *
24268
+ * This property can be read in early-execution mode.
24269
+ *
24270
+ */
24271
+ readonly chatSend: ChatSendAfterEventSignal;
22403
24272
  /**
22404
24273
  * @remarks
22405
24274
  * This event is fired when an entity event has been triggered
@@ -22524,6 +24393,24 @@ export class WorldAfterEvents {
22524
24393
  *
22525
24394
  */
22526
24395
  readonly entitySpawn: EntitySpawnAfterEventSignal;
24396
+ /**
24397
+ * @beta
24398
+ * @remarks
24399
+ * This event fires when an entity starts sneaking.
24400
+ *
24401
+ * This property can be read in early-execution mode.
24402
+ *
24403
+ */
24404
+ readonly entityStartSneaking: EntityStartSneakingAfterEventSignal;
24405
+ /**
24406
+ * @beta
24407
+ * @remarks
24408
+ * This event fires when an entity stops sneaking.
24409
+ *
24410
+ * This property can be read in early-execution mode.
24411
+ *
24412
+ */
24413
+ readonly entityStopSneaking: EntityStopSneakingAfterEventSignal;
22527
24414
  /**
22528
24415
  * @rc
22529
24416
  * @remarks
@@ -22628,6 +24515,25 @@ export class WorldAfterEvents {
22628
24515
  *
22629
24516
  */
22630
24517
  readonly leverAction: LeverActionAfterEventSignal;
24518
+ /**
24519
+ * @beta
24520
+ * @remarks
24521
+ * This event is an internal implementation detail, and is
24522
+ * otherwise not currently functional.
24523
+ *
24524
+ * This property can be read in early-execution mode.
24525
+ *
24526
+ */
24527
+ readonly messageReceive: ServerMessageAfterEventSignal;
24528
+ /**
24529
+ * @beta
24530
+ * @remarks
24531
+ * This event is triggered when a pack setting is changed.
24532
+ *
24533
+ * This property can be read in early-execution mode.
24534
+ *
24535
+ */
24536
+ readonly packSettingChange: PackSettingChangeAfterEventSignal;
22631
24537
  /**
22632
24538
  * @remarks
22633
24539
  * This event fires when a piston expands or retracts.
@@ -22782,6 +24688,16 @@ export class WorldAfterEvents {
22782
24688
  *
22783
24689
  */
22784
24690
  readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
24691
+ /**
24692
+ * @beta
24693
+ * @remarks
24694
+ * An event for when a player uses a named name tag on an
24695
+ * entity.
24696
+ *
24697
+ * This property can be read in early-execution mode.
24698
+ *
24699
+ */
24700
+ readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
22785
24701
  /**
22786
24702
  * @remarks
22787
24703
  * A pressure plate has popped back up (i.e., there are no
@@ -22867,6 +24783,43 @@ export class WorldAfterEvents {
22867
24783
  */
22868
24784
  export class WorldBeforeEvents {
22869
24785
  private constructor();
24786
+ /**
24787
+ * @beta
24788
+ * @remarks
24789
+ * This event is triggered after a chat message has been
24790
+ * broadcast or sent to players.
24791
+ *
24792
+ * This property can be read in early-execution mode.
24793
+ *
24794
+ * @example customCommand.ts
24795
+ * ```typescript
24796
+ * import { world, DimensionLocation } from '@minecraft/server';
24797
+ *
24798
+ * function customCommand(targetLocation: DimensionLocation) {
24799
+ * const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
24800
+ * if (eventData.message.includes('cancel')) {
24801
+ * // Cancel event if the message contains "cancel"
24802
+ * eventData.cancel = true;
24803
+ * } else {
24804
+ * const args = eventData.message.split(' ');
24805
+ *
24806
+ * if (args.length > 0) {
24807
+ * switch (args[0].toLowerCase()) {
24808
+ * case 'echo':
24809
+ * // Send a modified version of chat message
24810
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
24811
+ * break;
24812
+ * case 'help':
24813
+ * world.sendMessage(`Available commands: echo <message>`);
24814
+ * break;
24815
+ * }
24816
+ * }
24817
+ * }
24818
+ * });
24819
+ * }
24820
+ * ```
24821
+ */
24822
+ readonly chatSend: ChatSendBeforeEventSignal;
22870
24823
  /**
22871
24824
  * @remarks
22872
24825
  * This event is triggered after an event has been added to an
@@ -22969,6 +24922,15 @@ export class WorldBeforeEvents {
22969
24922
  *
22970
24923
  */
22971
24924
  readonly playerLeave: PlayerLeaveBeforeEventSignal;
24925
+ /**
24926
+ * @beta
24927
+ * @remarks
24928
+ * This event fires before a block is placed by a player.
24929
+ *
24930
+ * This property can be read in early-execution mode.
24931
+ *
24932
+ */
24933
+ readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
22972
24934
  /**
22973
24935
  * @remarks
22974
24936
  * This property can be read in early-execution mode.
@@ -23065,8 +25027,8 @@ export interface BiomeSearchOptions {
23065
25027
  * represents an AABB aligned rectangle.
23066
25028
  * The BlockBoundingBox assumes that it was created in a valid
23067
25029
  * state (min <= max) but cannot guarantee it (unless it was
23068
- * created using the associated {@link
23069
- * @minecraft/server.BlockBoundingBoxUtils} utility functions.
25030
+ * created using the associated {@link BlockBoundingBoxUtils}
25031
+ * utility functions.
23070
25032
  * The min/max coordinates represent the diametrically opposite
23071
25033
  * corners of the rectangle.
23072
25034
  * The BlockBoundingBox is not a representation of blocks - it
@@ -23694,6 +25656,15 @@ export interface CustomCommand {
23694
25656
  * command.
23695
25657
  */
23696
25658
  export interface CustomCommandParameter {
25659
+ /**
25660
+ * @beta
25661
+ * @remarks
25662
+ * Can be used to reference the enum name when {@link
25663
+ * CustomCommandParamType} is 'Enum'. Allows the parameter name
25664
+ * to be different from the enum name.
25665
+ *
25666
+ */
25667
+ enumName?: string;
23697
25668
  /**
23698
25669
  * @remarks
23699
25670
  * The name of parameter as it appears on the command line.
@@ -23772,6 +25743,14 @@ export interface DefinitionModifier {
23772
25743
  *
23773
25744
  */
23774
25745
  removedComponentGroups: string[];
25746
+ /**
25747
+ * @beta
25748
+ * @remarks
25749
+ * The list of entity definition events that will be fired via
25750
+ * this update.
25751
+ *
25752
+ */
25753
+ triggers: Trigger[];
23775
25754
  }
23776
25755
 
23777
25756
  /**
@@ -24572,6 +26551,15 @@ export interface EntityRaycastOptions extends EntityFilter {
24572
26551
  maxDistance?: number;
24573
26552
  }
24574
26553
 
26554
+ /**
26555
+ * @beta
26556
+ * Options used to filter entity start sneaking and stop
26557
+ * sneaking events.
26558
+ */
26559
+ export interface EntitySneakingChangedEventOptions {
26560
+ entityFilter?: EntityFilter;
26561
+ }
26562
+
24575
26563
  /**
24576
26564
  * @rc
24577
26565
  * Contains options for filtering entity tamed events.
@@ -25124,6 +27112,19 @@ export interface PlayerSoundOptions {
25124
27112
  *
25125
27113
  */
25126
27114
  location?: Vector3;
27115
+ /**
27116
+ * @beta
27117
+ * @remarks
27118
+ * Number of additional times to repeat the sound after the
27119
+ * initial play. `0` (the default) plays the sound once, `-1`
27120
+ * loops it forever, and a positive integer `N` plays the sound
27121
+ * `N + 1` times in total. For example, `loopCount: 1` plays
27122
+ * the sound twice. The loop count is fixed when the sound
27123
+ * starts and cannot be changed afterward. When using `-1`, see
27124
+ * `SoundInstance` for handle lifetime requirements.
27125
+ *
27126
+ */
27127
+ loopCount?: number;
25127
27128
  /**
25128
27129
  * @remarks
25129
27130
  * Optional pitch of the sound.
@@ -25195,6 +27196,43 @@ export interface PlayerVisibilityRules extends EntityVisibilityRules {
25195
27196
  showSpectatorToSpectator?: boolean;
25196
27197
  }
25197
27198
 
27199
+ /**
27200
+ * @beta
27201
+ * Contains optional filters that control which primitive
27202
+ * shapes are returned from a primitive shapes query.
27203
+ */
27204
+ export interface PrimitiveShapeQueryOptions {
27205
+ /**
27206
+ * @remarks
27207
+ * If specified, only returns shapes attached to this entity.
27208
+ *
27209
+ */
27210
+ attachedTo?: Entity;
27211
+ /**
27212
+ * @remarks
27213
+ * Adds a seed location to the query that is used in
27214
+ * conjunction with distance properties.
27215
+ *
27216
+ */
27217
+ location?: Vector3;
27218
+ /**
27219
+ * @remarks
27220
+ * If specified, only includes shapes that are less than this
27221
+ * distance away from the location specified in the location
27222
+ * property.
27223
+ *
27224
+ */
27225
+ maxDistance?: number;
27226
+ /**
27227
+ * @remarks
27228
+ * If specified, only includes shapes that are at least this
27229
+ * distance away from the location specified in the location
27230
+ * property.
27231
+ *
27232
+ */
27233
+ minDistance?: number;
27234
+ }
27235
+
25198
27236
  /**
25199
27237
  * Key frame that holds the progress of the camera animation.
25200
27238
  */
@@ -25516,6 +27554,136 @@ export interface ScriptEventMessageFilterOptions {
25516
27554
  namespaces: string[];
25517
27555
  }
25518
27556
 
27557
+ /**
27558
+ * @beta
27559
+ * Duration metadata declared in a sound definition.
27560
+ */
27561
+ export interface SoundDefinitionDurationInfo {
27562
+ /**
27563
+ * @remarks
27564
+ * Total duration of the sound in seconds, as declared in the
27565
+ * sound definition.
27566
+ *
27567
+ */
27568
+ duration: number;
27569
+ }
27570
+
27571
+ /**
27572
+ * @beta
27573
+ * Criteria used to narrow a set of sound definitions. Each
27574
+ * field is optional and applies its constraint only when
27575
+ * defined; a definition must satisfy every defined field to
27576
+ * pass.
27577
+ */
27578
+ export interface SoundDefinitionFilter {
27579
+ /**
27580
+ * @remarks
27581
+ * Artist names to match against the definition's
27582
+ * music_info.artist. Comparison is case-insensitive. When
27583
+ * defined as a non-empty array, a definition passes only when
27584
+ * its declared artist matches one of the supplied values. When
27585
+ * undefined, no constraint on artist is applied.
27586
+ *
27587
+ */
27588
+ artists?: string[];
27589
+ /**
27590
+ * @remarks
27591
+ * Genres to match against the definition's music_info.genres.
27592
+ * Comparison is case-insensitive. When defined as a non-empty
27593
+ * array, a definition passes only when at least one of its
27594
+ * declared genres matches one of the supplied values. When
27595
+ * undefined, no constraint on genres is applied.
27596
+ *
27597
+ */
27598
+ genres?: string[];
27599
+ /**
27600
+ * @remarks
27601
+ * Upper bound in seconds, inclusive. When defined, definitions
27602
+ * with a longer duration and definitions without a declared
27603
+ * duration are excluded. When undefined, no upper bound is
27604
+ * applied.
27605
+ *
27606
+ */
27607
+ maxDuration?: number;
27608
+ /**
27609
+ * @remarks
27610
+ * Lower bound in seconds, inclusive. When defined, definitions
27611
+ * with a shorter duration and definitions without a declared
27612
+ * duration are excluded. When undefined, no lower bound is
27613
+ * applied.
27614
+ *
27615
+ */
27616
+ minDuration?: number;
27617
+ /**
27618
+ * @remarks
27619
+ * Moods to match against the definition's music_info.moods.
27620
+ * Comparison is case-insensitive. When defined as a non-empty
27621
+ * array, a definition passes only when at least one of its
27622
+ * declared moods matches one of the supplied values. When
27623
+ * undefined, no constraint on moods is applied.
27624
+ *
27625
+ */
27626
+ moods?: string[];
27627
+ /**
27628
+ * @remarks
27629
+ * Tag constraints to match against the definition's tags.
27630
+ * Comparisons of tag names and values are case-insensitive.
27631
+ * When defined as a non-empty record, a definition passes only
27632
+ * when, for each entry with a non-empty value array, the tag
27633
+ * name is present on the definition with at least one matching
27634
+ * value. When undefined, no constraint on tags is applied.
27635
+ *
27636
+ */
27637
+ tags?: Record<string, string[]>;
27638
+ /**
27639
+ * @remarks
27640
+ * Titles to match against the definition's music_info.title.
27641
+ * Comparison is case-insensitive. When defined as a non-empty
27642
+ * array, a definition passes only when its declared title
27643
+ * matches one of the supplied values. When undefined, no
27644
+ * constraint on title is applied.
27645
+ *
27646
+ */
27647
+ titles?: string[];
27648
+ }
27649
+
27650
+ /**
27651
+ * @beta
27652
+ * Music metadata declared on a sound definition. Each field is
27653
+ * optional and is undefined when the sound definition does not
27654
+ * declare a value for it.
27655
+ */
27656
+ export interface SoundDefinitionMusicInfo {
27657
+ /**
27658
+ * @remarks
27659
+ * Artist declared for this sound. Undefined when no artist was
27660
+ * declared.
27661
+ *
27662
+ */
27663
+ artist?: string;
27664
+ /**
27665
+ * @remarks
27666
+ * Genres declared for this sound. Undefined when no genres
27667
+ * were declared.
27668
+ *
27669
+ */
27670
+ genres?: string[];
27671
+ /**
27672
+ * @remarks
27673
+ * Moods declared for this sound. Undefined when no moods were
27674
+ * declared.
27675
+ *
27676
+ */
27677
+ moods?: string[];
27678
+ /**
27679
+ * @remarks
27680
+ * Title declared for this sound. Undefined when no title was
27681
+ * declared.
27682
+ *
27683
+ */
27684
+ title?: string;
27685
+ }
27686
+
25519
27687
  /**
25520
27688
  * Contains additional options for spawning an Entity.
25521
27689
  */
@@ -25947,6 +28115,19 @@ export interface WaypointTextureSelector {
25947
28115
  * Contains additional options for a playSound occurrence.
25948
28116
  */
25949
28117
  export interface WorldSoundOptions {
28118
+ /**
28119
+ * @beta
28120
+ * @remarks
28121
+ * Number of additional times to repeat the sound after the
28122
+ * initial play. `0` (the default) plays the sound once, `-1`
28123
+ * loops it forever, and a positive integer `N` plays the sound
28124
+ * `N + 1` times in total. For example, `loopCount: 1` plays
28125
+ * the sound twice. The loop count is fixed when the sound
28126
+ * starts and cannot be changed afterward. When using `-1`, see
28127
+ * `SoundInstance` for handle lifetime requirements.
28128
+ *
28129
+ */
28130
+ loopCount?: number;
25950
28131
  /**
25951
28132
  * @remarks
25952
28133
  * Pitch of the sound played.
@@ -26136,6 +28317,17 @@ export class EntitySpawnError extends Error {
26136
28317
  private constructor();
26137
28318
  }
26138
28319
 
28320
+ /**
28321
+ * @beta
28322
+ * Error thrown by {@link FogSettings} operations when the fog
28323
+ * stack limit is exceeded or an invalid fog identifier is
28324
+ * provided.
28325
+ */
28326
+ // @ts-ignore Class inheritance allowed for native defined classes
28327
+ export class FogSettingsError extends Error {
28328
+ private constructor();
28329
+ }
28330
+
26139
28331
  /**
26140
28332
  * The error can occur when a block is invalid. This can also
26141
28333
  * occur when accessing components on a block that doesn't have