@minecraft/server 2.6.0-rc.1.26.10-preview.20 → 2.7.0-beta.1.26.10-preview.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +2934 -140
  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.6.0"
19
+ * "version": "2.7.0-beta"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -24,6 +24,25 @@
24
24
  import * as minecraftcommon from '@minecraft/common';
25
25
  // @ts-ignore Optional types-only package, will decay to any if @minecraft/vanilla-data isn't installed
26
26
  import type * as minecraftvanilladata from '@minecraft/vanilla-data';
27
+ /**
28
+ * @beta
29
+ * Specifies different targeting modes for use in aim-assist.
30
+ */
31
+ export enum AimAssistTargetMode {
32
+ /**
33
+ * @remarks
34
+ * Angle based targeting.
35
+ *
36
+ */
37
+ Angle = 'Angle',
38
+ /**
39
+ * @remarks
40
+ * Distance based targeting.
41
+ *
42
+ */
43
+ Distance = 'Distance',
44
+ }
45
+
27
46
  /**
28
47
  * The types of block components that are accessible via
29
48
  * function Block.getComponent.
@@ -215,6 +234,55 @@ export enum CommandPermissionLevel {
215
234
  Owner = 4,
216
235
  }
217
236
 
237
+ /**
238
+ * @beta
239
+ * The Action enum determines how the CompoundBlockVolume
240
+ * considers the associated CompoundBlockVolumeItem when
241
+ * performing inside/outside calculations.
242
+ */
243
+ export enum CompoundBlockVolumeAction {
244
+ /**
245
+ * @remarks
246
+ * The associated BlockVolume is considered a positive space,
247
+ * and any intersection tests are considered hits
248
+ *
249
+ */
250
+ Add = 0,
251
+ /**
252
+ * @remarks
253
+ * The associated BlockVolume is considered a negative or void
254
+ * space, and any intersection tests are considered misses.
255
+ * Using the Subtract action, it is possible to `punch holes`
256
+ * in block volumes so that any intersection tests may pass
257
+ * through such spaces
258
+ *
259
+ */
260
+ Subtract = 1,
261
+ }
262
+
263
+ /**
264
+ * @beta
265
+ * An enum describing the relativity of the
266
+ * CompoundBlockVolumeItem, relative to the parent
267
+ * CompoundVolume.
268
+ */
269
+ export enum CompoundBlockVolumePositionRelativity {
270
+ /**
271
+ * @remarks
272
+ * The locations within the associated BlockVolume are relative
273
+ * to the CompoundBlockVolume to which they were added
274
+ *
275
+ */
276
+ Relative = 0,
277
+ /**
278
+ * @remarks
279
+ * The locations within the associated BlockVolume are in
280
+ * absolute world space
281
+ *
282
+ */
283
+ Absolute = 1,
284
+ }
285
+
218
286
  /**
219
287
  * Reasons that the {@link
220
288
  * @minecraft/server.ContainerRulesError} was thrown.
@@ -317,6 +385,13 @@ export enum CustomCommandErrorReason {
317
385
  *
318
386
  */
319
387
  RegistryReadOnly = 'RegistryReadOnly',
388
+ /**
389
+ * @beta
390
+ * @remarks
391
+ * Non enum type command parameters cannot use enumName.
392
+ *
393
+ */
394
+ UnexpectedEnumName = 'UnexpectedEnumName',
320
395
  }
321
396
 
322
397
  /**
@@ -684,6 +759,23 @@ export enum EnchantmentSlot {
684
759
  Sword = 'Sword',
685
760
  }
686
761
 
762
+ /**
763
+ * @beta
764
+ * The entity's attach location point. Contains points such as
765
+ * head, body, leg, etc to attach the camera to.
766
+ */
767
+ export enum EntityAttachPoint {
768
+ Body = 'Body',
769
+ BreathingPoint = 'BreathingPoint',
770
+ DropAttachPoint = 'DropAttachPoint',
771
+ ExplosionPoint = 'ExplosionPoint',
772
+ Eyes = 'Eyes',
773
+ Feet = 'Feet',
774
+ Head = 'Head',
775
+ Mouth = 'Mouth',
776
+ WeaponAttachPoint = 'WeaponAttachPoint',
777
+ }
778
+
687
779
  /**
688
780
  * The types of entity components that are accessible via
689
781
  * function Entity.getComponent.
@@ -1031,6 +1123,14 @@ export enum EntityComponentTypes {
1031
1123
  *
1032
1124
  */
1033
1125
  NavigationWalk = 'minecraft:navigation.walk',
1126
+ /**
1127
+ * @beta
1128
+ * @remarks
1129
+ * Adds NPC capabilities to an entity such as custom skin,
1130
+ * name, and dialogue interactions.
1131
+ *
1132
+ */
1133
+ Npc = 'minecraft:npc',
1034
1134
  /**
1035
1135
  * @remarks
1036
1136
  * When present on an entity, this entity is on fire.
@@ -1510,6 +1610,14 @@ export enum EntitySwingSource {
1510
1610
  * and mainhand slots.
1511
1611
  */
1512
1612
  export enum EquipmentSlot {
1613
+ /**
1614
+ * @beta
1615
+ * @remarks
1616
+ * The body slot. This slot is used to hold armor for
1617
+ * non-humanoid mobs.
1618
+ *
1619
+ */
1620
+ Body = 'Body',
1513
1621
  /**
1514
1622
  * @remarks
1515
1623
  * The chest slot. This slot is used to hold items such as
@@ -1752,6 +1860,10 @@ export enum GameRule {
1752
1860
  *
1753
1861
  */
1754
1862
  KeepInventory = 'keepInventory',
1863
+ /**
1864
+ * @beta
1865
+ */
1866
+ LocatorBar = 'locatorBar',
1755
1867
  /**
1756
1868
  * @remarks
1757
1869
  * The maximum number of chained commands that can execute per
@@ -2735,6 +2847,41 @@ export enum StructureSaveMode {
2735
2847
  World = 'World',
2736
2848
  }
2737
2849
 
2850
+ /**
2851
+ * @beta
2852
+ * The reason that the {@link
2853
+ * @minecraft/server.TickingAreaError} was thrown.
2854
+ */
2855
+ export enum TickingAreaErrorReason {
2856
+ /**
2857
+ * @remarks
2858
+ * Added a ticking area with an identifier that already exists.
2859
+ *
2860
+ */
2861
+ IdentifierAlreadyExists = 'IdentifierAlreadyExists',
2862
+ /**
2863
+ * @remarks
2864
+ * Adding this ticking area pushed the ticking areas over the
2865
+ * limit specified by {@link TickingAreaManager.maxChunkCount}.
2866
+ *
2867
+ */
2868
+ OverChunkLimit = 'OverChunkLimit',
2869
+ /**
2870
+ * @remarks
2871
+ * Exceeded the 255 chunk limit for the length or width of the
2872
+ * ticking area.
2873
+ *
2874
+ */
2875
+ SideLengthExceeded = 'SideLengthExceeded',
2876
+ /**
2877
+ * @remarks
2878
+ * Tried to remove ticking area with identifier not registered
2879
+ * in the {@link TickingAreaManager}.
2880
+ *
2881
+ */
2882
+ UnknownIdentifier = 'UnknownIdentifier',
2883
+ }
2884
+
2738
2885
  /**
2739
2886
  * Provides numeric values for common periods in the Minecraft
2740
2887
  * day.
@@ -2834,6 +2981,29 @@ export enum TintMethod {
2834
2981
  Water = 'Water',
2835
2982
  }
2836
2983
 
2984
+ /**
2985
+ * @beta
2986
+ * An enumeration with the reason that a watchdog is deciding
2987
+ * to terminate execution of a behavior packs' script.
2988
+ */
2989
+ export enum WatchdogTerminateReason {
2990
+ /**
2991
+ * @remarks
2992
+ * Script runtime for a behavior pack is terminated due to
2993
+ * non-responsiveness from script (a hang or infinite loop).
2994
+ *
2995
+ */
2996
+ Hang = 'Hang',
2997
+ /**
2998
+ * @remarks
2999
+ * Script runtime for a behavior pack is terminated due to a
3000
+ * stack overflow (a long, and potentially infinite) chain of
3001
+ * function calls.
3002
+ *
3003
+ */
3004
+ StackOverflow = 'StackOverflow',
3005
+ }
3006
+
2837
3007
  /**
2838
3008
  * Used to specify the type of weather condition within the
2839
3009
  * world.
@@ -2985,6 +3155,7 @@ export type EntityComponentTypeMap = {
2985
3155
  'minecraft:navigation.generic': EntityNavigationGenericComponent;
2986
3156
  'minecraft:navigation.hover': EntityNavigationHoverComponent;
2987
3157
  'minecraft:navigation.walk': EntityNavigationWalkComponent;
3158
+ 'minecraft:npc': EntityNpcComponent;
2988
3159
  'minecraft:onfire': EntityOnFireComponent;
2989
3160
  'minecraft:player.exhaustion': EntityExhaustionComponent;
2990
3161
  'minecraft:player.hunger': EntityHungerComponent;
@@ -3018,6 +3189,7 @@ export type EntityComponentTypeMap = {
3018
3189
  'navigation.generic': EntityNavigationGenericComponent;
3019
3190
  'navigation.hover': EntityNavigationHoverComponent;
3020
3191
  'navigation.walk': EntityNavigationWalkComponent;
3192
+ npc: EntityNpcComponent;
3021
3193
  onfire: EntityOnFireComponent;
3022
3194
  'player.exhaustion': EntityExhaustionComponent;
3023
3195
  'player.hunger': EntityHungerComponent;
@@ -3037,6 +3209,15 @@ export type EntityComponentTypeMap = {
3037
3209
  wants_jockey: EntityWantsJockeyComponent;
3038
3210
  };
3039
3211
 
3212
+ /**
3213
+ * @beta
3214
+ */
3215
+ export type EntityIdentifierType<T> = [T] extends [never]
3216
+ ? VanillaEntityIdentifier
3217
+ : T extends string
3218
+ ? VanillaEntityIdentifier | T
3219
+ : never;
3220
+
3040
3221
  export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
3041
3222
  ? ItemComponentTypeMap[T]
3042
3223
  : ItemCustomComponentInstance;
@@ -3063,194 +3244,808 @@ export type ItemComponentTypeMap = {
3063
3244
  };
3064
3245
 
3065
3246
  /**
3066
- * Describes a type of biome.
3247
+ * @beta
3067
3248
  */
3068
- export class BiomeType {
3069
- private constructor();
3070
- /**
3071
- * @remarks
3072
- * Identifier of the biome type.
3073
- *
3074
- */
3075
- readonly id: string;
3076
- }
3249
+ export type VanillaEntityIdentifier =
3250
+ | EntityType
3251
+ | minecraftvanilladata.MinecraftEntityTypes
3252
+ | `${minecraftvanilladata.MinecraftEntityTypes}`
3253
+ | `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
3077
3254
 
3078
3255
  /**
3079
- * Represents a block in a dimension. A block represents a
3080
- * unique X, Y, and Z within a dimension and get/sets the state
3081
- * of the block at that location. This type was significantly
3082
- * updated in version 1.17.10.21.
3256
+ * @beta
3257
+ * Handle to an aim-assist category that exists in the
3258
+ * world.aimAssist registry.
3083
3259
  */
3084
- export class Block {
3260
+ export class AimAssistCategory {
3085
3261
  private constructor();
3086
3262
  /**
3087
3263
  * @remarks
3088
- * Returns the dimension that the block is within.
3264
+ * Default targeting priority used for block types not found in
3265
+ * getBlockPriorities.
3089
3266
  *
3267
+ * @throws This property can throw when used.
3090
3268
  */
3091
- readonly dimension: Dimension;
3269
+ readonly defaultBlockPriority: number;
3092
3270
  /**
3093
3271
  * @remarks
3094
- * Returns true if this block is an air block (i.e., empty
3095
- * space).
3272
+ * Default targeting priority used for entity types not found
3273
+ * in getEntityPriorities.
3096
3274
  *
3097
3275
  * @throws This property can throw when used.
3276
+ */
3277
+ readonly defaultEntityPriority: number;
3278
+ /**
3279
+ * @remarks
3280
+ * The unique Id associated with the category.
3098
3281
  *
3099
- * {@link LocationInUnloadedChunkError}
3100
- *
3101
- * {@link LocationOutOfWorldBoundariesError}
3102
3282
  */
3103
- readonly isAir: boolean;
3283
+ readonly identifier: string;
3104
3284
  /**
3105
3285
  * @remarks
3106
- * Returns true if this block is a liquid block - (e.g., a
3107
- * water block and a lava block are liquid, while an air block
3108
- * and a stone block are not. Water logged blocks are not
3109
- * liquid blocks).
3286
+ * Gets the priority settings used for block targeting.
3110
3287
  *
3111
- * @throws This property can throw when used.
3288
+ * @returns
3289
+ * The record mapping block Ids to their priority settings.
3290
+ * Larger numbers have greater priority.
3291
+ * @throws This function can throw errors.
3292
+ */
3293
+ getBlockPriorities(): Record<string, number>;
3294
+ /**
3295
+ * @remarks
3296
+ * Gets the priority settings used for block targeting.
3112
3297
  *
3113
- * {@link LocationInUnloadedChunkError}
3298
+ * @returns
3299
+ * The record mapping block tags to their priority settings.
3300
+ * Larger numbers have greater priority.
3301
+ * @throws This function can throw errors.
3114
3302
  *
3115
- * {@link LocationOutOfWorldBoundariesError}
3303
+ * {@link minecraftcommon.EngineError}
3116
3304
  */
3117
- readonly isLiquid: boolean;
3305
+ getBlockTagPriorities(): Record<string, number>;
3118
3306
  /**
3119
3307
  * @remarks
3120
- * Returns true if this reference to a block is still valid
3121
- * (for example, if the block is unloaded, references to that
3122
- * block will no longer be valid.)
3308
+ * Gets the priority settings used for entity targeting.
3123
3309
  *
3310
+ * @returns
3311
+ * The record mapping entity Ids to their priority settings.
3312
+ * Larger numbers have greater priority.
3313
+ * @throws This function can throw errors.
3124
3314
  */
3125
- readonly isValid: boolean;
3315
+ getEntityPriorities(): Record<string, number>;
3126
3316
  /**
3127
3317
  * @remarks
3128
- * Returns or sets whether this block has water on it.
3318
+ * Gets the priority settings used for entity targeting.
3129
3319
  *
3130
- * @throws This property can throw when used.
3320
+ * @returns
3321
+ * Map entity type families to their priority settings in a
3322
+ * Record. Larger numbers have greater priority.
3323
+ * @throws This function can throw errors.
3131
3324
  *
3132
- * {@link LocationInUnloadedChunkError}
3325
+ * {@link minecraftcommon.EngineError}
3326
+ */
3327
+ getEntityTypeFamilyPriorities(): Record<string, number>;
3328
+ }
3329
+
3330
+ /**
3331
+ * @beta
3332
+ * Settings used with AimAssistRegistry.addCategory for
3333
+ * creation of the AimAssistCategory.
3334
+ */
3335
+ export class AimAssistCategorySettings {
3336
+ /**
3337
+ * @remarks
3338
+ * Optional. Default targeting priority used for block types
3339
+ * not provided to setBlockPriorities.
3340
+ *
3341
+ * This property can't be edited in restricted-execution mode.
3133
3342
  *
3134
- * {@link LocationOutOfWorldBoundariesError}
3135
3343
  */
3136
- readonly isWaterlogged: boolean;
3344
+ defaultBlockPriority: number;
3137
3345
  /**
3138
3346
  * @remarks
3139
- * Key for the localization of this block's name used in .lang
3140
- * files.
3347
+ * Optional. Default targeting priority used for entity types
3348
+ * not provided to setEntityPriorities.
3141
3349
  *
3142
- * @throws This property can throw when used.
3350
+ * This property can't be edited in restricted-execution mode.
3143
3351
  *
3144
- * {@link LocationInUnloadedChunkError}
3352
+ */
3353
+ defaultEntityPriority: number;
3354
+ /**
3355
+ * @remarks
3356
+ * The unique Id used to register the category with. Must have
3357
+ * a namespace.
3145
3358
  *
3146
- * {@link LocationOutOfWorldBoundariesError}
3147
3359
  */
3148
- readonly localizationKey: string;
3360
+ readonly identifier: string;
3149
3361
  /**
3150
3362
  * @remarks
3151
- * Coordinates of the specified block.
3363
+ * Constructor that takes a unique Id to associate with the
3364
+ * created AimAssistCategory. Must have a namespace.
3152
3365
  *
3153
- * @throws This property can throw when used.
3154
3366
  */
3155
- readonly location: Vector3;
3367
+ constructor(identifier: string);
3156
3368
  /**
3157
3369
  * @remarks
3158
- * Additional block configuration data that describes the
3159
- * block.
3370
+ * Gets the priority settings used for block targeting.
3160
3371
  *
3161
- * @throws This property can throw when used.
3372
+ * @returns
3373
+ * The record mapping block Ids to their priority settings.
3374
+ * Larger numbers have greater priority.
3375
+ */
3376
+ getBlockPriorities(): Record<string, number>;
3377
+ /**
3378
+ * @remarks
3379
+ * Gets the priority settings used for block targeting.
3162
3380
  *
3163
- * {@link LocationInUnloadedChunkError}
3381
+ * @returns
3382
+ * The record mapping block tags to their priority settings.
3383
+ * Larger numbers have greater priority.
3384
+ */
3385
+ getBlockTagPriorities(): Record<string, number>;
3386
+ /**
3387
+ * @remarks
3388
+ * Gets the priority settings used for entity targeting.
3164
3389
  *
3165
- * {@link LocationOutOfWorldBoundariesError}
3390
+ * @returns
3391
+ * The record mapping entity Ids to their priority settings.
3392
+ * Larger numbers have greater priority.
3166
3393
  */
3167
- readonly permutation: BlockPermutation;
3394
+ getEntityPriorities(): Record<string, number>;
3168
3395
  /**
3169
3396
  * @remarks
3170
- * Gets the type of block.
3397
+ * Gets the priority settings used for entity targeting.
3171
3398
  *
3172
- * @throws This property can throw when used.
3399
+ * @returns
3400
+ * Map entity type families to their priority settings in a
3401
+ * Record. Larger numbers have greater priority.
3402
+ */
3403
+ getEntityTypeFamilyPriorities(): Record<string, number>;
3404
+ /**
3405
+ * @remarks
3406
+ * Sets the priority settings used for block targeting.
3173
3407
  *
3174
- * {@link LocationInUnloadedChunkError}
3408
+ * This function can't be called in restricted-execution mode.
3175
3409
  *
3176
- * {@link LocationOutOfWorldBoundariesError}
3410
+ * @param blockPriorities
3411
+ * A record mapping block Ids to their priority settings.
3412
+ * Larger numbers have greater priority.
3177
3413
  */
3178
- readonly 'type': BlockType;
3414
+ setBlockPriorities(
3415
+ blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
3416
+ ): void;
3179
3417
  /**
3180
3418
  * @remarks
3181
- * Identifier of the type of block for this block. Warning:
3182
- * Vanilla block names can be changed in future releases, try
3183
- * using 'Block.matches' instead for block comparison.
3184
- *
3185
- * @throws This property can throw when used.
3419
+ * Sets the priority settings used for block targeting.
3186
3420
  *
3187
- * {@link LocationInUnloadedChunkError}
3421
+ * This function can't be called in restricted-execution mode.
3188
3422
  *
3189
- * {@link LocationOutOfWorldBoundariesError}
3190
3423
  */
3191
- readonly typeId: string;
3424
+ setBlockTagPriorities(blockTagPriorities: Record<string, number>): void;
3192
3425
  /**
3193
3426
  * @remarks
3194
- * X coordinate of the block.
3427
+ * Sets the priority settings used for entity targeting.
3428
+ *
3429
+ * This function can't be called in restricted-execution mode.
3195
3430
  *
3431
+ * @param entityPriorities
3432
+ * A record mapping entity Ids to their priority settings.
3433
+ * Larger numbers have greater priority.
3196
3434
  */
3197
- readonly x: number;
3435
+ setEntityPriorities(
3436
+ entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
3437
+ ): void;
3198
3438
  /**
3199
3439
  * @remarks
3200
- * Y coordinate of the block.
3440
+ * Sets the priority settings used for entity targeting.
3441
+ *
3442
+ * This function can't be called in restricted-execution mode.
3201
3443
  *
3202
3444
  */
3203
- readonly y: number;
3445
+ setEntityTypeFamilyPriorities(entityTypeFamilyPriorities: Record<string, number>): void;
3446
+ }
3447
+
3448
+ /**
3449
+ * @beta
3450
+ * Handle to an aim-assist preset that exists in the
3451
+ * world.aimAssist registry.
3452
+ */
3453
+ export class AimAssistPreset {
3454
+ private constructor();
3204
3455
  /**
3205
3456
  * @remarks
3206
- * Z coordinate of the block.
3457
+ * Optional. Default aim-assist category Id used for items not
3458
+ * provided to setItemSettings.
3207
3459
  *
3460
+ * @throws This property can throw when used.
3208
3461
  */
3209
- readonly z: number;
3462
+ readonly defaultItemSettings?: string;
3210
3463
  /**
3211
3464
  * @remarks
3212
- * Returns the {@link Block} above this block (positive in the
3213
- * Y direction).
3465
+ * Optional. Aim-assist category Id used for an empty hand.
3214
3466
  *
3215
- * @param steps
3216
- * Number of steps above to step before returning.
3217
- * Defaults to: 1
3218
- * @throws This function can throw errors.
3219
- *
3220
- * {@link LocationInUnloadedChunkError}
3467
+ * @throws This property can throw when used.
3468
+ */
3469
+ readonly handSettings?: string;
3470
+ /**
3471
+ * @remarks
3472
+ * The unique Id associated with the preset.
3221
3473
  *
3222
- * {@link LocationOutOfWorldBoundariesError}
3223
3474
  */
3224
- above(steps?: number): Block | undefined;
3475
+ readonly identifier: string;
3225
3476
  /**
3226
3477
  * @remarks
3227
- * Returns the {@link Block} below this block (negative in the
3228
- * Y direction).
3478
+ * Gets the list of block tags to exclude from aim assist
3479
+ * targeting.
3229
3480
  *
3230
- * @param steps
3231
- * Number of steps below to step before returning.
3232
- * Defaults to: 1
3481
+ * @returns
3482
+ * The array of block tags.
3233
3483
  * @throws This function can throw errors.
3234
3484
  *
3235
- * {@link LocationInUnloadedChunkError}
3236
- *
3237
- * {@link LocationOutOfWorldBoundariesError}
3485
+ * {@link minecraftcommon.EngineError}
3238
3486
  */
3239
- below(steps?: number): Block | undefined;
3487
+ getExcludedBlockTagTargets(): string[];
3240
3488
  /**
3241
3489
  * @remarks
3242
- * Returns the {@link Vector3} of the center of this block on
3243
- * the X and Z axis.
3490
+ * Gets the list of block Ids to exclude from aim assist
3491
+ * targeting.
3244
3492
  *
3493
+ * @returns
3494
+ * The array of block Ids.
3495
+ * @throws This function can throw errors.
3245
3496
  */
3246
- bottomCenter(): Vector3;
3497
+ getExcludedBlockTargets(): string[];
3247
3498
  /**
3248
3499
  * @remarks
3249
- * Returns whether this block is removed when touched by
3250
- * liquid.
3500
+ * Gets the list of entity Ids to exclude from aim assist
3501
+ * targeting.
3251
3502
  *
3252
- * @param liquidType
3253
- * The type of liquid this function should be called for.
3503
+ * @returns
3504
+ * The array of entity Ids.
3505
+ * @throws This function can throw errors.
3506
+ */
3507
+ getExcludedEntityTargets(): string[];
3508
+ /**
3509
+ * @remarks
3510
+ * Gets the list of entity type families to exclude from aim
3511
+ * assist targeting.
3512
+ *
3513
+ * @returns
3514
+ * The array of entity type families.
3515
+ * @throws This function can throw errors.
3516
+ *
3517
+ * {@link minecraftcommon.EngineError}
3518
+ */
3519
+ getExcludedEntityTypeFamilyTargets(): string[];
3520
+ /**
3521
+ * @remarks
3522
+ * Gets the per-item aim-assist category Ids.
3523
+ *
3524
+ * @returns
3525
+ * The record mapping item Ids to aim-assist category Ids.
3526
+ * @throws This function can throw errors.
3527
+ */
3528
+ getItemSettings(): Record<string, string>;
3529
+ /**
3530
+ * @remarks
3531
+ * Gets the list of item Ids that will target liquid blocks
3532
+ * with aim-assist when being held.
3533
+ *
3534
+ * @returns
3535
+ * The array of item Ids.
3536
+ * @throws This function can throw errors.
3537
+ */
3538
+ getLiquidTargetingItems(): string[];
3539
+ }
3540
+
3541
+ /**
3542
+ * @beta
3543
+ * Settings used with AimAssistRegistry.addPreset for creation
3544
+ * of the AimAssistPreset.
3545
+ */
3546
+ export class AimAssistPresetSettings {
3547
+ /**
3548
+ * @remarks
3549
+ * Optional. Default aim-assist category Id used for items not
3550
+ * provided to setItemSettings.
3551
+ *
3552
+ * This property can't be edited in restricted-execution mode.
3553
+ *
3554
+ */
3555
+ defaultItemSettings?: string;
3556
+ /**
3557
+ * @remarks
3558
+ * Optional. Aim-assist category Id used for an empty hand.
3559
+ *
3560
+ * This property can't be edited in restricted-execution mode.
3561
+ *
3562
+ */
3563
+ handSettings?: string;
3564
+ /**
3565
+ * @remarks
3566
+ * The unique Id used to register the preset with. Must have a
3567
+ * namespace.
3568
+ *
3569
+ */
3570
+ readonly identifier: string;
3571
+ /**
3572
+ * @remarks
3573
+ * Constructor that takes a unique Id to associate with the
3574
+ * created AimAssistPreset. Must have a namespace.
3575
+ *
3576
+ */
3577
+ constructor(identifier: string);
3578
+ /**
3579
+ * @remarks
3580
+ * Gets the list of block tags to exclude from aim assist
3581
+ * targeting.
3582
+ *
3583
+ * @returns
3584
+ * The array of block tags.
3585
+ */
3586
+ getExcludedBlockTagTargets(): string[] | undefined;
3587
+ /**
3588
+ * @remarks
3589
+ * Gets the list of block Ids to exclude from aim assist
3590
+ * targeting.
3591
+ *
3592
+ * @returns
3593
+ * The array of block Ids.
3594
+ */
3595
+ getExcludedBlockTargets(): string[] | undefined;
3596
+ /**
3597
+ * @remarks
3598
+ * Gets the list of entity Ids to exclude from aim assist
3599
+ * targeting.
3600
+ *
3601
+ * @returns
3602
+ * The array of entity Ids.
3603
+ */
3604
+ getExcludedEntityTargets(): string[] | undefined;
3605
+ /**
3606
+ * @remarks
3607
+ * Gets the list of entity type families to exclude from aim
3608
+ * assist targeting.
3609
+ *
3610
+ * @returns
3611
+ * The array of entity type families.
3612
+ */
3613
+ getExcludedEntityTypeFamilyTargets(): string[] | undefined;
3614
+ /**
3615
+ * @remarks
3616
+ * Gets the per-item aim-assist category Ids.
3617
+ *
3618
+ * @returns
3619
+ * The record mapping item Ids to aim-assist category Ids.
3620
+ */
3621
+ getItemSettings(): Record<string, string>;
3622
+ /**
3623
+ * @remarks
3624
+ * Gets the list of item Ids that will target liquid blocks
3625
+ * with aim-assist when being held.
3626
+ *
3627
+ * @returns
3628
+ * The array of item Ids.
3629
+ */
3630
+ getLiquidTargetingItems(): string[] | undefined;
3631
+ /**
3632
+ * @remarks
3633
+ * Sets the list of block tags to exclude from aim assist
3634
+ * targeting.
3635
+ *
3636
+ * This function can't be called in restricted-execution mode.
3637
+ *
3638
+ * @param targets
3639
+ * An array of block tags.
3640
+ */
3641
+ setExcludedBlockTagTargets(targets?: string[]): void;
3642
+ /**
3643
+ * @remarks
3644
+ * Sets the list of block Ids to exclude from aim assist
3645
+ * targeting.
3646
+ *
3647
+ * This function can't be called in restricted-execution mode.
3648
+ *
3649
+ * @param targets
3650
+ * An array of block Ids.
3651
+ */
3652
+ setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
3653
+ /**
3654
+ * @remarks
3655
+ * Sets the list of entity Ids to exclude from aim assist
3656
+ * targeting.
3657
+ *
3658
+ * This function can't be called in restricted-execution mode.
3659
+ *
3660
+ * @param targets
3661
+ * An array of entity Ids.
3662
+ */
3663
+ setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
3664
+ /**
3665
+ * @remarks
3666
+ * Sets the list of entity type families to exclude from aim
3667
+ * assist targeting.
3668
+ *
3669
+ * This function can't be called in restricted-execution mode.
3670
+ *
3671
+ * @param targets
3672
+ * An array of entity type families.
3673
+ */
3674
+ setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
3675
+ /**
3676
+ * @remarks
3677
+ * Sets the per-item aim-assist category Ids.
3678
+ *
3679
+ * This function can't be called in restricted-execution mode.
3680
+ *
3681
+ * @param itemSettings
3682
+ * A record mapping item Ids to aim-assist category Ids.
3683
+ * Category Ids must have a namespace.
3684
+ */
3685
+ setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
3686
+ /**
3687
+ * @remarks
3688
+ * Sets the list of item Ids that will target liquid blocks
3689
+ * with aim-assist when being held.
3690
+ *
3691
+ * This function can't be called in restricted-execution mode.
3692
+ *
3693
+ * @param items
3694
+ * An array of item Ids.
3695
+ */
3696
+ setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
3697
+ }
3698
+
3699
+ /**
3700
+ * @beta
3701
+ * A container for APIs related to the world's aim-assist
3702
+ * settings.
3703
+ */
3704
+ export class AimAssistRegistry {
3705
+ private constructor();
3706
+ /**
3707
+ * @remarks
3708
+ * The default aim-assist category Id that is used when not
3709
+ * otherwise specified.
3710
+ *
3711
+ */
3712
+ static readonly DefaultCategoryId = 'minecraft:default';
3713
+ /**
3714
+ * @remarks
3715
+ * The default aim-assist preset Id that is used when not
3716
+ * otherwise specified.
3717
+ *
3718
+ */
3719
+ static readonly DefaultPresetId = 'minecraft:aim_assist_default';
3720
+ /**
3721
+ * @remarks
3722
+ * Adds an aim-assist category to the registry.
3723
+ *
3724
+ * This function can't be called in restricted-execution mode.
3725
+ *
3726
+ * @param category
3727
+ * The category settings used to create the new category.
3728
+ * @returns
3729
+ * The created category handle.
3730
+ * @throws This function can throw errors.
3731
+ *
3732
+ * {@link minecraftcommon.EngineError}
3733
+ *
3734
+ * {@link Error}
3735
+ *
3736
+ * {@link minecraftcommon.InvalidArgumentError}
3737
+ *
3738
+ * {@link NamespaceNameError}
3739
+ */
3740
+ addCategory(category: AimAssistCategorySettings): AimAssistCategory;
3741
+ /**
3742
+ * @remarks
3743
+ * Adds an aim-assist preset to the registry.
3744
+ *
3745
+ * This function can't be called in restricted-execution mode.
3746
+ *
3747
+ * @param preset
3748
+ * The preset settings used to create the new preset.
3749
+ * @returns
3750
+ * The created preset handle.
3751
+ * @throws This function can throw errors.
3752
+ *
3753
+ * {@link minecraftcommon.EngineError}
3754
+ *
3755
+ * {@link Error}
3756
+ *
3757
+ * {@link minecraftcommon.InvalidArgumentError}
3758
+ *
3759
+ * {@link NamespaceNameError}
3760
+ */
3761
+ addPreset(preset: AimAssistPresetSettings): AimAssistPreset;
3762
+ /**
3763
+ * @remarks
3764
+ * Gets all available categories in the registry.
3765
+ *
3766
+ * @returns
3767
+ * An array of all available category objects.
3768
+ */
3769
+ getCategories(): AimAssistCategory[];
3770
+ /**
3771
+ * @remarks
3772
+ * Gets the category associated with the provided Id.
3773
+ *
3774
+ * This function can't be called in restricted-execution mode.
3775
+ *
3776
+ * @returns
3777
+ * The category object if it exists, otherwise returns
3778
+ * undefined.
3779
+ */
3780
+ getCategory(categoryId: string): AimAssistCategory | undefined;
3781
+ /**
3782
+ * @remarks
3783
+ * Gets the preset associated with the provided Id.
3784
+ *
3785
+ * This function can't be called in restricted-execution mode.
3786
+ *
3787
+ * @param presetId
3788
+ * The Id of the preset to retrieve. Must have a namespace.
3789
+ * @returns
3790
+ * The preset object if it exists, otherwise returns undefined.
3791
+ */
3792
+ getPreset(presetId: string): AimAssistPreset | undefined;
3793
+ /**
3794
+ * @remarks
3795
+ * Gets all available presets in the registry.
3796
+ *
3797
+ * @returns
3798
+ * An array of all available preset objects.
3799
+ */
3800
+ getPresets(): AimAssistPreset[];
3801
+ }
3802
+
3803
+ /**
3804
+ * Describes a type of biome.
3805
+ */
3806
+ export class BiomeType {
3807
+ private constructor();
3808
+ /**
3809
+ * @remarks
3810
+ * Identifier of the biome type.
3811
+ *
3812
+ */
3813
+ readonly id: string;
3814
+ /**
3815
+ * @beta
3816
+ * @remarks
3817
+ * Returns a list of the biome's tags.
3818
+ *
3819
+ */
3820
+ getTags(): string[];
3821
+ /**
3822
+ * @beta
3823
+ * @remarks
3824
+ * Checks if the biome has all of the provided tags.
3825
+ *
3826
+ * @param tags
3827
+ * The list of tags to check against the biome.
3828
+ */
3829
+ hasTags(tags: string[]): boolean;
3830
+ }
3831
+
3832
+ /**
3833
+ * @beta
3834
+ * Supports a catalog of available biome types registered
3835
+ * within Minecraft.
3836
+ */
3837
+ export class BiomeTypes {
3838
+ private constructor();
3839
+ /**
3840
+ * @remarks
3841
+ * Returns a specific biome type.
3842
+ *
3843
+ * @param typeName
3844
+ * Identifier of the biome. Generally, namespaced identifiers
3845
+ * (e.g., minecraft:frozen_peaks) should be used.
3846
+ * @returns
3847
+ * If the biome exists, a BiomeType object is returned. If not,
3848
+ * undefined is returned.
3849
+ */
3850
+ static get(typeName: string): BiomeType | undefined;
3851
+ /**
3852
+ * @remarks
3853
+ * Returns all registered biome types within Minecraft
3854
+ *
3855
+ */
3856
+ static getAll(): BiomeType[];
3857
+ }
3858
+
3859
+ /**
3860
+ * Represents a block in a dimension. A block represents a
3861
+ * unique X, Y, and Z within a dimension and get/sets the state
3862
+ * of the block at that location. This type was significantly
3863
+ * updated in version 1.17.10.21.
3864
+ */
3865
+ export class Block {
3866
+ private constructor();
3867
+ /**
3868
+ * @remarks
3869
+ * Returns the dimension that the block is within.
3870
+ *
3871
+ */
3872
+ readonly dimension: Dimension;
3873
+ /**
3874
+ * @remarks
3875
+ * Returns true if this block is an air block (i.e., empty
3876
+ * space).
3877
+ *
3878
+ * @throws This property can throw when used.
3879
+ *
3880
+ * {@link LocationInUnloadedChunkError}
3881
+ *
3882
+ * {@link LocationOutOfWorldBoundariesError}
3883
+ */
3884
+ readonly isAir: boolean;
3885
+ /**
3886
+ * @remarks
3887
+ * Returns true if this block is a liquid block - (e.g., a
3888
+ * water block and a lava block are liquid, while an air block
3889
+ * and a stone block are not. Water logged blocks are not
3890
+ * liquid blocks).
3891
+ *
3892
+ * @throws This property can throw when used.
3893
+ *
3894
+ * {@link LocationInUnloadedChunkError}
3895
+ *
3896
+ * {@link LocationOutOfWorldBoundariesError}
3897
+ */
3898
+ readonly isLiquid: boolean;
3899
+ /**
3900
+ * @beta
3901
+ * @remarks
3902
+ * Returns true if this block is solid and impassible - (e.g.,
3903
+ * a cobblestone block and a diamond block are solid, while a
3904
+ * ladder block and a fence block are not).
3905
+ *
3906
+ * @throws This property can throw when used.
3907
+ *
3908
+ * {@link LocationInUnloadedChunkError}
3909
+ *
3910
+ * {@link LocationOutOfWorldBoundariesError}
3911
+ */
3912
+ readonly isSolid: boolean;
3913
+ /**
3914
+ * @remarks
3915
+ * Returns true if this reference to a block is still valid
3916
+ * (for example, if the block is unloaded, references to that
3917
+ * block will no longer be valid.)
3918
+ *
3919
+ */
3920
+ readonly isValid: boolean;
3921
+ /**
3922
+ * @remarks
3923
+ * Returns or sets whether this block has water on it.
3924
+ *
3925
+ * @throws This property can throw when used.
3926
+ *
3927
+ * {@link LocationInUnloadedChunkError}
3928
+ *
3929
+ * {@link LocationOutOfWorldBoundariesError}
3930
+ */
3931
+ readonly isWaterlogged: boolean;
3932
+ /**
3933
+ * @remarks
3934
+ * Key for the localization of this block's name used in .lang
3935
+ * files.
3936
+ *
3937
+ * @throws This property can throw when used.
3938
+ *
3939
+ * {@link LocationInUnloadedChunkError}
3940
+ *
3941
+ * {@link LocationOutOfWorldBoundariesError}
3942
+ */
3943
+ readonly localizationKey: string;
3944
+ /**
3945
+ * @remarks
3946
+ * Coordinates of the specified block.
3947
+ *
3948
+ * @throws This property can throw when used.
3949
+ */
3950
+ readonly location: Vector3;
3951
+ /**
3952
+ * @remarks
3953
+ * Additional block configuration data that describes the
3954
+ * block.
3955
+ *
3956
+ * @throws This property can throw when used.
3957
+ *
3958
+ * {@link LocationInUnloadedChunkError}
3959
+ *
3960
+ * {@link LocationOutOfWorldBoundariesError}
3961
+ */
3962
+ readonly permutation: BlockPermutation;
3963
+ /**
3964
+ * @remarks
3965
+ * Gets the type of block.
3966
+ *
3967
+ * @throws This property can throw when used.
3968
+ *
3969
+ * {@link LocationInUnloadedChunkError}
3970
+ *
3971
+ * {@link LocationOutOfWorldBoundariesError}
3972
+ */
3973
+ readonly 'type': BlockType;
3974
+ /**
3975
+ * @remarks
3976
+ * Identifier of the type of block for this block. Warning:
3977
+ * Vanilla block names can be changed in future releases, try
3978
+ * using 'Block.matches' instead for block comparison.
3979
+ *
3980
+ * @throws This property can throw when used.
3981
+ *
3982
+ * {@link LocationInUnloadedChunkError}
3983
+ *
3984
+ * {@link LocationOutOfWorldBoundariesError}
3985
+ */
3986
+ readonly typeId: string;
3987
+ /**
3988
+ * @remarks
3989
+ * X coordinate of the block.
3990
+ *
3991
+ */
3992
+ readonly x: number;
3993
+ /**
3994
+ * @remarks
3995
+ * Y coordinate of the block.
3996
+ *
3997
+ */
3998
+ readonly y: number;
3999
+ /**
4000
+ * @remarks
4001
+ * Z coordinate of the block.
4002
+ *
4003
+ */
4004
+ readonly z: number;
4005
+ /**
4006
+ * @remarks
4007
+ * Returns the {@link Block} above this block (positive in the
4008
+ * Y direction).
4009
+ *
4010
+ * @param steps
4011
+ * Number of steps above to step before returning.
4012
+ * Defaults to: 1
4013
+ * @throws This function can throw errors.
4014
+ *
4015
+ * {@link LocationInUnloadedChunkError}
4016
+ *
4017
+ * {@link LocationOutOfWorldBoundariesError}
4018
+ */
4019
+ above(steps?: number): Block | undefined;
4020
+ /**
4021
+ * @remarks
4022
+ * Returns the {@link Block} below this block (negative in the
4023
+ * Y direction).
4024
+ *
4025
+ * @param steps
4026
+ * Number of steps below to step before returning.
4027
+ * Defaults to: 1
4028
+ * @throws This function can throw errors.
4029
+ *
4030
+ * {@link LocationInUnloadedChunkError}
4031
+ *
4032
+ * {@link LocationOutOfWorldBoundariesError}
4033
+ */
4034
+ below(steps?: number): Block | undefined;
4035
+ /**
4036
+ * @remarks
4037
+ * Returns the {@link Vector3} of the center of this block on
4038
+ * the X and Z axis.
4039
+ *
4040
+ */
4041
+ bottomCenter(): Vector3;
4042
+ /**
4043
+ * @remarks
4044
+ * Returns whether this block is removed when touched by
4045
+ * liquid.
4046
+ *
4047
+ * @param liquidType
4048
+ * The type of liquid this function should be called for.
3254
4049
  * @returns
3255
4050
  * Whether this block is removed when touched by liquid.
3256
4051
  * @throws This function can throw errors.
@@ -3270,7 +4065,31 @@ export class Block {
3270
4065
  * @param liquidType
3271
4066
  * The type of liquid this function should be called for.
3272
4067
  * @returns
3273
- * Whether this block can have a liquid placed over it.
4068
+ * Whether this block can have a liquid placed over it.
4069
+ * @throws This function can throw errors.
4070
+ *
4071
+ * {@link Error}
4072
+ *
4073
+ * {@link LocationInUnloadedChunkError}
4074
+ *
4075
+ * {@link LocationOutOfWorldBoundariesError}
4076
+ */
4077
+ canContainLiquid(liquidType: LiquidType): boolean;
4078
+ /**
4079
+ * @beta
4080
+ * @remarks
4081
+ * Checks to see whether it is valid to place the specified
4082
+ * block type or block permutation, on a specified face on this
4083
+ * block.
4084
+ *
4085
+ * @param blockToPlace
4086
+ * Block type or block permutation to check placement for.
4087
+ * @param faceToPlaceOn
4088
+ * Optional specific face of this block to check placement
4089
+ * against.
4090
+ * @returns
4091
+ * Returns `true` if the block type or permutation can be
4092
+ * placed on this block, else `false`.
3274
4093
  * @throws This function can throw errors.
3275
4094
  *
3276
4095
  * {@link Error}
@@ -3279,7 +4098,7 @@ export class Block {
3279
4098
  *
3280
4099
  * {@link LocationOutOfWorldBoundariesError}
3281
4100
  */
3282
- canContainLiquid(liquidType: LiquidType): boolean;
4101
+ canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
3283
4102
  /**
3284
4103
  * @remarks
3285
4104
  * Returns the {@link Vector3} of the center of this block on
@@ -3377,6 +4196,15 @@ export class Block {
3377
4196
  * {@link LocationInUnloadedChunkError}
3378
4197
  */
3379
4198
  getLightLevel(): number;
4199
+ /**
4200
+ * @beta
4201
+ * @throws This function can throw errors.
4202
+ *
4203
+ * {@link LocationInUnloadedChunkError}
4204
+ *
4205
+ * {@link LocationOutOfWorldBoundariesError}
4206
+ */
4207
+ getMapColor(): RGBA;
3380
4208
  /**
3381
4209
  * @remarks
3382
4210
  * Returns the net redstone power of this block.
@@ -3645,6 +4473,27 @@ export class Block {
3645
4473
  * {@link LocationOutOfWorldBoundariesError}
3646
4474
  */
3647
4475
  south(steps?: number): Block | undefined;
4476
+ /**
4477
+ * @beta
4478
+ * @remarks
4479
+ * Tries to set the block in the dimension to the state of the
4480
+ * permutation by first checking if the placement is valid.
4481
+ *
4482
+ * This function can't be called in restricted-execution mode.
4483
+ *
4484
+ * @param permutation
4485
+ * Permutation that contains a set of property states for the
4486
+ * Block.
4487
+ * @returns
4488
+ * Returns `true` if the block permutation data was
4489
+ * successfully set, else `false`.
4490
+ * @throws This function can throw errors.
4491
+ *
4492
+ * {@link LocationInUnloadedChunkError}
4493
+ *
4494
+ * {@link LocationOutOfWorldBoundariesError}
4495
+ */
4496
+ trySetPermutation(permutation: BlockPermutation): boolean;
3648
4497
  /**
3649
4498
  * @remarks
3650
4499
  * Returns the {@link Block} to the west of this block
@@ -3662,6 +4511,137 @@ export class Block {
3662
4511
  west(steps?: number): Block | undefined;
3663
4512
  }
3664
4513
 
4514
+ /**
4515
+ * @beta
4516
+ * Bounding Box Utils is a utility class that provides a number
4517
+ * of useful functions for the creation and utility of {@link
4518
+ * BlockBoundingBox} objects
4519
+ */
4520
+ export class BlockBoundingBoxUtils {
4521
+ private constructor();
4522
+ /**
4523
+ * @remarks
4524
+ * Create a validated instance of a {@link BlockBoundingBox}
4525
+ * where the min and max components are guaranteed to be (min
4526
+ * <= max)
4527
+ *
4528
+ * This function can't be called in restricted-execution mode.
4529
+ *
4530
+ * @param min
4531
+ * A corner world location
4532
+ * @param max
4533
+ * A corner world location diametrically opposite
4534
+ */
4535
+ static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
4536
+ /**
4537
+ * @remarks
4538
+ * Expand a {@link BlockBoundingBox} by a given amount along
4539
+ * each axis.
4540
+ * Sizes can be negative to perform contraction.
4541
+ * Note: corners can be inverted if the contraction size is
4542
+ * greater than the span, but the min/max relationship will
4543
+ * remain correct
4544
+ *
4545
+ * This function can't be called in restricted-execution mode.
4546
+ *
4547
+ * @returns
4548
+ * Return a new {@link BlockBoundingBox} object representing
4549
+ * the changes
4550
+ */
4551
+ static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
4552
+ /**
4553
+ * @remarks
4554
+ * Check if two {@link BlockBoundingBox} objects are identical
4555
+ *
4556
+ * This function can't be called in restricted-execution mode.
4557
+ *
4558
+ */
4559
+ static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4560
+ /**
4561
+ * @remarks
4562
+ * Expand the initial box object bounds to include the 2nd box
4563
+ * argument. The resultant {@link BlockBoundingBox} object
4564
+ * will be a BlockBoundingBox which exactly encompasses the two
4565
+ * boxes.
4566
+ *
4567
+ * This function can't be called in restricted-execution mode.
4568
+ *
4569
+ * @returns
4570
+ * A new {@link BlockBoundingBox} instance representing the
4571
+ * smallest possible bounding box which can encompass both
4572
+ */
4573
+ static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
4574
+ /**
4575
+ * @remarks
4576
+ * Calculate the center block of a given {@link
4577
+ * BlockBoundingBox} object.
4578
+ *
4579
+ * This function can't be called in restricted-execution mode.
4580
+ *
4581
+ * @returns
4582
+ * Note that {@link BlockBoundingBox} objects represent whole
4583
+ * blocks, so the center of boxes which have odd numbered
4584
+ * bounds are not mathematically centered...
4585
+ * i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
4586
+ * center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
4587
+ */
4588
+ static getCenter(box: BlockBoundingBox): Vector3;
4589
+ /**
4590
+ * @remarks
4591
+ * Calculate the BlockBoundingBox which represents the union
4592
+ * area of two intersecting BlockBoundingBoxes
4593
+ *
4594
+ * This function can't be called in restricted-execution mode.
4595
+ *
4596
+ */
4597
+ static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
4598
+ /**
4599
+ * @remarks
4600
+ * Get the Span of each of the BlockBoundingBox Axis components
4601
+ *
4602
+ * This function can't be called in restricted-execution mode.
4603
+ *
4604
+ */
4605
+ static getSpan(box: BlockBoundingBox): Vector3;
4606
+ /**
4607
+ * @remarks
4608
+ * Check to see if two BlockBoundingBox objects intersect
4609
+ *
4610
+ * This function can't be called in restricted-execution mode.
4611
+ *
4612
+ */
4613
+ static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4614
+ /**
4615
+ * @remarks
4616
+ * Check to see if a given coordinate is inside a
4617
+ * BlockBoundingBox
4618
+ *
4619
+ * This function can't be called in restricted-execution mode.
4620
+ *
4621
+ */
4622
+ static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
4623
+ /**
4624
+ * @remarks
4625
+ * Check to see if a BlockBoundingBox is valid (i.e. (min <=
4626
+ * max))
4627
+ *
4628
+ * This function can't be called in restricted-execution mode.
4629
+ *
4630
+ */
4631
+ static isValid(box: BlockBoundingBox): boolean;
4632
+ /**
4633
+ * @remarks
4634
+ * Move a BlockBoundingBox by a given amount
4635
+ *
4636
+ * This function can't be called in restricted-execution mode.
4637
+ *
4638
+ * @returns
4639
+ * Return a new BlockBoundingBox object which represents the
4640
+ * change
4641
+ */
4642
+ static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
4643
+ }
4644
+
3665
4645
  /**
3666
4646
  * Base type for components associated with blocks.
3667
4647
  */
@@ -3704,6 +4684,35 @@ export class BlockComponentBlockBreakEvent extends BlockEvent {
3704
4684
  readonly entitySource?: Entity;
3705
4685
  }
3706
4686
 
4687
+ /**
4688
+ * @beta
4689
+ * Contains information regarding an event sent by an entity to
4690
+ * this block in the world.
4691
+ */
4692
+ // @ts-ignore Class inheritance allowed for native defined classes
4693
+ export class BlockComponentEntityEvent extends BlockEvent {
4694
+ private constructor();
4695
+ /**
4696
+ * @remarks
4697
+ * Returns permutation information about the block receiving
4698
+ * the event.
4699
+ *
4700
+ */
4701
+ readonly blockPermutation: BlockPermutation;
4702
+ /**
4703
+ * @remarks
4704
+ * The entity that sent the event.
4705
+ *
4706
+ */
4707
+ readonly entitySource?: Entity;
4708
+ /**
4709
+ * @remarks
4710
+ * Name of the event fired by the entity.
4711
+ *
4712
+ */
4713
+ readonly name: string;
4714
+ }
4715
+
3707
4716
  /**
3708
4717
  * Contains information regarding an entity falling onto a
3709
4718
  * specific block.
@@ -3849,6 +4858,16 @@ export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
3849
4858
  *
3850
4859
  */
3851
4860
  readonly powerLevel: number;
4861
+ /**
4862
+ * @beta
4863
+ * @remarks
4864
+ * The redstone signal strength from the last tick that was
4865
+ * passing through this block. It is guaranteed to be >= the
4866
+ * `min_power` of the block's 'minecraft:redstone_consumer'
4867
+ * component.
4868
+ *
4869
+ */
4870
+ readonly previousPowerLevel: number;
3852
4871
  }
3853
4872
 
3854
4873
  export class BlockComponentRegistry {
@@ -4132,6 +5151,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
4132
5151
  *
4133
5152
  */
4134
5153
  [Symbol.iterator](): Iterator<Vector3>;
5154
+ /**
5155
+ * @beta
5156
+ * @remarks
5157
+ * Checks if the underlining block volume has been invalidated.
5158
+ * Will return false if the block volume was modified between
5159
+ * creating the iterator and iterating it, and true otherwise.
5160
+ *
5161
+ * @throws This function can throw errors.
5162
+ *
5163
+ * {@link minecraftcommon.EngineError}
5164
+ */
5165
+ isValid(): boolean;
4135
5166
  /**
4136
5167
  * @remarks
4137
5168
  * This function can't be called in restricted-execution mode.
@@ -5029,6 +6060,15 @@ export class BlockVolumeBase {
5029
6060
  *
5030
6061
  */
5031
6062
  getBlockLocationIterator(): BlockLocationIterator;
6063
+ /**
6064
+ * @beta
6065
+ * @remarks
6066
+ * Return a {@link BlockBoundingBox} object which represents
6067
+ * the validated min and max coordinates of the volume
6068
+ *
6069
+ * @throws This function can throw errors.
6070
+ */
6071
+ getBoundingBox(): BlockBoundingBox;
5032
6072
  /**
5033
6073
  * @remarks
5034
6074
  * Return the capacity (volume) of the BlockVolume (W*D*H)
@@ -5194,6 +6234,19 @@ export class Camera {
5194
6234
  *
5195
6235
  */
5196
6236
  readonly isValid: boolean;
6237
+ /**
6238
+ * @beta
6239
+ * @remarks
6240
+ * Attaches the camera to a non-player entity.
6241
+ *
6242
+ * This function can't be called in restricted-execution mode.
6243
+ *
6244
+ * @param attachCameraOptions
6245
+ * Options for the entity the camera is attaching to. Contains
6246
+ * the entity identifier and optional entity location.
6247
+ * @throws This function can throw errors.
6248
+ */
6249
+ attachToEntity(attachCameraOptions?: CameraAttachOptions): void;
5197
6250
  /**
5198
6251
  * @remarks
5199
6252
  * Clears the active camera for the specified player. Causes
@@ -5218,6 +6271,14 @@ export class Camera {
5218
6271
  * @throws This function can throw errors.
5219
6272
  */
5220
6273
  fade(fadeCameraOptions?: CameraFadeOptions): void;
6274
+ /**
6275
+ * @beta
6276
+ * @remarks
6277
+ * This function can't be called in restricted-execution mode.
6278
+ *
6279
+ * @throws This function can throw errors.
6280
+ */
6281
+ playAnimation(splineType: CatmullRomSpline | LinearSpline, cameraAnimationOptions: AnimationOptions): void;
5221
6282
  /**
5222
6283
  * @remarks
5223
6284
  * Sets the current active camera for the specified player.
@@ -5240,29 +6301,219 @@ export class Camera {
5240
6301
  | CameraSetRotOptions
5241
6302
  | CameraTargetOptions,
5242
6303
  ): void;
6304
+ /**
6305
+ * @beta
6306
+ * @remarks
6307
+ * Sets the current active camera with easing.
6308
+ *
6309
+ * This function can't be called in restricted-execution mode.
6310
+ *
6311
+ * @param cameraPreset
6312
+ * Identifier of a camera preset file defined within JSON.
6313
+ * @param easeOptions
6314
+ * Options to ease the camera from the previous camera to the
6315
+ * current one.
6316
+ * @throws
6317
+ * Throws when easing to minecraft:first_person presets
6318
+ * currently without the experimental cameras toggle enabled.
6319
+ */
6320
+ setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
6321
+ /**
6322
+ * @remarks
6323
+ * Sets the current active camera for the specified player and
6324
+ * resets the position and rotation to the values defined in
6325
+ * the JSON.
6326
+ *
6327
+ * This function can't be called in restricted-execution mode.
6328
+ *
6329
+ * @param cameraPreset
6330
+ * Identifier of a camera preset file defined within JSON.
6331
+ * @param easeOptions
6332
+ * Options to ease the camera back to its original position and
6333
+ * rotation.
6334
+ * @throws This function can throw errors.
6335
+ */
6336
+ setDefaultCamera(cameraPreset: string, easeOptions?: EaseOptions): void;
6337
+ /**
6338
+ * @remarks
6339
+ * This function can't be called in restricted-execution mode.
6340
+ *
6341
+ * @throws This function can throw errors.
6342
+ */
6343
+ setFov(fovCameraOptions?: CameraFovOptions): void;
6344
+ }
6345
+
6346
+ /**
6347
+ * @beta
6348
+ * CatmullRom spline creation.
6349
+ */
6350
+ export class CatmullRomSpline {
6351
+ /**
6352
+ * @remarks
6353
+ * Control points for the CatmullRom curve.
6354
+ *
6355
+ * This property can't be edited in restricted-execution mode.
6356
+ *
6357
+ */
6358
+ controlPoints: Vector3[];
6359
+ }
6360
+
6361
+ /**
6362
+ * @beta
6363
+ * An event that fires as players enter chat messages.
6364
+ */
6365
+ export class ChatSendAfterEvent {
6366
+ private constructor();
6367
+ /**
6368
+ * @remarks
6369
+ * Message that is being broadcast.
6370
+ *
6371
+ */
6372
+ readonly message: string;
6373
+ /**
6374
+ * @remarks
6375
+ * Player that sent the chat message.
6376
+ *
6377
+ */
6378
+ readonly sender: Player;
6379
+ /**
6380
+ * @remarks
6381
+ * Optional list of players that will receive this message. If
6382
+ * defined, this message is directly targeted to one or more
6383
+ * players (i.e., is not broadcast.)
6384
+ *
6385
+ */
6386
+ readonly targets?: Player[];
6387
+ }
6388
+
6389
+ /**
6390
+ * @beta
6391
+ * Manages callbacks that are connected to chat messages being
6392
+ * sent.
6393
+ */
6394
+ export class ChatSendAfterEventSignal {
6395
+ private constructor();
6396
+ /**
6397
+ * @remarks
6398
+ * Adds a callback that will be called when new chat messages
6399
+ * are sent.
6400
+ *
6401
+ * This function can't be called in restricted-execution mode.
6402
+ *
6403
+ * This function can be called in early-execution mode.
6404
+ *
6405
+ */
6406
+ subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
6407
+ /**
6408
+ * @remarks
6409
+ * Removes a callback from being called when new chat messages
6410
+ * are sent.
6411
+ *
6412
+ * This function can't be called in restricted-execution mode.
6413
+ *
6414
+ * This function can be called in early-execution mode.
6415
+ *
6416
+ */
6417
+ unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
6418
+ }
6419
+
6420
+ /**
6421
+ * @beta
6422
+ * An event that fires as players enter chat messages.
6423
+ */
6424
+ export class ChatSendBeforeEvent {
6425
+ private constructor();
6426
+ /**
6427
+ * @remarks
6428
+ * If set to true in a beforeChat event handler, this message
6429
+ * is not broadcast out.
6430
+ *
6431
+ */
6432
+ cancel: boolean;
6433
+ /**
6434
+ * @remarks
6435
+ * Message that is being broadcast.
6436
+ *
6437
+ */
6438
+ readonly message: string;
6439
+ /**
6440
+ * @remarks
6441
+ * Player that sent the chat message.
6442
+ *
6443
+ */
6444
+ readonly sender: Player;
6445
+ /**
6446
+ * @remarks
6447
+ * Optional list of players that will receive this message. If
6448
+ * defined, this message is directly targeted to one or more
6449
+ * players (i.e., is not broadcast.)
6450
+ *
6451
+ */
6452
+ readonly targets?: Player[];
6453
+ }
6454
+
6455
+ /**
6456
+ * @beta
6457
+ * Manages callbacks that are connected to an event that fires
6458
+ * before chat messages are sent.
6459
+ * @example customCommand.ts
6460
+ * ```typescript
6461
+ * import { world, DimensionLocation } from "@minecraft/server";
6462
+ *
6463
+ * function customCommand(targetLocation: DimensionLocation) {
6464
+ * const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
6465
+ * if (eventData.message.includes("cancel")) {
6466
+ * // Cancel event if the message contains "cancel"
6467
+ * eventData.cancel = true;
6468
+ * } else {
6469
+ * const args = eventData.message.split(" ");
6470
+ *
6471
+ * if (args.length > 0) {
6472
+ * switch (args[0].toLowerCase()) {
6473
+ * case "echo":
6474
+ * // Send a modified version of chat message
6475
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
6476
+ * break;
6477
+ * case "help":
6478
+ * world.sendMessage(`Available commands: echo <message>`);
6479
+ * break;
6480
+ * }
6481
+ * }
6482
+ * }
6483
+ * });
6484
+ * }
6485
+ * ```
6486
+ */
6487
+ export class ChatSendBeforeEventSignal {
6488
+ private constructor();
5243
6489
  /**
5244
6490
  * @remarks
5245
- * Sets the current active camera for the specified player and
5246
- * resets the position and rotation to the values defined in
5247
- * the JSON.
6491
+ * Adds a callback that will be called before new chat messages
6492
+ * are sent.
5248
6493
  *
5249
6494
  * This function can't be called in restricted-execution mode.
5250
6495
  *
5251
- * @param cameraPreset
5252
- * Identifier of a camera preset file defined within JSON.
5253
- * @param easeOptions
5254
- * Options to ease the camera back to its original position and
5255
- * rotation.
5256
- * @throws This function can throw errors.
6496
+ * This function can be called in early-execution mode.
6497
+ *
6498
+ * @param callback
6499
+ * This closure is called with restricted-execution privilege.
6500
+ * @returns
6501
+ * Closure that is called with restricted-execution privilege.
5257
6502
  */
5258
- setDefaultCamera(cameraPreset: string, easeOptions?: EaseOptions): void;
6503
+ subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
5259
6504
  /**
5260
6505
  * @remarks
6506
+ * Removes a callback from being called before new chat
6507
+ * messages are sent.
6508
+ *
5261
6509
  * This function can't be called in restricted-execution mode.
5262
6510
  *
5263
- * @throws This function can throw errors.
6511
+ * This function can be called in early-execution mode.
6512
+ *
6513
+ * @param callback
6514
+ * This closure is called with restricted-execution privilege.
5264
6515
  */
5265
- setFov(fovCameraOptions?: CameraFovOptions): void;
6516
+ unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
5266
6517
  }
5267
6518
 
5268
6519
  /**
@@ -5322,6 +6573,258 @@ export class Component {
5322
6573
  readonly typeId: string;
5323
6574
  }
5324
6575
 
6576
+ /**
6577
+ * @beta
6578
+ * The Compound Block Volume is a collection of individual
6579
+ * block volume definitions which, as a collection, define a
6580
+ * larger volume of (sometimes non-contiguous) irregular
6581
+ * shapes.
6582
+ * This class is loosely based on the concept of CSG
6583
+ * (Computational Solid Geometry) and allows a user to create
6584
+ * complex volumes by building a stack of volumes and voids to
6585
+ * make a larger single volume.
6586
+ * For example - normally a creator would create a hollow cube
6587
+ * by creating 6 "wall" surfaces for each face.
6588
+ * With a Compound Block Volume, a creator can define a hollow
6589
+ * cube by creating a single outer solid cube, and then
6590
+ * defining a further single 'void' cube inside the larger one.
6591
+ * Similarly, the Compound Block Volume can represent irregular
6592
+ * shaped volumes (e.g. a tree consists of a trunk and lots of
6593
+ * leaf cubes which are not necessarily contiguously placed).
6594
+ * Each of the volumes added to the CompoundBlockVolume are (by
6595
+ * default) relative to the origin set (either at construction
6596
+ * or via one of the set functions).
6597
+ * However, it is also possible to push volumes to the compound
6598
+ * collection which are absolute in nature and are not affected
6599
+ * by origin changes.
6600
+ */
6601
+ export class CompoundBlockVolume {
6602
+ /**
6603
+ * @remarks
6604
+ * Return the 'capacity' of the bounding rectangle which
6605
+ * represents the collection of volumes in the stack
6606
+ *
6607
+ */
6608
+ readonly capacity: number;
6609
+ readonly items: CompoundBlockVolumeItem[];
6610
+ readonly itemsAbsolute: CompoundBlockVolumeItem[];
6611
+ /**
6612
+ * @remarks
6613
+ * Return the number of volumes (positive and negative) in the
6614
+ * volume stack
6615
+ *
6616
+ */
6617
+ readonly volumeCount: number;
6618
+ /**
6619
+ * @remarks
6620
+ * Create a CompoundBlockVolume object
6621
+ *
6622
+ * @param origin
6623
+ * An optional world space origin on which to center the
6624
+ * compound volume.
6625
+ * If not specified, the origin is set to (0,0,0)
6626
+ */
6627
+ constructor(origin?: Vector3);
6628
+ /**
6629
+ * @remarks
6630
+ * Clear the contents of the volume stack
6631
+ *
6632
+ * This function can't be called in restricted-execution mode.
6633
+ *
6634
+ */
6635
+ clear(): void;
6636
+ /**
6637
+ * @remarks
6638
+ * Fetch a Block Location Iterator for the Compound Block
6639
+ * Volume. This iterator will allow a creator to iterate
6640
+ * across all of the selected volumes within the larger
6641
+ * bounding area.
6642
+ * Areas of a volume which have been overridden by a
6643
+ * subtractive volume will not be included in the iterator
6644
+ * step.
6645
+ * (i.e. if you push a cube to the stack, and then push a
6646
+ * subtractive volume to the same location, then the iterator
6647
+ * will step over the initial volume because it is considered
6648
+ * negative space)
6649
+ * Note that the Block Locations returned by this iterator are
6650
+ * in absolute world space (irrespective of whether the
6651
+ * compound volume items pushed are absolute or relative)
6652
+ *
6653
+ * This function can't be called in restricted-execution mode.
6654
+ *
6655
+ */
6656
+ getBlockLocationIterator(): BlockLocationIterator;
6657
+ /**
6658
+ * @remarks
6659
+ * Get the largest bounding box that represents a container for
6660
+ * all of the volumes on the stack
6661
+ * Note that the bounding box returned is represented in
6662
+ * absolute world space (irrespective of whether the compound
6663
+ * volume items pushed are absolute or relative)
6664
+ *
6665
+ * This function can't be called in restricted-execution mode.
6666
+ *
6667
+ */
6668
+ getBoundingBox(): BlockBoundingBox;
6669
+ /**
6670
+ * @remarks
6671
+ * Get the max block location of the outermost bounding
6672
+ * rectangle which represents the volumes on the stack.
6673
+ * Note that the max location returned is in absolute world
6674
+ * space (irrespective of whether the compound volume items
6675
+ * pushed are absolute or relative)
6676
+ *
6677
+ * This function can't be called in restricted-execution mode.
6678
+ *
6679
+ */
6680
+ getMax(): Vector3;
6681
+ /**
6682
+ * @remarks
6683
+ * Get the min block location of the outermost bounding
6684
+ * rectangle which represents the volumes on the stack.
6685
+ * Note that the min location returned is in absolute world
6686
+ * space (irrespective of whether the compound volume items
6687
+ * pushed are absolute or relative)
6688
+ *
6689
+ * This function can't be called in restricted-execution mode.
6690
+ *
6691
+ */
6692
+ getMin(): Vector3;
6693
+ /**
6694
+ * @remarks
6695
+ * Fetch the origin in world space of the compound volume
6696
+ *
6697
+ * This function can't be called in restricted-execution mode.
6698
+ *
6699
+ */
6700
+ getOrigin(): Vector3;
6701
+ /**
6702
+ * @remarks
6703
+ * Return a boolean which signals if there are any volume items
6704
+ * pushed to the volume
6705
+ *
6706
+ * This function can't be called in restricted-execution mode.
6707
+ *
6708
+ */
6709
+ isEmpty(): boolean;
6710
+ /**
6711
+ * @remarks
6712
+ * Return a boolean representing whether or not a given
6713
+ * absolute world space block location is inside a positive
6714
+ * block volume.
6715
+ * E.g. if the stack contains a large cube followed by a
6716
+ * slightly smaller negative cube, and the test location is
6717
+ * within the negative cube - the function will return false
6718
+ * because it's not 'inside' a volume (it IS inside the
6719
+ * bounding rectangle, but it is not inside a positively
6720
+ * defined location)
6721
+ *
6722
+ * This function can't be called in restricted-execution mode.
6723
+ *
6724
+ */
6725
+ isInside(worldLocation: Vector3): boolean;
6726
+ /**
6727
+ * @remarks
6728
+ * Inspect the last entry pushed to the volume stack without
6729
+ * affecting the stack contents.
6730
+ *
6731
+ * This function can't be called in restricted-execution mode.
6732
+ *
6733
+ * @param forceRelativity
6734
+ * Determine whether the function returns a
6735
+ * CompoundBlockVolumeItem which is forced into either relative
6736
+ * or absolute coordinate system.
6737
+ * `true` = force returned item to be relative to volume origin
6738
+ * `false` = force returned item to be absolute world space
6739
+ * location
6740
+ *
6741
+ * If no flag is specified, the item returned retains whatever
6742
+ * relativity it had when it was pushed
6743
+ * @returns
6744
+ * Returns undefined if the stack is empty
6745
+ */
6746
+ peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
6747
+ /**
6748
+ * @remarks
6749
+ * Remove the last entry from the volume stack. This will
6750
+ * reduce the stack size by one
6751
+ *
6752
+ * This function can't be called in restricted-execution mode.
6753
+ *
6754
+ */
6755
+ popVolume(): boolean;
6756
+ /**
6757
+ * @remarks
6758
+ * Push a volume item to the stack. The volume item contains
6759
+ * an 'action' parameter which determines whether this volume
6760
+ * is a positive or negative space.
6761
+ * The item also contains a `locationRelativity` which
6762
+ * determines whether it is relative or absolute to the
6763
+ * compound volume origin
6764
+ *
6765
+ * This function can't be called in restricted-execution mode.
6766
+ *
6767
+ * @param item
6768
+ * Item to push to the end of the stack
6769
+ */
6770
+ pushVolume(item: CompoundBlockVolumeItem): void;
6771
+ /**
6772
+ * @remarks
6773
+ * If the volume stack is empty, this function will push the
6774
+ * specified item to the stack.
6775
+ * If the volume stack is NOT empty, this function will replace
6776
+ * the last item on the stack with the new item.
6777
+ *
6778
+ * This function can't be called in restricted-execution mode.
6779
+ *
6780
+ * @param item
6781
+ * Item to add or replace
6782
+ */
6783
+ replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
6784
+ /**
6785
+ * @remarks
6786
+ * Set the origin of the compound volume to an absolute world
6787
+ * space location
6788
+ *
6789
+ * This function can't be called in restricted-execution mode.
6790
+ *
6791
+ * @param preserveExistingVolumes
6792
+ * This optional boolean flag determines whether the relative
6793
+ * `CompoundBlockVolumeItem`'s are frozen in place, or are
6794
+ * affected by the new origin.
6795
+ * Imagine a scenario where you have a series of relative
6796
+ * locations around an origin which make up a sphere; all of
6797
+ * these locations are in the range of -2 to 2.
6798
+ * Push each of these locations to the compound volume as
6799
+ * relative items.
6800
+ * Now, move the origin and all of the locations representing
6801
+ * the sphere move accordingly.
6802
+ * However, let's say you want to add a 2nd sphere next to the
6803
+ * 1st.
6804
+ * In this case, set the new origin a few locations over, but
6805
+ * 'preserveExistingVolumes' = true.
6806
+ * This will set a new origin, but the existing sphere
6807
+ * locations will remain relative to the original origin.
6808
+ * Now, you can push the relative sphere locations again (this
6809
+ * time they will be relative to the new origin) - resulting in
6810
+ * 2 spheres next to each other.
6811
+ */
6812
+ setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
6813
+ /**
6814
+ * @remarks
6815
+ * Similar to {@link CompoundBlockVolume.setOrigin} - this
6816
+ * function will translate the origin by a given delta to a new
6817
+ * position
6818
+ *
6819
+ * This function can't be called in restricted-execution mode.
6820
+ *
6821
+ * @param preserveExistingVolumes
6822
+ * See the description for the arguments to {@link
6823
+ * CompoundBlockVolume.setOrigin}
6824
+ */
6825
+ translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
6826
+ }
6827
+
5325
6828
  /**
5326
6829
  * Represents a container that can hold sets of items. Used
5327
6830
  * with entities such as Players, Chest Minecarts, Llamas, and
@@ -5459,7 +6962,9 @@ export class Container {
5459
6962
  *
5460
6963
  * @param itemStack
5461
6964
  * The stack of items to add.
5462
- * @throws This function can throw errors.
6965
+ * @throws
6966
+ * Won't throw {@link ContainerRules} error for over weight
6967
+ * limit but will instead add items up to the weight limit.
5463
6968
  *
5464
6969
  * {@link ContainerRulesError}
5465
6970
  *
@@ -5699,6 +7204,8 @@ export class Container {
5699
7204
  * @throws
5700
7205
  * Throws if either this container or `toContainer` are invalid
5701
7206
  * or if the `fromSlot` or `toSlot` indices out of bounds.
7207
+ * Won't throw {@link ContainerRules} error for over weight
7208
+ * limit but will instead add items up to the weight limit.
5702
7209
  *
5703
7210
  * {@link ContainerRulesError}
5704
7211
  *
@@ -6327,6 +7834,46 @@ export class Dimension {
6327
7834
  *
6328
7835
  */
6329
7836
  readonly localizationKey: string;
7837
+ /**
7838
+ * @beta
7839
+ * @remarks
7840
+ * Checks if an area contains the specified biomes. If the area
7841
+ * is partially inside world boundaries, only the area that is
7842
+ * in bounds will be searched. This operation takes longer
7843
+ * proportional to both the area of the volume and the number
7844
+ * of biomes to check.
7845
+ *
7846
+ * @param volume
7847
+ * Area to check biomes in.
7848
+ * @param biomeFilter
7849
+ * A list of biomes to include and exclude. A list of tags to
7850
+ * include and exclude. Will return false if a biome is found
7851
+ * in the area that is in the excluded list or contains any of
7852
+ * the excluded tags. If superset is set to true then the area
7853
+ * must contain at least one biome in the included list or that
7854
+ * contains all of the included tags. If superset is set to
7855
+ * false then the area must contain only biomes in the included
7856
+ * list and that contain all of the included tags
7857
+ * @returns
7858
+ * Returns true if the biomes in the area match the filter
7859
+ * settings passed in. Otherwise, returns false.
7860
+ * @throws
7861
+ * An error will be thrown if the area provided includes
7862
+ * unloaded chunks.
7863
+ * An error will be thrown if the area provided is completely
7864
+ * outside the world boundaries.
7865
+ * An error will be thrown if an unknown biome name is
7866
+ * provided.
7867
+ *
7868
+ * {@link minecraftcommon.EngineError}
7869
+ *
7870
+ * {@link minecraftcommon.InvalidArgumentError}
7871
+ *
7872
+ * {@link LocationOutOfWorldBoundariesError}
7873
+ *
7874
+ * {@link UnloadedChunksError}
7875
+ */
7876
+ containsBiomes(volume: BlockVolumeBase, biomeFilter: BiomeFilter): boolean;
6330
7877
  /**
6331
7878
  * @remarks
6332
7879
  * Searches the block volume for a block that satisfies the
@@ -6444,6 +7991,30 @@ export class Dimension {
6444
7991
  block: BlockPermutation | BlockType | string,
6445
7992
  options?: BlockFillOptions,
6446
7993
  ): ListBlockVolume;
7994
+ /**
7995
+ * @beta
7996
+ * @remarks
7997
+ * Finds the location of the closest biome of a particular
7998
+ * type. Note that the findClosestBiome operation can take some
7999
+ * time to complete, so avoid using many of these calls within
8000
+ * a particular tick.
8001
+ *
8002
+ * @param pos
8003
+ * Starting location to look for a biome to find.
8004
+ * @param biomeToFind
8005
+ * Identifier of the biome to look for.
8006
+ * @param options
8007
+ * Additional selection criteria for a biome search.
8008
+ * @returns
8009
+ * Returns a location of the biome, or undefined if a biome
8010
+ * could not be found.
8011
+ * @throws This function can throw errors.
8012
+ *
8013
+ * {@link minecraftcommon.EngineError}
8014
+ *
8015
+ * {@link Error}
8016
+ */
8017
+ findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
6447
8018
  /**
6448
8019
  * @remarks
6449
8020
  * Returns the biome type at the specified location.
@@ -6663,6 +8234,26 @@ export class Dimension {
6663
8234
  * {@link minecraftcommon.UnsupportedFunctionalityError}
6664
8235
  */
6665
8236
  getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
8237
+ /**
8238
+ * @beta
8239
+ * @remarks
8240
+ * Returns a vector of generated structures that contain the
8241
+ * specified location (ex: Pillager Outpost, Mineshaft, etc.).
8242
+ * The vector will be empty if no structures are found.
8243
+ *
8244
+ * @param location
8245
+ * Location at which to check for structures.
8246
+ * @throws
8247
+ * An error will be thrown if the location is out of world
8248
+ * bounds.
8249
+ * An error will be thrown if the location is in an unloaded
8250
+ * chunk.
8251
+ *
8252
+ * {@link LocationInUnloadedChunkError}
8253
+ *
8254
+ * {@link LocationOutOfWorldBoundariesError}
8255
+ */
8256
+ getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
6666
8257
  /**
6667
8258
  * @remarks
6668
8259
  * Returns the total brightness level of light shining on a
@@ -6724,6 +8315,16 @@ export class Dimension {
6724
8315
  * @throws This function can throw errors.
6725
8316
  */
6726
8317
  getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
8318
+ /**
8319
+ * @beta
8320
+ * @remarks
8321
+ * Returns the current weather.
8322
+ *
8323
+ * @returns
8324
+ * Returns a WeatherType that explains the broad category of
8325
+ * weather that is currently going on.
8326
+ */
8327
+ getWeather(): WeatherType;
6727
8328
  /**
6728
8329
  * @remarks
6729
8330
  * Returns true if the chunk at the given location is loaded
@@ -6967,7 +8568,11 @@ export class Dimension {
6967
8568
  * }
6968
8569
  * ```
6969
8570
  */
6970
- spawnEntity(identifier: EntityType | string, location: Vector3, options?: SpawnEntityOptions): Entity;
8571
+ spawnEntity<T = never>(
8572
+ identifier: EntityIdentifierType<NoInfer<T>>,
8573
+ location: Vector3,
8574
+ options?: SpawnEntityOptions,
8575
+ ): Entity;
6971
8576
  /**
6972
8577
  * @remarks
6973
8578
  * Creates a new item stack as an entity at the specified
@@ -7062,6 +8667,26 @@ export class Dimension {
7062
8667
  * ```
7063
8668
  */
7064
8669
  spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
8670
+ /**
8671
+ * @beta
8672
+ * @remarks
8673
+ * Stops all sounds from playing for all players.
8674
+ *
8675
+ * This function can't be called in restricted-execution mode.
8676
+ *
8677
+ */
8678
+ stopAllSounds(): void;
8679
+ /**
8680
+ * @beta
8681
+ * @remarks
8682
+ * Stops a sound from playing for all players.
8683
+ *
8684
+ * This function can't be called in restricted-execution mode.
8685
+ *
8686
+ * @param soundId
8687
+ * Identifier of the sound.
8688
+ */
8689
+ stopSound(soundId: string): void;
7065
8690
  }
7066
8691
 
7067
8692
  /**
@@ -7586,6 +9211,18 @@ export class Entity {
7586
9211
  *
7587
9212
  */
7588
9213
  readonly scoreboardIdentity?: ScoreboardIdentity;
9214
+ /**
9215
+ * @beta
9216
+ * @remarks
9217
+ * Retrieves or sets an entity that is used as the target of
9218
+ * AI-related behaviors, like attacking. If the entity
9219
+ * currently has no target returns undefined.
9220
+ *
9221
+ * @throws This property can throw when used.
9222
+ *
9223
+ * {@link InvalidEntityError}
9224
+ */
9225
+ readonly target?: Entity;
7589
9226
  /**
7590
9227
  * @remarks
7591
9228
  * Identifier of the type of the entity - for example,
@@ -8814,6 +10451,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
8814
10451
  // @ts-ignore Class inheritance allowed for native defined classes
8815
10452
  export class EntityBreathableComponent extends EntityComponent {
8816
10453
  private constructor();
10454
+ /**
10455
+ * @beta
10456
+ * @remarks
10457
+ * The current air supply of the entity.
10458
+ *
10459
+ * This property can't be edited in restricted-execution mode.
10460
+ *
10461
+ * @throws
10462
+ * Will throw an error if the air supply is out of bounds
10463
+ * [suffocationTime, maxAirSupply].
10464
+ */
10465
+ airSupply: number;
8817
10466
  /**
8818
10467
  * @remarks
8819
10468
  * If true, this entity can breathe in air.
@@ -8842,6 +10491,14 @@ export class EntityBreathableComponent extends EntityComponent {
8842
10491
  * @throws This property can throw when used.
8843
10492
  */
8844
10493
  readonly breathesWater: boolean;
10494
+ /**
10495
+ * @beta
10496
+ * @remarks
10497
+ * If true, the entity is able to breathe.
10498
+ *
10499
+ * @throws This property can throw when used.
10500
+ */
10501
+ readonly canBreathe: boolean;
8845
10502
  /**
8846
10503
  * @remarks
8847
10504
  * If true, this entity will have visible bubbles while in
@@ -8997,6 +10654,10 @@ export class EntityDefinitionFeedItem {
8997
10654
  *
8998
10655
  */
8999
10656
  readonly item: string;
10657
+ /**
10658
+ * @beta
10659
+ */
10660
+ readonly resultItem: string;
9000
10661
  }
9001
10662
 
9002
10663
  /**
@@ -9971,17 +11632,72 @@ export class EntityIsTamedComponent extends EntityComponent {
9971
11632
  * }
9972
11633
  * ```
9973
11634
  */
9974
- // @ts-ignore Class inheritance allowed for native defined classes
9975
- export class EntityItemComponent extends EntityComponent {
11635
+ // @ts-ignore Class inheritance allowed for native defined classes
11636
+ export class EntityItemComponent extends EntityComponent {
11637
+ private constructor();
11638
+ /**
11639
+ * @remarks
11640
+ * Item stack represented by this entity in the world.
11641
+ *
11642
+ * @throws This property can throw when used.
11643
+ */
11644
+ readonly itemStack: ItemStack;
11645
+ static readonly componentId = 'minecraft:item';
11646
+ }
11647
+
11648
+ /**
11649
+ * @beta
11650
+ * Contains information related to an entity having dropped
11651
+ * items.
11652
+ */
11653
+ export class EntityItemDropAfterEvent {
11654
+ private constructor();
11655
+ /**
11656
+ * @remarks
11657
+ * The entity that has dropped the items.
11658
+ *
11659
+ */
11660
+ readonly entity: Entity;
11661
+ /**
11662
+ * @remarks
11663
+ * The list of items the entity has dropped.
11664
+ *
11665
+ */
11666
+ readonly items: Entity[];
11667
+ }
11668
+
11669
+ /**
11670
+ * @beta
11671
+ * Manages callbacks that are connected to when an entity has
11672
+ * dropped items.
11673
+ */
11674
+ export class EntityItemDropAfterEventSignal {
9976
11675
  private constructor();
9977
11676
  /**
9978
11677
  * @remarks
9979
- * Item stack represented by this entity in the world.
11678
+ * Adds a callback that will be called when an entity has
11679
+ * dropped items.
11680
+ *
11681
+ * This function can't be called in restricted-execution mode.
11682
+ *
11683
+ * This function can be called in early-execution mode.
9980
11684
  *
9981
- * @throws This property can throw when used.
9982
11685
  */
9983
- readonly itemStack: ItemStack;
9984
- static readonly componentId = 'minecraft:item';
11686
+ subscribe(
11687
+ callback: (arg0: EntityItemDropAfterEvent) => void,
11688
+ options?: EntityItemDropEventOptions,
11689
+ ): (arg0: EntityItemDropAfterEvent) => void;
11690
+ /**
11691
+ * @remarks
11692
+ * Removes a callback from being called when an entity has
11693
+ * dropped items.
11694
+ *
11695
+ * This function can't be called in restricted-execution mode.
11696
+ *
11697
+ * This function can be called in early-execution mode.
11698
+ *
11699
+ */
11700
+ unsubscribe(callback: (arg0: EntityItemDropAfterEvent) => void): void;
9985
11701
  }
9986
11702
 
9987
11703
  /**
@@ -10627,6 +12343,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
10627
12343
  static readonly componentId = 'minecraft:navigation.walk';
10628
12344
  }
10629
12345
 
12346
+ /**
12347
+ * @beta
12348
+ * Adds NPC capabilities to an entity such as custom skin,
12349
+ * name, and dialogue interactions.
12350
+ */
12351
+ // @ts-ignore Class inheritance allowed for native defined classes
12352
+ export class EntityNpcComponent extends EntityComponent {
12353
+ private constructor();
12354
+ /**
12355
+ * @remarks
12356
+ * The DialogueScene that is opened when players first interact
12357
+ * with the NPC.
12358
+ *
12359
+ * This property can't be edited in restricted-execution mode.
12360
+ *
12361
+ */
12362
+ defaultScene: string;
12363
+ /**
12364
+ * @remarks
12365
+ * The name of the NPC as it is displayed to players.
12366
+ *
12367
+ * This property can't be edited in restricted-execution mode.
12368
+ *
12369
+ */
12370
+ name: string;
12371
+ /**
12372
+ * @remarks
12373
+ * The index of the skin the NPC will use.
12374
+ *
12375
+ * This property can't be edited in restricted-execution mode.
12376
+ *
12377
+ */
12378
+ skinIndex: number;
12379
+ static readonly componentId = 'minecraft:npc';
12380
+ }
12381
+
10630
12382
  /**
10631
12383
  * When present on an entity, this entity is on fire.
10632
12384
  * @example setOnFire.ts
@@ -11505,7 +13257,7 @@ export class EntityTypes {
11505
13257
  * Retrieves an entity type using a string-based identifier.
11506
13258
  *
11507
13259
  */
11508
- static get(identifier: string): EntityType | undefined;
13260
+ static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
11509
13261
  /**
11510
13262
  * @remarks
11511
13263
  * Retrieves a set of all entity types within this world.
@@ -11715,6 +13467,10 @@ export class FeedItem {
11715
13467
  *
11716
13468
  */
11717
13469
  readonly item: string;
13470
+ /**
13471
+ * @beta
13472
+ */
13473
+ readonly resultItem: string;
11718
13474
  /**
11719
13475
  * @remarks
11720
13476
  * As part of the Healable component, an optional collection of
@@ -11962,6 +13718,13 @@ export class GameRules {
11962
13718
  *
11963
13719
  */
11964
13720
  keepInventory: boolean;
13721
+ /**
13722
+ * @beta
13723
+ * @remarks
13724
+ * This property can't be edited in restricted-execution mode.
13725
+ *
13726
+ */
13727
+ locatorBar: boolean;
11965
13728
  /**
11966
13729
  * @remarks
11967
13730
  * This property can't be edited in restricted-execution mode.
@@ -12762,6 +14525,17 @@ export class ItemDurabilityComponent extends ItemComponent {
12762
14525
  * @throws This property can throw when used.
12763
14526
  */
12764
14527
  readonly maxDurability: number;
14528
+ /**
14529
+ * @beta
14530
+ * @remarks
14531
+ * Whether an item breaks or loses durability. Setting to true
14532
+ * temporarily removes item's durabilty HUD, and freezes
14533
+ * durability loss on item.
14534
+ *
14535
+ * This property can't be edited in restricted-execution mode.
14536
+ *
14537
+ */
14538
+ unbreakable: boolean;
12765
14539
  static readonly componentId = 'minecraft:durability';
12766
14540
  /**
12767
14541
  * @remarks
@@ -14227,6 +16001,21 @@ export class LeverActionAfterEventSignal {
14227
16001
  unsubscribe(callback: (arg0: LeverActionAfterEvent) => void): void;
14228
16002
  }
14229
16003
 
16004
+ /**
16005
+ * @beta
16006
+ * A spline that linearly interpolates between points.
16007
+ */
16008
+ export class LinearSpline {
16009
+ /**
16010
+ * @remarks
16011
+ * Control points for the Linear spline.
16012
+ *
16013
+ * This property can't be edited in restricted-execution mode.
16014
+ *
16015
+ */
16016
+ controlPoints: Vector3[];
16017
+ }
16018
+
14230
16019
  /**
14231
16020
  * Volume composed of an unordered container of unique block
14232
16021
  * locations.
@@ -14638,6 +16427,33 @@ export class MatchToolCondition extends LootItemCondition {
14638
16427
  readonly itemTagsNone: string[];
14639
16428
  }
14640
16429
 
16430
+ /**
16431
+ * @beta
16432
+ * A specific currently-internal event used for passing
16433
+ * messages from client to server.
16434
+ */
16435
+ export class MessageReceiveAfterEvent {
16436
+ private constructor();
16437
+ /**
16438
+ * @remarks
16439
+ * The message identifier.
16440
+ *
16441
+ */
16442
+ readonly id: string;
16443
+ /**
16444
+ * @remarks
16445
+ * The message.
16446
+ *
16447
+ */
16448
+ readonly message: string;
16449
+ /**
16450
+ * @remarks
16451
+ * The player who sent the message.
16452
+ *
16453
+ */
16454
+ readonly player: Player;
16455
+ }
16456
+
14641
16457
  /**
14642
16458
  * Contains a set of additional variable values for further
14643
16459
  * defining how rendering and animations function.
@@ -14706,6 +16522,49 @@ export class MolangVariableMap {
14706
16522
  setVector3(variableName: string, vector: Vector3): void;
14707
16523
  }
14708
16524
 
16525
+ /**
16526
+ * @beta
16527
+ * Pack setting name and value that changed.
16528
+ */
16529
+ export class PackSettingChangeAfterEvent {
16530
+ private constructor();
16531
+ /**
16532
+ * @remarks
16533
+ * The name of the setting.
16534
+ *
16535
+ */
16536
+ readonly settingName: string;
16537
+ /**
16538
+ * @remarks
16539
+ * The value of the setting.
16540
+ *
16541
+ */
16542
+ readonly settingValue: boolean | number | string;
16543
+ }
16544
+
16545
+ /**
16546
+ * @beta
16547
+ */
16548
+ export class PackSettingChangeAfterEventSignal {
16549
+ private constructor();
16550
+ /**
16551
+ * @remarks
16552
+ * This function can't be called in restricted-execution mode.
16553
+ *
16554
+ * This function can be called in early-execution mode.
16555
+ *
16556
+ */
16557
+ subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
16558
+ /**
16559
+ * @remarks
16560
+ * This function can't be called in restricted-execution mode.
16561
+ *
16562
+ * This function can be called in early-execution mode.
16563
+ *
16564
+ */
16565
+ unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
16566
+ }
16567
+
14709
16568
  /**
14710
16569
  * Loot item condition that checks whether the looting entity
14711
16570
  * is currently a passenger of a specific type of entity.
@@ -15021,6 +16880,27 @@ export class Player extends Entity {
15021
16880
  * Throws if the Entity or Entity ID is invalid.
15022
16881
  */
15023
16882
  clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
16883
+ /**
16884
+ * @beta
16885
+ * @remarks
16886
+ * Eats an item, providing the item's hunger and saturation
16887
+ * effects to the player. Can only be used on food items.
16888
+ *
16889
+ * This function can't be called in restricted-execution mode.
16890
+ *
16891
+ * @param itemStack
16892
+ * The item to eat.
16893
+ * @throws
16894
+ * Throws if the item is not a food item.
16895
+ */
16896
+ eatItem(itemStack: ItemStack): void;
16897
+ /**
16898
+ * @beta
16899
+ * @remarks
16900
+ * The player's aim-assist settings.
16901
+ *
16902
+ */
16903
+ getAimAssist(): PlayerAimAssist;
15024
16904
  /**
15025
16905
  * @remarks
15026
16906
  * Returns the player's current control scheme.
@@ -15115,6 +16995,17 @@ export class Player extends Entity {
15115
16995
  * ```
15116
16996
  */
15117
16997
  playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
16998
+ /**
16999
+ * @beta
17000
+ * @remarks
17001
+ * This is an internal-facing method for posting a system
17002
+ * message to downstream clients.
17003
+ *
17004
+ * This function can't be called in restricted-execution mode.
17005
+ *
17006
+ * @throws This function can throw errors.
17007
+ */
17008
+ postClientMessage(id: string, value: string): void;
15118
17009
  /**
15119
17010
  * @remarks
15120
17011
  * Queues an additional music track that only this particular
@@ -15392,6 +17283,18 @@ export class Player extends Entity {
15392
17283
  * @throws This function can throw errors.
15393
17284
  */
15394
17285
  startItemCooldown(cooldownCategory: string, tickDuration: number): void;
17286
+ /**
17287
+ * @beta
17288
+ * @remarks
17289
+ * Stops all sounds from playing for this particular player.
17290
+ *
17291
+ * This function can't be called in restricted-execution mode.
17292
+ *
17293
+ * @throws This function can throw errors.
17294
+ *
17295
+ * {@link InvalidEntityError}
17296
+ */
17297
+ stopAllSounds(): void;
15395
17298
  /**
15396
17299
  * @remarks
15397
17300
  * Stops any music tracks from playing for this particular
@@ -15402,6 +17305,59 @@ export class Player extends Entity {
15402
17305
  * @throws This function can throw errors.
15403
17306
  */
15404
17307
  stopMusic(): void;
17308
+ /**
17309
+ * @beta
17310
+ * @remarks
17311
+ * Stops a sound from playing for this particular player.
17312
+ *
17313
+ * This function can't be called in restricted-execution mode.
17314
+ *
17315
+ * @param soundId
17316
+ * Identifier of the sound.
17317
+ * @throws This function can throw errors.
17318
+ *
17319
+ * {@link InvalidEntityError}
17320
+ */
17321
+ stopSound(soundId: string): void;
17322
+ }
17323
+
17324
+ /**
17325
+ * @beta
17326
+ * A container for APIs related to player aim-assist.
17327
+ */
17328
+ export class PlayerAimAssist {
17329
+ private constructor();
17330
+ /**
17331
+ * @remarks
17332
+ * The player's currently active aim-assist settings, or
17333
+ * undefined if not active.
17334
+ *
17335
+ */
17336
+ readonly settings?: PlayerAimAssistSettings;
17337
+ /**
17338
+ * @remarks
17339
+ * Sets the player's aim-assist settings.
17340
+ *
17341
+ * This function can't be called in restricted-execution mode.
17342
+ *
17343
+ * @param settings
17344
+ * Aim-assist settings to activate for the player, if undefined
17345
+ * aim-assist will be disabled.
17346
+ * @throws This function can throw errors.
17347
+ *
17348
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
17349
+ *
17350
+ * {@link minecraftcommon.EngineError}
17351
+ *
17352
+ * {@link Error}
17353
+ *
17354
+ * {@link minecraftcommon.InvalidArgumentError}
17355
+ *
17356
+ * {@link InvalidEntityError}
17357
+ *
17358
+ * {@link NamespaceNameError}
17359
+ */
17360
+ set(settings?: PlayerAimAssistSettings): void;
15405
17361
  }
15406
17362
 
15407
17363
  /**
@@ -16609,43 +18565,125 @@ export class PlayerPlaceBlockAfterEvent extends BlockEvent {
16609
18565
  private constructor();
16610
18566
  /**
16611
18567
  * @remarks
16612
- * Player that placed the block for this event.
18568
+ * Player that placed the block for this event.
18569
+ *
18570
+ */
18571
+ readonly player: Player;
18572
+ }
18573
+
18574
+ /**
18575
+ * Manages callbacks that are connected to when a block is
18576
+ * placed by a player.
18577
+ */
18578
+ export class PlayerPlaceBlockAfterEventSignal {
18579
+ private constructor();
18580
+ /**
18581
+ * @remarks
18582
+ * Adds a callback that will be called when a block is placed
18583
+ * by a player.
18584
+ *
18585
+ * This function can't be called in restricted-execution mode.
18586
+ *
18587
+ * This function can be called in early-execution mode.
18588
+ *
18589
+ */
18590
+ subscribe(
18591
+ callback: (arg0: PlayerPlaceBlockAfterEvent) => void,
18592
+ options?: BlockEventOptions,
18593
+ ): (arg0: PlayerPlaceBlockAfterEvent) => void;
18594
+ /**
18595
+ * @remarks
18596
+ * Removes a callback from being called when an block is placed
18597
+ * by a player.
18598
+ *
18599
+ * This function can't be called in restricted-execution mode.
18600
+ *
18601
+ * This function can be called in early-execution mode.
18602
+ *
18603
+ */
18604
+ unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
18605
+ }
18606
+
18607
+ /**
18608
+ * @beta
18609
+ * Contains information regarding an event before a player
18610
+ * places a block.
18611
+ */
18612
+ // @ts-ignore Class inheritance allowed for native defined classes
18613
+ export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
18614
+ private constructor();
18615
+ /**
18616
+ * @remarks
18617
+ * If set to true, cancels the block place event.
18618
+ *
18619
+ */
18620
+ cancel: boolean;
18621
+ /**
18622
+ * @remarks
18623
+ * The face of the block that the new block is being placed on.
18624
+ *
18625
+ */
18626
+ readonly face: Direction;
18627
+ /**
18628
+ * @remarks
18629
+ * Location relative to the bottom north-west corner of the
18630
+ * block where the new block is being placed onto.
18631
+ *
18632
+ */
18633
+ readonly faceLocation: Vector3;
18634
+ /**
18635
+ * @remarks
18636
+ * The block permutation that will be placed if the event is
18637
+ * not cancelled.
18638
+ *
18639
+ */
18640
+ readonly permutationToPlace: BlockPermutation;
18641
+ /**
18642
+ * @remarks
18643
+ * Player that is placing the block for this event.
16613
18644
  *
16614
18645
  */
16615
18646
  readonly player: Player;
16616
18647
  }
16617
18648
 
16618
18649
  /**
16619
- * Manages callbacks that are connected to when a block is
18650
+ * @beta
18651
+ * Manages callbacks that are connected to before a block is
16620
18652
  * placed by a player.
16621
18653
  */
16622
- export class PlayerPlaceBlockAfterEventSignal {
18654
+ export class PlayerPlaceBlockBeforeEventSignal {
16623
18655
  private constructor();
16624
18656
  /**
16625
18657
  * @remarks
16626
- * Adds a callback that will be called when a block is placed
18658
+ * Adds a callback that will be called before a block is placed
16627
18659
  * by a player.
16628
18660
  *
16629
18661
  * This function can't be called in restricted-execution mode.
16630
18662
  *
16631
18663
  * This function can be called in early-execution mode.
16632
18664
  *
18665
+ * @param callback
18666
+ * This closure is called with restricted-execution privilege.
18667
+ * @returns
18668
+ * Closure that is called with restricted-execution privilege.
16633
18669
  */
16634
18670
  subscribe(
16635
- callback: (arg0: PlayerPlaceBlockAfterEvent) => void,
18671
+ callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
16636
18672
  options?: BlockEventOptions,
16637
- ): (arg0: PlayerPlaceBlockAfterEvent) => void;
18673
+ ): (arg0: PlayerPlaceBlockBeforeEvent) => void;
16638
18674
  /**
16639
18675
  * @remarks
16640
- * Removes a callback from being called when an block is placed
16641
- * by a player.
18676
+ * Removes a callback from being called before an block is
18677
+ * placed by a player.
16642
18678
  *
16643
18679
  * This function can't be called in restricted-execution mode.
16644
18680
  *
16645
18681
  * This function can be called in early-execution mode.
16646
18682
  *
18683
+ * @param callback
18684
+ * This closure is called with restricted-execution privilege.
16647
18685
  */
16648
- unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
18686
+ unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
16649
18687
  }
16650
18688
 
16651
18689
  /**
@@ -16768,6 +18806,80 @@ export class PlayerSwingStartAfterEventSignal {
16768
18806
  unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
16769
18807
  }
16770
18808
 
18809
+ /**
18810
+ * @beta
18811
+ * Contains information related to when a player successfully
18812
+ * names an Entity with a named Name Tag item.
18813
+ */
18814
+ export class PlayerUseNameTagAfterEvent {
18815
+ private constructor();
18816
+ /**
18817
+ * @remarks
18818
+ * The entity that was named by the player.
18819
+ *
18820
+ * This property can't be edited in restricted-execution mode.
18821
+ *
18822
+ */
18823
+ entityNamed: Entity;
18824
+ /**
18825
+ * @remarks
18826
+ * The new name that the player has given to the entity.
18827
+ *
18828
+ * This property can't be edited in restricted-execution mode.
18829
+ *
18830
+ */
18831
+ newName: string;
18832
+ /**
18833
+ * @remarks
18834
+ * Handle to the player that used the name tag.
18835
+ *
18836
+ * This property can't be edited in restricted-execution mode.
18837
+ *
18838
+ */
18839
+ player: Player;
18840
+ /**
18841
+ * @remarks
18842
+ * The previous name of the entity before the player used the
18843
+ * name tag. This will be undefined if the entity was not
18844
+ * previously named.
18845
+ *
18846
+ * This property can't be edited in restricted-execution mode.
18847
+ *
18848
+ */
18849
+ previousName?: string;
18850
+ }
18851
+
18852
+ /**
18853
+ * @beta
18854
+ * Manages callbacks that are connected to when a player
18855
+ * successfully names an Entity with a named Name Tag item.
18856
+ */
18857
+ export class PlayerUseNameTagAfterEventSignal {
18858
+ private constructor();
18859
+ /**
18860
+ * @remarks
18861
+ * Subscribes the specified callback to a player use name tag
18862
+ * after event.
18863
+ *
18864
+ * This function can't be called in restricted-execution mode.
18865
+ *
18866
+ * This function can be called in early-execution mode.
18867
+ *
18868
+ */
18869
+ subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
18870
+ /**
18871
+ * @remarks
18872
+ * Removes the specified callback from a player use name tag
18873
+ * after event.
18874
+ *
18875
+ * This function can't be called in restricted-execution mode.
18876
+ *
18877
+ * This function can be called in early-execution mode.
18878
+ *
18879
+ */
18880
+ unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
18881
+ }
18882
+
16771
18883
  /**
16772
18884
  * Represents how the potion effect is delivered.
16773
18885
  */
@@ -16850,10 +18962,10 @@ export class Potions {
16850
18962
  *
16851
18963
  * {@link InvalidPotionEffectTypeError}
16852
18964
  */
16853
- static resolve(
16854
- potionEffectType: PotionEffectType | string,
16855
- potionDeliveryType: PotionDeliveryType | string,
16856
- ): ItemStack;
18965
+ static resolve<
18966
+ T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
18967
+ U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
18968
+ >(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
16857
18969
  }
16858
18970
 
16859
18971
  /**
@@ -17921,6 +20033,38 @@ export class Seat {
17921
20033
  readonly seatRotation: number;
17922
20034
  }
17923
20035
 
20036
+ /**
20037
+ * @beta
20038
+ * Manages callbacks that are message passing to a server. This
20039
+ * event is not currently fully implemented, and should not be
20040
+ * used.
20041
+ */
20042
+ export class ServerMessageAfterEventSignal {
20043
+ private constructor();
20044
+ /**
20045
+ * @remarks
20046
+ * Adds a callback that will be called when an internal message
20047
+ * is passed.
20048
+ *
20049
+ * This function can't be called in restricted-execution mode.
20050
+ *
20051
+ * This function can be called in early-execution mode.
20052
+ *
20053
+ */
20054
+ subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
20055
+ /**
20056
+ * @remarks
20057
+ * Removes a callback from being called when an internal
20058
+ * message is passed.
20059
+ *
20060
+ * This function can't be called in restricted-execution mode.
20061
+ *
20062
+ * This function can be called in early-execution mode.
20063
+ *
20064
+ */
20065
+ unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
20066
+ }
20067
+
17924
20068
  /**
17925
20069
  * Loot item function that modifies the trim on a dropped armor
17926
20070
  * item.
@@ -18881,6 +21025,19 @@ export class SystemBeforeEvents {
18881
21025
  *
18882
21026
  */
18883
21027
  readonly startup: StartupBeforeEventSignal;
21028
+ /**
21029
+ * @beta
21030
+ * @remarks
21031
+ * Fires when the scripting watchdog shuts down the server. The
21032
+ * can be due to using too much memory, or by causing
21033
+ * significant slowdown or hang.
21034
+ * To prevent shutdown, set the event's cancel property to
21035
+ * true.
21036
+ *
21037
+ * This property can be read in early-execution mode.
21038
+ *
21039
+ */
21040
+ readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
18884
21041
  }
18885
21042
 
18886
21043
  /**
@@ -18959,6 +21116,110 @@ export class TargetBlockHitAfterEventSignal {
18959
21116
  unsubscribe(callback: (arg0: TargetBlockHitAfterEvent) => void): void;
18960
21117
  }
18961
21118
 
21119
+ /**
21120
+ * @beta
21121
+ * This manager is used to add, remove or query temporary
21122
+ * ticking areas to a dimension. These ticking areas are
21123
+ * limited by a fixed amount of ticking chunks per pack
21124
+ * independent of the command limits. Cannot modify or query
21125
+ * ticking areas added by other packs or commands.
21126
+ */
21127
+ export class TickingAreaManager {
21128
+ private constructor();
21129
+ /**
21130
+ * @remarks
21131
+ * The number of currently ticking chunks in this manager.
21132
+ *
21133
+ */
21134
+ readonly chunkCount: number;
21135
+ /**
21136
+ * @remarks
21137
+ * The maximum number of allowed ticking chunks. Overlapping
21138
+ * ticking area chunks do count towards total.
21139
+ *
21140
+ */
21141
+ readonly maxChunkCount: number;
21142
+ /**
21143
+ * @remarks
21144
+ * Creates a ticking area. Promise will return when all the
21145
+ * chunks in the area are loaded and ticking.
21146
+ *
21147
+ * This function can't be called in restricted-execution mode.
21148
+ *
21149
+ * @throws This function can throw errors.
21150
+ *
21151
+ * {@link minecraftcommon.EngineError}
21152
+ *
21153
+ * {@link TickingAreaError}
21154
+ */
21155
+ createTickingArea(identifier: string, options: TickingAreaOptions): Promise<TickingArea>;
21156
+ /**
21157
+ * @remarks
21158
+ * Gets all ticking areas added by this manager.
21159
+ *
21160
+ * This function can't be called in restricted-execution mode.
21161
+ *
21162
+ * @throws This function can throw errors.
21163
+ *
21164
+ * {@link minecraftcommon.EngineError}
21165
+ */
21166
+ getAllTickingAreas(): TickingArea[];
21167
+ /**
21168
+ * @remarks
21169
+ * Tries to get specific ticking area by identifier.
21170
+ *
21171
+ * This function can't be called in restricted-execution mode.
21172
+ *
21173
+ * @throws This function can throw errors.
21174
+ *
21175
+ * {@link minecraftcommon.EngineError}
21176
+ */
21177
+ getTickingArea(identifier: string | TickingArea): TickingArea | undefined;
21178
+ /**
21179
+ * @remarks
21180
+ * Returns true if the manager has enough chunk capacity for
21181
+ * the ticking area and false otherwise. Will also return false
21182
+ * if the length or width exceeds the 255 chunk limit.
21183
+ *
21184
+ * This function can't be called in restricted-execution mode.
21185
+ *
21186
+ */
21187
+ hasCapacity(options: TickingAreaOptions): boolean;
21188
+ /**
21189
+ * @remarks
21190
+ * Returns true if the identifier is already in the manager and
21191
+ * false otherwise.
21192
+ *
21193
+ * This function can't be called in restricted-execution mode.
21194
+ *
21195
+ */
21196
+ hasTickingArea(identifier: string): boolean;
21197
+ /**
21198
+ * @remarks
21199
+ * Removes all ticking areas added by this manager.
21200
+ *
21201
+ * This function can't be called in restricted-execution mode.
21202
+ *
21203
+ * @throws This function can throw errors.
21204
+ *
21205
+ * {@link minecraftcommon.EngineError}
21206
+ */
21207
+ removeAllTickingAreas(): void;
21208
+ /**
21209
+ * @remarks
21210
+ * Removes specific ticking area by unique identifier.
21211
+ *
21212
+ * This function can't be called in restricted-execution mode.
21213
+ *
21214
+ * @throws This function can throw errors.
21215
+ *
21216
+ * {@link minecraftcommon.EngineError}
21217
+ *
21218
+ * {@link TickingAreaError}
21219
+ */
21220
+ removeTickingArea(identifier: string | TickingArea): void;
21221
+ }
21222
+
18962
21223
  /**
18963
21224
  * Represents a trigger for firing an event.
18964
21225
  */
@@ -19097,6 +21358,71 @@ export class TripWireTripAfterEventSignal {
19097
21358
  unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
19098
21359
  }
19099
21360
 
21361
+ /**
21362
+ * @beta
21363
+ * Contains information related to a script watchdog
21364
+ * termination.
21365
+ */
21366
+ export class WatchdogTerminateBeforeEvent {
21367
+ private constructor();
21368
+ /**
21369
+ * @remarks
21370
+ * If set to true, cancels the termination of the script
21371
+ * runtime. Note that depending on server configuration
21372
+ * settings, cancellation of the termination may not be
21373
+ * allowed.
21374
+ *
21375
+ */
21376
+ cancel: boolean;
21377
+ /**
21378
+ * @remarks
21379
+ * Contains the reason why a script runtime is to be
21380
+ * terminated.
21381
+ *
21382
+ */
21383
+ readonly terminateReason: WatchdogTerminateReason;
21384
+ }
21385
+
21386
+ /**
21387
+ * @beta
21388
+ * Manages callbacks that are connected to a callback that will
21389
+ * be called when a script runtime is being terminated due to a
21390
+ * violation of the performance watchdog system.
21391
+ */
21392
+ export class WatchdogTerminateBeforeEventSignal {
21393
+ private constructor();
21394
+ /**
21395
+ * @remarks
21396
+ * Adds a callback that will be called when a script runtime is
21397
+ * being terminated due to a violation of the performance
21398
+ * watchdog system.
21399
+ *
21400
+ * This function can't be called in restricted-execution mode.
21401
+ *
21402
+ * This function can be called in early-execution mode.
21403
+ *
21404
+ * @param callback
21405
+ * This closure is called with restricted-execution privilege.
21406
+ * @returns
21407
+ * Closure that is called with restricted-execution privilege.
21408
+ */
21409
+ subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
21410
+ /**
21411
+ * @remarks
21412
+ * Removes a callback from being called when a script runtime
21413
+ * is being terminated due to a violation of the performance
21414
+ * watchdog system.
21415
+ *
21416
+ * This function can't be called in restricted-execution mode.
21417
+ *
21418
+ * This function can be called in early-execution mode.
21419
+ *
21420
+ * @param callback
21421
+ * This closure is called with restricted-execution privilege.
21422
+ */
21423
+ unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
21424
+ }
21425
+
19100
21426
  /**
19101
21427
  * Contains information related to changes in weather in the
19102
21428
  * environment.
@@ -19297,6 +21623,28 @@ export class World {
19297
21623
  *
19298
21624
  */
19299
21625
  readonly structureManager: StructureManager;
21626
+ /**
21627
+ * @beta
21628
+ * @remarks
21629
+ * Manager for adding, removing and querying pack specific
21630
+ * ticking areas.
21631
+ *
21632
+ */
21633
+ readonly tickingAreaManager: TickingAreaManager;
21634
+ /**
21635
+ * @beta
21636
+ * @remarks
21637
+ * A method that is internal-only, used for broadcasting
21638
+ * specific messages between client and server.
21639
+ *
21640
+ * This function can't be called in restricted-execution mode.
21641
+ *
21642
+ * @param id
21643
+ * The message identifier.
21644
+ * @param value
21645
+ * The message.
21646
+ */
21647
+ broadcastClientMessage(id: string, value: string): void;
19300
21648
  /**
19301
21649
  * @remarks
19302
21650
  * Clears the set of dynamic properties declared for this
@@ -19310,6 +21658,14 @@ export class World {
19310
21658
  *
19311
21659
  */
19312
21660
  getAbsoluteTime(): number;
21661
+ /**
21662
+ * @beta
21663
+ * @remarks
21664
+ * The aim-assist presets and categories that can be used in
21665
+ * the world.
21666
+ *
21667
+ */
21668
+ getAimAssist(): AimAssistRegistry;
19313
21669
  /**
19314
21670
  * @remarks
19315
21671
  * Returns an array of all active players within the world.
@@ -19486,6 +21842,15 @@ export class World {
19486
21842
  *
19487
21843
  */
19488
21844
  getMoonPhase(): MoonPhase;
21845
+ /**
21846
+ * @beta
21847
+ * @remarks
21848
+ * Returns a map of pack setting name and value pairs.
21849
+ *
21850
+ * This function can be called in early-execution mode.
21851
+ *
21852
+ */
21853
+ getPackSettings(): Record<string, boolean | number | string>;
19489
21854
  /**
19490
21855
  * @remarks
19491
21856
  * Returns a set of players based on a set of conditions
@@ -19761,6 +22126,16 @@ export class WorldAfterEvents {
19761
22126
  *
19762
22127
  */
19763
22128
  readonly buttonPush: ButtonPushAfterEventSignal;
22129
+ /**
22130
+ * @beta
22131
+ * @remarks
22132
+ * This event is triggered after a chat message has been
22133
+ * broadcast or sent to players.
22134
+ *
22135
+ * This property can be read in early-execution mode.
22136
+ *
22137
+ */
22138
+ readonly chatSend: ChatSendAfterEventSignal;
19764
22139
  /**
19765
22140
  * @remarks
19766
22141
  * This event is fired when an entity event has been triggered
@@ -19830,6 +22205,15 @@ export class WorldAfterEvents {
19830
22205
  *
19831
22206
  */
19832
22207
  readonly entityHurt: EntityHurtAfterEventSignal;
22208
+ /**
22209
+ * @beta
22210
+ * @remarks
22211
+ * This event fires when an entity drops items.
22212
+ *
22213
+ * This property can be read in early-execution mode.
22214
+ *
22215
+ */
22216
+ readonly entityItemDrop: EntityItemDropAfterEventSignal;
19833
22217
  /**
19834
22218
  * @rc
19835
22219
  * @remarks
@@ -19953,6 +22337,25 @@ export class WorldAfterEvents {
19953
22337
  *
19954
22338
  */
19955
22339
  readonly leverAction: LeverActionAfterEventSignal;
22340
+ /**
22341
+ * @beta
22342
+ * @remarks
22343
+ * This event is an internal implementation detail, and is
22344
+ * otherwise not currently functional.
22345
+ *
22346
+ * This property can be read in early-execution mode.
22347
+ *
22348
+ */
22349
+ readonly messageReceive: ServerMessageAfterEventSignal;
22350
+ /**
22351
+ * @beta
22352
+ * @remarks
22353
+ * This event is triggered when a pack setting is changed.
22354
+ *
22355
+ * This property can be read in early-execution mode.
22356
+ *
22357
+ */
22358
+ readonly packSettingChange: PackSettingChangeAfterEventSignal;
19956
22359
  /**
19957
22360
  * @remarks
19958
22361
  * This event fires when a piston expands or retracts.
@@ -20090,6 +22493,16 @@ export class WorldAfterEvents {
20090
22493
  *
20091
22494
  */
20092
22495
  readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
22496
+ /**
22497
+ * @beta
22498
+ * @remarks
22499
+ * An event for when a player uses a named name tag on an
22500
+ * entity.
22501
+ *
22502
+ * This property can be read in early-execution mode.
22503
+ *
22504
+ */
22505
+ readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
20093
22506
  /**
20094
22507
  * @remarks
20095
22508
  * A pressure plate has popped back up (i.e., there are no
@@ -20166,6 +22579,43 @@ export class WorldAfterEvents {
20166
22579
  */
20167
22580
  export class WorldBeforeEvents {
20168
22581
  private constructor();
22582
+ /**
22583
+ * @beta
22584
+ * @remarks
22585
+ * This event is triggered after a chat message has been
22586
+ * broadcast or sent to players.
22587
+ *
22588
+ * This property can be read in early-execution mode.
22589
+ *
22590
+ * @example customCommand.ts
22591
+ * ```typescript
22592
+ * import { world, DimensionLocation } from "@minecraft/server";
22593
+ *
22594
+ * function customCommand(targetLocation: DimensionLocation) {
22595
+ * const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
22596
+ * if (eventData.message.includes("cancel")) {
22597
+ * // Cancel event if the message contains "cancel"
22598
+ * eventData.cancel = true;
22599
+ * } else {
22600
+ * const args = eventData.message.split(" ");
22601
+ *
22602
+ * if (args.length > 0) {
22603
+ * switch (args[0].toLowerCase()) {
22604
+ * case "echo":
22605
+ * // Send a modified version of chat message
22606
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
22607
+ * break;
22608
+ * case "help":
22609
+ * world.sendMessage(`Available commands: echo <message>`);
22610
+ * break;
22611
+ * }
22612
+ * }
22613
+ * }
22614
+ * });
22615
+ * }
22616
+ * ```
22617
+ */
22618
+ readonly chatSend: ChatSendBeforeEventSignal;
20169
22619
  /**
20170
22620
  * @remarks
20171
22621
  * This event is triggered after an event has been added to an
@@ -20262,6 +22712,15 @@ export class WorldBeforeEvents {
20262
22712
  *
20263
22713
  */
20264
22714
  readonly playerLeave: PlayerLeaveBeforeEventSignal;
22715
+ /**
22716
+ * @beta
22717
+ * @remarks
22718
+ * This event fires before a block is placed by a player.
22719
+ *
22720
+ * This property can be read in early-execution mode.
22721
+ *
22722
+ */
22723
+ readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
20265
22724
  /**
20266
22725
  * @remarks
20267
22726
  * This property can be read in early-execution mode.
@@ -20314,13 +22773,57 @@ export interface AABB {
20314
22773
  extent: Vector3;
20315
22774
  }
20316
22775
 
22776
+ /**
22777
+ * @beta
22778
+ * Used to create camera animations.
22779
+ */
22780
+ export interface AnimationOptions {
22781
+ /**
22782
+ * @remarks
22783
+ * Key frames for the camera animation.
22784
+ *
22785
+ */
22786
+ animation: SplineAnimation;
22787
+ /**
22788
+ * @remarks
22789
+ * Total time of the camera animation in seconds.
22790
+ *
22791
+ */
22792
+ totalTimeSeconds: number;
22793
+ }
22794
+
22795
+ /**
22796
+ * @beta
22797
+ */
22798
+ export interface BiomeFilter {
22799
+ excludeBiomes?: string[];
22800
+ excludeTags?: string[];
22801
+ includeBiomes?: string[];
22802
+ includeTags?: string[];
22803
+ superset: boolean;
22804
+ }
22805
+
22806
+ /**
22807
+ * @beta
22808
+ * Contains additional options for searches for the
22809
+ * dimension.findNearestBiome API.
22810
+ */
22811
+ export interface BiomeSearchOptions {
22812
+ /**
22813
+ * @remarks
22814
+ * Bounding volume size to look within.
22815
+ *
22816
+ */
22817
+ boundingSize?: Vector3;
22818
+ }
22819
+
20317
22820
  /**
20318
22821
  * A BlockBoundingBox is an interface to an object which
20319
22822
  * represents an AABB aligned rectangle.
20320
22823
  * The BlockBoundingBox assumes that it was created in a valid
20321
22824
  * state (min <= max) but cannot guarantee it (unless it was
20322
- * created using the associated {@link
20323
- * @minecraft/server.BlockBoundingBoxUtils} utility functions.
22825
+ * created using the associated {@link BlockBoundingBoxUtils}
22826
+ * utility functions.
20324
22827
  * The min/max coordinates represent the diametrically opposite
20325
22828
  * corners of the rectangle.
20326
22829
  * The BlockBoundingBox is not a representation of blocks - it
@@ -20372,6 +22875,14 @@ export interface BlockCustomComponent {
20372
22875
  *
20373
22876
  */
20374
22877
  onBreak?: (arg0: BlockComponentBlockBreakEvent, arg1: CustomComponentParameters) => void;
22878
+ /**
22879
+ * @beta
22880
+ * @remarks
22881
+ * This function will be called when an entity fires an event
22882
+ * to this block in the world.
22883
+ *
22884
+ */
22885
+ onEntity?: (arg0: BlockComponentEntityEvent, arg1: CustomComponentParameters) => void;
20375
22886
  /**
20376
22887
  * @remarks
20377
22888
  * This function will be called when an entity falls onto the
@@ -20604,6 +23115,26 @@ export interface BlockRaycastOptions extends BlockFilter {
20604
23115
  maxDistance?: number;
20605
23116
  }
20606
23117
 
23118
+ /**
23119
+ * @beta
23120
+ * Used to attach the camera to a non player entity.
23121
+ */
23122
+ export interface CameraAttachOptions {
23123
+ /**
23124
+ * @remarks
23125
+ * Set a non player entity for the camera to target.
23126
+ *
23127
+ */
23128
+ entity: Entity;
23129
+ /**
23130
+ * @remarks
23131
+ * The location of the entity that you want to target (eg.
23132
+ * head, feet, eyes).
23133
+ *
23134
+ */
23135
+ locator: EntityAttachPoint;
23136
+ }
23137
+
20607
23138
  /**
20608
23139
  * Used to initiate a full-screen color fade.
20609
23140
  */
@@ -20720,6 +23251,40 @@ export interface CameraTargetOptions {
20720
23251
  targetEntity: Entity;
20721
23252
  }
20722
23253
 
23254
+ /**
23255
+ * @beta
23256
+ * This interface defines an entry into the {@link
23257
+ * CompoundBlockVolume} which represents a volume of positive
23258
+ * or negative space.
23259
+ *
23260
+ */
23261
+ export interface CompoundBlockVolumeItem {
23262
+ /**
23263
+ * @remarks
23264
+ * The 'action' defines how the block volume is represented in
23265
+ * the compound block volume stack.
23266
+ * 'Add' creates a block volume which is positively selected
23267
+ * 'Subtract' creates a block volume which represents a hole or
23268
+ * negative space in the overall compound block volume.
23269
+ *
23270
+ */
23271
+ action?: CompoundBlockVolumeAction;
23272
+ /**
23273
+ * @remarks
23274
+ * The relativity enumeration determines whether the
23275
+ * BlockVolume specified is positioned relative to the parent
23276
+ * compound block volume origin, or in absolute world space.
23277
+ *
23278
+ */
23279
+ locationRelativity?: CompoundBlockVolumePositionRelativity;
23280
+ /**
23281
+ * @remarks
23282
+ * The volume of space
23283
+ *
23284
+ */
23285
+ volume: BlockVolume;
23286
+ }
23287
+
20723
23288
  /**
20724
23289
  * Rules that if broken on container operations will throw an
20725
23290
  * error.
@@ -20804,6 +23369,15 @@ export interface CustomCommand {
20804
23369
  * command.
20805
23370
  */
20806
23371
  export interface CustomCommandParameter {
23372
+ /**
23373
+ * @beta
23374
+ * @remarks
23375
+ * Can be used to reference the enum name when {@link
23376
+ * CustomCommandParamType} is 'Enum'. Allows the parameter name
23377
+ * to be different from the enum name.
23378
+ *
23379
+ */
23380
+ enumName?: string;
20807
23381
  /**
20808
23382
  * @remarks
20809
23383
  * The name of parameter as it appears on the command line.
@@ -20856,6 +23430,14 @@ export interface DefinitionModifier {
20856
23430
  *
20857
23431
  */
20858
23432
  removedComponentGroups: string[];
23433
+ /**
23434
+ * @beta
23435
+ * @remarks
23436
+ * The list of entity definition events that will be fired via
23437
+ * this update.
23438
+ *
23439
+ */
23440
+ triggers: Trigger[];
20859
23441
  }
20860
23442
 
20861
23443
  /**
@@ -21272,6 +23854,30 @@ export interface EntityHurtBeforeEventOptions {
21272
23854
  entityFilter?: EntityFilter;
21273
23855
  }
21274
23856
 
23857
+ /**
23858
+ * @beta
23859
+ * An interface that is passed into {@link
23860
+ * @minecraft/Server.EntityItemDropAfterEventSignal.subscribe}
23861
+ * that filters out which events are passed to the provided
23862
+ * callback.
23863
+ */
23864
+ export interface EntityItemDropEventOptions {
23865
+ /**
23866
+ * @remarks
23867
+ * If this value is set, this event will only fire for entities
23868
+ * that match.
23869
+ *
23870
+ */
23871
+ entityFilter?: EntityFilter;
23872
+ /**
23873
+ * @remarks
23874
+ * If this value is set, this event will only fire if an item
23875
+ * in the event matches.
23876
+ *
23877
+ */
23878
+ itemFilter?: ItemFilter;
23879
+ }
23880
+
21275
23881
  /**
21276
23882
  * @rc
21277
23883
  * An interface that is passed into {@link
@@ -22073,6 +24679,38 @@ export interface PlayAnimationOptions {
22073
24679
  stopExpression?: string;
22074
24680
  }
22075
24681
 
24682
+ /**
24683
+ * @beta
24684
+ * Settings relating to a player's aim-assist targeting.
24685
+ */
24686
+ export interface PlayerAimAssistSettings {
24687
+ /**
24688
+ * @remarks
24689
+ * The view distance limit to use for aim-assist targeting.
24690
+ *
24691
+ */
24692
+ distance?: number;
24693
+ /**
24694
+ * @remarks
24695
+ * The Id of the aim-assist preset to activate. Must have a
24696
+ * namespace.
24697
+ *
24698
+ */
24699
+ presetId: string;
24700
+ /**
24701
+ * @remarks
24702
+ * The mode to use for aim-assist targeting.
24703
+ *
24704
+ */
24705
+ targetMode?: AimAssistTargetMode;
24706
+ /**
24707
+ * @remarks
24708
+ * The view angle limit to use for aim-assist targeting.
24709
+ *
24710
+ */
24711
+ viewAngle?: Vector2;
24712
+ }
24713
+
22076
24714
  /**
22077
24715
  * Additional options for how a sound plays for a player.
22078
24716
  */
@@ -22124,6 +24762,33 @@ export interface PlayerSwingEventOptions {
22124
24762
  swingSource?: EntitySwingSource;
22125
24763
  }
22126
24764
 
24765
+ /**
24766
+ * @beta
24767
+ * Key frame that holds the progress of the camera animation.
24768
+ */
24769
+ export interface ProgressKeyFrame {
24770
+ /**
24771
+ * @remarks
24772
+ * Value to denote how far along the curve the camera will be.
24773
+ * Values are [0.0, 1.0] inclusive.
24774
+ *
24775
+ */
24776
+ alpha: number;
24777
+ /**
24778
+ * @remarks
24779
+ * The optional easing type that the frame will use for
24780
+ * position.
24781
+ *
24782
+ */
24783
+ easingFunc?: EasingType;
24784
+ /**
24785
+ * @remarks
24786
+ * Time value that the camera will be at the given alpha.
24787
+ *
24788
+ */
24789
+ timeSeconds: number;
24790
+ }
24791
+
22127
24792
  /**
22128
24793
  * Optional arguments for
22129
24794
  * @minecraft/server.EntityProjectileComponent.shoot.
@@ -22364,6 +25029,32 @@ export interface RGBA extends RGB {
22364
25029
  alpha: number;
22365
25030
  }
22366
25031
 
25032
+ /**
25033
+ * @beta
25034
+ * Key frame that holds the rotation of the camera animation.
25035
+ */
25036
+ export interface RotationKeyFrame {
25037
+ /**
25038
+ * @remarks
25039
+ * The optional easing type that the frame will use for
25040
+ * rotation.
25041
+ *
25042
+ */
25043
+ easingFunc?: EasingType;
25044
+ /**
25045
+ * @remarks
25046
+ * Value of the rotation of the camera.
25047
+ *
25048
+ */
25049
+ rotation: Vector3;
25050
+ /**
25051
+ * @remarks
25052
+ * Time value that the camera will be at the given rotation.
25053
+ *
25054
+ */
25055
+ timeSeconds: number;
25056
+ }
25057
+
22367
25058
  /**
22368
25059
  * Contains additional options for how a scoreboard should be
22369
25060
  * displayed within its display slot.
@@ -22425,6 +25116,25 @@ export interface SpawnEntityOptions {
22425
25116
  spawnEvent?: string;
22426
25117
  }
22427
25118
 
25119
+ /**
25120
+ * @beta
25121
+ * Collection of key frames for camera animation.
25122
+ */
25123
+ export interface SplineAnimation {
25124
+ /**
25125
+ * @remarks
25126
+ * Key frames for camera progress along a given curve.
25127
+ *
25128
+ */
25129
+ progressKeyFrames: ProgressKeyFrame[];
25130
+ /**
25131
+ * @remarks
25132
+ * Key frames for camera rotation.
25133
+ *
25134
+ */
25135
+ rotationKeyFrames: RotationKeyFrame[];
25136
+ }
25137
+
22428
25138
  /**
22429
25139
  * Provides additional options for {@link
22430
25140
  * StructureManager.createFromWorld}
@@ -22605,6 +25315,72 @@ export interface TeleportOptions {
22605
25315
  rotation?: Vector2;
22606
25316
  }
22607
25317
 
25318
+ /**
25319
+ * @beta
25320
+ * A context which provides information about a specific
25321
+ * ticking area.
25322
+ */
25323
+ export interface TickingArea {
25324
+ /**
25325
+ * @remarks
25326
+ * The box which contains all the ticking blocks in the ticking
25327
+ * area.
25328
+ *
25329
+ */
25330
+ boundingBox: BlockBoundingBox;
25331
+ /**
25332
+ * @remarks
25333
+ * The number of chunks that the ticking area contains.
25334
+ *
25335
+ */
25336
+ chunkCount: number;
25337
+ /**
25338
+ * @remarks
25339
+ * The dimension the ticking area is located.
25340
+ *
25341
+ */
25342
+ dimension: Dimension;
25343
+ /**
25344
+ * @remarks
25345
+ * The unique identifier of the ticking area.
25346
+ *
25347
+ */
25348
+ identifier: string;
25349
+ /**
25350
+ * @remarks
25351
+ * Will be true if all the ticking areas chunks are loaded in
25352
+ * ticking and false otherwise.
25353
+ *
25354
+ */
25355
+ isFullyLoaded: boolean;
25356
+ }
25357
+
25358
+ /**
25359
+ * @beta
25360
+ * Options to create a ticking area using the {@link
25361
+ * TickingAreaManager}.
25362
+ */
25363
+ export interface TickingAreaOptions {
25364
+ /**
25365
+ * @remarks
25366
+ * The dimension the ticking area will be in.
25367
+ *
25368
+ */
25369
+ dimension: Dimension;
25370
+ /**
25371
+ * @remarks
25372
+ * Corner block location of the bounding box.
25373
+ *
25374
+ */
25375
+ from: Vector3;
25376
+ /**
25377
+ * @remarks
25378
+ * Opposite corner block location of the bounding box.
25379
+ *
25380
+ */
25381
+ to: Vector3;
25382
+ }
25383
+
22608
25384
  /**
22609
25385
  * Contains additional options for displaying a title and
22610
25386
  * optional subtitle.
@@ -23020,6 +25796,24 @@ export class RawMessageError extends Error {
23020
25796
  private constructor();
23021
25797
  }
23022
25798
 
25799
+ /**
25800
+ * @beta
25801
+ * The error returned from invalid {@link TickingAreaManager}
25802
+ * method calls.
25803
+ */
25804
+ // @ts-ignore Class inheritance allowed for native defined classes
25805
+ export class TickingAreaError extends Error {
25806
+ private constructor();
25807
+ /**
25808
+ * @remarks
25809
+ * The specific reason that the error was thrown.
25810
+ *
25811
+ * This property can be read in early-execution mode.
25812
+ *
25813
+ */
25814
+ reason: TickingAreaErrorReason;
25815
+ }
25816
+
23023
25817
  /**
23024
25818
  * Error thrown when the specified area contains one or more
23025
25819
  * unloaded chunks.