@minecraft/server 2.11.0-rc.1.26.60-preview.21 → 2.12.0-beta.1.26.60-preview.21

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 +2964 -149
  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.11.0"
19
+ * "version": "2.12.0-beta"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -89,6 +89,10 @@ export enum BlockComponentTypes {
89
89
  *
90
90
  */
91
91
  PrecipitationInteractions = 'minecraft:precipitation_interactions',
92
+ /**
93
+ * @beta
94
+ */
95
+ RecipeCrafting = 'minecraft:recipe_crafting',
92
96
  /**
93
97
  * @remarks
94
98
  * Represents a block that can play a record.
@@ -385,6 +389,13 @@ export enum CustomCommandErrorReason {
385
389
  *
386
390
  */
387
391
  RegistryReadOnly = 'RegistryReadOnly',
392
+ /**
393
+ * @beta
394
+ * @remarks
395
+ * Non enum type command parameters cannot use enumName.
396
+ *
397
+ */
398
+ UnexpectedEnumName = 'UnexpectedEnumName',
388
399
  }
389
400
 
390
401
  /**
@@ -1120,6 +1131,14 @@ export enum EntityComponentTypes {
1120
1131
  *
1121
1132
  */
1122
1133
  NavigationWalk = 'minecraft:navigation.walk',
1134
+ /**
1135
+ * @beta
1136
+ * @remarks
1137
+ * Adds NPC capabilities to an entity such as custom skin,
1138
+ * name, and dialogue interactions.
1139
+ *
1140
+ */
1141
+ Npc = 'minecraft:npc',
1123
1142
  /**
1124
1143
  * @remarks
1125
1144
  * When present on an entity, this entity is on fire.
@@ -1603,6 +1622,14 @@ export enum EntitySwingSource {
1603
1622
  * and mainhand slots.
1604
1623
  */
1605
1624
  export enum EquipmentSlot {
1625
+ /**
1626
+ * @beta
1627
+ * @remarks
1628
+ * The body slot. This slot is used to hold armor for
1629
+ * non-humanoid mobs.
1630
+ *
1631
+ */
1632
+ Body = 'Body',
1606
1633
  /**
1607
1634
  * @remarks
1608
1635
  * The chest slot. This slot is used to hold items such as
@@ -1872,6 +1899,14 @@ export enum GameRule {
1872
1899
  *
1873
1900
  */
1874
1901
  PlayersSleepingPercentage = 'playersSleepingPercentage',
1902
+ /**
1903
+ * @beta
1904
+ * @remarks
1905
+ * Controls which player waypoints are automatically added to
1906
+ * the players locator bar.
1907
+ *
1908
+ */
1909
+ PlayerWaypoints = 'playerWaypoints',
1875
1910
  /**
1876
1911
  * @remarks
1877
1912
  * Controls whether projectiles (entities with a projectile
@@ -2697,6 +2732,42 @@ export enum PlayerSplitScreenSlot {
2697
2732
  Third = 'Third',
2698
2733
  }
2699
2734
 
2735
+ /**
2736
+ * @beta
2737
+ */
2738
+ export enum PlayerWaypointsMode {
2739
+ Everyone = 'Everyone',
2740
+ Off = 'Off',
2741
+ }
2742
+
2743
+ /**
2744
+ * @beta
2745
+ * Specifies how a block point-of-interest query filters
2746
+ * instances by ticket occupancy.
2747
+ */
2748
+ export enum PoiBlockOccupancyFilter {
2749
+ /**
2750
+ * @remarks
2751
+ * Includes POI instances regardless of their occupancy or
2752
+ * available ticket count.
2753
+ *
2754
+ */
2755
+ Any = 'Any',
2756
+ /**
2757
+ * @remarks
2758
+ * Includes POI instances with no available tickets.
2759
+ *
2760
+ */
2761
+ Full = 'Full',
2762
+ /**
2763
+ * @remarks
2764
+ * Includes POI instances with at least one ticket available to
2765
+ * be claimed.
2766
+ *
2767
+ */
2768
+ HasVacancy = 'HasVacancy',
2769
+ }
2770
+
2700
2771
  /**
2701
2772
  * Contains objectives and participants for the scoreboard.
2702
2773
  */
@@ -3022,6 +3093,29 @@ export enum TintMethod {
3022
3093
  Water = 'Water',
3023
3094
  }
3024
3095
 
3096
+ /**
3097
+ * @beta
3098
+ * An enumeration with the reason that a watchdog is deciding
3099
+ * to terminate execution of a behavior packs' script.
3100
+ */
3101
+ export enum WatchdogTerminateReason {
3102
+ /**
3103
+ * @remarks
3104
+ * Script runtime for a behavior pack is terminated due to
3105
+ * non-responsiveness from script (a hang or infinite loop).
3106
+ *
3107
+ */
3108
+ Hang = 'Hang',
3109
+ /**
3110
+ * @remarks
3111
+ * Script runtime for a behavior pack is terminated due to a
3112
+ * stack overflow (a long, and potentially infinite) chain of
3113
+ * function calls.
3114
+ *
3115
+ */
3116
+ StackOverflow = 'StackOverflow',
3117
+ }
3118
+
3025
3119
  /**
3026
3120
  * Enum representing different texture icons that can be
3027
3121
  * displayed for waypoints on the locator bar.
@@ -3096,12 +3190,14 @@ export type BlockComponentTypeMap = {
3096
3190
  'minecraft:movable': BlockMovableComponent;
3097
3191
  'minecraft:piston': BlockPistonComponent;
3098
3192
  'minecraft:precipitation_interactions': BlockPrecipitationInteractionsComponent;
3193
+ 'minecraft:recipe_crafting': BlockRecipeCraftingComponent;
3099
3194
  'minecraft:record_player': BlockRecordPlayerComponent;
3100
3195
  'minecraft:redstone_producer': BlockRedstoneProducerComponent;
3101
3196
  'minecraft:sign': BlockSignComponent;
3102
3197
  movable: BlockMovableComponent;
3103
3198
  piston: BlockPistonComponent;
3104
3199
  precipitation_interactions: BlockPrecipitationInteractionsComponent;
3200
+ recipe_crafting: BlockRecipeCraftingComponent;
3105
3201
  record_player: BlockRecordPlayerComponent;
3106
3202
  redstone_producer: BlockRedstoneProducerComponent;
3107
3203
  sign: BlockSignComponent;
@@ -3208,6 +3304,7 @@ export type EntityComponentTypeMap = {
3208
3304
  'minecraft:navigation.generic': EntityNavigationGenericComponent;
3209
3305
  'minecraft:navigation.hover': EntityNavigationHoverComponent;
3210
3306
  'minecraft:navigation.walk': EntityNavigationWalkComponent;
3307
+ 'minecraft:npc': EntityNpcComponent;
3211
3308
  'minecraft:onfire': EntityOnFireComponent;
3212
3309
  'minecraft:player.exhaustion': EntityExhaustionComponent;
3213
3310
  'minecraft:player.hunger': EntityHungerComponent;
@@ -3241,6 +3338,7 @@ export type EntityComponentTypeMap = {
3241
3338
  'navigation.generic': EntityNavigationGenericComponent;
3242
3339
  'navigation.hover': EntityNavigationHoverComponent;
3243
3340
  'navigation.walk': EntityNavigationWalkComponent;
3341
+ npc: EntityNpcComponent;
3244
3342
  onfire: EntityOnFireComponent;
3245
3343
  'player.exhaustion': EntityExhaustionComponent;
3246
3344
  'player.hunger': EntityHungerComponent;
@@ -3260,6 +3358,15 @@ export type EntityComponentTypeMap = {
3260
3358
  wants_jockey: EntityWantsJockeyComponent;
3261
3359
  };
3262
3360
 
3361
+ /**
3362
+ * @beta
3363
+ */
3364
+ export type EntityIdentifierType<T> = [T] extends [never]
3365
+ ? VanillaEntityIdentifier
3366
+ : T extends string
3367
+ ? VanillaEntityIdentifier | T
3368
+ : never;
3369
+
3263
3370
  export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
3264
3371
  ? ItemComponentTypeMap[T]
3265
3372
  : ItemCustomComponentInstance;
@@ -3287,6 +3394,15 @@ export type ItemComponentTypeMap = {
3287
3394
  potion: ItemPotionComponent;
3288
3395
  };
3289
3396
 
3397
+ /**
3398
+ * @beta
3399
+ */
3400
+ export type VanillaEntityIdentifier =
3401
+ | EntityType
3402
+ | minecraftvanilladata.MinecraftEntityTypes
3403
+ | `${minecraftvanilladata.MinecraftEntityTypes}`
3404
+ | `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
3405
+
3290
3406
  /**
3291
3407
  * Handle to an aim-assist category that exists in the
3292
3408
  * world.aimAssist registry.
@@ -3444,7 +3560,9 @@ export class AimAssistCategorySettings {
3444
3560
  * A record mapping block Ids to their priority settings.
3445
3561
  * Larger numbers have greater priority.
3446
3562
  */
3447
- setBlockPriorities(blockPriorities: Record<string, number>): void;
3563
+ setBlockPriorities(
3564
+ blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
3565
+ ): void;
3448
3566
  /**
3449
3567
  * @remarks
3450
3568
  * Sets the priority settings used for block targeting.
@@ -3463,7 +3581,9 @@ export class AimAssistCategorySettings {
3463
3581
  * A record mapping entity Ids to their priority settings.
3464
3582
  * Larger numbers have greater priority.
3465
3583
  */
3466
- setEntityPriorities(entityPriorities: Record<string, number>): void;
3584
+ setEntityPriorities(
3585
+ entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
3586
+ ): void;
3467
3587
  /**
3468
3588
  * @remarks
3469
3589
  * Sets the priority settings used for entity targeting.
@@ -3662,8 +3782,10 @@ export class AimAssistPresetSettings {
3662
3782
  *
3663
3783
  * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
3664
3784
  *
3785
+ * @param targets
3786
+ * An array of block tags.
3665
3787
  */
3666
- setExcludedBlockTagTargets(blockTagTargets?: string[]): void;
3788
+ setExcludedBlockTagTargets(targets?: string[]): void;
3667
3789
  /**
3668
3790
  * @remarks
3669
3791
  * Sets the list of block Ids to exclude from aim assist
@@ -3671,8 +3793,10 @@ export class AimAssistPresetSettings {
3671
3793
  *
3672
3794
  * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
3673
3795
  *
3796
+ * @param targets
3797
+ * An array of block Ids.
3674
3798
  */
3675
- setExcludedBlockTargets(blockTargets?: string[]): void;
3799
+ setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
3676
3800
  /**
3677
3801
  * @remarks
3678
3802
  * Sets the list of entity Ids to exclude from aim assist
@@ -3680,8 +3804,10 @@ export class AimAssistPresetSettings {
3680
3804
  *
3681
3805
  * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
3682
3806
  *
3807
+ * @param targets
3808
+ * An array of entity Ids.
3683
3809
  */
3684
- setExcludedEntityTargets(entityTargets?: string[]): void;
3810
+ setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
3685
3811
  /**
3686
3812
  * @remarks
3687
3813
  * Sets the list of entity type families to exclude from aim
@@ -3689,8 +3815,10 @@ export class AimAssistPresetSettings {
3689
3815
  *
3690
3816
  * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
3691
3817
  *
3818
+ * @param targets
3819
+ * An array of entity type families.
3692
3820
  */
3693
- setExcludedEntityTypeFamilyTargets(entityTypeFamilyTargets?: string[]): void;
3821
+ setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
3694
3822
  /**
3695
3823
  * @remarks
3696
3824
  * Sets the per-item aim-assist category Ids.
@@ -3701,7 +3829,7 @@ export class AimAssistPresetSettings {
3701
3829
  * A record mapping item Ids to aim-assist category Ids.
3702
3830
  * Category Ids must have a namespace.
3703
3831
  */
3704
- setItemSettings(itemSettings: Record<string, string>): void;
3832
+ setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
3705
3833
  /**
3706
3834
  * @remarks
3707
3835
  * Sets the list of item Ids that will target liquid blocks
@@ -3712,7 +3840,7 @@ export class AimAssistPresetSettings {
3712
3840
  * @param items
3713
3841
  * An array of item Ids.
3714
3842
  */
3715
- setLiquidTargetingItems(items?: string[]): void;
3843
+ setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
3716
3844
  }
3717
3845
 
3718
3846
  /**
@@ -3818,6 +3946,28 @@ export class AimAssistRegistry {
3818
3946
  getPresets(): AimAssistPreset[];
3819
3947
  }
3820
3948
 
3949
+ /**
3950
+ * @beta
3951
+ * Describes a single banner pattern, which includes a colour
3952
+ * and a pattern type.
3953
+ */
3954
+ export class BannerPattern {
3955
+ private constructor();
3956
+ /**
3957
+ * @remarks
3958
+ * The color to apply to this banner pattern.
3959
+ *
3960
+ */
3961
+ readonly color: string;
3962
+ /**
3963
+ * @remarks
3964
+ * The pattern type (e.g. gradient, chevron, cross, etc.) to
3965
+ * apply to the banner.
3966
+ *
3967
+ */
3968
+ readonly pattern: string;
3969
+ }
3970
+
3821
3971
  /**
3822
3972
  * Describes a type of biome.
3823
3973
  */
@@ -3911,6 +4061,20 @@ export class Block {
3911
4061
  * {@link LocationOutOfWorldBoundariesError}
3912
4062
  */
3913
4063
  readonly isLiquid: boolean;
4064
+ /**
4065
+ * @beta
4066
+ * @remarks
4067
+ * Returns true if this block is solid and impassible - (e.g.,
4068
+ * a cobblestone block and a diamond block are solid, while a
4069
+ * ladder block and a fence block are not).
4070
+ *
4071
+ * @throws This property can throw when used.
4072
+ *
4073
+ * {@link LocationInUnloadedChunkError}
4074
+ *
4075
+ * {@link LocationOutOfWorldBoundariesError}
4076
+ */
4077
+ readonly isSolid: boolean;
3914
4078
  /**
3915
4079
  * @remarks
3916
4080
  * Returns true if this reference to a block is still valid
@@ -4076,6 +4240,30 @@ export class Block {
4076
4240
  * {@link LocationOutOfWorldBoundariesError}
4077
4241
  */
4078
4242
  canContainLiquid(liquidType: LiquidType): boolean;
4243
+ /**
4244
+ * @beta
4245
+ * @remarks
4246
+ * Checks to see whether it is valid to place the specified
4247
+ * block type or block permutation, on a specified face on this
4248
+ * block.
4249
+ *
4250
+ * @param blockToPlace
4251
+ * Block type or block permutation to check placement for.
4252
+ * @param faceToPlaceOn
4253
+ * Optional specific face of this block to check placement
4254
+ * against.
4255
+ * @returns
4256
+ * Returns `true` if the block type or permutation can be
4257
+ * placed on this block, else `false`.
4258
+ * @throws This function can throw errors.
4259
+ *
4260
+ * {@link Error}
4261
+ *
4262
+ * {@link LocationInUnloadedChunkError}
4263
+ *
4264
+ * {@link LocationOutOfWorldBoundariesError}
4265
+ */
4266
+ canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
4079
4267
  /**
4080
4268
  * @remarks
4081
4269
  * Returns the {@link Vector3} of the center of this block on
@@ -4172,6 +4360,15 @@ export class Block {
4172
4360
  * {@link LocationInUnloadedChunkError}
4173
4361
  */
4174
4362
  getLightLevel(): number;
4363
+ /**
4364
+ * @beta
4365
+ * @throws This function can throw errors.
4366
+ *
4367
+ * {@link LocationInUnloadedChunkError}
4368
+ *
4369
+ * {@link LocationOutOfWorldBoundariesError}
4370
+ */
4371
+ getMapColor(): RGBA;
4175
4372
  /**
4176
4373
  * @remarks
4177
4374
  * Returns array of all loaded block parts if this block has
@@ -4452,6 +4649,27 @@ export class Block {
4452
4649
  * {@link LocationOutOfWorldBoundariesError}
4453
4650
  */
4454
4651
  south(steps?: number): Block | undefined;
4652
+ /**
4653
+ * @beta
4654
+ * @remarks
4655
+ * Tries to set the block in the dimension to the state of the
4656
+ * permutation by first checking if the placement is valid.
4657
+ *
4658
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4659
+ *
4660
+ * @param permutation
4661
+ * Permutation that contains a set of property states for the
4662
+ * Block.
4663
+ * @returns
4664
+ * Returns `true` if the block permutation data was
4665
+ * successfully set, else `false`.
4666
+ * @throws This function can throw errors.
4667
+ *
4668
+ * {@link LocationInUnloadedChunkError}
4669
+ *
4670
+ * {@link LocationOutOfWorldBoundariesError}
4671
+ */
4672
+ trySetPermutation(permutation: BlockPermutation): boolean;
4455
4673
  /**
4456
4674
  * @remarks
4457
4675
  * Returns the {@link Block} to the west of this block
@@ -4469,6 +4687,137 @@ export class Block {
4469
4687
  west(steps?: number): Block | undefined;
4470
4688
  }
4471
4689
 
4690
+ /**
4691
+ * @beta
4692
+ * Bounding Box Utils is a utility class that provides a number
4693
+ * of useful functions for the creation and utility of
4694
+ * {@link BlockBoundingBox} objects
4695
+ */
4696
+ export class BlockBoundingBoxUtils {
4697
+ private constructor();
4698
+ /**
4699
+ * @remarks
4700
+ * Create a validated instance of a {@link BlockBoundingBox}
4701
+ * where the min and max components are guaranteed to be (min
4702
+ * <= max)
4703
+ *
4704
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4705
+ *
4706
+ * @param min
4707
+ * A corner world location
4708
+ * @param max
4709
+ * A corner world location diametrically opposite
4710
+ */
4711
+ static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
4712
+ /**
4713
+ * @remarks
4714
+ * Expand a {@link BlockBoundingBox} by a given amount along
4715
+ * each axis.
4716
+ * Sizes can be negative to perform contraction.
4717
+ * Note: corners can be inverted if the contraction size is
4718
+ * greater than the span, but the min/max relationship will
4719
+ * remain correct
4720
+ *
4721
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4722
+ *
4723
+ * @returns
4724
+ * Return a new {@link BlockBoundingBox} object representing
4725
+ * the changes
4726
+ */
4727
+ static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
4728
+ /**
4729
+ * @remarks
4730
+ * Check if two {@link BlockBoundingBox} objects are identical
4731
+ *
4732
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4733
+ *
4734
+ */
4735
+ static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4736
+ /**
4737
+ * @remarks
4738
+ * Expand the initial box object bounds to include the 2nd box
4739
+ * argument. The resultant {@link BlockBoundingBox} object
4740
+ * will be a BlockBoundingBox which exactly encompasses the two
4741
+ * boxes.
4742
+ *
4743
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4744
+ *
4745
+ * @returns
4746
+ * A new {@link BlockBoundingBox} instance representing the
4747
+ * smallest possible bounding box which can encompass both
4748
+ */
4749
+ static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
4750
+ /**
4751
+ * @remarks
4752
+ * Calculate the center block of a given
4753
+ * {@link BlockBoundingBox} object.
4754
+ *
4755
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4756
+ *
4757
+ * @returns
4758
+ * Note that {@link BlockBoundingBox} objects represent whole
4759
+ * blocks, so the center of boxes which have odd numbered
4760
+ * bounds are not mathematically centered...
4761
+ * i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
4762
+ * center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
4763
+ */
4764
+ static getCenter(box: BlockBoundingBox): Vector3;
4765
+ /**
4766
+ * @remarks
4767
+ * Calculate the BlockBoundingBox which represents the union
4768
+ * area of two intersecting BlockBoundingBoxes
4769
+ *
4770
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4771
+ *
4772
+ */
4773
+ static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
4774
+ /**
4775
+ * @remarks
4776
+ * Get the Span of each of the BlockBoundingBox Axis components
4777
+ *
4778
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4779
+ *
4780
+ */
4781
+ static getSpan(box: BlockBoundingBox): Vector3;
4782
+ /**
4783
+ * @remarks
4784
+ * Check to see if two BlockBoundingBox objects intersect
4785
+ *
4786
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4787
+ *
4788
+ */
4789
+ static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4790
+ /**
4791
+ * @remarks
4792
+ * Check to see if a given coordinate is inside a
4793
+ * BlockBoundingBox
4794
+ *
4795
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4796
+ *
4797
+ */
4798
+ static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
4799
+ /**
4800
+ * @remarks
4801
+ * Check to see if a BlockBoundingBox is valid (i.e. (min <=
4802
+ * max))
4803
+ *
4804
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4805
+ *
4806
+ */
4807
+ static isValid(box: BlockBoundingBox): boolean;
4808
+ /**
4809
+ * @remarks
4810
+ * Move a BlockBoundingBox by a given amount
4811
+ *
4812
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
4813
+ *
4814
+ * @returns
4815
+ * Return a new BlockBoundingBox object which represents the
4816
+ * change
4817
+ */
4818
+ static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
4819
+ }
4820
+
4472
4821
  /**
4473
4822
  * Base type for components associated with blocks.
4474
4823
  */
@@ -4691,6 +5040,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
4691
5040
  // @ts-ignore Class inheritance allowed for native defined classes
4692
5041
  export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
4693
5042
  private constructor();
5043
+ /**
5044
+ * @beta
5045
+ * @remarks
5046
+ * The first update event for the redstone component.
5047
+ *
5048
+ */
5049
+ readonly firstUpdate: boolean;
4694
5050
  /**
4695
5051
  * @remarks
4696
5052
  * The redstone signal strength passing through this block. It
@@ -5247,6 +5603,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
5247
5603
  *
5248
5604
  */
5249
5605
  [Symbol.iterator](): Iterator<Vector3>;
5606
+ /**
5607
+ * @beta
5608
+ * @remarks
5609
+ * Checks if the underlining block volume has been invalidated.
5610
+ * Will return false if the block volume was modified between
5611
+ * creating the iterator and iterating it, and true otherwise.
5612
+ *
5613
+ * @throws This function can throw errors.
5614
+ *
5615
+ * {@link minecraftcommon.EngineError}
5616
+ */
5617
+ isValid(): boolean;
5250
5618
  /**
5251
5619
  * @remarks
5252
5620
  * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
@@ -5645,6 +6013,41 @@ export class BlockPrecipitationInteractionsComponent extends BlockComponent {
5645
6013
  obstructsRain(): boolean;
5646
6014
  }
5647
6015
 
6016
+ /**
6017
+ * @beta
6018
+ * Represents a block component that provides access to recipe
6019
+ * crafting.
6020
+ */
6021
+ // @ts-ignore Class inheritance allowed for native defined classes
6022
+ export class BlockRecipeCraftingComponent extends BlockComponent {
6023
+ private constructor();
6024
+ /**
6025
+ * @remarks
6026
+ * Returns an array of all players currently interacting with
6027
+ * this block.
6028
+ *
6029
+ */
6030
+ readonly players: Player[];
6031
+ static readonly componentId = 'minecraft:recipe_crafting';
6032
+ /**
6033
+ * @remarks
6034
+ * Gets the recipe crafting context for a player interacting
6035
+ * with this block.
6036
+ *
6037
+ * @param player
6038
+ * The player for whom to retrieve the crafting context.
6039
+ * @returns
6040
+ * The current recipe crafting context for the player, or
6041
+ * undefined if the player isn't crafting.
6042
+ * @throws This function can throw errors.
6043
+ *
6044
+ * {@link minecraftcommon.EngineError}
6045
+ *
6046
+ * {@link InvalidEntityError}
6047
+ */
6048
+ getCraftingContext(player: Player): RecipeCraftingContext | undefined;
6049
+ }
6050
+
5648
6051
  /**
5649
6052
  * Represents a block that can play a record.
5650
6053
  */
@@ -6162,6 +6565,15 @@ export class BlockVolumeBase {
6162
6565
  *
6163
6566
  */
6164
6567
  getBlockLocationIterator(): BlockLocationIterator;
6568
+ /**
6569
+ * @beta
6570
+ * @remarks
6571
+ * Return a {@link BlockBoundingBox} object which represents
6572
+ * the validated min and max coordinates of the volume
6573
+ *
6574
+ * @throws This function can throw errors.
6575
+ */
6576
+ getBoundingBox(): BlockBoundingBox;
6165
6577
  /**
6166
6578
  * @remarks
6167
6579
  * Return the capacity (volume) of the BlockVolume (W*D*H)
@@ -6436,6 +6848,23 @@ export class Camera {
6436
6848
  | CameraSetRotOptions
6437
6849
  | CameraTargetOptions,
6438
6850
  ): void;
6851
+ /**
6852
+ * @beta
6853
+ * @remarks
6854
+ * Sets the current active camera with easing.
6855
+ *
6856
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
6857
+ *
6858
+ * @param cameraPreset
6859
+ * Identifier of a camera preset file defined within JSON.
6860
+ * @param easeOptions
6861
+ * Options to ease the camera from the previous camera to the
6862
+ * current one.
6863
+ * @throws
6864
+ * Throws when easing to minecraft:first_person presets
6865
+ * currently without the experimental cameras toggle enabled.
6866
+ */
6867
+ setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
6439
6868
  /**
6440
6869
  * @remarks
6441
6870
  * Sets the current active camera for the specified player and
@@ -6471,6 +6900,24 @@ export class Camera {
6471
6900
  stopShaking(): void;
6472
6901
  }
6473
6902
 
6903
+ /**
6904
+ * @beta
6905
+ * Loot item function that will try to copy the block entity
6906
+ * data from the destroyed block to the dropped item.
6907
+ */
6908
+ // @ts-ignore Class inheritance allowed for native defined classes
6909
+ export class CarryOverBlockEntityDataFunction extends LootItemFunction {
6910
+ private constructor();
6911
+ /**
6912
+ * @remarks
6913
+ * If true, and if the block entity had dynamic_properties, the
6914
+ * function will copy the dynamic properties from the block
6915
+ * entity to the dropped item.
6916
+ *
6917
+ */
6918
+ readonly dynamicProperties: boolean;
6919
+ }
6920
+
6474
6921
  /**
6475
6922
  * CatmullRom spline creation.
6476
6923
  */
@@ -6486,16 +6933,175 @@ export class CatmullRomSpline {
6486
6933
  }
6487
6934
 
6488
6935
  /**
6489
- * Contains the device information for a client instance.
6936
+ * @beta
6937
+ * An event that fires as players enter chat messages.
6490
6938
  */
6491
- // @ts-ignore Class inheritance allowed for native defined classes
6492
- export class ClientSystemInfo extends SystemInfo {
6939
+ export class ChatSendAfterEvent {
6493
6940
  private constructor();
6494
6941
  /**
6495
6942
  * @remarks
6496
- * The locale selected by the client (e.g., en_US, fr_FR,
6497
- * ja_JP). Note that in most cases, server scripts should not
6498
- * use this property to manually localize text. Instead, use
6943
+ * Message that is being broadcast.
6944
+ *
6945
+ */
6946
+ readonly message: string;
6947
+ /**
6948
+ * @remarks
6949
+ * Player that sent the chat message.
6950
+ *
6951
+ */
6952
+ readonly sender: Player;
6953
+ /**
6954
+ * @remarks
6955
+ * Optional list of players that will receive this message. If
6956
+ * defined, this message is directly targeted to one or more
6957
+ * players (i.e., is not broadcast.)
6958
+ *
6959
+ */
6960
+ readonly targets?: Player[];
6961
+ }
6962
+
6963
+ /**
6964
+ * @beta
6965
+ * Manages callbacks that are connected to chat messages being
6966
+ * sent.
6967
+ */
6968
+ export class ChatSendAfterEventSignal {
6969
+ private constructor();
6970
+ /**
6971
+ * @remarks
6972
+ * Adds a callback that will be called when new chat messages
6973
+ * are sent.
6974
+ *
6975
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
6976
+ *
6977
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
6978
+ *
6979
+ */
6980
+ subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
6981
+ /**
6982
+ * @remarks
6983
+ * Removes a callback from being called when new chat messages
6984
+ * are sent.
6985
+ *
6986
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
6987
+ *
6988
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
6989
+ *
6990
+ */
6991
+ unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
6992
+ }
6993
+
6994
+ /**
6995
+ * @beta
6996
+ * An event that fires as players enter chat messages.
6997
+ */
6998
+ export class ChatSendBeforeEvent {
6999
+ private constructor();
7000
+ /**
7001
+ * @remarks
7002
+ * If set to true in a beforeChat event handler, this message
7003
+ * is not broadcast out.
7004
+ *
7005
+ */
7006
+ cancel: boolean;
7007
+ /**
7008
+ * @remarks
7009
+ * Message that is being broadcast.
7010
+ *
7011
+ */
7012
+ readonly message: string;
7013
+ /**
7014
+ * @remarks
7015
+ * Player that sent the chat message.
7016
+ *
7017
+ */
7018
+ readonly sender: Player;
7019
+ /**
7020
+ * @remarks
7021
+ * Optional list of players that will receive this message. If
7022
+ * defined, this message is directly targeted to one or more
7023
+ * players (i.e., is not broadcast). This list can be modified
7024
+ * to change the message recipients.
7025
+ *
7026
+ */
7027
+ targets?: Player[];
7028
+ }
7029
+
7030
+ /**
7031
+ * @beta
7032
+ * Manages callbacks that are connected to an event that fires
7033
+ * before chat messages are sent.
7034
+ * @example customCommand.ts
7035
+ * ```typescript
7036
+ * import { world, DimensionLocation } from '@minecraft/server';
7037
+ *
7038
+ * function customCommand(targetLocation: DimensionLocation) {
7039
+ * const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
7040
+ * if (eventData.message.includes('cancel')) {
7041
+ * // Cancel event if the message contains "cancel"
7042
+ * eventData.cancel = true;
7043
+ * } else {
7044
+ * const args = eventData.message.split(' ');
7045
+ *
7046
+ * if (args.length > 0) {
7047
+ * switch (args[0].toLowerCase()) {
7048
+ * case 'echo':
7049
+ * // Send a modified version of chat message
7050
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
7051
+ * break;
7052
+ * case 'help':
7053
+ * world.sendMessage(`Available commands: echo <message>`);
7054
+ * break;
7055
+ * }
7056
+ * }
7057
+ * }
7058
+ * });
7059
+ * }
7060
+ * ```
7061
+ */
7062
+ export class ChatSendBeforeEventSignal {
7063
+ private constructor();
7064
+ /**
7065
+ * @remarks
7066
+ * Adds a callback that will be called before new chat messages
7067
+ * are sent.
7068
+ *
7069
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
7070
+ *
7071
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
7072
+ *
7073
+ * @param callback
7074
+ * This closure is called with restricted-execution privilege.
7075
+ * @returns
7076
+ * Closure that is called with restricted-execution privilege.
7077
+ */
7078
+ subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
7079
+ /**
7080
+ * @remarks
7081
+ * Removes a callback from being called before new chat
7082
+ * messages are sent.
7083
+ *
7084
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
7085
+ *
7086
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
7087
+ *
7088
+ * @param callback
7089
+ * This closure is called with restricted-execution privilege.
7090
+ */
7091
+ unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
7092
+ }
7093
+
7094
+ /**
7095
+ * Contains the device information for a client instance.
7096
+ */
7097
+ // @ts-ignore Class inheritance allowed for native defined classes
7098
+ export class ClientSystemInfo extends SystemInfo {
7099
+ private constructor();
7100
+ /**
7101
+ * @remarks
7102
+ * The locale selected by the client (e.g., en_US, fr_FR,
7103
+ * ja_JP). Note that in most cases, server scripts should not
7104
+ * use this property to manually localize text. Instead, use
6499
7105
  * {@link RawMessage} with a translate field to send
6500
7106
  * localization keys, allowing each client to resolve them in
6501
7107
  * their own language automatically. Direct use of locale for
@@ -6693,7 +7299,9 @@ export class Container {
6693
7299
  *
6694
7300
  * @param itemStack
6695
7301
  * The stack of items to add.
6696
- * @throws This function can throw errors.
7302
+ * @throws
7303
+ * Won't throw {@link ContainerRules} error for over weight
7304
+ * limit but will instead add items up to the weight limit.
6697
7305
  *
6698
7306
  * {@link ContainerRulesError}
6699
7307
  *
@@ -6931,6 +7539,8 @@ export class Container {
6931
7539
  * @throws
6932
7540
  * Throws if either this container or `toContainer` are invalid
6933
7541
  * or if the `fromSlot` or `toSlot` indices out of bounds.
7542
+ * Won't throw {@link ContainerRules} error for over weight
7543
+ * limit but will instead add items up to the weight limit.
6934
7544
  *
6935
7545
  * {@link ContainerRulesError}
6936
7546
  *
@@ -7557,6 +8167,15 @@ export class Dimension {
7557
8167
  *
7558
8168
  */
7559
8169
  readonly localizationKey: string;
8170
+ /**
8171
+ * @beta
8172
+ * @remarks
8173
+ * Provides access to point-of-interest (POI) managers for this
8174
+ * dimension. This property is available only when the POI
8175
+ * experiment is enabled.
8176
+ *
8177
+ */
8178
+ readonly poiManager: PoiManager;
7560
8179
  /**
7561
8180
  * @remarks
7562
8181
  * Calculates the location of the closest biome of a particular
@@ -7862,10 +8481,14 @@ export class Dimension {
7862
8481
  /**
7863
8482
  * @rc
7864
8483
  * @remarks
7865
- * Gets all the blocks in a volume that satisfy the filter.
8484
+ * Gets all the blocks in a volume that satisfy the block query
8485
+ * options.
7866
8486
  *
7867
8487
  * @param volume
7868
8488
  * Volume of blocks that will be checked.
8489
+ * @param options
8490
+ * Block query options including filter criteria and optional
8491
+ * closest/farthest distance sorting from a location.
7869
8492
  * @param allowUnloadedChunks
7870
8493
  * If set to true will suppress the UnloadedChunksError if some
7871
8494
  * or all of the block volume is outside of the loaded chunks.
@@ -7874,7 +8497,7 @@ export class Dimension {
7874
8497
  * Defaults to: false
7875
8498
  * @returns
7876
8499
  * Returns the ListBlockVolume that contains all the block
7877
- * locations that satisfied the block filter.
8500
+ * locations that satisfied the block query options.
7878
8501
  * @throws This function can throw errors.
7879
8502
  *
7880
8503
  * {@link minecraftcommon.ArgumentOutOfBoundsError}
@@ -7999,6 +8622,26 @@ export class Dimension {
7999
8622
  * {@link minecraftcommon.UnsupportedFunctionalityError}
8000
8623
  */
8001
8624
  getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
8625
+ /**
8626
+ * @beta
8627
+ * @remarks
8628
+ * Returns a vector of generated structures that contain the
8629
+ * specified location (ex: Pillager Outpost, Mineshaft, etc.).
8630
+ * The vector will be empty if no structures are found.
8631
+ *
8632
+ * @param location
8633
+ * Location at which to check for structures.
8634
+ * @throws
8635
+ * An error will be thrown if the location is out of world
8636
+ * bounds.
8637
+ * An error will be thrown if the location is in an unloaded
8638
+ * chunk.
8639
+ *
8640
+ * {@link LocationInUnloadedChunkError}
8641
+ *
8642
+ * {@link LocationOutOfWorldBoundariesError}
8643
+ */
8644
+ getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
8002
8645
  /**
8003
8646
  * @remarks
8004
8647
  * Returns the total brightness level of light shining on a
@@ -8060,6 +8703,16 @@ export class Dimension {
8060
8703
  * @throws This function can throw errors.
8061
8704
  */
8062
8705
  getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
8706
+ /**
8707
+ * @beta
8708
+ * @remarks
8709
+ * Returns the current weather.
8710
+ *
8711
+ * @returns
8712
+ * Returns a WeatherType that explains the broad category of
8713
+ * weather that is currently going on.
8714
+ */
8715
+ getWeather(): WeatherType;
8063
8716
  /**
8064
8717
  * @remarks
8065
8718
  * Returns true if the chunk at the given location is loaded
@@ -8305,7 +8958,11 @@ export class Dimension {
8305
8958
  * }
8306
8959
  * ```
8307
8960
  */
8308
- spawnEntity(identifier: EntityType | string, location: Vector3, options?: SpawnEntityOptions): Entity;
8961
+ spawnEntity<T = never>(
8962
+ identifier: EntityIdentifierType<NoInfer<T>>,
8963
+ location: Vector3,
8964
+ options?: SpawnEntityOptions,
8965
+ ): Entity;
8309
8966
  /**
8310
8967
  * @remarks
8311
8968
  * Creates a new item stack as an entity at the specified
@@ -8420,6 +9077,26 @@ export class Dimension {
8420
9077
  * {@link LocationOutOfWorldBoundariesError}
8421
9078
  */
8422
9079
  spawnXp(location: Vector3, amount: number): void;
9080
+ /**
9081
+ * @beta
9082
+ * @remarks
9083
+ * Stops all sounds from playing for all players.
9084
+ *
9085
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
9086
+ *
9087
+ */
9088
+ stopAllSounds(): void;
9089
+ /**
9090
+ * @beta
9091
+ * @remarks
9092
+ * Stops a sound from playing for all players.
9093
+ *
9094
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
9095
+ *
9096
+ * @param soundId
9097
+ * Identifier of the sound.
9098
+ */
9099
+ stopSound(soundId: string): void;
8423
9100
  }
8424
9101
 
8425
9102
  /**
@@ -9003,6 +9680,18 @@ export class Entity {
9003
9680
  *
9004
9681
  */
9005
9682
  readonly scoreboardIdentity?: ScoreboardIdentity;
9683
+ /**
9684
+ * @beta
9685
+ * @remarks
9686
+ * Retrieves or sets an entity that is used as the target of
9687
+ * AI-related behaviors, like attacking. If the entity
9688
+ * currently has no target returns undefined.
9689
+ *
9690
+ * @throws This property can throw when used.
9691
+ *
9692
+ * {@link InvalidEntityError}
9693
+ */
9694
+ readonly target?: Entity;
9006
9695
  /**
9007
9696
  * @remarks
9008
9697
  * Identifier of the type of the entity - for example,
@@ -10247,6 +10936,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
10247
10936
  // @ts-ignore Class inheritance allowed for native defined classes
10248
10937
  export class EntityBreathableComponent extends EntityComponent {
10249
10938
  private constructor();
10939
+ /**
10940
+ * @beta
10941
+ * @remarks
10942
+ * The current air supply of the entity.
10943
+ *
10944
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
10945
+ *
10946
+ * @throws
10947
+ * Will throw an error if the air supply is out of bounds
10948
+ * [suffocationTime, maxAirSupply].
10949
+ */
10950
+ airSupply: number;
10250
10951
  /**
10251
10952
  * @remarks
10252
10953
  * If true, this entity can breathe in air.
@@ -10275,6 +10976,14 @@ export class EntityBreathableComponent extends EntityComponent {
10275
10976
  * @throws This property can throw when used.
10276
10977
  */
10277
10978
  readonly breathesWater: boolean;
10979
+ /**
10980
+ * @beta
10981
+ * @remarks
10982
+ * If true, the entity is able to breathe.
10983
+ *
10984
+ * @throws This property can throw when used.
10985
+ */
10986
+ readonly canBreathe: boolean;
10278
10987
  /**
10279
10988
  * @remarks
10280
10989
  * If true, this entity will have visible bubbles while in
@@ -11487,6 +12196,28 @@ export class EntityIsStunnedComponent extends EntityComponent {
11487
12196
  // @ts-ignore Class inheritance allowed for native defined classes
11488
12197
  export class EntityIsTamedComponent extends EntityComponent {
11489
12198
  private constructor();
12199
+ /**
12200
+ * @beta
12201
+ * @remarks
12202
+ * Returns the player that has tamed the entity, or 'undefined'
12203
+ * if the entity has no player owner.
12204
+ *
12205
+ * @throws This property can throw when used.
12206
+ *
12207
+ * {@link InvalidEntityError}
12208
+ */
12209
+ readonly tamedToPlayer?: Player;
12210
+ /**
12211
+ * @beta
12212
+ * @remarks
12213
+ * Returns the id of the player that has tamed the entity, or
12214
+ * 'undefined' if the entity has no player owner.
12215
+ *
12216
+ * @throws This property can throw when used.
12217
+ *
12218
+ * {@link InvalidEntityError}
12219
+ */
12220
+ readonly tamedToPlayerId?: string;
11490
12221
  static readonly componentId = 'minecraft:is_tamed';
11491
12222
  }
11492
12223
 
@@ -12225,6 +12956,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
12225
12956
  static readonly componentId = 'minecraft:navigation.walk';
12226
12957
  }
12227
12958
 
12959
+ /**
12960
+ * @beta
12961
+ * Adds NPC capabilities to an entity such as custom skin,
12962
+ * name, and dialogue interactions.
12963
+ */
12964
+ // @ts-ignore Class inheritance allowed for native defined classes
12965
+ export class EntityNpcComponent extends EntityComponent {
12966
+ private constructor();
12967
+ /**
12968
+ * @remarks
12969
+ * The DialogueScene that is opened when players first interact
12970
+ * with the NPC.
12971
+ *
12972
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
12973
+ *
12974
+ */
12975
+ defaultScene: string;
12976
+ /**
12977
+ * @remarks
12978
+ * The name of the NPC as it is displayed to players.
12979
+ *
12980
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
12981
+ *
12982
+ */
12983
+ name: string;
12984
+ /**
12985
+ * @remarks
12986
+ * The index of the skin the NPC will use.
12987
+ *
12988
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
12989
+ *
12990
+ */
12991
+ skinIndex: number;
12992
+ static readonly componentId = 'minecraft:npc';
12993
+ }
12994
+
12228
12995
  /**
12229
12996
  * When present on an entity, this entity is on fire.
12230
12997
  * @example setOnFire.ts
@@ -13291,7 +14058,7 @@ export class EntityTypes {
13291
14058
  * Retrieves an entity type using a string-based identifier.
13292
14059
  *
13293
14060
  */
13294
- static get(identifier: string): EntityType | undefined;
14061
+ static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
13295
14062
  /**
13296
14063
  * @remarks
13297
14064
  * Retrieves a set of all entity types within this world.
@@ -14017,6 +14784,13 @@ export class GameRules {
14017
14784
  *
14018
14785
  */
14019
14786
  playersSleepingPercentage: number;
14787
+ /**
14788
+ * @beta
14789
+ * @remarks
14790
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
14791
+ *
14792
+ */
14793
+ playerWaypoints: PlayerWaypointsMode;
14020
14794
  /**
14021
14795
  * @remarks
14022
14796
  * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
@@ -16935,6 +17709,33 @@ export class MatchToolCondition extends LootItemCondition {
16935
17709
  readonly itemTagsNone: string[];
16936
17710
  }
16937
17711
 
17712
+ /**
17713
+ * @beta
17714
+ * A specific currently-internal event used for passing
17715
+ * messages from client to server.
17716
+ */
17717
+ export class MessageReceiveAfterEvent {
17718
+ private constructor();
17719
+ /**
17720
+ * @remarks
17721
+ * The message identifier.
17722
+ *
17723
+ */
17724
+ readonly id: string;
17725
+ /**
17726
+ * @remarks
17727
+ * The message.
17728
+ *
17729
+ */
17730
+ readonly message: string;
17731
+ /**
17732
+ * @remarks
17733
+ * The player who sent the message.
17734
+ *
17735
+ */
17736
+ readonly player: Player;
17737
+ }
17738
+
16938
17739
  /**
16939
17740
  * Contains a set of additional variable values for further
16940
17741
  * defining how rendering and animations function.
@@ -17004,35 +17805,78 @@ export class MolangVariableMap {
17004
17805
  }
17005
17806
 
17006
17807
  /**
17007
- * Loot item condition that checks whether the looting entity
17008
- * is currently a passenger of a specific type of entity.
17808
+ * @beta
17809
+ * Pack setting name and value that changed.
17009
17810
  */
17010
- // @ts-ignore Class inheritance allowed for native defined classes
17011
- export class PassengerOfEntityCondition extends LootItemCondition {
17811
+ export class PackSettingChangeAfterEvent {
17012
17812
  private constructor();
17013
17813
  /**
17014
17814
  * @remarks
17015
- * The entity type required for this condition to pass.
17815
+ * The name of the setting.
17016
17816
  *
17017
17817
  */
17018
- readonly entityType: string;
17818
+ readonly settingName: string;
17819
+ /**
17820
+ * @remarks
17821
+ * The value of the setting.
17822
+ *
17823
+ */
17824
+ readonly settingValue: string[] | boolean | number | string;
17019
17825
  }
17020
17826
 
17021
17827
  /**
17022
- * Contains information related to changes to a piston
17023
- * expanding or retracting.
17024
- * @example pistonAfterEvent.ts
17025
- * ```typescript
17026
- * import {
17027
- * world,
17028
- * system,
17029
- * BlockPermutation,
17030
- * BlockPistonState,
17031
- * PistonActivateAfterEvent,
17032
- * DimensionLocation,
17033
- * } from '@minecraft/server';
17034
- * import { MinecraftBlockTypes } from '@minecraft/vanilla-data';
17035
- *
17828
+ * @beta
17829
+ */
17830
+ export class PackSettingChangeAfterEventSignal {
17831
+ private constructor();
17832
+ /**
17833
+ * @remarks
17834
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
17835
+ *
17836
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
17837
+ *
17838
+ */
17839
+ subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
17840
+ /**
17841
+ * @remarks
17842
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
17843
+ *
17844
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
17845
+ *
17846
+ */
17847
+ unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
17848
+ }
17849
+
17850
+ /**
17851
+ * Loot item condition that checks whether the looting entity
17852
+ * is currently a passenger of a specific type of entity.
17853
+ */
17854
+ // @ts-ignore Class inheritance allowed for native defined classes
17855
+ export class PassengerOfEntityCondition extends LootItemCondition {
17856
+ private constructor();
17857
+ /**
17858
+ * @remarks
17859
+ * The entity type required for this condition to pass.
17860
+ *
17861
+ */
17862
+ readonly entityType: string;
17863
+ }
17864
+
17865
+ /**
17866
+ * Contains information related to changes to a piston
17867
+ * expanding or retracting.
17868
+ * @example pistonAfterEvent.ts
17869
+ * ```typescript
17870
+ * import {
17871
+ * world,
17872
+ * system,
17873
+ * BlockPermutation,
17874
+ * BlockPistonState,
17875
+ * PistonActivateAfterEvent,
17876
+ * DimensionLocation,
17877
+ * } from '@minecraft/server';
17878
+ * import { MinecraftBlockTypes } from '@minecraft/vanilla-data';
17879
+ *
17036
17880
  * function pistonAfterEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
17037
17881
  * // set up a couple of piston blocks
17038
17882
  * const piston = targetLocation.dimension.getBlock(targetLocation);
@@ -17170,6 +18014,63 @@ export class Player extends Entity {
17170
18014
  * @throws This property can throw when used.
17171
18015
  */
17172
18016
  readonly camera: Camera;
18017
+ /**
18018
+ * @beta
18019
+ * @remarks
18020
+ * The player's chat display name, composed from
18021
+ * {@link Player.chatNamePrefix} + {@link Player.name} +
18022
+ * {@link Player.chatNameSuffix}. This is the name shown as the
18023
+ * author of chat messages sent by this player. To change the
18024
+ * name shown above the player's head, use
18025
+ * {@link Entity.nameTag}.
18026
+ *
18027
+ * @throws This property can throw when used.
18028
+ *
18029
+ * {@link InvalidEntityError}
18030
+ */
18031
+ readonly chatDisplayName: string;
18032
+ /**
18033
+ * @beta
18034
+ * @remarks
18035
+ * An optional string that, when set, is prepended to the text
18036
+ * of chat messages sent by this player. Useful for applying
18037
+ * formatting or color codes to a player's messages (e.g., '§a'
18038
+ * to make their messages green). Does not affect the player's
18039
+ * name display - use {@link Player.chatNamePrefix} for the
18040
+ * name shown in chat, or {@link Entity.nameTag} for the name
18041
+ * above the player's head. Set to undefined to clear.
18042
+ *
18043
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
18044
+ *
18045
+ */
18046
+ chatMessagePrefix?: string;
18047
+ /**
18048
+ * @beta
18049
+ * @remarks
18050
+ * An optional string that, when set, is prepended to the
18051
+ * player's name in chat messages. Does not affect the name tag
18052
+ * above the player's head or the player list - use
18053
+ * {@link Entity.nameTag} for that. To prefix the message text
18054
+ * itself, use {@link Player.chatMessagePrefix}. Set to
18055
+ * undefined to clear.
18056
+ *
18057
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
18058
+ *
18059
+ */
18060
+ chatNamePrefix?: string;
18061
+ /**
18062
+ * @beta
18063
+ * @remarks
18064
+ * An optional string that, when set, is appended to the
18065
+ * player's name in chat messages. Does not affect the name tag
18066
+ * above the player's head or the player list - use
18067
+ * {@link Entity.nameTag} for that. See also
18068
+ * {@link Player.chatNamePrefix}. Set to undefined to clear.
18069
+ *
18070
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
18071
+ *
18072
+ */
18073
+ chatNameSuffix?: string;
17173
18074
  /**
17174
18075
  * @remarks
17175
18076
  * Contains the player's device information.
@@ -17274,6 +18175,19 @@ export class Player extends Entity {
17274
18175
  * @throws This property can throw when used.
17275
18176
  */
17276
18177
  readonly onScreenDisplay: ScreenDisplay;
18178
+ /**
18179
+ * @beta
18180
+ * @remarks
18181
+ * An identifier that can be used to identify a player across
18182
+ * sessions.
18183
+ *
18184
+ * @throws This property can throw when used.
18185
+ *
18186
+ * {@link minecraftcommon.EngineError}
18187
+ *
18188
+ * {@link InvalidEntityError}
18189
+ */
18190
+ readonly persistentId: string;
17277
18191
  /**
17278
18192
  * @throws This property can throw when used.
17279
18193
  *
@@ -17347,6 +18261,20 @@ export class Player extends Entity {
17347
18261
  * Throws if the Entity or Entity ID is invalid.
17348
18262
  */
17349
18263
  clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
18264
+ /**
18265
+ * @beta
18266
+ * @remarks
18267
+ * Eats an item, providing the item's hunger and saturation
18268
+ * effects to the player. Can only be used on food items.
18269
+ *
18270
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
18271
+ *
18272
+ * @param itemStack
18273
+ * The item to eat.
18274
+ * @throws
18275
+ * Throws if the item is not a food item.
18276
+ */
18277
+ eatItem(itemStack: ItemStack): void;
17350
18278
  /**
17351
18279
  * @remarks
17352
18280
  * The player's aim-assist settings.
@@ -17380,6 +18308,20 @@ export class Player extends Entity {
17380
18308
  * @throws This function can throw errors.
17381
18309
  */
17382
18310
  getItemCooldown(cooldownCategory: string): number;
18311
+ /**
18312
+ * @beta
18313
+ * @remarks
18314
+ * Gets the player's ping in milliseconds.
18315
+ *
18316
+ * @returns
18317
+ * The player's ping in milliseconds.
18318
+ * @throws This function can throw errors.
18319
+ *
18320
+ * {@link minecraftcommon.EngineError}
18321
+ *
18322
+ * {@link InvalidEntityError}
18323
+ */
18324
+ getPing(): number;
17383
18325
  /**
17384
18326
  * @remarks
17385
18327
  * Gets the current spawn point of the player.
@@ -17387,6 +18329,21 @@ export class Player extends Entity {
17387
18329
  * @throws This function can throw errors.
17388
18330
  */
17389
18331
  getSpawnPoint(): DimensionLocation | undefined;
18332
+ /**
18333
+ * @beta
18334
+ * @remarks
18335
+ * Returns the split screen slot of the player.
18336
+ *
18337
+ * @returns
18338
+ * The split screen slot of the player or undefined if the
18339
+ * player is not in a split screen session.
18340
+ * @throws This function can throw errors.
18341
+ *
18342
+ * {@link minecraftcommon.EngineError}
18343
+ *
18344
+ * {@link InvalidEntityError}
18345
+ */
18346
+ getSplitScreenSlot(): PlayerSplitScreenSlot | undefined;
17390
18347
  /**
17391
18348
  * @remarks
17392
18349
  * Gets the total experience of the Player.
@@ -17451,6 +18408,17 @@ export class Player extends Entity {
17451
18408
  * ```
17452
18409
  */
17453
18410
  playSound(soundId: SoundDefinition | string, soundOptions?: PlayerSoundOptions): SoundInstance;
18411
+ /**
18412
+ * @beta
18413
+ * @remarks
18414
+ * This is an internal-facing method for posting a system
18415
+ * message to downstream clients.
18416
+ *
18417
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
18418
+ *
18419
+ * @throws This function can throw errors.
18420
+ */
18421
+ postClientMessage(id: string, value: string): void;
17454
18422
  /**
17455
18423
  * @remarks
17456
18424
  * Queues an additional music track that only this particular
@@ -17726,6 +18694,18 @@ export class Player extends Entity {
17726
18694
  * @throws This function can throw errors.
17727
18695
  */
17728
18696
  startItemCooldown(cooldownCategory: string, tickDuration: number): void;
18697
+ /**
18698
+ * @beta
18699
+ * @remarks
18700
+ * Stops all sounds from playing for this particular player.
18701
+ *
18702
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
18703
+ *
18704
+ * @throws This function can throw errors.
18705
+ *
18706
+ * {@link InvalidEntityError}
18707
+ */
18708
+ stopAllSounds(): void;
17729
18709
  /**
17730
18710
  * @remarks
17731
18711
  * Stops any music tracks from playing for this particular
@@ -17736,6 +18716,20 @@ export class Player extends Entity {
17736
18716
  * @throws This function can throw errors.
17737
18717
  */
17738
18718
  stopMusic(): void;
18719
+ /**
18720
+ * @beta
18721
+ * @remarks
18722
+ * Stops a sound from playing for this particular player.
18723
+ *
18724
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
18725
+ *
18726
+ * @param soundId
18727
+ * Identifier of the sound.
18728
+ * @throws This function can throw errors.
18729
+ *
18730
+ * {@link InvalidEntityError}
18731
+ */
18732
+ stopSound(soundId: string): void;
17739
18733
  }
17740
18734
 
17741
18735
  /**
@@ -18044,6 +19038,72 @@ export class PlayerCancelBreakingBlockAfterEventSignal {
18044
19038
  unsubscribe(callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void): void;
18045
19039
  }
18046
19040
 
19041
+ /**
19042
+ * @beta
19043
+ * Contains information regarding a player crafting a recipe.
19044
+ */
19045
+ export class PlayerCraftRecipeAfterEvent {
19046
+ private constructor();
19047
+ /**
19048
+ * @remarks
19049
+ * The block where the recipe was crafted, if applicable.
19050
+ *
19051
+ */
19052
+ readonly block?: Block;
19053
+ /**
19054
+ * @remarks
19055
+ * The item stack crafted by the player.
19056
+ *
19057
+ */
19058
+ readonly itemStack?: ItemStack;
19059
+ /**
19060
+ * @remarks
19061
+ * The player who crafted the recipe.
19062
+ *
19063
+ */
19064
+ readonly player: Player;
19065
+ }
19066
+
19067
+ /**
19068
+ * @beta
19069
+ * Manages callbacks that are connected to when a player crafts
19070
+ * a recipe.
19071
+ */
19072
+ export class PlayerCraftRecipeAfterEventSignal {
19073
+ private constructor();
19074
+ /**
19075
+ * @remarks
19076
+ * Adds a callback that will be called when a player crafts a
19077
+ * recipe.
19078
+ *
19079
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19080
+ *
19081
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
19082
+ *
19083
+ * @param callback
19084
+ * Function callback that is called when this event fires.
19085
+ * @param options
19086
+ * Additional filtering options for the event subscription.
19087
+ */
19088
+ subscribe(
19089
+ callback: (arg0: PlayerCraftRecipeAfterEvent) => void,
19090
+ options?: PlayerCraftRecipeEventOptions,
19091
+ ): (arg0: PlayerCraftRecipeAfterEvent) => void;
19092
+ /**
19093
+ * @remarks
19094
+ * Removes a callback from being called when a player crafts a
19095
+ * recipe.
19096
+ *
19097
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19098
+ *
19099
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
19100
+ *
19101
+ * @param callback
19102
+ * The callback to remove from the event subscription.
19103
+ */
19104
+ unsubscribe(callback: (arg0: PlayerCraftRecipeAfterEvent) => void): void;
19105
+ }
19106
+
18047
19107
  /**
18048
19108
  * Represents the players cursor inventory. Used when moving
18049
19109
  * items between between containers in the inventory UI. Not
@@ -19095,6 +20155,88 @@ export class PlayerPlaceBlockAfterEventSignal {
19095
20155
  unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
19096
20156
  }
19097
20157
 
20158
+ /**
20159
+ * @beta
20160
+ * Contains information regarding an event before a player
20161
+ * places a block.
20162
+ */
20163
+ // @ts-ignore Class inheritance allowed for native defined classes
20164
+ export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
20165
+ private constructor();
20166
+ /**
20167
+ * @remarks
20168
+ * If set to true, cancels the block place event.
20169
+ *
20170
+ */
20171
+ cancel: boolean;
20172
+ /**
20173
+ * @remarks
20174
+ * The face of the block that the new block is being placed on.
20175
+ *
20176
+ */
20177
+ readonly face: Direction;
20178
+ /**
20179
+ * @remarks
20180
+ * Location relative to the bottom north-west corner of the
20181
+ * block where the new block is being placed onto.
20182
+ *
20183
+ */
20184
+ readonly faceLocation: Vector3;
20185
+ /**
20186
+ * @remarks
20187
+ * The block permutation that will be placed if the event is
20188
+ * not cancelled.
20189
+ *
20190
+ */
20191
+ readonly permutationToPlace: BlockPermutation;
20192
+ /**
20193
+ * @remarks
20194
+ * Player that is placing the block for this event.
20195
+ *
20196
+ */
20197
+ readonly player: Player;
20198
+ }
20199
+
20200
+ /**
20201
+ * @beta
20202
+ * Manages callbacks that are connected to before a block is
20203
+ * placed by a player.
20204
+ */
20205
+ export class PlayerPlaceBlockBeforeEventSignal {
20206
+ private constructor();
20207
+ /**
20208
+ * @remarks
20209
+ * Adds a callback that will be called before a block is placed
20210
+ * by a player.
20211
+ *
20212
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20213
+ *
20214
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
20215
+ *
20216
+ * @param callback
20217
+ * This closure is called with restricted-execution privilege.
20218
+ * @returns
20219
+ * Closure that is called with restricted-execution privilege.
20220
+ */
20221
+ subscribe(
20222
+ callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
20223
+ options?: BlockEventOptions,
20224
+ ): (arg0: PlayerPlaceBlockBeforeEvent) => void;
20225
+ /**
20226
+ * @remarks
20227
+ * Removes a callback from being called before an block is
20228
+ * placed by a player.
20229
+ *
20230
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20231
+ *
20232
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
20233
+ *
20234
+ * @param callback
20235
+ * This closure is called with restricted-execution privilege.
20236
+ */
20237
+ unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
20238
+ }
20239
+
19098
20240
  /**
19099
20241
  * An event that contains more information about a player
19100
20242
  * spawning.
@@ -19282,15 +20424,89 @@ export class PlayerSwingStartAfterEventSignal {
19282
20424
  }
19283
20425
 
19284
20426
  /**
19285
- * Waypoint that tracks a player's position. Extends
19286
- * {@link EntityWaypoint} with additional player-specific
19287
- * visibility rules such as hidden state and spectator mode.
20427
+ * @beta
20428
+ * Contains information related to when a player successfully
20429
+ * names an Entity with a named Name Tag item.
19288
20430
  */
19289
- // @ts-ignore Class inheritance allowed for native defined classes
19290
- export class PlayerWaypoint extends EntityWaypoint {
20431
+ export class PlayerUseNameTagAfterEvent {
20432
+ private constructor();
19291
20433
  /**
19292
20434
  * @remarks
19293
- * The {@link PlayerVisibilityRules} that control when the
20435
+ * The entity that was named by the player.
20436
+ *
20437
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
20438
+ *
20439
+ */
20440
+ entityNamed: Entity;
20441
+ /**
20442
+ * @remarks
20443
+ * The new name that the player has given to the entity.
20444
+ *
20445
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
20446
+ *
20447
+ */
20448
+ newName: string;
20449
+ /**
20450
+ * @remarks
20451
+ * Handle to the player that used the name tag.
20452
+ *
20453
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
20454
+ *
20455
+ */
20456
+ player: Player;
20457
+ /**
20458
+ * @remarks
20459
+ * The previous name of the entity before the player used the
20460
+ * name tag. This will be undefined if the entity was not
20461
+ * previously named.
20462
+ *
20463
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
20464
+ *
20465
+ */
20466
+ previousName?: string;
20467
+ }
20468
+
20469
+ /**
20470
+ * @beta
20471
+ * Manages callbacks that are connected to when a player
20472
+ * successfully names an Entity with a named Name Tag item.
20473
+ */
20474
+ export class PlayerUseNameTagAfterEventSignal {
20475
+ private constructor();
20476
+ /**
20477
+ * @remarks
20478
+ * Subscribes the specified callback to a player use name tag
20479
+ * after event.
20480
+ *
20481
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20482
+ *
20483
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
20484
+ *
20485
+ */
20486
+ subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
20487
+ /**
20488
+ * @remarks
20489
+ * Removes the specified callback from a player use name tag
20490
+ * after event.
20491
+ *
20492
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20493
+ *
20494
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
20495
+ *
20496
+ */
20497
+ unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
20498
+ }
20499
+
20500
+ /**
20501
+ * Waypoint that tracks a player's position. Extends
20502
+ * {@link EntityWaypoint} with additional player-specific
20503
+ * visibility rules such as hidden state and spectator mode.
20504
+ */
20505
+ // @ts-ignore Class inheritance allowed for native defined classes
20506
+ export class PlayerWaypoint extends EntityWaypoint {
20507
+ /**
20508
+ * @remarks
20509
+ * The {@link PlayerVisibilityRules} that control when the
19294
20510
  * waypoint is shown based on the player's state (e.g., hidden,
19295
20511
  * spectator mode, spectator viewing another spectator).
19296
20512
  *
@@ -19314,6 +20530,315 @@ export class PlayerWaypoint extends EntityWaypoint {
19314
20530
  );
19315
20531
  }
19316
20532
 
20533
+ /**
20534
+ * @beta
20535
+ * Describes a block point-of-interest instance returned by a
20536
+ * query.
20537
+ *
20538
+ * Required Experiments:
20539
+ * - Poi
20540
+ *
20541
+ */
20542
+ export class PoiBlockInstance {
20543
+ private constructor();
20544
+ /**
20545
+ * @remarks
20546
+ * Block position of this POI instance.
20547
+ *
20548
+ */
20549
+ readonly position: Vector3;
20550
+ /**
20551
+ * @remarks
20552
+ * Number of tickets currently available to be claimed from
20553
+ * this POI instance.
20554
+ *
20555
+ */
20556
+ readonly tickets: number;
20557
+ /**
20558
+ * @remarks
20559
+ * Type of this POI instance.
20560
+ *
20561
+ */
20562
+ readonly 'type': PoiBlockType;
20563
+ }
20564
+
20565
+ /**
20566
+ * @beta
20567
+ * Provides methods for querying and managing block-based
20568
+ * points of interest in a dimension.
20569
+ *
20570
+ * Required Experiments:
20571
+ * - Poi
20572
+ *
20573
+ */
20574
+ export class PoiBlockManager {
20575
+ private constructor();
20576
+ /**
20577
+ * @remarks
20578
+ * Adds a block point of interest at a position. This method is
20579
+ * intended for temporary usage. Will be replaced when chunk is
20580
+ * reloaded
20581
+ *
20582
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20583
+ *
20584
+ * @param position
20585
+ * Block position at which to add the POI.
20586
+ * @param poi
20587
+ * POI type to add, specified by numeric type Id, type name, or
20588
+ * POI type object.
20589
+ */
20590
+ addTemporary(position: Vector3, poi: PoiBlockType | string | number): void;
20591
+ /**
20592
+ * @remarks
20593
+ * Gets the type of the block point of interest at a position.
20594
+ *
20595
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20596
+ *
20597
+ * @param position
20598
+ * Block position to inspect.
20599
+ * @returns
20600
+ * The POI type at the position, or undefined if no POI exists
20601
+ * there.
20602
+ */
20603
+ at(position: Vector3): PoiBlockType | undefined;
20604
+ /**
20605
+ * @remarks
20606
+ * Tests whether a block point of interest at a position
20607
+ * matches a type filter.
20608
+ *
20609
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20610
+ *
20611
+ * @param position
20612
+ * Block position to inspect.
20613
+ * @param filter
20614
+ * Filter used to select the POI type. A callback receives the
20615
+ * POI type and returns whether it matches; a name filter
20616
+ * matches a type name; and a tag filter requires all specified
20617
+ * tags.
20618
+ * @returns
20619
+ * True if a POI exists at the position and its type matches
20620
+ * the filter; otherwise false.
20621
+ */
20622
+ exists(position: Vector3, filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter): boolean;
20623
+ /**
20624
+ * @remarks
20625
+ * Returns block points of interest that match the supplied
20626
+ * type and occupancy filters within the specified distance of
20627
+ * a location.
20628
+ *
20629
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20630
+ *
20631
+ * @param filter
20632
+ * Filter used to select POI types. A callback receives each
20633
+ * POI type and returns whether it should be included; a name
20634
+ * filter matches a type name; and a tag filter requires all
20635
+ * specified tags.
20636
+ * @param center
20637
+ * Center of the search.
20638
+ * @param blockRadius
20639
+ * Maximum three-dimensional distance from the center, in
20640
+ * blocks.
20641
+ * @param occupancyFilter
20642
+ * Optional filter applied to the occupancy state of matching
20643
+ * POIs. If omitted, POIs in any occupancy state are returned.
20644
+ * @returns
20645
+ * The matching POI instances within range. The result order is
20646
+ * not guaranteed.
20647
+ */
20648
+ getInRange(
20649
+ filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
20650
+ center: Vector3,
20651
+ blockRadius: number,
20652
+ occupancyFilter?: PoiBlockOccupancyFilter,
20653
+ ): PoiBlockInstance[];
20654
+ /**
20655
+ * @remarks
20656
+ * Returns block points of interest that match the supplied
20657
+ * type and occupancy filters within an axis-aligned square
20658
+ * centered on the specified location, sorted from nearest to
20659
+ * farthest.
20660
+ *
20661
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20662
+ *
20663
+ * @param filter
20664
+ * Filter used to select POI types. A callback receives each
20665
+ * POI type and returns whether it should be included; a name
20666
+ * filter matches a type name; and a tag filter requires all
20667
+ * specified tags.
20668
+ * @param center
20669
+ * Center of the search and the location from which distances
20670
+ * are calculated.
20671
+ * @param blockRadius
20672
+ * Maximum three-dimensional distance from the center, in
20673
+ * blocks.
20674
+ * @param occupancyFilter
20675
+ * Optional filter applied to the occupancy state of matching
20676
+ * POIs. If omitted, POIs in any occupancy state are returned.
20677
+ * @returns
20678
+ * The matching POI instances and their squared distances from
20679
+ * the center, sorted in ascending distance order.
20680
+ */
20681
+ getInRangeSorted(
20682
+ filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
20683
+ center: Vector3,
20684
+ blockRadius: number,
20685
+ occupancyFilter?: PoiBlockOccupancyFilter,
20686
+ ): PoiDistancePair[];
20687
+ /**
20688
+ * @remarks
20689
+ * Returns block points of interest that match the supplied
20690
+ * type and occupancy filters within an axis-aligned square
20691
+ * centered on the specified location.
20692
+ *
20693
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20694
+ *
20695
+ * @param filter
20696
+ * Filter used to select POI types. A callback receives each
20697
+ * POI type and returns whether it should be included; a name
20698
+ * filter matches a type name; and a tag filter requires all
20699
+ * specified tags.
20700
+ * @param center
20701
+ * Center of the search volume.
20702
+ * @param blockRadius
20703
+ * Half-size of the search volume, in blocks, along each axis.
20704
+ * @param occupancyFilter
20705
+ * Optional filter applied to the occupancy state of matching
20706
+ * POIs. If omitted, POIs in any occupancy state are returned.
20707
+ * @returns
20708
+ * The matching POI instances in the search volume.
20709
+ */
20710
+ getInSquare(
20711
+ filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
20712
+ center: Vector3,
20713
+ blockRadius: number,
20714
+ occupancyFilter?: PoiBlockOccupancyFilter,
20715
+ ): PoiBlockInstance[];
20716
+ /**
20717
+ * @remarks
20718
+ * Releases one previously claimed ticket at a block point of
20719
+ * interest.
20720
+ *
20721
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20722
+ *
20723
+ * @param center
20724
+ * Block position of the POI whose ticket should be released.
20725
+ * @returns
20726
+ * True if a ticket was released; false if no POI exists at the
20727
+ * position or the POI has no claimed tickets.
20728
+ */
20729
+ release(center: Vector3): boolean;
20730
+ /**
20731
+ * @remarks
20732
+ * Claims one available ticket from a matching block point of
20733
+ * interest within range.
20734
+ *
20735
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20736
+ *
20737
+ * @param filter
20738
+ * Filter used to select the POI type to claim. A callback
20739
+ * receives each POI type and returns whether it should be
20740
+ * included; a name filter matches a type name; and a tag
20741
+ * filter requires all specified tags.
20742
+ * @param center
20743
+ * Center of the search.
20744
+ * @param blockRadius
20745
+ * Maximum three-dimensional distance from the center, in
20746
+ * blocks.
20747
+ * @returns
20748
+ * The block position of the claimed POI, or undefined if no
20749
+ * matching POI has an available ticket.
20750
+ */
20751
+ take(
20752
+ filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
20753
+ center: Vector3,
20754
+ blockRadius: number,
20755
+ ): Vector3 | undefined;
20756
+ }
20757
+
20758
+ /**
20759
+ * @beta
20760
+ * Describes a block point-of-interest type.
20761
+ *
20762
+ * Required Experiments:
20763
+ * - Poi
20764
+ *
20765
+ */
20766
+ export class PoiBlockType {
20767
+ private constructor();
20768
+ /**
20769
+ * @remarks
20770
+ * Numeric identifier of this POI type.
20771
+ *
20772
+ */
20773
+ readonly id: number;
20774
+ /**
20775
+ * @remarks
20776
+ * Namespaced identifier of this POI type.
20777
+ *
20778
+ */
20779
+ readonly name: string;
20780
+ /**
20781
+ * @remarks
20782
+ * Maximum number of tickets that can be claimed from each POI
20783
+ * instance of this type.
20784
+ *
20785
+ */
20786
+ readonly tickets: number;
20787
+ /**
20788
+ * @remarks
20789
+ * Maximum range, in blocks, at which this POI type is
20790
+ * considered usable.
20791
+ *
20792
+ */
20793
+ readonly usableRange: number;
20794
+ /**
20795
+ * @remarks
20796
+ * Tests whether this object and another object describe the
20797
+ * same POI type.
20798
+ *
20799
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20800
+ *
20801
+ * @param other
20802
+ * POI type to compare with this type.
20803
+ * @returns
20804
+ * True if both objects describe the same POI type; otherwise
20805
+ * false.
20806
+ */
20807
+ equals(other: PoiBlockType): boolean;
20808
+ /**
20809
+ * @remarks
20810
+ * Tests whether the type has the provided tag attribute
20811
+ *
20812
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
20813
+ *
20814
+ * @param tag
20815
+ * POI tag to check.
20816
+ * @returns
20817
+ * True if the POI conatains the tag; otherwise false.
20818
+ */
20819
+ has(tag: string): boolean;
20820
+ }
20821
+
20822
+ /**
20823
+ * @beta
20824
+ * Provides access to point-of-interest (POI) data in a
20825
+ * dimension.
20826
+ *
20827
+ * Required Experiments:
20828
+ * - Poi
20829
+ *
20830
+ */
20831
+ export class PoiManager {
20832
+ private constructor();
20833
+ /**
20834
+ * @remarks
20835
+ * Provides access to block-based points of interest in the
20836
+ * dimension.
20837
+ *
20838
+ */
20839
+ readonly blocks: PoiBlockManager;
20840
+ }
20841
+
19317
20842
  /**
19318
20843
  * Represents how the potion effect is delivered.
19319
20844
  */
@@ -19396,10 +20921,10 @@ export class Potions {
19396
20921
  *
19397
20922
  * {@link InvalidPotionEffectTypeError}
19398
20923
  */
19399
- static resolve(
19400
- potionEffectType: PotionEffectType | string,
19401
- potionDeliveryType: PotionDeliveryType | string,
19402
- ): ItemStack;
20924
+ static resolve<
20925
+ T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
20926
+ U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
20927
+ >(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
19403
20928
  }
19404
20929
 
19405
20930
  /**
@@ -19939,59 +21464,157 @@ export class RandomRegionalDifficultyChanceCondition extends LootItemCondition {
19939
21464
  }
19940
21465
 
19941
21466
  /**
19942
- * Contains objectives and participants for the scoreboard.
19943
- * @example updateScoreboard.ts
19944
- * ```typescript
19945
- * import { world, DisplaySlotId, ObjectiveSortOrder, DimensionLocation } from '@minecraft/server';
19946
- *
19947
- * function updateScoreboard(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
19948
- * const scoreboardObjectiveId = 'scoreboard_demo_objective';
19949
- * const scoreboardObjectiveDisplayName = 'Demo Objective';
19950
- *
19951
- * const players = world.getPlayers();
19952
- *
19953
- * // Ensure a new objective.
19954
- * let objective = world.scoreboard.getObjective(scoreboardObjectiveId);
19955
- *
19956
- * if (!objective) {
19957
- * objective = world.scoreboard.addObjective(scoreboardObjectiveId, scoreboardObjectiveDisplayName);
19958
- * }
19959
- *
19960
- * // get the scoreboard identity for player 0
19961
- * const player0Identity = players[0].scoreboardIdentity;
19962
- *
19963
- * if (player0Identity === undefined) {
19964
- * log('Could not get a scoreboard identity for player 0.');
19965
- * return -1;
19966
- * }
19967
- *
19968
- * // initialize player score to 100;
19969
- * objective.setScore(player0Identity, 100);
19970
- *
19971
- * world.scoreboard.setObjectiveAtDisplaySlot(DisplaySlotId.Sidebar, {
19972
- * objective: objective,
19973
- * sortOrder: ObjectiveSortOrder.Descending,
19974
- * });
19975
- *
19976
- * const playerScore = objective.getScore(player0Identity) ?? 0;
19977
- *
19978
- * // score should now be 110.
19979
- * objective.setScore(player0Identity, playerScore + 10);
19980
- * }
19981
- * ```
21467
+ * @beta
21468
+ * Provides access to the slots and recipe of a players active
21469
+ * crafting UI ie. stonecutter.
19982
21470
  */
19983
- export class Scoreboard {
21471
+ export class RecipeCraftingContext {
19984
21472
  private constructor();
19985
21473
  /**
19986
21474
  * @remarks
19987
- * Adds a new objective to the scoreboard.
21475
+ * The amount of addressable input slots for getInputItem and
21476
+ * setInputItem.
19988
21477
  *
19989
- * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
21478
+ * @throws This property can throw when used.
19990
21479
  *
19991
- * @throws This function can throw errors.
19992
- * @example updateScoreboard.ts
19993
- * ```typescript
19994
- * import { world, DisplaySlotId, ObjectiveSortOrder, DimensionLocation } from '@minecraft/server';
21480
+ * {@link minecraftcommon.EngineError}
21481
+ */
21482
+ readonly inputSlotCount: number;
21483
+ /**
21484
+ * @remarks
21485
+ * Whether this recipe crafting context is valid. Invalidates
21486
+ * when the player closes the crafting UI or leaves.
21487
+ *
21488
+ */
21489
+ readonly isValid: boolean;
21490
+ /**
21491
+ * @remarks
21492
+ * The identifiers of the recipes that are valid for the
21493
+ * current input items.
21494
+ *
21495
+ * @throws This property can throw when used.
21496
+ *
21497
+ * {@link minecraftcommon.EngineError}
21498
+ */
21499
+ readonly validRecipes: string[];
21500
+ /**
21501
+ * @remarks
21502
+ * Gets the item in the provided input slot.
21503
+ *
21504
+ * @param slot
21505
+ * The zero-based input slot index.
21506
+ * @returns
21507
+ * The item stack in the input slot, or undefined if the slot
21508
+ * is empty.
21509
+ * @throws This function can throw errors.
21510
+ *
21511
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
21512
+ *
21513
+ * {@link minecraftcommon.EngineError}
21514
+ */
21515
+ getInputItem(slot: number): ItemStack | undefined;
21516
+ /**
21517
+ * @remarks
21518
+ * Gets the item produced by the currently selected recipe.
21519
+ *
21520
+ * @returns
21521
+ * The output item stack, or undefined if there is no output.
21522
+ * @throws This function can throw errors.
21523
+ *
21524
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
21525
+ *
21526
+ * {@link minecraftcommon.EngineError}
21527
+ */
21528
+ getOutputItem(): ItemStack | undefined;
21529
+ /**
21530
+ * @remarks
21531
+ * Sets or clears an item in an input slot.
21532
+ *
21533
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
21534
+ *
21535
+ * @param slot
21536
+ * The zero-based input slot index.
21537
+ * @param item
21538
+ * The item stack to place in the slot, or undefined to clear
21539
+ * the slot.
21540
+ * @throws This function can throw errors.
21541
+ *
21542
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
21543
+ *
21544
+ * {@link minecraftcommon.EngineError}
21545
+ */
21546
+ setInputItem(slot: number, item?: ItemStack): void;
21547
+ /**
21548
+ * @remarks
21549
+ * Selects a recipe for the current crafting operation.
21550
+ *
21551
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
21552
+ *
21553
+ * @param recipeId
21554
+ * The identifier of a valid recipe to select.
21555
+ * @throws This function can throw errors.
21556
+ *
21557
+ * {@link minecraftcommon.EngineError}
21558
+ *
21559
+ * {@link InvalidRecipeError}
21560
+ */
21561
+ setSelectedRecipe(recipeId: string): void;
21562
+ }
21563
+
21564
+ /**
21565
+ * Contains objectives and participants for the scoreboard.
21566
+ * @example updateScoreboard.ts
21567
+ * ```typescript
21568
+ * import { world, DisplaySlotId, ObjectiveSortOrder, DimensionLocation } from '@minecraft/server';
21569
+ *
21570
+ * function updateScoreboard(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
21571
+ * const scoreboardObjectiveId = 'scoreboard_demo_objective';
21572
+ * const scoreboardObjectiveDisplayName = 'Demo Objective';
21573
+ *
21574
+ * const players = world.getPlayers();
21575
+ *
21576
+ * // Ensure a new objective.
21577
+ * let objective = world.scoreboard.getObjective(scoreboardObjectiveId);
21578
+ *
21579
+ * if (!objective) {
21580
+ * objective = world.scoreboard.addObjective(scoreboardObjectiveId, scoreboardObjectiveDisplayName);
21581
+ * }
21582
+ *
21583
+ * // get the scoreboard identity for player 0
21584
+ * const player0Identity = players[0].scoreboardIdentity;
21585
+ *
21586
+ * if (player0Identity === undefined) {
21587
+ * log('Could not get a scoreboard identity for player 0.');
21588
+ * return -1;
21589
+ * }
21590
+ *
21591
+ * // initialize player score to 100;
21592
+ * objective.setScore(player0Identity, 100);
21593
+ *
21594
+ * world.scoreboard.setObjectiveAtDisplaySlot(DisplaySlotId.Sidebar, {
21595
+ * objective: objective,
21596
+ * sortOrder: ObjectiveSortOrder.Descending,
21597
+ * });
21598
+ *
21599
+ * const playerScore = objective.getScore(player0Identity) ?? 0;
21600
+ *
21601
+ * // score should now be 110.
21602
+ * objective.setScore(player0Identity, playerScore + 10);
21603
+ * }
21604
+ * ```
21605
+ */
21606
+ export class Scoreboard {
21607
+ private constructor();
21608
+ /**
21609
+ * @remarks
21610
+ * Adds a new objective to the scoreboard.
21611
+ *
21612
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
21613
+ *
21614
+ * @throws This function can throw errors.
21615
+ * @example updateScoreboard.ts
21616
+ * ```typescript
21617
+ * import { world, DisplaySlotId, ObjectiveSortOrder, DimensionLocation } from '@minecraft/server';
19995
21618
  *
19996
21619
  * function updateScoreboard(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
19997
21620
  * const scoreboardObjectiveId = 'scoreboard_demo_objective';
@@ -20618,6 +22241,38 @@ export class Seat {
20618
22241
  readonly seatRotation: number;
20619
22242
  }
20620
22243
 
22244
+ /**
22245
+ * @beta
22246
+ * Manages callbacks that are message passing to a server. This
22247
+ * event is not currently fully implemented, and should not be
22248
+ * used.
22249
+ */
22250
+ export class ServerMessageAfterEventSignal {
22251
+ private constructor();
22252
+ /**
22253
+ * @remarks
22254
+ * Adds a callback that will be called when an internal message
22255
+ * is passed.
22256
+ *
22257
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22258
+ *
22259
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
22260
+ *
22261
+ */
22262
+ subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
22263
+ /**
22264
+ * @remarks
22265
+ * Removes a callback from being called when an internal
22266
+ * message is passed.
22267
+ *
22268
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22269
+ *
22270
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
22271
+ *
22272
+ */
22273
+ unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
22274
+ }
22275
+
20621
22276
  /**
20622
22277
  * Loot item function that modifies the trim on a dropped armor
20623
22278
  * item.
@@ -20646,6 +22301,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
20646
22301
  // @ts-ignore Class inheritance allowed for native defined classes
20647
22302
  export class SetBannerDetailsFunction extends LootItemFunction {
20648
22303
  private constructor();
22304
+ /**
22305
+ * @beta
22306
+ * @remarks
22307
+ * The base color for the dropped banner.
22308
+ *
22309
+ */
22310
+ readonly baseColor: string;
22311
+ /**
22312
+ * @beta
22313
+ * @remarks
22314
+ * An array of {@link BannerPattern} objects used to decorate
22315
+ * the banner, including color and pattern type.
22316
+ *
22317
+ */
22318
+ readonly patterns: BannerPattern[];
20649
22319
  /**
20650
22320
  * @remarks
20651
22321
  * The type of banner to drop.
@@ -21081,6 +22751,84 @@ export class SoundInstance {
21081
22751
  *
21082
22752
  */
21083
22753
  readonly soundEventId: string;
22754
+ /**
22755
+ * @beta
22756
+ * @remarks
22757
+ * Fades this sound instance from its current volume to the
22758
+ * target volume over the specified duration. To fade in from
22759
+ * silence, call `setVolume(0.0)` first; to fade out, pass a
22760
+ * target volume of `0.0`.
22761
+ *
22762
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22763
+ *
22764
+ * @param duration
22765
+ * Duration of the fade in seconds. Must be non-negative.
22766
+ * Minimum value: 0
22767
+ * @param targetVolume
22768
+ * Volume to fade to. Must be non-negative.
22769
+ * Minimum value: 0
22770
+ */
22771
+ fade(duration: number, targetVolume: number): void;
22772
+ /**
22773
+ * @beta
22774
+ * @remarks
22775
+ * Pauses this sound.
22776
+ *
22777
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22778
+ *
22779
+ */
22780
+ pause(): void;
22781
+ /**
22782
+ * @beta
22783
+ * @remarks
22784
+ * Resumes this sound after a pause.
22785
+ *
22786
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22787
+ *
22788
+ */
22789
+ resume(): void;
22790
+ /**
22791
+ * @beta
22792
+ * @remarks
22793
+ * Sets the playback position of this sound instance.
22794
+ *
22795
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22796
+ *
22797
+ * @param seconds
22798
+ * Position to seek to in seconds. Must be non-negative.
22799
+ * Bounds: [0, 107374184]
22800
+ * @throws
22801
+ * Throws if `seconds` is negative, or if the sound has a known
22802
+ * duration and `seconds` is greater than that duration.
22803
+ *
22804
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
22805
+ */
22806
+ seekTo(seconds: number): void;
22807
+ /**
22808
+ * @beta
22809
+ * @remarks
22810
+ * Sets the pitch of this sound instance.
22811
+ *
22812
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22813
+ *
22814
+ * @param pitch
22815
+ * Pitch multiplier between 0.01 and 10.0. A value of 1.0 is
22816
+ * normal pitch.
22817
+ * Bounds: [0.009999999776482582, 10]
22818
+ */
22819
+ setPitch(pitch: number): void;
22820
+ /**
22821
+ * @beta
22822
+ * @remarks
22823
+ * Sets the volume of this sound instance.
22824
+ *
22825
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22826
+ *
22827
+ * @param volume
22828
+ * Volume level between 0.0 and 10.0.
22829
+ * Bounds: [0, 10]
22830
+ */
22831
+ setVolume(volume: number): void;
21084
22832
  /**
21085
22833
  * @remarks
21086
22834
  * Stops this sound instance from playing.
@@ -21153,6 +22901,13 @@ export class StartupEvent {
21153
22901
  *
21154
22902
  */
21155
22903
  readonly itemComponentRegistry: ItemComponentRegistry;
22904
+ /**
22905
+ * @beta
22906
+ * @remarks
22907
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
22908
+ *
22909
+ */
22910
+ readonly worldClockRegistry: WorldClockRegistry;
21156
22911
  }
21157
22912
 
21158
22913
  /**
@@ -21805,6 +23560,19 @@ export class SystemBeforeEvents {
21805
23560
  *
21806
23561
  */
21807
23562
  readonly startup: StartupBeforeEventSignal;
23563
+ /**
23564
+ * @beta
23565
+ * @remarks
23566
+ * Fires when the scripting watchdog shuts down the server. The
23567
+ * can be due to using too much memory, or by causing
23568
+ * significant slowdown or hang.
23569
+ * To prevent shutdown, set the event's cancel property to
23570
+ * true.
23571
+ *
23572
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
23573
+ *
23574
+ */
23575
+ readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
21808
23576
  }
21809
23577
 
21810
23578
  /**
@@ -22060,6 +23828,45 @@ export class TickingAreaManager {
22060
23828
  removeTickingArea(identifier: string | TickingArea): void;
22061
23829
  }
22062
23830
 
23831
+ /**
23832
+ * @beta
23833
+ * A named point in time on a world clock that can occur once
23834
+ * or periodically.
23835
+ */
23836
+ export class TimeMarker {
23837
+ private constructor();
23838
+ /**
23839
+ * @remarks
23840
+ * The identifier that represents this time marker.
23841
+ *
23842
+ */
23843
+ readonly name: string;
23844
+ /**
23845
+ * @remarks
23846
+ * The interval (in ticks) at which the time marker repeats. If
23847
+ * not specified, the time marker will only occur once.
23848
+ *
23849
+ * @throws
23850
+ * WorldClockInvalidTimeMarkerError: If the time marker is
23851
+ * invalid.
23852
+ *
23853
+ * {@link WorldClockInvalidTimeMarkerError}
23854
+ */
23855
+ readonly period?: number;
23856
+ /**
23857
+ * @remarks
23858
+ * The time (in ticks) that the time marker occurs at on a
23859
+ * world clock.
23860
+ *
23861
+ * @throws
23862
+ * WorldClockInvalidTimeMarkerError: If the time marker is
23863
+ * invalid.
23864
+ *
23865
+ * {@link WorldClockInvalidTimeMarkerError}
23866
+ */
23867
+ readonly time: number;
23868
+ }
23869
+
22063
23870
  /**
22064
23871
  * Represents a trigger for firing an event.
22065
23872
  */
@@ -22199,42 +24006,107 @@ export class TripWireTripAfterEventSignal {
22199
24006
  }
22200
24007
 
22201
24008
  /**
22202
- * Base class for waypoints displayed on the player's locator
22203
- * bar. Waypoints can track locations or entities and are
22204
- * rendered with customizable textures and colors.
22205
- *
22206
- * Waypoints act as shared handles that can be added to
22207
- * multiple players' locator bars. When you modify a waypoint's
22208
- * properties (such as color, texture, or enabled state), the
22209
- * changes are reflected for all players who have that waypoint
22210
- * in their locator bar. This allows you to efficiently manage
22211
- * waypoints across multiple players without creating separate
22212
- * instances for each player.
24009
+ * @beta
24010
+ * Contains information related to a script watchdog
24011
+ * termination.
22213
24012
  */
22214
- export class Waypoint {
24013
+ export class WatchdogTerminateBeforeEvent {
22215
24014
  private constructor();
22216
24015
  /**
22217
24016
  * @remarks
22218
- * Optional {@link RGB} color tint applied to the waypoint
22219
- * icon. If not specified, the waypoint uses its default color.
24017
+ * If set to true, cancels the termination of the script
24018
+ * runtime. Note that depending on server configuration
24019
+ * settings, cancellation of the termination may not be
24020
+ * allowed.
22220
24021
  *
22221
- * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
24022
+ */
24023
+ cancel: boolean;
24024
+ /**
24025
+ * @remarks
24026
+ * Contains the reason why a script runtime is to be
24027
+ * terminated.
22222
24028
  *
22223
24029
  */
22224
- color?: RGB;
24030
+ readonly terminateReason: WatchdogTerminateReason;
24031
+ }
24032
+
24033
+ /**
24034
+ * @beta
24035
+ * Manages callbacks that are connected to a callback that will
24036
+ * be called when a script runtime is being terminated due to a
24037
+ * violation of the performance watchdog system.
24038
+ */
24039
+ export class WatchdogTerminateBeforeEventSignal {
24040
+ private constructor();
22225
24041
  /**
22226
24042
  * @remarks
22227
- * Controls whether the waypoint is currently displayed on the
22228
- * player's screen. When disabled, the waypoint is hidden but
22229
- * remains valid.
24043
+ * Adds a callback that will be called when a script runtime is
24044
+ * being terminated due to a violation of the performance
24045
+ * watchdog system.
22230
24046
  *
22231
- * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
24047
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
22232
24048
  *
24049
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
24050
+ *
24051
+ * @param callback
24052
+ * This closure is called with restricted-execution privilege.
24053
+ * @returns
24054
+ * Closure that is called with restricted-execution privilege.
22233
24055
  */
22234
- isEnabled: boolean;
24056
+ subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
22235
24057
  /**
22236
24058
  * @remarks
22237
- * Returns whether the waypoint is currently valid. A waypoint
24059
+ * Removes a callback from being called when a script runtime
24060
+ * is being terminated due to a violation of the performance
24061
+ * watchdog system.
24062
+ *
24063
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
24064
+ *
24065
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
24066
+ *
24067
+ * @param callback
24068
+ * This closure is called with restricted-execution privilege.
24069
+ */
24070
+ unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
24071
+ }
24072
+
24073
+ /**
24074
+ * Base class for waypoints displayed on the player's locator
24075
+ * bar. Waypoints can track locations or entities and are
24076
+ * rendered with customizable textures and colors.
24077
+ *
24078
+ * Waypoints act as shared handles that can be added to
24079
+ * multiple players' locator bars. When you modify a waypoint's
24080
+ * properties (such as color, texture, or enabled state), the
24081
+ * changes are reflected for all players who have that waypoint
24082
+ * in their locator bar. This allows you to efficiently manage
24083
+ * waypoints across multiple players without creating separate
24084
+ * instances for each player.
24085
+ */
24086
+ export class Waypoint {
24087
+ private constructor();
24088
+ /**
24089
+ * @remarks
24090
+ * Optional {@link RGB} color tint applied to the waypoint
24091
+ * icon. If not specified, the waypoint uses its default color.
24092
+ *
24093
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
24094
+ *
24095
+ */
24096
+ color?: RGB;
24097
+ /**
24098
+ * @remarks
24099
+ * Controls whether the waypoint is currently displayed on the
24100
+ * player's screen. When disabled, the waypoint is hidden but
24101
+ * remains valid.
24102
+ *
24103
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
24104
+ *
24105
+ */
24106
+ isEnabled: boolean;
24107
+ /**
24108
+ * @remarks
24109
+ * Returns whether the waypoint is currently valid. A waypoint
22238
24110
  * becomes invalid when its tracked entity is no longer valid.
22239
24111
  *
22240
24112
  */
@@ -22413,6 +24285,15 @@ export class World {
22413
24285
  *
22414
24286
  */
22415
24287
  readonly afterEvents: WorldAfterEvents;
24288
+ /**
24289
+ * @beta
24290
+ * @remarks
24291
+ * Enables or disables cheats.
24292
+ *
24293
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
24294
+ *
24295
+ */
24296
+ allowCheats: boolean;
22416
24297
  /**
22417
24298
  * @remarks
22418
24299
  * Contains a set of events that are applicable to the entirety
@@ -22498,6 +24379,20 @@ export class World {
22498
24379
  *
22499
24380
  */
22500
24381
  readonly tickingAreaManager: TickingAreaManager;
24382
+ /**
24383
+ * @beta
24384
+ * @remarks
24385
+ * A method that is internal-only, used for broadcasting
24386
+ * specific messages between client and server.
24387
+ *
24388
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
24389
+ *
24390
+ * @param id
24391
+ * The message identifier.
24392
+ * @param value
24393
+ * The message.
24394
+ */
24395
+ broadcastClientMessage(id: string, value: string): void;
22501
24396
  /**
22502
24397
  * @remarks
22503
24398
  * Clears the set of dynamic properties declared for this
@@ -22529,6 +24424,22 @@ export class World {
22529
24424
  * {@link minecraftcommon.InvalidArgumentError}
22530
24425
  */
22531
24426
  getAllPlayers(): Player[];
24427
+ /**
24428
+ * @beta
24429
+ * @remarks
24430
+ * Retrieves a world clock by its name.
24431
+ *
24432
+ * @param name
24433
+ * The name of the world clock to retrieve.
24434
+ * @returns
24435
+ * The {@link WorldClock} with the given name.
24436
+ * @throws
24437
+ * WorldClockNotFoundError: If the world clock with the given
24438
+ * name does not exist.
24439
+ *
24440
+ * {@link WorldClockNotFoundError}
24441
+ */
24442
+ getClock(name: string): WorldClock;
22532
24443
  /**
22533
24444
  * @remarks
22534
24445
  * Returns the current day.
@@ -22987,6 +24898,16 @@ export class WorldAfterEvents {
22987
24898
  *
22988
24899
  */
22989
24900
  readonly buttonPush: ButtonPushAfterEventSignal;
24901
+ /**
24902
+ * @beta
24903
+ * @remarks
24904
+ * This event is triggered after a chat message has been
24905
+ * broadcast or sent to players.
24906
+ *
24907
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
24908
+ *
24909
+ */
24910
+ readonly chatSend: ChatSendAfterEventSignal;
22990
24911
  /**
22991
24912
  * @remarks
22992
24913
  * This event is fired when an entity event has been triggered
@@ -23233,6 +25154,25 @@ export class WorldAfterEvents {
23233
25154
  *
23234
25155
  */
23235
25156
  readonly leverAction: LeverActionAfterEventSignal;
25157
+ /**
25158
+ * @beta
25159
+ * @remarks
25160
+ * This event is an internal implementation detail, and is
25161
+ * otherwise not currently functional.
25162
+ *
25163
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25164
+ *
25165
+ */
25166
+ readonly messageReceive: ServerMessageAfterEventSignal;
25167
+ /**
25168
+ * @beta
25169
+ * @remarks
25170
+ * This event is triggered when a pack setting is changed.
25171
+ *
25172
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25173
+ *
25174
+ */
25175
+ readonly packSettingChange: PackSettingChangeAfterEventSignal;
23236
25176
  /**
23237
25177
  * @remarks
23238
25178
  * This event fires when a piston expands or retracts.
@@ -23266,6 +25206,15 @@ export class WorldAfterEvents {
23266
25206
  *
23267
25207
  */
23268
25208
  readonly playerCancelBreakingBlock: PlayerCancelBreakingBlockAfterEventSignal;
25209
+ /**
25210
+ * @beta
25211
+ * @remarks
25212
+ * This event fires when a player crafts a recipe.
25213
+ *
25214
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25215
+ *
25216
+ */
25217
+ readonly playerCraftRecipe: PlayerCraftRecipeAfterEventSignal;
23269
25218
  /**
23270
25219
  * @remarks
23271
25220
  * Fires when a player moved to a different dimension.
@@ -23385,6 +25334,16 @@ export class WorldAfterEvents {
23385
25334
  *
23386
25335
  */
23387
25336
  readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
25337
+ /**
25338
+ * @beta
25339
+ * @remarks
25340
+ * An event for when a player uses a named name tag on an
25341
+ * entity.
25342
+ *
25343
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25344
+ *
25345
+ */
25346
+ readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
23388
25347
  /**
23389
25348
  * @remarks
23390
25349
  * A pressure plate has popped back up (i.e., there are no
@@ -23453,6 +25412,47 @@ export class WorldAfterEvents {
23453
25412
  *
23454
25413
  */
23455
25414
  readonly weatherChange: WeatherChangeAfterEventSignal;
25415
+ /**
25416
+ * @beta
25417
+ * @remarks
25418
+ * This event fires when a {@link WorldClock} is paused.
25419
+ *
25420
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25421
+ *
25422
+ */
25423
+ readonly worldClockOnPaused: WorldClockOnPausedAfterEventSignal;
25424
+ /**
25425
+ * @beta
25426
+ * @remarks
25427
+ * This event fires when a {@link WorldClock} is resumed.
25428
+ *
25429
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25430
+ *
25431
+ */
25432
+ readonly worldClockOnResumed: WorldClockOnResumedAfterEventSignal;
25433
+ /**
25434
+ * @beta
25435
+ * @remarks
25436
+ * This event fires when the time of a {@link WorldClock} hits
25437
+ * a {@link TimeMarker} on the clock. This can happen during a
25438
+ * regular level tick or when the time is set.
25439
+ *
25440
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25441
+ *
25442
+ */
25443
+ readonly worldClockOnTimeMarker: WorldClockOnTimeMarkerAfterEventSignal;
25444
+ /**
25445
+ * @beta
25446
+ * @remarks
25447
+ * This event fires when a {@link WorldClock} time is changed.
25448
+ * This can happen when the time is directly set through
25449
+ * scripts or commands or when the clock reaches the maximum
25450
+ * time and restarts.
25451
+ *
25452
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25453
+ *
25454
+ */
25455
+ readonly worldClockOnTimeModified: WorldClockOnTimeModifiedAfterEventSignal;
23456
25456
  /**
23457
25457
  * @remarks
23458
25458
  * @privilege early-execution-readable - This property can be read in early-execution mode.
@@ -23470,6 +25470,43 @@ export class WorldAfterEvents {
23470
25470
  */
23471
25471
  export class WorldBeforeEvents {
23472
25472
  private constructor();
25473
+ /**
25474
+ * @beta
25475
+ * @remarks
25476
+ * This event is triggered after a chat message has been
25477
+ * broadcast or sent to players.
25478
+ *
25479
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25480
+ *
25481
+ * @example customCommand.ts
25482
+ * ```typescript
25483
+ * import { world, DimensionLocation } from '@minecraft/server';
25484
+ *
25485
+ * function customCommand(targetLocation: DimensionLocation) {
25486
+ * const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
25487
+ * if (eventData.message.includes('cancel')) {
25488
+ * // Cancel event if the message contains "cancel"
25489
+ * eventData.cancel = true;
25490
+ * } else {
25491
+ * const args = eventData.message.split(' ');
25492
+ *
25493
+ * if (args.length > 0) {
25494
+ * switch (args[0].toLowerCase()) {
25495
+ * case 'echo':
25496
+ * // Send a modified version of chat message
25497
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
25498
+ * break;
25499
+ * case 'help':
25500
+ * world.sendMessage(`Available commands: echo <message>`);
25501
+ * break;
25502
+ * }
25503
+ * }
25504
+ * }
25505
+ * });
25506
+ * }
25507
+ * ```
25508
+ */
25509
+ readonly chatSend: ChatSendBeforeEventSignal;
23473
25510
  /**
23474
25511
  * @remarks
23475
25512
  * This event is triggered after an event has been added to an
@@ -23516,68 +25553,522 @@ export class WorldBeforeEvents {
23516
25553
  * @privilege early-execution-readable - This property can be read in early-execution mode.
23517
25554
  *
23518
25555
  */
23519
- readonly entityTamed: EntityTamedBeforeEventSignal;
25556
+ readonly entityTamed: EntityTamedBeforeEventSignal;
25557
+ /**
25558
+ * @remarks
25559
+ * This event is fired after an explosion occurs.
25560
+ *
25561
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25562
+ *
25563
+ */
25564
+ readonly explosion: ExplosionBeforeEventSignal;
25565
+ /**
25566
+ * @remarks
25567
+ * This event fires when an item is successfully used by a
25568
+ * player.
25569
+ *
25570
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25571
+ *
25572
+ */
25573
+ readonly itemUse: ItemUseBeforeEventSignal;
25574
+ /**
25575
+ * @remarks
25576
+ * This event fires before a block is broken by a player.
25577
+ *
25578
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25579
+ *
25580
+ */
25581
+ readonly playerBreakBlock: PlayerBreakBlockBeforeEventSignal;
25582
+ /**
25583
+ * @remarks
25584
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25585
+ *
25586
+ */
25587
+ readonly playerGameModeChange: PlayerGameModeChangeBeforeEventSignal;
25588
+ /**
25589
+ * @remarks
25590
+ * Fires before a player interacts with a block.
25591
+ *
25592
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25593
+ *
25594
+ */
25595
+ readonly playerInteractWithBlock: PlayerInteractWithBlockBeforeEventSignal;
25596
+ /**
25597
+ * @remarks
25598
+ * Fires before a player interacts with an entity.
25599
+ *
25600
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25601
+ *
25602
+ */
25603
+ readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
25604
+ /**
25605
+ * @remarks
25606
+ * Fires when a player leaves the game.
25607
+ *
25608
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25609
+ *
25610
+ */
25611
+ readonly playerLeave: PlayerLeaveBeforeEventSignal;
25612
+ /**
25613
+ * @beta
25614
+ * @remarks
25615
+ * This event fires before a block is placed by a player.
25616
+ *
25617
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25618
+ *
25619
+ */
25620
+ readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
25621
+ /**
25622
+ * @remarks
25623
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25624
+ *
25625
+ */
25626
+ readonly weatherChange: WeatherChangeBeforeEventSignal;
25627
+ /**
25628
+ * @beta
25629
+ * @remarks
25630
+ * This event fires when a {@link WorldClock} reaches its
25631
+ * maximum time and is about to restart.
25632
+ *
25633
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
25634
+ *
25635
+ */
25636
+ readonly worldClockOnRestart: WorldClockOnRestartBeforeEventSignal;
25637
+ }
25638
+
25639
+ /**
25640
+ * @beta
25641
+ * A class that represents a particular clock within a world.
25642
+ */
25643
+ export class WorldClock {
25644
+ private constructor();
25645
+ /**
25646
+ * @remarks
25647
+ * Retrieves or sets whether the world clock is currently
25648
+ * paused.
25649
+ *
25650
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
25651
+ *
25652
+ */
25653
+ isPaused: boolean;
25654
+ /**
25655
+ * @remarks
25656
+ * The identifier that represents this world clock.
25657
+ *
25658
+ */
25659
+ readonly name: string;
25660
+ /**
25661
+ * @remarks
25662
+ * Retrieves or sets the current time (in ticks) of the world
25663
+ * clock.
25664
+ *
25665
+ * @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
25666
+ *
25667
+ * Minimum Value: 0
25668
+ */
25669
+ time: number;
25670
+ /**
25671
+ * @remarks
25672
+ * Retrieves the current time markers of the world clock.
25673
+ *
25674
+ */
25675
+ readonly timeMarkers: TimeMarker[];
25676
+ /**
25677
+ * @remarks
25678
+ * Adds a new time marker to the world clock.
25679
+ *
25680
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25681
+ *
25682
+ * @param timeMarkerOptions
25683
+ * Options for creating a time marker.
25684
+ * @throws This function can throw errors.
25685
+ *
25686
+ * {@link WorldClockAddTimeMarkerError}
25687
+ */
25688
+ addTimeMarker(timeMarkerOptions: TimeMarkerOptions): void;
25689
+ /**
25690
+ * @remarks
25691
+ * Removes an existing time marker from the world clock.
25692
+ *
25693
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25694
+ *
25695
+ * @param timeMarker
25696
+ * The time marker or time marker name to remove.
25697
+ * @throws
25698
+ * WorldClockTimeMarkerNotFoundError: If the time marker does
25699
+ * not exist on the world clock.
25700
+ * WorldClockRemoveMinecraftTimeMarkerError: If the time marker
25701
+ * uses the 'minecraft' namespace.
25702
+ *
25703
+ * {@link WorldClockRemoveMinecraftTimeMarkerError}
25704
+ *
25705
+ * {@link WorldClockTimeMarkerNotFoundError}
25706
+ */
25707
+ removeTimeMarker(timeMarker: string | TimeMarker): void;
25708
+ /**
25709
+ * @remarks
25710
+ * Rewinds the world clock's time to the previous occurrence of
25711
+ * the specified time marker.
25712
+ *
25713
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25714
+ *
25715
+ * @param timeMarker
25716
+ * The time marker or time marker name to rewind the world
25717
+ * clock's time to.
25718
+ * @throws
25719
+ * WorldClockTimeMarkerNotFoundError: If the time marker does
25720
+ * not exist on the world clock.
25721
+ * WorldClockRewindError: If the world clock's current time is
25722
+ * before the time marker's first occurrence.
25723
+ *
25724
+ * {@link WorldClockRewindError}
25725
+ *
25726
+ * {@link WorldClockTimeMarkerNotFoundError}
25727
+ */
25728
+ rewindTo(timeMarker: string | TimeMarker): void;
25729
+ /**
25730
+ * @remarks
25731
+ * Sets the world clock's time to the specified time marker.
25732
+ *
25733
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25734
+ *
25735
+ * @param timeMarker
25736
+ * The time marker or time marker name to set the world clock's
25737
+ * time to.
25738
+ * @throws
25739
+ * WorldClockTimeMarkerNotFoundError: If the time marker does
25740
+ * not exist on the world clock.
25741
+ *
25742
+ * {@link WorldClockTimeMarkerNotFoundError}
25743
+ */
25744
+ set(timeMarker: string | TimeMarker): void;
25745
+ /**
25746
+ * @remarks
25747
+ * Skips the world clock's time to the next occurrence of the
25748
+ * specified time marker.
25749
+ * If the next occurrence overflows the world clock's time, the
25750
+ * time is reset to the first occurrence.
25751
+ *
25752
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25753
+ *
25754
+ * @param timeMarker
25755
+ * The time marker or time marker name to skip the world
25756
+ * clock's time to.
25757
+ * @throws
25758
+ * WorldClockTimeMarkerNotFoundError: If the time marker does
25759
+ * not exist on the world clock.
25760
+ *
25761
+ * {@link WorldClockTimeMarkerNotFoundError}
25762
+ */
25763
+ skipTo(timeMarker: string | TimeMarker): void;
25764
+ }
25765
+
25766
+ /**
25767
+ * @beta
25768
+ * Contains information related to a {@link WorldClock} being
25769
+ * paused.
25770
+ */
25771
+ export class WorldClockOnPausedAfterEvent {
25772
+ private constructor();
25773
+ /**
25774
+ * @remarks
25775
+ * The world clock that was paused.
25776
+ *
25777
+ */
25778
+ readonly clock: WorldClock;
25779
+ }
25780
+
25781
+ /**
25782
+ * @beta
25783
+ * Manages callbacks that are connected to a {@link WorldClock}
25784
+ * being paused.
25785
+ */
25786
+ export class WorldClockOnPausedAfterEventSignal {
25787
+ private constructor();
25788
+ /**
25789
+ * @remarks
25790
+ * Adds a callback that will be called when a world clock is
25791
+ * paused.
25792
+ *
25793
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25794
+ *
25795
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
25796
+ *
25797
+ */
25798
+ subscribe(
25799
+ callback: (arg0: WorldClockOnPausedAfterEvent) => void,
25800
+ options?: WorldClockEventOptions,
25801
+ ): (arg0: WorldClockOnPausedAfterEvent) => void;
25802
+ /**
25803
+ * @remarks
25804
+ * Removes a callback from being called when a world clock is
25805
+ * paused.
25806
+ *
25807
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25808
+ *
25809
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
25810
+ *
25811
+ */
25812
+ unsubscribe(callback: (arg0: WorldClockOnPausedAfterEvent) => void): void;
25813
+ }
25814
+
25815
+ /**
25816
+ * @beta
25817
+ * Contains information related to a {@link WorldClock}
25818
+ * restarting.
25819
+ */
25820
+ export class WorldClockOnRestartBeforeEvent {
25821
+ private constructor();
25822
+ /**
25823
+ * @remarks
25824
+ * If set to true, cancels the world clock restart event. This
25825
+ * will keep the world clock at the maximum time value and
25826
+ * prevent it from ticking forward.
25827
+ *
25828
+ */
25829
+ cancel: boolean;
25830
+ /**
25831
+ * @remarks
25832
+ * The world clock that is restarting.
25833
+ *
25834
+ */
25835
+ readonly clock: WorldClock;
25836
+ /**
25837
+ * @remarks
25838
+ * The time that the world clock will be set to after it
25839
+ * restarts. If not set, the world clock will be set to 0.
25840
+ *
25841
+ * Minimum Value: 0
25842
+ */
25843
+ newTime: number;
25844
+ }
25845
+
25846
+ /**
25847
+ * @beta
25848
+ * Manages callbacks that are connected to a {@link WorldClock}
25849
+ * restarting.
25850
+ */
25851
+ export class WorldClockOnRestartBeforeEventSignal {
25852
+ private constructor();
25853
+ /**
25854
+ * @remarks
25855
+ * Adds a callback that will be called when a world clock is
25856
+ * restarting.
25857
+ *
25858
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25859
+ *
25860
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
25861
+ *
25862
+ * @param callback
25863
+ * This closure is called with restricted-execution privilege.
25864
+ * @returns
25865
+ * Closure that is called with restricted-execution privilege.
25866
+ */
25867
+ subscribe(
25868
+ callback: (arg0: WorldClockOnRestartBeforeEvent) => void,
25869
+ options?: WorldClockEventOptions,
25870
+ ): (arg0: WorldClockOnRestartBeforeEvent) => void;
25871
+ /**
25872
+ * @remarks
25873
+ * Removes a callback from being called when a world clock is
25874
+ * restarting.
25875
+ *
25876
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25877
+ *
25878
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
25879
+ *
25880
+ * @param callback
25881
+ * This closure is called with restricted-execution privilege.
25882
+ */
25883
+ unsubscribe(callback: (arg0: WorldClockOnRestartBeforeEvent) => void): void;
25884
+ }
25885
+
25886
+ /**
25887
+ * @beta
25888
+ * Contains information related to a {@link WorldClock} being
25889
+ * resumed.
25890
+ */
25891
+ export class WorldClockOnResumedAfterEvent {
25892
+ private constructor();
25893
+ /**
25894
+ * @remarks
25895
+ * The world clock that was resumed.
25896
+ *
25897
+ */
25898
+ readonly clock: WorldClock;
25899
+ }
25900
+
25901
+ /**
25902
+ * @beta
25903
+ * Manages callbacks that are connected to a {@link WorldClock}
25904
+ * being resumed.
25905
+ */
25906
+ export class WorldClockOnResumedAfterEventSignal {
25907
+ private constructor();
25908
+ /**
25909
+ * @remarks
25910
+ * Adds a callback that will be called when a world clock is
25911
+ * resumed.
25912
+ *
25913
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25914
+ *
25915
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
25916
+ *
25917
+ */
25918
+ subscribe(
25919
+ callback: (arg0: WorldClockOnResumedAfterEvent) => void,
25920
+ options?: WorldClockEventOptions,
25921
+ ): (arg0: WorldClockOnResumedAfterEvent) => void;
25922
+ /**
25923
+ * @remarks
25924
+ * Removes a callback from being called when a world clock is
25925
+ * resumed.
25926
+ *
25927
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25928
+ *
25929
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
25930
+ *
25931
+ */
25932
+ unsubscribe(callback: (arg0: WorldClockOnResumedAfterEvent) => void): void;
25933
+ }
25934
+
25935
+ /**
25936
+ * @beta
25937
+ * Contains information related to when the time of a
25938
+ * {@link WorldClock} hits a {@link TimeMarker}.
25939
+ */
25940
+ export class WorldClockOnTimeMarkerAfterEvent {
25941
+ private constructor();
25942
+ /**
25943
+ * @remarks
25944
+ * The world clock that hit a time marker.
25945
+ *
25946
+ */
25947
+ readonly clock: WorldClock;
23520
25948
  /**
23521
25949
  * @remarks
23522
- * This event is fired after an explosion occurs.
23523
- *
23524
- * @privilege early-execution-readable - This property can be read in early-execution mode.
25950
+ * The time marker that was hit by the world clock.
23525
25951
  *
23526
25952
  */
23527
- readonly explosion: ExplosionBeforeEventSignal;
25953
+ readonly timeMarker: TimeMarker;
25954
+ }
25955
+
25956
+ /**
25957
+ * @beta
25958
+ * Manages callbacks that are connected to when the time of a
25959
+ * {@link WorldClock} hits a {@link TimeMarker}.
25960
+ */
25961
+ export class WorldClockOnTimeMarkerAfterEventSignal {
25962
+ private constructor();
23528
25963
  /**
23529
25964
  * @remarks
23530
- * This event fires when an item is successfully used by a
23531
- * player.
25965
+ * Adds a callback that will be called when a world clock's
25966
+ * time hits a time marker.
23532
25967
  *
23533
- * @privilege early-execution-readable - This property can be read in early-execution mode.
25968
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25969
+ *
25970
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
23534
25971
  *
23535
25972
  */
23536
- readonly itemUse: ItemUseBeforeEventSignal;
25973
+ subscribe(
25974
+ callback: (arg0: WorldClockOnTimeMarkerAfterEvent) => void,
25975
+ options?: WorldClockTimeMarkerEventOptions,
25976
+ ): (arg0: WorldClockOnTimeMarkerAfterEvent) => void;
23537
25977
  /**
23538
25978
  * @remarks
23539
- * This event fires before a block is broken by a player.
25979
+ * Removes a callback from being called when a world clock's
25980
+ * time hits a time marker.
23540
25981
  *
23541
- * @privilege early-execution-readable - This property can be read in early-execution mode.
25982
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
25983
+ *
25984
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
23542
25985
  *
23543
25986
  */
23544
- readonly playerBreakBlock: PlayerBreakBlockBeforeEventSignal;
25987
+ unsubscribe(callback: (arg0: WorldClockOnTimeMarkerAfterEvent) => void): void;
25988
+ }
25989
+
25990
+ /**
25991
+ * @beta
25992
+ * Contains information related to changes to the time of a
25993
+ * {@link WorldClock}.
25994
+ */
25995
+ export class WorldClockOnTimeModifiedAfterEvent {
25996
+ private constructor();
23545
25997
  /**
23546
25998
  * @remarks
23547
- * @privilege early-execution-readable - This property can be read in early-execution mode.
25999
+ * The world clock that had its time modified.
23548
26000
  *
23549
26001
  */
23550
- readonly playerGameModeChange: PlayerGameModeChangeBeforeEventSignal;
26002
+ readonly clock: WorldClock;
26003
+ }
26004
+
26005
+ /**
26006
+ * @beta
26007
+ * Manages callbacks that are connected to changes to the time
26008
+ * of a {@link WorldClock}.
26009
+ */
26010
+ export class WorldClockOnTimeModifiedAfterEventSignal {
26011
+ private constructor();
23551
26012
  /**
23552
26013
  * @remarks
23553
- * Fires before a player interacts with a block.
26014
+ * Adds a callback that will be called when a world clock's
26015
+ * time is modified.
23554
26016
  *
23555
- * @privilege early-execution-readable - This property can be read in early-execution mode.
26017
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
26018
+ *
26019
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
23556
26020
  *
23557
26021
  */
23558
- readonly playerInteractWithBlock: PlayerInteractWithBlockBeforeEventSignal;
26022
+ subscribe(
26023
+ callback: (arg0: WorldClockOnTimeModifiedAfterEvent) => void,
26024
+ options?: WorldClockEventOptions,
26025
+ ): (arg0: WorldClockOnTimeModifiedAfterEvent) => void;
23559
26026
  /**
23560
26027
  * @remarks
23561
- * Fires before a player interacts with an entity.
26028
+ * Removes a callback from being called when a world clock's
26029
+ * time is modified.
23562
26030
  *
23563
- * @privilege early-execution-readable - This property can be read in early-execution mode.
26031
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
26032
+ *
26033
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
23564
26034
  *
23565
26035
  */
23566
- readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
26036
+ unsubscribe(callback: (arg0: WorldClockOnTimeModifiedAfterEvent) => void): void;
26037
+ }
26038
+
26039
+ /**
26040
+ * @beta
26041
+ * Provides the functionality for registering custom world
26042
+ * clocks. World clocks can only be registered during the
26043
+ * system startup event.
26044
+ */
26045
+ export class WorldClockRegistry {
26046
+ private constructor();
23567
26047
  /**
23568
26048
  * @remarks
23569
- * Fires when a player leaves the game.
26049
+ * Registers a new custom world clock. Must be called during
26050
+ * the system startup event.
23570
26051
  *
23571
- * @privilege early-execution-readable - This property can be read in early-execution mode.
26052
+ * @privilege early-execution-allowed - This function can be called in early-execution mode.
23572
26053
  *
23573
- */
23574
- readonly playerLeave: PlayerLeaveBeforeEventSignal;
23575
- /**
23576
- * @remarks
23577
- * @privilege early-execution-readable - This property can be read in early-execution mode.
26054
+ * @param name
26055
+ * The name that represents this world clock. Must have a
26056
+ * namespace and use only valid identifier characters. (e.g.,
26057
+ * 'mypack:my_clock').
26058
+ * @param registrationOptions
26059
+ * Additional options for registering a world clock, such as
26060
+ * including time markers at registration time.
26061
+ * @throws This function can throw errors.
26062
+ *
26063
+ * {@link WorldClockInvalidRegistryError}
26064
+ *
26065
+ * {@link WorldClockRegistrationError}
26066
+ *
26067
+ * {@link WorldClockReloadNewWorldClockError}
23578
26068
  *
26069
+ * {@link WorldClockReloadTimeMarkerError}
23579
26070
  */
23580
- readonly weatherChange: WeatherChangeBeforeEventSignal;
26071
+ registerClock(name: string, registrationOptions?: WorldClockRegistrationOptions): void;
23581
26072
  }
23582
26073
 
23583
26074
  export class WorldLoadAfterEvent {
@@ -23666,7 +26157,9 @@ export interface BiomeSearchOptions {
23666
26157
  * A BlockBoundingBox is an interface to an object which
23667
26158
  * represents an AABB aligned rectangle.
23668
26159
  * The BlockBoundingBox assumes that it was created in a valid
23669
- * state (min <= max) but cannot guarantee it.
26160
+ * state (min <= max) but cannot guarantee it (unless it was
26161
+ * created using the associated {@link BlockBoundingBoxUtils}
26162
+ * utility functions.
23670
26163
  * The min/max coordinates represent the diametrically opposite
23671
26164
  * corners of the rectangle.
23672
26165
  * The BlockBoundingBox is not a representation of blocks - it
@@ -24294,6 +26787,15 @@ export interface CustomCommand {
24294
26787
  * command.
24295
26788
  */
24296
26789
  export interface CustomCommandParameter {
26790
+ /**
26791
+ * @beta
26792
+ * @remarks
26793
+ * Can be used to reference the enum name when
26794
+ * {@link CustomCommandParamType} is 'Enum'. Allows the
26795
+ * parameter name to be different from the enum name.
26796
+ *
26797
+ */
26798
+ enumName?: string;
24297
26799
  /**
24298
26800
  * @remarks
24299
26801
  * The name of parameter as it appears on the command line.
@@ -24372,6 +26874,14 @@ export interface DefinitionModifier {
24372
26874
  *
24373
26875
  */
24374
26876
  removedComponentGroups: string[];
26877
+ /**
26878
+ * @beta
26879
+ * @remarks
26880
+ * The list of entity definition events that will be fired via
26881
+ * this update.
26882
+ *
26883
+ */
26884
+ triggers: Trigger[];
24375
26885
  }
24376
26886
 
24377
26887
  /**
@@ -25725,6 +28235,31 @@ export interface PlayerBreakingBlockEventOptions {
25725
28235
  playerFilter?: EntityFilter;
25726
28236
  }
25727
28237
 
28238
+ /**
28239
+ * @beta
28240
+ * Contains options for filtering player craft recipe events.
28241
+ */
28242
+ export interface PlayerCraftRecipeEventOptions {
28243
+ /**
28244
+ * @remarks
28245
+ * Filter for the block where the recipe is crafted.
28246
+ *
28247
+ */
28248
+ blockFilter?: BlockFilter;
28249
+ /**
28250
+ * @remarks
28251
+ * Filter for the item crafted by the player.
28252
+ *
28253
+ */
28254
+ itemFilter?: ItemFilter;
28255
+ /**
28256
+ * @remarks
28257
+ * Filter for the player crafting the recipe.
28258
+ *
28259
+ */
28260
+ playerFilter?: EntityFilter;
28261
+ }
28262
+
25728
28263
  /**
25729
28264
  * Additional options for how a sound plays for a player.
25730
28265
  */
@@ -25736,6 +28271,19 @@ export interface PlayerSoundOptions {
25736
28271
  *
25737
28272
  */
25738
28273
  location?: Vector3;
28274
+ /**
28275
+ * @beta
28276
+ * @remarks
28277
+ * Number of additional times to repeat the sound after the
28278
+ * initial play. `0` (the default) plays the sound once, `-1`
28279
+ * loops it forever, and a positive integer `N` plays the sound
28280
+ * `N + 1` times in total. For example, `loopCount: 1` plays
28281
+ * the sound twice. The loop count is fixed when the sound
28282
+ * starts and cannot be changed afterward. When using `-1`, see
28283
+ * `SoundInstance` for handle lifetime requirements.
28284
+ *
28285
+ */
28286
+ loopCount?: number;
25739
28287
  /**
25740
28288
  * @remarks
25741
28289
  * Optional pitch of the sound.
@@ -25807,6 +28355,56 @@ export interface PlayerVisibilityRules extends EntityVisibilityRules {
25807
28355
  showSpectatorToSpectator?: boolean;
25808
28356
  }
25809
28357
 
28358
+ /**
28359
+ * @beta
28360
+ * Associates a block point-of-interest instance with its
28361
+ * squared distance from a query center.
28362
+ */
28363
+ export interface PoiDistancePair {
28364
+ /**
28365
+ * @remarks
28366
+ * Squared three-dimensional distance, in blocks squared, from
28367
+ * the query center to the POI position.
28368
+ *
28369
+ */
28370
+ distance: number;
28371
+ /**
28372
+ * @remarks
28373
+ * POI instance at this distance.
28374
+ *
28375
+ */
28376
+ poi: PoiBlockInstance;
28377
+ }
28378
+
28379
+ /**
28380
+ * @beta
28381
+ * Selects block point-of-interest types by their exact
28382
+ * namespaced identifier.
28383
+ */
28384
+ export interface PoiNameFilter {
28385
+ /**
28386
+ * @remarks
28387
+ * Exact namespaced POI type identifier to match.
28388
+ *
28389
+ */
28390
+ name: string;
28391
+ }
28392
+
28393
+ /**
28394
+ * @beta
28395
+ * Selects block point-of-interest types that have all
28396
+ * specified tags.
28397
+ */
28398
+ export interface PoiTagFilter {
28399
+ /**
28400
+ * @remarks
28401
+ * Namespaced POI tags that a matching type must contain. All
28402
+ * tags in the array are required.
28403
+ *
28404
+ */
28405
+ tags: string[];
28406
+ }
28407
+
25810
28408
  /**
25811
28409
  * @rc
25812
28410
  * Contains optional filters that control which primitive
@@ -26586,6 +29184,37 @@ export interface TickingAreaOptions {
26586
29184
  to: Vector3;
26587
29185
  }
26588
29186
 
29187
+ /**
29188
+ * @beta
29189
+ * Options for creating time markers for world clocks.
29190
+ */
29191
+ export interface TimeMarkerOptions {
29192
+ /**
29193
+ * @remarks
29194
+ * The name that the time marker will have. Must have a
29195
+ * namespace and use only valid identifier characters. (e.g.,
29196
+ * 'mypack:my_time_marker').
29197
+ *
29198
+ */
29199
+ name: string;
29200
+ /**
29201
+ * @remarks
29202
+ * The optional repeat period (in ticks) that the time marker
29203
+ * will have. If not specified, the time marker will only occur
29204
+ * once.
29205
+ *
29206
+ * Minimum Value: 0
29207
+ */
29208
+ period?: number;
29209
+ /**
29210
+ * @remarks
29211
+ * The time (in ticks) that the time marker will occur at.
29212
+ *
29213
+ * Minimum Value: 0
29214
+ */
29215
+ time: number;
29216
+ }
29217
+
26589
29218
  /**
26590
29219
  * Contains additional options for displaying a title and
26591
29220
  * optional subtitle.
@@ -26723,6 +29352,57 @@ export interface WaypointTextureSelector {
26723
29352
  textureBoundsList: WaypointTextureBounds[];
26724
29353
  }
26725
29354
 
29355
+ /**
29356
+ * @beta
29357
+ * Contains parameters for world clock events that filters out
29358
+ * which events are passed to the provided callback.
29359
+ */
29360
+ export interface WorldClockEventOptions {
29361
+ /**
29362
+ * @remarks
29363
+ * The name of the clock that this event should fire for.
29364
+ *
29365
+ */
29366
+ clock: string;
29367
+ }
29368
+
29369
+ /**
29370
+ * @beta
29371
+ * Contains additional options for registering world clocks.
29372
+ */
29373
+ export interface WorldClockRegistrationOptions {
29374
+ /**
29375
+ * @remarks
29376
+ * Set of options to include time markers during world clock
29377
+ * registration.
29378
+ *
29379
+ */
29380
+ timeMarkers?: TimeMarkerOptions[];
29381
+ }
29382
+
29383
+ /**
29384
+ * @beta
29385
+ * Contains parameters for world clock time marker events that
29386
+ * filters out which events are passed to the provided
29387
+ * callback.
29388
+ */
29389
+ export interface WorldClockTimeMarkerEventOptions {
29390
+ /**
29391
+ * @remarks
29392
+ * The name of the world clock that this event should fire for.
29393
+ *
29394
+ */
29395
+ clock: string;
29396
+ /**
29397
+ * @remarks
29398
+ * The name of the time marker that this event should fire for.
29399
+ * If undefined, the event will fire for all time markers on
29400
+ * the world clock.
29401
+ *
29402
+ */
29403
+ timeMarker?: string;
29404
+ }
29405
+
26726
29406
  /**
26727
29407
  * Contains additional options for a playSound occurrence.
26728
29408
  */
@@ -26731,6 +29411,19 @@ export interface WorldSoundOptions {
26731
29411
  * @rc
26732
29412
  */
26733
29413
  isBroadcast?: boolean;
29414
+ /**
29415
+ * @beta
29416
+ * @remarks
29417
+ * Number of additional times to repeat the sound after the
29418
+ * initial play. `0` (the default) plays the sound once, `-1`
29419
+ * loops it forever, and a positive integer `N` plays the sound
29420
+ * `N + 1` times in total. For example, `loopCount: 1` plays
29421
+ * the sound twice. The loop count is fixed when the sound
29422
+ * starts and cannot be changed afterward. When using `-1`, see
29423
+ * `SoundInstance` for handle lifetime requirements.
29424
+ *
29425
+ */
29426
+ loopCount?: number;
26734
29427
  /**
26735
29428
  * @remarks
26736
29429
  * Pitch of the sound played.
@@ -27025,6 +29718,23 @@ export class InvalidPotionEffectTypeError extends Error {
27025
29718
  private constructor();
27026
29719
  }
27027
29720
 
29721
+ /**
29722
+ * @beta
29723
+ * Thrown when an invalid recipe identifier is used.
29724
+ */
29725
+ // @ts-ignore Class inheritance allowed for native defined classes
29726
+ export class InvalidRecipeError extends Error {
29727
+ private constructor();
29728
+ /**
29729
+ * @remarks
29730
+ * The identifier of the invalid recipe.
29731
+ *
29732
+ * @privilege early-execution-readable - This property can be read in early-execution mode.
29733
+ *
29734
+ */
29735
+ readonly recipeId: string;
29736
+ }
29737
+
27028
29738
  /**
27029
29739
  * Thrown when a Structure is invalid. A structure becomes
27030
29740
  * invalid when it is deleted.
@@ -27179,6 +29889,111 @@ export class UnloadedChunksError extends Error {
27179
29889
  private constructor();
27180
29890
  }
27181
29891
 
29892
+ /**
29893
+ * @beta
29894
+ * Error thrown by {@link WorldClock.addTimeMarker} when
29895
+ * failing to add a time marker to a world clock.
29896
+ */
29897
+ // @ts-ignore Class inheritance allowed for native defined classes
29898
+ export class WorldClockAddTimeMarkerError extends Error {
29899
+ private constructor();
29900
+ }
29901
+
29902
+ /**
29903
+ * @beta
29904
+ * Thrown when trying to register a world clock outside of the
29905
+ * system startup event.
29906
+ */
29907
+ // @ts-ignore Class inheritance allowed for native defined classes
29908
+ export class WorldClockInvalidRegistryError extends Error {
29909
+ private constructor();
29910
+ }
29911
+
29912
+ /**
29913
+ * @beta
29914
+ * Error thrown when a time marker is invalid. This can occur
29915
+ * when trying to access data on a time marker that has been
29916
+ * removed.
29917
+ */
29918
+ // @ts-ignore Class inheritance allowed for native defined classes
29919
+ export class WorldClockInvalidTimeMarkerError extends Error {
29920
+ private constructor();
29921
+ }
29922
+
29923
+ /**
29924
+ * @beta
29925
+ * Error thrown when a world clock is not found in the world
29926
+ * clock registry.
29927
+ */
29928
+ // @ts-ignore Class inheritance allowed for native defined classes
29929
+ export class WorldClockNotFoundError extends Error {
29930
+ private constructor();
29931
+ }
29932
+
29933
+ /**
29934
+ * @beta
29935
+ * Error thrown by {@link WorldClockRegistry.registerClock}
29936
+ * when failing to register a world clock.
29937
+ */
29938
+ // @ts-ignore Class inheritance allowed for native defined classes
29939
+ export class WorldClockRegistrationError extends Error {
29940
+ private constructor();
29941
+ }
29942
+
29943
+ /**
29944
+ * @beta
29945
+ * Thrown after using the /reload command when trying to
29946
+ * register a world clock that was not previously registered.
29947
+ * New world clocks cannot be added during a reload.
29948
+ */
29949
+ // @ts-ignore Class inheritance allowed for native defined classes
29950
+ export class WorldClockReloadNewWorldClockError extends Error {
29951
+ private constructor();
29952
+ }
29953
+
29954
+ /**
29955
+ * @beta
29956
+ * Error thrown after using the /reload command when trying to
29957
+ * re-register an existing world clock with an invalid time
29958
+ * marker.
29959
+ */
29960
+ // @ts-ignore Class inheritance allowed for native defined classes
29961
+ export class WorldClockReloadTimeMarkerError extends Error {
29962
+ private constructor();
29963
+ }
29964
+
29965
+ /**
29966
+ * @beta
29967
+ * Error thrown by {@link WorldClock.removeTimeMarker} when
29968
+ * trying to remove a time marker with the 'minecraft'
29969
+ * namespace from a world clock.
29970
+ */
29971
+ // @ts-ignore Class inheritance allowed for native defined classes
29972
+ export class WorldClockRemoveMinecraftTimeMarkerError extends Error {
29973
+ private constructor();
29974
+ }
29975
+
29976
+ /**
29977
+ * @beta
29978
+ * Error thrown by {@link WorldClock.rewindTo} when the world
29979
+ * clock's time is already before the time marker's first
29980
+ * occurrence.
29981
+ */
29982
+ // @ts-ignore Class inheritance allowed for native defined classes
29983
+ export class WorldClockRewindError extends Error {
29984
+ private constructor();
29985
+ }
29986
+
29987
+ /**
29988
+ * @beta
29989
+ * Error thrown when performing actions on a world clock with a
29990
+ * time marker that does not exist.
29991
+ */
29992
+ // @ts-ignore Class inheritance allowed for native defined classes
29993
+ export class WorldClockTimeMarkerNotFoundError extends Error {
29994
+ private constructor();
29995
+ }
29996
+
27182
29997
  export const HudElementsCount = 13;
27183
29998
  export const HudVisibilityCount = 2;
27184
29999
  /**