@minecraft/server 2.0.0-rc.1.21.90-preview.21 → 2.1.0-beta.1.21.80-preview.22

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 +3012 -118
  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.0.0"
19
+ * "version": "2.1.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.
@@ -122,6 +141,240 @@ export enum ButtonState {
122
141
  Released = 'Released',
123
142
  }
124
143
 
144
+ /**
145
+ * @beta
146
+ * The required permission level to execute the custom command.
147
+ */
148
+ export enum CommandPermissionLevel {
149
+ /**
150
+ * @remarks
151
+ * Anything can run this level.
152
+ *
153
+ */
154
+ Any = 0,
155
+ /**
156
+ * @remarks
157
+ * Any operator can run this command, including command blocks.
158
+ *
159
+ */
160
+ GameDirectors = 1,
161
+ /**
162
+ * @remarks
163
+ * Any operator can run this command, but NOT command blocks.
164
+ *
165
+ */
166
+ Admin = 2,
167
+ /**
168
+ * @remarks
169
+ * Any server host can run this command.
170
+ *
171
+ */
172
+ Host = 3,
173
+ /**
174
+ * @remarks
175
+ * Only dedicated server can run this command.
176
+ *
177
+ */
178
+ Owner = 4,
179
+ }
180
+
181
+ /**
182
+ * @beta
183
+ * The Action enum determines how the CompoundBlockVolume
184
+ * considers the associated CompoundBlockVolumeItem when
185
+ * performing inside/outside calculations.
186
+ */
187
+ export enum CompoundBlockVolumeAction {
188
+ /**
189
+ * @remarks
190
+ * The associated BlockVolume is considered a positive space,
191
+ * and any intersection tests are considered hits
192
+ *
193
+ */
194
+ Add = 0,
195
+ /**
196
+ * @remarks
197
+ * The associated BlockVolume is considered a negative or void
198
+ * space, and any intersection tests are considered misses.
199
+ * Using the Subtract action, it is possible to `punch holes`
200
+ * in block volumes so that any intersection tests may pass
201
+ * through such spaces
202
+ *
203
+ */
204
+ Subtract = 1,
205
+ }
206
+
207
+ /**
208
+ * @beta
209
+ * An enum describing the relativity of the
210
+ * CompoundBlockVolumeItem, relative to the parent
211
+ * CompoundVolume.
212
+ */
213
+ export enum CompoundBlockVolumePositionRelativity {
214
+ /**
215
+ * @remarks
216
+ * The locations within the associated BlockVolume are relative
217
+ * to the CompoundBlockVolume to which they were added
218
+ *
219
+ */
220
+ Relative = 0,
221
+ /**
222
+ * @remarks
223
+ * The locations within the associated BlockVolume are in
224
+ * absolute world space
225
+ *
226
+ */
227
+ Absolute = 1,
228
+ }
229
+
230
+ /**
231
+ * @beta
232
+ * Reason why custom command registration failed.
233
+ */
234
+ export enum CustomCommandErrorReason {
235
+ /**
236
+ * @remarks
237
+ * Command name already registered.
238
+ *
239
+ */
240
+ AlreadyRegistered = 'AlreadyRegistered',
241
+ /**
242
+ * @remarks
243
+ * Custom Command references an enum that has not been
244
+ * registered.
245
+ *
246
+ */
247
+ EnumDependencyMissing = 'EnumDependencyMissing',
248
+ /**
249
+ * @remarks
250
+ * Supplied Custom Command namespace does not match previous
251
+ * registrations for this add-on.
252
+ *
253
+ */
254
+ NamespaceMismatch = 'NamespaceMismatch',
255
+ /**
256
+ * @remarks
257
+ * Too many command parameters defined in CustomCommand.
258
+ *
259
+ */
260
+ ParameterLimit = 'ParameterLimit',
261
+ /**
262
+ * @remarks
263
+ * Custom command registry can not be accessed after world
264
+ * initialized event.
265
+ *
266
+ */
267
+ RegistryInvalid = 'RegistryInvalid',
268
+ /**
269
+ * @remarks
270
+ * Command parameters cannot be redefined during reload. Only
271
+ * the script closure itself can be changed.
272
+ *
273
+ */
274
+ RegistryReadOnly = 'RegistryReadOnly',
275
+ }
276
+
277
+ /**
278
+ * @beta
279
+ * The types of paramaters accepted by a custom command.
280
+ */
281
+ export enum CustomCommandParamType {
282
+ /**
283
+ * @remarks
284
+ * Command boolean parameter expecting true or false as input.
285
+ *
286
+ */
287
+ Boolean = 0,
288
+ /**
289
+ * @remarks
290
+ * Command integer parameter.
291
+ *
292
+ */
293
+ Integer = 1,
294
+ /**
295
+ * @remarks
296
+ * Command float parameter.
297
+ *
298
+ */
299
+ Float = 2,
300
+ /**
301
+ * @remarks
302
+ * Command string parameter.
303
+ *
304
+ */
305
+ String = 3,
306
+ /**
307
+ * @remarks
308
+ * Command entity selector parameter.
309
+ *
310
+ */
311
+ EntitySelector = 4,
312
+ /**
313
+ * @remarks
314
+ * Command player selector parameter.
315
+ *
316
+ */
317
+ PlayerSelector = 5,
318
+ /**
319
+ * @remarks
320
+ * Command location parameter.
321
+ *
322
+ */
323
+ Location = 6,
324
+ /**
325
+ * @remarks
326
+ * Command block type parameter expecting a Minecraft block.
327
+ *
328
+ */
329
+ BlockType = 7,
330
+ /**
331
+ * @remarks
332
+ * Command item name parameter.
333
+ *
334
+ */
335
+ ItemType = 8,
336
+ /**
337
+ * @remarks
338
+ * Command enum parameter.
339
+ *
340
+ */
341
+ Enum = 9,
342
+ }
343
+
344
+ /**
345
+ * @beta
346
+ * Who executed the command.
347
+ */
348
+ export enum CustomCommandSource {
349
+ /**
350
+ * @remarks
351
+ * Command originated from a command block.
352
+ *
353
+ */
354
+ Block = 'Block',
355
+ /**
356
+ * @remarks
357
+ * Command originated from an entity or player.
358
+ *
359
+ */
360
+ Entity = 'Entity',
361
+ NPCDialogue = 'NPCDialogue',
362
+ /**
363
+ * @remarks
364
+ * Command originated from the server.
365
+ *
366
+ */
367
+ Server = 'Server',
368
+ }
369
+
370
+ /**
371
+ * @beta
372
+ */
373
+ export enum CustomCommandStatus {
374
+ Success = 0,
375
+ Failure = 1,
376
+ }
377
+
125
378
  export enum CustomComponentNameErrorReason {
126
379
  NoNamespace = 1,
127
380
  DisallowedNamespace = 2,
@@ -731,6 +984,14 @@ export enum EntityComponentTypes {
731
984
  *
732
985
  */
733
986
  NavigationWalk = 'minecraft:navigation.walk',
987
+ /**
988
+ * @beta
989
+ * @remarks
990
+ * Adds NPC capabilities to an entity such as custom skin,
991
+ * name, and dialogue interactions.
992
+ *
993
+ */
994
+ Npc = 'minecraft:npc',
734
995
  /**
735
996
  * @remarks
736
997
  * When present on an entity, this entity is on fire.
@@ -1102,6 +1363,14 @@ export enum EntityInitializationCause {
1102
1363
  * and mainhand slots.
1103
1364
  */
1104
1365
  export enum EquipmentSlot {
1366
+ /**
1367
+ * @beta
1368
+ * @remarks
1369
+ * The body slot. This slot is used to hold armor for
1370
+ * non-humanoid mobs.
1371
+ *
1372
+ */
1373
+ Body = 'Body',
1105
1374
  /**
1106
1375
  * @remarks
1107
1376
  * The chest slot. This slot is used to hold items such as
@@ -1348,6 +1617,10 @@ export enum GameRule {
1348
1617
  *
1349
1618
  */
1350
1619
  KeepInventory = 'keepInventory',
1620
+ /**
1621
+ * @beta
1622
+ */
1623
+ LocatorBar = 'locatorBar',
1351
1624
  /**
1352
1625
  * @remarks
1353
1626
  * The maximum number of chained commands that can execute per
@@ -1719,6 +1992,10 @@ export enum ItemComponentTypes {
1719
1992
  *
1720
1993
  */
1721
1994
  Durability = 'minecraft:durability',
1995
+ /**
1996
+ * @beta
1997
+ */
1998
+ Dyeable = 'minecraft:dyeable',
1722
1999
  /**
1723
2000
  * @remarks
1724
2001
  * The minecraft:enchantable component.
@@ -1731,6 +2008,10 @@ export enum ItemComponentTypes {
1731
2008
  *
1732
2009
  */
1733
2010
  Food = 'minecraft:food',
2011
+ /**
2012
+ * @beta
2013
+ */
2014
+ Potion = 'minecraft:potion',
1734
2015
  }
1735
2016
 
1736
2017
  /**
@@ -1758,6 +2039,28 @@ export enum ItemLockMode {
1758
2039
  slot = 'slot',
1759
2040
  }
1760
2041
 
2042
+ /**
2043
+ * @beta
2044
+ * Specifies how to handle waterloggable blocks overlapping
2045
+ * with existing liquid.
2046
+ */
2047
+ export enum LiquidSettings {
2048
+ /**
2049
+ * @remarks
2050
+ * Causes a waterloggable block to become waterlogged, if it
2051
+ * overlaps with existing liquid.
2052
+ *
2053
+ */
2054
+ ApplyWaterlogging = 'ApplyWaterlogging',
2055
+ /**
2056
+ * @remarks
2057
+ * Do not waterlog any waterloggable blocks that overlap
2058
+ * existing liquid.
2059
+ *
2060
+ */
2061
+ IgnoreWaterlogging = 'IgnoreWaterlogging',
2062
+ }
2063
+
1761
2064
  /**
1762
2065
  * Represents the type of liquid that can be placed on a block
1763
2066
  * or flow dynamically in the world.
@@ -2037,6 +2340,53 @@ export enum PlatformType {
2037
2340
  Mobile = 'Mobile',
2038
2341
  }
2039
2342
 
2343
+ /**
2344
+ * @beta
2345
+ * Specifies the player inventory type.
2346
+ */
2347
+ export enum PlayerInventoryType {
2348
+ /**
2349
+ * @remarks
2350
+ * Hotbar inventory.
2351
+ *
2352
+ */
2353
+ Hotbar = 'Hotbar',
2354
+ /**
2355
+ * @remarks
2356
+ * Main inventory.
2357
+ *
2358
+ */
2359
+ Inventory = 'Inventory',
2360
+ }
2361
+
2362
+ /**
2363
+ * @beta
2364
+ * The player permission level.
2365
+ */
2366
+ export enum PlayerPermissionLevel {
2367
+ /**
2368
+ * @remarks
2369
+ * Visitors can only observe the world, not interact with it.
2370
+ *
2371
+ */
2372
+ Visitor = 0,
2373
+ /**
2374
+ * @remarks
2375
+ * Members can build and mine, attack players and mobs, and
2376
+ * interact with items and entities.
2377
+ *
2378
+ */
2379
+ Member = 1,
2380
+ /**
2381
+ * @remarks
2382
+ * Operators can teleport and use commands, in addition to
2383
+ * everything Members can do.
2384
+ *
2385
+ */
2386
+ Operator = 2,
2387
+ Custom = 3,
2388
+ }
2389
+
2040
2390
  /**
2041
2391
  * Contains objectives and participants for the scoreboard.
2042
2392
  */
@@ -2325,6 +2675,29 @@ export enum TintMethod {
2325
2675
  Water = 'Water',
2326
2676
  }
2327
2677
 
2678
+ /**
2679
+ * @beta
2680
+ * An enumeration with the reason that a watchdog is deciding
2681
+ * to terminate execution of a behavior packs' script.
2682
+ */
2683
+ export enum WatchdogTerminateReason {
2684
+ /**
2685
+ * @remarks
2686
+ * Script runtime for a behavior pack is terminated due to
2687
+ * non-responsiveness from script (a hang or infinite loop).
2688
+ *
2689
+ */
2690
+ Hang = 'Hang',
2691
+ /**
2692
+ * @remarks
2693
+ * Script runtime for a behavior pack is terminated due to a
2694
+ * stack overflow (a long, and potentially infinite) chain of
2695
+ * function calls.
2696
+ *
2697
+ */
2698
+ StackOverflow = 'StackOverflow',
2699
+ }
2700
+
2328
2701
  /**
2329
2702
  * Used to specify the type of weather condition within the
2330
2703
  * world.
@@ -2355,9 +2728,11 @@ export type BlockComponentReturnType<T extends string> = T extends keyof BlockCo
2355
2728
  : BlockCustomComponentInstance;
2356
2729
 
2357
2730
  export type BlockComponentTypeMap = {
2731
+ destruction_particles: BlockDestructionParticlesComponent;
2358
2732
  fluid_container: BlockFluidContainerComponent;
2359
2733
  inventory: BlockInventoryComponent;
2360
2734
  map_color: BlockMapColorComponent;
2735
+ 'minecraft:destruction_particles': BlockDestructionParticlesComponent;
2361
2736
  'minecraft:fluid_container': BlockFluidContainerComponent;
2362
2737
  'minecraft:inventory': BlockInventoryComponent;
2363
2738
  'minecraft:map_color': BlockMapColorComponent;
@@ -2470,6 +2845,7 @@ export type EntityComponentTypeMap = {
2470
2845
  'minecraft:navigation.generic': EntityNavigationGenericComponent;
2471
2846
  'minecraft:navigation.hover': EntityNavigationHoverComponent;
2472
2847
  'minecraft:navigation.walk': EntityNavigationWalkComponent;
2848
+ 'minecraft:npc': EntityNpcComponent;
2473
2849
  'minecraft:onfire': EntityOnFireComponent;
2474
2850
  'minecraft:projectile': EntityProjectileComponent;
2475
2851
  'minecraft:push_through': EntityPushThroughComponent;
@@ -2500,6 +2876,7 @@ export type EntityComponentTypeMap = {
2500
2876
  'navigation.generic': EntityNavigationGenericComponent;
2501
2877
  'navigation.hover': EntityNavigationHoverComponent;
2502
2878
  'navigation.walk': EntityNavigationWalkComponent;
2879
+ npc: EntityNpcComponent;
2503
2880
  onfire: EntityOnFireComponent;
2504
2881
  projectile: EntityProjectileComponent;
2505
2882
  push_through: EntityPushThroughComponent;
@@ -2516,6 +2893,15 @@ export type EntityComponentTypeMap = {
2516
2893
  wants_jockey: EntityWantsJockeyComponent;
2517
2894
  };
2518
2895
 
2896
+ /**
2897
+ * @beta
2898
+ */
2899
+ export type EntityIdentifierType<T> = [T] extends [never]
2900
+ ? VanillaEntityIdentifier
2901
+ : T extends string
2902
+ ? VanillaEntityIdentifier | T
2903
+ : never;
2904
+
2519
2905
  export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
2520
2906
  ? ItemComponentTypeMap[T]
2521
2907
  : ItemCustomComponentInstance;
@@ -2524,60 +2910,523 @@ export type ItemComponentTypeMap = {
2524
2910
  compostable: ItemCompostableComponent;
2525
2911
  cooldown: ItemCooldownComponent;
2526
2912
  durability: ItemDurabilityComponent;
2913
+ dyeable: ItemDyeableComponent;
2527
2914
  enchantable: ItemEnchantableComponent;
2528
2915
  food: ItemFoodComponent;
2529
2916
  'minecraft:compostable': ItemCompostableComponent;
2530
2917
  'minecraft:cooldown': ItemCooldownComponent;
2531
2918
  'minecraft:durability': ItemDurabilityComponent;
2919
+ 'minecraft:dyeable': ItemDyeableComponent;
2532
2920
  'minecraft:enchantable': ItemEnchantableComponent;
2533
2921
  'minecraft:food': ItemFoodComponent;
2922
+ 'minecraft:potion': ItemPotionComponent;
2923
+ potion: ItemPotionComponent;
2534
2924
  };
2535
2925
 
2536
2926
  /**
2537
- * Represents a block in a dimension. A block represents a
2538
- * unique X, Y, and Z within a dimension and get/sets the state
2539
- * of the block at that location. This type was significantly
2540
- * updated in version 1.17.10.21.
2927
+ * @beta
2541
2928
  */
2542
- export class Block {
2929
+ export type VanillaEntityIdentifier =
2930
+ | EntityType
2931
+ | minecraftvanilladata.MinecraftEntityTypes
2932
+ | `${minecraftvanilladata.MinecraftEntityTypes}`
2933
+ | `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
2934
+
2935
+ /**
2936
+ * @beta
2937
+ * Handle to an aim-assist category that exists in the
2938
+ * world.aimAssist registry.
2939
+ */
2940
+ export class AimAssistCategory {
2543
2941
  private constructor();
2544
2942
  /**
2545
2943
  * @remarks
2546
- * Returns the dimension that the block is within.
2944
+ * Default targeting priority used for block types not found in
2945
+ * getBlockPriorities.
2547
2946
  *
2947
+ * @throws This property can throw when used.
2548
2948
  */
2549
- readonly dimension: Dimension;
2949
+ readonly defaultBlockPriority: number;
2550
2950
  /**
2551
2951
  * @remarks
2552
- * Returns true if this block is an air block (i.e., empty
2553
- * space).
2952
+ * Default targeting priority used for entity types not found
2953
+ * in getEntityPriorities.
2554
2954
  *
2555
2955
  * @throws This property can throw when used.
2556
- *
2557
- * {@link LocationInUnloadedChunkError}
2558
- *
2559
- * {@link LocationOutOfWorldBoundariesError}
2560
2956
  */
2561
- readonly isAir: boolean;
2957
+ readonly defaultEntityPriority: number;
2562
2958
  /**
2563
2959
  * @remarks
2564
- * Returns true if this block is a liquid block - (e.g., a
2565
- * water block and a lava block are liquid, while an air block
2566
- * and a stone block are not. Water logged blocks are not
2567
- * liquid blocks).
2568
- *
2569
- * @throws This property can throw when used.
2570
- *
2571
- * {@link LocationInUnloadedChunkError}
2960
+ * The unique Id associated with the category.
2572
2961
  *
2573
- * {@link LocationOutOfWorldBoundariesError}
2574
2962
  */
2575
- readonly isLiquid: boolean;
2963
+ readonly identifier: string;
2576
2964
  /**
2577
- * @rc
2578
2965
  * @remarks
2579
- * Returns true if this reference to a block is still valid
2580
- * (for example, if the block is unloaded, references to that
2966
+ * Gets the priority settings used for block targeting.
2967
+ *
2968
+ * @returns
2969
+ * The record mapping block Ids to their priority settings.
2970
+ * Larger numbers have greater priority.
2971
+ * @throws This function can throw errors.
2972
+ */
2973
+ getBlockPriorities(): Record<string, number>;
2974
+ /**
2975
+ * @remarks
2976
+ * Gets the priority settings used for entity targeting.
2977
+ *
2978
+ * @returns
2979
+ * The record mapping entity Ids to their priority settings.
2980
+ * Larger numbers have greater priority.
2981
+ * @throws This function can throw errors.
2982
+ */
2983
+ getEntityPriorities(): Record<string, number>;
2984
+ }
2985
+
2986
+ /**
2987
+ * @beta
2988
+ * Settings used with AimAssistRegistry.addCategory for
2989
+ * creation of the AimAssistCategory.
2990
+ */
2991
+ export class AimAssistCategorySettings {
2992
+ /**
2993
+ * @remarks
2994
+ * Optional. Default targeting priority used for block types
2995
+ * not provided to setBlockPriorities.
2996
+ *
2997
+ * This property can't be edited in read-only mode.
2998
+ *
2999
+ */
3000
+ defaultBlockPriority: number;
3001
+ /**
3002
+ * @remarks
3003
+ * Optional. Default targeting priority used for entity types
3004
+ * not provided to setEntityPriorities.
3005
+ *
3006
+ * This property can't be edited in read-only mode.
3007
+ *
3008
+ */
3009
+ defaultEntityPriority: number;
3010
+ /**
3011
+ * @remarks
3012
+ * The unique Id used to register the category with. Must have
3013
+ * a namespace.
3014
+ *
3015
+ */
3016
+ readonly identifier: string;
3017
+ /**
3018
+ * @remarks
3019
+ * Constructor that takes a unique Id to associate with the
3020
+ * created AimAssistCategory. Must have a namespace.
3021
+ *
3022
+ */
3023
+ constructor(identifier: string);
3024
+ /**
3025
+ * @remarks
3026
+ * Gets the priority settings used for block targeting.
3027
+ *
3028
+ * @returns
3029
+ * The record mapping block Ids to their priority settings.
3030
+ * Larger numbers have greater priority.
3031
+ */
3032
+ getBlockPriorities(): Record<string, number>;
3033
+ /**
3034
+ * @remarks
3035
+ * Gets the priority settings used for entity targeting.
3036
+ *
3037
+ * @returns
3038
+ * The record mapping entity Ids to their priority settings.
3039
+ * Larger numbers have greater priority.
3040
+ */
3041
+ getEntityPriorities(): Record<string, number>;
3042
+ /**
3043
+ * @remarks
3044
+ * Sets the priority settings used for block targeting.
3045
+ *
3046
+ * This function can't be called in read-only mode.
3047
+ *
3048
+ * @param blockPriorities
3049
+ * A record mapping block Ids to their priority settings.
3050
+ * Larger numbers have greater priority.
3051
+ */
3052
+ setBlockPriorities(
3053
+ blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
3054
+ ): void;
3055
+ /**
3056
+ * @remarks
3057
+ * Sets the priority settings used for entity targeting.
3058
+ *
3059
+ * This function can't be called in read-only mode.
3060
+ *
3061
+ * @param entityPriorities
3062
+ * A record mapping entity Ids to their priority settings.
3063
+ * Larger numbers have greater priority.
3064
+ */
3065
+ setEntityPriorities(
3066
+ entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
3067
+ ): void;
3068
+ }
3069
+
3070
+ /**
3071
+ * @beta
3072
+ * Handle to an aim-assist preset that exists in the
3073
+ * world.aimAssist registry.
3074
+ */
3075
+ export class AimAssistPreset {
3076
+ private constructor();
3077
+ /**
3078
+ * @remarks
3079
+ * Optional. Default aim-assist category Id used for items not
3080
+ * provided to setItemSettings.
3081
+ *
3082
+ * @throws This property can throw when used.
3083
+ */
3084
+ readonly defaultItemSettings?: string;
3085
+ /**
3086
+ * @remarks
3087
+ * Optional. Aim-assist category Id used for an empty hand.
3088
+ *
3089
+ * @throws This property can throw when used.
3090
+ */
3091
+ readonly handSettings?: string;
3092
+ /**
3093
+ * @remarks
3094
+ * The unique Id associated with the preset.
3095
+ *
3096
+ */
3097
+ readonly identifier: string;
3098
+ /**
3099
+ * @remarks
3100
+ * Gets the list of block/entity Ids to exclude from aim assist
3101
+ * targeting.
3102
+ *
3103
+ * @returns
3104
+ * The array of block/entity Ids.
3105
+ * @throws This function can throw errors.
3106
+ */
3107
+ getExcludedTargets(): string[];
3108
+ /**
3109
+ * @remarks
3110
+ * Gets the per-item aim-assist category Ids.
3111
+ *
3112
+ * @returns
3113
+ * The record mapping item Ids to aim-assist category Ids.
3114
+ * @throws This function can throw errors.
3115
+ */
3116
+ getItemSettings(): Record<string, string>;
3117
+ /**
3118
+ * @remarks
3119
+ * Gets the list of item Ids that will target liquid blocks
3120
+ * with aim-assist when being held.
3121
+ *
3122
+ * @returns
3123
+ * The array of item Ids.
3124
+ * @throws This function can throw errors.
3125
+ */
3126
+ getLiquidTargetingItems(): string[];
3127
+ }
3128
+
3129
+ /**
3130
+ * @beta
3131
+ * Settings used with AimAssistRegistry.addPreset for creation
3132
+ * of the AimAssistPreset.
3133
+ */
3134
+ export class AimAssistPresetSettings {
3135
+ /**
3136
+ * @remarks
3137
+ * Optional. Default aim-assist category Id used for items not
3138
+ * provided to setItemSettings.
3139
+ *
3140
+ * This property can't be edited in read-only mode.
3141
+ *
3142
+ */
3143
+ defaultItemSettings?: string;
3144
+ /**
3145
+ * @remarks
3146
+ * Optional. Aim-assist category Id used for an empty hand.
3147
+ *
3148
+ * This property can't be edited in read-only mode.
3149
+ *
3150
+ */
3151
+ handSettings?: string;
3152
+ /**
3153
+ * @remarks
3154
+ * The unique Id used to register the preset with. Must have a
3155
+ * namespace.
3156
+ *
3157
+ */
3158
+ readonly identifier: string;
3159
+ /**
3160
+ * @remarks
3161
+ * Constructor that takes a unique Id to associate with the
3162
+ * created AimAssistPreset. Must have a namespace.
3163
+ *
3164
+ */
3165
+ constructor(identifier: string);
3166
+ /**
3167
+ * @remarks
3168
+ * Gets the list of block/entity Ids to exclude from aim assist
3169
+ * targeting.
3170
+ *
3171
+ * @returns
3172
+ * The array of block/entity Ids.
3173
+ */
3174
+ getExcludedTargets(): string[] | undefined;
3175
+ /**
3176
+ * @remarks
3177
+ * Gets the per-item aim-assist category Ids.
3178
+ *
3179
+ * @returns
3180
+ * The record mapping item Ids to aim-assist category Ids.
3181
+ */
3182
+ getItemSettings(): Record<string, string>;
3183
+ /**
3184
+ * @remarks
3185
+ * Gets the list of item Ids that will target liquid blocks
3186
+ * with aim-assist when being held.
3187
+ *
3188
+ * @returns
3189
+ * The array of item Ids.
3190
+ */
3191
+ getLiquidTargetingItems(): string[] | undefined;
3192
+ /**
3193
+ * @remarks
3194
+ * Sets the list of block/entity Ids to exclude from aim assist
3195
+ * targeting.
3196
+ *
3197
+ * This function can't be called in read-only mode.
3198
+ *
3199
+ * @param targets
3200
+ * An array of block/entity Ids.
3201
+ */
3202
+ setExcludedTargets(
3203
+ targets?: (
3204
+ | keyof typeof minecraftvanilladata.MinecraftBlockTypes
3205
+ | keyof typeof minecraftvanilladata.MinecraftEntityTypes
3206
+ | string
3207
+ )[],
3208
+ ): void;
3209
+ /**
3210
+ * @remarks
3211
+ * Sets the per-item aim-assist category Ids.
3212
+ *
3213
+ * This function can't be called in read-only mode.
3214
+ *
3215
+ * @param itemSettings
3216
+ * A record mapping item Ids to aim-assist category Ids.
3217
+ * Category Ids must have a namespace.
3218
+ */
3219
+ setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
3220
+ /**
3221
+ * @remarks
3222
+ * Sets the list of item Ids that will target liquid blocks
3223
+ * with aim-assist when being held.
3224
+ *
3225
+ * This function can't be called in read-only mode.
3226
+ *
3227
+ * @param items
3228
+ * An array of item Ids.
3229
+ */
3230
+ setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
3231
+ }
3232
+
3233
+ /**
3234
+ * @beta
3235
+ * A container for APIs related to the world's aim-assist
3236
+ * settings.
3237
+ */
3238
+ export class AimAssistRegistry {
3239
+ private constructor();
3240
+ /**
3241
+ * @remarks
3242
+ * The default aim-assist preset Id that is used when not
3243
+ * otherwise specified.
3244
+ *
3245
+ */
3246
+ static readonly DefaultPresetId = 'minecraft:aim_assist_default';
3247
+ /**
3248
+ * @remarks
3249
+ * Adds an aim-assist category to the registry.
3250
+ *
3251
+ * This function can't be called in read-only mode.
3252
+ *
3253
+ * @param category
3254
+ * The category settings used to create the new category.
3255
+ * @returns
3256
+ * The created category handle.
3257
+ * @throws This function can throw errors.
3258
+ *
3259
+ * {@link minecraftcommon.EngineError}
3260
+ *
3261
+ * {@link Error}
3262
+ *
3263
+ * {@link minecraftcommon.InvalidArgumentError}
3264
+ *
3265
+ * {@link NamespaceNameError}
3266
+ */
3267
+ addCategory(category: AimAssistCategorySettings): AimAssistCategory;
3268
+ /**
3269
+ * @remarks
3270
+ * Adds an aim-assist preset to the registry.
3271
+ *
3272
+ * This function can't be called in read-only mode.
3273
+ *
3274
+ * @param preset
3275
+ * The preset settings used to create the new preset.
3276
+ * @returns
3277
+ * The created preset handle.
3278
+ * @throws This function can throw errors.
3279
+ *
3280
+ * {@link minecraftcommon.EngineError}
3281
+ *
3282
+ * {@link Error}
3283
+ *
3284
+ * {@link minecraftcommon.InvalidArgumentError}
3285
+ *
3286
+ * {@link NamespaceNameError}
3287
+ */
3288
+ addPreset(preset: AimAssistPresetSettings): AimAssistPreset;
3289
+ /**
3290
+ * @remarks
3291
+ * Gets all available categories in the registry.
3292
+ *
3293
+ * @returns
3294
+ * An array of all available category objects.
3295
+ */
3296
+ getCategories(): AimAssistCategory[];
3297
+ /**
3298
+ * @remarks
3299
+ * Gets the category associated with the provided Id.
3300
+ *
3301
+ * This function can't be called in read-only mode.
3302
+ *
3303
+ * @returns
3304
+ * The category object if it exists, otherwise returns
3305
+ * undefined.
3306
+ */
3307
+ getCategory(categoryId: string): AimAssistCategory | undefined;
3308
+ /**
3309
+ * @remarks
3310
+ * Gets the preset associated with the provided Id.
3311
+ *
3312
+ * This function can't be called in read-only mode.
3313
+ *
3314
+ * @param presetId
3315
+ * The Id of the preset to retrieve. Must have a namespace.
3316
+ * @returns
3317
+ * The preset object if it exists, otherwise returns undefined.
3318
+ */
3319
+ getPreset(presetId: string): AimAssistPreset | undefined;
3320
+ /**
3321
+ * @remarks
3322
+ * Gets all available presets in the registry.
3323
+ *
3324
+ * @returns
3325
+ * An array of all available preset objects.
3326
+ */
3327
+ getPresets(): AimAssistPreset[];
3328
+ }
3329
+
3330
+ /**
3331
+ * @beta
3332
+ * Describes a type of biome.
3333
+ */
3334
+ export class BiomeType {
3335
+ private constructor();
3336
+ /**
3337
+ * @remarks
3338
+ * Identifier of the biome type.
3339
+ *
3340
+ */
3341
+ readonly id: string;
3342
+ }
3343
+
3344
+ /**
3345
+ * @beta
3346
+ * Supports a catalog of available biome types registered
3347
+ * within Minecraft.
3348
+ */
3349
+ export class BiomeTypes {
3350
+ private constructor();
3351
+ /**
3352
+ * @remarks
3353
+ * Returns a specific biome type.
3354
+ *
3355
+ * @param typeName
3356
+ * Identifier of the biome. Generally, namespaced identifiers
3357
+ * (e.g., minecraft:frozen_peaks) should be used.
3358
+ * @returns
3359
+ * If the biome exists, a BiomeType object is returned. If not,
3360
+ * undefined is returned.
3361
+ */
3362
+ static get(typeName: string): BiomeType | undefined;
3363
+ /**
3364
+ * @remarks
3365
+ * Returns all registered biome types within Minecraft
3366
+ *
3367
+ */
3368
+ static getAll(): BiomeType[];
3369
+ }
3370
+
3371
+ /**
3372
+ * Represents a block in a dimension. A block represents a
3373
+ * unique X, Y, and Z within a dimension and get/sets the state
3374
+ * of the block at that location. This type was significantly
3375
+ * updated in version 1.17.10.21.
3376
+ */
3377
+ export class Block {
3378
+ private constructor();
3379
+ /**
3380
+ * @remarks
3381
+ * Returns the dimension that the block is within.
3382
+ *
3383
+ */
3384
+ readonly dimension: Dimension;
3385
+ /**
3386
+ * @remarks
3387
+ * Returns true if this block is an air block (i.e., empty
3388
+ * space).
3389
+ *
3390
+ * @throws This property can throw when used.
3391
+ *
3392
+ * {@link LocationInUnloadedChunkError}
3393
+ *
3394
+ * {@link LocationOutOfWorldBoundariesError}
3395
+ */
3396
+ readonly isAir: boolean;
3397
+ /**
3398
+ * @remarks
3399
+ * Returns true if this block is a liquid block - (e.g., a
3400
+ * water block and a lava block are liquid, while an air block
3401
+ * and a stone block are not. Water logged blocks are not
3402
+ * liquid blocks).
3403
+ *
3404
+ * @throws This property can throw when used.
3405
+ *
3406
+ * {@link LocationInUnloadedChunkError}
3407
+ *
3408
+ * {@link LocationOutOfWorldBoundariesError}
3409
+ */
3410
+ readonly isLiquid: boolean;
3411
+ /**
3412
+ * @beta
3413
+ * @remarks
3414
+ * Returns true if this block is solid and impassible - (e.g.,
3415
+ * a cobblestone block and a diamond block are solid, while a
3416
+ * ladder block and a fence block are not).
3417
+ *
3418
+ * @throws This property can throw when used.
3419
+ *
3420
+ * {@link LocationInUnloadedChunkError}
3421
+ *
3422
+ * {@link LocationOutOfWorldBoundariesError}
3423
+ */
3424
+ readonly isSolid: boolean;
3425
+ /**
3426
+ * @rc
3427
+ * @remarks
3428
+ * Returns true if this reference to a block is still valid
3429
+ * (for example, if the block is unloaded, references to that
2581
3430
  * block will no longer be valid.)
2582
3431
  *
2583
3432
  */
@@ -2593,6 +3442,19 @@ export class Block {
2593
3442
  * {@link LocationOutOfWorldBoundariesError}
2594
3443
  */
2595
3444
  readonly isWaterlogged: boolean;
3445
+ /**
3446
+ * @beta
3447
+ * @remarks
3448
+ * key for the localization of this block's name used in .lang
3449
+ * files.
3450
+ *
3451
+ * @throws This property can throw when used.
3452
+ *
3453
+ * {@link LocationInUnloadedChunkError}
3454
+ *
3455
+ * {@link LocationOutOfWorldBoundariesError}
3456
+ */
3457
+ readonly localizationKey: string;
2596
3458
  /**
2597
3459
  * @remarks
2598
3460
  * Coordinates of the specified block.
@@ -2727,6 +3589,30 @@ export class Block {
2727
3589
  * {@link LocationOutOfWorldBoundariesError}
2728
3590
  */
2729
3591
  canContainLiquid(liquidType: LiquidType): boolean;
3592
+ /**
3593
+ * @beta
3594
+ * @remarks
3595
+ * Checks to see whether it is valid to place the specified
3596
+ * block type or block permutation, on a specified face on this
3597
+ * block.
3598
+ *
3599
+ * @param blockToPlace
3600
+ * Block type or block permutation to check placement for.
3601
+ * @param faceToPlaceOn
3602
+ * Optional specific face of this block to check placement
3603
+ * against.
3604
+ * @returns
3605
+ * Returns `true` if the block type or permutation can be
3606
+ * placed on this block, else `false`.
3607
+ * @throws This function can throw errors.
3608
+ *
3609
+ * {@link Error}
3610
+ *
3611
+ * {@link LocationInUnloadedChunkError}
3612
+ *
3613
+ * {@link LocationOutOfWorldBoundariesError}
3614
+ */
3615
+ canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
2730
3616
  /**
2731
3617
  * @remarks
2732
3618
  * Returns the {@link Vector3} of the center of this block on
@@ -2794,6 +3680,15 @@ export class Block {
2794
3680
  * {@link LocationOutOfWorldBoundariesError}
2795
3681
  */
2796
3682
  getItemStack(amount?: number, withData?: boolean): ItemStack | undefined;
3683
+ /**
3684
+ * @beta
3685
+ * @throws This function can throw errors.
3686
+ *
3687
+ * {@link LocationInUnloadedChunkError}
3688
+ *
3689
+ * {@link LocationOutOfWorldBoundariesError}
3690
+ */
3691
+ getMapColor(): RGBA;
2797
3692
  /**
2798
3693
  * @remarks
2799
3694
  * Returns the net redstone power of this block.
@@ -3029,6 +3924,27 @@ export class Block {
3029
3924
  * {@link LocationOutOfWorldBoundariesError}
3030
3925
  */
3031
3926
  south(steps?: number): Block | undefined;
3927
+ /**
3928
+ * @beta
3929
+ * @remarks
3930
+ * Tries to set the block in the dimension to the state of the
3931
+ * permutation by first checking if the placement is valid.
3932
+ *
3933
+ * This function can't be called in read-only mode.
3934
+ *
3935
+ * @param permutation
3936
+ * Permutation that contains a set of property states for the
3937
+ * Block.
3938
+ * @returns
3939
+ * Returns `true` if the block permutation data was
3940
+ * successfully set, else `false`.
3941
+ * @throws This function can throw errors.
3942
+ *
3943
+ * {@link LocationInUnloadedChunkError}
3944
+ *
3945
+ * {@link LocationOutOfWorldBoundariesError}
3946
+ */
3947
+ trySetPermutation(permutation: BlockPermutation): boolean;
3032
3948
  /**
3033
3949
  * @remarks
3034
3950
  * Returns the {@link Block} to the west of this block
@@ -3046,6 +3962,137 @@ export class Block {
3046
3962
  west(steps?: number): Block | undefined;
3047
3963
  }
3048
3964
 
3965
+ /**
3966
+ * @beta
3967
+ * Bounding Box Utils is a utility class that provides a number
3968
+ * of useful functions for the creation and utility of {@link
3969
+ * BlockBoundingBox} objects
3970
+ */
3971
+ export class BlockBoundingBoxUtils {
3972
+ private constructor();
3973
+ /**
3974
+ * @remarks
3975
+ * Create a validated instance of a {@link BlockBoundingBox}
3976
+ * where the min and max components are guaranteed to be (min
3977
+ * <= max)
3978
+ *
3979
+ * This function can't be called in read-only mode.
3980
+ *
3981
+ * @param min
3982
+ * A corner world location
3983
+ * @param max
3984
+ * A corner world location diametrically opposite
3985
+ */
3986
+ static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
3987
+ /**
3988
+ * @remarks
3989
+ * Expand a {@link BlockBoundingBox} by a given amount along
3990
+ * each axis.
3991
+ * Sizes can be negative to perform contraction.
3992
+ * Note: corners can be inverted if the contraction size is
3993
+ * greater than the span, but the min/max relationship will
3994
+ * remain correct
3995
+ *
3996
+ * This function can't be called in read-only mode.
3997
+ *
3998
+ * @returns
3999
+ * Return a new {@link BlockBoundingBox} object representing
4000
+ * the changes
4001
+ */
4002
+ static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
4003
+ /**
4004
+ * @remarks
4005
+ * Check if two {@link BlockBoundingBox} objects are identical
4006
+ *
4007
+ * This function can't be called in read-only mode.
4008
+ *
4009
+ */
4010
+ static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4011
+ /**
4012
+ * @remarks
4013
+ * Expand the initial box object bounds to include the 2nd box
4014
+ * argument. The resultant {@link BlockBoundingBox} object
4015
+ * will be a BlockBoundingBox which exactly encompasses the two
4016
+ * boxes.
4017
+ *
4018
+ * This function can't be called in read-only mode.
4019
+ *
4020
+ * @returns
4021
+ * A new {@link BlockBoundingBox} instance representing the
4022
+ * smallest possible bounding box which can encompass both
4023
+ */
4024
+ static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
4025
+ /**
4026
+ * @remarks
4027
+ * Calculate the center block of a given {@link
4028
+ * BlockBoundingBox} object.
4029
+ *
4030
+ * This function can't be called in read-only mode.
4031
+ *
4032
+ * @returns
4033
+ * Note that {@link BlockBoundingBox} objects represent whole
4034
+ * blocks, so the center of boxes which have odd numbered
4035
+ * bounds are not mathematically centered...
4036
+ * i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
4037
+ * center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
4038
+ */
4039
+ static getCenter(box: BlockBoundingBox): Vector3;
4040
+ /**
4041
+ * @remarks
4042
+ * Calculate the BlockBoundingBox which represents the union
4043
+ * area of two intersecting BlockBoundingBoxes
4044
+ *
4045
+ * This function can't be called in read-only mode.
4046
+ *
4047
+ */
4048
+ static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
4049
+ /**
4050
+ * @remarks
4051
+ * Get the Span of each of the BlockBoundingBox Axis components
4052
+ *
4053
+ * This function can't be called in read-only mode.
4054
+ *
4055
+ */
4056
+ static getSpan(box: BlockBoundingBox): Vector3;
4057
+ /**
4058
+ * @remarks
4059
+ * Check to see if two BlockBoundingBox objects intersect
4060
+ *
4061
+ * This function can't be called in read-only mode.
4062
+ *
4063
+ */
4064
+ static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
4065
+ /**
4066
+ * @remarks
4067
+ * Check to see if a given coordinate is inside a
4068
+ * BlockBoundingBox
4069
+ *
4070
+ * This function can't be called in read-only mode.
4071
+ *
4072
+ */
4073
+ static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
4074
+ /**
4075
+ * @remarks
4076
+ * Check to see if a BlockBoundingBox is valid (i.e. (min <=
4077
+ * max))
4078
+ *
4079
+ * This function can't be called in read-only mode.
4080
+ *
4081
+ */
4082
+ static isValid(box: BlockBoundingBox): boolean;
4083
+ /**
4084
+ * @remarks
4085
+ * Move a BlockBoundingBox by a given amount
4086
+ *
4087
+ * This function can't be called in read-only mode.
4088
+ *
4089
+ * @returns
4090
+ * Return a new BlockBoundingBox object which represents the
4091
+ * change
4092
+ */
4093
+ static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
4094
+ }
4095
+
3049
4096
  /**
3050
4097
  * Base type for components associated with blocks.
3051
4098
  */
@@ -3264,6 +4311,31 @@ export class BlockCustomComponentInstance extends BlockComponent {
3264
4311
  readonly customComponentParameters: CustomComponentParameters;
3265
4312
  }
3266
4313
 
4314
+ /**
4315
+ * @beta
4316
+ * Represents the particles that appear when the block is
4317
+ * destroyed.
4318
+ */
4319
+ // @ts-ignore Class inheritance allowed for native defined classes
4320
+ export class BlockDestructionParticlesComponent extends BlockComponent {
4321
+ private constructor();
4322
+ /**
4323
+ * @remarks
4324
+ * Name of the texture used for the particles.
4325
+ *
4326
+ * @throws This property can throw when used.
4327
+ */
4328
+ readonly texture: string;
4329
+ /**
4330
+ * @remarks
4331
+ * Type of tint applied to the particles.
4332
+ *
4333
+ * @throws This property can throw when used.
4334
+ */
4335
+ readonly tintMethod: TintMethod;
4336
+ static readonly componentId = 'minecraft:destruction_particles';
4337
+ }
4338
+
3267
4339
  /**
3268
4340
  * Contains information regarding an event that impacts a
3269
4341
  * specific block.
@@ -3473,6 +4545,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
3473
4545
  *
3474
4546
  */
3475
4547
  [Symbol.iterator](): Iterator<Vector3>;
4548
+ /**
4549
+ * @beta
4550
+ * @remarks
4551
+ * Checks if the underlining block volume has been invalidated.
4552
+ * Will return false if the block volume was modified between
4553
+ * creating the iterator and iterating it, and true otherwise.
4554
+ *
4555
+ * @throws This function can throw errors.
4556
+ *
4557
+ * {@link minecraftcommon.EngineError}
4558
+ */
4559
+ isValid(): boolean;
3476
4560
  /**
3477
4561
  * @remarks
3478
4562
  * This function can't be called in read-only mode.
@@ -4249,7 +5333,16 @@ export class BlockVolumeBase {
4249
5333
  * the block world locations within the specified volume
4250
5334
  *
4251
5335
  */
4252
- getBlockLocationIterator(): BlockLocationIterator;
5336
+ getBlockLocationIterator(): BlockLocationIterator;
5337
+ /**
5338
+ * @beta
5339
+ * @remarks
5340
+ * Return a {@link BlockBoundingBox} object which represents
5341
+ * the validated min and max coordinates of the volume
5342
+ *
5343
+ * @throws This function can throw errors.
5344
+ */
5345
+ getBoundingBox(): BlockBoundingBox;
4253
5346
  /**
4254
5347
  * @remarks
4255
5348
  * Return the capacity (volume) of the BlockVolume (W*D*H)
@@ -4417,112 +5510,516 @@ export class Camera {
4417
5510
  * Camera is loaded and valid itself.
4418
5511
  *
4419
5512
  */
4420
- readonly isValid: boolean;
5513
+ readonly isValid: boolean;
5514
+ /**
5515
+ * @remarks
5516
+ * Clears the active camera for the specified player. Causes
5517
+ * the specified players to end any in-progress camera
5518
+ * perspectives, including any eased camera motions, and return
5519
+ * to their normal perspective.
5520
+ *
5521
+ * This function can't be called in read-only mode.
5522
+ *
5523
+ * @throws This function can throw errors.
5524
+ */
5525
+ clear(): void;
5526
+ /**
5527
+ * @remarks
5528
+ * Begins a camera fade transition. A fade transition is a
5529
+ * full-screen color that fades-in, holds, and then fades-out.
5530
+ *
5531
+ * This function can't be called in read-only mode.
5532
+ *
5533
+ * @param fadeCameraOptions
5534
+ * Additional options around camera fade operations.
5535
+ * @throws This function can throw errors.
5536
+ */
5537
+ fade(fadeCameraOptions?: CameraFadeOptions): void;
5538
+ /**
5539
+ * @remarks
5540
+ * Sets the current active camera for the specified player.
5541
+ *
5542
+ * This function can't be called in read-only mode.
5543
+ *
5544
+ * @param cameraPreset
5545
+ * Identifier of a camera preset file defined within JSON.
5546
+ * @param setOptions
5547
+ * Additional options for the camera.
5548
+ * @throws This function can throw errors.
5549
+ */
5550
+ setCamera(
5551
+ cameraPreset: string,
5552
+ setOptions?:
5553
+ | CameraDefaultOptions
5554
+ | CameraFixedBoomOptions
5555
+ | CameraSetFacingOptions
5556
+ | CameraSetLocationOptions
5557
+ | CameraSetPosOptions
5558
+ | CameraSetRotOptions
5559
+ | CameraTargetOptions,
5560
+ ): void;
5561
+ }
5562
+
5563
+ /**
5564
+ * @beta
5565
+ * An event that fires as players enter chat messages.
5566
+ */
5567
+ export class ChatSendAfterEvent {
5568
+ private constructor();
5569
+ /**
5570
+ * @remarks
5571
+ * Message that is being broadcast.
5572
+ *
5573
+ */
5574
+ readonly message: string;
5575
+ /**
5576
+ * @remarks
5577
+ * Player that sent the chat message.
5578
+ *
5579
+ */
5580
+ readonly sender: Player;
5581
+ /**
5582
+ * @remarks
5583
+ * Optional list of players that will receive this message. If
5584
+ * defined, this message is directly targeted to one or more
5585
+ * players (i.e., is not broadcast.)
5586
+ *
5587
+ */
5588
+ readonly targets?: Player[];
5589
+ }
5590
+
5591
+ /**
5592
+ * @beta
5593
+ * Manages callbacks that are connected to chat messages being
5594
+ * sent.
5595
+ */
5596
+ export class ChatSendAfterEventSignal {
5597
+ private constructor();
5598
+ /**
5599
+ * @remarks
5600
+ * Adds a callback that will be called when new chat messages
5601
+ * are sent.
5602
+ *
5603
+ * This function can't be called in read-only mode.
5604
+ *
5605
+ * This function can be called in early-execution mode.
5606
+ *
5607
+ */
5608
+ subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
5609
+ /**
5610
+ * @remarks
5611
+ * Removes a callback from being called when new chat messages
5612
+ * are sent.
5613
+ *
5614
+ * This function can't be called in read-only mode.
5615
+ *
5616
+ * This function can be called in early-execution mode.
5617
+ *
5618
+ */
5619
+ unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
5620
+ }
5621
+
5622
+ /**
5623
+ * @beta
5624
+ * An event that fires as players enter chat messages.
5625
+ */
5626
+ export class ChatSendBeforeEvent {
5627
+ private constructor();
5628
+ /**
5629
+ * @remarks
5630
+ * If set to true in a beforeChat event handler, this message
5631
+ * is not broadcast out.
5632
+ *
5633
+ */
5634
+ cancel: boolean;
5635
+ /**
5636
+ * @remarks
5637
+ * Message that is being broadcast.
5638
+ *
5639
+ */
5640
+ readonly message: string;
5641
+ /**
5642
+ * @remarks
5643
+ * Player that sent the chat message.
5644
+ *
5645
+ */
5646
+ readonly sender: Player;
5647
+ /**
5648
+ * @remarks
5649
+ * Optional list of players that will receive this message. If
5650
+ * defined, this message is directly targeted to one or more
5651
+ * players (i.e., is not broadcast.)
5652
+ *
5653
+ */
5654
+ readonly targets?: Player[];
5655
+ }
5656
+
5657
+ /**
5658
+ * @beta
5659
+ * Manages callbacks that are connected to an event that fires
5660
+ * before chat messages are sent.
5661
+ * @example customCommand.ts
5662
+ * ```typescript
5663
+ * import { world, DimensionLocation } from "@minecraft/server";
5664
+ *
5665
+ * function customCommand(targetLocation: DimensionLocation) {
5666
+ * const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
5667
+ * if (eventData.message.includes("cancel")) {
5668
+ * // Cancel event if the message contains "cancel"
5669
+ * eventData.cancel = true;
5670
+ * } else {
5671
+ * const args = eventData.message.split(" ");
5672
+ *
5673
+ * if (args.length > 0) {
5674
+ * switch (args[0].toLowerCase()) {
5675
+ * case "echo":
5676
+ * // Send a modified version of chat message
5677
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
5678
+ * break;
5679
+ * case "help":
5680
+ * world.sendMessage(`Available commands: echo <message>`);
5681
+ * break;
5682
+ * }
5683
+ * }
5684
+ * }
5685
+ * });
5686
+ * }
5687
+ * ```
5688
+ */
5689
+ export class ChatSendBeforeEventSignal {
5690
+ private constructor();
5691
+ /**
5692
+ * @remarks
5693
+ * Adds a callback that will be called before new chat messages
5694
+ * are sent.
5695
+ *
5696
+ * This function can't be called in read-only mode.
5697
+ *
5698
+ * This function can be called in early-execution mode.
5699
+ *
5700
+ */
5701
+ subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
5702
+ /**
5703
+ * @remarks
5704
+ * Removes a callback from being called before new chat
5705
+ * messages are sent.
5706
+ *
5707
+ * This function can't be called in read-only mode.
5708
+ *
5709
+ * This function can be called in early-execution mode.
5710
+ *
5711
+ */
5712
+ unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
5713
+ }
5714
+
5715
+ /**
5716
+ * Contains the device information for a client instance.
5717
+ */
5718
+ // @ts-ignore Class inheritance allowed for native defined classes
5719
+ export class ClientSystemInfo extends SystemInfo {
5720
+ private constructor();
5721
+ /**
5722
+ * @remarks
5723
+ * The max render distance for the device in chunks.
5724
+ *
5725
+ */
5726
+ readonly maxRenderDistance: number;
5727
+ /**
5728
+ * @remarks
5729
+ * The platform type of the device.
5730
+ *
5731
+ */
5732
+ readonly platformType: PlatformType;
5733
+ }
5734
+
5735
+ /**
5736
+ * Contains return data on the result of a command execution.
5737
+ */
5738
+ export class CommandResult {
5739
+ private constructor();
5740
+ /**
5741
+ * @remarks
5742
+ * If the command operates against a number of entities,
5743
+ * blocks, or items, this returns the number of successful
5744
+ * applications of this command.
5745
+ *
5746
+ */
5747
+ readonly successCount: number;
5748
+ }
5749
+
5750
+ /**
5751
+ * Base class for downstream Component implementations.
5752
+ */
5753
+ export class Component {
5754
+ private constructor();
5755
+ /**
5756
+ * @rc
5757
+ * @remarks
5758
+ * Returns whether the component is valid. A component is
5759
+ * considered valid if its owner is valid, in addition to any
5760
+ * addition to any additional validation required by the
5761
+ * component.
5762
+ *
5763
+ */
5764
+ readonly isValid: boolean;
5765
+ /**
5766
+ * @remarks
5767
+ * Identifier of the component.
5768
+ *
5769
+ */
5770
+ readonly typeId: string;
5771
+ }
5772
+
5773
+ /**
5774
+ * @beta
5775
+ * The Compound Block Volume is a collection of individual
5776
+ * block volume definitions which, as a collection, define a
5777
+ * larger volume of (sometimes non-contiguous) irregular
5778
+ * shapes.
5779
+ * This class is loosely based on the concept of CSG
5780
+ * (Computational Solid Geometry) and allows a user to create
5781
+ * complex volumes by building a stack of volumes and voids to
5782
+ * make a larger single volume.
5783
+ * For example - normally a creator would create a hollow cube
5784
+ * by creating 6 "wall" surfaces for each face.
5785
+ * With a Compound Block Volume, a creator can define a hollow
5786
+ * cube by creating a single outer solid cube, and then
5787
+ * defining a further single 'void' cube inside the larger one.
5788
+ * Similarly, the Compound Block Volume can represent irregular
5789
+ * shaped volumes (e.g. a tree consists of a trunk and lots of
5790
+ * leaf cubes which are not necessarily contiguously placed).
5791
+ * Each of the volumes added to the CompoundBlockVolume are (by
5792
+ * default) relative to the origin set (either at construction
5793
+ * or via one of the set functions).
5794
+ * However, it is also possible to push volumes to the compound
5795
+ * collection which are absolute in nature and are not affected
5796
+ * by origin changes.
5797
+ */
5798
+ export class CompoundBlockVolume {
5799
+ /**
5800
+ * @remarks
5801
+ * Return the 'capacity' of the bounding rectangle which
5802
+ * represents the collection of volumes in the stack
5803
+ *
5804
+ */
5805
+ readonly capacity: number;
5806
+ readonly items: CompoundBlockVolumeItem[];
5807
+ readonly itemsAbsolute: CompoundBlockVolumeItem[];
5808
+ /**
5809
+ * @remarks
5810
+ * Return the number of volumes (positive and negative) in the
5811
+ * volume stack
5812
+ *
5813
+ */
5814
+ readonly volumeCount: number;
5815
+ /**
5816
+ * @remarks
5817
+ * Create a CompoundBlockVolume object
5818
+ *
5819
+ * @param origin
5820
+ * An optional world space origin on which to center the
5821
+ * compound volume.
5822
+ * If not specified, the origin is set to (0,0,0)
5823
+ */
5824
+ constructor(origin?: Vector3);
5825
+ /**
5826
+ * @remarks
5827
+ * Clear the contents of the volume stack
5828
+ *
5829
+ * This function can't be called in read-only mode.
5830
+ *
5831
+ */
5832
+ clear(): void;
5833
+ /**
5834
+ * @remarks
5835
+ * Fetch a Block Location Iterator for the Compound Block
5836
+ * Volume. This iterator will allow a creator to iterate
5837
+ * across all of the selected volumes within the larger
5838
+ * bounding area.
5839
+ * Areas of a volume which have been overridden by a
5840
+ * subtractive volume will not be included in the iterator
5841
+ * step.
5842
+ * (i.e. if you push a cube to the stack, and then push a
5843
+ * subtractive volume to the same location, then the iterator
5844
+ * will step over the initial volume because it is considered
5845
+ * negative space)
5846
+ * Note that the Block Locations returned by this iterator are
5847
+ * in absolute world space (irrespective of whether the
5848
+ * compound volume items pushed are absolute or relative)
5849
+ *
5850
+ * This function can't be called in read-only mode.
5851
+ *
5852
+ */
5853
+ getBlockLocationIterator(): BlockLocationIterator;
5854
+ /**
5855
+ * @remarks
5856
+ * Get the largest bounding box that represents a container for
5857
+ * all of the volumes on the stack
5858
+ * Note that the bounding box returned is represented in
5859
+ * absolute world space (irrespective of whether the compound
5860
+ * volume items pushed are absolute or relative)
5861
+ *
5862
+ * This function can't be called in read-only mode.
5863
+ *
5864
+ */
5865
+ getBoundingBox(): BlockBoundingBox;
5866
+ /**
5867
+ * @remarks
5868
+ * Get the max block location of the outermost bounding
5869
+ * rectangle which represents the volumes on the stack.
5870
+ * Note that the max location returned is in absolute world
5871
+ * space (irrespective of whether the compound volume items
5872
+ * pushed are absolute or relative)
5873
+ *
5874
+ * This function can't be called in read-only mode.
5875
+ *
5876
+ */
5877
+ getMax(): Vector3;
5878
+ /**
5879
+ * @remarks
5880
+ * Get the min block location of the outermost bounding
5881
+ * rectangle which represents the volumes on the stack.
5882
+ * Note that the min location returned is in absolute world
5883
+ * space (irrespective of whether the compound volume items
5884
+ * pushed are absolute or relative)
5885
+ *
5886
+ * This function can't be called in read-only mode.
5887
+ *
5888
+ */
5889
+ getMin(): Vector3;
5890
+ /**
5891
+ * @remarks
5892
+ * Fetch the origin in world space of the compound volume
5893
+ *
5894
+ * This function can't be called in read-only mode.
5895
+ *
5896
+ */
5897
+ getOrigin(): Vector3;
4421
5898
  /**
4422
5899
  * @remarks
4423
- * Clears the active camera for the specified player. Causes
4424
- * the specified players to end any in-progress camera
4425
- * perspectives, including any eased camera motions, and return
4426
- * to their normal perspective.
5900
+ * Return a boolean which signals if there are any volume items
5901
+ * pushed to the volume
4427
5902
  *
4428
5903
  * This function can't be called in read-only mode.
4429
5904
  *
4430
- * @throws This function can throw errors.
4431
5905
  */
4432
- clear(): void;
5906
+ isEmpty(): boolean;
4433
5907
  /**
4434
5908
  * @remarks
4435
- * Begins a camera fade transition. A fade transition is a
4436
- * full-screen color that fades-in, holds, and then fades-out.
5909
+ * Return a boolean representing whether or not a given
5910
+ * absolute world space block location is inside a positive
5911
+ * block volume.
5912
+ * E.g. if the stack contains a large cube followed by a
5913
+ * slightly smaller negative cube, and the test location is
5914
+ * within the negative cube - the function will return false
5915
+ * because it's not 'inside' a volume (it IS inside the
5916
+ * bounding rectangle, but it is not inside a positively
5917
+ * defined location)
4437
5918
  *
4438
5919
  * This function can't be called in read-only mode.
4439
5920
  *
4440
- * @param fadeCameraOptions
4441
- * Additional options around camera fade operations.
4442
- * @throws This function can throw errors.
4443
5921
  */
4444
- fade(fadeCameraOptions?: CameraFadeOptions): void;
5922
+ isInside(worldLocation: Vector3): boolean;
4445
5923
  /**
4446
5924
  * @remarks
4447
- * Sets the current active camera for the specified player.
5925
+ * Inspect the last entry pushed to the volume stack without
5926
+ * affecting the stack contents.
4448
5927
  *
4449
5928
  * This function can't be called in read-only mode.
4450
5929
  *
4451
- * @param cameraPreset
4452
- * Identifier of a camera preset file defined within JSON.
4453
- * @param setOptions
4454
- * Additional options for the camera.
4455
- * @throws This function can throw errors.
5930
+ * @param forceRelativity
5931
+ * Determine whether the function returns a
5932
+ * CompoundBlockVolumeItem which is forced into either relative
5933
+ * or absolute coordinate system.
5934
+ * `true` = force returned item to be relative to volume origin
5935
+ * `false` = force returned item to be absolute world space
5936
+ * location
5937
+ *
5938
+ * If no flag is specified, the item returned retains whatever
5939
+ * relativity it had when it was pushed
5940
+ * @returns
5941
+ * Returns undefined if the stack is empty
4456
5942
  */
4457
- setCamera(
4458
- cameraPreset: string,
4459
- setOptions?:
4460
- | CameraDefaultOptions
4461
- | CameraFixedBoomOptions
4462
- | CameraSetFacingOptions
4463
- | CameraSetLocationOptions
4464
- | CameraSetPosOptions
4465
- | CameraSetRotOptions
4466
- | CameraTargetOptions,
4467
- ): void;
4468
- }
4469
-
4470
- /**
4471
- * Contains the device information for a client instance.
4472
- */
4473
- // @ts-ignore Class inheritance allowed for native defined classes
4474
- export class ClientSystemInfo extends SystemInfo {
4475
- private constructor();
5943
+ peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
4476
5944
  /**
4477
5945
  * @remarks
4478
- * The max render distance for the device in chunks.
5946
+ * Remove the last entry from the volume stack. This will
5947
+ * reduce the stack size by one
5948
+ *
5949
+ * This function can't be called in read-only mode.
4479
5950
  *
4480
5951
  */
4481
- readonly maxRenderDistance: number;
5952
+ popVolume(): boolean;
4482
5953
  /**
4483
5954
  * @remarks
4484
- * The platform type of the device.
5955
+ * Push a volume item to the stack. The volume item contains
5956
+ * an 'action' parameter which determines whether this volume
5957
+ * is a positive or negative space.
5958
+ * The item also contains a `locationRelativity` which
5959
+ * determines whether it is relative or absolute to the
5960
+ * compound volume origin
5961
+ *
5962
+ * This function can't be called in read-only mode.
4485
5963
  *
5964
+ * @param item
5965
+ * Item to push to the end of the stack
4486
5966
  */
4487
- readonly platformType: PlatformType;
4488
- }
4489
-
4490
- /**
4491
- * Contains return data on the result of a command execution.
4492
- */
4493
- export class CommandResult {
4494
- private constructor();
5967
+ pushVolume(item: CompoundBlockVolumeItem): void;
4495
5968
  /**
4496
5969
  * @remarks
4497
- * If the command operates against a number of entities,
4498
- * blocks, or items, this returns the number of successful
4499
- * applications of this command.
5970
+ * If the volume stack is empty, this function will push the
5971
+ * specified item to the stack.
5972
+ * If the volume stack is NOT empty, this function will replace
5973
+ * the last item on the stack with the new item.
5974
+ *
5975
+ * This function can't be called in read-only mode.
4500
5976
  *
5977
+ * @param item
5978
+ * Item to add or replace
4501
5979
  */
4502
- readonly successCount: number;
4503
- }
4504
-
4505
- /**
4506
- * Base class for downstream Component implementations.
4507
- */
4508
- export class Component {
4509
- private constructor();
5980
+ replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
4510
5981
  /**
4511
- * @rc
4512
5982
  * @remarks
4513
- * Returns whether the component is valid. A component is
4514
- * considered valid if its owner is valid, in addition to any
4515
- * addition to any additional validation required by the
4516
- * component.
5983
+ * Set the origin of the compound volume to an absolute world
5984
+ * space location
5985
+ *
5986
+ * This function can't be called in read-only mode.
4517
5987
  *
5988
+ * @param preserveExistingVolumes
5989
+ * This optional boolean flag determines whether the relative
5990
+ * `CompoundBlockVolumeItem`'s are frozen in place, or are
5991
+ * affected by the new origin.
5992
+ * Imagine a scenario where you have a series of relative
5993
+ * locations around an origin which make up a sphere; all of
5994
+ * these locations are in the range of -2 to 2.
5995
+ * Push each of these locations to the compound volume as
5996
+ * relative items.
5997
+ * Now, move the origin and all of the locations representing
5998
+ * the sphere move accordingly.
5999
+ * However, let's say you want to add a 2nd sphere next to the
6000
+ * 1st.
6001
+ * In this case, set the new origin a few locations over, but
6002
+ * 'preserveExistingVolumes' = true.
6003
+ * This will set a new origin, but the existing sphere
6004
+ * locations will remain relative to the original origin.
6005
+ * Now, you can push the relative sphere locations again (this
6006
+ * time they will be relative to the new origin) - resulting in
6007
+ * 2 spheres next to each other.
4518
6008
  */
4519
- readonly isValid: boolean;
6009
+ setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
4520
6010
  /**
4521
6011
  * @remarks
4522
- * Identifier of the component.
6012
+ * Similar to {@link CompoundBlockVolume.setOrigin} - this
6013
+ * function will translate the origin by a given delta to a new
6014
+ * position
6015
+ *
6016
+ * This function can't be called in read-only mode.
4523
6017
  *
6018
+ * @param preserveExistingVolumes
6019
+ * See the description for the arguments to {@link
6020
+ * CompoundBlockVolume.setOrigin}
4524
6021
  */
4525
- readonly typeId: string;
6022
+ translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
4526
6023
  }
4527
6024
 
4528
6025
  /**
@@ -4659,6 +6156,64 @@ export class Container {
4659
6156
  * Throws if the container is invalid.
4660
6157
  */
4661
6158
  clearAll(): void;
6159
+ /**
6160
+ * @beta
6161
+ * @remarks
6162
+ * Attempts to find an item inside the container
6163
+ *
6164
+ * @param itemStack
6165
+ * The item to find.
6166
+ * @throws This function can throw errors.
6167
+ *
6168
+ * {@link InvalidContainerError}
6169
+ */
6170
+ contains(itemStack: ItemStack): boolean;
6171
+ /**
6172
+ * @beta
6173
+ * @remarks
6174
+ * Find the index of the first instance of an item inside the
6175
+ * container
6176
+ *
6177
+ * @param itemStack
6178
+ * The item to find.
6179
+ * @throws This function can throw errors.
6180
+ *
6181
+ * {@link InvalidContainerError}
6182
+ */
6183
+ find(itemStack: ItemStack): number | undefined;
6184
+ /**
6185
+ * @beta
6186
+ * @remarks
6187
+ * Find the index of the last instance of an item inside the
6188
+ * container
6189
+ *
6190
+ * @param itemStack
6191
+ * The item to find.
6192
+ * @throws This function can throw errors.
6193
+ *
6194
+ * {@link InvalidContainerError}
6195
+ */
6196
+ findLast(itemStack: ItemStack): number | undefined;
6197
+ /**
6198
+ * @beta
6199
+ * @remarks
6200
+ * Finds the index of the first empty slot inside the container
6201
+ *
6202
+ * @throws This function can throw errors.
6203
+ *
6204
+ * {@link InvalidContainerError}
6205
+ */
6206
+ firstEmptySlot(): number | undefined;
6207
+ /**
6208
+ * @beta
6209
+ * @remarks
6210
+ * Finds the index of the first item inside the container
6211
+ *
6212
+ * @throws This function can throw errors.
6213
+ *
6214
+ * {@link InvalidContainerError}
6215
+ */
6216
+ firstItem(): number | undefined;
4662
6217
  /**
4663
6218
  * @remarks
4664
6219
  * Gets an {@link ItemStack} of the item at the specified slot.
@@ -5146,6 +6701,21 @@ export class ContainerSlot {
5146
6701
  * {@link InvalidContainerSlotError}
5147
6702
  */
5148
6703
  setCanPlaceOn(blockIdentifiers?: string[]): void;
6704
+ /**
6705
+ * @beta
6706
+ * @remarks
6707
+ * Sets multiple dynamic properties with specific values.
6708
+ *
6709
+ * @param values
6710
+ * A Record of key value pairs of the dynamic properties to
6711
+ * set.
6712
+ * @throws This function can throw errors.
6713
+ *
6714
+ * {@link Error}
6715
+ *
6716
+ * {@link InvalidContainerSlotError}
6717
+ */
6718
+ setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
5149
6719
  /**
5150
6720
  * @remarks
5151
6721
  * Sets a specified property to a value.
@@ -5197,6 +6767,89 @@ export class ContainerSlot {
5197
6767
  setLore(loreList?: string[]): void;
5198
6768
  }
5199
6769
 
6770
+ /**
6771
+ * @beta
6772
+ * Details about the origins of the command.
6773
+ */
6774
+ export class CustomCommandOrigin {
6775
+ private constructor();
6776
+ /**
6777
+ * @remarks
6778
+ * If this command was initiated via an NPC, returns the entity
6779
+ * that initiated the NPC dialogue.
6780
+ *
6781
+ */
6782
+ readonly initiator?: Entity;
6783
+ /**
6784
+ * @remarks
6785
+ * Source block if this command was triggered via a block
6786
+ * (e.g., a commandblock.)
6787
+ *
6788
+ */
6789
+ readonly sourceBlock?: Block;
6790
+ /**
6791
+ * @remarks
6792
+ * Source entity if this command was triggered by an entity
6793
+ * (e.g., a NPC).
6794
+ *
6795
+ */
6796
+ readonly sourceEntity?: Entity;
6797
+ /**
6798
+ * @remarks
6799
+ * Returns the type of source that fired this command.
6800
+ *
6801
+ */
6802
+ readonly sourceType: CustomCommandSource;
6803
+ }
6804
+
6805
+ /**
6806
+ * @beta
6807
+ * Provides the functionality for registering custom commands.
6808
+ */
6809
+ export class CustomCommandRegistry {
6810
+ private constructor();
6811
+ /**
6812
+ * @remarks
6813
+ * Registers a custom command that when executed triggers a
6814
+ * script callback.
6815
+ *
6816
+ * This function can't be called in read-only mode.
6817
+ *
6818
+ * This function can be called in early-execution mode.
6819
+ *
6820
+ * @param callback
6821
+ * The callback triggered when the command executes.
6822
+ * @throws This function can throw errors.
6823
+ *
6824
+ * {@link CustomCommandError}
6825
+ *
6826
+ * {@link minecraftcommon.EngineError}
6827
+ *
6828
+ * {@link NamespaceNameError}
6829
+ */
6830
+ registerCommand(
6831
+ customCommand: CustomCommand,
6832
+ callback: (origin: CustomCommandOrigin, ...args: any[]) => CustomCommandResult | undefined,
6833
+ ): void;
6834
+ /**
6835
+ * @remarks
6836
+ * Registers a custom command enum.
6837
+ *
6838
+ * This function can't be called in read-only mode.
6839
+ *
6840
+ * This function can be called in early-execution mode.
6841
+ *
6842
+ * @throws This function can throw errors.
6843
+ *
6844
+ * {@link CustomCommandError}
6845
+ *
6846
+ * {@link minecraftcommon.EngineError}
6847
+ *
6848
+ * {@link NamespaceNameError}
6849
+ */
6850
+ registerEnum(name: string, values: string[]): void;
6851
+ }
6852
+
5200
6853
  /**
5201
6854
  * @rc
5202
6855
  * Contains the custom component's JSON parameters
@@ -5405,10 +7058,36 @@ export class Dimension {
5405
7058
  * {@link UnloadedChunksError}
5406
7059
  */
5407
7060
  fillBlocks(
5408
- volume: BlockVolumeBase,
7061
+ volume: BlockVolumeBase | CompoundBlockVolume,
5409
7062
  block: BlockPermutation | BlockType | string,
5410
7063
  options?: BlockFillOptions,
5411
7064
  ): ListBlockVolume;
7065
+ /**
7066
+ * @beta
7067
+ * @remarks
7068
+ * Finds the location of the closest biome of a particular
7069
+ * type. Note that the findClosestBiome operation can take some
7070
+ * time to complete, so avoid using many of these calls within
7071
+ * a particular tick.
7072
+ *
7073
+ * This function can't be called in read-only mode.
7074
+ *
7075
+ * @param pos
7076
+ * Starting location to look for a biome to find.
7077
+ * @param biomeToFind
7078
+ * Identifier of the biome to look for.
7079
+ * @param options
7080
+ * Additional selection criteria for a biome search.
7081
+ * @returns
7082
+ * Returns a location of the biome, or undefined if a biome
7083
+ * could not be found.
7084
+ * @throws This function can throw errors.
7085
+ *
7086
+ * {@link minecraftcommon.EngineError}
7087
+ *
7088
+ * {@link Error}
7089
+ */
7090
+ findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
5412
7091
  /**
5413
7092
  * @remarks
5414
7093
  * Returns a block instance at the given location.
@@ -5433,6 +7112,22 @@ export class Dimension {
5433
7112
  * {@link LocationOutOfWorldBoundariesError}
5434
7113
  */
5435
7114
  getBlock(location: Vector3): Block | undefined;
7115
+ /**
7116
+ * @beta
7117
+ * @remarks
7118
+ * This function can't be called in read-only mode.
7119
+ *
7120
+ * @throws This function can throw errors.
7121
+ */
7122
+ getBlockAbove(location: Vector3, options?: BlockRaycastOptions): Block | undefined;
7123
+ /**
7124
+ * @beta
7125
+ * @remarks
7126
+ * This function can't be called in read-only mode.
7127
+ *
7128
+ * @throws This function can throw errors.
7129
+ */
7130
+ getBlockBelow(location: Vector3, options?: BlockRaycastOptions): Block | undefined;
5436
7131
  /**
5437
7132
  * @remarks
5438
7133
  * Gets the first block that intersects with a vector emanating
@@ -5600,6 +7295,18 @@ export class Dimension {
5600
7295
  * @throws This function can throw errors.
5601
7296
  */
5602
7297
  getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
7298
+ /**
7299
+ * @beta
7300
+ * @remarks
7301
+ * Returns the current weather.
7302
+ *
7303
+ * This function can't be called in read-only mode.
7304
+ *
7305
+ * @returns
7306
+ * Returns a WeatherType that explains the broad category of
7307
+ * weather that is currently going on.
7308
+ */
7309
+ getWeather(): WeatherType;
5603
7310
  /**
5604
7311
  * @rc
5605
7312
  * @remarks
@@ -5831,7 +7538,11 @@ export class Dimension {
5831
7538
  * }
5832
7539
  * ```
5833
7540
  */
5834
- spawnEntity(identifier: EntityType | string, location: Vector3, options?: SpawnEntityOptions): Entity;
7541
+ spawnEntity<T = never>(
7542
+ identifier: EntityIdentifierType<NoInfer<T>>,
7543
+ location: Vector3,
7544
+ options?: SpawnEntityOptions,
7545
+ ): Entity;
5835
7546
  /**
5836
7547
  * @remarks
5837
7548
  * Creates a new item stack as an entity at the specified
@@ -5926,6 +7637,26 @@ export class Dimension {
5926
7637
  * ```
5927
7638
  */
5928
7639
  spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
7640
+ /**
7641
+ * @beta
7642
+ * @remarks
7643
+ * Stops all sounds from playing for all players.
7644
+ *
7645
+ * This function can't be called in read-only mode.
7646
+ *
7647
+ */
7648
+ stopAllSounds(): void;
7649
+ /**
7650
+ * @beta
7651
+ * @remarks
7652
+ * Stops a sound from playing for all players.
7653
+ *
7654
+ * This function can't be called in read-only mode.
7655
+ *
7656
+ * @param soundId
7657
+ * Identifier of the sound.
7658
+ */
7659
+ stopSound(soundId: string): void;
5929
7660
  }
5930
7661
 
5931
7662
  /**
@@ -6323,6 +8054,17 @@ export class Entity {
6323
8054
  *
6324
8055
  */
6325
8056
  readonly isValid: boolean;
8057
+ /**
8058
+ * @beta
8059
+ * @remarks
8060
+ * key for the localization of this entity's name used in .lang
8061
+ * files.
8062
+ *
8063
+ * @throws This property can throw when used.
8064
+ *
8065
+ * {@link InvalidEntityError}
8066
+ */
8067
+ readonly localizationKey: string;
6326
8068
  /**
6327
8069
  * @remarks
6328
8070
  * Current location of the entity.
@@ -6345,6 +8087,16 @@ export class Entity {
6345
8087
  *
6346
8088
  */
6347
8089
  readonly scoreboardIdentity?: ScoreboardIdentity;
8090
+ /**
8091
+ * @beta
8092
+ * @remarks
8093
+ * Retrieves or sets an entity that is used as the target of
8094
+ * AI-related behaviors, like attacking. If the entity
8095
+ * currently has no target returns undefined.
8096
+ *
8097
+ * @throws This property can throw when used.
8098
+ */
8099
+ readonly target?: Entity;
6348
8100
  /**
6349
8101
  * @remarks
6350
8102
  * Identifier of the type of the entity - for example,
@@ -7011,7 +8763,18 @@ export class Entity {
7011
8763
  *
7012
8764
  * {@link InvalidEntityError}
7013
8765
  */
7014
- runCommand(commandString: string): CommandResult;
8766
+ runCommand(commandString: string): CommandResult;
8767
+ /**
8768
+ * @beta
8769
+ * @remarks
8770
+ * Sets multiple dynamic properties with specific values.
8771
+ *
8772
+ * @param values
8773
+ * A Record of key value pairs of the dynamic properties to
8774
+ * set.
8775
+ * @throws This function can throw errors.
8776
+ */
8777
+ setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
7015
8778
  /**
7016
8779
  * @remarks
7017
8780
  * Sets a specified property to a value.
@@ -7394,6 +9157,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
7394
9157
  // @ts-ignore Class inheritance allowed for native defined classes
7395
9158
  export class EntityBreathableComponent extends EntityComponent {
7396
9159
  private constructor();
9160
+ /**
9161
+ * @beta
9162
+ * @remarks
9163
+ * The current air supply of the entity.
9164
+ *
9165
+ * This property can't be edited in read-only mode.
9166
+ *
9167
+ * @throws
9168
+ * Will throw an error if the air supply is out of bounds
9169
+ * [suffocationTime, maxAirSupply].
9170
+ */
9171
+ airSupply: number;
7397
9172
  /**
7398
9173
  * @remarks
7399
9174
  * If true, this entity can breathe in air.
@@ -7422,6 +9197,14 @@ export class EntityBreathableComponent extends EntityComponent {
7422
9197
  * @throws This property can throw when used.
7423
9198
  */
7424
9199
  readonly breathesWater: boolean;
9200
+ /**
9201
+ * @beta
9202
+ * @remarks
9203
+ * If true, the entity is able to breathe.
9204
+ *
9205
+ * @throws This property can throw when used.
9206
+ */
9207
+ readonly canBreathe: boolean;
7425
9208
  /**
7426
9209
  * @remarks
7427
9210
  * If true, this entity will have visible bubbles while in
@@ -8786,6 +10569,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
8786
10569
  static readonly componentId = 'minecraft:navigation.walk';
8787
10570
  }
8788
10571
 
10572
+ /**
10573
+ * @beta
10574
+ * Adds NPC capabilities to an entity such as custom skin,
10575
+ * name, and dialogue interactions.
10576
+ */
10577
+ // @ts-ignore Class inheritance allowed for native defined classes
10578
+ export class EntityNpcComponent extends EntityComponent {
10579
+ private constructor();
10580
+ /**
10581
+ * @remarks
10582
+ * The DialogueScene that is opened when players first interact
10583
+ * with the NPC.
10584
+ *
10585
+ * This property can't be edited in read-only mode.
10586
+ *
10587
+ */
10588
+ defaultScene: string;
10589
+ /**
10590
+ * @remarks
10591
+ * The name of the NPC as it is displayed to players.
10592
+ *
10593
+ * This property can't be edited in read-only mode.
10594
+ *
10595
+ */
10596
+ name: string;
10597
+ /**
10598
+ * @remarks
10599
+ * The index of the skin the NPC will use.
10600
+ *
10601
+ * This property can't be edited in read-only mode.
10602
+ *
10603
+ */
10604
+ skinIndex: number;
10605
+ static readonly componentId = 'minecraft:npc';
10606
+ }
10607
+
8789
10608
  /**
8790
10609
  * When present on an entity, this entity is on fire.
8791
10610
  * @example setOnFire.ts
@@ -9642,7 +11461,7 @@ export class EntityTypes {
9642
11461
  * Retrieves an entity type using a string-based identifier.
9643
11462
  *
9644
11463
  */
9645
- static get(identifier: string): EntityType | undefined;
11464
+ static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
9646
11465
  /**
9647
11466
  * @remarks
9648
11467
  * Retrieves a set of all entity types within this world.
@@ -10053,6 +11872,13 @@ export class GameRules {
10053
11872
  *
10054
11873
  */
10055
11874
  keepInventory: boolean;
11875
+ /**
11876
+ * @beta
11877
+ * @remarks
11878
+ * This property can't be edited in read-only mode.
11879
+ *
11880
+ */
11881
+ locatorBar: boolean;
10056
11882
  /**
10057
11883
  * @remarks
10058
11884
  * This property can't be edited in read-only mode.
@@ -10668,6 +12494,31 @@ export class ItemDurabilityComponent extends ItemComponent {
10668
12494
  getDamageChanceRange(): minecraftcommon.NumberRange;
10669
12495
  }
10670
12496
 
12497
+ /**
12498
+ * @beta
12499
+ * When present on an item, this item can be dyed.
12500
+ */
12501
+ // @ts-ignore Class inheritance allowed for native defined classes
12502
+ export class ItemDyeableComponent extends ItemComponent {
12503
+ private constructor();
12504
+ /**
12505
+ * @remarks
12506
+ * Sets and returns the current color of the item.
12507
+ *
12508
+ * This property can't be edited in read-only mode.
12509
+ *
12510
+ */
12511
+ color?: RGB;
12512
+ /**
12513
+ * @remarks
12514
+ * Returns the default color of the item.
12515
+ *
12516
+ * @throws This property can throw when used.
12517
+ */
12518
+ readonly defaultColor?: RGB;
12519
+ static readonly componentId = 'minecraft:dyeable';
12520
+ }
12521
+
10671
12522
  /**
10672
12523
  * When present on an item, this item can have enchantments
10673
12524
  * applied to it.
@@ -10878,6 +12729,37 @@ export class ItemFoodComponent extends ItemComponent {
10878
12729
  static readonly componentId = 'minecraft:food';
10879
12730
  }
10880
12731
 
12732
+ /**
12733
+ * @beta
12734
+ * When present on an item, this item is a potion item.
12735
+ */
12736
+ // @ts-ignore Class inheritance allowed for native defined classes
12737
+ export class ItemPotionComponent extends ItemComponent {
12738
+ private constructor();
12739
+ /**
12740
+ * @remarks
12741
+ * The PotionEffectType associated with the potion item.
12742
+ *
12743
+ * @throws This property can throw when used.
12744
+ */
12745
+ readonly potionEffectType: PotionEffectType;
12746
+ /**
12747
+ * @remarks
12748
+ * The PotionLiquidType associated with the potion item.
12749
+ *
12750
+ * @throws This property can throw when used.
12751
+ */
12752
+ readonly potionLiquidType: PotionLiquidType;
12753
+ /**
12754
+ * @remarks
12755
+ * The PotionModifierType associated with the potion item.
12756
+ *
12757
+ * @throws This property can throw when used.
12758
+ */
12759
+ readonly potionModifierType: PotionModifierType;
12760
+ static readonly componentId = 'minecraft:potion';
12761
+ }
12762
+
10881
12763
  /**
10882
12764
  * Contains information related to a chargeable item when the
10883
12765
  * player has finished using the item and released the build
@@ -11038,6 +12920,17 @@ export class ItemStack {
11038
12920
  *
11039
12921
  */
11040
12922
  keepOnDeath: boolean;
12923
+ /**
12924
+ * @beta
12925
+ * @remarks
12926
+ * key for the localization of this items's name used in .lang
12927
+ * files.
12928
+ *
12929
+ * @throws This property can throw when used.
12930
+ *
12931
+ * {@link minecraftcommon.EngineError}
12932
+ */
12933
+ readonly localizationKey: string;
11041
12934
  /**
11042
12935
  * @remarks
11043
12936
  * Gets or sets the item's lock mode. The default value is
@@ -11353,6 +13246,17 @@ export class ItemStack {
11353
13246
  * ```
11354
13247
  */
11355
13248
  setCanPlaceOn(blockIdentifiers?: string[]): void;
13249
+ /**
13250
+ * @beta
13251
+ * @remarks
13252
+ * Sets multiple dynamic properties with specific values.
13253
+ *
13254
+ * @param values
13255
+ * A Record of key value pairs of the dynamic properties to
13256
+ * set.
13257
+ * @throws This function can throw errors.
13258
+ */
13259
+ setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
11356
13260
  /**
11357
13261
  * @remarks
11358
13262
  * Sets a specified property to a value. Note: This function
@@ -11402,6 +13306,16 @@ export class ItemStack {
11402
13306
  * ```
11403
13307
  */
11404
13308
  setLore(loreList?: string[]): void;
13309
+ /**
13310
+ * @beta
13311
+ * @remarks
13312
+ * Helper function for creating potion items.
13313
+ *
13314
+ * This function can't be called in read-only mode.
13315
+ *
13316
+ * @throws This function can throw errors.
13317
+ */
13318
+ static createPotion(options: PotionOptions): ItemStack;
11405
13319
  }
11406
13320
 
11407
13321
  /**
@@ -11960,6 +13874,33 @@ export class ListBlockVolume extends BlockVolumeBase {
11960
13874
  remove(locations: Vector3[]): void;
11961
13875
  }
11962
13876
 
13877
+ /**
13878
+ * @beta
13879
+ * A specific currently-internal event used for passing
13880
+ * messages from client to server.
13881
+ */
13882
+ export class MessageReceiveAfterEvent {
13883
+ private constructor();
13884
+ /**
13885
+ * @remarks
13886
+ * The message identifier.
13887
+ *
13888
+ */
13889
+ readonly id: string;
13890
+ /**
13891
+ * @remarks
13892
+ * The message.
13893
+ *
13894
+ */
13895
+ readonly message: string;
13896
+ /**
13897
+ * @remarks
13898
+ * The player who sent the message.
13899
+ *
13900
+ */
13901
+ readonly player: Player;
13902
+ }
13903
+
11963
13904
  /**
11964
13905
  * Contains a set of additional variable values for further
11965
13906
  * defining how rendering and animations function.
@@ -12173,6 +14114,13 @@ export class Player extends Entity {
12173
14114
  * @throws This property can throw when used.
12174
14115
  */
12175
14116
  readonly clientSystemInfo: ClientSystemInfo;
14117
+ /**
14118
+ * @beta
14119
+ * @remarks
14120
+ * This property can't be edited in read-only mode.
14121
+ *
14122
+ */
14123
+ commandPermissionLevel: CommandPermissionLevel;
12176
14124
  /**
12177
14125
  * @rc
12178
14126
  * @remarks
@@ -12250,6 +14198,13 @@ export class Player extends Entity {
12250
14198
  * @throws This property can throw when used.
12251
14199
  */
12252
14200
  readonly onScreenDisplay: ScreenDisplay;
14201
+ /**
14202
+ * @beta
14203
+ * @throws This property can throw when used.
14204
+ *
14205
+ * {@link InvalidEntityError}
14206
+ */
14207
+ readonly playerPermissionLevel: PlayerPermissionLevel;
12253
14208
  /**
12254
14209
  * @remarks
12255
14210
  * This property can't be edited in read-only mode.
@@ -12316,6 +14271,27 @@ export class Player extends Entity {
12316
14271
  * Throws if the entity is invalid.
12317
14272
  */
12318
14273
  clearPropertyOverridesForEntity(targetEntity: Entity): void;
14274
+ /**
14275
+ * @beta
14276
+ * @remarks
14277
+ * Eats an item, providing the item's hunger and saturation
14278
+ * effects to the player. Can only be used on food items.
14279
+ *
14280
+ * This function can't be called in read-only mode.
14281
+ *
14282
+ * @param itemStack
14283
+ * The item to eat.
14284
+ * @throws
14285
+ * Throws if the item is not a food item.
14286
+ */
14287
+ eatItem(itemStack: ItemStack): void;
14288
+ /**
14289
+ * @beta
14290
+ * @remarks
14291
+ * The player's aim-assist settings.
14292
+ *
14293
+ */
14294
+ getAimAssist(): PlayerAimAssist;
12319
14295
  /**
12320
14296
  * @remarks
12321
14297
  * Retrieves the active gamemode for this player, if specified.
@@ -12401,6 +14377,17 @@ export class Player extends Entity {
12401
14377
  * ```
12402
14378
  */
12403
14379
  playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
14380
+ /**
14381
+ * @beta
14382
+ * @remarks
14383
+ * This is an internal-facing method for posting a system
14384
+ * message to downstream clients.
14385
+ *
14386
+ * This function can't be called in read-only mode.
14387
+ *
14388
+ * @throws This function can throw errors.
14389
+ */
14390
+ postClientMessage(id: string, value: string): void;
12404
14391
  /**
12405
14392
  * @remarks
12406
14393
  * Queues an additional music track that only this particular
@@ -12653,6 +14640,18 @@ export class Player extends Entity {
12653
14640
  * @throws This function can throw errors.
12654
14641
  */
12655
14642
  startItemCooldown(cooldownCategory: string, tickDuration: number): void;
14643
+ /**
14644
+ * @beta
14645
+ * @remarks
14646
+ * Stops all sounds from playing for this particular player.
14647
+ *
14648
+ * This function can't be called in read-only mode.
14649
+ *
14650
+ * @throws This function can throw errors.
14651
+ *
14652
+ * {@link InvalidEntityError}
14653
+ */
14654
+ stopAllSounds(): void;
12656
14655
  /**
12657
14656
  * @remarks
12658
14657
  * Stops any music tracks from playing for this particular
@@ -12663,6 +14662,59 @@ export class Player extends Entity {
12663
14662
  * @throws This function can throw errors.
12664
14663
  */
12665
14664
  stopMusic(): void;
14665
+ /**
14666
+ * @beta
14667
+ * @remarks
14668
+ * Stops a sound from playing for this particular player.
14669
+ *
14670
+ * This function can't be called in read-only mode.
14671
+ *
14672
+ * @param soundId
14673
+ * Identifier of the sound.
14674
+ * @throws This function can throw errors.
14675
+ *
14676
+ * {@link InvalidEntityError}
14677
+ */
14678
+ stopSound(soundId: string): void;
14679
+ }
14680
+
14681
+ /**
14682
+ * @beta
14683
+ * A container for APIs related to player aim-assist.
14684
+ */
14685
+ export class PlayerAimAssist {
14686
+ private constructor();
14687
+ /**
14688
+ * @remarks
14689
+ * The player's currently active aim-assist settings, or
14690
+ * undefined if not active.
14691
+ *
14692
+ */
14693
+ readonly settings?: PlayerAimAssistSettings;
14694
+ /**
14695
+ * @remarks
14696
+ * Sets the player's aim-assist settings.
14697
+ *
14698
+ * This function can't be called in read-only mode.
14699
+ *
14700
+ * @param settings
14701
+ * Aim-assist settings to activate for the player, if undefined
14702
+ * aim-assist will be disabled.
14703
+ * @throws This function can throw errors.
14704
+ *
14705
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
14706
+ *
14707
+ * {@link minecraftcommon.EngineError}
14708
+ *
14709
+ * {@link Error}
14710
+ *
14711
+ * {@link minecraftcommon.InvalidArgumentError}
14712
+ *
14713
+ * {@link InvalidEntityError}
14714
+ *
14715
+ * {@link NamespaceNameError}
14716
+ */
14717
+ set(settings?: PlayerAimAssistSettings): void;
12666
14718
  }
12667
14719
 
12668
14720
  /**
@@ -13049,7 +15101,72 @@ export class PlayerGameModeChangeBeforeEvent {
13049
15101
  * The current game mode.
13050
15102
  *
13051
15103
  */
13052
- readonly fromGameMode: GameMode;
15104
+ readonly fromGameMode: GameMode;
15105
+ /**
15106
+ * @remarks
15107
+ * Source Player for this event.
15108
+ *
15109
+ */
15110
+ readonly player: Player;
15111
+ /**
15112
+ * @remarks
15113
+ * The game mode being changed to.
15114
+ *
15115
+ */
15116
+ toGameMode: GameMode;
15117
+ }
15118
+
15119
+ /**
15120
+ * Manages callbacks that are connected to before a players
15121
+ * game mode is changed.
15122
+ */
15123
+ export class PlayerGameModeChangeBeforeEventSignal {
15124
+ private constructor();
15125
+ /**
15126
+ * @remarks
15127
+ * Adds a callback that will be called before a players game
15128
+ * mode is changed.
15129
+ *
15130
+ * This function can't be called in read-only mode.
15131
+ *
15132
+ * This function can be called in early-execution mode.
15133
+ *
15134
+ */
15135
+ subscribe(
15136
+ callback: (arg0: PlayerGameModeChangeBeforeEvent) => void,
15137
+ ): (arg0: PlayerGameModeChangeBeforeEvent) => void;
15138
+ /**
15139
+ * @remarks
15140
+ * Removes a callback from being called before a players game
15141
+ * mode is changed.
15142
+ *
15143
+ * This function can't be called in read-only mode.
15144
+ *
15145
+ * This function can be called in early-execution mode.
15146
+ *
15147
+ */
15148
+ unsubscribe(callback: (arg0: PlayerGameModeChangeBeforeEvent) => void): void;
15149
+ }
15150
+
15151
+ /**
15152
+ * @beta
15153
+ * Contains information regarding an event after changing the
15154
+ * selected hotbar slot for a player.
15155
+ */
15156
+ export class PlayerHotbarSelectedSlotChangeAfterEvent {
15157
+ private constructor();
15158
+ /**
15159
+ * @remarks
15160
+ * The item stack of the new slot selected.
15161
+ *
15162
+ */
15163
+ readonly itemStack?: ItemStack;
15164
+ /**
15165
+ * @remarks
15166
+ * The new hotbar slot index selected.
15167
+ *
15168
+ */
15169
+ readonly newSlotSelected: number;
13053
15170
  /**
13054
15171
  * @remarks
13055
15172
  * Source Player for this event.
@@ -13058,42 +15175,48 @@ export class PlayerGameModeChangeBeforeEvent {
13058
15175
  readonly player: Player;
13059
15176
  /**
13060
15177
  * @remarks
13061
- * The game mode being changed to.
15178
+ * The previous hotbar slot index selected.
13062
15179
  *
13063
15180
  */
13064
- toGameMode: GameMode;
15181
+ readonly previousSlotSelected: number;
13065
15182
  }
13066
15183
 
13067
15184
  /**
13068
- * Manages callbacks that are connected to before a players
13069
- * game mode is changed.
15185
+ * @beta
15186
+ * Manages callbacks that are connected after a player selected
15187
+ * hotbar slot is changed.
13070
15188
  */
13071
- export class PlayerGameModeChangeBeforeEventSignal {
15189
+ export class PlayerHotbarSelectedSlotChangeAfterEventSignal {
13072
15190
  private constructor();
13073
15191
  /**
13074
15192
  * @remarks
13075
- * Adds a callback that will be called before a players game
13076
- * mode is changed.
15193
+ * Adds a callback that will be called after a player selected
15194
+ * hotbar slot is changed.
13077
15195
  *
13078
15196
  * This function can't be called in read-only mode.
13079
15197
  *
13080
15198
  * This function can be called in early-execution mode.
13081
15199
  *
15200
+ * @param callback
15201
+ * Function callback that is called when this event fires.
15202
+ * @param options
15203
+ * Additional filtering options for the event subscription.
13082
15204
  */
13083
15205
  subscribe(
13084
- callback: (arg0: PlayerGameModeChangeBeforeEvent) => void,
13085
- ): (arg0: PlayerGameModeChangeBeforeEvent) => void;
15206
+ callback: (arg0: PlayerHotbarSelectedSlotChangeAfterEvent) => void,
15207
+ options?: HotbarEventOptions,
15208
+ ): (arg0: PlayerHotbarSelectedSlotChangeAfterEvent) => void;
13086
15209
  /**
13087
15210
  * @remarks
13088
- * Removes a callback from being called before a players game
13089
- * mode is changed.
15211
+ * Removes a callback from being called after a player selected
15212
+ * hotbar slot is changed.
13090
15213
  *
13091
15214
  * This function can't be called in read-only mode.
13092
15215
  *
13093
15216
  * This function can be called in early-execution mode.
13094
15217
  *
13095
15218
  */
13096
- unsubscribe(callback: (arg0: PlayerGameModeChangeBeforeEvent) => void): void;
15219
+ unsubscribe(callback: (arg0: PlayerHotbarSelectedSlotChangeAfterEvent) => void): void;
13097
15220
  }
13098
15221
 
13099
15222
  /**
@@ -13540,6 +15663,83 @@ export class PlayerInteractWithEntityBeforeEventSignal {
13540
15663
  unsubscribe(callback: (arg0: PlayerInteractWithEntityBeforeEvent) => void): void;
13541
15664
  }
13542
15665
 
15666
+ /**
15667
+ * @beta
15668
+ * Contains information regarding an event after a player's
15669
+ * inventory item changes.
15670
+ */
15671
+ export class PlayerInventoryItemChangeAfterEvent {
15672
+ private constructor();
15673
+ /**
15674
+ * @remarks
15675
+ * The previous item stack.
15676
+ *
15677
+ */
15678
+ readonly beforeItemStack?: ItemStack;
15679
+ /**
15680
+ * @remarks
15681
+ * Inventory type.
15682
+ *
15683
+ */
15684
+ readonly inventoryType: PlayerInventoryType;
15685
+ /**
15686
+ * @remarks
15687
+ * The new item stack.
15688
+ *
15689
+ */
15690
+ readonly itemStack?: ItemStack;
15691
+ /**
15692
+ * @remarks
15693
+ * Source Player for this event.
15694
+ *
15695
+ */
15696
+ readonly player: Player;
15697
+ /**
15698
+ * @remarks
15699
+ * The slot index with the change.
15700
+ *
15701
+ */
15702
+ readonly slot: number;
15703
+ }
15704
+
15705
+ /**
15706
+ * @beta
15707
+ * Manages callbacks that are connected after a player's
15708
+ * inventory item is changed.
15709
+ */
15710
+ export class PlayerInventoryItemChangeAfterEventSignal {
15711
+ private constructor();
15712
+ /**
15713
+ * @remarks
15714
+ * Adds a callback that will be called after a player's
15715
+ * inventory item is changed.
15716
+ *
15717
+ * This function can't be called in read-only mode.
15718
+ *
15719
+ * This function can be called in early-execution mode.
15720
+ *
15721
+ * @param callback
15722
+ * Function callback that is called when this event fires.
15723
+ * @param options
15724
+ * Additional filtering options for the event subscription.
15725
+ */
15726
+ subscribe(
15727
+ callback: (arg0: PlayerInventoryItemChangeAfterEvent) => void,
15728
+ options?: InventoryItemEventOptions,
15729
+ ): (arg0: PlayerInventoryItemChangeAfterEvent) => void;
15730
+ /**
15731
+ * @remarks
15732
+ * Removes a callback from being called after a player's
15733
+ * inventory item is changed.
15734
+ *
15735
+ * This function can't be called in read-only mode.
15736
+ *
15737
+ * This function can be called in early-execution mode.
15738
+ *
15739
+ */
15740
+ unsubscribe(callback: (arg0: PlayerInventoryItemChangeAfterEvent) => void): void;
15741
+ }
15742
+
13543
15743
  /**
13544
15744
  * Contains information regarding a player that has joined.
13545
15745
  * See the playerSpawn event for more detailed information that
@@ -13739,6 +15939,82 @@ export class PlayerPlaceBlockAfterEventSignal {
13739
15939
  unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
13740
15940
  }
13741
15941
 
15942
+ /**
15943
+ * @beta
15944
+ * Contains information regarding an event before a player
15945
+ * places a block.
15946
+ */
15947
+ // @ts-ignore Class inheritance allowed for native defined classes
15948
+ export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
15949
+ private constructor();
15950
+ /**
15951
+ * @remarks
15952
+ * If set to true, cancels the block place event.
15953
+ *
15954
+ */
15955
+ cancel: boolean;
15956
+ /**
15957
+ * @remarks
15958
+ * The face of the block that the new block is being placed on.
15959
+ *
15960
+ */
15961
+ readonly face: Direction;
15962
+ /**
15963
+ * @remarks
15964
+ * Location relative to the bottom north-west corner of the
15965
+ * block where the new block is being placed onto.
15966
+ *
15967
+ */
15968
+ readonly faceLocation: Vector3;
15969
+ /**
15970
+ * @remarks
15971
+ * The block permutation that will be placed if the event is
15972
+ * not cancelled.
15973
+ *
15974
+ */
15975
+ readonly permutationToPlace: BlockPermutation;
15976
+ /**
15977
+ * @remarks
15978
+ * Player that is placing the block for this event.
15979
+ *
15980
+ */
15981
+ readonly player: Player;
15982
+ }
15983
+
15984
+ /**
15985
+ * @beta
15986
+ * Manages callbacks that are connected to before a block is
15987
+ * placed by a player.
15988
+ */
15989
+ export class PlayerPlaceBlockBeforeEventSignal {
15990
+ private constructor();
15991
+ /**
15992
+ * @remarks
15993
+ * Adds a callback that will be called before a block is placed
15994
+ * by a player.
15995
+ *
15996
+ * This function can't be called in read-only mode.
15997
+ *
15998
+ * This function can be called in early-execution mode.
15999
+ *
16000
+ */
16001
+ subscribe(
16002
+ callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
16003
+ options?: BlockEventOptions,
16004
+ ): (arg0: PlayerPlaceBlockBeforeEvent) => void;
16005
+ /**
16006
+ * @remarks
16007
+ * Removes a callback from being called before an block is
16008
+ * placed by a player.
16009
+ *
16010
+ * This function can't be called in read-only mode.
16011
+ *
16012
+ * This function can be called in early-execution mode.
16013
+ *
16014
+ */
16015
+ unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
16016
+ }
16017
+
13742
16018
  /**
13743
16019
  * An event that contains more information about a player
13744
16020
  * spawning.
@@ -13795,6 +16071,75 @@ export class PlayerSpawnAfterEventSignal {
13795
16071
  unsubscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): void;
13796
16072
  }
13797
16073
 
16074
+ /**
16075
+ * @beta
16076
+ * Represents a type of potion effect - like healing or leaping
16077
+ * - that can be used with PotionOptions.
16078
+ */
16079
+ export class PotionEffectType {
16080
+ private constructor();
16081
+ readonly id: string;
16082
+ }
16083
+
16084
+ /**
16085
+ * @beta
16086
+ * Represents a type of potion liquid - like splash, or
16087
+ * lingering - that can be used with PotionOptions.
16088
+ */
16089
+ export class PotionLiquidType {
16090
+ private constructor();
16091
+ readonly id: string;
16092
+ }
16093
+
16094
+ /**
16095
+ * @beta
16096
+ * Represents a type of potion modifier - like strong, or long
16097
+ * - that can be used with PotionOptions.
16098
+ */
16099
+ export class PotionModifierType {
16100
+ private constructor();
16101
+ readonly id: string;
16102
+ }
16103
+
16104
+ /**
16105
+ * @beta
16106
+ * Used for accessing all potion effects, liquids, and
16107
+ * modifiers currently available for use within the world.
16108
+ */
16109
+ export class Potions {
16110
+ private constructor();
16111
+ /**
16112
+ * @remarks
16113
+ * Retrieves a type handle for a specified potion effect id.
16114
+ *
16115
+ * @param potionEffectId
16116
+ * A valid potion effect id. See
16117
+ * @minecraft/vanilla-data.MinecraftPotionEffectTypes
16118
+ * @returns
16119
+ * A type handle wrapping the valid effect id, or undefined for
16120
+ * an invalid effect id.
16121
+ */
16122
+ static getPotionEffectType(potionEffectId: string): PotionEffectType | undefined;
16123
+ /**
16124
+ * @remarks
16125
+ * Retrieves a type handle for a specified potion liquid id.
16126
+ *
16127
+ * @returns
16128
+ * A type handle wrapping the valid liquid id, or undefined for
16129
+ * an invalid liquid id.
16130
+ */
16131
+ static getPotionLiquidType(potionLiquidId: string): PotionLiquidType | undefined;
16132
+ /**
16133
+ * @remarks
16134
+ * Retrieves a type handle for a specified potion modifier id.
16135
+ *
16136
+ * @returns
16137
+ * A type handle wrapping the valid modifier id, or undefined
16138
+ * for an invalid modifier id.
16139
+ */
16140
+ static getPotionModifierType(potionModifierId: string): PotionModifierType | undefined;
16141
+ }
16142
+
13798
16143
  /**
13799
16144
  * Contains information related to changes to a pressure plate
13800
16145
  * pop.
@@ -14749,6 +17094,38 @@ export class Seat {
14749
17094
  readonly seatRotation: number;
14750
17095
  }
14751
17096
 
17097
+ /**
17098
+ * @beta
17099
+ * Manages callbacks that are message passing to a server. This
17100
+ * event is not currently fully implemented, and should not be
17101
+ * used.
17102
+ */
17103
+ export class ServerMessageAfterEventSignal {
17104
+ private constructor();
17105
+ /**
17106
+ * @remarks
17107
+ * Adds a callback that will be called when an internal message
17108
+ * is passed.
17109
+ *
17110
+ * This function can't be called in read-only mode.
17111
+ *
17112
+ * This function can be called in early-execution mode.
17113
+ *
17114
+ */
17115
+ subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
17116
+ /**
17117
+ * @remarks
17118
+ * Removes a callback from being called when an internal
17119
+ * message is passed.
17120
+ *
17121
+ * This function can't be called in read-only mode.
17122
+ *
17123
+ * This function can be called in early-execution mode.
17124
+ *
17125
+ */
17126
+ unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
17127
+ }
17128
+
14752
17129
  /**
14753
17130
  * @rc
14754
17131
  * Provides an adaptable interface for callers to subscribe to
@@ -14829,6 +17206,13 @@ export class StartupEvent {
14829
17206
  *
14830
17207
  */
14831
17208
  readonly blockComponentRegistry: BlockComponentRegistry;
17209
+ /**
17210
+ * @beta
17211
+ * @remarks
17212
+ * This property can be read in early-execution mode.
17213
+ *
17214
+ */
17215
+ readonly customCommandRegistry: CustomCommandRegistry;
14832
17216
  /**
14833
17217
  * @remarks
14834
17218
  * This property can be read in early-execution mode.
@@ -15475,6 +17859,19 @@ export class SystemBeforeEvents {
15475
17859
  *
15476
17860
  */
15477
17861
  readonly startup: StartupBeforeEventSignal;
17862
+ /**
17863
+ * @beta
17864
+ * @remarks
17865
+ * Fires when the scripting watchdog shuts down the server. The
17866
+ * can be due to using too much memory, or by causing
17867
+ * significant slowdown or hang.
17868
+ * To prevent shutdown, set the event's cancel property to
17869
+ * true.
17870
+ *
17871
+ * This property can be read in early-execution mode.
17872
+ *
17873
+ */
17874
+ readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
15478
17875
  }
15479
17876
 
15480
17877
  /**
@@ -15691,6 +18088,65 @@ export class TripWireTripAfterEventSignal {
15691
18088
  unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
15692
18089
  }
15693
18090
 
18091
+ /**
18092
+ * @beta
18093
+ * Contains information related to a script watchdog
18094
+ * termination.
18095
+ */
18096
+ export class WatchdogTerminateBeforeEvent {
18097
+ private constructor();
18098
+ /**
18099
+ * @remarks
18100
+ * If set to true, cancels the termination of the script
18101
+ * runtime. Note that depending on server configuration
18102
+ * settings, cancellation of the termination may not be
18103
+ * allowed.
18104
+ *
18105
+ */
18106
+ cancel: boolean;
18107
+ /**
18108
+ * @remarks
18109
+ * Contains the reason why a script runtime is to be
18110
+ * terminated.
18111
+ *
18112
+ */
18113
+ readonly terminateReason: WatchdogTerminateReason;
18114
+ }
18115
+
18116
+ /**
18117
+ * @beta
18118
+ * Manages callbacks that are connected to a callback that will
18119
+ * be called when a script runtime is being terminated due to a
18120
+ * violation of the performance watchdog system.
18121
+ */
18122
+ export class WatchdogTerminateBeforeEventSignal {
18123
+ private constructor();
18124
+ /**
18125
+ * @remarks
18126
+ * Adds a callback that will be called when a script runtime is
18127
+ * being terminated due to a violation of the performance
18128
+ * watchdog system.
18129
+ *
18130
+ * This function can't be called in read-only mode.
18131
+ *
18132
+ * This function can be called in early-execution mode.
18133
+ *
18134
+ */
18135
+ subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
18136
+ /**
18137
+ * @remarks
18138
+ * Removes a callback from being called when a script runtime
18139
+ * is being terminated due to a violation of the performance
18140
+ * watchdog system.
18141
+ *
18142
+ * This function can't be called in read-only mode.
18143
+ *
18144
+ * This function can be called in early-execution mode.
18145
+ *
18146
+ */
18147
+ unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
18148
+ }
18149
+
15694
18150
  /**
15695
18151
  * Contains information related to changes in weather in the
15696
18152
  * environment.
@@ -15878,6 +18334,20 @@ export class World {
15878
18334
  *
15879
18335
  */
15880
18336
  readonly structureManager: StructureManager;
18337
+ /**
18338
+ * @beta
18339
+ * @remarks
18340
+ * A method that is internal-only, used for broadcasting
18341
+ * specific messages between client and server.
18342
+ *
18343
+ * This function can't be called in read-only mode.
18344
+ *
18345
+ * @param id
18346
+ * The message identifier.
18347
+ * @param value
18348
+ * The message.
18349
+ */
18350
+ broadcastClientMessage(id: string, value: string): void;
15881
18351
  /**
15882
18352
  * @remarks
15883
18353
  * Clears the set of dynamic properties declared for this
@@ -15891,6 +18361,14 @@ export class World {
15891
18361
  *
15892
18362
  */
15893
18363
  getAbsoluteTime(): number;
18364
+ /**
18365
+ * @beta
18366
+ * @remarks
18367
+ * The aim-assist presets and categories that can be used in
18368
+ * the world.
18369
+ *
18370
+ */
18371
+ getAimAssist(): AimAssistRegistry;
15894
18372
  /**
15895
18373
  * @remarks
15896
18374
  * Returns an array of all active players within the world.
@@ -16179,7 +18657,18 @@ export class World {
16179
18657
  * @param difficulty
16180
18658
  * The difficulty we want to set the world to.
16181
18659
  */
16182
- setDifficulty(difficulty: Difficulty): void;
18660
+ setDifficulty(difficulty: Difficulty): void;
18661
+ /**
18662
+ * @beta
18663
+ * @remarks
18664
+ * Sets multiple dynamic properties with specific values.
18665
+ *
18666
+ * @param values
18667
+ * A Record of key value pairs of the dynamic properties to
18668
+ * set.
18669
+ * @throws This function can throw errors.
18670
+ */
18671
+ setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
16183
18672
  /**
16184
18673
  * @remarks
16185
18674
  * Sets a specified property to a value.
@@ -16306,6 +18795,16 @@ export class WorldAfterEvents {
16306
18795
  *
16307
18796
  */
16308
18797
  readonly buttonPush: ButtonPushAfterEventSignal;
18798
+ /**
18799
+ * @beta
18800
+ * @remarks
18801
+ * This event is triggered after a chat message has been
18802
+ * broadcast or sent to players.
18803
+ *
18804
+ * This property can be read in early-execution mode.
18805
+ *
18806
+ */
18807
+ readonly chatSend: ChatSendAfterEventSignal;
16309
18808
  /**
16310
18809
  * @remarks
16311
18810
  * This event is fired when an entity event has been triggered
@@ -16481,6 +18980,16 @@ export class WorldAfterEvents {
16481
18980
  *
16482
18981
  */
16483
18982
  readonly leverAction: LeverActionAfterEventSignal;
18983
+ /**
18984
+ * @beta
18985
+ * @remarks
18986
+ * This event is an internal implementation detail, and is
18987
+ * otherwise not currently functional.
18988
+ *
18989
+ * This property can be read in early-execution mode.
18990
+ *
18991
+ */
18992
+ readonly messageReceive: ServerMessageAfterEventSignal;
16484
18993
  /**
16485
18994
  * @remarks
16486
18995
  * This event fires when a piston expands or retracts.
@@ -16526,6 +19035,13 @@ export class WorldAfterEvents {
16526
19035
  *
16527
19036
  */
16528
19037
  readonly playerGameModeChange: PlayerGameModeChangeAfterEventSignal;
19038
+ /**
19039
+ * @beta
19040
+ * @remarks
19041
+ * This property can be read in early-execution mode.
19042
+ *
19043
+ */
19044
+ readonly playerHotbarSelectedSlotChange: PlayerHotbarSelectedSlotChangeAfterEventSignal;
16529
19045
  /**
16530
19046
  * @remarks
16531
19047
  * This event fires when a player's {@link InputMode} changes.
@@ -16558,6 +19074,13 @@ export class WorldAfterEvents {
16558
19074
  *
16559
19075
  */
16560
19076
  readonly playerInteractWithEntity: PlayerInteractWithEntityAfterEventSignal;
19077
+ /**
19078
+ * @beta
19079
+ * @remarks
19080
+ * This property can be read in early-execution mode.
19081
+ *
19082
+ */
19083
+ readonly playerInventoryItemChange: PlayerInventoryItemChangeAfterEventSignal;
16561
19084
  /**
16562
19085
  * @remarks
16563
19086
  * This event fires when a player joins a world. See also
@@ -16671,6 +19194,43 @@ export class WorldAfterEvents {
16671
19194
  */
16672
19195
  export class WorldBeforeEvents {
16673
19196
  private constructor();
19197
+ /**
19198
+ * @beta
19199
+ * @remarks
19200
+ * This event is triggered after a chat message has been
19201
+ * broadcast or sent to players.
19202
+ *
19203
+ * This property can be read in early-execution mode.
19204
+ *
19205
+ * @example customCommand.ts
19206
+ * ```typescript
19207
+ * import { world, DimensionLocation } from "@minecraft/server";
19208
+ *
19209
+ * function customCommand(targetLocation: DimensionLocation) {
19210
+ * const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
19211
+ * if (eventData.message.includes("cancel")) {
19212
+ * // Cancel event if the message contains "cancel"
19213
+ * eventData.cancel = true;
19214
+ * } else {
19215
+ * const args = eventData.message.split(" ");
19216
+ *
19217
+ * if (args.length > 0) {
19218
+ * switch (args[0].toLowerCase()) {
19219
+ * case "echo":
19220
+ * // Send a modified version of chat message
19221
+ * world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
19222
+ * break;
19223
+ * case "help":
19224
+ * world.sendMessage(`Available commands: echo <message>`);
19225
+ * break;
19226
+ * }
19227
+ * }
19228
+ * }
19229
+ * });
19230
+ * }
19231
+ * ```
19232
+ */
19233
+ readonly chatSend: ChatSendBeforeEventSignal;
16674
19234
  /**
16675
19235
  * @remarks
16676
19236
  * This event is triggered after an event has been added to an
@@ -16744,6 +19304,15 @@ export class WorldBeforeEvents {
16744
19304
  *
16745
19305
  */
16746
19306
  readonly playerLeave: PlayerLeaveBeforeEventSignal;
19307
+ /**
19308
+ * @beta
19309
+ * @remarks
19310
+ * This event fires before a block is placed by a player.
19311
+ *
19312
+ * This property can be read in early-execution mode.
19313
+ *
19314
+ */
19315
+ readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
16747
19316
  /**
16748
19317
  * @remarks
16749
19318
  * This property can be read in early-execution mode.
@@ -16782,14 +19351,28 @@ export class WorldLoadAfterEventSignal {
16782
19351
  unsubscribe(callback: (arg0: WorldLoadAfterEvent) => void): void;
16783
19352
  }
16784
19353
 
19354
+ /**
19355
+ * @beta
19356
+ * Contains additional options for searches for the
19357
+ * dimension.findNearestBiome API.
19358
+ */
19359
+ export interface BiomeSearchOptions {
19360
+ /**
19361
+ * @remarks
19362
+ * Bounding volume size to look within.
19363
+ *
19364
+ */
19365
+ boundingSize?: Vector3;
19366
+ }
19367
+
16785
19368
  /**
16786
19369
  * @rc
16787
19370
  * A BlockBoundingBox is an interface to an object which
16788
19371
  * represents an AABB aligned rectangle.
16789
19372
  * The BlockBoundingBox assumes that it was created in a valid
16790
19373
  * state (min <= max) but cannot guarantee it (unless it was
16791
- * created using the associated {@link
16792
- * @minecraft/server.BlockBoundingBoxUtils} utility functions.
19374
+ * created using the associated {@link BlockBoundingBoxUtils}
19375
+ * utility functions.
16793
19376
  * The min/max coordinates represent the diametrically opposite
16794
19377
  * corners of the rectangle.
16795
19378
  * The BlockBoundingBox is not a representation of blocks - it
@@ -17184,6 +19767,125 @@ export interface CameraTargetOptions {
17184
19767
  targetEntity: Entity;
17185
19768
  }
17186
19769
 
19770
+ /**
19771
+ * @beta
19772
+ * This interface defines an entry into the {@link
19773
+ * CompoundBlockVolume} which represents a volume of positive
19774
+ * or negative space.
19775
+ *
19776
+ */
19777
+ export interface CompoundBlockVolumeItem {
19778
+ /**
19779
+ * @remarks
19780
+ * The 'action' defines how the block volume is represented in
19781
+ * the compound block volume stack.
19782
+ * 'Add' creates a block volume which is positively selected
19783
+ * 'Subtract' creates a block volume which represents a hole or
19784
+ * negative space in the overall compound block volume.
19785
+ *
19786
+ */
19787
+ action?: CompoundBlockVolumeAction;
19788
+ /**
19789
+ * @remarks
19790
+ * The relativity enumeration determines whether the
19791
+ * BlockVolume specified is positioned relative to the parent
19792
+ * compound block volume origin, or in absolute world space.
19793
+ *
19794
+ */
19795
+ locationRelativity?: CompoundBlockVolumePositionRelativity;
19796
+ /**
19797
+ * @remarks
19798
+ * The volume of space
19799
+ *
19800
+ */
19801
+ volume: BlockVolume;
19802
+ }
19803
+
19804
+ /**
19805
+ * @beta
19806
+ * Define the custom command, including name, permissions, and
19807
+ * parameters.
19808
+ */
19809
+ export interface CustomCommand {
19810
+ /**
19811
+ * @remarks
19812
+ * Cheats must be enabled to run this command. Defaults to
19813
+ * true.
19814
+ *
19815
+ */
19816
+ cheatsRequired?: boolean;
19817
+ /**
19818
+ * @remarks
19819
+ * Command description as seen on the command line.
19820
+ *
19821
+ */
19822
+ description: string;
19823
+ /**
19824
+ * @remarks
19825
+ * List of mandatory command parameters.
19826
+ *
19827
+ */
19828
+ mandatoryParameters?: CustomCommandParameter[];
19829
+ /**
19830
+ * @remarks
19831
+ * The name of the command. A namespace is required.
19832
+ *
19833
+ */
19834
+ name: string;
19835
+ /**
19836
+ * @remarks
19837
+ * List of optional command parameters.
19838
+ *
19839
+ */
19840
+ optionalParameters?: CustomCommandParameter[];
19841
+ /**
19842
+ * @remarks
19843
+ * The permission level required to execute the command.
19844
+ *
19845
+ */
19846
+ permissionLevel: CommandPermissionLevel;
19847
+ }
19848
+
19849
+ /**
19850
+ * @beta
19851
+ * Definition for each parameter expected by the custom
19852
+ * command.
19853
+ */
19854
+ export interface CustomCommandParameter {
19855
+ /**
19856
+ * @remarks
19857
+ * The name of parameter as it appears on the command line.
19858
+ *
19859
+ */
19860
+ name: string;
19861
+ /**
19862
+ * @remarks
19863
+ * The data type of the parameter.
19864
+ *
19865
+ */
19866
+ type: CustomCommandParamType;
19867
+ }
19868
+
19869
+ /**
19870
+ * @beta
19871
+ * Interface returned from custom command callback function.
19872
+ */
19873
+ export interface CustomCommandResult {
19874
+ /**
19875
+ * @remarks
19876
+ * Message displayed to chat after command execution.
19877
+ *
19878
+ */
19879
+ message?: string;
19880
+ /**
19881
+ * @remarks
19882
+ * Command execution Success or Failure. Determines how the
19883
+ * status message is displayed.
19884
+ *
19885
+ */
19886
+ status: CustomCommandStatus;
19887
+ }
19888
+
17187
19889
  /**
17188
19890
  * Contains a set of updates to the component definition state
17189
19891
  * of an entity.
@@ -17203,6 +19905,14 @@ export interface DefinitionModifier {
17203
19905
  *
17204
19906
  */
17205
19907
  removedComponentGroups: string[];
19908
+ /**
19909
+ * @beta
19910
+ * @remarks
19911
+ * The list of entity definition events that will be fired via
19912
+ * this update.
19913
+ *
19914
+ */
19915
+ triggers: Trigger[];
17206
19916
  }
17207
19917
 
17208
19918
  /**
@@ -17947,6 +20657,19 @@ export interface GreaterThanOrEqualsComparison {
17947
20657
  greaterThanOrEquals: number;
17948
20658
  }
17949
20659
 
20660
+ /**
20661
+ * @beta
20662
+ * Contains additional filtering options for hotbar events.
20663
+ */
20664
+ export interface HotbarEventOptions {
20665
+ /**
20666
+ * @remarks
20667
+ * The slot indexes to consider.
20668
+ *
20669
+ */
20670
+ allowedSlots?: number[];
20671
+ }
20672
+
17950
20673
  /**
17951
20674
  * An interface that is passed into {@link
17952
20675
  * @minecraft/Server.PlayerButtonInputAfterEventSignal.subscribe}
@@ -17970,6 +20693,58 @@ export interface InputEventOptions {
17970
20693
  state?: ButtonState;
17971
20694
  }
17972
20695
 
20696
+ /**
20697
+ * @beta
20698
+ * Contains additional filtering options for inventory item
20699
+ * events.
20700
+ */
20701
+ export interface InventoryItemEventOptions {
20702
+ /**
20703
+ * @remarks
20704
+ * The slot indexes to consider.
20705
+ *
20706
+ */
20707
+ allowedSlots?: number[];
20708
+ /**
20709
+ * @remarks
20710
+ * The names for the items to exclude.
20711
+ *
20712
+ */
20713
+ excludeItems?: string[];
20714
+ /**
20715
+ * @remarks
20716
+ * The item tags to exclude.
20717
+ *
20718
+ */
20719
+ excludeTags?: string[];
20720
+ /**
20721
+ * @remarks
20722
+ * Flag to specify to ignore quantity changes only. True to
20723
+ * ignore quantity changes, false to not ignore quantity
20724
+ * changes.
20725
+ *
20726
+ */
20727
+ ignoreQuantityChange?: boolean;
20728
+ /**
20729
+ * @remarks
20730
+ * The item names to consider.
20731
+ *
20732
+ */
20733
+ includeItems?: string[];
20734
+ /**
20735
+ * @remarks
20736
+ * The item tags to consider.
20737
+ *
20738
+ */
20739
+ includeTags?: string[];
20740
+ /**
20741
+ * @remarks
20742
+ * The player inventory type to consider.
20743
+ *
20744
+ */
20745
+ inventoryType?: PlayerInventoryType;
20746
+ }
20747
+
17973
20748
  /**
17974
20749
  * Contains a set of events that will be raised for an item.
17975
20750
  * This object must be bound using the ItemComponentRegistry.
@@ -18050,6 +20825,14 @@ export interface JigsawPlaceOptions {
18050
20825
  *
18051
20826
  */
18052
20827
  keepJigsaws?: boolean;
20828
+ /**
20829
+ * @beta
20830
+ * @remarks
20831
+ * Specifies how to handle waterloggable blocks overlapping
20832
+ * with existing liquid. Defaults to `ApplyWaterlogging`.
20833
+ *
20834
+ */
20835
+ liquidSettings?: LiquidSettings;
18053
20836
  }
18054
20837
 
18055
20838
  /**
@@ -18080,6 +20863,14 @@ export interface JigsawStructurePlaceOptions {
18080
20863
  *
18081
20864
  */
18082
20865
  keepJigsaws?: boolean;
20866
+ /**
20867
+ * @beta
20868
+ * @remarks
20869
+ * Specifies how to handle waterloggable blocks overlapping
20870
+ * with existing liquid. Defaults to `ApplyWaterlogging`.
20871
+ *
20872
+ */
20873
+ liquidSettings?: LiquidSettings;
18083
20874
  }
18084
20875
 
18085
20876
  /**
@@ -18181,6 +20972,38 @@ export interface PlayAnimationOptions {
18181
20972
  stopExpression?: string;
18182
20973
  }
18183
20974
 
20975
+ /**
20976
+ * @beta
20977
+ * Settings relating to a player's aim-assist targeting.
20978
+ */
20979
+ export interface PlayerAimAssistSettings {
20980
+ /**
20981
+ * @remarks
20982
+ * The view distance limit to use for aim-assist targeting.
20983
+ *
20984
+ */
20985
+ distance?: number;
20986
+ /**
20987
+ * @remarks
20988
+ * The Id of the aim-assist preset to activate. Must have a
20989
+ * namespace.
20990
+ *
20991
+ */
20992
+ presetId: string;
20993
+ /**
20994
+ * @remarks
20995
+ * The mode to use for aim-assist targeting.
20996
+ *
20997
+ */
20998
+ targetMode?: AimAssistTargetMode;
20999
+ /**
21000
+ * @remarks
21001
+ * The view angle limit to use for aim-assist targeting.
21002
+ *
21003
+ */
21004
+ viewAngle?: Vector2;
21005
+ }
21006
+
18184
21007
  /**
18185
21008
  * Additional options for how a sound plays for a player.
18186
21009
  */
@@ -18206,6 +21029,35 @@ export interface PlayerSoundOptions {
18206
21029
  volume?: number;
18207
21030
  }
18208
21031
 
21032
+ /**
21033
+ * @beta
21034
+ * Options for use in creating potions. See
21035
+ * ItemStack.createPotion.
21036
+ */
21037
+ export interface PotionOptions {
21038
+ /**
21039
+ * @remarks
21040
+ * The type of potion effect to create. See
21041
+ * @minecraft/vanilla-data.MinecraftPotionEffectTypes.
21042
+ *
21043
+ */
21044
+ effect: PotionEffectType | string;
21045
+ /**
21046
+ * @remarks
21047
+ * Optional potion liquid, defaults to 'Regular'. See
21048
+ * @minecraft/vanilla-data.MinecraftPotionLiquidTypes.
21049
+ *
21050
+ */
21051
+ liquid?: PotionLiquidType | string;
21052
+ /**
21053
+ * @remarks
21054
+ * Optional potion modifier, defaults to 'Normal'. See
21055
+ * @minecraft/vanilla-data.MinecraftPotionModifierTypes.
21056
+ *
21057
+ */
21058
+ modifier?: PotionModifierType | string;
21059
+ }
21060
+
18209
21061
  /**
18210
21062
  * Optional arguments for
18211
21063
  * @minecraft/server.EntityProjectileComponent.shoot.
@@ -18484,6 +21336,23 @@ export interface ScriptEventMessageFilterOptions {
18484
21336
  * Contains additional options for spawning an Entity.
18485
21337
  */
18486
21338
  export interface SpawnEntityOptions {
21339
+ /**
21340
+ * @beta
21341
+ * @remarks
21342
+ * Optional boolean which determines if this entity should
21343
+ * persist in the game world. Persistence prevents the entity
21344
+ * from automatically despawning.
21345
+ *
21346
+ */
21347
+ initialPersistence?: boolean;
21348
+ /**
21349
+ * @beta
21350
+ * @remarks
21351
+ * Optional initial rotation, in degrees, to set on the entity
21352
+ * when it spawns.
21353
+ *
21354
+ */
21355
+ initialRotation?: number;
18487
21356
  /**
18488
21357
  * @remarks
18489
21358
  * Optional spawn event to send to the entity after it is
@@ -18801,6 +21670,23 @@ export class CommandError extends Error {
18801
21670
  private constructor();
18802
21671
  }
18803
21672
 
21673
+ /**
21674
+ * @beta
21675
+ * Error object thrown when CustomCommandRegistry errors occur.
21676
+ */
21677
+ // @ts-ignore Class inheritance allowed for native defined classes
21678
+ export class CustomCommandError extends Error {
21679
+ private constructor();
21680
+ /**
21681
+ * @remarks
21682
+ * Reason for the error.
21683
+ *
21684
+ * This property can be read in early-execution mode.
21685
+ *
21686
+ */
21687
+ reason: CustomCommandErrorReason;
21688
+ }
21689
+
18804
21690
  // @ts-ignore Class inheritance allowed for native defined classes
18805
21691
  export class CustomComponentInvalidRegistryError extends Error {
18806
21692
  private constructor();
@@ -18832,6 +21718,14 @@ export class EnchantmentTypeUnknownIdError extends Error {
18832
21718
  private constructor();
18833
21719
  }
18834
21720
 
21721
+ /**
21722
+ * @beta
21723
+ */
21724
+ // @ts-ignore Class inheritance allowed for native defined classes
21725
+ export class InvalidContainerError extends Error {
21726
+ private constructor();
21727
+ }
21728
+
18835
21729
  /**
18836
21730
  * The container slot is invalid. This can occur when the
18837
21731
  * owning container is destroyed or unloaded.