@minecraft/server 2.9.0-rc.1.26.40-preview.20 → 2.10.0-beta.1.26.40-preview.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2908 -151
- 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
|
-
* @
|
|
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.
|
|
19
|
+
* "version": "2.10.0-beta"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -47,7 +47,15 @@ export enum AimAssistTargetMode {
|
|
|
47
47
|
* function Block.getComponent.
|
|
48
48
|
*/
|
|
49
49
|
export enum BlockComponentTypes {
|
|
50
|
+
/**
|
|
51
|
+
* @beta
|
|
52
|
+
*/
|
|
53
|
+
DynamicProperties = 'minecraft:dynamic_properties',
|
|
50
54
|
FluidContainer = 'minecraft:fluid_container',
|
|
55
|
+
/**
|
|
56
|
+
* @beta
|
|
57
|
+
*/
|
|
58
|
+
Instrument = 'minecraft:instrument_sound',
|
|
51
59
|
/**
|
|
52
60
|
* @remarks
|
|
53
61
|
* Represents the inventory of a block in the world. Used with
|
|
@@ -193,6 +201,25 @@ export enum ButtonState {
|
|
|
193
201
|
Released = 'Released',
|
|
194
202
|
}
|
|
195
203
|
|
|
204
|
+
/**
|
|
205
|
+
* @beta
|
|
206
|
+
* Represents the type of shake to apply to the camera.
|
|
207
|
+
*/
|
|
208
|
+
export enum CameraShakeType {
|
|
209
|
+
/**
|
|
210
|
+
* @remarks
|
|
211
|
+
* A positional shake that moves the camera along its axes.
|
|
212
|
+
*
|
|
213
|
+
*/
|
|
214
|
+
Positional = 'Positional',
|
|
215
|
+
/**
|
|
216
|
+
* @remarks
|
|
217
|
+
* A rotational shake that rotates the camera around its axes.
|
|
218
|
+
*
|
|
219
|
+
*/
|
|
220
|
+
Rotational = 'Rotational',
|
|
221
|
+
}
|
|
222
|
+
|
|
196
223
|
/**
|
|
197
224
|
* The required permission level to execute the custom command.
|
|
198
225
|
*/
|
|
@@ -229,6 +256,55 @@ export enum CommandPermissionLevel {
|
|
|
229
256
|
Owner = 4,
|
|
230
257
|
}
|
|
231
258
|
|
|
259
|
+
/**
|
|
260
|
+
* @beta
|
|
261
|
+
* The Action enum determines how the CompoundBlockVolume
|
|
262
|
+
* considers the associated CompoundBlockVolumeItem when
|
|
263
|
+
* performing inside/outside calculations.
|
|
264
|
+
*/
|
|
265
|
+
export enum CompoundBlockVolumeAction {
|
|
266
|
+
/**
|
|
267
|
+
* @remarks
|
|
268
|
+
* The associated BlockVolume is considered a positive space,
|
|
269
|
+
* and any intersection tests are considered hits
|
|
270
|
+
*
|
|
271
|
+
*/
|
|
272
|
+
Add = 0,
|
|
273
|
+
/**
|
|
274
|
+
* @remarks
|
|
275
|
+
* The associated BlockVolume is considered a negative or void
|
|
276
|
+
* space, and any intersection tests are considered misses.
|
|
277
|
+
* Using the Subtract action, it is possible to `punch holes`
|
|
278
|
+
* in block volumes so that any intersection tests may pass
|
|
279
|
+
* through such spaces
|
|
280
|
+
*
|
|
281
|
+
*/
|
|
282
|
+
Subtract = 1,
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @beta
|
|
287
|
+
* An enum describing the relativity of the
|
|
288
|
+
* CompoundBlockVolumeItem, relative to the parent
|
|
289
|
+
* CompoundVolume.
|
|
290
|
+
*/
|
|
291
|
+
export enum CompoundBlockVolumePositionRelativity {
|
|
292
|
+
/**
|
|
293
|
+
* @remarks
|
|
294
|
+
* The locations within the associated BlockVolume are relative
|
|
295
|
+
* to the CompoundBlockVolume to which they were added
|
|
296
|
+
*
|
|
297
|
+
*/
|
|
298
|
+
Relative = 0,
|
|
299
|
+
/**
|
|
300
|
+
* @remarks
|
|
301
|
+
* The locations within the associated BlockVolume are in
|
|
302
|
+
* absolute world space
|
|
303
|
+
*
|
|
304
|
+
*/
|
|
305
|
+
Absolute = 1,
|
|
306
|
+
}
|
|
307
|
+
|
|
232
308
|
/**
|
|
233
309
|
* Reasons that the {@link
|
|
234
310
|
* @minecraft/server.ContainerRulesError} was thrown.
|
|
@@ -331,6 +407,13 @@ export enum CustomCommandErrorReason {
|
|
|
331
407
|
*
|
|
332
408
|
*/
|
|
333
409
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
410
|
+
/**
|
|
411
|
+
* @beta
|
|
412
|
+
* @remarks
|
|
413
|
+
* Non enum type command parameters cannot use enumName.
|
|
414
|
+
*
|
|
415
|
+
*/
|
|
416
|
+
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
334
417
|
}
|
|
335
418
|
|
|
336
419
|
/**
|
|
@@ -1068,6 +1151,14 @@ export enum EntityComponentTypes {
|
|
|
1068
1151
|
*
|
|
1069
1152
|
*/
|
|
1070
1153
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1154
|
+
/**
|
|
1155
|
+
* @beta
|
|
1156
|
+
* @remarks
|
|
1157
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
1158
|
+
* name, and dialogue interactions.
|
|
1159
|
+
*
|
|
1160
|
+
*/
|
|
1161
|
+
Npc = 'minecraft:npc',
|
|
1071
1162
|
/**
|
|
1072
1163
|
* @remarks
|
|
1073
1164
|
* When present on an entity, this entity is on fire.
|
|
@@ -1081,6 +1172,15 @@ export enum EntityComponentTypes {
|
|
|
1081
1172
|
*
|
|
1082
1173
|
*/
|
|
1083
1174
|
Exhaustion = 'minecraft:player.exhaustion',
|
|
1175
|
+
/**
|
|
1176
|
+
* @beta
|
|
1177
|
+
* @remarks
|
|
1178
|
+
* Use this component to access and manipulate the fog
|
|
1179
|
+
* definitions stack of a player. This is only available on
|
|
1180
|
+
* players.
|
|
1181
|
+
*
|
|
1182
|
+
*/
|
|
1183
|
+
Fog = 'minecraft:player.fog',
|
|
1084
1184
|
/**
|
|
1085
1185
|
* @remarks
|
|
1086
1186
|
* Use this component to read the hunger of a player. This is
|
|
@@ -1552,6 +1652,14 @@ export enum EntitySwingSource {
|
|
|
1552
1652
|
* and mainhand slots.
|
|
1553
1653
|
*/
|
|
1554
1654
|
export enum EquipmentSlot {
|
|
1655
|
+
/**
|
|
1656
|
+
* @beta
|
|
1657
|
+
* @remarks
|
|
1658
|
+
* The body slot. This slot is used to hold armor for
|
|
1659
|
+
* non-humanoid mobs.
|
|
1660
|
+
*
|
|
1661
|
+
*/
|
|
1662
|
+
Body = 'Body',
|
|
1555
1663
|
/**
|
|
1556
1664
|
* @remarks
|
|
1557
1665
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1821,6 +1929,14 @@ export enum GameRule {
|
|
|
1821
1929
|
*
|
|
1822
1930
|
*/
|
|
1823
1931
|
PlayersSleepingPercentage = 'playersSleepingPercentage',
|
|
1932
|
+
/**
|
|
1933
|
+
* @beta
|
|
1934
|
+
* @remarks
|
|
1935
|
+
* Controls which player waypoints are automatically added to
|
|
1936
|
+
* the players locator bar.
|
|
1937
|
+
*
|
|
1938
|
+
*/
|
|
1939
|
+
PlayerWaypoints = 'playerWaypoints',
|
|
1824
1940
|
/**
|
|
1825
1941
|
* @remarks
|
|
1826
1942
|
* Controls whether projectiles (entities with a projectile
|
|
@@ -2170,6 +2286,10 @@ export enum InputPermissionCategory {
|
|
|
2170
2286
|
* function ItemStack.getComponent.
|
|
2171
2287
|
*/
|
|
2172
2288
|
export enum ItemComponentTypes {
|
|
2289
|
+
/**
|
|
2290
|
+
* @beta
|
|
2291
|
+
*/
|
|
2292
|
+
BlockDynamicProperties = 'minecraft:block_actor_dynamic_properties',
|
|
2173
2293
|
/**
|
|
2174
2294
|
* @remarks
|
|
2175
2295
|
* The minecraft:book component.
|
|
@@ -2611,6 +2731,14 @@ export enum PlayerPermissionLevel {
|
|
|
2611
2731
|
Custom = 3,
|
|
2612
2732
|
}
|
|
2613
2733
|
|
|
2734
|
+
/**
|
|
2735
|
+
* @beta
|
|
2736
|
+
*/
|
|
2737
|
+
export enum PlayerWaypointsMode {
|
|
2738
|
+
Everyone = 'Everyone',
|
|
2739
|
+
Off = 'Off',
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2614
2742
|
/**
|
|
2615
2743
|
* Contains objectives and participants for the scoreboard.
|
|
2616
2744
|
*/
|
|
@@ -2937,6 +3065,29 @@ export enum TintMethod {
|
|
|
2937
3065
|
Water = 'Water',
|
|
2938
3066
|
}
|
|
2939
3067
|
|
|
3068
|
+
/**
|
|
3069
|
+
* @beta
|
|
3070
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
3071
|
+
* to terminate execution of a behavior packs' script.
|
|
3072
|
+
*/
|
|
3073
|
+
export enum WatchdogTerminateReason {
|
|
3074
|
+
/**
|
|
3075
|
+
* @remarks
|
|
3076
|
+
* Script runtime for a behavior pack is terminated due to
|
|
3077
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
3078
|
+
*
|
|
3079
|
+
*/
|
|
3080
|
+
Hang = 'Hang',
|
|
3081
|
+
/**
|
|
3082
|
+
* @remarks
|
|
3083
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3084
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3085
|
+
* function calls.
|
|
3086
|
+
*
|
|
3087
|
+
*/
|
|
3088
|
+
StackOverflow = 'StackOverflow',
|
|
3089
|
+
}
|
|
3090
|
+
|
|
2940
3091
|
/**
|
|
2941
3092
|
* @rc
|
|
2942
3093
|
* Enum representing different texture icons that can be
|
|
@@ -2999,10 +3150,14 @@ export type BlockComponentReturnType<T extends string> = T extends keyof BlockCo
|
|
|
2999
3150
|
: BlockCustomComponentInstance;
|
|
3000
3151
|
|
|
3001
3152
|
export type BlockComponentTypeMap = {
|
|
3153
|
+
dynamic_properties: BlockDynamicPropertiesComponent;
|
|
3002
3154
|
fluid_container: BlockFluidContainerComponent;
|
|
3155
|
+
instrument_sound: BlockInstrumentComponent;
|
|
3003
3156
|
inventory: BlockInventoryComponent;
|
|
3004
3157
|
map_color: BlockMapColorComponent;
|
|
3158
|
+
'minecraft:dynamic_properties': BlockDynamicPropertiesComponent;
|
|
3005
3159
|
'minecraft:fluid_container': BlockFluidContainerComponent;
|
|
3160
|
+
'minecraft:instrument_sound': BlockInstrumentComponent;
|
|
3006
3161
|
'minecraft:inventory': BlockInventoryComponent;
|
|
3007
3162
|
'minecraft:map_color': BlockMapColorComponent;
|
|
3008
3163
|
'minecraft:movable': BlockMovableComponent;
|
|
@@ -3122,8 +3277,10 @@ export type EntityComponentTypeMap = {
|
|
|
3122
3277
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
3123
3278
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
3124
3279
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3280
|
+
'minecraft:npc': EntityNpcComponent;
|
|
3125
3281
|
'minecraft:onfire': EntityOnFireComponent;
|
|
3126
3282
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
3283
|
+
'minecraft:player.fog': EntityFogComponent;
|
|
3127
3284
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
3128
3285
|
'minecraft:player.saturation': EntitySaturationComponent;
|
|
3129
3286
|
'minecraft:projectile': EntityProjectileComponent;
|
|
@@ -3155,8 +3312,10 @@ export type EntityComponentTypeMap = {
|
|
|
3155
3312
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3156
3313
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3157
3314
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3315
|
+
npc: EntityNpcComponent;
|
|
3158
3316
|
onfire: EntityOnFireComponent;
|
|
3159
3317
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3318
|
+
'player.fog': EntityFogComponent;
|
|
3160
3319
|
'player.hunger': EntityHungerComponent;
|
|
3161
3320
|
'player.saturation': EntitySaturationComponent;
|
|
3162
3321
|
projectile: EntityProjectileComponent;
|
|
@@ -3174,11 +3333,21 @@ export type EntityComponentTypeMap = {
|
|
|
3174
3333
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3175
3334
|
};
|
|
3176
3335
|
|
|
3336
|
+
/**
|
|
3337
|
+
* @beta
|
|
3338
|
+
*/
|
|
3339
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3340
|
+
? VanillaEntityIdentifier
|
|
3341
|
+
: T extends string
|
|
3342
|
+
? VanillaEntityIdentifier | T
|
|
3343
|
+
: never;
|
|
3344
|
+
|
|
3177
3345
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3178
3346
|
? ItemComponentTypeMap[T]
|
|
3179
3347
|
: ItemCustomComponentInstance;
|
|
3180
3348
|
|
|
3181
3349
|
export type ItemComponentTypeMap = {
|
|
3350
|
+
block_actor_dynamic_properties: ItemBlockDynamicPropertiesComponent;
|
|
3182
3351
|
book: ItemBookComponent;
|
|
3183
3352
|
compostable: ItemCompostableComponent;
|
|
3184
3353
|
cooldown: ItemCooldownComponent;
|
|
@@ -3187,6 +3356,7 @@ export type ItemComponentTypeMap = {
|
|
|
3187
3356
|
enchantable: ItemEnchantableComponent;
|
|
3188
3357
|
food: ItemFoodComponent;
|
|
3189
3358
|
inventory: ItemInventoryComponent;
|
|
3359
|
+
'minecraft:block_actor_dynamic_properties': ItemBlockDynamicPropertiesComponent;
|
|
3190
3360
|
'minecraft:book': ItemBookComponent;
|
|
3191
3361
|
'minecraft:compostable': ItemCompostableComponent;
|
|
3192
3362
|
'minecraft:cooldown': ItemCooldownComponent;
|
|
@@ -3199,6 +3369,15 @@ export type ItemComponentTypeMap = {
|
|
|
3199
3369
|
potion: ItemPotionComponent;
|
|
3200
3370
|
};
|
|
3201
3371
|
|
|
3372
|
+
/**
|
|
3373
|
+
* @beta
|
|
3374
|
+
*/
|
|
3375
|
+
export type VanillaEntityIdentifier =
|
|
3376
|
+
| EntityType
|
|
3377
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3378
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3379
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3380
|
+
|
|
3202
3381
|
/**
|
|
3203
3382
|
* Handle to an aim-assist category that exists in the
|
|
3204
3383
|
* world.aimAssist registry.
|
|
@@ -3356,7 +3535,9 @@ export class AimAssistCategorySettings {
|
|
|
3356
3535
|
* A record mapping block Ids to their priority settings.
|
|
3357
3536
|
* Larger numbers have greater priority.
|
|
3358
3537
|
*/
|
|
3359
|
-
setBlockPriorities(
|
|
3538
|
+
setBlockPriorities(
|
|
3539
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3540
|
+
): void;
|
|
3360
3541
|
/**
|
|
3361
3542
|
* @remarks
|
|
3362
3543
|
* Sets the priority settings used for block targeting.
|
|
@@ -3375,7 +3556,9 @@ export class AimAssistCategorySettings {
|
|
|
3375
3556
|
* A record mapping entity Ids to their priority settings.
|
|
3376
3557
|
* Larger numbers have greater priority.
|
|
3377
3558
|
*/
|
|
3378
|
-
setEntityPriorities(
|
|
3559
|
+
setEntityPriorities(
|
|
3560
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3561
|
+
): void;
|
|
3379
3562
|
/**
|
|
3380
3563
|
* @remarks
|
|
3381
3564
|
* Sets the priority settings used for entity targeting.
|
|
@@ -3574,8 +3757,10 @@ export class AimAssistPresetSettings {
|
|
|
3574
3757
|
*
|
|
3575
3758
|
* This function can't be called in restricted-execution mode.
|
|
3576
3759
|
*
|
|
3760
|
+
* @param targets
|
|
3761
|
+
* An array of block tags.
|
|
3577
3762
|
*/
|
|
3578
|
-
setExcludedBlockTagTargets(
|
|
3763
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3579
3764
|
/**
|
|
3580
3765
|
* @remarks
|
|
3581
3766
|
* Sets the list of block Ids to exclude from aim assist
|
|
@@ -3583,8 +3768,10 @@ export class AimAssistPresetSettings {
|
|
|
3583
3768
|
*
|
|
3584
3769
|
* This function can't be called in restricted-execution mode.
|
|
3585
3770
|
*
|
|
3771
|
+
* @param targets
|
|
3772
|
+
* An array of block Ids.
|
|
3586
3773
|
*/
|
|
3587
|
-
setExcludedBlockTargets(
|
|
3774
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3588
3775
|
/**
|
|
3589
3776
|
* @remarks
|
|
3590
3777
|
* Sets the list of entity Ids to exclude from aim assist
|
|
@@ -3592,8 +3779,10 @@ export class AimAssistPresetSettings {
|
|
|
3592
3779
|
*
|
|
3593
3780
|
* This function can't be called in restricted-execution mode.
|
|
3594
3781
|
*
|
|
3782
|
+
* @param targets
|
|
3783
|
+
* An array of entity Ids.
|
|
3595
3784
|
*/
|
|
3596
|
-
setExcludedEntityTargets(
|
|
3785
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3597
3786
|
/**
|
|
3598
3787
|
* @remarks
|
|
3599
3788
|
* Sets the list of entity type families to exclude from aim
|
|
@@ -3601,8 +3790,10 @@ export class AimAssistPresetSettings {
|
|
|
3601
3790
|
*
|
|
3602
3791
|
* This function can't be called in restricted-execution mode.
|
|
3603
3792
|
*
|
|
3793
|
+
* @param targets
|
|
3794
|
+
* An array of entity type families.
|
|
3604
3795
|
*/
|
|
3605
|
-
setExcludedEntityTypeFamilyTargets(
|
|
3796
|
+
setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
|
|
3606
3797
|
/**
|
|
3607
3798
|
* @remarks
|
|
3608
3799
|
* Sets the per-item aim-assist category Ids.
|
|
@@ -3613,7 +3804,7 @@ export class AimAssistPresetSettings {
|
|
|
3613
3804
|
* A record mapping item Ids to aim-assist category Ids.
|
|
3614
3805
|
* Category Ids must have a namespace.
|
|
3615
3806
|
*/
|
|
3616
|
-
setItemSettings(itemSettings: Record<string, string>): void;
|
|
3807
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3617
3808
|
/**
|
|
3618
3809
|
* @remarks
|
|
3619
3810
|
* Sets the list of item Ids that will target liquid blocks
|
|
@@ -3624,7 +3815,7 @@ export class AimAssistPresetSettings {
|
|
|
3624
3815
|
* @param items
|
|
3625
3816
|
* An array of item Ids.
|
|
3626
3817
|
*/
|
|
3627
|
-
setLiquidTargetingItems(items?: string[]): void;
|
|
3818
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3628
3819
|
}
|
|
3629
3820
|
|
|
3630
3821
|
/**
|
|
@@ -3730,6 +3921,28 @@ export class AimAssistRegistry {
|
|
|
3730
3921
|
getPresets(): AimAssistPreset[];
|
|
3731
3922
|
}
|
|
3732
3923
|
|
|
3924
|
+
/**
|
|
3925
|
+
* @beta
|
|
3926
|
+
* Describes a single banner pattern, which includes a colour
|
|
3927
|
+
* and a pattern type.
|
|
3928
|
+
*/
|
|
3929
|
+
export class BannerPattern {
|
|
3930
|
+
private constructor();
|
|
3931
|
+
/**
|
|
3932
|
+
* @remarks
|
|
3933
|
+
* The color to apply to this banner pattern.
|
|
3934
|
+
*
|
|
3935
|
+
*/
|
|
3936
|
+
readonly color: string;
|
|
3937
|
+
/**
|
|
3938
|
+
* @remarks
|
|
3939
|
+
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
3940
|
+
* apply to the banner.
|
|
3941
|
+
*
|
|
3942
|
+
*/
|
|
3943
|
+
readonly pattern: string;
|
|
3944
|
+
}
|
|
3945
|
+
|
|
3733
3946
|
/**
|
|
3734
3947
|
* Describes a type of biome.
|
|
3735
3948
|
*/
|
|
@@ -3823,6 +4036,20 @@ export class Block {
|
|
|
3823
4036
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3824
4037
|
*/
|
|
3825
4038
|
readonly isLiquid: boolean;
|
|
4039
|
+
/**
|
|
4040
|
+
* @beta
|
|
4041
|
+
* @remarks
|
|
4042
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
4043
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
4044
|
+
* ladder block and a fence block are not).
|
|
4045
|
+
*
|
|
4046
|
+
* @throws This property can throw when used.
|
|
4047
|
+
*
|
|
4048
|
+
* {@link LocationInUnloadedChunkError}
|
|
4049
|
+
*
|
|
4050
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4051
|
+
*/
|
|
4052
|
+
readonly isSolid: boolean;
|
|
3826
4053
|
/**
|
|
3827
4054
|
* @remarks
|
|
3828
4055
|
* Returns true if this reference to a block is still valid
|
|
@@ -3988,6 +4215,30 @@ export class Block {
|
|
|
3988
4215
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3989
4216
|
*/
|
|
3990
4217
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4218
|
+
/**
|
|
4219
|
+
* @beta
|
|
4220
|
+
* @remarks
|
|
4221
|
+
* Checks to see whether it is valid to place the specified
|
|
4222
|
+
* block type or block permutation, on a specified face on this
|
|
4223
|
+
* block.
|
|
4224
|
+
*
|
|
4225
|
+
* @param blockToPlace
|
|
4226
|
+
* Block type or block permutation to check placement for.
|
|
4227
|
+
* @param faceToPlaceOn
|
|
4228
|
+
* Optional specific face of this block to check placement
|
|
4229
|
+
* against.
|
|
4230
|
+
* @returns
|
|
4231
|
+
* Returns `true` if the block type or permutation can be
|
|
4232
|
+
* placed on this block, else `false`.
|
|
4233
|
+
* @throws This function can throw errors.
|
|
4234
|
+
*
|
|
4235
|
+
* {@link Error}
|
|
4236
|
+
*
|
|
4237
|
+
* {@link LocationInUnloadedChunkError}
|
|
4238
|
+
*
|
|
4239
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4240
|
+
*/
|
|
4241
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
3991
4242
|
/**
|
|
3992
4243
|
* @remarks
|
|
3993
4244
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -4084,6 +4335,29 @@ export class Block {
|
|
|
4084
4335
|
* {@link LocationInUnloadedChunkError}
|
|
4085
4336
|
*/
|
|
4086
4337
|
getLightLevel(): number;
|
|
4338
|
+
/**
|
|
4339
|
+
* @beta
|
|
4340
|
+
* @throws This function can throw errors.
|
|
4341
|
+
*
|
|
4342
|
+
* {@link LocationInUnloadedChunkError}
|
|
4343
|
+
*
|
|
4344
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4345
|
+
*/
|
|
4346
|
+
getMapColor(): RGBA;
|
|
4347
|
+
/**
|
|
4348
|
+
* @beta
|
|
4349
|
+
* @remarks
|
|
4350
|
+
* Returns array of all loaded block parts if this block has
|
|
4351
|
+
* the 'minecraft:multi_block' trait. If it does not have the
|
|
4352
|
+
* trait returns undefined
|
|
4353
|
+
*
|
|
4354
|
+
* @throws This function can throw errors.
|
|
4355
|
+
*
|
|
4356
|
+
* {@link LocationInUnloadedChunkError}
|
|
4357
|
+
*
|
|
4358
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4359
|
+
*/
|
|
4360
|
+
getParts(): Block[] | undefined;
|
|
4087
4361
|
/**
|
|
4088
4362
|
* @remarks
|
|
4089
4363
|
* Returns the net redstone power of this block.
|
|
@@ -4351,6 +4625,27 @@ export class Block {
|
|
|
4351
4625
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4352
4626
|
*/
|
|
4353
4627
|
south(steps?: number): Block | undefined;
|
|
4628
|
+
/**
|
|
4629
|
+
* @beta
|
|
4630
|
+
* @remarks
|
|
4631
|
+
* Tries to set the block in the dimension to the state of the
|
|
4632
|
+
* permutation by first checking if the placement is valid.
|
|
4633
|
+
*
|
|
4634
|
+
* This function can't be called in restricted-execution mode.
|
|
4635
|
+
*
|
|
4636
|
+
* @param permutation
|
|
4637
|
+
* Permutation that contains a set of property states for the
|
|
4638
|
+
* Block.
|
|
4639
|
+
* @returns
|
|
4640
|
+
* Returns `true` if the block permutation data was
|
|
4641
|
+
* successfully set, else `false`.
|
|
4642
|
+
* @throws This function can throw errors.
|
|
4643
|
+
*
|
|
4644
|
+
* {@link LocationInUnloadedChunkError}
|
|
4645
|
+
*
|
|
4646
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4647
|
+
*/
|
|
4648
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4354
4649
|
/**
|
|
4355
4650
|
* @remarks
|
|
4356
4651
|
* Returns the {@link Block} to the west of this block
|
|
@@ -4368,6 +4663,137 @@ export class Block {
|
|
|
4368
4663
|
west(steps?: number): Block | undefined;
|
|
4369
4664
|
}
|
|
4370
4665
|
|
|
4666
|
+
/**
|
|
4667
|
+
* @beta
|
|
4668
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4669
|
+
* of useful functions for the creation and utility of {@link
|
|
4670
|
+
* BlockBoundingBox} objects
|
|
4671
|
+
*/
|
|
4672
|
+
export class BlockBoundingBoxUtils {
|
|
4673
|
+
private constructor();
|
|
4674
|
+
/**
|
|
4675
|
+
* @remarks
|
|
4676
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4677
|
+
* where the min and max components are guaranteed to be (min
|
|
4678
|
+
* <= max)
|
|
4679
|
+
*
|
|
4680
|
+
* This function can't be called in restricted-execution mode.
|
|
4681
|
+
*
|
|
4682
|
+
* @param min
|
|
4683
|
+
* A corner world location
|
|
4684
|
+
* @param max
|
|
4685
|
+
* A corner world location diametrically opposite
|
|
4686
|
+
*/
|
|
4687
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4688
|
+
/**
|
|
4689
|
+
* @remarks
|
|
4690
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4691
|
+
* each axis.
|
|
4692
|
+
* Sizes can be negative to perform contraction.
|
|
4693
|
+
* Note: corners can be inverted if the contraction size is
|
|
4694
|
+
* greater than the span, but the min/max relationship will
|
|
4695
|
+
* remain correct
|
|
4696
|
+
*
|
|
4697
|
+
* This function can't be called in restricted-execution mode.
|
|
4698
|
+
*
|
|
4699
|
+
* @returns
|
|
4700
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4701
|
+
* the changes
|
|
4702
|
+
*/
|
|
4703
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4704
|
+
/**
|
|
4705
|
+
* @remarks
|
|
4706
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4707
|
+
*
|
|
4708
|
+
* This function can't be called in restricted-execution mode.
|
|
4709
|
+
*
|
|
4710
|
+
*/
|
|
4711
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4712
|
+
/**
|
|
4713
|
+
* @remarks
|
|
4714
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4715
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4716
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4717
|
+
* boxes.
|
|
4718
|
+
*
|
|
4719
|
+
* This function can't be called in restricted-execution mode.
|
|
4720
|
+
*
|
|
4721
|
+
* @returns
|
|
4722
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4723
|
+
* smallest possible bounding box which can encompass both
|
|
4724
|
+
*/
|
|
4725
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4726
|
+
/**
|
|
4727
|
+
* @remarks
|
|
4728
|
+
* Calculate the center block of a given {@link
|
|
4729
|
+
* BlockBoundingBox} object.
|
|
4730
|
+
*
|
|
4731
|
+
* This function can't be called in restricted-execution mode.
|
|
4732
|
+
*
|
|
4733
|
+
* @returns
|
|
4734
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4735
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4736
|
+
* bounds are not mathematically centered...
|
|
4737
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4738
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4739
|
+
*/
|
|
4740
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4741
|
+
/**
|
|
4742
|
+
* @remarks
|
|
4743
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4744
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4745
|
+
*
|
|
4746
|
+
* This function can't be called in restricted-execution mode.
|
|
4747
|
+
*
|
|
4748
|
+
*/
|
|
4749
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4750
|
+
/**
|
|
4751
|
+
* @remarks
|
|
4752
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4753
|
+
*
|
|
4754
|
+
* This function can't be called in restricted-execution mode.
|
|
4755
|
+
*
|
|
4756
|
+
*/
|
|
4757
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4758
|
+
/**
|
|
4759
|
+
* @remarks
|
|
4760
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4761
|
+
*
|
|
4762
|
+
* This function can't be called in restricted-execution mode.
|
|
4763
|
+
*
|
|
4764
|
+
*/
|
|
4765
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4766
|
+
/**
|
|
4767
|
+
* @remarks
|
|
4768
|
+
* Check to see if a given coordinate is inside a
|
|
4769
|
+
* BlockBoundingBox
|
|
4770
|
+
*
|
|
4771
|
+
* This function can't be called in restricted-execution mode.
|
|
4772
|
+
*
|
|
4773
|
+
*/
|
|
4774
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4775
|
+
/**
|
|
4776
|
+
* @remarks
|
|
4777
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4778
|
+
* max))
|
|
4779
|
+
*
|
|
4780
|
+
* This function can't be called in restricted-execution mode.
|
|
4781
|
+
*
|
|
4782
|
+
*/
|
|
4783
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4784
|
+
/**
|
|
4785
|
+
* @remarks
|
|
4786
|
+
* Move a BlockBoundingBox by a given amount
|
|
4787
|
+
*
|
|
4788
|
+
* This function can't be called in restricted-execution mode.
|
|
4789
|
+
*
|
|
4790
|
+
* @returns
|
|
4791
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4792
|
+
* change
|
|
4793
|
+
*/
|
|
4794
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4795
|
+
}
|
|
4796
|
+
|
|
4371
4797
|
/**
|
|
4372
4798
|
* Base type for components associated with blocks.
|
|
4373
4799
|
*/
|
|
@@ -4591,6 +5017,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
|
|
|
4591
5017
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4592
5018
|
export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
|
|
4593
5019
|
private constructor();
|
|
5020
|
+
/**
|
|
5021
|
+
* @beta
|
|
5022
|
+
* @remarks
|
|
5023
|
+
* The first update event for the redstone component.
|
|
5024
|
+
*
|
|
5025
|
+
*/
|
|
5026
|
+
readonly firstUpdate: boolean;
|
|
4594
5027
|
/**
|
|
4595
5028
|
* @remarks
|
|
4596
5029
|
* The redstone signal strength passing through this block. It
|
|
@@ -4787,20 +5220,122 @@ export class BlockCustomComponentInstance extends BlockComponent {
|
|
|
4787
5220
|
}
|
|
4788
5221
|
|
|
4789
5222
|
/**
|
|
4790
|
-
*
|
|
4791
|
-
*
|
|
5223
|
+
* @beta
|
|
5224
|
+
* Represents the dynamic properties of a block in the world.
|
|
5225
|
+
* Only available with block entities. Up to 1KBytes of data
|
|
5226
|
+
* can be stored per block entity in their dynamic properties
|
|
5227
|
+
* storage.
|
|
5228
|
+
* @example rememberPlayerInteraction.ts
|
|
5229
|
+
* ```typescript
|
|
5230
|
+
* import { system } from '@minecraft/server-wrapper';
|
|
5231
|
+
*
|
|
5232
|
+
* system.beforeEvents.startup.subscribe(initEvent => {
|
|
5233
|
+
* initEvent.blockComponentRegistry.registerCustomComponent('scripting_demo_pack:block_entity_onPlayerInteract', {
|
|
5234
|
+
* onPlayerInteract: e => {
|
|
5235
|
+
* if (e.player === undefined) {
|
|
5236
|
+
* return;
|
|
5237
|
+
* }
|
|
5238
|
+
*
|
|
5239
|
+
* const dynamicProperties = e.block.getComponent('minecraft:dynamic_properties');
|
|
5240
|
+
* if (!dynamicProperties) {
|
|
5241
|
+
* return;
|
|
5242
|
+
* }
|
|
5243
|
+
*
|
|
5244
|
+
* const lastInteractorValue = dynamicProperties.get('last_interactor');
|
|
5245
|
+
* const lastVisitor = typeof lastInteractorValue === 'string' ? lastInteractorValue : 'unknown';
|
|
5246
|
+
* const lastTick = Number(dynamicProperties.get('last_interact_tick') ?? system.currentTick);
|
|
5247
|
+
* const ticksAgo = Math.max(0, system.currentTick - lastTick);
|
|
5248
|
+
*
|
|
5249
|
+
* if (lastVisitor === e.player.name) {
|
|
5250
|
+
* e.player.sendMessage("do you remember that player? I 'member, it was here " + String(ticksAgo) + ' ticks ago!');
|
|
5251
|
+
* } else {
|
|
5252
|
+
* e.player.sendMessage("oh, I don't remember that player");
|
|
5253
|
+
* }
|
|
5254
|
+
*
|
|
5255
|
+
* dynamicProperties.set('last_interactor', e.player.name);
|
|
5256
|
+
* dynamicProperties.set('last_interact_tick', system.currentTick);
|
|
5257
|
+
* },
|
|
5258
|
+
* });
|
|
5259
|
+
* });
|
|
5260
|
+
* ```
|
|
4792
5261
|
*/
|
|
4793
|
-
|
|
5262
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5263
|
+
export class BlockDynamicPropertiesComponent extends BlockComponent {
|
|
4794
5264
|
private constructor();
|
|
5265
|
+
static readonly componentId = 'minecraft:dynamic_properties';
|
|
4795
5266
|
/**
|
|
4796
5267
|
* @remarks
|
|
4797
|
-
*
|
|
5268
|
+
* Returns a DynamicProperty that was stored with the provided
|
|
5269
|
+
* key. Keys are unique to each content pack and cannot be used
|
|
5270
|
+
* to retrieve dynamic properties set from other content packs.
|
|
5271
|
+
* Returns undefined if the key was not found.
|
|
4798
5272
|
*
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
*
|
|
4803
|
-
*
|
|
5273
|
+
* @throws This function can throw errors.
|
|
5274
|
+
*
|
|
5275
|
+
* {@link Error}
|
|
5276
|
+
*
|
|
5277
|
+
* {@link InvalidBlockComponentError}
|
|
5278
|
+
*
|
|
5279
|
+
* {@link LocationInUnloadedChunkError}
|
|
5280
|
+
*
|
|
5281
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5282
|
+
*/
|
|
5283
|
+
get(key: string): boolean | number | string | Vector3 | undefined;
|
|
5284
|
+
/**
|
|
5285
|
+
* @remarks
|
|
5286
|
+
* Sets a dynamic property with the provided key and value.
|
|
5287
|
+
* Keys are unique to each content pack and cannot be used to
|
|
5288
|
+
* set dynamic properties for other content packs. Values can
|
|
5289
|
+
* be either a Number, a String or a Vector3. Setting a
|
|
5290
|
+
* property with an undefined value will remove it from the
|
|
5291
|
+
* storage.
|
|
5292
|
+
*
|
|
5293
|
+
* This function can't be called in restricted-execution mode.
|
|
5294
|
+
*
|
|
5295
|
+
* @throws This function can throw errors.
|
|
5296
|
+
*
|
|
5297
|
+
* {@link Error}
|
|
5298
|
+
*
|
|
5299
|
+
* {@link InvalidBlockComponentError}
|
|
5300
|
+
*
|
|
5301
|
+
* {@link LocationInUnloadedChunkError}
|
|
5302
|
+
*
|
|
5303
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5304
|
+
*/
|
|
5305
|
+
set(key: string, value?: boolean | number | string | Vector3): void;
|
|
5306
|
+
/**
|
|
5307
|
+
* @remarks
|
|
5308
|
+
* Returns the current size, in bytes, of the dynamic
|
|
5309
|
+
* properties storage for this block entity.
|
|
5310
|
+
*
|
|
5311
|
+
* @throws This function can throw errors.
|
|
5312
|
+
*
|
|
5313
|
+
* {@link Error}
|
|
5314
|
+
*
|
|
5315
|
+
* {@link InvalidBlockComponentError}
|
|
5316
|
+
*
|
|
5317
|
+
* {@link LocationInUnloadedChunkError}
|
|
5318
|
+
*
|
|
5319
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5320
|
+
*/
|
|
5321
|
+
totalByteCount(): number;
|
|
5322
|
+
}
|
|
5323
|
+
|
|
5324
|
+
/**
|
|
5325
|
+
* Contains information regarding an event that impacts a
|
|
5326
|
+
* specific block.
|
|
5327
|
+
*/
|
|
5328
|
+
export class BlockEvent {
|
|
5329
|
+
private constructor();
|
|
5330
|
+
/**
|
|
5331
|
+
* @remarks
|
|
5332
|
+
* Block currently in the world at the location of this event.
|
|
5333
|
+
*
|
|
5334
|
+
*/
|
|
5335
|
+
readonly block: Block;
|
|
5336
|
+
/**
|
|
5337
|
+
* @remarks
|
|
5338
|
+
* Dimension that contains the block that is the subject of
|
|
4804
5339
|
* this event.
|
|
4805
5340
|
*
|
|
4806
5341
|
*/
|
|
@@ -4922,6 +5457,58 @@ export class BlockFluidContainerComponent extends BlockComponent {
|
|
|
4922
5457
|
setPotion(itemStack: ItemStack): void;
|
|
4923
5458
|
}
|
|
4924
5459
|
|
|
5460
|
+
/**
|
|
5461
|
+
* @beta
|
|
5462
|
+
* Represents the instruments a block can have assigned to it's
|
|
5463
|
+
* up and down faces.
|
|
5464
|
+
*/
|
|
5465
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5466
|
+
export class BlockInstrumentComponent extends BlockComponent {
|
|
5467
|
+
private constructor();
|
|
5468
|
+
static readonly componentId = 'minecraft:instrument_sound';
|
|
5469
|
+
/**
|
|
5470
|
+
* @remarks
|
|
5471
|
+
* A getter method to get the name of an instrument for a given
|
|
5472
|
+
* valid face Direction.
|
|
5473
|
+
*
|
|
5474
|
+
* @param face
|
|
5475
|
+
* the face Direction to get the instrument name for.
|
|
5476
|
+
* @returns
|
|
5477
|
+
* Returns the name of the instrument for a given valid face
|
|
5478
|
+
* Direction.
|
|
5479
|
+
* @throws This function can throw errors.
|
|
5480
|
+
*
|
|
5481
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
5482
|
+
*
|
|
5483
|
+
* {@link LocationInUnloadedChunkError}
|
|
5484
|
+
*
|
|
5485
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5486
|
+
*/
|
|
5487
|
+
getInstrumentName(face: Direction): string;
|
|
5488
|
+
/**
|
|
5489
|
+
* @remarks
|
|
5490
|
+
* plays the instrument sound for a given valid face Direction
|
|
5491
|
+
* at the components block location using optional
|
|
5492
|
+
* WorldSoundOptions.
|
|
5493
|
+
*
|
|
5494
|
+
* This function can't be called in restricted-execution mode.
|
|
5495
|
+
*
|
|
5496
|
+
* @param face
|
|
5497
|
+
* the face Direction for which instrument sound to play.
|
|
5498
|
+
* @param soundOptions
|
|
5499
|
+
* optional WorldSoundOptions to use when playing the
|
|
5500
|
+
* insturment sound; if omitted the default values are used.
|
|
5501
|
+
* @throws This function can throw errors.
|
|
5502
|
+
*
|
|
5503
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
5504
|
+
*
|
|
5505
|
+
* {@link LocationInUnloadedChunkError}
|
|
5506
|
+
*
|
|
5507
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5508
|
+
*/
|
|
5509
|
+
playInstrumentSound(face: Direction, soundOptions?: WorldSoundOptions): void;
|
|
5510
|
+
}
|
|
5511
|
+
|
|
4925
5512
|
/**
|
|
4926
5513
|
* Represents the inventory of a block in the world. Used with
|
|
4927
5514
|
* blocks like chests.
|
|
@@ -4995,6 +5582,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
4995
5582
|
*
|
|
4996
5583
|
*/
|
|
4997
5584
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5585
|
+
/**
|
|
5586
|
+
* @beta
|
|
5587
|
+
* @remarks
|
|
5588
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5589
|
+
* Will return false if the block volume was modified between
|
|
5590
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5591
|
+
*
|
|
5592
|
+
* @throws This function can throw errors.
|
|
5593
|
+
*
|
|
5594
|
+
* {@link minecraftcommon.EngineError}
|
|
5595
|
+
*/
|
|
5596
|
+
isValid(): boolean;
|
|
4998
5597
|
/**
|
|
4999
5598
|
* @remarks
|
|
5000
5599
|
* This function can't be called in restricted-execution mode.
|
|
@@ -5911,6 +6510,15 @@ export class BlockVolumeBase {
|
|
|
5911
6510
|
*
|
|
5912
6511
|
*/
|
|
5913
6512
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
6513
|
+
/**
|
|
6514
|
+
* @beta
|
|
6515
|
+
* @remarks
|
|
6516
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
6517
|
+
* the validated min and max coordinates of the volume
|
|
6518
|
+
*
|
|
6519
|
+
* @throws This function can throw errors.
|
|
6520
|
+
*/
|
|
6521
|
+
getBoundingBox(): BlockBoundingBox;
|
|
5914
6522
|
/**
|
|
5915
6523
|
* @remarks
|
|
5916
6524
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -6076,6 +6684,18 @@ export class Camera {
|
|
|
6076
6684
|
*
|
|
6077
6685
|
*/
|
|
6078
6686
|
readonly isValid: boolean;
|
|
6687
|
+
/**
|
|
6688
|
+
* @beta
|
|
6689
|
+
* @remarks
|
|
6690
|
+
* This function can't be called in restricted-execution mode.
|
|
6691
|
+
*
|
|
6692
|
+
* @throws This function can throw errors.
|
|
6693
|
+
*
|
|
6694
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6695
|
+
*
|
|
6696
|
+
* {@link InvalidEntityError}
|
|
6697
|
+
*/
|
|
6698
|
+
addShake(shakeCameraOptions: CameraShakeOptions): void;
|
|
6079
6699
|
/**
|
|
6080
6700
|
* @remarks
|
|
6081
6701
|
* Attaches the camera to a non-player entity.
|
|
@@ -6141,6 +6761,23 @@ export class Camera {
|
|
|
6141
6761
|
| CameraSetRotOptions
|
|
6142
6762
|
| CameraTargetOptions,
|
|
6143
6763
|
): void;
|
|
6764
|
+
/**
|
|
6765
|
+
* @beta
|
|
6766
|
+
* @remarks
|
|
6767
|
+
* Sets the current active camera with easing.
|
|
6768
|
+
*
|
|
6769
|
+
* This function can't be called in restricted-execution mode.
|
|
6770
|
+
*
|
|
6771
|
+
* @param cameraPreset
|
|
6772
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6773
|
+
* @param easeOptions
|
|
6774
|
+
* Options to ease the camera from the previous camera to the
|
|
6775
|
+
* current one.
|
|
6776
|
+
* @throws
|
|
6777
|
+
* Throws when easing to minecraft:first_person presets
|
|
6778
|
+
* currently without the experimental cameras toggle enabled.
|
|
6779
|
+
*/
|
|
6780
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
6144
6781
|
/**
|
|
6145
6782
|
* @remarks
|
|
6146
6783
|
* Sets the current active camera for the specified player and
|
|
@@ -6164,6 +6801,34 @@ export class Camera {
|
|
|
6164
6801
|
* @throws This function can throw errors.
|
|
6165
6802
|
*/
|
|
6166
6803
|
setFov(fovCameraOptions?: CameraFovOptions): void;
|
|
6804
|
+
/**
|
|
6805
|
+
* @beta
|
|
6806
|
+
* @remarks
|
|
6807
|
+
* This function can't be called in restricted-execution mode.
|
|
6808
|
+
*
|
|
6809
|
+
* @throws This function can throw errors.
|
|
6810
|
+
*
|
|
6811
|
+
* {@link InvalidEntityError}
|
|
6812
|
+
*/
|
|
6813
|
+
stopShaking(): void;
|
|
6814
|
+
}
|
|
6815
|
+
|
|
6816
|
+
/**
|
|
6817
|
+
* @beta
|
|
6818
|
+
* Loot item function that will try to copy the block entity
|
|
6819
|
+
* data from the destroyed block to the dropped item.
|
|
6820
|
+
*/
|
|
6821
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6822
|
+
export class CarryOverBlockEntityDataFunction extends LootItemFunction {
|
|
6823
|
+
private constructor();
|
|
6824
|
+
/**
|
|
6825
|
+
* @remarks
|
|
6826
|
+
* If true, and if the block entity had dynamic_properties, the
|
|
6827
|
+
* function will copy the dynamic properties from the block
|
|
6828
|
+
* entity to the dropped item.
|
|
6829
|
+
*
|
|
6830
|
+
*/
|
|
6831
|
+
readonly dynamicProperties: boolean;
|
|
6167
6832
|
}
|
|
6168
6833
|
|
|
6169
6834
|
/**
|
|
@@ -6180,6 +6845,164 @@ export class CatmullRomSpline {
|
|
|
6180
6845
|
controlPoints: Vector3[];
|
|
6181
6846
|
}
|
|
6182
6847
|
|
|
6848
|
+
/**
|
|
6849
|
+
* @beta
|
|
6850
|
+
* An event that fires as players enter chat messages.
|
|
6851
|
+
*/
|
|
6852
|
+
export class ChatSendAfterEvent {
|
|
6853
|
+
private constructor();
|
|
6854
|
+
/**
|
|
6855
|
+
* @remarks
|
|
6856
|
+
* Message that is being broadcast.
|
|
6857
|
+
*
|
|
6858
|
+
*/
|
|
6859
|
+
readonly message: string;
|
|
6860
|
+
/**
|
|
6861
|
+
* @remarks
|
|
6862
|
+
* Player that sent the chat message.
|
|
6863
|
+
*
|
|
6864
|
+
*/
|
|
6865
|
+
readonly sender: Player;
|
|
6866
|
+
/**
|
|
6867
|
+
* @remarks
|
|
6868
|
+
* Optional list of players that will receive this message. If
|
|
6869
|
+
* defined, this message is directly targeted to one or more
|
|
6870
|
+
* players (i.e., is not broadcast.)
|
|
6871
|
+
*
|
|
6872
|
+
*/
|
|
6873
|
+
readonly targets?: Player[];
|
|
6874
|
+
}
|
|
6875
|
+
|
|
6876
|
+
/**
|
|
6877
|
+
* @beta
|
|
6878
|
+
* Manages callbacks that are connected to chat messages being
|
|
6879
|
+
* sent.
|
|
6880
|
+
*/
|
|
6881
|
+
export class ChatSendAfterEventSignal {
|
|
6882
|
+
private constructor();
|
|
6883
|
+
/**
|
|
6884
|
+
* @remarks
|
|
6885
|
+
* Adds a callback that will be called when new chat messages
|
|
6886
|
+
* are sent.
|
|
6887
|
+
*
|
|
6888
|
+
* This function can't be called in restricted-execution mode.
|
|
6889
|
+
*
|
|
6890
|
+
* This function can be called in early-execution mode.
|
|
6891
|
+
*
|
|
6892
|
+
*/
|
|
6893
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
6894
|
+
/**
|
|
6895
|
+
* @remarks
|
|
6896
|
+
* Removes a callback from being called when new chat messages
|
|
6897
|
+
* are sent.
|
|
6898
|
+
*
|
|
6899
|
+
* This function can't be called in restricted-execution mode.
|
|
6900
|
+
*
|
|
6901
|
+
* This function can be called in early-execution mode.
|
|
6902
|
+
*
|
|
6903
|
+
*/
|
|
6904
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
6905
|
+
}
|
|
6906
|
+
|
|
6907
|
+
/**
|
|
6908
|
+
* @beta
|
|
6909
|
+
* An event that fires as players enter chat messages.
|
|
6910
|
+
*/
|
|
6911
|
+
export class ChatSendBeforeEvent {
|
|
6912
|
+
private constructor();
|
|
6913
|
+
/**
|
|
6914
|
+
* @remarks
|
|
6915
|
+
* If set to true in a beforeChat event handler, this message
|
|
6916
|
+
* is not broadcast out.
|
|
6917
|
+
*
|
|
6918
|
+
*/
|
|
6919
|
+
cancel: boolean;
|
|
6920
|
+
/**
|
|
6921
|
+
* @remarks
|
|
6922
|
+
* Message that is being broadcast.
|
|
6923
|
+
*
|
|
6924
|
+
*/
|
|
6925
|
+
readonly message: string;
|
|
6926
|
+
/**
|
|
6927
|
+
* @remarks
|
|
6928
|
+
* Player that sent the chat message.
|
|
6929
|
+
*
|
|
6930
|
+
*/
|
|
6931
|
+
readonly sender: Player;
|
|
6932
|
+
/**
|
|
6933
|
+
* @remarks
|
|
6934
|
+
* Optional list of players that will receive this message. If
|
|
6935
|
+
* defined, this message is directly targeted to one or more
|
|
6936
|
+
* players (i.e., is not broadcast.)
|
|
6937
|
+
*
|
|
6938
|
+
*/
|
|
6939
|
+
readonly targets?: Player[];
|
|
6940
|
+
}
|
|
6941
|
+
|
|
6942
|
+
/**
|
|
6943
|
+
* @beta
|
|
6944
|
+
* Manages callbacks that are connected to an event that fires
|
|
6945
|
+
* before chat messages are sent.
|
|
6946
|
+
* @example customCommand.ts
|
|
6947
|
+
* ```typescript
|
|
6948
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
6949
|
+
*
|
|
6950
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
6951
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
6952
|
+
* if (eventData.message.includes('cancel')) {
|
|
6953
|
+
* // Cancel event if the message contains "cancel"
|
|
6954
|
+
* eventData.cancel = true;
|
|
6955
|
+
* } else {
|
|
6956
|
+
* const args = eventData.message.split(' ');
|
|
6957
|
+
*
|
|
6958
|
+
* if (args.length > 0) {
|
|
6959
|
+
* switch (args[0].toLowerCase()) {
|
|
6960
|
+
* case 'echo':
|
|
6961
|
+
* // Send a modified version of chat message
|
|
6962
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
6963
|
+
* break;
|
|
6964
|
+
* case 'help':
|
|
6965
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
6966
|
+
* break;
|
|
6967
|
+
* }
|
|
6968
|
+
* }
|
|
6969
|
+
* }
|
|
6970
|
+
* });
|
|
6971
|
+
* }
|
|
6972
|
+
* ```
|
|
6973
|
+
*/
|
|
6974
|
+
export class ChatSendBeforeEventSignal {
|
|
6975
|
+
private constructor();
|
|
6976
|
+
/**
|
|
6977
|
+
* @remarks
|
|
6978
|
+
* Adds a callback that will be called before new chat messages
|
|
6979
|
+
* are sent.
|
|
6980
|
+
*
|
|
6981
|
+
* This function can't be called in restricted-execution mode.
|
|
6982
|
+
*
|
|
6983
|
+
* This function can be called in early-execution mode.
|
|
6984
|
+
*
|
|
6985
|
+
* @param callback
|
|
6986
|
+
* This closure is called with restricted-execution privilege.
|
|
6987
|
+
* @returns
|
|
6988
|
+
* Closure that is called with restricted-execution privilege.
|
|
6989
|
+
*/
|
|
6990
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
6991
|
+
/**
|
|
6992
|
+
* @remarks
|
|
6993
|
+
* Removes a callback from being called before new chat
|
|
6994
|
+
* messages are sent.
|
|
6995
|
+
*
|
|
6996
|
+
* This function can't be called in restricted-execution mode.
|
|
6997
|
+
*
|
|
6998
|
+
* This function can be called in early-execution mode.
|
|
6999
|
+
*
|
|
7000
|
+
* @param callback
|
|
7001
|
+
* This closure is called with restricted-execution privilege.
|
|
7002
|
+
*/
|
|
7003
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
7004
|
+
}
|
|
7005
|
+
|
|
6183
7006
|
/**
|
|
6184
7007
|
* Contains the device information for a client instance.
|
|
6185
7008
|
*/
|
|
@@ -6187,69 +7010,321 @@ export class CatmullRomSpline {
|
|
|
6187
7010
|
export class ClientSystemInfo extends SystemInfo {
|
|
6188
7011
|
private constructor();
|
|
6189
7012
|
/**
|
|
6190
|
-
* @rc
|
|
7013
|
+
* @rc
|
|
7014
|
+
* @remarks
|
|
7015
|
+
* The locale selected by the client (e.g., en_US, fr_FR,
|
|
7016
|
+
* ja_JP). Note that in most cases, server scripts should not
|
|
7017
|
+
* use this property to manually localize text. Instead, use
|
|
7018
|
+
* {@link RawMessage} with a translate field to send
|
|
7019
|
+
* localization keys, allowing each client to resolve them in
|
|
7020
|
+
* their own language automatically. Direct use of locale for
|
|
7021
|
+
* localization is fragile and may produce unexpected results
|
|
7022
|
+
* when players with different languages are on the same
|
|
7023
|
+
* server.
|
|
7024
|
+
*
|
|
7025
|
+
*/
|
|
7026
|
+
readonly locale: string;
|
|
7027
|
+
/**
|
|
7028
|
+
* @remarks
|
|
7029
|
+
* The max render distance for the device in chunks.
|
|
7030
|
+
*
|
|
7031
|
+
*/
|
|
7032
|
+
readonly maxRenderDistance: number;
|
|
7033
|
+
/**
|
|
7034
|
+
* @remarks
|
|
7035
|
+
* The platform type of the device.
|
|
7036
|
+
*
|
|
7037
|
+
*/
|
|
7038
|
+
readonly platformType: PlatformType;
|
|
7039
|
+
}
|
|
7040
|
+
|
|
7041
|
+
/**
|
|
7042
|
+
* Contains return data on the result of a command execution.
|
|
7043
|
+
*/
|
|
7044
|
+
export class CommandResult {
|
|
7045
|
+
private constructor();
|
|
7046
|
+
/**
|
|
7047
|
+
* @remarks
|
|
7048
|
+
* If the command operates against a number of entities,
|
|
7049
|
+
* blocks, or items, this returns the number of successful
|
|
7050
|
+
* applications of this command.
|
|
7051
|
+
*
|
|
7052
|
+
*/
|
|
7053
|
+
readonly successCount: number;
|
|
7054
|
+
}
|
|
7055
|
+
|
|
7056
|
+
/**
|
|
7057
|
+
* Base class for downstream Component implementations.
|
|
7058
|
+
*/
|
|
7059
|
+
export class Component {
|
|
7060
|
+
private constructor();
|
|
7061
|
+
/**
|
|
7062
|
+
* @remarks
|
|
7063
|
+
* Returns whether the component is valid. A component is
|
|
7064
|
+
* considered valid if its owner is valid, in addition to any
|
|
7065
|
+
* addition to any additional validation required by the
|
|
7066
|
+
* component.
|
|
7067
|
+
*
|
|
7068
|
+
*/
|
|
7069
|
+
readonly isValid: boolean;
|
|
7070
|
+
/**
|
|
7071
|
+
* @remarks
|
|
7072
|
+
* Identifier of the component.
|
|
7073
|
+
*
|
|
7074
|
+
*/
|
|
7075
|
+
readonly typeId: string;
|
|
7076
|
+
}
|
|
7077
|
+
|
|
7078
|
+
/**
|
|
7079
|
+
* @beta
|
|
7080
|
+
* The Compound Block Volume is a collection of individual
|
|
7081
|
+
* block volume definitions which, as a collection, define a
|
|
7082
|
+
* larger volume of (sometimes non-contiguous) irregular
|
|
7083
|
+
* shapes.
|
|
7084
|
+
* This class is loosely based on the concept of CSG
|
|
7085
|
+
* (Computational Solid Geometry) and allows a user to create
|
|
7086
|
+
* complex volumes by building a stack of volumes and voids to
|
|
7087
|
+
* make a larger single volume.
|
|
7088
|
+
* For example - normally a creator would create a hollow cube
|
|
7089
|
+
* by creating 6 "wall" surfaces for each face.
|
|
7090
|
+
* With a Compound Block Volume, a creator can define a hollow
|
|
7091
|
+
* cube by creating a single outer solid cube, and then
|
|
7092
|
+
* defining a further single 'void' cube inside the larger one.
|
|
7093
|
+
* Similarly, the Compound Block Volume can represent irregular
|
|
7094
|
+
* shaped volumes (e.g. a tree consists of a trunk and lots of
|
|
7095
|
+
* leaf cubes which are not necessarily contiguously placed).
|
|
7096
|
+
* Each of the volumes added to the CompoundBlockVolume are (by
|
|
7097
|
+
* default) relative to the origin set (either at construction
|
|
7098
|
+
* or via one of the set functions).
|
|
7099
|
+
* However, it is also possible to push volumes to the compound
|
|
7100
|
+
* collection which are absolute in nature and are not affected
|
|
7101
|
+
* by origin changes.
|
|
7102
|
+
*/
|
|
7103
|
+
export class CompoundBlockVolume {
|
|
7104
|
+
/**
|
|
7105
|
+
* @remarks
|
|
7106
|
+
* Return the 'capacity' of the bounding rectangle which
|
|
7107
|
+
* represents the collection of volumes in the stack
|
|
7108
|
+
*
|
|
7109
|
+
*/
|
|
7110
|
+
readonly capacity: number;
|
|
7111
|
+
readonly items: CompoundBlockVolumeItem[];
|
|
7112
|
+
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
7113
|
+
/**
|
|
7114
|
+
* @remarks
|
|
7115
|
+
* Return the number of volumes (positive and negative) in the
|
|
7116
|
+
* volume stack
|
|
7117
|
+
*
|
|
7118
|
+
*/
|
|
7119
|
+
readonly volumeCount: number;
|
|
7120
|
+
/**
|
|
7121
|
+
* @remarks
|
|
7122
|
+
* Create a CompoundBlockVolume object
|
|
7123
|
+
*
|
|
7124
|
+
* @param origin
|
|
7125
|
+
* An optional world space origin on which to center the
|
|
7126
|
+
* compound volume.
|
|
7127
|
+
* If not specified, the origin is set to (0,0,0)
|
|
7128
|
+
*/
|
|
7129
|
+
constructor(origin?: Vector3);
|
|
7130
|
+
/**
|
|
7131
|
+
* @remarks
|
|
7132
|
+
* Clear the contents of the volume stack
|
|
7133
|
+
*
|
|
7134
|
+
* This function can't be called in restricted-execution mode.
|
|
7135
|
+
*
|
|
7136
|
+
*/
|
|
7137
|
+
clear(): void;
|
|
7138
|
+
/**
|
|
7139
|
+
* @remarks
|
|
7140
|
+
* Fetch a Block Location Iterator for the Compound Block
|
|
7141
|
+
* Volume. This iterator will allow a creator to iterate
|
|
7142
|
+
* across all of the selected volumes within the larger
|
|
7143
|
+
* bounding area.
|
|
7144
|
+
* Areas of a volume which have been overridden by a
|
|
7145
|
+
* subtractive volume will not be included in the iterator
|
|
7146
|
+
* step.
|
|
7147
|
+
* (i.e. if you push a cube to the stack, and then push a
|
|
7148
|
+
* subtractive volume to the same location, then the iterator
|
|
7149
|
+
* will step over the initial volume because it is considered
|
|
7150
|
+
* negative space)
|
|
7151
|
+
* Note that the Block Locations returned by this iterator are
|
|
7152
|
+
* in absolute world space (irrespective of whether the
|
|
7153
|
+
* compound volume items pushed are absolute or relative)
|
|
7154
|
+
*
|
|
7155
|
+
* This function can't be called in restricted-execution mode.
|
|
7156
|
+
*
|
|
7157
|
+
*/
|
|
7158
|
+
getBlockLocationIterator(): BlockLocationIterator;
|
|
7159
|
+
/**
|
|
7160
|
+
* @remarks
|
|
7161
|
+
* Get the largest bounding box that represents a container for
|
|
7162
|
+
* all of the volumes on the stack
|
|
7163
|
+
* Note that the bounding box returned is represented in
|
|
7164
|
+
* absolute world space (irrespective of whether the compound
|
|
7165
|
+
* volume items pushed are absolute or relative)
|
|
7166
|
+
*
|
|
7167
|
+
* This function can't be called in restricted-execution mode.
|
|
7168
|
+
*
|
|
7169
|
+
*/
|
|
7170
|
+
getBoundingBox(): BlockBoundingBox;
|
|
7171
|
+
/**
|
|
7172
|
+
* @remarks
|
|
7173
|
+
* Get the max block location of the outermost bounding
|
|
7174
|
+
* rectangle which represents the volumes on the stack.
|
|
7175
|
+
* Note that the max location returned is in absolute world
|
|
7176
|
+
* space (irrespective of whether the compound volume items
|
|
7177
|
+
* pushed are absolute or relative)
|
|
7178
|
+
*
|
|
7179
|
+
* This function can't be called in restricted-execution mode.
|
|
7180
|
+
*
|
|
7181
|
+
*/
|
|
7182
|
+
getMax(): Vector3;
|
|
7183
|
+
/**
|
|
7184
|
+
* @remarks
|
|
7185
|
+
* Get the min block location of the outermost bounding
|
|
7186
|
+
* rectangle which represents the volumes on the stack.
|
|
7187
|
+
* Note that the min location returned is in absolute world
|
|
7188
|
+
* space (irrespective of whether the compound volume items
|
|
7189
|
+
* pushed are absolute or relative)
|
|
7190
|
+
*
|
|
7191
|
+
* This function can't be called in restricted-execution mode.
|
|
7192
|
+
*
|
|
7193
|
+
*/
|
|
7194
|
+
getMin(): Vector3;
|
|
7195
|
+
/**
|
|
7196
|
+
* @remarks
|
|
7197
|
+
* Fetch the origin in world space of the compound volume
|
|
7198
|
+
*
|
|
7199
|
+
* This function can't be called in restricted-execution mode.
|
|
7200
|
+
*
|
|
7201
|
+
*/
|
|
7202
|
+
getOrigin(): Vector3;
|
|
7203
|
+
/**
|
|
7204
|
+
* @remarks
|
|
7205
|
+
* Return a boolean which signals if there are any volume items
|
|
7206
|
+
* pushed to the volume
|
|
7207
|
+
*
|
|
7208
|
+
* This function can't be called in restricted-execution mode.
|
|
7209
|
+
*
|
|
7210
|
+
*/
|
|
7211
|
+
isEmpty(): boolean;
|
|
7212
|
+
/**
|
|
7213
|
+
* @remarks
|
|
7214
|
+
* Return a boolean representing whether or not a given
|
|
7215
|
+
* absolute world space block location is inside a positive
|
|
7216
|
+
* block volume.
|
|
7217
|
+
* E.g. if the stack contains a large cube followed by a
|
|
7218
|
+
* slightly smaller negative cube, and the test location is
|
|
7219
|
+
* within the negative cube - the function will return false
|
|
7220
|
+
* because it's not 'inside' a volume (it IS inside the
|
|
7221
|
+
* bounding rectangle, but it is not inside a positively
|
|
7222
|
+
* defined location)
|
|
7223
|
+
*
|
|
7224
|
+
* This function can't be called in restricted-execution mode.
|
|
7225
|
+
*
|
|
7226
|
+
*/
|
|
7227
|
+
isInside(worldLocation: Vector3): boolean;
|
|
7228
|
+
/**
|
|
6191
7229
|
* @remarks
|
|
6192
|
-
*
|
|
6193
|
-
*
|
|
6194
|
-
*
|
|
6195
|
-
*
|
|
6196
|
-
* localization keys, allowing each client to resolve them in
|
|
6197
|
-
* their own language automatically. Direct use of locale for
|
|
6198
|
-
* localization is fragile and may produce unexpected results
|
|
6199
|
-
* when players with different languages are on the same
|
|
6200
|
-
* server.
|
|
7230
|
+
* Inspect the last entry pushed to the volume stack without
|
|
7231
|
+
* affecting the stack contents.
|
|
7232
|
+
*
|
|
7233
|
+
* This function can't be called in restricted-execution mode.
|
|
6201
7234
|
*
|
|
7235
|
+
* @param forceRelativity
|
|
7236
|
+
* Determine whether the function returns a
|
|
7237
|
+
* CompoundBlockVolumeItem which is forced into either relative
|
|
7238
|
+
* or absolute coordinate system.
|
|
7239
|
+
* `true` = force returned item to be relative to volume origin
|
|
7240
|
+
* `false` = force returned item to be absolute world space
|
|
7241
|
+
* location
|
|
7242
|
+
*
|
|
7243
|
+
* If no flag is specified, the item returned retains whatever
|
|
7244
|
+
* relativity it had when it was pushed
|
|
7245
|
+
* @returns
|
|
7246
|
+
* Returns undefined if the stack is empty
|
|
6202
7247
|
*/
|
|
6203
|
-
|
|
7248
|
+
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
6204
7249
|
/**
|
|
6205
7250
|
* @remarks
|
|
6206
|
-
*
|
|
7251
|
+
* Remove the last entry from the volume stack. This will
|
|
7252
|
+
* reduce the stack size by one
|
|
7253
|
+
*
|
|
7254
|
+
* This function can't be called in restricted-execution mode.
|
|
6207
7255
|
*
|
|
6208
7256
|
*/
|
|
6209
|
-
|
|
7257
|
+
popVolume(): boolean;
|
|
6210
7258
|
/**
|
|
6211
7259
|
* @remarks
|
|
6212
|
-
*
|
|
7260
|
+
* Push a volume item to the stack. The volume item contains
|
|
7261
|
+
* an 'action' parameter which determines whether this volume
|
|
7262
|
+
* is a positive or negative space.
|
|
7263
|
+
* The item also contains a `locationRelativity` which
|
|
7264
|
+
* determines whether it is relative or absolute to the
|
|
7265
|
+
* compound volume origin
|
|
6213
7266
|
*
|
|
7267
|
+
* This function can't be called in restricted-execution mode.
|
|
7268
|
+
*
|
|
7269
|
+
* @param item
|
|
7270
|
+
* Item to push to the end of the stack
|
|
6214
7271
|
*/
|
|
6215
|
-
|
|
6216
|
-
}
|
|
6217
|
-
|
|
6218
|
-
/**
|
|
6219
|
-
* Contains return data on the result of a command execution.
|
|
6220
|
-
*/
|
|
6221
|
-
export class CommandResult {
|
|
6222
|
-
private constructor();
|
|
7272
|
+
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
6223
7273
|
/**
|
|
6224
7274
|
* @remarks
|
|
6225
|
-
* If the
|
|
6226
|
-
*
|
|
6227
|
-
*
|
|
7275
|
+
* If the volume stack is empty, this function will push the
|
|
7276
|
+
* specified item to the stack.
|
|
7277
|
+
* If the volume stack is NOT empty, this function will replace
|
|
7278
|
+
* the last item on the stack with the new item.
|
|
7279
|
+
*
|
|
7280
|
+
* This function can't be called in restricted-execution mode.
|
|
6228
7281
|
*
|
|
7282
|
+
* @param item
|
|
7283
|
+
* Item to add or replace
|
|
6229
7284
|
*/
|
|
6230
|
-
|
|
6231
|
-
}
|
|
6232
|
-
|
|
6233
|
-
/**
|
|
6234
|
-
* Base class for downstream Component implementations.
|
|
6235
|
-
*/
|
|
6236
|
-
export class Component {
|
|
6237
|
-
private constructor();
|
|
7285
|
+
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
6238
7286
|
/**
|
|
6239
7287
|
* @remarks
|
|
6240
|
-
*
|
|
6241
|
-
*
|
|
6242
|
-
*
|
|
6243
|
-
*
|
|
7288
|
+
* Set the origin of the compound volume to an absolute world
|
|
7289
|
+
* space location
|
|
7290
|
+
*
|
|
7291
|
+
* This function can't be called in restricted-execution mode.
|
|
6244
7292
|
*
|
|
7293
|
+
* @param preserveExistingVolumes
|
|
7294
|
+
* This optional boolean flag determines whether the relative
|
|
7295
|
+
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
7296
|
+
* affected by the new origin.
|
|
7297
|
+
* Imagine a scenario where you have a series of relative
|
|
7298
|
+
* locations around an origin which make up a sphere; all of
|
|
7299
|
+
* these locations are in the range of -2 to 2.
|
|
7300
|
+
* Push each of these locations to the compound volume as
|
|
7301
|
+
* relative items.
|
|
7302
|
+
* Now, move the origin and all of the locations representing
|
|
7303
|
+
* the sphere move accordingly.
|
|
7304
|
+
* However, let's say you want to add a 2nd sphere next to the
|
|
7305
|
+
* 1st.
|
|
7306
|
+
* In this case, set the new origin a few locations over, but
|
|
7307
|
+
* 'preserveExistingVolumes' = true.
|
|
7308
|
+
* This will set a new origin, but the existing sphere
|
|
7309
|
+
* locations will remain relative to the original origin.
|
|
7310
|
+
* Now, you can push the relative sphere locations again (this
|
|
7311
|
+
* time they will be relative to the new origin) - resulting in
|
|
7312
|
+
* 2 spheres next to each other.
|
|
6245
7313
|
*/
|
|
6246
|
-
|
|
7314
|
+
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6247
7315
|
/**
|
|
6248
7316
|
* @remarks
|
|
6249
|
-
*
|
|
7317
|
+
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
7318
|
+
* function will translate the origin by a given delta to a new
|
|
7319
|
+
* position
|
|
7320
|
+
*
|
|
7321
|
+
* This function can't be called in restricted-execution mode.
|
|
6250
7322
|
*
|
|
7323
|
+
* @param preserveExistingVolumes
|
|
7324
|
+
* See the description for the arguments to {@link
|
|
7325
|
+
* CompoundBlockVolume.setOrigin}
|
|
6251
7326
|
*/
|
|
6252
|
-
|
|
7327
|
+
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6253
7328
|
}
|
|
6254
7329
|
|
|
6255
7330
|
/**
|
|
@@ -6389,7 +7464,9 @@ export class Container {
|
|
|
6389
7464
|
*
|
|
6390
7465
|
* @param itemStack
|
|
6391
7466
|
* The stack of items to add.
|
|
6392
|
-
* @throws
|
|
7467
|
+
* @throws
|
|
7468
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7469
|
+
* limit but will instead add items up to the weight limit.
|
|
6393
7470
|
*
|
|
6394
7471
|
* {@link ContainerRulesError}
|
|
6395
7472
|
*
|
|
@@ -6627,6 +7704,8 @@ export class Container {
|
|
|
6627
7704
|
* @throws
|
|
6628
7705
|
* Throws if either this container or `toContainer` are invalid
|
|
6629
7706
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
7707
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7708
|
+
* limit but will instead add items up to the weight limit.
|
|
6630
7709
|
*
|
|
6631
7710
|
* {@link ContainerRulesError}
|
|
6632
7711
|
*
|
|
@@ -7409,6 +8488,30 @@ export class Dimension {
|
|
|
7409
8488
|
block: BlockPermutation | BlockType | string,
|
|
7410
8489
|
options?: BlockFillOptions,
|
|
7411
8490
|
): ListBlockVolume;
|
|
8491
|
+
/**
|
|
8492
|
+
* @beta
|
|
8493
|
+
* @remarks
|
|
8494
|
+
* Finds the location of the closest biome of a particular
|
|
8495
|
+
* type. Note that the findClosestBiome operation can take some
|
|
8496
|
+
* time to complete, so avoid using many of these calls within
|
|
8497
|
+
* a particular tick.
|
|
8498
|
+
*
|
|
8499
|
+
* @param pos
|
|
8500
|
+
* Starting location to look for a biome to find.
|
|
8501
|
+
* @param biomeToFind
|
|
8502
|
+
* Identifier of the biome to look for.
|
|
8503
|
+
* @param options
|
|
8504
|
+
* Additional selection criteria for a biome search.
|
|
8505
|
+
* @returns
|
|
8506
|
+
* Returns a location of the biome, or undefined if a biome
|
|
8507
|
+
* could not be found.
|
|
8508
|
+
* @throws This function can throw errors.
|
|
8509
|
+
*
|
|
8510
|
+
* {@link minecraftcommon.EngineError}
|
|
8511
|
+
*
|
|
8512
|
+
* {@link Error}
|
|
8513
|
+
*/
|
|
8514
|
+
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
7412
8515
|
/**
|
|
7413
8516
|
* @remarks
|
|
7414
8517
|
* Returns the biome type at the specified location.
|
|
@@ -7492,13 +8595,14 @@ export class Dimension {
|
|
|
7492
8595
|
getBlockFromRay(location: Vector3, direction: Vector3, options?: BlockRaycastOptions): BlockRaycastHit | undefined;
|
|
7493
8596
|
/**
|
|
7494
8597
|
* @remarks
|
|
7495
|
-
* Gets all the blocks in a volume that satisfy the
|
|
8598
|
+
* Gets all the blocks in a volume that satisfy the block query
|
|
8599
|
+
* options.
|
|
7496
8600
|
*
|
|
7497
8601
|
* @param volume
|
|
7498
8602
|
* Volume of blocks that will be checked.
|
|
7499
|
-
* @param
|
|
7500
|
-
* Block
|
|
7501
|
-
*
|
|
8603
|
+
* @param options
|
|
8604
|
+
* Block query options including filter criteria and optional
|
|
8605
|
+
* closest/farthest distance sorting from a location.
|
|
7502
8606
|
* @param allowUnloadedChunks
|
|
7503
8607
|
* If set to true will suppress the UnloadedChunksError if some
|
|
7504
8608
|
* or all of the block volume is outside of the loaded chunks.
|
|
@@ -7507,7 +8611,7 @@ export class Dimension {
|
|
|
7507
8611
|
* Defaults to: false
|
|
7508
8612
|
* @returns
|
|
7509
8613
|
* Returns the ListBlockVolume that contains all the block
|
|
7510
|
-
* locations that satisfied the block
|
|
8614
|
+
* locations that satisfied the block query options.
|
|
7511
8615
|
* @throws This function can throw errors.
|
|
7512
8616
|
*
|
|
7513
8617
|
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
@@ -7518,7 +8622,7 @@ export class Dimension {
|
|
|
7518
8622
|
*
|
|
7519
8623
|
* {@link UnloadedChunksError}
|
|
7520
8624
|
*/
|
|
7521
|
-
getBlocks(volume: BlockVolumeBase,
|
|
8625
|
+
getBlocks(volume: BlockVolumeBase, options: BlockQueryOptions, allowUnloadedChunks?: boolean): ListBlockVolume;
|
|
7522
8626
|
/**
|
|
7523
8627
|
* @remarks
|
|
7524
8628
|
* Returns a set of entities based on a set of conditions
|
|
@@ -7632,6 +8736,26 @@ export class Dimension {
|
|
|
7632
8736
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7633
8737
|
*/
|
|
7634
8738
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8739
|
+
/**
|
|
8740
|
+
* @beta
|
|
8741
|
+
* @remarks
|
|
8742
|
+
* Returns a vector of generated structures that contain the
|
|
8743
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
8744
|
+
* The vector will be empty if no structures are found.
|
|
8745
|
+
*
|
|
8746
|
+
* @param location
|
|
8747
|
+
* Location at which to check for structures.
|
|
8748
|
+
* @throws
|
|
8749
|
+
* An error will be thrown if the location is out of world
|
|
8750
|
+
* bounds.
|
|
8751
|
+
* An error will be thrown if the location is in an unloaded
|
|
8752
|
+
* chunk.
|
|
8753
|
+
*
|
|
8754
|
+
* {@link LocationInUnloadedChunkError}
|
|
8755
|
+
*
|
|
8756
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8757
|
+
*/
|
|
8758
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
7635
8759
|
/**
|
|
7636
8760
|
* @remarks
|
|
7637
8761
|
* Returns the total brightness level of light shining on a
|
|
@@ -7693,6 +8817,16 @@ export class Dimension {
|
|
|
7693
8817
|
* @throws This function can throw errors.
|
|
7694
8818
|
*/
|
|
7695
8819
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
8820
|
+
/**
|
|
8821
|
+
* @beta
|
|
8822
|
+
* @remarks
|
|
8823
|
+
* Returns the current weather.
|
|
8824
|
+
*
|
|
8825
|
+
* @returns
|
|
8826
|
+
* Returns a WeatherType that explains the broad category of
|
|
8827
|
+
* weather that is currently going on.
|
|
8828
|
+
*/
|
|
8829
|
+
getWeather(): WeatherType;
|
|
7696
8830
|
/**
|
|
7697
8831
|
* @remarks
|
|
7698
8832
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -7938,7 +9072,11 @@ export class Dimension {
|
|
|
7938
9072
|
* }
|
|
7939
9073
|
* ```
|
|
7940
9074
|
*/
|
|
7941
|
-
spawnEntity
|
|
9075
|
+
spawnEntity<T = never>(
|
|
9076
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
9077
|
+
location: Vector3,
|
|
9078
|
+
options?: SpawnEntityOptions,
|
|
9079
|
+
): Entity;
|
|
7942
9080
|
/**
|
|
7943
9081
|
* @remarks
|
|
7944
9082
|
* Creates a new item stack as an entity at the specified
|
|
@@ -8033,6 +9171,46 @@ export class Dimension {
|
|
|
8033
9171
|
* ```
|
|
8034
9172
|
*/
|
|
8035
9173
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
9174
|
+
/**
|
|
9175
|
+
* @beta
|
|
9176
|
+
* @remarks
|
|
9177
|
+
* Spawns an experience orb at a specified location in the
|
|
9178
|
+
* dimension.
|
|
9179
|
+
*
|
|
9180
|
+
* This function can't be called in restricted-execution mode.
|
|
9181
|
+
*
|
|
9182
|
+
* @param location
|
|
9183
|
+
* The location at which to spawn the experience orb.
|
|
9184
|
+
* @param amount
|
|
9185
|
+
* The amount of experience to give the experience orb.
|
|
9186
|
+
* Bounds: [1, 12000]
|
|
9187
|
+
* @throws This function can throw errors.
|
|
9188
|
+
*
|
|
9189
|
+
* {@link LocationInUnloadedChunkError}
|
|
9190
|
+
*
|
|
9191
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
9192
|
+
*/
|
|
9193
|
+
spawnXp(location: Vector3, amount: number): void;
|
|
9194
|
+
/**
|
|
9195
|
+
* @beta
|
|
9196
|
+
* @remarks
|
|
9197
|
+
* Stops all sounds from playing for all players.
|
|
9198
|
+
*
|
|
9199
|
+
* This function can't be called in restricted-execution mode.
|
|
9200
|
+
*
|
|
9201
|
+
*/
|
|
9202
|
+
stopAllSounds(): void;
|
|
9203
|
+
/**
|
|
9204
|
+
* @beta
|
|
9205
|
+
* @remarks
|
|
9206
|
+
* Stops a sound from playing for all players.
|
|
9207
|
+
*
|
|
9208
|
+
* This function can't be called in restricted-execution mode.
|
|
9209
|
+
*
|
|
9210
|
+
* @param soundId
|
|
9211
|
+
* Identifier of the sound.
|
|
9212
|
+
*/
|
|
9213
|
+
stopSound(soundId: string): void;
|
|
8036
9214
|
}
|
|
8037
9215
|
|
|
8038
9216
|
/**
|
|
@@ -8619,6 +9797,18 @@ export class Entity {
|
|
|
8619
9797
|
*
|
|
8620
9798
|
*/
|
|
8621
9799
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
9800
|
+
/**
|
|
9801
|
+
* @beta
|
|
9802
|
+
* @remarks
|
|
9803
|
+
* Retrieves or sets an entity that is used as the target of
|
|
9804
|
+
* AI-related behaviors, like attacking. If the entity
|
|
9805
|
+
* currently has no target returns undefined.
|
|
9806
|
+
*
|
|
9807
|
+
* @throws This property can throw when used.
|
|
9808
|
+
*
|
|
9809
|
+
* {@link InvalidEntityError}
|
|
9810
|
+
*/
|
|
9811
|
+
readonly target?: Entity;
|
|
8622
9812
|
/**
|
|
8623
9813
|
* @remarks
|
|
8624
9814
|
* Identifier of the type of the entity - for example,
|
|
@@ -9859,6 +11049,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
9859
11049
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
9860
11050
|
export class EntityBreathableComponent extends EntityComponent {
|
|
9861
11051
|
private constructor();
|
|
11052
|
+
/**
|
|
11053
|
+
* @beta
|
|
11054
|
+
* @remarks
|
|
11055
|
+
* The current air supply of the entity.
|
|
11056
|
+
*
|
|
11057
|
+
* This property can't be edited in restricted-execution mode.
|
|
11058
|
+
*
|
|
11059
|
+
* @throws
|
|
11060
|
+
* Will throw an error if the air supply is out of bounds
|
|
11061
|
+
* [suffocationTime, maxAirSupply].
|
|
11062
|
+
*/
|
|
11063
|
+
airSupply: number;
|
|
9862
11064
|
/**
|
|
9863
11065
|
* @remarks
|
|
9864
11066
|
* If true, this entity can breathe in air.
|
|
@@ -9887,6 +11089,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
9887
11089
|
* @throws This property can throw when used.
|
|
9888
11090
|
*/
|
|
9889
11091
|
readonly breathesWater: boolean;
|
|
11092
|
+
/**
|
|
11093
|
+
* @beta
|
|
11094
|
+
* @remarks
|
|
11095
|
+
* If true, the entity is able to breathe.
|
|
11096
|
+
*
|
|
11097
|
+
* @throws This property can throw when used.
|
|
11098
|
+
*/
|
|
11099
|
+
readonly canBreathe: boolean;
|
|
9890
11100
|
/**
|
|
9891
11101
|
* @remarks
|
|
9892
11102
|
* If true, this entity will have visible bubbles while in
|
|
@@ -10306,60 +11516,194 @@ export class EntityEquippableComponent extends EntityComponent {
|
|
|
10306
11516
|
*
|
|
10307
11517
|
* This function can't be called in restricted-execution mode.
|
|
10308
11518
|
*
|
|
10309
|
-
* @param equipmentSlot
|
|
10310
|
-
* The equipment slot. e.g. "head", "chest", "offhand".
|
|
10311
|
-
* @param itemStack
|
|
10312
|
-
* The item to equip. If undefined, clears the slot.
|
|
10313
|
-
* @throws This function can throw errors.
|
|
11519
|
+
* @param equipmentSlot
|
|
11520
|
+
* The equipment slot. e.g. "head", "chest", "offhand".
|
|
11521
|
+
* @param itemStack
|
|
11522
|
+
* The item to equip. If undefined, clears the slot.
|
|
11523
|
+
* @throws This function can throw errors.
|
|
11524
|
+
*/
|
|
11525
|
+
setEquipment(equipmentSlot: EquipmentSlot, itemStack?: ItemStack): boolean;
|
|
11526
|
+
}
|
|
11527
|
+
|
|
11528
|
+
/**
|
|
11529
|
+
* Defines the interactions with this entity for Exhaustion.
|
|
11530
|
+
* Wraps the `minecraft.player.exhaustion` attribute.
|
|
11531
|
+
*/
|
|
11532
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11533
|
+
export class EntityExhaustionComponent extends EntityAttributeComponent {
|
|
11534
|
+
private constructor();
|
|
11535
|
+
static readonly componentId = 'minecraft:player.exhaustion';
|
|
11536
|
+
}
|
|
11537
|
+
|
|
11538
|
+
/**
|
|
11539
|
+
* When added, this component signifies that this entity
|
|
11540
|
+
* doesn't take damage from fire.
|
|
11541
|
+
*/
|
|
11542
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11543
|
+
export class EntityFireImmuneComponent extends EntityComponent {
|
|
11544
|
+
private constructor();
|
|
11545
|
+
static readonly componentId = 'minecraft:fire_immune';
|
|
11546
|
+
}
|
|
11547
|
+
|
|
11548
|
+
/**
|
|
11549
|
+
* When added, this component signifies that this entity can
|
|
11550
|
+
* float in liquid blocks.
|
|
11551
|
+
*/
|
|
11552
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11553
|
+
export class EntityFloatsInLiquidComponent extends EntityComponent {
|
|
11554
|
+
private constructor();
|
|
11555
|
+
static readonly componentId = 'minecraft:floats_in_liquid';
|
|
11556
|
+
}
|
|
11557
|
+
|
|
11558
|
+
/**
|
|
11559
|
+
* Represents the flying speed of an entity.
|
|
11560
|
+
*/
|
|
11561
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11562
|
+
export class EntityFlyingSpeedComponent extends EntityComponent {
|
|
11563
|
+
private constructor();
|
|
11564
|
+
/**
|
|
11565
|
+
* @remarks
|
|
11566
|
+
* Current value of the flying speed of the associated entity.
|
|
11567
|
+
*
|
|
11568
|
+
* This property can't be edited in restricted-execution mode.
|
|
11569
|
+
*
|
|
11570
|
+
*/
|
|
11571
|
+
value: number;
|
|
11572
|
+
static readonly componentId = 'minecraft:flying_speed';
|
|
11573
|
+
}
|
|
11574
|
+
|
|
11575
|
+
/**
|
|
11576
|
+
* @beta
|
|
11577
|
+
* Provides access to the fog definitions stack of a player
|
|
11578
|
+
* entity, allowing scripts to push, pop, remove, and query
|
|
11579
|
+
* active fog definitions.
|
|
11580
|
+
*/
|
|
11581
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11582
|
+
export class EntityFogComponent extends EntityComponent {
|
|
11583
|
+
private constructor();
|
|
11584
|
+
static readonly componentId = 'minecraft:player.fog';
|
|
11585
|
+
/**
|
|
11586
|
+
* @remarks
|
|
11587
|
+
* Sets the player's fog stack to the given list of fog
|
|
11588
|
+
* identifiers, replacing any existing entries.
|
|
11589
|
+
*
|
|
11590
|
+
* This function can't be called in restricted-execution mode.
|
|
11591
|
+
*
|
|
11592
|
+
* @param fogIds
|
|
11593
|
+
* A stack of fog definition identifiers to set on the player's
|
|
11594
|
+
* fog stack (e.g. ['minecraft:fog_bamboo_jungle']). Maximum of
|
|
11595
|
+
* 16 entries.
|
|
11596
|
+
* @param tag
|
|
11597
|
+
* An optional tag to associate with the new entries, used to
|
|
11598
|
+
* target them with pop or remove.
|
|
11599
|
+
* @throws
|
|
11600
|
+
* Throws if the entity is invalid, if more than 16 fog
|
|
11601
|
+
* identifiers are provided, or if any fog identifier is
|
|
11602
|
+
* invalid.
|
|
11603
|
+
*
|
|
11604
|
+
* {@link EntityFogComponentError}
|
|
11605
|
+
*
|
|
11606
|
+
* {@link InvalidEntityError}
|
|
11607
|
+
*/
|
|
11608
|
+
applyStack(fogIds: string[], tag?: string): void;
|
|
11609
|
+
/**
|
|
11610
|
+
* @remarks
|
|
11611
|
+
* Returns the list of fog identifiers currently on the
|
|
11612
|
+
* player's fog stack, ordered from bottom to top.
|
|
11613
|
+
*
|
|
11614
|
+
* This function can't be called in restricted-execution mode.
|
|
11615
|
+
*
|
|
11616
|
+
* @returns
|
|
11617
|
+
* An array of fog definition identifiers currently on the
|
|
11618
|
+
* stack.
|
|
11619
|
+
* @throws
|
|
11620
|
+
* Throws if the entity is invalid.
|
|
11621
|
+
*
|
|
11622
|
+
* {@link InvalidEntityError}
|
|
11623
|
+
*/
|
|
11624
|
+
getStack(): string[];
|
|
11625
|
+
/**
|
|
11626
|
+
* @remarks
|
|
11627
|
+
* Returns the list of tags currently present on the player's
|
|
11628
|
+
* fog stack.
|
|
11629
|
+
*
|
|
11630
|
+
* This function can't be called in restricted-execution mode.
|
|
11631
|
+
*
|
|
11632
|
+
* @returns
|
|
11633
|
+
* An array of tag strings associated with fog settings on the
|
|
11634
|
+
* stack.
|
|
11635
|
+
* @throws
|
|
11636
|
+
* Throws if the entity is invalid.
|
|
11637
|
+
*
|
|
11638
|
+
* {@link InvalidEntityError}
|
|
11639
|
+
*/
|
|
11640
|
+
getTags(): string[];
|
|
11641
|
+
/**
|
|
11642
|
+
* @remarks
|
|
11643
|
+
* Removes the most recently pushed fog definition from the
|
|
11644
|
+
* player's fog stack.
|
|
11645
|
+
*
|
|
11646
|
+
* This function can't be called in restricted-execution mode.
|
|
11647
|
+
*
|
|
11648
|
+
* @param tag
|
|
11649
|
+
* An optional tag identifying which entry to pop. If provided,
|
|
11650
|
+
* searches the stack from top to bottom and removes the most
|
|
11651
|
+
* recently pushed entry with this tag. If omitted, removes the
|
|
11652
|
+
* most recently pushed entry regardless of tag.
|
|
11653
|
+
* @returns
|
|
11654
|
+
* Returns the identifier of the popped fog definition, or
|
|
11655
|
+
* undefined if the stack was unchanged.
|
|
11656
|
+
* @throws
|
|
11657
|
+
* Throws if the entity is invalid.
|
|
11658
|
+
*
|
|
11659
|
+
* {@link InvalidEntityError}
|
|
11660
|
+
*/
|
|
11661
|
+
pop(tag?: string): string | undefined;
|
|
11662
|
+
/**
|
|
11663
|
+
* @remarks
|
|
11664
|
+
* Pushes a new fog definition onto the player's fog stack.
|
|
11665
|
+
*
|
|
11666
|
+
* This function can't be called in restricted-execution mode.
|
|
11667
|
+
*
|
|
11668
|
+
* @param fogId
|
|
11669
|
+
* The identifier of the fog definition to push onto the stack
|
|
11670
|
+
* (e.g. 'minecraft:fog_bamboo_jungle').
|
|
11671
|
+
* @param tag
|
|
11672
|
+
* An optional tag used to label this fog definition on the
|
|
11673
|
+
* stack, allowing it to be targeted by pop or remove. If
|
|
11674
|
+
* omitted, the entry is stored with the tag 'untagged'.
|
|
11675
|
+
* @returns
|
|
11676
|
+
* Returns the zero-based index at which the fog definition was
|
|
11677
|
+
* inserted into the stack.
|
|
11678
|
+
* @throws
|
|
11679
|
+
* Throws if the entity is invalid, the fog identifier is
|
|
11680
|
+
* invalid, or if the stack limit of 16 has been exceeded.
|
|
11681
|
+
*
|
|
11682
|
+
* {@link EntityFogComponentError}
|
|
11683
|
+
*
|
|
11684
|
+
* {@link InvalidEntityError}
|
|
10314
11685
|
*/
|
|
10315
|
-
|
|
10316
|
-
}
|
|
10317
|
-
|
|
10318
|
-
/**
|
|
10319
|
-
* Defines the interactions with this entity for Exhaustion.
|
|
10320
|
-
* Wraps the `minecraft.player.exhaustion` attribute.
|
|
10321
|
-
*/
|
|
10322
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10323
|
-
export class EntityExhaustionComponent extends EntityAttributeComponent {
|
|
10324
|
-
private constructor();
|
|
10325
|
-
static readonly componentId = 'minecraft:player.exhaustion';
|
|
10326
|
-
}
|
|
10327
|
-
|
|
10328
|
-
/**
|
|
10329
|
-
* When added, this component signifies that this entity
|
|
10330
|
-
* doesn't take damage from fire.
|
|
10331
|
-
*/
|
|
10332
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10333
|
-
export class EntityFireImmuneComponent extends EntityComponent {
|
|
10334
|
-
private constructor();
|
|
10335
|
-
static readonly componentId = 'minecraft:fire_immune';
|
|
10336
|
-
}
|
|
10337
|
-
|
|
10338
|
-
/**
|
|
10339
|
-
* When added, this component signifies that this entity can
|
|
10340
|
-
* float in liquid blocks.
|
|
10341
|
-
*/
|
|
10342
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10343
|
-
export class EntityFloatsInLiquidComponent extends EntityComponent {
|
|
10344
|
-
private constructor();
|
|
10345
|
-
static readonly componentId = 'minecraft:floats_in_liquid';
|
|
10346
|
-
}
|
|
10347
|
-
|
|
10348
|
-
/**
|
|
10349
|
-
* Represents the flying speed of an entity.
|
|
10350
|
-
*/
|
|
10351
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10352
|
-
export class EntityFlyingSpeedComponent extends EntityComponent {
|
|
10353
|
-
private constructor();
|
|
11686
|
+
push(fogId: string, tag?: string): number;
|
|
10354
11687
|
/**
|
|
10355
11688
|
* @remarks
|
|
10356
|
-
*
|
|
11689
|
+
* Removes all fog definitions with the given tag from the
|
|
11690
|
+
* player's fog stack. If no tag is provided, clears all fog
|
|
11691
|
+
* definitions.
|
|
10357
11692
|
*
|
|
10358
|
-
* This
|
|
11693
|
+
* This function can't be called in restricted-execution mode.
|
|
10359
11694
|
*
|
|
11695
|
+
* @param tag
|
|
11696
|
+
* An optional tag identifying which the entries to remove. If
|
|
11697
|
+
* omitted, clears all fog definitions regardless of tag.
|
|
11698
|
+
* @returns
|
|
11699
|
+
* Returns true if at least one entry was removed, or false if
|
|
11700
|
+
* the stack was unchanged.
|
|
11701
|
+
* @throws
|
|
11702
|
+
* Throws if the entity is invalid.
|
|
11703
|
+
*
|
|
11704
|
+
* {@link InvalidEntityError}
|
|
10360
11705
|
*/
|
|
10361
|
-
|
|
10362
|
-
static readonly componentId = 'minecraft:flying_speed';
|
|
11706
|
+
remove(tag?: string): boolean;
|
|
10363
11707
|
}
|
|
10364
11708
|
|
|
10365
11709
|
/**
|
|
@@ -11842,6 +13186,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
11842
13186
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
11843
13187
|
}
|
|
11844
13188
|
|
|
13189
|
+
/**
|
|
13190
|
+
* @beta
|
|
13191
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
13192
|
+
* name, and dialogue interactions.
|
|
13193
|
+
*/
|
|
13194
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13195
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
13196
|
+
private constructor();
|
|
13197
|
+
/**
|
|
13198
|
+
* @remarks
|
|
13199
|
+
* The DialogueScene that is opened when players first interact
|
|
13200
|
+
* with the NPC.
|
|
13201
|
+
*
|
|
13202
|
+
* This property can't be edited in restricted-execution mode.
|
|
13203
|
+
*
|
|
13204
|
+
*/
|
|
13205
|
+
defaultScene: string;
|
|
13206
|
+
/**
|
|
13207
|
+
* @remarks
|
|
13208
|
+
* The name of the NPC as it is displayed to players.
|
|
13209
|
+
*
|
|
13210
|
+
* This property can't be edited in restricted-execution mode.
|
|
13211
|
+
*
|
|
13212
|
+
*/
|
|
13213
|
+
name: string;
|
|
13214
|
+
/**
|
|
13215
|
+
* @remarks
|
|
13216
|
+
* The index of the skin the NPC will use.
|
|
13217
|
+
*
|
|
13218
|
+
* This property can't be edited in restricted-execution mode.
|
|
13219
|
+
*
|
|
13220
|
+
*/
|
|
13221
|
+
skinIndex: number;
|
|
13222
|
+
static readonly componentId = 'minecraft:npc';
|
|
13223
|
+
}
|
|
13224
|
+
|
|
11845
13225
|
/**
|
|
11846
13226
|
* When present on an entity, this entity is on fire.
|
|
11847
13227
|
* @example setOnFire.ts
|
|
@@ -12514,6 +13894,102 @@ export class EntitySpawnAfterEventSignal {
|
|
|
12514
13894
|
unsubscribe(callback: (arg0: EntitySpawnAfterEvent) => void): void;
|
|
12515
13895
|
}
|
|
12516
13896
|
|
|
13897
|
+
/**
|
|
13898
|
+
* @beta
|
|
13899
|
+
* Contains data related to an entity beginning to sneak.
|
|
13900
|
+
*/
|
|
13901
|
+
export class EntityStartSneakingAfterEvent {
|
|
13902
|
+
private constructor();
|
|
13903
|
+
/**
|
|
13904
|
+
* @remarks
|
|
13905
|
+
* Entity that has started sneaking.
|
|
13906
|
+
*
|
|
13907
|
+
*/
|
|
13908
|
+
readonly entity: Entity;
|
|
13909
|
+
}
|
|
13910
|
+
|
|
13911
|
+
/**
|
|
13912
|
+
* @beta
|
|
13913
|
+
* Manages callbacks that are connected to when an entity
|
|
13914
|
+
* begins sneaking.
|
|
13915
|
+
*/
|
|
13916
|
+
export class EntityStartSneakingAfterEventSignal {
|
|
13917
|
+
private constructor();
|
|
13918
|
+
/**
|
|
13919
|
+
* @remarks
|
|
13920
|
+
* Adds a callback that will be called when an entity begins
|
|
13921
|
+
* sneaking.
|
|
13922
|
+
*
|
|
13923
|
+
* This function can't be called in restricted-execution mode.
|
|
13924
|
+
*
|
|
13925
|
+
* This function can be called in early-execution mode.
|
|
13926
|
+
*
|
|
13927
|
+
*/
|
|
13928
|
+
subscribe(
|
|
13929
|
+
callback: (arg0: EntityStartSneakingAfterEvent) => void,
|
|
13930
|
+
options?: EntitySneakingChangedEventOptions,
|
|
13931
|
+
): (arg0: EntityStartSneakingAfterEvent) => void;
|
|
13932
|
+
/**
|
|
13933
|
+
* @remarks
|
|
13934
|
+
* Removes a callback from being called when an entity begins
|
|
13935
|
+
* sneaking.
|
|
13936
|
+
*
|
|
13937
|
+
* This function can't be called in restricted-execution mode.
|
|
13938
|
+
*
|
|
13939
|
+
* This function can be called in early-execution mode.
|
|
13940
|
+
*
|
|
13941
|
+
*/
|
|
13942
|
+
unsubscribe(callback: (arg0: EntityStartSneakingAfterEvent) => void): void;
|
|
13943
|
+
}
|
|
13944
|
+
|
|
13945
|
+
/**
|
|
13946
|
+
* @beta
|
|
13947
|
+
* Contains data related to an entity stopping sneaking.
|
|
13948
|
+
*/
|
|
13949
|
+
export class EntityStopSneakingAfterEvent {
|
|
13950
|
+
private constructor();
|
|
13951
|
+
/**
|
|
13952
|
+
* @remarks
|
|
13953
|
+
* Entity that has stopped sneaking.
|
|
13954
|
+
*
|
|
13955
|
+
*/
|
|
13956
|
+
readonly entity: Entity;
|
|
13957
|
+
}
|
|
13958
|
+
|
|
13959
|
+
/**
|
|
13960
|
+
* @beta
|
|
13961
|
+
* Manages callbacks that are connected to when an entity stops
|
|
13962
|
+
* sneaking.
|
|
13963
|
+
*/
|
|
13964
|
+
export class EntityStopSneakingAfterEventSignal {
|
|
13965
|
+
private constructor();
|
|
13966
|
+
/**
|
|
13967
|
+
* @remarks
|
|
13968
|
+
* Adds a callback that will be called when an entity stops
|
|
13969
|
+
* sneaking.
|
|
13970
|
+
*
|
|
13971
|
+
* This function can't be called in restricted-execution mode.
|
|
13972
|
+
*
|
|
13973
|
+
* This function can be called in early-execution mode.
|
|
13974
|
+
*
|
|
13975
|
+
*/
|
|
13976
|
+
subscribe(
|
|
13977
|
+
callback: (arg0: EntityStopSneakingAfterEvent) => void,
|
|
13978
|
+
options?: EntitySneakingChangedEventOptions,
|
|
13979
|
+
): (arg0: EntityStopSneakingAfterEvent) => void;
|
|
13980
|
+
/**
|
|
13981
|
+
* @remarks
|
|
13982
|
+
* Removes a callback from being called when an entity stops
|
|
13983
|
+
* sneaking.
|
|
13984
|
+
*
|
|
13985
|
+
* This function can't be called in restricted-execution mode.
|
|
13986
|
+
*
|
|
13987
|
+
* This function can be called in early-execution mode.
|
|
13988
|
+
*
|
|
13989
|
+
*/
|
|
13990
|
+
unsubscribe(callback: (arg0: EntityStopSneakingAfterEvent) => void): void;
|
|
13991
|
+
}
|
|
13992
|
+
|
|
12517
13993
|
/**
|
|
12518
13994
|
* Defines the entity's ability to carry items. An entity with
|
|
12519
13995
|
* a higher strength would have higher potential carry capacity
|
|
@@ -12601,6 +14077,44 @@ export class EntityTameableComponent extends EntityComponent {
|
|
|
12601
14077
|
tame(player: Player): boolean;
|
|
12602
14078
|
}
|
|
12603
14079
|
|
|
14080
|
+
/**
|
|
14081
|
+
* @beta
|
|
14082
|
+
* Contains data related to an entity being tamed.
|
|
14083
|
+
*/
|
|
14084
|
+
export class EntityTamedAfterEvent {
|
|
14085
|
+
private constructor();
|
|
14086
|
+
readonly entity: Entity;
|
|
14087
|
+
readonly tamingEntity: Entity;
|
|
14088
|
+
}
|
|
14089
|
+
|
|
14090
|
+
/**
|
|
14091
|
+
* @beta
|
|
14092
|
+
* Manages callbacks that are connected to when an entity is
|
|
14093
|
+
* tamed.
|
|
14094
|
+
*/
|
|
14095
|
+
export class EntityTamedAfterEventSignal {
|
|
14096
|
+
private constructor();
|
|
14097
|
+
/**
|
|
14098
|
+
* @remarks
|
|
14099
|
+
* This function can't be called in restricted-execution mode.
|
|
14100
|
+
*
|
|
14101
|
+
* This function can be called in early-execution mode.
|
|
14102
|
+
*
|
|
14103
|
+
*/
|
|
14104
|
+
subscribe(
|
|
14105
|
+
callback: (arg0: EntityTamedAfterEvent) => void,
|
|
14106
|
+
options?: EntityTamedEventFilter,
|
|
14107
|
+
): (arg0: EntityTamedAfterEvent) => void;
|
|
14108
|
+
/**
|
|
14109
|
+
* @remarks
|
|
14110
|
+
* This function can't be called in restricted-execution mode.
|
|
14111
|
+
*
|
|
14112
|
+
* This function can be called in early-execution mode.
|
|
14113
|
+
*
|
|
14114
|
+
*/
|
|
14115
|
+
unsubscribe(callback: (arg0: EntityTamedAfterEvent) => void): void;
|
|
14116
|
+
}
|
|
14117
|
+
|
|
12604
14118
|
/**
|
|
12605
14119
|
* Contains options for taming a rideable entity based on the
|
|
12606
14120
|
* entity that mounts it.
|
|
@@ -12713,7 +14227,7 @@ export class EntityTypes {
|
|
|
12713
14227
|
* Retrieves an entity type using a string-based identifier.
|
|
12714
14228
|
*
|
|
12715
14229
|
*/
|
|
12716
|
-
static get(identifier:
|
|
14230
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
12717
14231
|
/**
|
|
12718
14232
|
* @remarks
|
|
12719
14233
|
* Retrieves a set of all entity types within this world.
|
|
@@ -13310,6 +14824,13 @@ export class GameRules {
|
|
|
13310
14824
|
*
|
|
13311
14825
|
*/
|
|
13312
14826
|
playersSleepingPercentage: number;
|
|
14827
|
+
/**
|
|
14828
|
+
* @beta
|
|
14829
|
+
* @remarks
|
|
14830
|
+
* This property can't be edited in restricted-execution mode.
|
|
14831
|
+
*
|
|
14832
|
+
*/
|
|
14833
|
+
playerWaypoints: PlayerWaypointsMode;
|
|
13313
14834
|
/**
|
|
13314
14835
|
* @remarks
|
|
13315
14836
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -13457,6 +14978,42 @@ export class ISerializable {
|
|
|
13457
14978
|
private constructor();
|
|
13458
14979
|
}
|
|
13459
14980
|
|
|
14981
|
+
/**
|
|
14982
|
+
* @beta
|
|
14983
|
+
* Represents the dynamic properties of a block. Only available
|
|
14984
|
+
* from block entities. Up to 1KBytes of data can be stored per
|
|
14985
|
+
* block entity in their dynamic properties storage.
|
|
14986
|
+
*/
|
|
14987
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14988
|
+
export class ItemBlockDynamicPropertiesComponent extends ItemComponent {
|
|
14989
|
+
private constructor();
|
|
14990
|
+
static readonly componentId = 'minecraft:block_actor_dynamic_properties';
|
|
14991
|
+
/**
|
|
14992
|
+
* @remarks
|
|
14993
|
+
* Returns a DynamicProperty that was stored with the provided
|
|
14994
|
+
* key. Keys are unique to each content pack and cannot be used
|
|
14995
|
+
* to retrieve dynamic properties set from other content packs.
|
|
14996
|
+
* Returns undefined if the key was not found.
|
|
14997
|
+
*
|
|
14998
|
+
* @throws This function can throw errors.
|
|
14999
|
+
*
|
|
15000
|
+
* {@link Error}
|
|
15001
|
+
*
|
|
15002
|
+
* {@link InvalidItemStackError}
|
|
15003
|
+
*/
|
|
15004
|
+
get(key: string): boolean | number | string | Vector3 | undefined;
|
|
15005
|
+
/**
|
|
15006
|
+
* @remarks
|
|
15007
|
+
* Returns the current size, in bytes, of the dynamic
|
|
15008
|
+
* properties storage for this block.
|
|
15009
|
+
*
|
|
15010
|
+
* @throws This function can throw errors.
|
|
15011
|
+
*
|
|
15012
|
+
* {@link InvalidItemStackError}
|
|
15013
|
+
*/
|
|
15014
|
+
totalByteCount(): number;
|
|
15015
|
+
}
|
|
15016
|
+
|
|
13460
15017
|
/**
|
|
13461
15018
|
* When present on an item, this item is a book item. Can
|
|
13462
15019
|
* access and modify the contents of the book and sign it.
|
|
@@ -15813,6 +17370,10 @@ export class LootingEnchantFunction extends LootItemFunction {
|
|
|
15813
17370
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15814
17371
|
export class LootItem extends LootPoolEntry {
|
|
15815
17372
|
private constructor();
|
|
17373
|
+
/**
|
|
17374
|
+
* @beta
|
|
17375
|
+
*/
|
|
17376
|
+
readonly conditions: LootItemCondition[];
|
|
15816
17377
|
readonly functions: LootItemFunction[];
|
|
15817
17378
|
/**
|
|
15818
17379
|
* @remarks
|
|
@@ -16168,6 +17729,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
16168
17729
|
readonly itemTagsNone: string[];
|
|
16169
17730
|
}
|
|
16170
17731
|
|
|
17732
|
+
/**
|
|
17733
|
+
* @beta
|
|
17734
|
+
* A specific currently-internal event used for passing
|
|
17735
|
+
* messages from client to server.
|
|
17736
|
+
*/
|
|
17737
|
+
export class MessageReceiveAfterEvent {
|
|
17738
|
+
private constructor();
|
|
17739
|
+
/**
|
|
17740
|
+
* @remarks
|
|
17741
|
+
* The message identifier.
|
|
17742
|
+
*
|
|
17743
|
+
*/
|
|
17744
|
+
readonly id: string;
|
|
17745
|
+
/**
|
|
17746
|
+
* @remarks
|
|
17747
|
+
* The message.
|
|
17748
|
+
*
|
|
17749
|
+
*/
|
|
17750
|
+
readonly message: string;
|
|
17751
|
+
/**
|
|
17752
|
+
* @remarks
|
|
17753
|
+
* The player who sent the message.
|
|
17754
|
+
*
|
|
17755
|
+
*/
|
|
17756
|
+
readonly player: Player;
|
|
17757
|
+
}
|
|
17758
|
+
|
|
16171
17759
|
/**
|
|
16172
17760
|
* Contains a set of additional variable values for further
|
|
16173
17761
|
* defining how rendering and animations function.
|
|
@@ -16233,7 +17821,50 @@ export class MolangVariableMap {
|
|
|
16233
17821
|
*
|
|
16234
17822
|
* @throws This function can throw errors.
|
|
16235
17823
|
*/
|
|
16236
|
-
setVector3(variableName: string, vector: Vector3): void;
|
|
17824
|
+
setVector3(variableName: string, vector: Vector3): void;
|
|
17825
|
+
}
|
|
17826
|
+
|
|
17827
|
+
/**
|
|
17828
|
+
* @beta
|
|
17829
|
+
* Pack setting name and value that changed.
|
|
17830
|
+
*/
|
|
17831
|
+
export class PackSettingChangeAfterEvent {
|
|
17832
|
+
private constructor();
|
|
17833
|
+
/**
|
|
17834
|
+
* @remarks
|
|
17835
|
+
* The name of the setting.
|
|
17836
|
+
*
|
|
17837
|
+
*/
|
|
17838
|
+
readonly settingName: string;
|
|
17839
|
+
/**
|
|
17840
|
+
* @remarks
|
|
17841
|
+
* The value of the setting.
|
|
17842
|
+
*
|
|
17843
|
+
*/
|
|
17844
|
+
readonly settingValue: boolean | number | string;
|
|
17845
|
+
}
|
|
17846
|
+
|
|
17847
|
+
/**
|
|
17848
|
+
* @beta
|
|
17849
|
+
*/
|
|
17850
|
+
export class PackSettingChangeAfterEventSignal {
|
|
17851
|
+
private constructor();
|
|
17852
|
+
/**
|
|
17853
|
+
* @remarks
|
|
17854
|
+
* This function can't be called in restricted-execution mode.
|
|
17855
|
+
*
|
|
17856
|
+
* This function can be called in early-execution mode.
|
|
17857
|
+
*
|
|
17858
|
+
*/
|
|
17859
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
17860
|
+
/**
|
|
17861
|
+
* @remarks
|
|
17862
|
+
* This function can't be called in restricted-execution mode.
|
|
17863
|
+
*
|
|
17864
|
+
* This function can be called in early-execution mode.
|
|
17865
|
+
*
|
|
17866
|
+
*/
|
|
17867
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
16237
17868
|
}
|
|
16238
17869
|
|
|
16239
17870
|
/**
|
|
@@ -16403,6 +18034,62 @@ export class Player extends Entity {
|
|
|
16403
18034
|
* @throws This property can throw when used.
|
|
16404
18035
|
*/
|
|
16405
18036
|
readonly camera: Camera;
|
|
18037
|
+
/**
|
|
18038
|
+
* @beta
|
|
18039
|
+
* @remarks
|
|
18040
|
+
* The player's chat display name, composed from {@link
|
|
18041
|
+
* Player.chatNamePrefix} + {@link Player.name} + {@link
|
|
18042
|
+
* Player.chatNameSuffix}. This is the name shown as the author
|
|
18043
|
+
* of chat messages sent by this player. To change the name
|
|
18044
|
+
* shown above the player's head, use {@link Entity.nameTag}.
|
|
18045
|
+
*
|
|
18046
|
+
* @throws This property can throw when used.
|
|
18047
|
+
*
|
|
18048
|
+
* {@link InvalidEntityError}
|
|
18049
|
+
*/
|
|
18050
|
+
readonly chatDisplayName: string;
|
|
18051
|
+
/**
|
|
18052
|
+
* @beta
|
|
18053
|
+
* @remarks
|
|
18054
|
+
* An optional string that, when set, is prepended to the text
|
|
18055
|
+
* of chat messages sent by this player. Useful for applying
|
|
18056
|
+
* formatting or color codes to a player's messages (e.g., '§a'
|
|
18057
|
+
* to make their messages green). Does not affect the player's
|
|
18058
|
+
* name display - use {@link Player.chatNamePrefix} for the
|
|
18059
|
+
* name shown in chat, or {@link Entity.nameTag} for the name
|
|
18060
|
+
* above the player's head. Set to undefined to clear.
|
|
18061
|
+
*
|
|
18062
|
+
* This property can't be edited in restricted-execution mode.
|
|
18063
|
+
*
|
|
18064
|
+
*/
|
|
18065
|
+
chatMessagePrefix?: string;
|
|
18066
|
+
/**
|
|
18067
|
+
* @beta
|
|
18068
|
+
* @remarks
|
|
18069
|
+
* An optional string that, when set, is prepended to the
|
|
18070
|
+
* player's name in chat messages. Does not affect the name tag
|
|
18071
|
+
* above the player's head or the player list - use {@link
|
|
18072
|
+
* Entity.nameTag} for that. To prefix the message text itself,
|
|
18073
|
+
* use {@link Player.chatMessagePrefix}. Set to undefined to
|
|
18074
|
+
* clear.
|
|
18075
|
+
*
|
|
18076
|
+
* This property can't be edited in restricted-execution mode.
|
|
18077
|
+
*
|
|
18078
|
+
*/
|
|
18079
|
+
chatNamePrefix?: string;
|
|
18080
|
+
/**
|
|
18081
|
+
* @beta
|
|
18082
|
+
* @remarks
|
|
18083
|
+
* An optional string that, when set, is appended to the
|
|
18084
|
+
* player's name in chat messages. Does not affect the name tag
|
|
18085
|
+
* above the player's head or the player list - use {@link
|
|
18086
|
+
* Entity.nameTag} for that. See also {@link
|
|
18087
|
+
* Player.chatNamePrefix}. Set to undefined to clear.
|
|
18088
|
+
*
|
|
18089
|
+
* This property can't be edited in restricted-execution mode.
|
|
18090
|
+
*
|
|
18091
|
+
*/
|
|
18092
|
+
chatNameSuffix?: string;
|
|
16406
18093
|
/**
|
|
16407
18094
|
* @remarks
|
|
16408
18095
|
* Contains the player's device information.
|
|
@@ -16506,6 +18193,18 @@ export class Player extends Entity {
|
|
|
16506
18193
|
* {@link InvalidEntityError}
|
|
16507
18194
|
*/
|
|
16508
18195
|
readonly playerPermissionLevel: PlayerPermissionLevel;
|
|
18196
|
+
/**
|
|
18197
|
+
* @beta
|
|
18198
|
+
* @remarks
|
|
18199
|
+
* Gets the player's Playfab ID.
|
|
18200
|
+
*
|
|
18201
|
+
* @throws This property can throw when used.
|
|
18202
|
+
*
|
|
18203
|
+
* {@link minecraftcommon.EngineError}
|
|
18204
|
+
*
|
|
18205
|
+
* {@link InvalidEntityError}
|
|
18206
|
+
*/
|
|
18207
|
+
readonly playfabId: string;
|
|
16509
18208
|
/**
|
|
16510
18209
|
* @remarks
|
|
16511
18210
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -16573,6 +18272,20 @@ export class Player extends Entity {
|
|
|
16573
18272
|
* Throws if the Entity or Entity ID is invalid.
|
|
16574
18273
|
*/
|
|
16575
18274
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
18275
|
+
/**
|
|
18276
|
+
* @beta
|
|
18277
|
+
* @remarks
|
|
18278
|
+
* Eats an item, providing the item's hunger and saturation
|
|
18279
|
+
* effects to the player. Can only be used on food items.
|
|
18280
|
+
*
|
|
18281
|
+
* This function can't be called in restricted-execution mode.
|
|
18282
|
+
*
|
|
18283
|
+
* @param itemStack
|
|
18284
|
+
* The item to eat.
|
|
18285
|
+
* @throws
|
|
18286
|
+
* Throws if the item is not a food item.
|
|
18287
|
+
*/
|
|
18288
|
+
eatItem(itemStack: ItemStack): void;
|
|
16576
18289
|
/**
|
|
16577
18290
|
* @remarks
|
|
16578
18291
|
* The player's aim-assist settings.
|
|
@@ -16606,6 +18319,22 @@ export class Player extends Entity {
|
|
|
16606
18319
|
* @throws This function can throw errors.
|
|
16607
18320
|
*/
|
|
16608
18321
|
getItemCooldown(cooldownCategory: string): number;
|
|
18322
|
+
/**
|
|
18323
|
+
* @beta
|
|
18324
|
+
* @remarks
|
|
18325
|
+
* Gets the player's ping in milliseconds.
|
|
18326
|
+
*
|
|
18327
|
+
* This function can't be called in restricted-execution mode.
|
|
18328
|
+
*
|
|
18329
|
+
* @returns
|
|
18330
|
+
* The player's ping in milliseconds.
|
|
18331
|
+
* @throws This function can throw errors.
|
|
18332
|
+
*
|
|
18333
|
+
* {@link minecraftcommon.EngineError}
|
|
18334
|
+
*
|
|
18335
|
+
* {@link InvalidEntityError}
|
|
18336
|
+
*/
|
|
18337
|
+
getPing(): number;
|
|
16609
18338
|
/**
|
|
16610
18339
|
* @remarks
|
|
16611
18340
|
* Gets the current spawn point of the player.
|
|
@@ -16677,6 +18406,17 @@ export class Player extends Entity {
|
|
|
16677
18406
|
* ```
|
|
16678
18407
|
*/
|
|
16679
18408
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): SoundInstance;
|
|
18409
|
+
/**
|
|
18410
|
+
* @beta
|
|
18411
|
+
* @remarks
|
|
18412
|
+
* This is an internal-facing method for posting a system
|
|
18413
|
+
* message to downstream clients.
|
|
18414
|
+
*
|
|
18415
|
+
* This function can't be called in restricted-execution mode.
|
|
18416
|
+
*
|
|
18417
|
+
* @throws This function can throw errors.
|
|
18418
|
+
*/
|
|
18419
|
+
postClientMessage(id: string, value: string): void;
|
|
16680
18420
|
/**
|
|
16681
18421
|
* @remarks
|
|
16682
18422
|
* Queues an additional music track that only this particular
|
|
@@ -16952,6 +18692,18 @@ export class Player extends Entity {
|
|
|
16952
18692
|
* @throws This function can throw errors.
|
|
16953
18693
|
*/
|
|
16954
18694
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
18695
|
+
/**
|
|
18696
|
+
* @beta
|
|
18697
|
+
* @remarks
|
|
18698
|
+
* Stops all sounds from playing for this particular player.
|
|
18699
|
+
*
|
|
18700
|
+
* This function can't be called in restricted-execution mode.
|
|
18701
|
+
*
|
|
18702
|
+
* @throws This function can throw errors.
|
|
18703
|
+
*
|
|
18704
|
+
* {@link InvalidEntityError}
|
|
18705
|
+
*/
|
|
18706
|
+
stopAllSounds(): void;
|
|
16955
18707
|
/**
|
|
16956
18708
|
* @remarks
|
|
16957
18709
|
* Stops any music tracks from playing for this particular
|
|
@@ -16962,6 +18714,20 @@ export class Player extends Entity {
|
|
|
16962
18714
|
* @throws This function can throw errors.
|
|
16963
18715
|
*/
|
|
16964
18716
|
stopMusic(): void;
|
|
18717
|
+
/**
|
|
18718
|
+
* @beta
|
|
18719
|
+
* @remarks
|
|
18720
|
+
* Stops a sound from playing for this particular player.
|
|
18721
|
+
*
|
|
18722
|
+
* This function can't be called in restricted-execution mode.
|
|
18723
|
+
*
|
|
18724
|
+
* @param soundId
|
|
18725
|
+
* Identifier of the sound.
|
|
18726
|
+
* @throws This function can throw errors.
|
|
18727
|
+
*
|
|
18728
|
+
* {@link InvalidEntityError}
|
|
18729
|
+
*/
|
|
18730
|
+
stopSound(soundId: string): void;
|
|
16965
18731
|
}
|
|
16966
18732
|
|
|
16967
18733
|
/**
|
|
@@ -17195,6 +18961,83 @@ export class PlayerButtonInputAfterEventSignal {
|
|
|
17195
18961
|
unsubscribe(callback: (arg0: PlayerButtonInputAfterEvent) => void): void;
|
|
17196
18962
|
}
|
|
17197
18963
|
|
|
18964
|
+
/**
|
|
18965
|
+
* @beta
|
|
18966
|
+
* Contains information regarding an event after a player
|
|
18967
|
+
* cancels breaking a block.
|
|
18968
|
+
*/
|
|
18969
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18970
|
+
export class PlayerCancelBreakingBlockAfterEvent extends BlockEvent {
|
|
18971
|
+
private constructor();
|
|
18972
|
+
/**
|
|
18973
|
+
* @remarks
|
|
18974
|
+
* The permutation of the block that the player cancelled
|
|
18975
|
+
* breaking.
|
|
18976
|
+
*
|
|
18977
|
+
*/
|
|
18978
|
+
readonly blockPermutation: BlockPermutation;
|
|
18979
|
+
/**
|
|
18980
|
+
* @remarks
|
|
18981
|
+
* The progress of breaking the block when the player cancelled
|
|
18982
|
+
* in the exclusive range (0, 1).
|
|
18983
|
+
*
|
|
18984
|
+
*/
|
|
18985
|
+
readonly breakProgress: number;
|
|
18986
|
+
/**
|
|
18987
|
+
* @remarks
|
|
18988
|
+
* The face of the block that was being broken.
|
|
18989
|
+
*
|
|
18990
|
+
*/
|
|
18991
|
+
readonly face: Direction;
|
|
18992
|
+
/**
|
|
18993
|
+
* @remarks
|
|
18994
|
+
* The item stack that the player was using to break the block,
|
|
18995
|
+
* or undefined if empty hand.
|
|
18996
|
+
*
|
|
18997
|
+
*/
|
|
18998
|
+
readonly heldItemStack?: ItemStack;
|
|
18999
|
+
/**
|
|
19000
|
+
* @remarks
|
|
19001
|
+
* Player that cancelled breaking the block for this event.
|
|
19002
|
+
*
|
|
19003
|
+
*/
|
|
19004
|
+
readonly player: Player;
|
|
19005
|
+
}
|
|
19006
|
+
|
|
19007
|
+
/**
|
|
19008
|
+
* @beta
|
|
19009
|
+
* Manages callbacks that are connected to when a player
|
|
19010
|
+
* cancels breaking a block.
|
|
19011
|
+
*/
|
|
19012
|
+
export class PlayerCancelBreakingBlockAfterEventSignal {
|
|
19013
|
+
private constructor();
|
|
19014
|
+
/**
|
|
19015
|
+
* @remarks
|
|
19016
|
+
* Adds a callback that will be called when a player cancels
|
|
19017
|
+
* breaking a block.
|
|
19018
|
+
*
|
|
19019
|
+
* This function can't be called in restricted-execution mode.
|
|
19020
|
+
*
|
|
19021
|
+
* This function can be called in early-execution mode.
|
|
19022
|
+
*
|
|
19023
|
+
*/
|
|
19024
|
+
subscribe(
|
|
19025
|
+
callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void,
|
|
19026
|
+
options?: PlayerBreakingBlockEventOptions,
|
|
19027
|
+
): (arg0: PlayerCancelBreakingBlockAfterEvent) => void;
|
|
19028
|
+
/**
|
|
19029
|
+
* @remarks
|
|
19030
|
+
* Removes a callback from being called when a player cancels
|
|
19031
|
+
* breaking a block.
|
|
19032
|
+
*
|
|
19033
|
+
* This function can't be called in restricted-execution mode.
|
|
19034
|
+
*
|
|
19035
|
+
* This function can be called in early-execution mode.
|
|
19036
|
+
*
|
|
19037
|
+
*/
|
|
19038
|
+
unsubscribe(callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void): void;
|
|
19039
|
+
}
|
|
19040
|
+
|
|
17198
19041
|
/**
|
|
17199
19042
|
* Represents the players cursor inventory. Used when moving
|
|
17200
19043
|
* items between between containers in the inventory UI. Not
|
|
@@ -18235,69 +20078,221 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
18235
20078
|
): (arg0: PlayerPlaceBlockAfterEvent) => void;
|
|
18236
20079
|
/**
|
|
18237
20080
|
* @remarks
|
|
18238
|
-
* Removes a callback from being called when an block is placed
|
|
18239
|
-
* by a player.
|
|
20081
|
+
* Removes a callback from being called when an block is placed
|
|
20082
|
+
* by a player.
|
|
20083
|
+
*
|
|
20084
|
+
* This function can't be called in restricted-execution mode.
|
|
20085
|
+
*
|
|
20086
|
+
* This function can be called in early-execution mode.
|
|
20087
|
+
*
|
|
20088
|
+
*/
|
|
20089
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
20090
|
+
}
|
|
20091
|
+
|
|
20092
|
+
/**
|
|
20093
|
+
* @beta
|
|
20094
|
+
* Contains information regarding an event before a player
|
|
20095
|
+
* places a block.
|
|
20096
|
+
*/
|
|
20097
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20098
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
20099
|
+
private constructor();
|
|
20100
|
+
/**
|
|
20101
|
+
* @remarks
|
|
20102
|
+
* If set to true, cancels the block place event.
|
|
20103
|
+
*
|
|
20104
|
+
*/
|
|
20105
|
+
cancel: boolean;
|
|
20106
|
+
/**
|
|
20107
|
+
* @remarks
|
|
20108
|
+
* The face of the block that the new block is being placed on.
|
|
20109
|
+
*
|
|
20110
|
+
*/
|
|
20111
|
+
readonly face: Direction;
|
|
20112
|
+
/**
|
|
20113
|
+
* @remarks
|
|
20114
|
+
* Location relative to the bottom north-west corner of the
|
|
20115
|
+
* block where the new block is being placed onto.
|
|
20116
|
+
*
|
|
20117
|
+
*/
|
|
20118
|
+
readonly faceLocation: Vector3;
|
|
20119
|
+
/**
|
|
20120
|
+
* @remarks
|
|
20121
|
+
* The block permutation that will be placed if the event is
|
|
20122
|
+
* not cancelled.
|
|
20123
|
+
*
|
|
20124
|
+
*/
|
|
20125
|
+
readonly permutationToPlace: BlockPermutation;
|
|
20126
|
+
/**
|
|
20127
|
+
* @remarks
|
|
20128
|
+
* Player that is placing the block for this event.
|
|
20129
|
+
*
|
|
20130
|
+
*/
|
|
20131
|
+
readonly player: Player;
|
|
20132
|
+
}
|
|
20133
|
+
|
|
20134
|
+
/**
|
|
20135
|
+
* @beta
|
|
20136
|
+
* Manages callbacks that are connected to before a block is
|
|
20137
|
+
* placed by a player.
|
|
20138
|
+
*/
|
|
20139
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
20140
|
+
private constructor();
|
|
20141
|
+
/**
|
|
20142
|
+
* @remarks
|
|
20143
|
+
* Adds a callback that will be called before a block is placed
|
|
20144
|
+
* by a player.
|
|
20145
|
+
*
|
|
20146
|
+
* This function can't be called in restricted-execution mode.
|
|
20147
|
+
*
|
|
20148
|
+
* This function can be called in early-execution mode.
|
|
20149
|
+
*
|
|
20150
|
+
* @param callback
|
|
20151
|
+
* This closure is called with restricted-execution privilege.
|
|
20152
|
+
* @returns
|
|
20153
|
+
* Closure that is called with restricted-execution privilege.
|
|
20154
|
+
*/
|
|
20155
|
+
subscribe(
|
|
20156
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
20157
|
+
options?: BlockEventOptions,
|
|
20158
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
20159
|
+
/**
|
|
20160
|
+
* @remarks
|
|
20161
|
+
* Removes a callback from being called before an block is
|
|
20162
|
+
* placed by a player.
|
|
20163
|
+
*
|
|
20164
|
+
* This function can't be called in restricted-execution mode.
|
|
20165
|
+
*
|
|
20166
|
+
* This function can be called in early-execution mode.
|
|
20167
|
+
*
|
|
20168
|
+
* @param callback
|
|
20169
|
+
* This closure is called with restricted-execution privilege.
|
|
20170
|
+
*/
|
|
20171
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
20172
|
+
}
|
|
20173
|
+
|
|
20174
|
+
/**
|
|
20175
|
+
* An event that contains more information about a player
|
|
20176
|
+
* spawning.
|
|
20177
|
+
*/
|
|
20178
|
+
export class PlayerSpawnAfterEvent {
|
|
20179
|
+
private constructor();
|
|
20180
|
+
/**
|
|
20181
|
+
* @remarks
|
|
20182
|
+
* If true, this is the initial spawn of a player after joining
|
|
20183
|
+
* the game.
|
|
20184
|
+
*
|
|
20185
|
+
* This property can't be edited in restricted-execution mode.
|
|
20186
|
+
*
|
|
20187
|
+
*/
|
|
20188
|
+
initialSpawn: boolean;
|
|
20189
|
+
/**
|
|
20190
|
+
* @remarks
|
|
20191
|
+
* Object that represents the player that joined the game.
|
|
20192
|
+
*
|
|
20193
|
+
* This property can't be edited in restricted-execution mode.
|
|
20194
|
+
*
|
|
20195
|
+
*/
|
|
20196
|
+
player: Player;
|
|
20197
|
+
}
|
|
20198
|
+
|
|
20199
|
+
/**
|
|
20200
|
+
* Registers an event when a player is spawned (or re-spawned
|
|
20201
|
+
* after death) and fully ready within the world.
|
|
20202
|
+
*/
|
|
20203
|
+
export class PlayerSpawnAfterEventSignal {
|
|
20204
|
+
private constructor();
|
|
20205
|
+
/**
|
|
20206
|
+
* @remarks
|
|
20207
|
+
* Registers a new event receiver for this particular type of
|
|
20208
|
+
* event.
|
|
20209
|
+
*
|
|
20210
|
+
* This function can't be called in restricted-execution mode.
|
|
20211
|
+
*
|
|
20212
|
+
* This function can be called in early-execution mode.
|
|
20213
|
+
*
|
|
20214
|
+
*/
|
|
20215
|
+
subscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): (arg0: PlayerSpawnAfterEvent) => void;
|
|
20216
|
+
/**
|
|
20217
|
+
* @remarks
|
|
20218
|
+
* De-registers an event receiver for the player spawn event.
|
|
18240
20219
|
*
|
|
18241
20220
|
* This function can't be called in restricted-execution mode.
|
|
18242
20221
|
*
|
|
18243
20222
|
* This function can be called in early-execution mode.
|
|
18244
20223
|
*
|
|
18245
20224
|
*/
|
|
18246
|
-
unsubscribe(callback: (arg0:
|
|
20225
|
+
unsubscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): void;
|
|
18247
20226
|
}
|
|
18248
20227
|
|
|
18249
20228
|
/**
|
|
18250
|
-
*
|
|
18251
|
-
*
|
|
20229
|
+
* @beta
|
|
20230
|
+
* Contains information regarding an event after a player
|
|
20231
|
+
* starts breaking a block.
|
|
18252
20232
|
*/
|
|
18253
|
-
|
|
20233
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20234
|
+
export class PlayerStartBreakingBlockAfterEvent extends BlockEvent {
|
|
18254
20235
|
private constructor();
|
|
18255
20236
|
/**
|
|
18256
20237
|
* @remarks
|
|
18257
|
-
*
|
|
18258
|
-
*
|
|
20238
|
+
* The permutation of the block that the player is starting to
|
|
20239
|
+
* break.
|
|
18259
20240
|
*
|
|
18260
|
-
|
|
20241
|
+
*/
|
|
20242
|
+
readonly blockPermutation: BlockPermutation;
|
|
20243
|
+
/**
|
|
20244
|
+
* @remarks
|
|
20245
|
+
* The face of the block being broken.
|
|
18261
20246
|
*
|
|
18262
20247
|
*/
|
|
18263
|
-
|
|
20248
|
+
readonly face: Direction;
|
|
18264
20249
|
/**
|
|
18265
20250
|
* @remarks
|
|
18266
|
-
*
|
|
20251
|
+
* The item stack that the player is using to break the block,
|
|
20252
|
+
* or undefined if empty hand.
|
|
18267
20253
|
*
|
|
18268
|
-
|
|
20254
|
+
*/
|
|
20255
|
+
readonly heldItemStack?: ItemStack;
|
|
20256
|
+
/**
|
|
20257
|
+
* @remarks
|
|
20258
|
+
* Player that started breaking the block for this event.
|
|
18269
20259
|
*
|
|
18270
20260
|
*/
|
|
18271
|
-
player: Player;
|
|
20261
|
+
readonly player: Player;
|
|
18272
20262
|
}
|
|
18273
20263
|
|
|
18274
20264
|
/**
|
|
18275
|
-
*
|
|
18276
|
-
*
|
|
20265
|
+
* @beta
|
|
20266
|
+
* Manages callbacks that are connected to when a player starts
|
|
20267
|
+
* breaking a block.
|
|
18277
20268
|
*/
|
|
18278
|
-
export class
|
|
20269
|
+
export class PlayerStartBreakingBlockAfterEventSignal {
|
|
18279
20270
|
private constructor();
|
|
18280
20271
|
/**
|
|
18281
20272
|
* @remarks
|
|
18282
|
-
*
|
|
18283
|
-
*
|
|
20273
|
+
* Adds a callback that will be called when a player starts
|
|
20274
|
+
* breaking a block.
|
|
18284
20275
|
*
|
|
18285
20276
|
* This function can't be called in restricted-execution mode.
|
|
18286
20277
|
*
|
|
18287
20278
|
* This function can be called in early-execution mode.
|
|
18288
20279
|
*
|
|
18289
20280
|
*/
|
|
18290
|
-
subscribe(
|
|
20281
|
+
subscribe(
|
|
20282
|
+
callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void,
|
|
20283
|
+
options?: PlayerBreakingBlockEventOptions,
|
|
20284
|
+
): (arg0: PlayerStartBreakingBlockAfterEvent) => void;
|
|
18291
20285
|
/**
|
|
18292
20286
|
* @remarks
|
|
18293
|
-
*
|
|
20287
|
+
* Removes a callback from being called when a player starts
|
|
20288
|
+
* breaking a block.
|
|
18294
20289
|
*
|
|
18295
20290
|
* This function can't be called in restricted-execution mode.
|
|
18296
20291
|
*
|
|
18297
20292
|
* This function can be called in early-execution mode.
|
|
18298
20293
|
*
|
|
18299
20294
|
*/
|
|
18300
|
-
unsubscribe(callback: (arg0:
|
|
20295
|
+
unsubscribe(callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void): void;
|
|
18301
20296
|
}
|
|
18302
20297
|
|
|
18303
20298
|
/**
|
|
@@ -18364,6 +20359,80 @@ export class PlayerSwingStartAfterEventSignal {
|
|
|
18364
20359
|
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
18365
20360
|
}
|
|
18366
20361
|
|
|
20362
|
+
/**
|
|
20363
|
+
* @beta
|
|
20364
|
+
* Contains information related to when a player successfully
|
|
20365
|
+
* names an Entity with a named Name Tag item.
|
|
20366
|
+
*/
|
|
20367
|
+
export class PlayerUseNameTagAfterEvent {
|
|
20368
|
+
private constructor();
|
|
20369
|
+
/**
|
|
20370
|
+
* @remarks
|
|
20371
|
+
* The entity that was named by the player.
|
|
20372
|
+
*
|
|
20373
|
+
* This property can't be edited in restricted-execution mode.
|
|
20374
|
+
*
|
|
20375
|
+
*/
|
|
20376
|
+
entityNamed: Entity;
|
|
20377
|
+
/**
|
|
20378
|
+
* @remarks
|
|
20379
|
+
* The new name that the player has given to the entity.
|
|
20380
|
+
*
|
|
20381
|
+
* This property can't be edited in restricted-execution mode.
|
|
20382
|
+
*
|
|
20383
|
+
*/
|
|
20384
|
+
newName: string;
|
|
20385
|
+
/**
|
|
20386
|
+
* @remarks
|
|
20387
|
+
* Handle to the player that used the name tag.
|
|
20388
|
+
*
|
|
20389
|
+
* This property can't be edited in restricted-execution mode.
|
|
20390
|
+
*
|
|
20391
|
+
*/
|
|
20392
|
+
player: Player;
|
|
20393
|
+
/**
|
|
20394
|
+
* @remarks
|
|
20395
|
+
* The previous name of the entity before the player used the
|
|
20396
|
+
* name tag. This will be undefined if the entity was not
|
|
20397
|
+
* previously named.
|
|
20398
|
+
*
|
|
20399
|
+
* This property can't be edited in restricted-execution mode.
|
|
20400
|
+
*
|
|
20401
|
+
*/
|
|
20402
|
+
previousName?: string;
|
|
20403
|
+
}
|
|
20404
|
+
|
|
20405
|
+
/**
|
|
20406
|
+
* @beta
|
|
20407
|
+
* Manages callbacks that are connected to when a player
|
|
20408
|
+
* successfully names an Entity with a named Name Tag item.
|
|
20409
|
+
*/
|
|
20410
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
20411
|
+
private constructor();
|
|
20412
|
+
/**
|
|
20413
|
+
* @remarks
|
|
20414
|
+
* Subscribes the specified callback to a player use name tag
|
|
20415
|
+
* after event.
|
|
20416
|
+
*
|
|
20417
|
+
* This function can't be called in restricted-execution mode.
|
|
20418
|
+
*
|
|
20419
|
+
* This function can be called in early-execution mode.
|
|
20420
|
+
*
|
|
20421
|
+
*/
|
|
20422
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
20423
|
+
/**
|
|
20424
|
+
* @remarks
|
|
20425
|
+
* Removes the specified callback from a player use name tag
|
|
20426
|
+
* after event.
|
|
20427
|
+
*
|
|
20428
|
+
* This function can't be called in restricted-execution mode.
|
|
20429
|
+
*
|
|
20430
|
+
* This function can be called in early-execution mode.
|
|
20431
|
+
*
|
|
20432
|
+
*/
|
|
20433
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
20434
|
+
}
|
|
20435
|
+
|
|
18367
20436
|
/**
|
|
18368
20437
|
* @rc
|
|
18369
20438
|
* Waypoint that tracks a player's position. Extends {@link
|
|
@@ -18480,10 +20549,10 @@ export class Potions {
|
|
|
18480
20549
|
*
|
|
18481
20550
|
* {@link InvalidPotionEffectTypeError}
|
|
18482
20551
|
*/
|
|
18483
|
-
static resolve
|
|
18484
|
-
|
|
18485
|
-
|
|
18486
|
-
): ItemStack;
|
|
20552
|
+
static resolve<
|
|
20553
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
20554
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
20555
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
18487
20556
|
}
|
|
18488
20557
|
|
|
18489
20558
|
/**
|
|
@@ -19692,6 +21761,38 @@ export class Seat {
|
|
|
19692
21761
|
readonly seatRotation: number;
|
|
19693
21762
|
}
|
|
19694
21763
|
|
|
21764
|
+
/**
|
|
21765
|
+
* @beta
|
|
21766
|
+
* Manages callbacks that are message passing to a server. This
|
|
21767
|
+
* event is not currently fully implemented, and should not be
|
|
21768
|
+
* used.
|
|
21769
|
+
*/
|
|
21770
|
+
export class ServerMessageAfterEventSignal {
|
|
21771
|
+
private constructor();
|
|
21772
|
+
/**
|
|
21773
|
+
* @remarks
|
|
21774
|
+
* Adds a callback that will be called when an internal message
|
|
21775
|
+
* is passed.
|
|
21776
|
+
*
|
|
21777
|
+
* This function can't be called in restricted-execution mode.
|
|
21778
|
+
*
|
|
21779
|
+
* This function can be called in early-execution mode.
|
|
21780
|
+
*
|
|
21781
|
+
*/
|
|
21782
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
21783
|
+
/**
|
|
21784
|
+
* @remarks
|
|
21785
|
+
* Removes a callback from being called when an internal
|
|
21786
|
+
* message is passed.
|
|
21787
|
+
*
|
|
21788
|
+
* This function can't be called in restricted-execution mode.
|
|
21789
|
+
*
|
|
21790
|
+
* This function can be called in early-execution mode.
|
|
21791
|
+
*
|
|
21792
|
+
*/
|
|
21793
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
21794
|
+
}
|
|
21795
|
+
|
|
19695
21796
|
/**
|
|
19696
21797
|
* Loot item function that modifies the trim on a dropped armor
|
|
19697
21798
|
* item.
|
|
@@ -19720,6 +21821,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
19720
21821
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19721
21822
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
19722
21823
|
private constructor();
|
|
21824
|
+
/**
|
|
21825
|
+
* @beta
|
|
21826
|
+
* @remarks
|
|
21827
|
+
* The base color for the dropped banner.
|
|
21828
|
+
*
|
|
21829
|
+
*/
|
|
21830
|
+
readonly baseColor: string;
|
|
21831
|
+
/**
|
|
21832
|
+
* @beta
|
|
21833
|
+
* @remarks
|
|
21834
|
+
* An array of {@link BannerPattern} objects used to decorate
|
|
21835
|
+
* the banner, including color and pattern type.
|
|
21836
|
+
*
|
|
21837
|
+
*/
|
|
21838
|
+
readonly patterns: BannerPattern[];
|
|
19723
21839
|
/**
|
|
19724
21840
|
* @remarks
|
|
19725
21841
|
* The type of banner to drop.
|
|
@@ -19964,6 +22080,86 @@ export class SmeltItemFunction extends LootItemFunction {
|
|
|
19964
22080
|
private constructor();
|
|
19965
22081
|
}
|
|
19966
22082
|
|
|
22083
|
+
/**
|
|
22084
|
+
* @beta
|
|
22085
|
+
* Contains information about a sound thats declared duration
|
|
22086
|
+
* elapsed.
|
|
22087
|
+
*/
|
|
22088
|
+
export class SoundCompletedAfterEvent {
|
|
22089
|
+
private constructor();
|
|
22090
|
+
/**
|
|
22091
|
+
* @remarks
|
|
22092
|
+
* Identifier of the sound instance that completed. Matches the
|
|
22093
|
+
* `id` property of the `SoundInstance` returned when the sound
|
|
22094
|
+
* was played.
|
|
22095
|
+
*
|
|
22096
|
+
*/
|
|
22097
|
+
readonly soundInstanceId: string;
|
|
22098
|
+
}
|
|
22099
|
+
|
|
22100
|
+
/**
|
|
22101
|
+
* @beta
|
|
22102
|
+
* Manages callbacks that are invoked when a tracked sound's
|
|
22103
|
+
* declared duration elapses.
|
|
22104
|
+
*/
|
|
22105
|
+
export class SoundCompletedAfterEventSignal {
|
|
22106
|
+
private constructor();
|
|
22107
|
+
/**
|
|
22108
|
+
* @remarks
|
|
22109
|
+
* Adds a callback that will be invoked when a tracked sound's
|
|
22110
|
+
* declared duration elapses.
|
|
22111
|
+
*
|
|
22112
|
+
* This function can't be called in restricted-execution mode.
|
|
22113
|
+
*
|
|
22114
|
+
* This function can be called in early-execution mode.
|
|
22115
|
+
*
|
|
22116
|
+
*/
|
|
22117
|
+
subscribe(callback: (arg0: SoundCompletedAfterEvent) => void): (arg0: SoundCompletedAfterEvent) => void;
|
|
22118
|
+
/**
|
|
22119
|
+
* @remarks
|
|
22120
|
+
* Removes a callback from being invoked when a tracked sound's
|
|
22121
|
+
* declared duration elapses.
|
|
22122
|
+
*
|
|
22123
|
+
* This function can't be called in restricted-execution mode.
|
|
22124
|
+
*
|
|
22125
|
+
* This function can be called in early-execution mode.
|
|
22126
|
+
*
|
|
22127
|
+
*/
|
|
22128
|
+
unsubscribe(callback: (arg0: SoundCompletedAfterEvent) => void): void;
|
|
22129
|
+
}
|
|
22130
|
+
|
|
22131
|
+
/**
|
|
22132
|
+
* @beta
|
|
22133
|
+
* Provides duration and playback information for a sound whose
|
|
22134
|
+
* definition declares a duration.
|
|
22135
|
+
*/
|
|
22136
|
+
export class SoundDurationInfo {
|
|
22137
|
+
private constructor();
|
|
22138
|
+
/**
|
|
22139
|
+
* @remarks
|
|
22140
|
+
* Gets the total duration of the sound in seconds.
|
|
22141
|
+
*
|
|
22142
|
+
*/
|
|
22143
|
+
readonly duration: number;
|
|
22144
|
+
/**
|
|
22145
|
+
* @remarks
|
|
22146
|
+
* Gets whether the sound is still being tracked.
|
|
22147
|
+
*
|
|
22148
|
+
*/
|
|
22149
|
+
readonly isActive: boolean;
|
|
22150
|
+
/**
|
|
22151
|
+
* @remarks
|
|
22152
|
+
* Returns the elapsed playback time of the sound, in seconds,
|
|
22153
|
+
* since it started playing.
|
|
22154
|
+
*
|
|
22155
|
+
* This function can't be called in restricted-execution mode.
|
|
22156
|
+
*
|
|
22157
|
+
* @returns
|
|
22158
|
+
* Elapsed playback time in seconds.
|
|
22159
|
+
*/
|
|
22160
|
+
getPlaybackPosition(): number;
|
|
22161
|
+
}
|
|
22162
|
+
|
|
19967
22163
|
/**
|
|
19968
22164
|
* Represents a handle to a sound that has been played. The
|
|
19969
22165
|
* handle is required to control the sound while it is playing
|
|
@@ -19975,6 +22171,108 @@ export class SmeltItemFunction extends LootItemFunction {
|
|
|
19975
22171
|
*/
|
|
19976
22172
|
export class SoundInstance {
|
|
19977
22173
|
private constructor();
|
|
22174
|
+
/**
|
|
22175
|
+
* @beta
|
|
22176
|
+
* @remarks
|
|
22177
|
+
* Gets duration and playback information for this sound.
|
|
22178
|
+
*
|
|
22179
|
+
*/
|
|
22180
|
+
readonly durationInfo?: SoundDurationInfo;
|
|
22181
|
+
/**
|
|
22182
|
+
* @beta
|
|
22183
|
+
* @remarks
|
|
22184
|
+
* Unique identifier of this sound instance.
|
|
22185
|
+
*
|
|
22186
|
+
*/
|
|
22187
|
+
readonly id: string;
|
|
22188
|
+
/**
|
|
22189
|
+
* @beta
|
|
22190
|
+
* @remarks
|
|
22191
|
+
* Gets the player this sound was played for.
|
|
22192
|
+
*
|
|
22193
|
+
*/
|
|
22194
|
+
readonly recipient?: Player;
|
|
22195
|
+
/**
|
|
22196
|
+
* @beta
|
|
22197
|
+
* @remarks
|
|
22198
|
+
* Gets the identifier of the sound event this instance was
|
|
22199
|
+
* started with.
|
|
22200
|
+
*
|
|
22201
|
+
*/
|
|
22202
|
+
readonly soundEventId: string;
|
|
22203
|
+
/**
|
|
22204
|
+
* @beta
|
|
22205
|
+
* @remarks
|
|
22206
|
+
* Fades this sound instance from its current volume to the
|
|
22207
|
+
* target volume over the specified duration. To fade in from
|
|
22208
|
+
* silence, call `setVolume(0.0)` first; to fade out, pass a
|
|
22209
|
+
* target volume of `0.0`.
|
|
22210
|
+
*
|
|
22211
|
+
* This function can't be called in restricted-execution mode.
|
|
22212
|
+
*
|
|
22213
|
+
* @param duration
|
|
22214
|
+
* Duration of the fade in seconds. Must be non-negative.
|
|
22215
|
+
* Minimum value: 0
|
|
22216
|
+
* @param targetVolume
|
|
22217
|
+
* Volume to fade to. Must be non-negative.
|
|
22218
|
+
* Minimum value: 0
|
|
22219
|
+
*/
|
|
22220
|
+
fade(duration: number, targetVolume: number): void;
|
|
22221
|
+
/**
|
|
22222
|
+
* @beta
|
|
22223
|
+
* @remarks
|
|
22224
|
+
* Pauses this sound.
|
|
22225
|
+
*
|
|
22226
|
+
* This function can't be called in restricted-execution mode.
|
|
22227
|
+
*
|
|
22228
|
+
*/
|
|
22229
|
+
pause(): void;
|
|
22230
|
+
/**
|
|
22231
|
+
* @beta
|
|
22232
|
+
* @remarks
|
|
22233
|
+
* Resumes this sound after a pause.
|
|
22234
|
+
*
|
|
22235
|
+
* This function can't be called in restricted-execution mode.
|
|
22236
|
+
*
|
|
22237
|
+
*/
|
|
22238
|
+
resume(): void;
|
|
22239
|
+
/**
|
|
22240
|
+
* @beta
|
|
22241
|
+
* @remarks
|
|
22242
|
+
* Sets the playback position of this sound instance.
|
|
22243
|
+
*
|
|
22244
|
+
* This function can't be called in restricted-execution mode.
|
|
22245
|
+
*
|
|
22246
|
+
* @param seconds
|
|
22247
|
+
* Position to seek to in seconds. Must be non-negative.
|
|
22248
|
+
* Minimum value: 0
|
|
22249
|
+
*/
|
|
22250
|
+
seekTo(seconds: number): void;
|
|
22251
|
+
/**
|
|
22252
|
+
* @beta
|
|
22253
|
+
* @remarks
|
|
22254
|
+
* Sets the pitch of this sound instance.
|
|
22255
|
+
*
|
|
22256
|
+
* This function can't be called in restricted-execution mode.
|
|
22257
|
+
*
|
|
22258
|
+
* @param pitch
|
|
22259
|
+
* Pitch multiplier between 0.01 and 10.0. A value of 1.0 is
|
|
22260
|
+
* normal pitch.
|
|
22261
|
+
* Bounds: [0.009999999776482582, 10]
|
|
22262
|
+
*/
|
|
22263
|
+
setPitch(pitch: number): void;
|
|
22264
|
+
/**
|
|
22265
|
+
* @beta
|
|
22266
|
+
* @remarks
|
|
22267
|
+
* Sets the volume of this sound instance.
|
|
22268
|
+
*
|
|
22269
|
+
* This function can't be called in restricted-execution mode.
|
|
22270
|
+
*
|
|
22271
|
+
* @param volume
|
|
22272
|
+
* Volume level between 0.0 and 10.0.
|
|
22273
|
+
* Bounds: [0, 10]
|
|
22274
|
+
*/
|
|
22275
|
+
setVolume(volume: number): void;
|
|
19978
22276
|
/**
|
|
19979
22277
|
* @rc
|
|
19980
22278
|
* @remarks
|
|
@@ -20701,6 +22999,19 @@ export class SystemBeforeEvents {
|
|
|
20701
22999
|
*
|
|
20702
23000
|
*/
|
|
20703
23001
|
readonly startup: StartupBeforeEventSignal;
|
|
23002
|
+
/**
|
|
23003
|
+
* @beta
|
|
23004
|
+
* @remarks
|
|
23005
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
23006
|
+
* can be due to using too much memory, or by causing
|
|
23007
|
+
* significant slowdown or hang.
|
|
23008
|
+
* To prevent shutdown, set the event's cancel property to
|
|
23009
|
+
* true.
|
|
23010
|
+
*
|
|
23011
|
+
* This property can be read in early-execution mode.
|
|
23012
|
+
*
|
|
23013
|
+
*/
|
|
23014
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
20704
23015
|
}
|
|
20705
23016
|
|
|
20706
23017
|
/**
|
|
@@ -21061,30 +23372,95 @@ export class TripWireTripAfterEvent extends BlockEvent {
|
|
|
21061
23372
|
* }
|
|
21062
23373
|
* ```
|
|
21063
23374
|
*/
|
|
21064
|
-
export class TripWireTripAfterEventSignal {
|
|
23375
|
+
export class TripWireTripAfterEventSignal {
|
|
23376
|
+
private constructor();
|
|
23377
|
+
/**
|
|
23378
|
+
* @remarks
|
|
23379
|
+
* Adds a callback that will be called when a trip wire is
|
|
23380
|
+
* tripped.
|
|
23381
|
+
*
|
|
23382
|
+
* This function can't be called in restricted-execution mode.
|
|
23383
|
+
*
|
|
23384
|
+
* This function can be called in early-execution mode.
|
|
23385
|
+
*
|
|
23386
|
+
*/
|
|
23387
|
+
subscribe(callback: (arg0: TripWireTripAfterEvent) => void): (arg0: TripWireTripAfterEvent) => void;
|
|
23388
|
+
/**
|
|
23389
|
+
* @remarks
|
|
23390
|
+
* Removes a callback from being called when a trip wire is
|
|
23391
|
+
* tripped.
|
|
23392
|
+
*
|
|
23393
|
+
* This function can't be called in restricted-execution mode.
|
|
23394
|
+
*
|
|
23395
|
+
* This function can be called in early-execution mode.
|
|
23396
|
+
*
|
|
23397
|
+
*/
|
|
23398
|
+
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
23399
|
+
}
|
|
23400
|
+
|
|
23401
|
+
/**
|
|
23402
|
+
* @beta
|
|
23403
|
+
* Contains information related to a script watchdog
|
|
23404
|
+
* termination.
|
|
23405
|
+
*/
|
|
23406
|
+
export class WatchdogTerminateBeforeEvent {
|
|
21065
23407
|
private constructor();
|
|
21066
23408
|
/**
|
|
21067
23409
|
* @remarks
|
|
21068
|
-
*
|
|
21069
|
-
*
|
|
23410
|
+
* If set to true, cancels the termination of the script
|
|
23411
|
+
* runtime. Note that depending on server configuration
|
|
23412
|
+
* settings, cancellation of the termination may not be
|
|
23413
|
+
* allowed.
|
|
23414
|
+
*
|
|
23415
|
+
*/
|
|
23416
|
+
cancel: boolean;
|
|
23417
|
+
/**
|
|
23418
|
+
* @remarks
|
|
23419
|
+
* Contains the reason why a script runtime is to be
|
|
23420
|
+
* terminated.
|
|
23421
|
+
*
|
|
23422
|
+
*/
|
|
23423
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
23424
|
+
}
|
|
23425
|
+
|
|
23426
|
+
/**
|
|
23427
|
+
* @beta
|
|
23428
|
+
* Manages callbacks that are connected to a callback that will
|
|
23429
|
+
* be called when a script runtime is being terminated due to a
|
|
23430
|
+
* violation of the performance watchdog system.
|
|
23431
|
+
*/
|
|
23432
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
23433
|
+
private constructor();
|
|
23434
|
+
/**
|
|
23435
|
+
* @remarks
|
|
23436
|
+
* Adds a callback that will be called when a script runtime is
|
|
23437
|
+
* being terminated due to a violation of the performance
|
|
23438
|
+
* watchdog system.
|
|
21070
23439
|
*
|
|
21071
23440
|
* This function can't be called in restricted-execution mode.
|
|
21072
23441
|
*
|
|
21073
23442
|
* This function can be called in early-execution mode.
|
|
21074
23443
|
*
|
|
23444
|
+
* @param callback
|
|
23445
|
+
* This closure is called with restricted-execution privilege.
|
|
23446
|
+
* @returns
|
|
23447
|
+
* Closure that is called with restricted-execution privilege.
|
|
21075
23448
|
*/
|
|
21076
|
-
subscribe(callback: (arg0:
|
|
23449
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
21077
23450
|
/**
|
|
21078
23451
|
* @remarks
|
|
21079
|
-
* Removes a callback from being called when a
|
|
21080
|
-
*
|
|
23452
|
+
* Removes a callback from being called when a script runtime
|
|
23453
|
+
* is being terminated due to a violation of the performance
|
|
23454
|
+
* watchdog system.
|
|
21081
23455
|
*
|
|
21082
23456
|
* This function can't be called in restricted-execution mode.
|
|
21083
23457
|
*
|
|
21084
23458
|
* This function can be called in early-execution mode.
|
|
21085
23459
|
*
|
|
23460
|
+
* @param callback
|
|
23461
|
+
* This closure is called with restricted-execution privilege.
|
|
21086
23462
|
*/
|
|
21087
|
-
unsubscribe(callback: (arg0:
|
|
23463
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
21088
23464
|
}
|
|
21089
23465
|
|
|
21090
23466
|
/**
|
|
@@ -21303,6 +23679,15 @@ export class World {
|
|
|
21303
23679
|
*
|
|
21304
23680
|
*/
|
|
21305
23681
|
readonly afterEvents: WorldAfterEvents;
|
|
23682
|
+
/**
|
|
23683
|
+
* @beta
|
|
23684
|
+
* @remarks
|
|
23685
|
+
* Enables or disables cheats.
|
|
23686
|
+
*
|
|
23687
|
+
* This property can't be edited in restricted-execution mode.
|
|
23688
|
+
*
|
|
23689
|
+
*/
|
|
23690
|
+
allowCheats: boolean;
|
|
21306
23691
|
/**
|
|
21307
23692
|
* @remarks
|
|
21308
23693
|
* Contains a set of events that are applicable to the entirety
|
|
@@ -21381,6 +23766,20 @@ export class World {
|
|
|
21381
23766
|
*
|
|
21382
23767
|
*/
|
|
21383
23768
|
readonly tickingAreaManager: TickingAreaManager;
|
|
23769
|
+
/**
|
|
23770
|
+
* @beta
|
|
23771
|
+
* @remarks
|
|
23772
|
+
* A method that is internal-only, used for broadcasting
|
|
23773
|
+
* specific messages between client and server.
|
|
23774
|
+
*
|
|
23775
|
+
* This function can't be called in restricted-execution mode.
|
|
23776
|
+
*
|
|
23777
|
+
* @param id
|
|
23778
|
+
* The message identifier.
|
|
23779
|
+
* @param value
|
|
23780
|
+
* The message.
|
|
23781
|
+
*/
|
|
23782
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
21384
23783
|
/**
|
|
21385
23784
|
* @remarks
|
|
21386
23785
|
* Clears the set of dynamic properties declared for this
|
|
@@ -21873,6 +24272,16 @@ export class WorldAfterEvents {
|
|
|
21873
24272
|
*
|
|
21874
24273
|
*/
|
|
21875
24274
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
24275
|
+
/**
|
|
24276
|
+
* @beta
|
|
24277
|
+
* @remarks
|
|
24278
|
+
* This event is triggered after a chat message has been
|
|
24279
|
+
* broadcast or sent to players.
|
|
24280
|
+
*
|
|
24281
|
+
* This property can be read in early-execution mode.
|
|
24282
|
+
*
|
|
24283
|
+
*/
|
|
24284
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
21876
24285
|
/**
|
|
21877
24286
|
* @remarks
|
|
21878
24287
|
* This event is fired when an entity event has been triggered
|
|
@@ -21999,6 +24408,33 @@ export class WorldAfterEvents {
|
|
|
21999
24408
|
*
|
|
22000
24409
|
*/
|
|
22001
24410
|
readonly entitySpawn: EntitySpawnAfterEventSignal;
|
|
24411
|
+
/**
|
|
24412
|
+
* @beta
|
|
24413
|
+
* @remarks
|
|
24414
|
+
* This event fires when an entity starts sneaking.
|
|
24415
|
+
*
|
|
24416
|
+
* This property can be read in early-execution mode.
|
|
24417
|
+
*
|
|
24418
|
+
*/
|
|
24419
|
+
readonly entityStartSneaking: EntityStartSneakingAfterEventSignal;
|
|
24420
|
+
/**
|
|
24421
|
+
* @beta
|
|
24422
|
+
* @remarks
|
|
24423
|
+
* This event fires when an entity stops sneaking.
|
|
24424
|
+
*
|
|
24425
|
+
* This property can be read in early-execution mode.
|
|
24426
|
+
*
|
|
24427
|
+
*/
|
|
24428
|
+
readonly entityStopSneaking: EntityStopSneakingAfterEventSignal;
|
|
24429
|
+
/**
|
|
24430
|
+
* @beta
|
|
24431
|
+
* @remarks
|
|
24432
|
+
* This event fires when an entity is tamed.
|
|
24433
|
+
*
|
|
24434
|
+
* This property can be read in early-execution mode.
|
|
24435
|
+
*
|
|
24436
|
+
*/
|
|
24437
|
+
readonly entityTamed: EntityTamedAfterEventSignal;
|
|
22002
24438
|
/**
|
|
22003
24439
|
* @rc
|
|
22004
24440
|
* @remarks
|
|
@@ -22095,6 +24531,25 @@ export class WorldAfterEvents {
|
|
|
22095
24531
|
*
|
|
22096
24532
|
*/
|
|
22097
24533
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
24534
|
+
/**
|
|
24535
|
+
* @beta
|
|
24536
|
+
* @remarks
|
|
24537
|
+
* This event is an internal implementation detail, and is
|
|
24538
|
+
* otherwise not currently functional.
|
|
24539
|
+
*
|
|
24540
|
+
* This property can be read in early-execution mode.
|
|
24541
|
+
*
|
|
24542
|
+
*/
|
|
24543
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
24544
|
+
/**
|
|
24545
|
+
* @beta
|
|
24546
|
+
* @remarks
|
|
24547
|
+
* This event is triggered when a pack setting is changed.
|
|
24548
|
+
*
|
|
24549
|
+
* This property can be read in early-execution mode.
|
|
24550
|
+
*
|
|
24551
|
+
*/
|
|
24552
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
22098
24553
|
/**
|
|
22099
24554
|
* @remarks
|
|
22100
24555
|
* This event fires when a piston expands or retracts.
|
|
@@ -22120,6 +24575,15 @@ export class WorldAfterEvents {
|
|
|
22120
24575
|
*
|
|
22121
24576
|
*/
|
|
22122
24577
|
readonly playerButtonInput: PlayerButtonInputAfterEventSignal;
|
|
24578
|
+
/**
|
|
24579
|
+
* @beta
|
|
24580
|
+
* @remarks
|
|
24581
|
+
* This event fires when a player cancels breaking a block.
|
|
24582
|
+
*
|
|
24583
|
+
* This property can be read in early-execution mode.
|
|
24584
|
+
*
|
|
24585
|
+
*/
|
|
24586
|
+
readonly playerCancelBreakingBlock: PlayerCancelBreakingBlockAfterEventSignal;
|
|
22123
24587
|
/**
|
|
22124
24588
|
* @remarks
|
|
22125
24589
|
* Fires when a player moved to a different dimension.
|
|
@@ -22225,12 +24689,31 @@ export class WorldAfterEvents {
|
|
|
22225
24689
|
*
|
|
22226
24690
|
*/
|
|
22227
24691
|
readonly playerSpawn: PlayerSpawnAfterEventSignal;
|
|
24692
|
+
/**
|
|
24693
|
+
* @beta
|
|
24694
|
+
* @remarks
|
|
24695
|
+
* This event fires when a player starts breaking a block.
|
|
24696
|
+
*
|
|
24697
|
+
* This property can be read in early-execution mode.
|
|
24698
|
+
*
|
|
24699
|
+
*/
|
|
24700
|
+
readonly playerStartBreakingBlock: PlayerStartBreakingBlockAfterEventSignal;
|
|
22228
24701
|
/**
|
|
22229
24702
|
* @remarks
|
|
22230
24703
|
* This property can be read in early-execution mode.
|
|
22231
24704
|
*
|
|
22232
24705
|
*/
|
|
22233
24706
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
24707
|
+
/**
|
|
24708
|
+
* @beta
|
|
24709
|
+
* @remarks
|
|
24710
|
+
* An event for when a player uses a named name tag on an
|
|
24711
|
+
* entity.
|
|
24712
|
+
*
|
|
24713
|
+
* This property can be read in early-execution mode.
|
|
24714
|
+
*
|
|
24715
|
+
*/
|
|
24716
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
22234
24717
|
/**
|
|
22235
24718
|
* @remarks
|
|
22236
24719
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -22265,6 +24748,15 @@ export class WorldAfterEvents {
|
|
|
22265
24748
|
*
|
|
22266
24749
|
*/
|
|
22267
24750
|
readonly projectileHitEntity: ProjectileHitEntityAfterEventSignal;
|
|
24751
|
+
/**
|
|
24752
|
+
* @beta
|
|
24753
|
+
* @remarks
|
|
24754
|
+
* A tracked sound's declared duration elapsed.
|
|
24755
|
+
*
|
|
24756
|
+
* This property can be read in early-execution mode.
|
|
24757
|
+
*
|
|
24758
|
+
*/
|
|
24759
|
+
readonly soundCompleted: SoundCompletedAfterEventSignal;
|
|
22268
24760
|
/**
|
|
22269
24761
|
* @remarks
|
|
22270
24762
|
* A target block was hit.
|
|
@@ -22307,6 +24799,43 @@ export class WorldAfterEvents {
|
|
|
22307
24799
|
*/
|
|
22308
24800
|
export class WorldBeforeEvents {
|
|
22309
24801
|
private constructor();
|
|
24802
|
+
/**
|
|
24803
|
+
* @beta
|
|
24804
|
+
* @remarks
|
|
24805
|
+
* This event is triggered after a chat message has been
|
|
24806
|
+
* broadcast or sent to players.
|
|
24807
|
+
*
|
|
24808
|
+
* This property can be read in early-execution mode.
|
|
24809
|
+
*
|
|
24810
|
+
* @example customCommand.ts
|
|
24811
|
+
* ```typescript
|
|
24812
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
24813
|
+
*
|
|
24814
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
24815
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
24816
|
+
* if (eventData.message.includes('cancel')) {
|
|
24817
|
+
* // Cancel event if the message contains "cancel"
|
|
24818
|
+
* eventData.cancel = true;
|
|
24819
|
+
* } else {
|
|
24820
|
+
* const args = eventData.message.split(' ');
|
|
24821
|
+
*
|
|
24822
|
+
* if (args.length > 0) {
|
|
24823
|
+
* switch (args[0].toLowerCase()) {
|
|
24824
|
+
* case 'echo':
|
|
24825
|
+
* // Send a modified version of chat message
|
|
24826
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
24827
|
+
* break;
|
|
24828
|
+
* case 'help':
|
|
24829
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
24830
|
+
* break;
|
|
24831
|
+
* }
|
|
24832
|
+
* }
|
|
24833
|
+
* }
|
|
24834
|
+
* });
|
|
24835
|
+
* }
|
|
24836
|
+
* ```
|
|
24837
|
+
*/
|
|
24838
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
22310
24839
|
/**
|
|
22311
24840
|
* @remarks
|
|
22312
24841
|
* This event is triggered after an event has been added to an
|
|
@@ -22400,6 +24929,15 @@ export class WorldBeforeEvents {
|
|
|
22400
24929
|
*
|
|
22401
24930
|
*/
|
|
22402
24931
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
24932
|
+
/**
|
|
24933
|
+
* @beta
|
|
24934
|
+
* @remarks
|
|
24935
|
+
* This event fires before a block is placed by a player.
|
|
24936
|
+
*
|
|
24937
|
+
* This property can be read in early-execution mode.
|
|
24938
|
+
*
|
|
24939
|
+
*/
|
|
24940
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
22403
24941
|
/**
|
|
22404
24942
|
* @remarks
|
|
22405
24943
|
* This property can be read in early-execution mode.
|
|
@@ -22477,13 +25015,27 @@ export interface BiomeFilter {
|
|
|
22477
25015
|
includeTags?: string[];
|
|
22478
25016
|
}
|
|
22479
25017
|
|
|
25018
|
+
/**
|
|
25019
|
+
* @beta
|
|
25020
|
+
* Contains additional options for searches for the
|
|
25021
|
+
* dimension.findNearestBiome API.
|
|
25022
|
+
*/
|
|
25023
|
+
export interface BiomeSearchOptions {
|
|
25024
|
+
/**
|
|
25025
|
+
* @remarks
|
|
25026
|
+
* Bounding volume size to look within.
|
|
25027
|
+
*
|
|
25028
|
+
*/
|
|
25029
|
+
boundingSize?: Vector3;
|
|
25030
|
+
}
|
|
25031
|
+
|
|
22480
25032
|
/**
|
|
22481
25033
|
* A BlockBoundingBox is an interface to an object which
|
|
22482
25034
|
* represents an AABB aligned rectangle.
|
|
22483
25035
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
22484
25036
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
22485
|
-
* created using the associated {@link
|
|
22486
|
-
*
|
|
25037
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
25038
|
+
* utility functions.
|
|
22487
25039
|
* The min/max coordinates represent the diametrically opposite
|
|
22488
25040
|
* corners of the rectangle.
|
|
22489
25041
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -22746,6 +25298,40 @@ export interface BlockHitInformation {
|
|
|
22746
25298
|
faceLocation: Vector3;
|
|
22747
25299
|
}
|
|
22748
25300
|
|
|
25301
|
+
/**
|
|
25302
|
+
* @beta
|
|
25303
|
+
* Options for querying blocks in a volume. Extends BlockFilter
|
|
25304
|
+
* with additional sorting and limiting options based on
|
|
25305
|
+
* distance from a location.
|
|
25306
|
+
*/
|
|
25307
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
25308
|
+
export interface BlockQueryOptions extends BlockFilter {
|
|
25309
|
+
/**
|
|
25310
|
+
* @remarks
|
|
25311
|
+
* If specified, returns the closest N blocks to the location.
|
|
25312
|
+
* Must be greater than 0. Cannot be used with farthest.
|
|
25313
|
+
* Requires location to be set.
|
|
25314
|
+
*
|
|
25315
|
+
*/
|
|
25316
|
+
closest?: number;
|
|
25317
|
+
/**
|
|
25318
|
+
* @remarks
|
|
25319
|
+
* If specified, returns the farthest N blocks from the
|
|
25320
|
+
* location. Must be greater than 0. Cannot be used with
|
|
25321
|
+
* closest. Requires location to be set.
|
|
25322
|
+
*
|
|
25323
|
+
*/
|
|
25324
|
+
farthest?: number;
|
|
25325
|
+
/**
|
|
25326
|
+
* @remarks
|
|
25327
|
+
* Location used as the reference point for closest or farthest
|
|
25328
|
+
* distance calculations. Required when closest or farthest is
|
|
25329
|
+
* specified.
|
|
25330
|
+
*
|
|
25331
|
+
*/
|
|
25332
|
+
location?: Vector3;
|
|
25333
|
+
}
|
|
25334
|
+
|
|
22749
25335
|
/**
|
|
22750
25336
|
* Contains information for block raycast hit results.
|
|
22751
25337
|
*/
|
|
@@ -22916,6 +25502,44 @@ export interface CameraSetRotOptions {
|
|
|
22916
25502
|
rotation: Vector2;
|
|
22917
25503
|
}
|
|
22918
25504
|
|
|
25505
|
+
/**
|
|
25506
|
+
* @beta
|
|
25507
|
+
* Options for applying a camera shake effect to a player's
|
|
25508
|
+
* camera via `Camera.addShake`. Each call to `addShake` queues
|
|
25509
|
+
* a new independent shake event for the specified `type`;
|
|
25510
|
+
* positional and rotational shakes are tracked in separate
|
|
25511
|
+
* queues and run concurrently. The rendered intensity at any
|
|
25512
|
+
* moment is the sum of all active events' intensities for that
|
|
25513
|
+
* type, capped at `4.0`. Events expire naturally when their
|
|
25514
|
+
* `duration` elapses.
|
|
25515
|
+
*/
|
|
25516
|
+
export interface CameraShakeOptions {
|
|
25517
|
+
/**
|
|
25518
|
+
* @remarks
|
|
25519
|
+
* How long this shake event lasts, in seconds. Must be a
|
|
25520
|
+
* positive value.
|
|
25521
|
+
*
|
|
25522
|
+
*/
|
|
25523
|
+
duration: number;
|
|
25524
|
+
/**
|
|
25525
|
+
* @remarks
|
|
25526
|
+
* The intensity of this shake event. Must be a positive value
|
|
25527
|
+
* with a maximum of `4.0`. Multiple active events of the same
|
|
25528
|
+
* `type` are summed, capped at `4.0`.
|
|
25529
|
+
*
|
|
25530
|
+
*/
|
|
25531
|
+
intensity: number;
|
|
25532
|
+
/**
|
|
25533
|
+
* @remarks
|
|
25534
|
+
* The type of camera shake to apply. Positional and rotational
|
|
25535
|
+
* shakes maintain separate event queues and are applied
|
|
25536
|
+
* concurrently, so adding a shake of each type does not cause
|
|
25537
|
+
* them to interfere with one another.
|
|
25538
|
+
*
|
|
25539
|
+
*/
|
|
25540
|
+
type: CameraShakeType;
|
|
25541
|
+
}
|
|
25542
|
+
|
|
22919
25543
|
/**
|
|
22920
25544
|
* Used to target an entity with a free camera.
|
|
22921
25545
|
*/
|
|
@@ -22934,6 +25558,40 @@ export interface CameraTargetOptions {
|
|
|
22934
25558
|
targetEntity: Entity;
|
|
22935
25559
|
}
|
|
22936
25560
|
|
|
25561
|
+
/**
|
|
25562
|
+
* @beta
|
|
25563
|
+
* This interface defines an entry into the {@link
|
|
25564
|
+
* CompoundBlockVolume} which represents a volume of positive
|
|
25565
|
+
* or negative space.
|
|
25566
|
+
*
|
|
25567
|
+
*/
|
|
25568
|
+
export interface CompoundBlockVolumeItem {
|
|
25569
|
+
/**
|
|
25570
|
+
* @remarks
|
|
25571
|
+
* The 'action' defines how the block volume is represented in
|
|
25572
|
+
* the compound block volume stack.
|
|
25573
|
+
* 'Add' creates a block volume which is positively selected
|
|
25574
|
+
* 'Subtract' creates a block volume which represents a hole or
|
|
25575
|
+
* negative space in the overall compound block volume.
|
|
25576
|
+
*
|
|
25577
|
+
*/
|
|
25578
|
+
action?: CompoundBlockVolumeAction;
|
|
25579
|
+
/**
|
|
25580
|
+
* @remarks
|
|
25581
|
+
* The relativity enumeration determines whether the
|
|
25582
|
+
* BlockVolume specified is positioned relative to the parent
|
|
25583
|
+
* compound block volume origin, or in absolute world space.
|
|
25584
|
+
*
|
|
25585
|
+
*/
|
|
25586
|
+
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
25587
|
+
/**
|
|
25588
|
+
* @remarks
|
|
25589
|
+
* The volume of space
|
|
25590
|
+
*
|
|
25591
|
+
*/
|
|
25592
|
+
volume: BlockVolume;
|
|
25593
|
+
}
|
|
25594
|
+
|
|
22937
25595
|
/**
|
|
22938
25596
|
* @rc
|
|
22939
25597
|
* Represents the source of a container access.
|
|
@@ -23045,6 +25703,15 @@ export interface CustomCommand {
|
|
|
23045
25703
|
* command.
|
|
23046
25704
|
*/
|
|
23047
25705
|
export interface CustomCommandParameter {
|
|
25706
|
+
/**
|
|
25707
|
+
* @beta
|
|
25708
|
+
* @remarks
|
|
25709
|
+
* Can be used to reference the enum name when {@link
|
|
25710
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
25711
|
+
* to be different from the enum name.
|
|
25712
|
+
*
|
|
25713
|
+
*/
|
|
25714
|
+
enumName?: string;
|
|
23048
25715
|
/**
|
|
23049
25716
|
* @remarks
|
|
23050
25717
|
* The name of parameter as it appears on the command line.
|
|
@@ -23126,6 +25793,14 @@ export interface DefinitionModifier {
|
|
|
23126
25793
|
*
|
|
23127
25794
|
*/
|
|
23128
25795
|
removedComponentGroups: string[];
|
|
25796
|
+
/**
|
|
25797
|
+
* @beta
|
|
25798
|
+
* @remarks
|
|
25799
|
+
* The list of entity definition events that will be fired via
|
|
25800
|
+
* this update.
|
|
25801
|
+
*
|
|
25802
|
+
*/
|
|
25803
|
+
triggers: Trigger[];
|
|
23129
25804
|
}
|
|
23130
25805
|
|
|
23131
25806
|
/**
|
|
@@ -23927,6 +26602,24 @@ export interface EntityRaycastOptions extends EntityFilter {
|
|
|
23927
26602
|
maxDistance?: number;
|
|
23928
26603
|
}
|
|
23929
26604
|
|
|
26605
|
+
/**
|
|
26606
|
+
* @beta
|
|
26607
|
+
* Options used to filter entity start sneaking and stop
|
|
26608
|
+
* sneaking events.
|
|
26609
|
+
*/
|
|
26610
|
+
export interface EntitySneakingChangedEventOptions {
|
|
26611
|
+
entityFilter?: EntityFilter;
|
|
26612
|
+
}
|
|
26613
|
+
|
|
26614
|
+
/**
|
|
26615
|
+
* @beta
|
|
26616
|
+
* Contains options for filtering entity tamed events.
|
|
26617
|
+
*/
|
|
26618
|
+
export interface EntityTamedEventFilter {
|
|
26619
|
+
entityFilter?: EntityFilter;
|
|
26620
|
+
tamingEntityFilter?: EntityFilter;
|
|
26621
|
+
}
|
|
26622
|
+
|
|
23930
26623
|
/**
|
|
23931
26624
|
* @rc
|
|
23932
26625
|
* Controls when a waypoint is visible based on the state of
|
|
@@ -24433,6 +27126,33 @@ export interface PlayerAimAssistSettings {
|
|
|
24433
27126
|
viewAngle?: Vector2;
|
|
24434
27127
|
}
|
|
24435
27128
|
|
|
27129
|
+
/**
|
|
27130
|
+
* @beta
|
|
27131
|
+
* An interface that is passed into {@link
|
|
27132
|
+
* PlayerStartBreakingBlockAfterEventSignal.subscribe} or
|
|
27133
|
+
* {@link PlayerCancelBreakingBlockAfterEventSignal.subscribe}
|
|
27134
|
+
* that filters out which events are passed to the provided
|
|
27135
|
+
* callback.
|
|
27136
|
+
*/
|
|
27137
|
+
export interface PlayerBreakingBlockEventOptions {
|
|
27138
|
+
/**
|
|
27139
|
+
* @remarks
|
|
27140
|
+
* The {@link BlockFilter} that the callback should be called
|
|
27141
|
+
* for. If undefined, the callback will be called for all
|
|
27142
|
+
* blocks.
|
|
27143
|
+
*
|
|
27144
|
+
*/
|
|
27145
|
+
blockFilter?: BlockFilter;
|
|
27146
|
+
/**
|
|
27147
|
+
* @remarks
|
|
27148
|
+
* The {@link EntityFilter} that the callback should be called
|
|
27149
|
+
* for. If undefined, the callback will be called for all
|
|
27150
|
+
* players.
|
|
27151
|
+
*
|
|
27152
|
+
*/
|
|
27153
|
+
playerFilter?: EntityFilter;
|
|
27154
|
+
}
|
|
27155
|
+
|
|
24436
27156
|
/**
|
|
24437
27157
|
* Additional options for how a sound plays for a player.
|
|
24438
27158
|
*/
|
|
@@ -24444,6 +27164,19 @@ export interface PlayerSoundOptions {
|
|
|
24444
27164
|
*
|
|
24445
27165
|
*/
|
|
24446
27166
|
location?: Vector3;
|
|
27167
|
+
/**
|
|
27168
|
+
* @beta
|
|
27169
|
+
* @remarks
|
|
27170
|
+
* Number of additional times to repeat the sound after the
|
|
27171
|
+
* initial play. `0` (the default) plays the sound once, `-1`
|
|
27172
|
+
* loops it forever, and a positive integer `N` plays the sound
|
|
27173
|
+
* `N + 1` times in total. For example, `loopCount: 1` plays
|
|
27174
|
+
* the sound twice. The loop count is fixed when the sound
|
|
27175
|
+
* starts and cannot be changed afterward. When using `-1`, see
|
|
27176
|
+
* `SoundInstance` for handle lifetime requirements.
|
|
27177
|
+
*
|
|
27178
|
+
*/
|
|
27179
|
+
loopCount?: number;
|
|
24447
27180
|
/**
|
|
24448
27181
|
* @remarks
|
|
24449
27182
|
* Optional pitch of the sound.
|
|
@@ -25270,6 +28003,19 @@ export interface WaypointTextureSelector {
|
|
|
25270
28003
|
* Contains additional options for a playSound occurrence.
|
|
25271
28004
|
*/
|
|
25272
28005
|
export interface WorldSoundOptions {
|
|
28006
|
+
/**
|
|
28007
|
+
* @beta
|
|
28008
|
+
* @remarks
|
|
28009
|
+
* Number of additional times to repeat the sound after the
|
|
28010
|
+
* initial play. `0` (the default) plays the sound once, `-1`
|
|
28011
|
+
* loops it forever, and a positive integer `N` plays the sound
|
|
28012
|
+
* `N + 1` times in total. For example, `loopCount: 1` plays
|
|
28013
|
+
* the sound twice. The loop count is fixed when the sound
|
|
28014
|
+
* starts and cannot be changed afterward. When using `-1`, see
|
|
28015
|
+
* `SoundInstance` for handle lifetime requirements.
|
|
28016
|
+
*
|
|
28017
|
+
*/
|
|
28018
|
+
loopCount?: number;
|
|
25273
28019
|
/**
|
|
25274
28020
|
* @remarks
|
|
25275
28021
|
* Pitch of the sound played.
|
|
@@ -25458,6 +28204,17 @@ export class EnchantmentTypeUnknownIdError extends Error {
|
|
|
25458
28204
|
private constructor();
|
|
25459
28205
|
}
|
|
25460
28206
|
|
|
28207
|
+
/**
|
|
28208
|
+
* @beta
|
|
28209
|
+
* Error thrown by {@link EntityFogComponent} operations when
|
|
28210
|
+
* the fog stack limit is exceeded or an invalid fog identifier
|
|
28211
|
+
* is provided.
|
|
28212
|
+
*/
|
|
28213
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
28214
|
+
export class EntityFogComponentError extends Error {
|
|
28215
|
+
private constructor();
|
|
28216
|
+
}
|
|
28217
|
+
|
|
25461
28218
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
25462
28219
|
export class EntitySpawnError extends Error {
|
|
25463
28220
|
private constructor();
|