@minecraft/server 2.9.0-rc.1.26.40-preview.23 → 2.10.0-beta.1.26.40-preview.23
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 +2975 -121
- 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.
|
|
@@ -1552,6 +1643,14 @@ export enum EntitySwingSource {
|
|
|
1552
1643
|
* and mainhand slots.
|
|
1553
1644
|
*/
|
|
1554
1645
|
export enum EquipmentSlot {
|
|
1646
|
+
/**
|
|
1647
|
+
* @beta
|
|
1648
|
+
* @remarks
|
|
1649
|
+
* The body slot. This slot is used to hold armor for
|
|
1650
|
+
* non-humanoid mobs.
|
|
1651
|
+
*
|
|
1652
|
+
*/
|
|
1653
|
+
Body = 'Body',
|
|
1555
1654
|
/**
|
|
1556
1655
|
* @remarks
|
|
1557
1656
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1821,6 +1920,14 @@ export enum GameRule {
|
|
|
1821
1920
|
*
|
|
1822
1921
|
*/
|
|
1823
1922
|
PlayersSleepingPercentage = 'playersSleepingPercentage',
|
|
1923
|
+
/**
|
|
1924
|
+
* @beta
|
|
1925
|
+
* @remarks
|
|
1926
|
+
* Controls which player waypoints are automatically added to
|
|
1927
|
+
* the players locator bar.
|
|
1928
|
+
*
|
|
1929
|
+
*/
|
|
1930
|
+
PlayerWaypoints = 'playerWaypoints',
|
|
1824
1931
|
/**
|
|
1825
1932
|
* @remarks
|
|
1826
1933
|
* Controls whether projectiles (entities with a projectile
|
|
@@ -2170,6 +2277,10 @@ export enum InputPermissionCategory {
|
|
|
2170
2277
|
* function ItemStack.getComponent.
|
|
2171
2278
|
*/
|
|
2172
2279
|
export enum ItemComponentTypes {
|
|
2280
|
+
/**
|
|
2281
|
+
* @beta
|
|
2282
|
+
*/
|
|
2283
|
+
BlockDynamicProperties = 'minecraft:block_actor_dynamic_properties',
|
|
2173
2284
|
/**
|
|
2174
2285
|
* @remarks
|
|
2175
2286
|
* The minecraft:book component.
|
|
@@ -2643,6 +2754,14 @@ export enum PlayerSplitScreenSlot {
|
|
|
2643
2754
|
Third = 'Third',
|
|
2644
2755
|
}
|
|
2645
2756
|
|
|
2757
|
+
/**
|
|
2758
|
+
* @beta
|
|
2759
|
+
*/
|
|
2760
|
+
export enum PlayerWaypointsMode {
|
|
2761
|
+
Everyone = 'Everyone',
|
|
2762
|
+
Off = 'Off',
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2646
2765
|
/**
|
|
2647
2766
|
* Contains objectives and participants for the scoreboard.
|
|
2648
2767
|
*/
|
|
@@ -2969,6 +3088,29 @@ export enum TintMethod {
|
|
|
2969
3088
|
Water = 'Water',
|
|
2970
3089
|
}
|
|
2971
3090
|
|
|
3091
|
+
/**
|
|
3092
|
+
* @beta
|
|
3093
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
3094
|
+
* to terminate execution of a behavior packs' script.
|
|
3095
|
+
*/
|
|
3096
|
+
export enum WatchdogTerminateReason {
|
|
3097
|
+
/**
|
|
3098
|
+
* @remarks
|
|
3099
|
+
* Script runtime for a behavior pack is terminated due to
|
|
3100
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
3101
|
+
*
|
|
3102
|
+
*/
|
|
3103
|
+
Hang = 'Hang',
|
|
3104
|
+
/**
|
|
3105
|
+
* @remarks
|
|
3106
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3107
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3108
|
+
* function calls.
|
|
3109
|
+
*
|
|
3110
|
+
*/
|
|
3111
|
+
StackOverflow = 'StackOverflow',
|
|
3112
|
+
}
|
|
3113
|
+
|
|
2972
3114
|
/**
|
|
2973
3115
|
* @rc
|
|
2974
3116
|
* Enum representing different texture icons that can be
|
|
@@ -3031,10 +3173,14 @@ export type BlockComponentReturnType<T extends string> = T extends keyof BlockCo
|
|
|
3031
3173
|
: BlockCustomComponentInstance;
|
|
3032
3174
|
|
|
3033
3175
|
export type BlockComponentTypeMap = {
|
|
3176
|
+
dynamic_properties: BlockDynamicPropertiesComponent;
|
|
3034
3177
|
fluid_container: BlockFluidContainerComponent;
|
|
3178
|
+
instrument_sound: BlockInstrumentComponent;
|
|
3035
3179
|
inventory: BlockInventoryComponent;
|
|
3036
3180
|
map_color: BlockMapColorComponent;
|
|
3181
|
+
'minecraft:dynamic_properties': BlockDynamicPropertiesComponent;
|
|
3037
3182
|
'minecraft:fluid_container': BlockFluidContainerComponent;
|
|
3183
|
+
'minecraft:instrument_sound': BlockInstrumentComponent;
|
|
3038
3184
|
'minecraft:inventory': BlockInventoryComponent;
|
|
3039
3185
|
'minecraft:map_color': BlockMapColorComponent;
|
|
3040
3186
|
'minecraft:movable': BlockMovableComponent;
|
|
@@ -3154,6 +3300,7 @@ export type EntityComponentTypeMap = {
|
|
|
3154
3300
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
3155
3301
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
3156
3302
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3303
|
+
'minecraft:npc': EntityNpcComponent;
|
|
3157
3304
|
'minecraft:onfire': EntityOnFireComponent;
|
|
3158
3305
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
3159
3306
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -3187,6 +3334,7 @@ export type EntityComponentTypeMap = {
|
|
|
3187
3334
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3188
3335
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3189
3336
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3337
|
+
npc: EntityNpcComponent;
|
|
3190
3338
|
onfire: EntityOnFireComponent;
|
|
3191
3339
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3192
3340
|
'player.hunger': EntityHungerComponent;
|
|
@@ -3206,11 +3354,21 @@ export type EntityComponentTypeMap = {
|
|
|
3206
3354
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3207
3355
|
};
|
|
3208
3356
|
|
|
3357
|
+
/**
|
|
3358
|
+
* @beta
|
|
3359
|
+
*/
|
|
3360
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3361
|
+
? VanillaEntityIdentifier
|
|
3362
|
+
: T extends string
|
|
3363
|
+
? VanillaEntityIdentifier | T
|
|
3364
|
+
: never;
|
|
3365
|
+
|
|
3209
3366
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3210
3367
|
? ItemComponentTypeMap[T]
|
|
3211
3368
|
: ItemCustomComponentInstance;
|
|
3212
3369
|
|
|
3213
3370
|
export type ItemComponentTypeMap = {
|
|
3371
|
+
block_actor_dynamic_properties: ItemBlockDynamicPropertiesComponent;
|
|
3214
3372
|
book: ItemBookComponent;
|
|
3215
3373
|
compostable: ItemCompostableComponent;
|
|
3216
3374
|
cooldown: ItemCooldownComponent;
|
|
@@ -3219,6 +3377,7 @@ export type ItemComponentTypeMap = {
|
|
|
3219
3377
|
enchantable: ItemEnchantableComponent;
|
|
3220
3378
|
food: ItemFoodComponent;
|
|
3221
3379
|
inventory: ItemInventoryComponent;
|
|
3380
|
+
'minecraft:block_actor_dynamic_properties': ItemBlockDynamicPropertiesComponent;
|
|
3222
3381
|
'minecraft:book': ItemBookComponent;
|
|
3223
3382
|
'minecraft:compostable': ItemCompostableComponent;
|
|
3224
3383
|
'minecraft:cooldown': ItemCooldownComponent;
|
|
@@ -3231,6 +3390,15 @@ export type ItemComponentTypeMap = {
|
|
|
3231
3390
|
potion: ItemPotionComponent;
|
|
3232
3391
|
};
|
|
3233
3392
|
|
|
3393
|
+
/**
|
|
3394
|
+
* @beta
|
|
3395
|
+
*/
|
|
3396
|
+
export type VanillaEntityIdentifier =
|
|
3397
|
+
| EntityType
|
|
3398
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3399
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3400
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3401
|
+
|
|
3234
3402
|
/**
|
|
3235
3403
|
* Handle to an aim-assist category that exists in the
|
|
3236
3404
|
* world.aimAssist registry.
|
|
@@ -3388,7 +3556,9 @@ export class AimAssistCategorySettings {
|
|
|
3388
3556
|
* A record mapping block Ids to their priority settings.
|
|
3389
3557
|
* Larger numbers have greater priority.
|
|
3390
3558
|
*/
|
|
3391
|
-
setBlockPriorities(
|
|
3559
|
+
setBlockPriorities(
|
|
3560
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3561
|
+
): void;
|
|
3392
3562
|
/**
|
|
3393
3563
|
* @remarks
|
|
3394
3564
|
* Sets the priority settings used for block targeting.
|
|
@@ -3407,7 +3577,9 @@ export class AimAssistCategorySettings {
|
|
|
3407
3577
|
* A record mapping entity Ids to their priority settings.
|
|
3408
3578
|
* Larger numbers have greater priority.
|
|
3409
3579
|
*/
|
|
3410
|
-
setEntityPriorities(
|
|
3580
|
+
setEntityPriorities(
|
|
3581
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3582
|
+
): void;
|
|
3411
3583
|
/**
|
|
3412
3584
|
* @remarks
|
|
3413
3585
|
* Sets the priority settings used for entity targeting.
|
|
@@ -3606,8 +3778,10 @@ export class AimAssistPresetSettings {
|
|
|
3606
3778
|
*
|
|
3607
3779
|
* This function can't be called in restricted-execution mode.
|
|
3608
3780
|
*
|
|
3781
|
+
* @param targets
|
|
3782
|
+
* An array of block tags.
|
|
3609
3783
|
*/
|
|
3610
|
-
setExcludedBlockTagTargets(
|
|
3784
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3611
3785
|
/**
|
|
3612
3786
|
* @remarks
|
|
3613
3787
|
* Sets the list of block Ids to exclude from aim assist
|
|
@@ -3615,8 +3789,10 @@ export class AimAssistPresetSettings {
|
|
|
3615
3789
|
*
|
|
3616
3790
|
* This function can't be called in restricted-execution mode.
|
|
3617
3791
|
*
|
|
3792
|
+
* @param targets
|
|
3793
|
+
* An array of block Ids.
|
|
3618
3794
|
*/
|
|
3619
|
-
setExcludedBlockTargets(
|
|
3795
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3620
3796
|
/**
|
|
3621
3797
|
* @remarks
|
|
3622
3798
|
* Sets the list of entity Ids to exclude from aim assist
|
|
@@ -3624,8 +3800,10 @@ export class AimAssistPresetSettings {
|
|
|
3624
3800
|
*
|
|
3625
3801
|
* This function can't be called in restricted-execution mode.
|
|
3626
3802
|
*
|
|
3803
|
+
* @param targets
|
|
3804
|
+
* An array of entity Ids.
|
|
3627
3805
|
*/
|
|
3628
|
-
setExcludedEntityTargets(
|
|
3806
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3629
3807
|
/**
|
|
3630
3808
|
* @remarks
|
|
3631
3809
|
* Sets the list of entity type families to exclude from aim
|
|
@@ -3633,8 +3811,10 @@ export class AimAssistPresetSettings {
|
|
|
3633
3811
|
*
|
|
3634
3812
|
* This function can't be called in restricted-execution mode.
|
|
3635
3813
|
*
|
|
3814
|
+
* @param targets
|
|
3815
|
+
* An array of entity type families.
|
|
3636
3816
|
*/
|
|
3637
|
-
setExcludedEntityTypeFamilyTargets(
|
|
3817
|
+
setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
|
|
3638
3818
|
/**
|
|
3639
3819
|
* @remarks
|
|
3640
3820
|
* Sets the per-item aim-assist category Ids.
|
|
@@ -3645,7 +3825,7 @@ export class AimAssistPresetSettings {
|
|
|
3645
3825
|
* A record mapping item Ids to aim-assist category Ids.
|
|
3646
3826
|
* Category Ids must have a namespace.
|
|
3647
3827
|
*/
|
|
3648
|
-
setItemSettings(itemSettings: Record<string, string>): void;
|
|
3828
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3649
3829
|
/**
|
|
3650
3830
|
* @remarks
|
|
3651
3831
|
* Sets the list of item Ids that will target liquid blocks
|
|
@@ -3656,7 +3836,7 @@ export class AimAssistPresetSettings {
|
|
|
3656
3836
|
* @param items
|
|
3657
3837
|
* An array of item Ids.
|
|
3658
3838
|
*/
|
|
3659
|
-
setLiquidTargetingItems(items?: string[]): void;
|
|
3839
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3660
3840
|
}
|
|
3661
3841
|
|
|
3662
3842
|
/**
|
|
@@ -3762,6 +3942,28 @@ export class AimAssistRegistry {
|
|
|
3762
3942
|
getPresets(): AimAssistPreset[];
|
|
3763
3943
|
}
|
|
3764
3944
|
|
|
3945
|
+
/**
|
|
3946
|
+
* @beta
|
|
3947
|
+
* Describes a single banner pattern, which includes a colour
|
|
3948
|
+
* and a pattern type.
|
|
3949
|
+
*/
|
|
3950
|
+
export class BannerPattern {
|
|
3951
|
+
private constructor();
|
|
3952
|
+
/**
|
|
3953
|
+
* @remarks
|
|
3954
|
+
* The color to apply to this banner pattern.
|
|
3955
|
+
*
|
|
3956
|
+
*/
|
|
3957
|
+
readonly color: string;
|
|
3958
|
+
/**
|
|
3959
|
+
* @remarks
|
|
3960
|
+
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
3961
|
+
* apply to the banner.
|
|
3962
|
+
*
|
|
3963
|
+
*/
|
|
3964
|
+
readonly pattern: string;
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3765
3967
|
/**
|
|
3766
3968
|
* Describes a type of biome.
|
|
3767
3969
|
*/
|
|
@@ -3855,6 +4057,20 @@ export class Block {
|
|
|
3855
4057
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3856
4058
|
*/
|
|
3857
4059
|
readonly isLiquid: boolean;
|
|
4060
|
+
/**
|
|
4061
|
+
* @beta
|
|
4062
|
+
* @remarks
|
|
4063
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
4064
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
4065
|
+
* ladder block and a fence block are not).
|
|
4066
|
+
*
|
|
4067
|
+
* @throws This property can throw when used.
|
|
4068
|
+
*
|
|
4069
|
+
* {@link LocationInUnloadedChunkError}
|
|
4070
|
+
*
|
|
4071
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4072
|
+
*/
|
|
4073
|
+
readonly isSolid: boolean;
|
|
3858
4074
|
/**
|
|
3859
4075
|
* @remarks
|
|
3860
4076
|
* Returns true if this reference to a block is still valid
|
|
@@ -4020,6 +4236,30 @@ export class Block {
|
|
|
4020
4236
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4021
4237
|
*/
|
|
4022
4238
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4239
|
+
/**
|
|
4240
|
+
* @beta
|
|
4241
|
+
* @remarks
|
|
4242
|
+
* Checks to see whether it is valid to place the specified
|
|
4243
|
+
* block type or block permutation, on a specified face on this
|
|
4244
|
+
* block.
|
|
4245
|
+
*
|
|
4246
|
+
* @param blockToPlace
|
|
4247
|
+
* Block type or block permutation to check placement for.
|
|
4248
|
+
* @param faceToPlaceOn
|
|
4249
|
+
* Optional specific face of this block to check placement
|
|
4250
|
+
* against.
|
|
4251
|
+
* @returns
|
|
4252
|
+
* Returns `true` if the block type or permutation can be
|
|
4253
|
+
* placed on this block, else `false`.
|
|
4254
|
+
* @throws This function can throw errors.
|
|
4255
|
+
*
|
|
4256
|
+
* {@link Error}
|
|
4257
|
+
*
|
|
4258
|
+
* {@link LocationInUnloadedChunkError}
|
|
4259
|
+
*
|
|
4260
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4261
|
+
*/
|
|
4262
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
4023
4263
|
/**
|
|
4024
4264
|
* @remarks
|
|
4025
4265
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -4116,6 +4356,15 @@ export class Block {
|
|
|
4116
4356
|
* {@link LocationInUnloadedChunkError}
|
|
4117
4357
|
*/
|
|
4118
4358
|
getLightLevel(): number;
|
|
4359
|
+
/**
|
|
4360
|
+
* @beta
|
|
4361
|
+
* @throws This function can throw errors.
|
|
4362
|
+
*
|
|
4363
|
+
* {@link LocationInUnloadedChunkError}
|
|
4364
|
+
*
|
|
4365
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4366
|
+
*/
|
|
4367
|
+
getMapColor(): RGBA;
|
|
4119
4368
|
/**
|
|
4120
4369
|
* @rc
|
|
4121
4370
|
* @remarks
|
|
@@ -4397,6 +4646,27 @@ export class Block {
|
|
|
4397
4646
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4398
4647
|
*/
|
|
4399
4648
|
south(steps?: number): Block | undefined;
|
|
4649
|
+
/**
|
|
4650
|
+
* @beta
|
|
4651
|
+
* @remarks
|
|
4652
|
+
* Tries to set the block in the dimension to the state of the
|
|
4653
|
+
* permutation by first checking if the placement is valid.
|
|
4654
|
+
*
|
|
4655
|
+
* This function can't be called in restricted-execution mode.
|
|
4656
|
+
*
|
|
4657
|
+
* @param permutation
|
|
4658
|
+
* Permutation that contains a set of property states for the
|
|
4659
|
+
* Block.
|
|
4660
|
+
* @returns
|
|
4661
|
+
* Returns `true` if the block permutation data was
|
|
4662
|
+
* successfully set, else `false`.
|
|
4663
|
+
* @throws This function can throw errors.
|
|
4664
|
+
*
|
|
4665
|
+
* {@link LocationInUnloadedChunkError}
|
|
4666
|
+
*
|
|
4667
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4668
|
+
*/
|
|
4669
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4400
4670
|
/**
|
|
4401
4671
|
* @remarks
|
|
4402
4672
|
* Returns the {@link Block} to the west of this block
|
|
@@ -4414,6 +4684,137 @@ export class Block {
|
|
|
4414
4684
|
west(steps?: number): Block | undefined;
|
|
4415
4685
|
}
|
|
4416
4686
|
|
|
4687
|
+
/**
|
|
4688
|
+
* @beta
|
|
4689
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4690
|
+
* of useful functions for the creation and utility of {@link
|
|
4691
|
+
* BlockBoundingBox} objects
|
|
4692
|
+
*/
|
|
4693
|
+
export class BlockBoundingBoxUtils {
|
|
4694
|
+
private constructor();
|
|
4695
|
+
/**
|
|
4696
|
+
* @remarks
|
|
4697
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4698
|
+
* where the min and max components are guaranteed to be (min
|
|
4699
|
+
* <= max)
|
|
4700
|
+
*
|
|
4701
|
+
* This function can't be called in restricted-execution mode.
|
|
4702
|
+
*
|
|
4703
|
+
* @param min
|
|
4704
|
+
* A corner world location
|
|
4705
|
+
* @param max
|
|
4706
|
+
* A corner world location diametrically opposite
|
|
4707
|
+
*/
|
|
4708
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4709
|
+
/**
|
|
4710
|
+
* @remarks
|
|
4711
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4712
|
+
* each axis.
|
|
4713
|
+
* Sizes can be negative to perform contraction.
|
|
4714
|
+
* Note: corners can be inverted if the contraction size is
|
|
4715
|
+
* greater than the span, but the min/max relationship will
|
|
4716
|
+
* remain correct
|
|
4717
|
+
*
|
|
4718
|
+
* This function can't be called in restricted-execution mode.
|
|
4719
|
+
*
|
|
4720
|
+
* @returns
|
|
4721
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4722
|
+
* the changes
|
|
4723
|
+
*/
|
|
4724
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4725
|
+
/**
|
|
4726
|
+
* @remarks
|
|
4727
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4728
|
+
*
|
|
4729
|
+
* This function can't be called in restricted-execution mode.
|
|
4730
|
+
*
|
|
4731
|
+
*/
|
|
4732
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4733
|
+
/**
|
|
4734
|
+
* @remarks
|
|
4735
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4736
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4737
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4738
|
+
* boxes.
|
|
4739
|
+
*
|
|
4740
|
+
* This function can't be called in restricted-execution mode.
|
|
4741
|
+
*
|
|
4742
|
+
* @returns
|
|
4743
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4744
|
+
* smallest possible bounding box which can encompass both
|
|
4745
|
+
*/
|
|
4746
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4747
|
+
/**
|
|
4748
|
+
* @remarks
|
|
4749
|
+
* Calculate the center block of a given {@link
|
|
4750
|
+
* BlockBoundingBox} object.
|
|
4751
|
+
*
|
|
4752
|
+
* This function can't be called in restricted-execution mode.
|
|
4753
|
+
*
|
|
4754
|
+
* @returns
|
|
4755
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4756
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4757
|
+
* bounds are not mathematically centered...
|
|
4758
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4759
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4760
|
+
*/
|
|
4761
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4762
|
+
/**
|
|
4763
|
+
* @remarks
|
|
4764
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4765
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4766
|
+
*
|
|
4767
|
+
* This function can't be called in restricted-execution mode.
|
|
4768
|
+
*
|
|
4769
|
+
*/
|
|
4770
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4771
|
+
/**
|
|
4772
|
+
* @remarks
|
|
4773
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4774
|
+
*
|
|
4775
|
+
* This function can't be called in restricted-execution mode.
|
|
4776
|
+
*
|
|
4777
|
+
*/
|
|
4778
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4779
|
+
/**
|
|
4780
|
+
* @remarks
|
|
4781
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4782
|
+
*
|
|
4783
|
+
* This function can't be called in restricted-execution mode.
|
|
4784
|
+
*
|
|
4785
|
+
*/
|
|
4786
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4787
|
+
/**
|
|
4788
|
+
* @remarks
|
|
4789
|
+
* Check to see if a given coordinate is inside a
|
|
4790
|
+
* BlockBoundingBox
|
|
4791
|
+
*
|
|
4792
|
+
* This function can't be called in restricted-execution mode.
|
|
4793
|
+
*
|
|
4794
|
+
*/
|
|
4795
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4796
|
+
/**
|
|
4797
|
+
* @remarks
|
|
4798
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4799
|
+
* max))
|
|
4800
|
+
*
|
|
4801
|
+
* This function can't be called in restricted-execution mode.
|
|
4802
|
+
*
|
|
4803
|
+
*/
|
|
4804
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4805
|
+
/**
|
|
4806
|
+
* @remarks
|
|
4807
|
+
* Move a BlockBoundingBox by a given amount
|
|
4808
|
+
*
|
|
4809
|
+
* This function can't be called in restricted-execution mode.
|
|
4810
|
+
*
|
|
4811
|
+
* @returns
|
|
4812
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4813
|
+
* change
|
|
4814
|
+
*/
|
|
4815
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4816
|
+
}
|
|
4817
|
+
|
|
4417
4818
|
/**
|
|
4418
4819
|
* Base type for components associated with blocks.
|
|
4419
4820
|
*/
|
|
@@ -4637,6 +5038,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
|
|
|
4637
5038
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4638
5039
|
export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
|
|
4639
5040
|
private constructor();
|
|
5041
|
+
/**
|
|
5042
|
+
* @beta
|
|
5043
|
+
* @remarks
|
|
5044
|
+
* The first update event for the redstone component.
|
|
5045
|
+
*
|
|
5046
|
+
*/
|
|
5047
|
+
readonly firstUpdate: boolean;
|
|
4640
5048
|
/**
|
|
4641
5049
|
* @remarks
|
|
4642
5050
|
* The redstone signal strength passing through this block. It
|
|
@@ -4833,28 +5241,130 @@ export class BlockCustomComponentInstance extends BlockComponent {
|
|
|
4833
5241
|
}
|
|
4834
5242
|
|
|
4835
5243
|
/**
|
|
4836
|
-
*
|
|
4837
|
-
*
|
|
5244
|
+
* @beta
|
|
5245
|
+
* Represents the dynamic properties of a block in the world.
|
|
5246
|
+
* Only available with block entities. Up to 1KBytes of data
|
|
5247
|
+
* can be stored per block entity in their dynamic properties
|
|
5248
|
+
* storage.
|
|
5249
|
+
* @example rememberPlayerInteraction.ts
|
|
5250
|
+
* ```typescript
|
|
5251
|
+
* import { system } from '@minecraft/server-wrapper';
|
|
5252
|
+
*
|
|
5253
|
+
* system.beforeEvents.startup.subscribe(initEvent => {
|
|
5254
|
+
* initEvent.blockComponentRegistry.registerCustomComponent('scripting_demo_pack:block_entity_onPlayerInteract', {
|
|
5255
|
+
* onPlayerInteract: e => {
|
|
5256
|
+
* if (e.player === undefined) {
|
|
5257
|
+
* return;
|
|
5258
|
+
* }
|
|
5259
|
+
*
|
|
5260
|
+
* const dynamicProperties = e.block.getComponent('minecraft:dynamic_properties');
|
|
5261
|
+
* if (!dynamicProperties) {
|
|
5262
|
+
* return;
|
|
5263
|
+
* }
|
|
5264
|
+
*
|
|
5265
|
+
* const lastInteractorValue = dynamicProperties.get('last_interactor');
|
|
5266
|
+
* const lastVisitor = typeof lastInteractorValue === 'string' ? lastInteractorValue : 'unknown';
|
|
5267
|
+
* const lastTick = Number(dynamicProperties.get('last_interact_tick') ?? system.currentTick);
|
|
5268
|
+
* const ticksAgo = Math.max(0, system.currentTick - lastTick);
|
|
5269
|
+
*
|
|
5270
|
+
* if (lastVisitor === e.player.name) {
|
|
5271
|
+
* e.player.sendMessage("do you remember that player? I 'member, it was here " + String(ticksAgo) + ' ticks ago!');
|
|
5272
|
+
* } else {
|
|
5273
|
+
* e.player.sendMessage("oh, I don't remember that player");
|
|
5274
|
+
* }
|
|
5275
|
+
*
|
|
5276
|
+
* dynamicProperties.set('last_interactor', e.player.name);
|
|
5277
|
+
* dynamicProperties.set('last_interact_tick', system.currentTick);
|
|
5278
|
+
* },
|
|
5279
|
+
* });
|
|
5280
|
+
* });
|
|
5281
|
+
* ```
|
|
4838
5282
|
*/
|
|
4839
|
-
|
|
5283
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5284
|
+
export class BlockDynamicPropertiesComponent extends BlockComponent {
|
|
4840
5285
|
private constructor();
|
|
5286
|
+
static readonly componentId = 'minecraft:dynamic_properties';
|
|
4841
5287
|
/**
|
|
4842
5288
|
* @remarks
|
|
4843
|
-
*
|
|
5289
|
+
* Returns a DynamicProperty that was stored with the provided
|
|
5290
|
+
* key. Keys are unique to each content pack and cannot be used
|
|
5291
|
+
* to retrieve dynamic properties set from other content packs.
|
|
5292
|
+
* Returns undefined if the key was not found.
|
|
5293
|
+
*
|
|
5294
|
+
* @throws This function can throw errors.
|
|
4844
5295
|
*
|
|
5296
|
+
* {@link Error}
|
|
5297
|
+
*
|
|
5298
|
+
* {@link InvalidBlockComponentError}
|
|
5299
|
+
*
|
|
5300
|
+
* {@link LocationInUnloadedChunkError}
|
|
5301
|
+
*
|
|
5302
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4845
5303
|
*/
|
|
4846
|
-
|
|
5304
|
+
get(key: string): boolean | number | string | Vector3 | undefined;
|
|
4847
5305
|
/**
|
|
4848
5306
|
* @remarks
|
|
4849
|
-
*
|
|
4850
|
-
*
|
|
5307
|
+
* Sets a dynamic property with the provided key and value.
|
|
5308
|
+
* Keys are unique to each content pack and cannot be used to
|
|
5309
|
+
* set dynamic properties for other content packs. Values can
|
|
5310
|
+
* be either a Number, a String or a Vector3. Setting a
|
|
5311
|
+
* property with an undefined value will remove it from the
|
|
5312
|
+
* storage.
|
|
4851
5313
|
*
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
5314
|
+
* This function can't be called in restricted-execution mode.
|
|
5315
|
+
*
|
|
5316
|
+
* @throws This function can throw errors.
|
|
5317
|
+
*
|
|
5318
|
+
* {@link Error}
|
|
5319
|
+
*
|
|
5320
|
+
* {@link InvalidBlockComponentError}
|
|
5321
|
+
*
|
|
5322
|
+
* {@link LocationInUnloadedChunkError}
|
|
5323
|
+
*
|
|
5324
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5325
|
+
*/
|
|
5326
|
+
set(key: string, value?: boolean | number | string | Vector3): void;
|
|
5327
|
+
/**
|
|
5328
|
+
* @remarks
|
|
5329
|
+
* Returns the current size, in bytes, of the dynamic
|
|
5330
|
+
* properties storage for this block entity.
|
|
5331
|
+
*
|
|
5332
|
+
* @throws This function can throw errors.
|
|
5333
|
+
*
|
|
5334
|
+
* {@link Error}
|
|
5335
|
+
*
|
|
5336
|
+
* {@link InvalidBlockComponentError}
|
|
5337
|
+
*
|
|
5338
|
+
* {@link LocationInUnloadedChunkError}
|
|
5339
|
+
*
|
|
5340
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5341
|
+
*/
|
|
5342
|
+
totalByteCount(): number;
|
|
5343
|
+
}
|
|
5344
|
+
|
|
5345
|
+
/**
|
|
5346
|
+
* Contains information regarding an event that impacts a
|
|
5347
|
+
* specific block.
|
|
5348
|
+
*/
|
|
5349
|
+
export class BlockEvent {
|
|
5350
|
+
private constructor();
|
|
5351
|
+
/**
|
|
5352
|
+
* @remarks
|
|
5353
|
+
* Block currently in the world at the location of this event.
|
|
5354
|
+
*
|
|
5355
|
+
*/
|
|
5356
|
+
readonly block: Block;
|
|
5357
|
+
/**
|
|
5358
|
+
* @remarks
|
|
5359
|
+
* Dimension that contains the block that is the subject of
|
|
5360
|
+
* this event.
|
|
5361
|
+
*
|
|
5362
|
+
*/
|
|
5363
|
+
readonly dimension: Dimension;
|
|
5364
|
+
}
|
|
5365
|
+
|
|
5366
|
+
/**
|
|
5367
|
+
* Contains information regarding an explosion that has
|
|
4858
5368
|
* occurred for a specific block.
|
|
4859
5369
|
*/
|
|
4860
5370
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
@@ -4968,6 +5478,58 @@ export class BlockFluidContainerComponent extends BlockComponent {
|
|
|
4968
5478
|
setPotion(itemStack: ItemStack): void;
|
|
4969
5479
|
}
|
|
4970
5480
|
|
|
5481
|
+
/**
|
|
5482
|
+
* @beta
|
|
5483
|
+
* Represents the instruments a block can have assigned to it's
|
|
5484
|
+
* up and down faces.
|
|
5485
|
+
*/
|
|
5486
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5487
|
+
export class BlockInstrumentComponent extends BlockComponent {
|
|
5488
|
+
private constructor();
|
|
5489
|
+
static readonly componentId = 'minecraft:instrument_sound';
|
|
5490
|
+
/**
|
|
5491
|
+
* @remarks
|
|
5492
|
+
* A getter method to get the name of an instrument for a given
|
|
5493
|
+
* valid face Direction.
|
|
5494
|
+
*
|
|
5495
|
+
* @param face
|
|
5496
|
+
* the face Direction to get the instrument name for.
|
|
5497
|
+
* @returns
|
|
5498
|
+
* Returns the name of the instrument for a given valid face
|
|
5499
|
+
* Direction.
|
|
5500
|
+
* @throws This function can throw errors.
|
|
5501
|
+
*
|
|
5502
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
5503
|
+
*
|
|
5504
|
+
* {@link LocationInUnloadedChunkError}
|
|
5505
|
+
*
|
|
5506
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5507
|
+
*/
|
|
5508
|
+
getInstrumentName(face: Direction): string;
|
|
5509
|
+
/**
|
|
5510
|
+
* @remarks
|
|
5511
|
+
* plays the instrument sound for a given valid face Direction
|
|
5512
|
+
* at the components block location using optional
|
|
5513
|
+
* WorldSoundOptions.
|
|
5514
|
+
*
|
|
5515
|
+
* This function can't be called in restricted-execution mode.
|
|
5516
|
+
*
|
|
5517
|
+
* @param face
|
|
5518
|
+
* the face Direction for which instrument sound to play.
|
|
5519
|
+
* @param soundOptions
|
|
5520
|
+
* optional WorldSoundOptions to use when playing the
|
|
5521
|
+
* insturment sound; if omitted the default values are used.
|
|
5522
|
+
* @throws This function can throw errors.
|
|
5523
|
+
*
|
|
5524
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
5525
|
+
*
|
|
5526
|
+
* {@link LocationInUnloadedChunkError}
|
|
5527
|
+
*
|
|
5528
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5529
|
+
*/
|
|
5530
|
+
playInstrumentSound(face: Direction, soundOptions?: WorldSoundOptions): void;
|
|
5531
|
+
}
|
|
5532
|
+
|
|
4971
5533
|
/**
|
|
4972
5534
|
* Represents the inventory of a block in the world. Used with
|
|
4973
5535
|
* blocks like chests.
|
|
@@ -5041,6 +5603,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
5041
5603
|
*
|
|
5042
5604
|
*/
|
|
5043
5605
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5606
|
+
/**
|
|
5607
|
+
* @beta
|
|
5608
|
+
* @remarks
|
|
5609
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5610
|
+
* Will return false if the block volume was modified between
|
|
5611
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5612
|
+
*
|
|
5613
|
+
* @throws This function can throw errors.
|
|
5614
|
+
*
|
|
5615
|
+
* {@link minecraftcommon.EngineError}
|
|
5616
|
+
*/
|
|
5617
|
+
isValid(): boolean;
|
|
5044
5618
|
/**
|
|
5045
5619
|
* @remarks
|
|
5046
5620
|
* This function can't be called in restricted-execution mode.
|
|
@@ -5957,12 +6531,53 @@ export class BlockVolumeBase {
|
|
|
5957
6531
|
*
|
|
5958
6532
|
*/
|
|
5959
6533
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
6534
|
+
/**
|
|
6535
|
+
* @beta
|
|
6536
|
+
* @remarks
|
|
6537
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
6538
|
+
* the validated min and max coordinates of the volume
|
|
6539
|
+
*
|
|
6540
|
+
* @throws This function can throw errors.
|
|
6541
|
+
*/
|
|
6542
|
+
getBoundingBox(): BlockBoundingBox;
|
|
5960
6543
|
/**
|
|
5961
6544
|
* @remarks
|
|
5962
6545
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
5963
6546
|
*
|
|
5964
6547
|
*/
|
|
5965
6548
|
getCapacity(): number;
|
|
6549
|
+
/**
|
|
6550
|
+
* @beta
|
|
6551
|
+
* @remarks
|
|
6552
|
+
* Returns a list of block positions within the volume that are
|
|
6553
|
+
* closest to a given location, sorted by distance (nearest
|
|
6554
|
+
* first)
|
|
6555
|
+
*
|
|
6556
|
+
* @param count
|
|
6557
|
+
* Number of closest positions to return
|
|
6558
|
+
* @param location
|
|
6559
|
+
* Position to measure distance from
|
|
6560
|
+
* @throws This function can throw errors.
|
|
6561
|
+
*
|
|
6562
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6563
|
+
*/
|
|
6564
|
+
getClosest(count: number, location: Vector3): Vector3[];
|
|
6565
|
+
/**
|
|
6566
|
+
* @beta
|
|
6567
|
+
* @remarks
|
|
6568
|
+
* Returns a list of block positions within the volume that are
|
|
6569
|
+
* farthest from a given location, sorted by distance (farthest
|
|
6570
|
+
* first)
|
|
6571
|
+
*
|
|
6572
|
+
* @param count
|
|
6573
|
+
* Number of farthest positions to return
|
|
6574
|
+
* @param location
|
|
6575
|
+
* Position to measure distance from
|
|
6576
|
+
* @throws This function can throw errors.
|
|
6577
|
+
*
|
|
6578
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6579
|
+
*/
|
|
6580
|
+
getFarthest(count: number, location: Vector3): Vector3[];
|
|
5966
6581
|
/**
|
|
5967
6582
|
* @remarks
|
|
5968
6583
|
* Get the largest corner position of the volume (guaranteed to
|
|
@@ -6122,6 +6737,18 @@ export class Camera {
|
|
|
6122
6737
|
*
|
|
6123
6738
|
*/
|
|
6124
6739
|
readonly isValid: boolean;
|
|
6740
|
+
/**
|
|
6741
|
+
* @beta
|
|
6742
|
+
* @remarks
|
|
6743
|
+
* This function can't be called in restricted-execution mode.
|
|
6744
|
+
*
|
|
6745
|
+
* @throws This function can throw errors.
|
|
6746
|
+
*
|
|
6747
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6748
|
+
*
|
|
6749
|
+
* {@link InvalidEntityError}
|
|
6750
|
+
*/
|
|
6751
|
+
addShake(shakeCameraOptions: CameraShakeOptions): void;
|
|
6125
6752
|
/**
|
|
6126
6753
|
* @remarks
|
|
6127
6754
|
* Attaches the camera to a non-player entity.
|
|
@@ -6187,6 +6814,23 @@ export class Camera {
|
|
|
6187
6814
|
| CameraSetRotOptions
|
|
6188
6815
|
| CameraTargetOptions,
|
|
6189
6816
|
): void;
|
|
6817
|
+
/**
|
|
6818
|
+
* @beta
|
|
6819
|
+
* @remarks
|
|
6820
|
+
* Sets the current active camera with easing.
|
|
6821
|
+
*
|
|
6822
|
+
* This function can't be called in restricted-execution mode.
|
|
6823
|
+
*
|
|
6824
|
+
* @param cameraPreset
|
|
6825
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6826
|
+
* @param easeOptions
|
|
6827
|
+
* Options to ease the camera from the previous camera to the
|
|
6828
|
+
* current one.
|
|
6829
|
+
* @throws
|
|
6830
|
+
* Throws when easing to minecraft:first_person presets
|
|
6831
|
+
* currently without the experimental cameras toggle enabled.
|
|
6832
|
+
*/
|
|
6833
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
6190
6834
|
/**
|
|
6191
6835
|
* @remarks
|
|
6192
6836
|
* Sets the current active camera for the specified player and
|
|
@@ -6210,6 +6854,34 @@ export class Camera {
|
|
|
6210
6854
|
* @throws This function can throw errors.
|
|
6211
6855
|
*/
|
|
6212
6856
|
setFov(fovCameraOptions?: CameraFovOptions): void;
|
|
6857
|
+
/**
|
|
6858
|
+
* @beta
|
|
6859
|
+
* @remarks
|
|
6860
|
+
* This function can't be called in restricted-execution mode.
|
|
6861
|
+
*
|
|
6862
|
+
* @throws This function can throw errors.
|
|
6863
|
+
*
|
|
6864
|
+
* {@link InvalidEntityError}
|
|
6865
|
+
*/
|
|
6866
|
+
stopShaking(): void;
|
|
6867
|
+
}
|
|
6868
|
+
|
|
6869
|
+
/**
|
|
6870
|
+
* @beta
|
|
6871
|
+
* Loot item function that will try to copy the block entity
|
|
6872
|
+
* data from the destroyed block to the dropped item.
|
|
6873
|
+
*/
|
|
6874
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6875
|
+
export class CarryOverBlockEntityDataFunction extends LootItemFunction {
|
|
6876
|
+
private constructor();
|
|
6877
|
+
/**
|
|
6878
|
+
* @remarks
|
|
6879
|
+
* If true, and if the block entity had dynamic_properties, the
|
|
6880
|
+
* function will copy the dynamic properties from the block
|
|
6881
|
+
* entity to the dropped item.
|
|
6882
|
+
*
|
|
6883
|
+
*/
|
|
6884
|
+
readonly dynamicProperties: boolean;
|
|
6213
6885
|
}
|
|
6214
6886
|
|
|
6215
6887
|
/**
|
|
@@ -6226,6 +6898,164 @@ export class CatmullRomSpline {
|
|
|
6226
6898
|
controlPoints: Vector3[];
|
|
6227
6899
|
}
|
|
6228
6900
|
|
|
6901
|
+
/**
|
|
6902
|
+
* @beta
|
|
6903
|
+
* An event that fires as players enter chat messages.
|
|
6904
|
+
*/
|
|
6905
|
+
export class ChatSendAfterEvent {
|
|
6906
|
+
private constructor();
|
|
6907
|
+
/**
|
|
6908
|
+
* @remarks
|
|
6909
|
+
* Message that is being broadcast.
|
|
6910
|
+
*
|
|
6911
|
+
*/
|
|
6912
|
+
readonly message: string;
|
|
6913
|
+
/**
|
|
6914
|
+
* @remarks
|
|
6915
|
+
* Player that sent the chat message.
|
|
6916
|
+
*
|
|
6917
|
+
*/
|
|
6918
|
+
readonly sender: Player;
|
|
6919
|
+
/**
|
|
6920
|
+
* @remarks
|
|
6921
|
+
* Optional list of players that will receive this message. If
|
|
6922
|
+
* defined, this message is directly targeted to one or more
|
|
6923
|
+
* players (i.e., is not broadcast.)
|
|
6924
|
+
*
|
|
6925
|
+
*/
|
|
6926
|
+
readonly targets?: Player[];
|
|
6927
|
+
}
|
|
6928
|
+
|
|
6929
|
+
/**
|
|
6930
|
+
* @beta
|
|
6931
|
+
* Manages callbacks that are connected to chat messages being
|
|
6932
|
+
* sent.
|
|
6933
|
+
*/
|
|
6934
|
+
export class ChatSendAfterEventSignal {
|
|
6935
|
+
private constructor();
|
|
6936
|
+
/**
|
|
6937
|
+
* @remarks
|
|
6938
|
+
* Adds a callback that will be called when new chat messages
|
|
6939
|
+
* are sent.
|
|
6940
|
+
*
|
|
6941
|
+
* This function can't be called in restricted-execution mode.
|
|
6942
|
+
*
|
|
6943
|
+
* This function can be called in early-execution mode.
|
|
6944
|
+
*
|
|
6945
|
+
*/
|
|
6946
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
6947
|
+
/**
|
|
6948
|
+
* @remarks
|
|
6949
|
+
* Removes a callback from being called when new chat messages
|
|
6950
|
+
* are sent.
|
|
6951
|
+
*
|
|
6952
|
+
* This function can't be called in restricted-execution mode.
|
|
6953
|
+
*
|
|
6954
|
+
* This function can be called in early-execution mode.
|
|
6955
|
+
*
|
|
6956
|
+
*/
|
|
6957
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
6958
|
+
}
|
|
6959
|
+
|
|
6960
|
+
/**
|
|
6961
|
+
* @beta
|
|
6962
|
+
* An event that fires as players enter chat messages.
|
|
6963
|
+
*/
|
|
6964
|
+
export class ChatSendBeforeEvent {
|
|
6965
|
+
private constructor();
|
|
6966
|
+
/**
|
|
6967
|
+
* @remarks
|
|
6968
|
+
* If set to true in a beforeChat event handler, this message
|
|
6969
|
+
* is not broadcast out.
|
|
6970
|
+
*
|
|
6971
|
+
*/
|
|
6972
|
+
cancel: boolean;
|
|
6973
|
+
/**
|
|
6974
|
+
* @remarks
|
|
6975
|
+
* Message that is being broadcast.
|
|
6976
|
+
*
|
|
6977
|
+
*/
|
|
6978
|
+
readonly message: string;
|
|
6979
|
+
/**
|
|
6980
|
+
* @remarks
|
|
6981
|
+
* Player that sent the chat message.
|
|
6982
|
+
*
|
|
6983
|
+
*/
|
|
6984
|
+
readonly sender: Player;
|
|
6985
|
+
/**
|
|
6986
|
+
* @remarks
|
|
6987
|
+
* Optional list of players that will receive this message. If
|
|
6988
|
+
* defined, this message is directly targeted to one or more
|
|
6989
|
+
* players (i.e., is not broadcast.)
|
|
6990
|
+
*
|
|
6991
|
+
*/
|
|
6992
|
+
readonly targets?: Player[];
|
|
6993
|
+
}
|
|
6994
|
+
|
|
6995
|
+
/**
|
|
6996
|
+
* @beta
|
|
6997
|
+
* Manages callbacks that are connected to an event that fires
|
|
6998
|
+
* before chat messages are sent.
|
|
6999
|
+
* @example customCommand.ts
|
|
7000
|
+
* ```typescript
|
|
7001
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
7002
|
+
*
|
|
7003
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
7004
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
7005
|
+
* if (eventData.message.includes('cancel')) {
|
|
7006
|
+
* // Cancel event if the message contains "cancel"
|
|
7007
|
+
* eventData.cancel = true;
|
|
7008
|
+
* } else {
|
|
7009
|
+
* const args = eventData.message.split(' ');
|
|
7010
|
+
*
|
|
7011
|
+
* if (args.length > 0) {
|
|
7012
|
+
* switch (args[0].toLowerCase()) {
|
|
7013
|
+
* case 'echo':
|
|
7014
|
+
* // Send a modified version of chat message
|
|
7015
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
7016
|
+
* break;
|
|
7017
|
+
* case 'help':
|
|
7018
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
7019
|
+
* break;
|
|
7020
|
+
* }
|
|
7021
|
+
* }
|
|
7022
|
+
* }
|
|
7023
|
+
* });
|
|
7024
|
+
* }
|
|
7025
|
+
* ```
|
|
7026
|
+
*/
|
|
7027
|
+
export class ChatSendBeforeEventSignal {
|
|
7028
|
+
private constructor();
|
|
7029
|
+
/**
|
|
7030
|
+
* @remarks
|
|
7031
|
+
* Adds a callback that will be called before new chat messages
|
|
7032
|
+
* are sent.
|
|
7033
|
+
*
|
|
7034
|
+
* This function can't be called in restricted-execution mode.
|
|
7035
|
+
*
|
|
7036
|
+
* This function can be called in early-execution mode.
|
|
7037
|
+
*
|
|
7038
|
+
* @param callback
|
|
7039
|
+
* This closure is called with restricted-execution privilege.
|
|
7040
|
+
* @returns
|
|
7041
|
+
* Closure that is called with restricted-execution privilege.
|
|
7042
|
+
*/
|
|
7043
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
7044
|
+
/**
|
|
7045
|
+
* @remarks
|
|
7046
|
+
* Removes a callback from being called before new chat
|
|
7047
|
+
* messages are sent.
|
|
7048
|
+
*
|
|
7049
|
+
* This function can't be called in restricted-execution mode.
|
|
7050
|
+
*
|
|
7051
|
+
* This function can be called in early-execution mode.
|
|
7052
|
+
*
|
|
7053
|
+
* @param callback
|
|
7054
|
+
* This closure is called with restricted-execution privilege.
|
|
7055
|
+
*/
|
|
7056
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
7057
|
+
}
|
|
7058
|
+
|
|
6229
7059
|
/**
|
|
6230
7060
|
* Contains the device information for a client instance.
|
|
6231
7061
|
*/
|
|
@@ -6298,6 +7128,258 @@ export class Component {
|
|
|
6298
7128
|
readonly typeId: string;
|
|
6299
7129
|
}
|
|
6300
7130
|
|
|
7131
|
+
/**
|
|
7132
|
+
* @beta
|
|
7133
|
+
* The Compound Block Volume is a collection of individual
|
|
7134
|
+
* block volume definitions which, as a collection, define a
|
|
7135
|
+
* larger volume of (sometimes non-contiguous) irregular
|
|
7136
|
+
* shapes.
|
|
7137
|
+
* This class is loosely based on the concept of CSG
|
|
7138
|
+
* (Computational Solid Geometry) and allows a user to create
|
|
7139
|
+
* complex volumes by building a stack of volumes and voids to
|
|
7140
|
+
* make a larger single volume.
|
|
7141
|
+
* For example - normally a creator would create a hollow cube
|
|
7142
|
+
* by creating 6 "wall" surfaces for each face.
|
|
7143
|
+
* With a Compound Block Volume, a creator can define a hollow
|
|
7144
|
+
* cube by creating a single outer solid cube, and then
|
|
7145
|
+
* defining a further single 'void' cube inside the larger one.
|
|
7146
|
+
* Similarly, the Compound Block Volume can represent irregular
|
|
7147
|
+
* shaped volumes (e.g. a tree consists of a trunk and lots of
|
|
7148
|
+
* leaf cubes which are not necessarily contiguously placed).
|
|
7149
|
+
* Each of the volumes added to the CompoundBlockVolume are (by
|
|
7150
|
+
* default) relative to the origin set (either at construction
|
|
7151
|
+
* or via one of the set functions).
|
|
7152
|
+
* However, it is also possible to push volumes to the compound
|
|
7153
|
+
* collection which are absolute in nature and are not affected
|
|
7154
|
+
* by origin changes.
|
|
7155
|
+
*/
|
|
7156
|
+
export class CompoundBlockVolume {
|
|
7157
|
+
/**
|
|
7158
|
+
* @remarks
|
|
7159
|
+
* Return the 'capacity' of the bounding rectangle which
|
|
7160
|
+
* represents the collection of volumes in the stack
|
|
7161
|
+
*
|
|
7162
|
+
*/
|
|
7163
|
+
readonly capacity: number;
|
|
7164
|
+
readonly items: CompoundBlockVolumeItem[];
|
|
7165
|
+
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
7166
|
+
/**
|
|
7167
|
+
* @remarks
|
|
7168
|
+
* Return the number of volumes (positive and negative) in the
|
|
7169
|
+
* volume stack
|
|
7170
|
+
*
|
|
7171
|
+
*/
|
|
7172
|
+
readonly volumeCount: number;
|
|
7173
|
+
/**
|
|
7174
|
+
* @remarks
|
|
7175
|
+
* Create a CompoundBlockVolume object
|
|
7176
|
+
*
|
|
7177
|
+
* @param origin
|
|
7178
|
+
* An optional world space origin on which to center the
|
|
7179
|
+
* compound volume.
|
|
7180
|
+
* If not specified, the origin is set to (0,0,0)
|
|
7181
|
+
*/
|
|
7182
|
+
constructor(origin?: Vector3);
|
|
7183
|
+
/**
|
|
7184
|
+
* @remarks
|
|
7185
|
+
* Clear the contents of the volume stack
|
|
7186
|
+
*
|
|
7187
|
+
* This function can't be called in restricted-execution mode.
|
|
7188
|
+
*
|
|
7189
|
+
*/
|
|
7190
|
+
clear(): void;
|
|
7191
|
+
/**
|
|
7192
|
+
* @remarks
|
|
7193
|
+
* Fetch a Block Location Iterator for the Compound Block
|
|
7194
|
+
* Volume. This iterator will allow a creator to iterate
|
|
7195
|
+
* across all of the selected volumes within the larger
|
|
7196
|
+
* bounding area.
|
|
7197
|
+
* Areas of a volume which have been overridden by a
|
|
7198
|
+
* subtractive volume will not be included in the iterator
|
|
7199
|
+
* step.
|
|
7200
|
+
* (i.e. if you push a cube to the stack, and then push a
|
|
7201
|
+
* subtractive volume to the same location, then the iterator
|
|
7202
|
+
* will step over the initial volume because it is considered
|
|
7203
|
+
* negative space)
|
|
7204
|
+
* Note that the Block Locations returned by this iterator are
|
|
7205
|
+
* in absolute world space (irrespective of whether the
|
|
7206
|
+
* compound volume items pushed are absolute or relative)
|
|
7207
|
+
*
|
|
7208
|
+
* This function can't be called in restricted-execution mode.
|
|
7209
|
+
*
|
|
7210
|
+
*/
|
|
7211
|
+
getBlockLocationIterator(): BlockLocationIterator;
|
|
7212
|
+
/**
|
|
7213
|
+
* @remarks
|
|
7214
|
+
* Get the largest bounding box that represents a container for
|
|
7215
|
+
* all of the volumes on the stack
|
|
7216
|
+
* Note that the bounding box returned is represented in
|
|
7217
|
+
* absolute world space (irrespective of whether the compound
|
|
7218
|
+
* volume items pushed are absolute or relative)
|
|
7219
|
+
*
|
|
7220
|
+
* This function can't be called in restricted-execution mode.
|
|
7221
|
+
*
|
|
7222
|
+
*/
|
|
7223
|
+
getBoundingBox(): BlockBoundingBox;
|
|
7224
|
+
/**
|
|
7225
|
+
* @remarks
|
|
7226
|
+
* Get the max block location of the outermost bounding
|
|
7227
|
+
* rectangle which represents the volumes on the stack.
|
|
7228
|
+
* Note that the max location returned is in absolute world
|
|
7229
|
+
* space (irrespective of whether the compound volume items
|
|
7230
|
+
* pushed are absolute or relative)
|
|
7231
|
+
*
|
|
7232
|
+
* This function can't be called in restricted-execution mode.
|
|
7233
|
+
*
|
|
7234
|
+
*/
|
|
7235
|
+
getMax(): Vector3;
|
|
7236
|
+
/**
|
|
7237
|
+
* @remarks
|
|
7238
|
+
* Get the min block location of the outermost bounding
|
|
7239
|
+
* rectangle which represents the volumes on the stack.
|
|
7240
|
+
* Note that the min location returned is in absolute world
|
|
7241
|
+
* space (irrespective of whether the compound volume items
|
|
7242
|
+
* pushed are absolute or relative)
|
|
7243
|
+
*
|
|
7244
|
+
* This function can't be called in restricted-execution mode.
|
|
7245
|
+
*
|
|
7246
|
+
*/
|
|
7247
|
+
getMin(): Vector3;
|
|
7248
|
+
/**
|
|
7249
|
+
* @remarks
|
|
7250
|
+
* Fetch the origin in world space of the compound volume
|
|
7251
|
+
*
|
|
7252
|
+
* This function can't be called in restricted-execution mode.
|
|
7253
|
+
*
|
|
7254
|
+
*/
|
|
7255
|
+
getOrigin(): Vector3;
|
|
7256
|
+
/**
|
|
7257
|
+
* @remarks
|
|
7258
|
+
* Return a boolean which signals if there are any volume items
|
|
7259
|
+
* pushed to the volume
|
|
7260
|
+
*
|
|
7261
|
+
* This function can't be called in restricted-execution mode.
|
|
7262
|
+
*
|
|
7263
|
+
*/
|
|
7264
|
+
isEmpty(): boolean;
|
|
7265
|
+
/**
|
|
7266
|
+
* @remarks
|
|
7267
|
+
* Return a boolean representing whether or not a given
|
|
7268
|
+
* absolute world space block location is inside a positive
|
|
7269
|
+
* block volume.
|
|
7270
|
+
* E.g. if the stack contains a large cube followed by a
|
|
7271
|
+
* slightly smaller negative cube, and the test location is
|
|
7272
|
+
* within the negative cube - the function will return false
|
|
7273
|
+
* because it's not 'inside' a volume (it IS inside the
|
|
7274
|
+
* bounding rectangle, but it is not inside a positively
|
|
7275
|
+
* defined location)
|
|
7276
|
+
*
|
|
7277
|
+
* This function can't be called in restricted-execution mode.
|
|
7278
|
+
*
|
|
7279
|
+
*/
|
|
7280
|
+
isInside(worldLocation: Vector3): boolean;
|
|
7281
|
+
/**
|
|
7282
|
+
* @remarks
|
|
7283
|
+
* Inspect the last entry pushed to the volume stack without
|
|
7284
|
+
* affecting the stack contents.
|
|
7285
|
+
*
|
|
7286
|
+
* This function can't be called in restricted-execution mode.
|
|
7287
|
+
*
|
|
7288
|
+
* @param forceRelativity
|
|
7289
|
+
* Determine whether the function returns a
|
|
7290
|
+
* CompoundBlockVolumeItem which is forced into either relative
|
|
7291
|
+
* or absolute coordinate system.
|
|
7292
|
+
* `true` = force returned item to be relative to volume origin
|
|
7293
|
+
* `false` = force returned item to be absolute world space
|
|
7294
|
+
* location
|
|
7295
|
+
*
|
|
7296
|
+
* If no flag is specified, the item returned retains whatever
|
|
7297
|
+
* relativity it had when it was pushed
|
|
7298
|
+
* @returns
|
|
7299
|
+
* Returns undefined if the stack is empty
|
|
7300
|
+
*/
|
|
7301
|
+
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
7302
|
+
/**
|
|
7303
|
+
* @remarks
|
|
7304
|
+
* Remove the last entry from the volume stack. This will
|
|
7305
|
+
* reduce the stack size by one
|
|
7306
|
+
*
|
|
7307
|
+
* This function can't be called in restricted-execution mode.
|
|
7308
|
+
*
|
|
7309
|
+
*/
|
|
7310
|
+
popVolume(): boolean;
|
|
7311
|
+
/**
|
|
7312
|
+
* @remarks
|
|
7313
|
+
* Push a volume item to the stack. The volume item contains
|
|
7314
|
+
* an 'action' parameter which determines whether this volume
|
|
7315
|
+
* is a positive or negative space.
|
|
7316
|
+
* The item also contains a `locationRelativity` which
|
|
7317
|
+
* determines whether it is relative or absolute to the
|
|
7318
|
+
* compound volume origin
|
|
7319
|
+
*
|
|
7320
|
+
* This function can't be called in restricted-execution mode.
|
|
7321
|
+
*
|
|
7322
|
+
* @param item
|
|
7323
|
+
* Item to push to the end of the stack
|
|
7324
|
+
*/
|
|
7325
|
+
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
7326
|
+
/**
|
|
7327
|
+
* @remarks
|
|
7328
|
+
* If the volume stack is empty, this function will push the
|
|
7329
|
+
* specified item to the stack.
|
|
7330
|
+
* If the volume stack is NOT empty, this function will replace
|
|
7331
|
+
* the last item on the stack with the new item.
|
|
7332
|
+
*
|
|
7333
|
+
* This function can't be called in restricted-execution mode.
|
|
7334
|
+
*
|
|
7335
|
+
* @param item
|
|
7336
|
+
* Item to add or replace
|
|
7337
|
+
*/
|
|
7338
|
+
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
7339
|
+
/**
|
|
7340
|
+
* @remarks
|
|
7341
|
+
* Set the origin of the compound volume to an absolute world
|
|
7342
|
+
* space location
|
|
7343
|
+
*
|
|
7344
|
+
* This function can't be called in restricted-execution mode.
|
|
7345
|
+
*
|
|
7346
|
+
* @param preserveExistingVolumes
|
|
7347
|
+
* This optional boolean flag determines whether the relative
|
|
7348
|
+
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
7349
|
+
* affected by the new origin.
|
|
7350
|
+
* Imagine a scenario where you have a series of relative
|
|
7351
|
+
* locations around an origin which make up a sphere; all of
|
|
7352
|
+
* these locations are in the range of -2 to 2.
|
|
7353
|
+
* Push each of these locations to the compound volume as
|
|
7354
|
+
* relative items.
|
|
7355
|
+
* Now, move the origin and all of the locations representing
|
|
7356
|
+
* the sphere move accordingly.
|
|
7357
|
+
* However, let's say you want to add a 2nd sphere next to the
|
|
7358
|
+
* 1st.
|
|
7359
|
+
* In this case, set the new origin a few locations over, but
|
|
7360
|
+
* 'preserveExistingVolumes' = true.
|
|
7361
|
+
* This will set a new origin, but the existing sphere
|
|
7362
|
+
* locations will remain relative to the original origin.
|
|
7363
|
+
* Now, you can push the relative sphere locations again (this
|
|
7364
|
+
* time they will be relative to the new origin) - resulting in
|
|
7365
|
+
* 2 spheres next to each other.
|
|
7366
|
+
*/
|
|
7367
|
+
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
7368
|
+
/**
|
|
7369
|
+
* @remarks
|
|
7370
|
+
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
7371
|
+
* function will translate the origin by a given delta to a new
|
|
7372
|
+
* position
|
|
7373
|
+
*
|
|
7374
|
+
* This function can't be called in restricted-execution mode.
|
|
7375
|
+
*
|
|
7376
|
+
* @param preserveExistingVolumes
|
|
7377
|
+
* See the description for the arguments to {@link
|
|
7378
|
+
* CompoundBlockVolume.setOrigin}
|
|
7379
|
+
*/
|
|
7380
|
+
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
7381
|
+
}
|
|
7382
|
+
|
|
6301
7383
|
/**
|
|
6302
7384
|
* Represents a container that can hold sets of items. Used
|
|
6303
7385
|
* with entities such as Players, Chest Minecarts, Llamas, and
|
|
@@ -6435,7 +7517,9 @@ export class Container {
|
|
|
6435
7517
|
*
|
|
6436
7518
|
* @param itemStack
|
|
6437
7519
|
* The stack of items to add.
|
|
6438
|
-
* @throws
|
|
7520
|
+
* @throws
|
|
7521
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7522
|
+
* limit but will instead add items up to the weight limit.
|
|
6439
7523
|
*
|
|
6440
7524
|
* {@link ContainerRulesError}
|
|
6441
7525
|
*
|
|
@@ -6673,6 +7757,8 @@ export class Container {
|
|
|
6673
7757
|
* @throws
|
|
6674
7758
|
* Throws if either this container or `toContainer` are invalid
|
|
6675
7759
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
7760
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7761
|
+
* limit but will instead add items up to the weight limit.
|
|
6676
7762
|
*
|
|
6677
7763
|
* {@link ContainerRulesError}
|
|
6678
7764
|
*
|
|
@@ -7447,14 +8533,38 @@ export class Dimension {
|
|
|
7447
8533
|
* {@link minecraftcommon.EngineError}
|
|
7448
8534
|
*
|
|
7449
8535
|
* {@link Error}
|
|
7450
|
-
*
|
|
7451
|
-
* {@link UnloadedChunksError}
|
|
8536
|
+
*
|
|
8537
|
+
* {@link UnloadedChunksError}
|
|
8538
|
+
*/
|
|
8539
|
+
fillBlocks(
|
|
8540
|
+
volume: BlockVolumeBase,
|
|
8541
|
+
block: BlockPermutation | BlockType | string,
|
|
8542
|
+
options?: BlockFillOptions,
|
|
8543
|
+
): ListBlockVolume;
|
|
8544
|
+
/**
|
|
8545
|
+
* @beta
|
|
8546
|
+
* @remarks
|
|
8547
|
+
* Finds the location of the closest biome of a particular
|
|
8548
|
+
* type. Note that the findClosestBiome operation can take some
|
|
8549
|
+
* time to complete, so avoid using many of these calls within
|
|
8550
|
+
* a particular tick.
|
|
8551
|
+
*
|
|
8552
|
+
* @param pos
|
|
8553
|
+
* Starting location to look for a biome to find.
|
|
8554
|
+
* @param biomeToFind
|
|
8555
|
+
* Identifier of the biome to look for.
|
|
8556
|
+
* @param options
|
|
8557
|
+
* Additional selection criteria for a biome search.
|
|
8558
|
+
* @returns
|
|
8559
|
+
* Returns a location of the biome, or undefined if a biome
|
|
8560
|
+
* could not be found.
|
|
8561
|
+
* @throws This function can throw errors.
|
|
8562
|
+
*
|
|
8563
|
+
* {@link minecraftcommon.EngineError}
|
|
8564
|
+
*
|
|
8565
|
+
* {@link Error}
|
|
7452
8566
|
*/
|
|
7453
|
-
|
|
7454
|
-
volume: BlockVolumeBase,
|
|
7455
|
-
block: BlockPermutation | BlockType | string,
|
|
7456
|
-
options?: BlockFillOptions,
|
|
7457
|
-
): ListBlockVolume;
|
|
8567
|
+
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
7458
8568
|
/**
|
|
7459
8569
|
* @remarks
|
|
7460
8570
|
* Returns the biome type at the specified location.
|
|
@@ -7538,13 +8648,14 @@ export class Dimension {
|
|
|
7538
8648
|
getBlockFromRay(location: Vector3, direction: Vector3, options?: BlockRaycastOptions): BlockRaycastHit | undefined;
|
|
7539
8649
|
/**
|
|
7540
8650
|
* @remarks
|
|
7541
|
-
* Gets all the blocks in a volume that satisfy the
|
|
8651
|
+
* Gets all the blocks in a volume that satisfy the block query
|
|
8652
|
+
* options.
|
|
7542
8653
|
*
|
|
7543
8654
|
* @param volume
|
|
7544
8655
|
* Volume of blocks that will be checked.
|
|
7545
|
-
* @param
|
|
7546
|
-
* Block
|
|
7547
|
-
*
|
|
8656
|
+
* @param options
|
|
8657
|
+
* Block query options including filter criteria and optional
|
|
8658
|
+
* closest/farthest distance sorting from a location.
|
|
7548
8659
|
* @param allowUnloadedChunks
|
|
7549
8660
|
* If set to true will suppress the UnloadedChunksError if some
|
|
7550
8661
|
* or all of the block volume is outside of the loaded chunks.
|
|
@@ -7553,7 +8664,7 @@ export class Dimension {
|
|
|
7553
8664
|
* Defaults to: false
|
|
7554
8665
|
* @returns
|
|
7555
8666
|
* Returns the ListBlockVolume that contains all the block
|
|
7556
|
-
* locations that satisfied the block
|
|
8667
|
+
* locations that satisfied the block query options.
|
|
7557
8668
|
* @throws This function can throw errors.
|
|
7558
8669
|
*
|
|
7559
8670
|
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
@@ -7564,7 +8675,7 @@ export class Dimension {
|
|
|
7564
8675
|
*
|
|
7565
8676
|
* {@link UnloadedChunksError}
|
|
7566
8677
|
*/
|
|
7567
|
-
getBlocks(volume: BlockVolumeBase,
|
|
8678
|
+
getBlocks(volume: BlockVolumeBase, options: BlockQueryOptions, allowUnloadedChunks?: boolean): ListBlockVolume;
|
|
7568
8679
|
/**
|
|
7569
8680
|
* @remarks
|
|
7570
8681
|
* Returns a set of entities based on a set of conditions
|
|
@@ -7678,6 +8789,26 @@ export class Dimension {
|
|
|
7678
8789
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7679
8790
|
*/
|
|
7680
8791
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8792
|
+
/**
|
|
8793
|
+
* @beta
|
|
8794
|
+
* @remarks
|
|
8795
|
+
* Returns a vector of generated structures that contain the
|
|
8796
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
8797
|
+
* The vector will be empty if no structures are found.
|
|
8798
|
+
*
|
|
8799
|
+
* @param location
|
|
8800
|
+
* Location at which to check for structures.
|
|
8801
|
+
* @throws
|
|
8802
|
+
* An error will be thrown if the location is out of world
|
|
8803
|
+
* bounds.
|
|
8804
|
+
* An error will be thrown if the location is in an unloaded
|
|
8805
|
+
* chunk.
|
|
8806
|
+
*
|
|
8807
|
+
* {@link LocationInUnloadedChunkError}
|
|
8808
|
+
*
|
|
8809
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8810
|
+
*/
|
|
8811
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
7681
8812
|
/**
|
|
7682
8813
|
* @remarks
|
|
7683
8814
|
* Returns the total brightness level of light shining on a
|
|
@@ -7739,6 +8870,16 @@ export class Dimension {
|
|
|
7739
8870
|
* @throws This function can throw errors.
|
|
7740
8871
|
*/
|
|
7741
8872
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
8873
|
+
/**
|
|
8874
|
+
* @beta
|
|
8875
|
+
* @remarks
|
|
8876
|
+
* Returns the current weather.
|
|
8877
|
+
*
|
|
8878
|
+
* @returns
|
|
8879
|
+
* Returns a WeatherType that explains the broad category of
|
|
8880
|
+
* weather that is currently going on.
|
|
8881
|
+
*/
|
|
8882
|
+
getWeather(): WeatherType;
|
|
7742
8883
|
/**
|
|
7743
8884
|
* @remarks
|
|
7744
8885
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -7984,7 +9125,11 @@ export class Dimension {
|
|
|
7984
9125
|
* }
|
|
7985
9126
|
* ```
|
|
7986
9127
|
*/
|
|
7987
|
-
spawnEntity
|
|
9128
|
+
spawnEntity<T = never>(
|
|
9129
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
9130
|
+
location: Vector3,
|
|
9131
|
+
options?: SpawnEntityOptions,
|
|
9132
|
+
): Entity;
|
|
7988
9133
|
/**
|
|
7989
9134
|
* @remarks
|
|
7990
9135
|
* Creates a new item stack as an entity at the specified
|
|
@@ -8079,6 +9224,46 @@ export class Dimension {
|
|
|
8079
9224
|
* ```
|
|
8080
9225
|
*/
|
|
8081
9226
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
9227
|
+
/**
|
|
9228
|
+
* @beta
|
|
9229
|
+
* @remarks
|
|
9230
|
+
* Spawns an experience orb at a specified location in the
|
|
9231
|
+
* dimension.
|
|
9232
|
+
*
|
|
9233
|
+
* This function can't be called in restricted-execution mode.
|
|
9234
|
+
*
|
|
9235
|
+
* @param location
|
|
9236
|
+
* The location at which to spawn the experience orb.
|
|
9237
|
+
* @param amount
|
|
9238
|
+
* The amount of experience to give the experience orb.
|
|
9239
|
+
* Bounds: [1, 12000]
|
|
9240
|
+
* @throws This function can throw errors.
|
|
9241
|
+
*
|
|
9242
|
+
* {@link LocationInUnloadedChunkError}
|
|
9243
|
+
*
|
|
9244
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
9245
|
+
*/
|
|
9246
|
+
spawnXp(location: Vector3, amount: number): void;
|
|
9247
|
+
/**
|
|
9248
|
+
* @beta
|
|
9249
|
+
* @remarks
|
|
9250
|
+
* Stops all sounds from playing for all players.
|
|
9251
|
+
*
|
|
9252
|
+
* This function can't be called in restricted-execution mode.
|
|
9253
|
+
*
|
|
9254
|
+
*/
|
|
9255
|
+
stopAllSounds(): void;
|
|
9256
|
+
/**
|
|
9257
|
+
* @beta
|
|
9258
|
+
* @remarks
|
|
9259
|
+
* Stops a sound from playing for all players.
|
|
9260
|
+
*
|
|
9261
|
+
* This function can't be called in restricted-execution mode.
|
|
9262
|
+
*
|
|
9263
|
+
* @param soundId
|
|
9264
|
+
* Identifier of the sound.
|
|
9265
|
+
*/
|
|
9266
|
+
stopSound(soundId: string): void;
|
|
8082
9267
|
}
|
|
8083
9268
|
|
|
8084
9269
|
/**
|
|
@@ -8665,6 +9850,18 @@ export class Entity {
|
|
|
8665
9850
|
*
|
|
8666
9851
|
*/
|
|
8667
9852
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
9853
|
+
/**
|
|
9854
|
+
* @beta
|
|
9855
|
+
* @remarks
|
|
9856
|
+
* Retrieves or sets an entity that is used as the target of
|
|
9857
|
+
* AI-related behaviors, like attacking. If the entity
|
|
9858
|
+
* currently has no target returns undefined.
|
|
9859
|
+
*
|
|
9860
|
+
* @throws This property can throw when used.
|
|
9861
|
+
*
|
|
9862
|
+
* {@link InvalidEntityError}
|
|
9863
|
+
*/
|
|
9864
|
+
readonly target?: Entity;
|
|
8668
9865
|
/**
|
|
8669
9866
|
* @remarks
|
|
8670
9867
|
* Identifier of the type of the entity - for example,
|
|
@@ -9905,6 +11102,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
9905
11102
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
9906
11103
|
export class EntityBreathableComponent extends EntityComponent {
|
|
9907
11104
|
private constructor();
|
|
11105
|
+
/**
|
|
11106
|
+
* @beta
|
|
11107
|
+
* @remarks
|
|
11108
|
+
* The current air supply of the entity.
|
|
11109
|
+
*
|
|
11110
|
+
* This property can't be edited in restricted-execution mode.
|
|
11111
|
+
*
|
|
11112
|
+
* @throws
|
|
11113
|
+
* Will throw an error if the air supply is out of bounds
|
|
11114
|
+
* [suffocationTime, maxAirSupply].
|
|
11115
|
+
*/
|
|
11116
|
+
airSupply: number;
|
|
9908
11117
|
/**
|
|
9909
11118
|
* @remarks
|
|
9910
11119
|
* If true, this entity can breathe in air.
|
|
@@ -9933,6 +11142,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
9933
11142
|
* @throws This property can throw when used.
|
|
9934
11143
|
*/
|
|
9935
11144
|
readonly breathesWater: boolean;
|
|
11145
|
+
/**
|
|
11146
|
+
* @beta
|
|
11147
|
+
* @remarks
|
|
11148
|
+
* If true, the entity is able to breathe.
|
|
11149
|
+
*
|
|
11150
|
+
* @throws This property can throw when used.
|
|
11151
|
+
*/
|
|
11152
|
+
readonly canBreathe: boolean;
|
|
9936
11153
|
/**
|
|
9937
11154
|
* @remarks
|
|
9938
11155
|
* If true, this entity will have visible bubbles while in
|
|
@@ -11888,6 +13105,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
11888
13105
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
11889
13106
|
}
|
|
11890
13107
|
|
|
13108
|
+
/**
|
|
13109
|
+
* @beta
|
|
13110
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
13111
|
+
* name, and dialogue interactions.
|
|
13112
|
+
*/
|
|
13113
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13114
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
13115
|
+
private constructor();
|
|
13116
|
+
/**
|
|
13117
|
+
* @remarks
|
|
13118
|
+
* The DialogueScene that is opened when players first interact
|
|
13119
|
+
* with the NPC.
|
|
13120
|
+
*
|
|
13121
|
+
* This property can't be edited in restricted-execution mode.
|
|
13122
|
+
*
|
|
13123
|
+
*/
|
|
13124
|
+
defaultScene: string;
|
|
13125
|
+
/**
|
|
13126
|
+
* @remarks
|
|
13127
|
+
* The name of the NPC as it is displayed to players.
|
|
13128
|
+
*
|
|
13129
|
+
* This property can't be edited in restricted-execution mode.
|
|
13130
|
+
*
|
|
13131
|
+
*/
|
|
13132
|
+
name: string;
|
|
13133
|
+
/**
|
|
13134
|
+
* @remarks
|
|
13135
|
+
* The index of the skin the NPC will use.
|
|
13136
|
+
*
|
|
13137
|
+
* This property can't be edited in restricted-execution mode.
|
|
13138
|
+
*
|
|
13139
|
+
*/
|
|
13140
|
+
skinIndex: number;
|
|
13141
|
+
static readonly componentId = 'minecraft:npc';
|
|
13142
|
+
}
|
|
13143
|
+
|
|
11891
13144
|
/**
|
|
11892
13145
|
* When present on an entity, this entity is on fire.
|
|
11893
13146
|
* @example setOnFire.ts
|
|
@@ -12560,6 +13813,102 @@ export class EntitySpawnAfterEventSignal {
|
|
|
12560
13813
|
unsubscribe(callback: (arg0: EntitySpawnAfterEvent) => void): void;
|
|
12561
13814
|
}
|
|
12562
13815
|
|
|
13816
|
+
/**
|
|
13817
|
+
* @beta
|
|
13818
|
+
* Contains data related to an entity beginning to sneak.
|
|
13819
|
+
*/
|
|
13820
|
+
export class EntityStartSneakingAfterEvent {
|
|
13821
|
+
private constructor();
|
|
13822
|
+
/**
|
|
13823
|
+
* @remarks
|
|
13824
|
+
* Entity that has started sneaking.
|
|
13825
|
+
*
|
|
13826
|
+
*/
|
|
13827
|
+
readonly entity: Entity;
|
|
13828
|
+
}
|
|
13829
|
+
|
|
13830
|
+
/**
|
|
13831
|
+
* @beta
|
|
13832
|
+
* Manages callbacks that are connected to when an entity
|
|
13833
|
+
* begins sneaking.
|
|
13834
|
+
*/
|
|
13835
|
+
export class EntityStartSneakingAfterEventSignal {
|
|
13836
|
+
private constructor();
|
|
13837
|
+
/**
|
|
13838
|
+
* @remarks
|
|
13839
|
+
* Adds a callback that will be called when an entity begins
|
|
13840
|
+
* sneaking.
|
|
13841
|
+
*
|
|
13842
|
+
* This function can't be called in restricted-execution mode.
|
|
13843
|
+
*
|
|
13844
|
+
* This function can be called in early-execution mode.
|
|
13845
|
+
*
|
|
13846
|
+
*/
|
|
13847
|
+
subscribe(
|
|
13848
|
+
callback: (arg0: EntityStartSneakingAfterEvent) => void,
|
|
13849
|
+
options?: EntitySneakingChangedEventOptions,
|
|
13850
|
+
): (arg0: EntityStartSneakingAfterEvent) => void;
|
|
13851
|
+
/**
|
|
13852
|
+
* @remarks
|
|
13853
|
+
* Removes a callback from being called when an entity begins
|
|
13854
|
+
* sneaking.
|
|
13855
|
+
*
|
|
13856
|
+
* This function can't be called in restricted-execution mode.
|
|
13857
|
+
*
|
|
13858
|
+
* This function can be called in early-execution mode.
|
|
13859
|
+
*
|
|
13860
|
+
*/
|
|
13861
|
+
unsubscribe(callback: (arg0: EntityStartSneakingAfterEvent) => void): void;
|
|
13862
|
+
}
|
|
13863
|
+
|
|
13864
|
+
/**
|
|
13865
|
+
* @beta
|
|
13866
|
+
* Contains data related to an entity stopping sneaking.
|
|
13867
|
+
*/
|
|
13868
|
+
export class EntityStopSneakingAfterEvent {
|
|
13869
|
+
private constructor();
|
|
13870
|
+
/**
|
|
13871
|
+
* @remarks
|
|
13872
|
+
* Entity that has stopped sneaking.
|
|
13873
|
+
*
|
|
13874
|
+
*/
|
|
13875
|
+
readonly entity: Entity;
|
|
13876
|
+
}
|
|
13877
|
+
|
|
13878
|
+
/**
|
|
13879
|
+
* @beta
|
|
13880
|
+
* Manages callbacks that are connected to when an entity stops
|
|
13881
|
+
* sneaking.
|
|
13882
|
+
*/
|
|
13883
|
+
export class EntityStopSneakingAfterEventSignal {
|
|
13884
|
+
private constructor();
|
|
13885
|
+
/**
|
|
13886
|
+
* @remarks
|
|
13887
|
+
* Adds a callback that will be called when an entity stops
|
|
13888
|
+
* sneaking.
|
|
13889
|
+
*
|
|
13890
|
+
* This function can't be called in restricted-execution mode.
|
|
13891
|
+
*
|
|
13892
|
+
* This function can be called in early-execution mode.
|
|
13893
|
+
*
|
|
13894
|
+
*/
|
|
13895
|
+
subscribe(
|
|
13896
|
+
callback: (arg0: EntityStopSneakingAfterEvent) => void,
|
|
13897
|
+
options?: EntitySneakingChangedEventOptions,
|
|
13898
|
+
): (arg0: EntityStopSneakingAfterEvent) => void;
|
|
13899
|
+
/**
|
|
13900
|
+
* @remarks
|
|
13901
|
+
* Removes a callback from being called when an entity stops
|
|
13902
|
+
* sneaking.
|
|
13903
|
+
*
|
|
13904
|
+
* This function can't be called in restricted-execution mode.
|
|
13905
|
+
*
|
|
13906
|
+
* This function can be called in early-execution mode.
|
|
13907
|
+
*
|
|
13908
|
+
*/
|
|
13909
|
+
unsubscribe(callback: (arg0: EntityStopSneakingAfterEvent) => void): void;
|
|
13910
|
+
}
|
|
13911
|
+
|
|
12563
13912
|
/**
|
|
12564
13913
|
* Defines the entity's ability to carry items. An entity with
|
|
12565
13914
|
* a higher strength would have higher potential carry capacity
|
|
@@ -12573,78 +13922,177 @@ export class EntityStrengthComponent extends EntityComponent {
|
|
|
12573
13922
|
* Maximum strength of this entity, as defined in the entity
|
|
12574
13923
|
* type definition.
|
|
12575
13924
|
*
|
|
12576
|
-
* @throws This property can throw when used.
|
|
13925
|
+
* @throws This property can throw when used.
|
|
13926
|
+
*/
|
|
13927
|
+
readonly max: number;
|
|
13928
|
+
/**
|
|
13929
|
+
* @remarks
|
|
13930
|
+
* Current value of the strength component that has been set
|
|
13931
|
+
* for entities.
|
|
13932
|
+
*
|
|
13933
|
+
* @throws This property can throw when used.
|
|
13934
|
+
*/
|
|
13935
|
+
readonly value: number;
|
|
13936
|
+
static readonly componentId = 'minecraft:strength';
|
|
13937
|
+
}
|
|
13938
|
+
|
|
13939
|
+
/**
|
|
13940
|
+
* Defines the rules for an entity to be tamed by the player.
|
|
13941
|
+
*/
|
|
13942
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13943
|
+
export class EntityTameableComponent extends EntityComponent {
|
|
13944
|
+
private constructor();
|
|
13945
|
+
/**
|
|
13946
|
+
* @remarks
|
|
13947
|
+
* Returns a set of items that can be used to tame this entity.
|
|
13948
|
+
*
|
|
13949
|
+
* @throws This property can throw when used.
|
|
13950
|
+
*/
|
|
13951
|
+
readonly getTameItems: ItemStack[];
|
|
13952
|
+
/**
|
|
13953
|
+
* @remarks
|
|
13954
|
+
* Returns true if the entity is tamed by player.
|
|
13955
|
+
*
|
|
13956
|
+
* @throws This property can throw when used.
|
|
13957
|
+
*/
|
|
13958
|
+
readonly isTamed: boolean;
|
|
13959
|
+
/**
|
|
13960
|
+
* @remarks
|
|
13961
|
+
* The chance of taming the entity with each item use between
|
|
13962
|
+
* 0.0 and 1.0, where 1.0 is 100%
|
|
13963
|
+
*
|
|
13964
|
+
* @throws This property can throw when used.
|
|
13965
|
+
*/
|
|
13966
|
+
readonly probability: number;
|
|
13967
|
+
/**
|
|
13968
|
+
* @remarks
|
|
13969
|
+
* Returns the player that has tamed the entity, or 'undefined'
|
|
13970
|
+
* if entity is not tamed.
|
|
13971
|
+
*
|
|
13972
|
+
* @throws This property can throw when used.
|
|
13973
|
+
*/
|
|
13974
|
+
readonly tamedToPlayer?: Player;
|
|
13975
|
+
/**
|
|
13976
|
+
* @remarks
|
|
13977
|
+
* Returns the id of player that has tamed the entity, or
|
|
13978
|
+
* 'undefined' if entity is not tamed.
|
|
13979
|
+
*
|
|
13980
|
+
* @throws This property can throw when used.
|
|
13981
|
+
*/
|
|
13982
|
+
readonly tamedToPlayerId?: string;
|
|
13983
|
+
static readonly componentId = 'minecraft:tameable';
|
|
13984
|
+
/**
|
|
13985
|
+
* @remarks
|
|
13986
|
+
* Set this entity as tamed by the given player.
|
|
13987
|
+
*
|
|
13988
|
+
* This function can't be called in restricted-execution mode.
|
|
13989
|
+
*
|
|
13990
|
+
* @param player
|
|
13991
|
+
* The player that this entity should be tamed by.
|
|
13992
|
+
* @returns
|
|
13993
|
+
* Returns true if the entity was tamed.
|
|
13994
|
+
* @throws This function can throw errors.
|
|
13995
|
+
*/
|
|
13996
|
+
tame(player: Player): boolean;
|
|
13997
|
+
}
|
|
13998
|
+
|
|
13999
|
+
/**
|
|
14000
|
+
* @beta
|
|
14001
|
+
* Contains data related to an entity being tamed.
|
|
14002
|
+
*/
|
|
14003
|
+
export class EntityTamedAfterEvent {
|
|
14004
|
+
private constructor();
|
|
14005
|
+
readonly entity: Entity;
|
|
14006
|
+
readonly tamingEntity: Entity;
|
|
14007
|
+
}
|
|
14008
|
+
|
|
14009
|
+
/**
|
|
14010
|
+
* @beta
|
|
14011
|
+
* Manages callbacks that are connected to when an entity is
|
|
14012
|
+
* tamed.
|
|
14013
|
+
*/
|
|
14014
|
+
export class EntityTamedAfterEventSignal {
|
|
14015
|
+
private constructor();
|
|
14016
|
+
/**
|
|
14017
|
+
* @remarks
|
|
14018
|
+
* This function can't be called in restricted-execution mode.
|
|
14019
|
+
*
|
|
14020
|
+
* This function can be called in early-execution mode.
|
|
14021
|
+
*
|
|
12577
14022
|
*/
|
|
12578
|
-
|
|
14023
|
+
subscribe(
|
|
14024
|
+
callback: (arg0: EntityTamedAfterEvent) => void,
|
|
14025
|
+
options?: EntityTamedEventFilter,
|
|
14026
|
+
): (arg0: EntityTamedAfterEvent) => void;
|
|
12579
14027
|
/**
|
|
12580
14028
|
* @remarks
|
|
12581
|
-
*
|
|
12582
|
-
*
|
|
14029
|
+
* This function can't be called in restricted-execution mode.
|
|
14030
|
+
*
|
|
14031
|
+
* This function can be called in early-execution mode.
|
|
12583
14032
|
*
|
|
12584
|
-
* @throws This property can throw when used.
|
|
12585
14033
|
*/
|
|
12586
|
-
|
|
12587
|
-
static readonly componentId = 'minecraft:strength';
|
|
14034
|
+
unsubscribe(callback: (arg0: EntityTamedAfterEvent) => void): void;
|
|
12588
14035
|
}
|
|
12589
14036
|
|
|
12590
14037
|
/**
|
|
12591
|
-
*
|
|
14038
|
+
* @beta
|
|
14039
|
+
* Contains information regarding an event before an entity is
|
|
14040
|
+
* tamed.
|
|
12592
14041
|
*/
|
|
12593
|
-
|
|
12594
|
-
export class EntityTameableComponent extends EntityComponent {
|
|
14042
|
+
export class EntityTamedBeforeEvent {
|
|
12595
14043
|
private constructor();
|
|
12596
14044
|
/**
|
|
12597
14045
|
* @remarks
|
|
12598
|
-
*
|
|
14046
|
+
* When set to true will cancel the event.
|
|
12599
14047
|
*
|
|
12600
|
-
* @throws This property can throw when used.
|
|
12601
14048
|
*/
|
|
12602
|
-
|
|
14049
|
+
cancel: boolean;
|
|
12603
14050
|
/**
|
|
12604
14051
|
* @remarks
|
|
12605
|
-
*
|
|
14052
|
+
* The entity that is being tamed.
|
|
12606
14053
|
*
|
|
12607
|
-
* @throws This property can throw when used.
|
|
12608
14054
|
*/
|
|
12609
|
-
readonly
|
|
14055
|
+
readonly entity: Entity;
|
|
12610
14056
|
/**
|
|
12611
14057
|
* @remarks
|
|
12612
|
-
* The
|
|
12613
|
-
* 0.0 and 1.0, where 1.0 is 100%
|
|
14058
|
+
* The entity that is attempting to tame the entity.
|
|
12614
14059
|
*
|
|
12615
|
-
* @throws This property can throw when used.
|
|
12616
14060
|
*/
|
|
12617
|
-
readonly
|
|
14061
|
+
readonly tamingEntity: Entity;
|
|
14062
|
+
}
|
|
14063
|
+
|
|
14064
|
+
/**
|
|
14065
|
+
* @beta
|
|
14066
|
+
* Manages callbacks that are connected to before an entity is
|
|
14067
|
+
* tamed.
|
|
14068
|
+
*/
|
|
14069
|
+
export class EntityTamedBeforeEventSignal {
|
|
14070
|
+
private constructor();
|
|
12618
14071
|
/**
|
|
12619
14072
|
* @remarks
|
|
12620
|
-
*
|
|
12621
|
-
* if entity is not tamed.
|
|
14073
|
+
* This function can't be called in restricted-execution mode.
|
|
12622
14074
|
*
|
|
12623
|
-
*
|
|
12624
|
-
*/
|
|
12625
|
-
readonly tamedToPlayer?: Player;
|
|
12626
|
-
/**
|
|
12627
|
-
* @remarks
|
|
12628
|
-
* Returns the id of player that has tamed the entity, or
|
|
12629
|
-
* 'undefined' if entity is not tamed.
|
|
14075
|
+
* This function can be called in early-execution mode.
|
|
12630
14076
|
*
|
|
12631
|
-
* @
|
|
14077
|
+
* @param callback
|
|
14078
|
+
* This closure is called with restricted-execution privilege.
|
|
14079
|
+
* @returns
|
|
14080
|
+
* Closure that is called with restricted-execution privilege.
|
|
12632
14081
|
*/
|
|
12633
|
-
|
|
12634
|
-
|
|
14082
|
+
subscribe(
|
|
14083
|
+
callback: (arg0: EntityTamedBeforeEvent) => void,
|
|
14084
|
+
options?: EntityTamedEventFilter,
|
|
14085
|
+
): (arg0: EntityTamedBeforeEvent) => void;
|
|
12635
14086
|
/**
|
|
12636
14087
|
* @remarks
|
|
12637
|
-
* Set this entity as tamed by the given player.
|
|
12638
|
-
*
|
|
12639
14088
|
* This function can't be called in restricted-execution mode.
|
|
12640
14089
|
*
|
|
12641
|
-
*
|
|
12642
|
-
*
|
|
12643
|
-
* @
|
|
12644
|
-
*
|
|
12645
|
-
* @throws This function can throw errors.
|
|
14090
|
+
* This function can be called in early-execution mode.
|
|
14091
|
+
*
|
|
14092
|
+
* @param callback
|
|
14093
|
+
* This closure is called with restricted-execution privilege.
|
|
12646
14094
|
*/
|
|
12647
|
-
|
|
14095
|
+
unsubscribe(callback: (arg0: EntityTamedBeforeEvent) => void): void;
|
|
12648
14096
|
}
|
|
12649
14097
|
|
|
12650
14098
|
/**
|
|
@@ -12759,7 +14207,7 @@ export class EntityTypes {
|
|
|
12759
14207
|
* Retrieves an entity type using a string-based identifier.
|
|
12760
14208
|
*
|
|
12761
14209
|
*/
|
|
12762
|
-
static get(identifier:
|
|
14210
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
12763
14211
|
/**
|
|
12764
14212
|
* @remarks
|
|
12765
14213
|
* Retrieves a set of all entity types within this world.
|
|
@@ -13167,6 +14615,138 @@ export class FluidContainer {
|
|
|
13167
14615
|
static readonly minFillLevel = 0;
|
|
13168
14616
|
}
|
|
13169
14617
|
|
|
14618
|
+
/**
|
|
14619
|
+
* @beta
|
|
14620
|
+
* Provides access to the fog definitions stack of a player
|
|
14621
|
+
* entity, allowing scripts to push, pop, remove, and query
|
|
14622
|
+
* active fog definitions.
|
|
14623
|
+
*/
|
|
14624
|
+
export class FogSettings {
|
|
14625
|
+
private constructor();
|
|
14626
|
+
/**
|
|
14627
|
+
* @remarks
|
|
14628
|
+
* Returns the list of fog identifiers currently on the
|
|
14629
|
+
* player's fog stack, ordered from bottom to top.
|
|
14630
|
+
*
|
|
14631
|
+
* This function can't be called in restricted-execution mode.
|
|
14632
|
+
*
|
|
14633
|
+
* @returns
|
|
14634
|
+
* An array of fog definition identifiers currently on the
|
|
14635
|
+
* stack.
|
|
14636
|
+
* @throws
|
|
14637
|
+
* Throws if the entity is invalid.
|
|
14638
|
+
*
|
|
14639
|
+
* {@link InvalidEntityError}
|
|
14640
|
+
*/
|
|
14641
|
+
getStack(): string[];
|
|
14642
|
+
/**
|
|
14643
|
+
* @remarks
|
|
14644
|
+
* Returns the list of tags currently present on the player's
|
|
14645
|
+
* fog stack.
|
|
14646
|
+
*
|
|
14647
|
+
* This function can't be called in restricted-execution mode.
|
|
14648
|
+
*
|
|
14649
|
+
* @returns
|
|
14650
|
+
* An array of tag strings associated with fog settings on the
|
|
14651
|
+
* stack.
|
|
14652
|
+
* @throws
|
|
14653
|
+
* Throws if the entity is invalid.
|
|
14654
|
+
*
|
|
14655
|
+
* {@link InvalidEntityError}
|
|
14656
|
+
*/
|
|
14657
|
+
getTags(): string[];
|
|
14658
|
+
/**
|
|
14659
|
+
* @remarks
|
|
14660
|
+
* Removes the most recently pushed fog definition from the
|
|
14661
|
+
* player's fog stack.
|
|
14662
|
+
*
|
|
14663
|
+
* This function can't be called in restricted-execution mode.
|
|
14664
|
+
*
|
|
14665
|
+
* @param tag
|
|
14666
|
+
* An optional tag identifying which entry to pop. If provided,
|
|
14667
|
+
* searches the stack from top to bottom and removes the most
|
|
14668
|
+
* recently pushed entry with this tag. If omitted, removes the
|
|
14669
|
+
* most recently pushed entry regardless of tag.
|
|
14670
|
+
* @returns
|
|
14671
|
+
* Returns the identifier of the popped fog definition, or
|
|
14672
|
+
* undefined if the stack was unchanged.
|
|
14673
|
+
* @throws
|
|
14674
|
+
* Throws if the entity is invalid.
|
|
14675
|
+
*
|
|
14676
|
+
* {@link InvalidEntityError}
|
|
14677
|
+
*/
|
|
14678
|
+
pop(tag?: string): string | undefined;
|
|
14679
|
+
/**
|
|
14680
|
+
* @remarks
|
|
14681
|
+
* Pushes a new fog definition onto the player's fog stack.
|
|
14682
|
+
*
|
|
14683
|
+
* This function can't be called in restricted-execution mode.
|
|
14684
|
+
*
|
|
14685
|
+
* @param fogId
|
|
14686
|
+
* The identifier of the fog definition to push onto the stack
|
|
14687
|
+
* (e.g. 'minecraft:fog_bamboo_jungle').
|
|
14688
|
+
* @param tag
|
|
14689
|
+
* An optional tag used to label this fog definition on the
|
|
14690
|
+
* stack, allowing it to be targeted by pop or remove. If
|
|
14691
|
+
* omitted, the entry is stored with the tag 'untagged'.
|
|
14692
|
+
* @returns
|
|
14693
|
+
* Returns the zero-based index at which the fog definition was
|
|
14694
|
+
* inserted into the stack.
|
|
14695
|
+
* @throws
|
|
14696
|
+
* Throws if the entity is invalid, the fog identifier is
|
|
14697
|
+
* invalid, or if the stack limit of 16 has been exceeded.
|
|
14698
|
+
*
|
|
14699
|
+
* {@link FogSettingsError}
|
|
14700
|
+
*
|
|
14701
|
+
* {@link InvalidEntityError}
|
|
14702
|
+
*/
|
|
14703
|
+
push(fogId: string, tag?: string): number;
|
|
14704
|
+
/**
|
|
14705
|
+
* @remarks
|
|
14706
|
+
* Removes all fog definitions with the given tag from the
|
|
14707
|
+
* player's fog stack. If no tag is provided, clears all fog
|
|
14708
|
+
* definitions.
|
|
14709
|
+
*
|
|
14710
|
+
* This function can't be called in restricted-execution mode.
|
|
14711
|
+
*
|
|
14712
|
+
* @param tag
|
|
14713
|
+
* An optional tag identifying which the entries to remove. If
|
|
14714
|
+
* omitted, clears all fog definitions regardless of tag.
|
|
14715
|
+
* @returns
|
|
14716
|
+
* Returns true if at least one entry was removed, or false if
|
|
14717
|
+
* the stack was unchanged.
|
|
14718
|
+
* @throws
|
|
14719
|
+
* Throws if the entity is invalid.
|
|
14720
|
+
*
|
|
14721
|
+
* {@link InvalidEntityError}
|
|
14722
|
+
*/
|
|
14723
|
+
remove(tag?: string): boolean;
|
|
14724
|
+
/**
|
|
14725
|
+
* @remarks
|
|
14726
|
+
* Sets the player's fog stack to the given list of fog
|
|
14727
|
+
* identifiers, replacing any existing entries.
|
|
14728
|
+
*
|
|
14729
|
+
* This function can't be called in restricted-execution mode.
|
|
14730
|
+
*
|
|
14731
|
+
* @param fogIds
|
|
14732
|
+
* A stack of fog definition identifiers to set on the player's
|
|
14733
|
+
* fog stack (e.g. ['minecraft:fog_bamboo_jungle']). Maximum of
|
|
14734
|
+
* 16 entries.
|
|
14735
|
+
* @param tag
|
|
14736
|
+
* An optional tag to associate with the new entries, used to
|
|
14737
|
+
* target them with pop or remove.
|
|
14738
|
+
* @throws
|
|
14739
|
+
* Throws if the entity is invalid, if more than 16 fog
|
|
14740
|
+
* identifiers are provided, or if any fog identifier is
|
|
14741
|
+
* invalid.
|
|
14742
|
+
*
|
|
14743
|
+
* {@link FogSettingsError}
|
|
14744
|
+
*
|
|
14745
|
+
* {@link InvalidEntityError}
|
|
14746
|
+
*/
|
|
14747
|
+
setStack(fogIds: string[], tag?: string): void;
|
|
14748
|
+
}
|
|
14749
|
+
|
|
13170
14750
|
/**
|
|
13171
14751
|
* Contains information regarding a changed world.gameRules
|
|
13172
14752
|
* property.
|
|
@@ -13356,6 +14936,13 @@ export class GameRules {
|
|
|
13356
14936
|
*
|
|
13357
14937
|
*/
|
|
13358
14938
|
playersSleepingPercentage: number;
|
|
14939
|
+
/**
|
|
14940
|
+
* @beta
|
|
14941
|
+
* @remarks
|
|
14942
|
+
* This property can't be edited in restricted-execution mode.
|
|
14943
|
+
*
|
|
14944
|
+
*/
|
|
14945
|
+
playerWaypoints: PlayerWaypointsMode;
|
|
13359
14946
|
/**
|
|
13360
14947
|
* @remarks
|
|
13361
14948
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -13503,6 +15090,42 @@ export class ISerializable {
|
|
|
13503
15090
|
private constructor();
|
|
13504
15091
|
}
|
|
13505
15092
|
|
|
15093
|
+
/**
|
|
15094
|
+
* @beta
|
|
15095
|
+
* Represents the dynamic properties of a block. Only available
|
|
15096
|
+
* from block entities. Up to 1KBytes of data can be stored per
|
|
15097
|
+
* block entity in their dynamic properties storage.
|
|
15098
|
+
*/
|
|
15099
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15100
|
+
export class ItemBlockDynamicPropertiesComponent extends ItemComponent {
|
|
15101
|
+
private constructor();
|
|
15102
|
+
static readonly componentId = 'minecraft:block_actor_dynamic_properties';
|
|
15103
|
+
/**
|
|
15104
|
+
* @remarks
|
|
15105
|
+
* Returns a DynamicProperty that was stored with the provided
|
|
15106
|
+
* key. Keys are unique to each content pack and cannot be used
|
|
15107
|
+
* to retrieve dynamic properties set from other content packs.
|
|
15108
|
+
* Returns undefined if the key was not found.
|
|
15109
|
+
*
|
|
15110
|
+
* @throws This function can throw errors.
|
|
15111
|
+
*
|
|
15112
|
+
* {@link Error}
|
|
15113
|
+
*
|
|
15114
|
+
* {@link InvalidItemStackError}
|
|
15115
|
+
*/
|
|
15116
|
+
get(key: string): boolean | number | string | Vector3 | undefined;
|
|
15117
|
+
/**
|
|
15118
|
+
* @remarks
|
|
15119
|
+
* Returns the current size, in bytes, of the dynamic
|
|
15120
|
+
* properties storage for this block.
|
|
15121
|
+
*
|
|
15122
|
+
* @throws This function can throw errors.
|
|
15123
|
+
*
|
|
15124
|
+
* {@link InvalidItemStackError}
|
|
15125
|
+
*/
|
|
15126
|
+
totalByteCount(): number;
|
|
15127
|
+
}
|
|
15128
|
+
|
|
13506
15129
|
/**
|
|
13507
15130
|
* When present on an item, this item is a book item. Can
|
|
13508
15131
|
* access and modify the contents of the book and sign it.
|
|
@@ -15859,6 +17482,10 @@ export class LootingEnchantFunction extends LootItemFunction {
|
|
|
15859
17482
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15860
17483
|
export class LootItem extends LootPoolEntry {
|
|
15861
17484
|
private constructor();
|
|
17485
|
+
/**
|
|
17486
|
+
* @beta
|
|
17487
|
+
*/
|
|
17488
|
+
readonly conditions: LootItemCondition[];
|
|
15862
17489
|
readonly functions: LootItemFunction[];
|
|
15863
17490
|
/**
|
|
15864
17491
|
* @remarks
|
|
@@ -16214,6 +17841,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
16214
17841
|
readonly itemTagsNone: string[];
|
|
16215
17842
|
}
|
|
16216
17843
|
|
|
17844
|
+
/**
|
|
17845
|
+
* @beta
|
|
17846
|
+
* A specific currently-internal event used for passing
|
|
17847
|
+
* messages from client to server.
|
|
17848
|
+
*/
|
|
17849
|
+
export class MessageReceiveAfterEvent {
|
|
17850
|
+
private constructor();
|
|
17851
|
+
/**
|
|
17852
|
+
* @remarks
|
|
17853
|
+
* The message identifier.
|
|
17854
|
+
*
|
|
17855
|
+
*/
|
|
17856
|
+
readonly id: string;
|
|
17857
|
+
/**
|
|
17858
|
+
* @remarks
|
|
17859
|
+
* The message.
|
|
17860
|
+
*
|
|
17861
|
+
*/
|
|
17862
|
+
readonly message: string;
|
|
17863
|
+
/**
|
|
17864
|
+
* @remarks
|
|
17865
|
+
* The player who sent the message.
|
|
17866
|
+
*
|
|
17867
|
+
*/
|
|
17868
|
+
readonly player: Player;
|
|
17869
|
+
}
|
|
17870
|
+
|
|
16217
17871
|
/**
|
|
16218
17872
|
* Contains a set of additional variable values for further
|
|
16219
17873
|
* defining how rendering and animations function.
|
|
@@ -16282,6 +17936,49 @@ export class MolangVariableMap {
|
|
|
16282
17936
|
setVector3(variableName: string, vector: Vector3): void;
|
|
16283
17937
|
}
|
|
16284
17938
|
|
|
17939
|
+
/**
|
|
17940
|
+
* @beta
|
|
17941
|
+
* Pack setting name and value that changed.
|
|
17942
|
+
*/
|
|
17943
|
+
export class PackSettingChangeAfterEvent {
|
|
17944
|
+
private constructor();
|
|
17945
|
+
/**
|
|
17946
|
+
* @remarks
|
|
17947
|
+
* The name of the setting.
|
|
17948
|
+
*
|
|
17949
|
+
*/
|
|
17950
|
+
readonly settingName: string;
|
|
17951
|
+
/**
|
|
17952
|
+
* @remarks
|
|
17953
|
+
* The value of the setting.
|
|
17954
|
+
*
|
|
17955
|
+
*/
|
|
17956
|
+
readonly settingValue: boolean | number | string;
|
|
17957
|
+
}
|
|
17958
|
+
|
|
17959
|
+
/**
|
|
17960
|
+
* @beta
|
|
17961
|
+
*/
|
|
17962
|
+
export class PackSettingChangeAfterEventSignal {
|
|
17963
|
+
private constructor();
|
|
17964
|
+
/**
|
|
17965
|
+
* @remarks
|
|
17966
|
+
* This function can't be called in restricted-execution mode.
|
|
17967
|
+
*
|
|
17968
|
+
* This function can be called in early-execution mode.
|
|
17969
|
+
*
|
|
17970
|
+
*/
|
|
17971
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
17972
|
+
/**
|
|
17973
|
+
* @remarks
|
|
17974
|
+
* This function can't be called in restricted-execution mode.
|
|
17975
|
+
*
|
|
17976
|
+
* This function can be called in early-execution mode.
|
|
17977
|
+
*
|
|
17978
|
+
*/
|
|
17979
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
17980
|
+
}
|
|
17981
|
+
|
|
16285
17982
|
/**
|
|
16286
17983
|
* Loot item condition that checks whether the looting entity
|
|
16287
17984
|
* is currently a passenger of a specific type of entity.
|
|
@@ -16430,25 +18127,81 @@ export class PistonActivateAfterEventSignal {
|
|
|
16430
18127
|
*
|
|
16431
18128
|
* This function can't be called in restricted-execution mode.
|
|
16432
18129
|
*
|
|
16433
|
-
* This function can be called in early-execution mode.
|
|
18130
|
+
* This function can be called in early-execution mode.
|
|
18131
|
+
*
|
|
18132
|
+
*/
|
|
18133
|
+
unsubscribe(callback: (arg0: PistonActivateAfterEvent) => void): void;
|
|
18134
|
+
}
|
|
18135
|
+
|
|
18136
|
+
/**
|
|
18137
|
+
* Represents a player within the world.
|
|
18138
|
+
*/
|
|
18139
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18140
|
+
export class Player extends Entity {
|
|
18141
|
+
private constructor();
|
|
18142
|
+
/**
|
|
18143
|
+
* @remarks
|
|
18144
|
+
* The player's Camera.
|
|
18145
|
+
*
|
|
18146
|
+
* @throws This property can throw when used.
|
|
18147
|
+
*/
|
|
18148
|
+
readonly camera: Camera;
|
|
18149
|
+
/**
|
|
18150
|
+
* @beta
|
|
18151
|
+
* @remarks
|
|
18152
|
+
* The player's chat display name, composed from {@link
|
|
18153
|
+
* Player.chatNamePrefix} + {@link Player.name} + {@link
|
|
18154
|
+
* Player.chatNameSuffix}. This is the name shown as the author
|
|
18155
|
+
* of chat messages sent by this player. To change the name
|
|
18156
|
+
* shown above the player's head, use {@link Entity.nameTag}.
|
|
18157
|
+
*
|
|
18158
|
+
* @throws This property can throw when used.
|
|
18159
|
+
*
|
|
18160
|
+
* {@link InvalidEntityError}
|
|
18161
|
+
*/
|
|
18162
|
+
readonly chatDisplayName: string;
|
|
18163
|
+
/**
|
|
18164
|
+
* @beta
|
|
18165
|
+
* @remarks
|
|
18166
|
+
* An optional string that, when set, is prepended to the text
|
|
18167
|
+
* of chat messages sent by this player. Useful for applying
|
|
18168
|
+
* formatting or color codes to a player's messages (e.g., '§a'
|
|
18169
|
+
* to make their messages green). Does not affect the player's
|
|
18170
|
+
* name display - use {@link Player.chatNamePrefix} for the
|
|
18171
|
+
* name shown in chat, or {@link Entity.nameTag} for the name
|
|
18172
|
+
* above the player's head. Set to undefined to clear.
|
|
18173
|
+
*
|
|
18174
|
+
* This property can't be edited in restricted-execution mode.
|
|
18175
|
+
*
|
|
18176
|
+
*/
|
|
18177
|
+
chatMessagePrefix?: string;
|
|
18178
|
+
/**
|
|
18179
|
+
* @beta
|
|
18180
|
+
* @remarks
|
|
18181
|
+
* An optional string that, when set, is prepended to the
|
|
18182
|
+
* player's name in chat messages. Does not affect the name tag
|
|
18183
|
+
* above the player's head or the player list - use {@link
|
|
18184
|
+
* Entity.nameTag} for that. To prefix the message text itself,
|
|
18185
|
+
* use {@link Player.chatMessagePrefix}. Set to undefined to
|
|
18186
|
+
* clear.
|
|
18187
|
+
*
|
|
18188
|
+
* This property can't be edited in restricted-execution mode.
|
|
16434
18189
|
*
|
|
16435
18190
|
*/
|
|
16436
|
-
|
|
16437
|
-
}
|
|
16438
|
-
|
|
16439
|
-
/**
|
|
16440
|
-
* Represents a player within the world.
|
|
16441
|
-
*/
|
|
16442
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
16443
|
-
export class Player extends Entity {
|
|
16444
|
-
private constructor();
|
|
18191
|
+
chatNamePrefix?: string;
|
|
16445
18192
|
/**
|
|
18193
|
+
* @beta
|
|
16446
18194
|
* @remarks
|
|
16447
|
-
*
|
|
18195
|
+
* An optional string that, when set, is appended to the
|
|
18196
|
+
* player's name in chat messages. Does not affect the name tag
|
|
18197
|
+
* above the player's head or the player list - use {@link
|
|
18198
|
+
* Entity.nameTag} for that. See also {@link
|
|
18199
|
+
* Player.chatNamePrefix}. Set to undefined to clear.
|
|
18200
|
+
*
|
|
18201
|
+
* This property can't be edited in restricted-execution mode.
|
|
16448
18202
|
*
|
|
16449
|
-
* @throws This property can throw when used.
|
|
16450
18203
|
*/
|
|
16451
|
-
|
|
18204
|
+
chatNameSuffix?: string;
|
|
16452
18205
|
/**
|
|
16453
18206
|
* @remarks
|
|
16454
18207
|
* Contains the player's device information.
|
|
@@ -16462,6 +18215,14 @@ export class Player extends Entity {
|
|
|
16462
18215
|
*
|
|
16463
18216
|
*/
|
|
16464
18217
|
commandPermissionLevel: CommandPermissionLevel;
|
|
18218
|
+
/**
|
|
18219
|
+
* @beta
|
|
18220
|
+
* @remarks
|
|
18221
|
+
* Contains methods for manipulating the render distance fog
|
|
18222
|
+
* settings of a Player.
|
|
18223
|
+
*
|
|
18224
|
+
*/
|
|
18225
|
+
readonly fogSettings: FogSettings;
|
|
16465
18226
|
/**
|
|
16466
18227
|
* @remarks
|
|
16467
18228
|
* Gets the current graphics mode of the player's client. This
|
|
@@ -16546,6 +18307,19 @@ export class Player extends Entity {
|
|
|
16546
18307
|
* @throws This property can throw when used.
|
|
16547
18308
|
*/
|
|
16548
18309
|
readonly onScreenDisplay: ScreenDisplay;
|
|
18310
|
+
/**
|
|
18311
|
+
* @beta
|
|
18312
|
+
* @remarks
|
|
18313
|
+
* An identifier that can be used to identify a player across
|
|
18314
|
+
* sessions.
|
|
18315
|
+
*
|
|
18316
|
+
* @throws This property can throw when used.
|
|
18317
|
+
*
|
|
18318
|
+
* {@link minecraftcommon.EngineError}
|
|
18319
|
+
*
|
|
18320
|
+
* {@link InvalidEntityError}
|
|
18321
|
+
*/
|
|
18322
|
+
readonly persistentId: string;
|
|
16549
18323
|
/**
|
|
16550
18324
|
* @throws This property can throw when used.
|
|
16551
18325
|
*
|
|
@@ -16619,6 +18393,20 @@ export class Player extends Entity {
|
|
|
16619
18393
|
* Throws if the Entity or Entity ID is invalid.
|
|
16620
18394
|
*/
|
|
16621
18395
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
18396
|
+
/**
|
|
18397
|
+
* @beta
|
|
18398
|
+
* @remarks
|
|
18399
|
+
* Eats an item, providing the item's hunger and saturation
|
|
18400
|
+
* effects to the player. Can only be used on food items.
|
|
18401
|
+
*
|
|
18402
|
+
* This function can't be called in restricted-execution mode.
|
|
18403
|
+
*
|
|
18404
|
+
* @param itemStack
|
|
18405
|
+
* The item to eat.
|
|
18406
|
+
* @throws
|
|
18407
|
+
* Throws if the item is not a food item.
|
|
18408
|
+
*/
|
|
18409
|
+
eatItem(itemStack: ItemStack): void;
|
|
16622
18410
|
/**
|
|
16623
18411
|
* @remarks
|
|
16624
18412
|
* The player's aim-assist settings.
|
|
@@ -16652,6 +18440,20 @@ export class Player extends Entity {
|
|
|
16652
18440
|
* @throws This function can throw errors.
|
|
16653
18441
|
*/
|
|
16654
18442
|
getItemCooldown(cooldownCategory: string): number;
|
|
18443
|
+
/**
|
|
18444
|
+
* @beta
|
|
18445
|
+
* @remarks
|
|
18446
|
+
* Gets the player's ping in milliseconds.
|
|
18447
|
+
*
|
|
18448
|
+
* @returns
|
|
18449
|
+
* The player's ping in milliseconds.
|
|
18450
|
+
* @throws This function can throw errors.
|
|
18451
|
+
*
|
|
18452
|
+
* {@link minecraftcommon.EngineError}
|
|
18453
|
+
*
|
|
18454
|
+
* {@link InvalidEntityError}
|
|
18455
|
+
*/
|
|
18456
|
+
getPing(): number;
|
|
16655
18457
|
/**
|
|
16656
18458
|
* @remarks
|
|
16657
18459
|
* Gets the current spawn point of the player.
|
|
@@ -16659,6 +18461,21 @@ export class Player extends Entity {
|
|
|
16659
18461
|
* @throws This function can throw errors.
|
|
16660
18462
|
*/
|
|
16661
18463
|
getSpawnPoint(): DimensionLocation | undefined;
|
|
18464
|
+
/**
|
|
18465
|
+
* @beta
|
|
18466
|
+
* @remarks
|
|
18467
|
+
* Returns the split screen slot of the player.
|
|
18468
|
+
*
|
|
18469
|
+
* @returns
|
|
18470
|
+
* The split screen slot of the player or undefined if the
|
|
18471
|
+
* player is not in a split screen session.
|
|
18472
|
+
* @throws This function can throw errors.
|
|
18473
|
+
*
|
|
18474
|
+
* {@link minecraftcommon.EngineError}
|
|
18475
|
+
*
|
|
18476
|
+
* {@link InvalidEntityError}
|
|
18477
|
+
*/
|
|
18478
|
+
getSplitScreenSlot(): PlayerSplitScreenSlot | undefined;
|
|
16662
18479
|
/**
|
|
16663
18480
|
* @remarks
|
|
16664
18481
|
* Gets the total experience of the Player.
|
|
@@ -16723,6 +18540,17 @@ export class Player extends Entity {
|
|
|
16723
18540
|
* ```
|
|
16724
18541
|
*/
|
|
16725
18542
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): SoundInstance;
|
|
18543
|
+
/**
|
|
18544
|
+
* @beta
|
|
18545
|
+
* @remarks
|
|
18546
|
+
* This is an internal-facing method for posting a system
|
|
18547
|
+
* message to downstream clients.
|
|
18548
|
+
*
|
|
18549
|
+
* This function can't be called in restricted-execution mode.
|
|
18550
|
+
*
|
|
18551
|
+
* @throws This function can throw errors.
|
|
18552
|
+
*/
|
|
18553
|
+
postClientMessage(id: string, value: string): void;
|
|
16726
18554
|
/**
|
|
16727
18555
|
* @remarks
|
|
16728
18556
|
* Queues an additional music track that only this particular
|
|
@@ -16998,6 +18826,18 @@ export class Player extends Entity {
|
|
|
16998
18826
|
* @throws This function can throw errors.
|
|
16999
18827
|
*/
|
|
17000
18828
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
18829
|
+
/**
|
|
18830
|
+
* @beta
|
|
18831
|
+
* @remarks
|
|
18832
|
+
* Stops all sounds from playing for this particular player.
|
|
18833
|
+
*
|
|
18834
|
+
* This function can't be called in restricted-execution mode.
|
|
18835
|
+
*
|
|
18836
|
+
* @throws This function can throw errors.
|
|
18837
|
+
*
|
|
18838
|
+
* {@link InvalidEntityError}
|
|
18839
|
+
*/
|
|
18840
|
+
stopAllSounds(): void;
|
|
17001
18841
|
/**
|
|
17002
18842
|
* @remarks
|
|
17003
18843
|
* Stops any music tracks from playing for this particular
|
|
@@ -17008,6 +18848,20 @@ export class Player extends Entity {
|
|
|
17008
18848
|
* @throws This function can throw errors.
|
|
17009
18849
|
*/
|
|
17010
18850
|
stopMusic(): void;
|
|
18851
|
+
/**
|
|
18852
|
+
* @beta
|
|
18853
|
+
* @remarks
|
|
18854
|
+
* Stops a sound from playing for this particular player.
|
|
18855
|
+
*
|
|
18856
|
+
* This function can't be called in restricted-execution mode.
|
|
18857
|
+
*
|
|
18858
|
+
* @param soundId
|
|
18859
|
+
* Identifier of the sound.
|
|
18860
|
+
* @throws This function can throw errors.
|
|
18861
|
+
*
|
|
18862
|
+
* {@link InvalidEntityError}
|
|
18863
|
+
*/
|
|
18864
|
+
stopSound(soundId: string): void;
|
|
17011
18865
|
}
|
|
17012
18866
|
|
|
17013
18867
|
/**
|
|
@@ -17241,6 +19095,83 @@ export class PlayerButtonInputAfterEventSignal {
|
|
|
17241
19095
|
unsubscribe(callback: (arg0: PlayerButtonInputAfterEvent) => void): void;
|
|
17242
19096
|
}
|
|
17243
19097
|
|
|
19098
|
+
/**
|
|
19099
|
+
* @beta
|
|
19100
|
+
* Contains information regarding an event after a player
|
|
19101
|
+
* cancels breaking a block.
|
|
19102
|
+
*/
|
|
19103
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19104
|
+
export class PlayerCancelBreakingBlockAfterEvent extends BlockEvent {
|
|
19105
|
+
private constructor();
|
|
19106
|
+
/**
|
|
19107
|
+
* @remarks
|
|
19108
|
+
* The permutation of the block that the player cancelled
|
|
19109
|
+
* breaking.
|
|
19110
|
+
*
|
|
19111
|
+
*/
|
|
19112
|
+
readonly blockPermutation: BlockPermutation;
|
|
19113
|
+
/**
|
|
19114
|
+
* @remarks
|
|
19115
|
+
* The progress of breaking the block when the player cancelled
|
|
19116
|
+
* in the exclusive range (0, 1).
|
|
19117
|
+
*
|
|
19118
|
+
*/
|
|
19119
|
+
readonly breakProgress: number;
|
|
19120
|
+
/**
|
|
19121
|
+
* @remarks
|
|
19122
|
+
* The face of the block that was being broken.
|
|
19123
|
+
*
|
|
19124
|
+
*/
|
|
19125
|
+
readonly face: Direction;
|
|
19126
|
+
/**
|
|
19127
|
+
* @remarks
|
|
19128
|
+
* The item stack that the player was using to break the block,
|
|
19129
|
+
* or undefined if empty hand.
|
|
19130
|
+
*
|
|
19131
|
+
*/
|
|
19132
|
+
readonly heldItemStack?: ItemStack;
|
|
19133
|
+
/**
|
|
19134
|
+
* @remarks
|
|
19135
|
+
* Player that cancelled breaking the block for this event.
|
|
19136
|
+
*
|
|
19137
|
+
*/
|
|
19138
|
+
readonly player: Player;
|
|
19139
|
+
}
|
|
19140
|
+
|
|
19141
|
+
/**
|
|
19142
|
+
* @beta
|
|
19143
|
+
* Manages callbacks that are connected to when a player
|
|
19144
|
+
* cancels breaking a block.
|
|
19145
|
+
*/
|
|
19146
|
+
export class PlayerCancelBreakingBlockAfterEventSignal {
|
|
19147
|
+
private constructor();
|
|
19148
|
+
/**
|
|
19149
|
+
* @remarks
|
|
19150
|
+
* Adds a callback that will be called when a player cancels
|
|
19151
|
+
* breaking a block.
|
|
19152
|
+
*
|
|
19153
|
+
* This function can't be called in restricted-execution mode.
|
|
19154
|
+
*
|
|
19155
|
+
* This function can be called in early-execution mode.
|
|
19156
|
+
*
|
|
19157
|
+
*/
|
|
19158
|
+
subscribe(
|
|
19159
|
+
callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void,
|
|
19160
|
+
options?: PlayerBreakingBlockEventOptions,
|
|
19161
|
+
): (arg0: PlayerCancelBreakingBlockAfterEvent) => void;
|
|
19162
|
+
/**
|
|
19163
|
+
* @remarks
|
|
19164
|
+
* Removes a callback from being called when a player cancels
|
|
19165
|
+
* breaking a block.
|
|
19166
|
+
*
|
|
19167
|
+
* This function can't be called in restricted-execution mode.
|
|
19168
|
+
*
|
|
19169
|
+
* This function can be called in early-execution mode.
|
|
19170
|
+
*
|
|
19171
|
+
*/
|
|
19172
|
+
unsubscribe(callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void): void;
|
|
19173
|
+
}
|
|
19174
|
+
|
|
17244
19175
|
/**
|
|
17245
19176
|
* Represents the players cursor inventory. Used when moving
|
|
17246
19177
|
* items between between containers in the inventory UI. Not
|
|
@@ -18292,58 +20223,210 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
18292
20223
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
18293
20224
|
}
|
|
18294
20225
|
|
|
20226
|
+
/**
|
|
20227
|
+
* @beta
|
|
20228
|
+
* Contains information regarding an event before a player
|
|
20229
|
+
* places a block.
|
|
20230
|
+
*/
|
|
20231
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20232
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
20233
|
+
private constructor();
|
|
20234
|
+
/**
|
|
20235
|
+
* @remarks
|
|
20236
|
+
* If set to true, cancels the block place event.
|
|
20237
|
+
*
|
|
20238
|
+
*/
|
|
20239
|
+
cancel: boolean;
|
|
20240
|
+
/**
|
|
20241
|
+
* @remarks
|
|
20242
|
+
* The face of the block that the new block is being placed on.
|
|
20243
|
+
*
|
|
20244
|
+
*/
|
|
20245
|
+
readonly face: Direction;
|
|
20246
|
+
/**
|
|
20247
|
+
* @remarks
|
|
20248
|
+
* Location relative to the bottom north-west corner of the
|
|
20249
|
+
* block where the new block is being placed onto.
|
|
20250
|
+
*
|
|
20251
|
+
*/
|
|
20252
|
+
readonly faceLocation: Vector3;
|
|
20253
|
+
/**
|
|
20254
|
+
* @remarks
|
|
20255
|
+
* The block permutation that will be placed if the event is
|
|
20256
|
+
* not cancelled.
|
|
20257
|
+
*
|
|
20258
|
+
*/
|
|
20259
|
+
readonly permutationToPlace: BlockPermutation;
|
|
20260
|
+
/**
|
|
20261
|
+
* @remarks
|
|
20262
|
+
* Player that is placing the block for this event.
|
|
20263
|
+
*
|
|
20264
|
+
*/
|
|
20265
|
+
readonly player: Player;
|
|
20266
|
+
}
|
|
20267
|
+
|
|
20268
|
+
/**
|
|
20269
|
+
* @beta
|
|
20270
|
+
* Manages callbacks that are connected to before a block is
|
|
20271
|
+
* placed by a player.
|
|
20272
|
+
*/
|
|
20273
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
20274
|
+
private constructor();
|
|
20275
|
+
/**
|
|
20276
|
+
* @remarks
|
|
20277
|
+
* Adds a callback that will be called before a block is placed
|
|
20278
|
+
* by a player.
|
|
20279
|
+
*
|
|
20280
|
+
* This function can't be called in restricted-execution mode.
|
|
20281
|
+
*
|
|
20282
|
+
* This function can be called in early-execution mode.
|
|
20283
|
+
*
|
|
20284
|
+
* @param callback
|
|
20285
|
+
* This closure is called with restricted-execution privilege.
|
|
20286
|
+
* @returns
|
|
20287
|
+
* Closure that is called with restricted-execution privilege.
|
|
20288
|
+
*/
|
|
20289
|
+
subscribe(
|
|
20290
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
20291
|
+
options?: BlockEventOptions,
|
|
20292
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
20293
|
+
/**
|
|
20294
|
+
* @remarks
|
|
20295
|
+
* Removes a callback from being called before an block is
|
|
20296
|
+
* placed by a player.
|
|
20297
|
+
*
|
|
20298
|
+
* This function can't be called in restricted-execution mode.
|
|
20299
|
+
*
|
|
20300
|
+
* This function can be called in early-execution mode.
|
|
20301
|
+
*
|
|
20302
|
+
* @param callback
|
|
20303
|
+
* This closure is called with restricted-execution privilege.
|
|
20304
|
+
*/
|
|
20305
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
20306
|
+
}
|
|
20307
|
+
|
|
18295
20308
|
/**
|
|
18296
20309
|
* An event that contains more information about a player
|
|
18297
20310
|
* spawning.
|
|
18298
20311
|
*/
|
|
18299
|
-
export class PlayerSpawnAfterEvent {
|
|
20312
|
+
export class PlayerSpawnAfterEvent {
|
|
20313
|
+
private constructor();
|
|
20314
|
+
/**
|
|
20315
|
+
* @remarks
|
|
20316
|
+
* If true, this is the initial spawn of a player after joining
|
|
20317
|
+
* the game.
|
|
20318
|
+
*
|
|
20319
|
+
* This property can't be edited in restricted-execution mode.
|
|
20320
|
+
*
|
|
20321
|
+
*/
|
|
20322
|
+
initialSpawn: boolean;
|
|
20323
|
+
/**
|
|
20324
|
+
* @remarks
|
|
20325
|
+
* Object that represents the player that joined the game.
|
|
20326
|
+
*
|
|
20327
|
+
* This property can't be edited in restricted-execution mode.
|
|
20328
|
+
*
|
|
20329
|
+
*/
|
|
20330
|
+
player: Player;
|
|
20331
|
+
}
|
|
20332
|
+
|
|
20333
|
+
/**
|
|
20334
|
+
* Registers an event when a player is spawned (or re-spawned
|
|
20335
|
+
* after death) and fully ready within the world.
|
|
20336
|
+
*/
|
|
20337
|
+
export class PlayerSpawnAfterEventSignal {
|
|
20338
|
+
private constructor();
|
|
20339
|
+
/**
|
|
20340
|
+
* @remarks
|
|
20341
|
+
* Registers a new event receiver for this particular type of
|
|
20342
|
+
* event.
|
|
20343
|
+
*
|
|
20344
|
+
* This function can't be called in restricted-execution mode.
|
|
20345
|
+
*
|
|
20346
|
+
* This function can be called in early-execution mode.
|
|
20347
|
+
*
|
|
20348
|
+
*/
|
|
20349
|
+
subscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): (arg0: PlayerSpawnAfterEvent) => void;
|
|
20350
|
+
/**
|
|
20351
|
+
* @remarks
|
|
20352
|
+
* De-registers an event receiver for the player spawn event.
|
|
20353
|
+
*
|
|
20354
|
+
* This function can't be called in restricted-execution mode.
|
|
20355
|
+
*
|
|
20356
|
+
* This function can be called in early-execution mode.
|
|
20357
|
+
*
|
|
20358
|
+
*/
|
|
20359
|
+
unsubscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): void;
|
|
20360
|
+
}
|
|
20361
|
+
|
|
20362
|
+
/**
|
|
20363
|
+
* @beta
|
|
20364
|
+
* Contains information regarding an event after a player
|
|
20365
|
+
* starts breaking a block.
|
|
20366
|
+
*/
|
|
20367
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20368
|
+
export class PlayerStartBreakingBlockAfterEvent extends BlockEvent {
|
|
18300
20369
|
private constructor();
|
|
18301
20370
|
/**
|
|
18302
20371
|
* @remarks
|
|
18303
|
-
*
|
|
18304
|
-
*
|
|
20372
|
+
* The permutation of the block that the player is starting to
|
|
20373
|
+
* break.
|
|
18305
20374
|
*
|
|
18306
|
-
|
|
20375
|
+
*/
|
|
20376
|
+
readonly blockPermutation: BlockPermutation;
|
|
20377
|
+
/**
|
|
20378
|
+
* @remarks
|
|
20379
|
+
* The face of the block being broken.
|
|
18307
20380
|
*
|
|
18308
20381
|
*/
|
|
18309
|
-
|
|
20382
|
+
readonly face: Direction;
|
|
18310
20383
|
/**
|
|
18311
20384
|
* @remarks
|
|
18312
|
-
*
|
|
20385
|
+
* The item stack that the player is using to break the block,
|
|
20386
|
+
* or undefined if empty hand.
|
|
18313
20387
|
*
|
|
18314
|
-
|
|
20388
|
+
*/
|
|
20389
|
+
readonly heldItemStack?: ItemStack;
|
|
20390
|
+
/**
|
|
20391
|
+
* @remarks
|
|
20392
|
+
* Player that started breaking the block for this event.
|
|
18315
20393
|
*
|
|
18316
20394
|
*/
|
|
18317
|
-
player: Player;
|
|
20395
|
+
readonly player: Player;
|
|
18318
20396
|
}
|
|
18319
20397
|
|
|
18320
20398
|
/**
|
|
18321
|
-
*
|
|
18322
|
-
*
|
|
20399
|
+
* @beta
|
|
20400
|
+
* Manages callbacks that are connected to when a player starts
|
|
20401
|
+
* breaking a block.
|
|
18323
20402
|
*/
|
|
18324
|
-
export class
|
|
20403
|
+
export class PlayerStartBreakingBlockAfterEventSignal {
|
|
18325
20404
|
private constructor();
|
|
18326
20405
|
/**
|
|
18327
20406
|
* @remarks
|
|
18328
|
-
*
|
|
18329
|
-
*
|
|
20407
|
+
* Adds a callback that will be called when a player starts
|
|
20408
|
+
* breaking a block.
|
|
18330
20409
|
*
|
|
18331
20410
|
* This function can't be called in restricted-execution mode.
|
|
18332
20411
|
*
|
|
18333
20412
|
* This function can be called in early-execution mode.
|
|
18334
20413
|
*
|
|
18335
20414
|
*/
|
|
18336
|
-
subscribe(
|
|
20415
|
+
subscribe(
|
|
20416
|
+
callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void,
|
|
20417
|
+
options?: PlayerBreakingBlockEventOptions,
|
|
20418
|
+
): (arg0: PlayerStartBreakingBlockAfterEvent) => void;
|
|
18337
20419
|
/**
|
|
18338
20420
|
* @remarks
|
|
18339
|
-
*
|
|
20421
|
+
* Removes a callback from being called when a player starts
|
|
20422
|
+
* breaking a block.
|
|
18340
20423
|
*
|
|
18341
20424
|
* This function can't be called in restricted-execution mode.
|
|
18342
20425
|
*
|
|
18343
20426
|
* This function can be called in early-execution mode.
|
|
18344
20427
|
*
|
|
18345
20428
|
*/
|
|
18346
|
-
unsubscribe(callback: (arg0:
|
|
20429
|
+
unsubscribe(callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void): void;
|
|
18347
20430
|
}
|
|
18348
20431
|
|
|
18349
20432
|
/**
|
|
@@ -18410,6 +20493,80 @@ export class PlayerSwingStartAfterEventSignal {
|
|
|
18410
20493
|
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
18411
20494
|
}
|
|
18412
20495
|
|
|
20496
|
+
/**
|
|
20497
|
+
* @beta
|
|
20498
|
+
* Contains information related to when a player successfully
|
|
20499
|
+
* names an Entity with a named Name Tag item.
|
|
20500
|
+
*/
|
|
20501
|
+
export class PlayerUseNameTagAfterEvent {
|
|
20502
|
+
private constructor();
|
|
20503
|
+
/**
|
|
20504
|
+
* @remarks
|
|
20505
|
+
* The entity that was named by the player.
|
|
20506
|
+
*
|
|
20507
|
+
* This property can't be edited in restricted-execution mode.
|
|
20508
|
+
*
|
|
20509
|
+
*/
|
|
20510
|
+
entityNamed: Entity;
|
|
20511
|
+
/**
|
|
20512
|
+
* @remarks
|
|
20513
|
+
* The new name that the player has given to the entity.
|
|
20514
|
+
*
|
|
20515
|
+
* This property can't be edited in restricted-execution mode.
|
|
20516
|
+
*
|
|
20517
|
+
*/
|
|
20518
|
+
newName: string;
|
|
20519
|
+
/**
|
|
20520
|
+
* @remarks
|
|
20521
|
+
* Handle to the player that used the name tag.
|
|
20522
|
+
*
|
|
20523
|
+
* This property can't be edited in restricted-execution mode.
|
|
20524
|
+
*
|
|
20525
|
+
*/
|
|
20526
|
+
player: Player;
|
|
20527
|
+
/**
|
|
20528
|
+
* @remarks
|
|
20529
|
+
* The previous name of the entity before the player used the
|
|
20530
|
+
* name tag. This will be undefined if the entity was not
|
|
20531
|
+
* previously named.
|
|
20532
|
+
*
|
|
20533
|
+
* This property can't be edited in restricted-execution mode.
|
|
20534
|
+
*
|
|
20535
|
+
*/
|
|
20536
|
+
previousName?: string;
|
|
20537
|
+
}
|
|
20538
|
+
|
|
20539
|
+
/**
|
|
20540
|
+
* @beta
|
|
20541
|
+
* Manages callbacks that are connected to when a player
|
|
20542
|
+
* successfully names an Entity with a named Name Tag item.
|
|
20543
|
+
*/
|
|
20544
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
20545
|
+
private constructor();
|
|
20546
|
+
/**
|
|
20547
|
+
* @remarks
|
|
20548
|
+
* Subscribes the specified callback to a player use name tag
|
|
20549
|
+
* after event.
|
|
20550
|
+
*
|
|
20551
|
+
* This function can't be called in restricted-execution mode.
|
|
20552
|
+
*
|
|
20553
|
+
* This function can be called in early-execution mode.
|
|
20554
|
+
*
|
|
20555
|
+
*/
|
|
20556
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
20557
|
+
/**
|
|
20558
|
+
* @remarks
|
|
20559
|
+
* Removes the specified callback from a player use name tag
|
|
20560
|
+
* after event.
|
|
20561
|
+
*
|
|
20562
|
+
* This function can't be called in restricted-execution mode.
|
|
20563
|
+
*
|
|
20564
|
+
* This function can be called in early-execution mode.
|
|
20565
|
+
*
|
|
20566
|
+
*/
|
|
20567
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
20568
|
+
}
|
|
20569
|
+
|
|
18413
20570
|
/**
|
|
18414
20571
|
* @rc
|
|
18415
20572
|
* Waypoint that tracks a player's position. Extends {@link
|
|
@@ -18526,10 +20683,10 @@ export class Potions {
|
|
|
18526
20683
|
*
|
|
18527
20684
|
* {@link InvalidPotionEffectTypeError}
|
|
18528
20685
|
*/
|
|
18529
|
-
static resolve
|
|
18530
|
-
|
|
18531
|
-
|
|
18532
|
-
): ItemStack;
|
|
20686
|
+
static resolve<
|
|
20687
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
20688
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
20689
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
18533
20690
|
}
|
|
18534
20691
|
|
|
18535
20692
|
/**
|
|
@@ -19738,6 +21895,38 @@ export class Seat {
|
|
|
19738
21895
|
readonly seatRotation: number;
|
|
19739
21896
|
}
|
|
19740
21897
|
|
|
21898
|
+
/**
|
|
21899
|
+
* @beta
|
|
21900
|
+
* Manages callbacks that are message passing to a server. This
|
|
21901
|
+
* event is not currently fully implemented, and should not be
|
|
21902
|
+
* used.
|
|
21903
|
+
*/
|
|
21904
|
+
export class ServerMessageAfterEventSignal {
|
|
21905
|
+
private constructor();
|
|
21906
|
+
/**
|
|
21907
|
+
* @remarks
|
|
21908
|
+
* Adds a callback that will be called when an internal message
|
|
21909
|
+
* is passed.
|
|
21910
|
+
*
|
|
21911
|
+
* This function can't be called in restricted-execution mode.
|
|
21912
|
+
*
|
|
21913
|
+
* This function can be called in early-execution mode.
|
|
21914
|
+
*
|
|
21915
|
+
*/
|
|
21916
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
21917
|
+
/**
|
|
21918
|
+
* @remarks
|
|
21919
|
+
* Removes a callback from being called when an internal
|
|
21920
|
+
* message is passed.
|
|
21921
|
+
*
|
|
21922
|
+
* This function can't be called in restricted-execution mode.
|
|
21923
|
+
*
|
|
21924
|
+
* This function can be called in early-execution mode.
|
|
21925
|
+
*
|
|
21926
|
+
*/
|
|
21927
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
21928
|
+
}
|
|
21929
|
+
|
|
19741
21930
|
/**
|
|
19742
21931
|
* Loot item function that modifies the trim on a dropped armor
|
|
19743
21932
|
* item.
|
|
@@ -19766,6 +21955,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
19766
21955
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19767
21956
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
19768
21957
|
private constructor();
|
|
21958
|
+
/**
|
|
21959
|
+
* @beta
|
|
21960
|
+
* @remarks
|
|
21961
|
+
* The base color for the dropped banner.
|
|
21962
|
+
*
|
|
21963
|
+
*/
|
|
21964
|
+
readonly baseColor: string;
|
|
21965
|
+
/**
|
|
21966
|
+
* @beta
|
|
21967
|
+
* @remarks
|
|
21968
|
+
* An array of {@link BannerPattern} objects used to decorate
|
|
21969
|
+
* the banner, including color and pattern type.
|
|
21970
|
+
*
|
|
21971
|
+
*/
|
|
21972
|
+
readonly patterns: BannerPattern[];
|
|
19769
21973
|
/**
|
|
19770
21974
|
* @remarks
|
|
19771
21975
|
* The type of banner to drop.
|
|
@@ -20010,6 +22214,86 @@ export class SmeltItemFunction extends LootItemFunction {
|
|
|
20010
22214
|
private constructor();
|
|
20011
22215
|
}
|
|
20012
22216
|
|
|
22217
|
+
/**
|
|
22218
|
+
* @beta
|
|
22219
|
+
* Contains information about a sound thats declared duration
|
|
22220
|
+
* elapsed.
|
|
22221
|
+
*/
|
|
22222
|
+
export class SoundCompletedAfterEvent {
|
|
22223
|
+
private constructor();
|
|
22224
|
+
/**
|
|
22225
|
+
* @remarks
|
|
22226
|
+
* Identifier of the sound instance that completed. Matches the
|
|
22227
|
+
* `id` property of the `SoundInstance` returned when the sound
|
|
22228
|
+
* was played.
|
|
22229
|
+
*
|
|
22230
|
+
*/
|
|
22231
|
+
readonly soundInstanceId: string;
|
|
22232
|
+
}
|
|
22233
|
+
|
|
22234
|
+
/**
|
|
22235
|
+
* @beta
|
|
22236
|
+
* Manages callbacks that are invoked when a tracked sound's
|
|
22237
|
+
* declared duration elapses.
|
|
22238
|
+
*/
|
|
22239
|
+
export class SoundCompletedAfterEventSignal {
|
|
22240
|
+
private constructor();
|
|
22241
|
+
/**
|
|
22242
|
+
* @remarks
|
|
22243
|
+
* Adds a callback that will be invoked when a tracked sound's
|
|
22244
|
+
* declared duration elapses.
|
|
22245
|
+
*
|
|
22246
|
+
* This function can't be called in restricted-execution mode.
|
|
22247
|
+
*
|
|
22248
|
+
* This function can be called in early-execution mode.
|
|
22249
|
+
*
|
|
22250
|
+
*/
|
|
22251
|
+
subscribe(callback: (arg0: SoundCompletedAfterEvent) => void): (arg0: SoundCompletedAfterEvent) => void;
|
|
22252
|
+
/**
|
|
22253
|
+
* @remarks
|
|
22254
|
+
* Removes a callback from being invoked when a tracked sound's
|
|
22255
|
+
* declared duration elapses.
|
|
22256
|
+
*
|
|
22257
|
+
* This function can't be called in restricted-execution mode.
|
|
22258
|
+
*
|
|
22259
|
+
* This function can be called in early-execution mode.
|
|
22260
|
+
*
|
|
22261
|
+
*/
|
|
22262
|
+
unsubscribe(callback: (arg0: SoundCompletedAfterEvent) => void): void;
|
|
22263
|
+
}
|
|
22264
|
+
|
|
22265
|
+
/**
|
|
22266
|
+
* @beta
|
|
22267
|
+
* Provides duration and playback information for a sound whose
|
|
22268
|
+
* definition declares a duration.
|
|
22269
|
+
*/
|
|
22270
|
+
export class SoundDurationInfo {
|
|
22271
|
+
private constructor();
|
|
22272
|
+
/**
|
|
22273
|
+
* @remarks
|
|
22274
|
+
* Gets the total duration of the sound in seconds.
|
|
22275
|
+
*
|
|
22276
|
+
*/
|
|
22277
|
+
readonly duration: number;
|
|
22278
|
+
/**
|
|
22279
|
+
* @remarks
|
|
22280
|
+
* Gets whether the sound is still being tracked.
|
|
22281
|
+
*
|
|
22282
|
+
*/
|
|
22283
|
+
readonly isActive: boolean;
|
|
22284
|
+
/**
|
|
22285
|
+
* @remarks
|
|
22286
|
+
* Returns the elapsed playback time of the sound, in seconds,
|
|
22287
|
+
* since it started playing.
|
|
22288
|
+
*
|
|
22289
|
+
* This function can't be called in restricted-execution mode.
|
|
22290
|
+
*
|
|
22291
|
+
* @returns
|
|
22292
|
+
* Elapsed playback time in seconds.
|
|
22293
|
+
*/
|
|
22294
|
+
getPlaybackPosition(): number;
|
|
22295
|
+
}
|
|
22296
|
+
|
|
20013
22297
|
/**
|
|
20014
22298
|
* Represents a handle to a sound that has been played. The
|
|
20015
22299
|
* handle is required to control the sound while it is playing
|
|
@@ -20021,6 +22305,108 @@ export class SmeltItemFunction extends LootItemFunction {
|
|
|
20021
22305
|
*/
|
|
20022
22306
|
export class SoundInstance {
|
|
20023
22307
|
private constructor();
|
|
22308
|
+
/**
|
|
22309
|
+
* @beta
|
|
22310
|
+
* @remarks
|
|
22311
|
+
* Gets duration and playback information for this sound.
|
|
22312
|
+
*
|
|
22313
|
+
*/
|
|
22314
|
+
readonly durationInfo?: SoundDurationInfo;
|
|
22315
|
+
/**
|
|
22316
|
+
* @beta
|
|
22317
|
+
* @remarks
|
|
22318
|
+
* Unique identifier of this sound instance.
|
|
22319
|
+
*
|
|
22320
|
+
*/
|
|
22321
|
+
readonly id: string;
|
|
22322
|
+
/**
|
|
22323
|
+
* @beta
|
|
22324
|
+
* @remarks
|
|
22325
|
+
* Gets the player this sound was played for.
|
|
22326
|
+
*
|
|
22327
|
+
*/
|
|
22328
|
+
readonly recipient?: Player;
|
|
22329
|
+
/**
|
|
22330
|
+
* @beta
|
|
22331
|
+
* @remarks
|
|
22332
|
+
* Gets the identifier of the sound event this instance was
|
|
22333
|
+
* started with.
|
|
22334
|
+
*
|
|
22335
|
+
*/
|
|
22336
|
+
readonly soundEventId: string;
|
|
22337
|
+
/**
|
|
22338
|
+
* @beta
|
|
22339
|
+
* @remarks
|
|
22340
|
+
* Fades this sound instance from its current volume to the
|
|
22341
|
+
* target volume over the specified duration. To fade in from
|
|
22342
|
+
* silence, call `setVolume(0.0)` first; to fade out, pass a
|
|
22343
|
+
* target volume of `0.0`.
|
|
22344
|
+
*
|
|
22345
|
+
* This function can't be called in restricted-execution mode.
|
|
22346
|
+
*
|
|
22347
|
+
* @param duration
|
|
22348
|
+
* Duration of the fade in seconds. Must be non-negative.
|
|
22349
|
+
* Minimum value: 0
|
|
22350
|
+
* @param targetVolume
|
|
22351
|
+
* Volume to fade to. Must be non-negative.
|
|
22352
|
+
* Minimum value: 0
|
|
22353
|
+
*/
|
|
22354
|
+
fade(duration: number, targetVolume: number): void;
|
|
22355
|
+
/**
|
|
22356
|
+
* @beta
|
|
22357
|
+
* @remarks
|
|
22358
|
+
* Pauses this sound.
|
|
22359
|
+
*
|
|
22360
|
+
* This function can't be called in restricted-execution mode.
|
|
22361
|
+
*
|
|
22362
|
+
*/
|
|
22363
|
+
pause(): void;
|
|
22364
|
+
/**
|
|
22365
|
+
* @beta
|
|
22366
|
+
* @remarks
|
|
22367
|
+
* Resumes this sound after a pause.
|
|
22368
|
+
*
|
|
22369
|
+
* This function can't be called in restricted-execution mode.
|
|
22370
|
+
*
|
|
22371
|
+
*/
|
|
22372
|
+
resume(): void;
|
|
22373
|
+
/**
|
|
22374
|
+
* @beta
|
|
22375
|
+
* @remarks
|
|
22376
|
+
* Sets the playback position of this sound instance.
|
|
22377
|
+
*
|
|
22378
|
+
* This function can't be called in restricted-execution mode.
|
|
22379
|
+
*
|
|
22380
|
+
* @param seconds
|
|
22381
|
+
* Position to seek to in seconds. Must be non-negative.
|
|
22382
|
+
* Minimum value: 0
|
|
22383
|
+
*/
|
|
22384
|
+
seekTo(seconds: number): void;
|
|
22385
|
+
/**
|
|
22386
|
+
* @beta
|
|
22387
|
+
* @remarks
|
|
22388
|
+
* Sets the pitch of this sound instance.
|
|
22389
|
+
*
|
|
22390
|
+
* This function can't be called in restricted-execution mode.
|
|
22391
|
+
*
|
|
22392
|
+
* @param pitch
|
|
22393
|
+
* Pitch multiplier between 0.01 and 10.0. A value of 1.0 is
|
|
22394
|
+
* normal pitch.
|
|
22395
|
+
* Bounds: [0.009999999776482582, 10]
|
|
22396
|
+
*/
|
|
22397
|
+
setPitch(pitch: number): void;
|
|
22398
|
+
/**
|
|
22399
|
+
* @beta
|
|
22400
|
+
* @remarks
|
|
22401
|
+
* Sets the volume of this sound instance.
|
|
22402
|
+
*
|
|
22403
|
+
* This function can't be called in restricted-execution mode.
|
|
22404
|
+
*
|
|
22405
|
+
* @param volume
|
|
22406
|
+
* Volume level between 0.0 and 10.0.
|
|
22407
|
+
* Bounds: [0, 10]
|
|
22408
|
+
*/
|
|
22409
|
+
setVolume(volume: number): void;
|
|
20024
22410
|
/**
|
|
20025
22411
|
* @rc
|
|
20026
22412
|
* @remarks
|
|
@@ -20747,6 +23133,19 @@ export class SystemBeforeEvents {
|
|
|
20747
23133
|
*
|
|
20748
23134
|
*/
|
|
20749
23135
|
readonly startup: StartupBeforeEventSignal;
|
|
23136
|
+
/**
|
|
23137
|
+
* @beta
|
|
23138
|
+
* @remarks
|
|
23139
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
23140
|
+
* can be due to using too much memory, or by causing
|
|
23141
|
+
* significant slowdown or hang.
|
|
23142
|
+
* To prevent shutdown, set the event's cancel property to
|
|
23143
|
+
* true.
|
|
23144
|
+
*
|
|
23145
|
+
* This property can be read in early-execution mode.
|
|
23146
|
+
*
|
|
23147
|
+
*/
|
|
23148
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
20750
23149
|
}
|
|
20751
23150
|
|
|
20752
23151
|
/**
|
|
@@ -21107,30 +23506,95 @@ export class TripWireTripAfterEvent extends BlockEvent {
|
|
|
21107
23506
|
* }
|
|
21108
23507
|
* ```
|
|
21109
23508
|
*/
|
|
21110
|
-
export class TripWireTripAfterEventSignal {
|
|
23509
|
+
export class TripWireTripAfterEventSignal {
|
|
23510
|
+
private constructor();
|
|
23511
|
+
/**
|
|
23512
|
+
* @remarks
|
|
23513
|
+
* Adds a callback that will be called when a trip wire is
|
|
23514
|
+
* tripped.
|
|
23515
|
+
*
|
|
23516
|
+
* This function can't be called in restricted-execution mode.
|
|
23517
|
+
*
|
|
23518
|
+
* This function can be called in early-execution mode.
|
|
23519
|
+
*
|
|
23520
|
+
*/
|
|
23521
|
+
subscribe(callback: (arg0: TripWireTripAfterEvent) => void): (arg0: TripWireTripAfterEvent) => void;
|
|
23522
|
+
/**
|
|
23523
|
+
* @remarks
|
|
23524
|
+
* Removes a callback from being called when a trip wire is
|
|
23525
|
+
* tripped.
|
|
23526
|
+
*
|
|
23527
|
+
* This function can't be called in restricted-execution mode.
|
|
23528
|
+
*
|
|
23529
|
+
* This function can be called in early-execution mode.
|
|
23530
|
+
*
|
|
23531
|
+
*/
|
|
23532
|
+
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
23533
|
+
}
|
|
23534
|
+
|
|
23535
|
+
/**
|
|
23536
|
+
* @beta
|
|
23537
|
+
* Contains information related to a script watchdog
|
|
23538
|
+
* termination.
|
|
23539
|
+
*/
|
|
23540
|
+
export class WatchdogTerminateBeforeEvent {
|
|
21111
23541
|
private constructor();
|
|
21112
23542
|
/**
|
|
21113
23543
|
* @remarks
|
|
21114
|
-
*
|
|
21115
|
-
*
|
|
23544
|
+
* If set to true, cancels the termination of the script
|
|
23545
|
+
* runtime. Note that depending on server configuration
|
|
23546
|
+
* settings, cancellation of the termination may not be
|
|
23547
|
+
* allowed.
|
|
23548
|
+
*
|
|
23549
|
+
*/
|
|
23550
|
+
cancel: boolean;
|
|
23551
|
+
/**
|
|
23552
|
+
* @remarks
|
|
23553
|
+
* Contains the reason why a script runtime is to be
|
|
23554
|
+
* terminated.
|
|
23555
|
+
*
|
|
23556
|
+
*/
|
|
23557
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
23558
|
+
}
|
|
23559
|
+
|
|
23560
|
+
/**
|
|
23561
|
+
* @beta
|
|
23562
|
+
* Manages callbacks that are connected to a callback that will
|
|
23563
|
+
* be called when a script runtime is being terminated due to a
|
|
23564
|
+
* violation of the performance watchdog system.
|
|
23565
|
+
*/
|
|
23566
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
23567
|
+
private constructor();
|
|
23568
|
+
/**
|
|
23569
|
+
* @remarks
|
|
23570
|
+
* Adds a callback that will be called when a script runtime is
|
|
23571
|
+
* being terminated due to a violation of the performance
|
|
23572
|
+
* watchdog system.
|
|
21116
23573
|
*
|
|
21117
23574
|
* This function can't be called in restricted-execution mode.
|
|
21118
23575
|
*
|
|
21119
23576
|
* This function can be called in early-execution mode.
|
|
21120
23577
|
*
|
|
23578
|
+
* @param callback
|
|
23579
|
+
* This closure is called with restricted-execution privilege.
|
|
23580
|
+
* @returns
|
|
23581
|
+
* Closure that is called with restricted-execution privilege.
|
|
21121
23582
|
*/
|
|
21122
|
-
subscribe(callback: (arg0:
|
|
23583
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
21123
23584
|
/**
|
|
21124
23585
|
* @remarks
|
|
21125
|
-
* Removes a callback from being called when a
|
|
21126
|
-
*
|
|
23586
|
+
* Removes a callback from being called when a script runtime
|
|
23587
|
+
* is being terminated due to a violation of the performance
|
|
23588
|
+
* watchdog system.
|
|
21127
23589
|
*
|
|
21128
23590
|
* This function can't be called in restricted-execution mode.
|
|
21129
23591
|
*
|
|
21130
23592
|
* This function can be called in early-execution mode.
|
|
21131
23593
|
*
|
|
23594
|
+
* @param callback
|
|
23595
|
+
* This closure is called with restricted-execution privilege.
|
|
21132
23596
|
*/
|
|
21133
|
-
unsubscribe(callback: (arg0:
|
|
23597
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
21134
23598
|
}
|
|
21135
23599
|
|
|
21136
23600
|
/**
|
|
@@ -21349,6 +23813,15 @@ export class World {
|
|
|
21349
23813
|
*
|
|
21350
23814
|
*/
|
|
21351
23815
|
readonly afterEvents: WorldAfterEvents;
|
|
23816
|
+
/**
|
|
23817
|
+
* @beta
|
|
23818
|
+
* @remarks
|
|
23819
|
+
* Enables or disables cheats.
|
|
23820
|
+
*
|
|
23821
|
+
* This property can't be edited in restricted-execution mode.
|
|
23822
|
+
*
|
|
23823
|
+
*/
|
|
23824
|
+
allowCheats: boolean;
|
|
21352
23825
|
/**
|
|
21353
23826
|
* @remarks
|
|
21354
23827
|
* Contains a set of events that are applicable to the entirety
|
|
@@ -21427,6 +23900,20 @@ export class World {
|
|
|
21427
23900
|
*
|
|
21428
23901
|
*/
|
|
21429
23902
|
readonly tickingAreaManager: TickingAreaManager;
|
|
23903
|
+
/**
|
|
23904
|
+
* @beta
|
|
23905
|
+
* @remarks
|
|
23906
|
+
* A method that is internal-only, used for broadcasting
|
|
23907
|
+
* specific messages between client and server.
|
|
23908
|
+
*
|
|
23909
|
+
* This function can't be called in restricted-execution mode.
|
|
23910
|
+
*
|
|
23911
|
+
* @param id
|
|
23912
|
+
* The message identifier.
|
|
23913
|
+
* @param value
|
|
23914
|
+
* The message.
|
|
23915
|
+
*/
|
|
23916
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
21430
23917
|
/**
|
|
21431
23918
|
* @remarks
|
|
21432
23919
|
* Clears the set of dynamic properties declared for this
|
|
@@ -21919,6 +24406,16 @@ export class WorldAfterEvents {
|
|
|
21919
24406
|
*
|
|
21920
24407
|
*/
|
|
21921
24408
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
24409
|
+
/**
|
|
24410
|
+
* @beta
|
|
24411
|
+
* @remarks
|
|
24412
|
+
* This event is triggered after a chat message has been
|
|
24413
|
+
* broadcast or sent to players.
|
|
24414
|
+
*
|
|
24415
|
+
* This property can be read in early-execution mode.
|
|
24416
|
+
*
|
|
24417
|
+
*/
|
|
24418
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
21922
24419
|
/**
|
|
21923
24420
|
* @remarks
|
|
21924
24421
|
* This event is fired when an entity event has been triggered
|
|
@@ -22045,6 +24542,33 @@ export class WorldAfterEvents {
|
|
|
22045
24542
|
*
|
|
22046
24543
|
*/
|
|
22047
24544
|
readonly entitySpawn: EntitySpawnAfterEventSignal;
|
|
24545
|
+
/**
|
|
24546
|
+
* @beta
|
|
24547
|
+
* @remarks
|
|
24548
|
+
* This event fires when an entity starts sneaking.
|
|
24549
|
+
*
|
|
24550
|
+
* This property can be read in early-execution mode.
|
|
24551
|
+
*
|
|
24552
|
+
*/
|
|
24553
|
+
readonly entityStartSneaking: EntityStartSneakingAfterEventSignal;
|
|
24554
|
+
/**
|
|
24555
|
+
* @beta
|
|
24556
|
+
* @remarks
|
|
24557
|
+
* This event fires when an entity stops sneaking.
|
|
24558
|
+
*
|
|
24559
|
+
* This property can be read in early-execution mode.
|
|
24560
|
+
*
|
|
24561
|
+
*/
|
|
24562
|
+
readonly entityStopSneaking: EntityStopSneakingAfterEventSignal;
|
|
24563
|
+
/**
|
|
24564
|
+
* @beta
|
|
24565
|
+
* @remarks
|
|
24566
|
+
* This event fires when an entity is tamed.
|
|
24567
|
+
*
|
|
24568
|
+
* This property can be read in early-execution mode.
|
|
24569
|
+
*
|
|
24570
|
+
*/
|
|
24571
|
+
readonly entityTamed: EntityTamedAfterEventSignal;
|
|
22048
24572
|
/**
|
|
22049
24573
|
* @rc
|
|
22050
24574
|
* @remarks
|
|
@@ -22141,6 +24665,25 @@ export class WorldAfterEvents {
|
|
|
22141
24665
|
*
|
|
22142
24666
|
*/
|
|
22143
24667
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
24668
|
+
/**
|
|
24669
|
+
* @beta
|
|
24670
|
+
* @remarks
|
|
24671
|
+
* This event is an internal implementation detail, and is
|
|
24672
|
+
* otherwise not currently functional.
|
|
24673
|
+
*
|
|
24674
|
+
* This property can be read in early-execution mode.
|
|
24675
|
+
*
|
|
24676
|
+
*/
|
|
24677
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
24678
|
+
/**
|
|
24679
|
+
* @beta
|
|
24680
|
+
* @remarks
|
|
24681
|
+
* This event is triggered when a pack setting is changed.
|
|
24682
|
+
*
|
|
24683
|
+
* This property can be read in early-execution mode.
|
|
24684
|
+
*
|
|
24685
|
+
*/
|
|
24686
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
22144
24687
|
/**
|
|
22145
24688
|
* @remarks
|
|
22146
24689
|
* This event fires when a piston expands or retracts.
|
|
@@ -22166,6 +24709,15 @@ export class WorldAfterEvents {
|
|
|
22166
24709
|
*
|
|
22167
24710
|
*/
|
|
22168
24711
|
readonly playerButtonInput: PlayerButtonInputAfterEventSignal;
|
|
24712
|
+
/**
|
|
24713
|
+
* @beta
|
|
24714
|
+
* @remarks
|
|
24715
|
+
* This event fires when a player cancels breaking a block.
|
|
24716
|
+
*
|
|
24717
|
+
* This property can be read in early-execution mode.
|
|
24718
|
+
*
|
|
24719
|
+
*/
|
|
24720
|
+
readonly playerCancelBreakingBlock: PlayerCancelBreakingBlockAfterEventSignal;
|
|
22169
24721
|
/**
|
|
22170
24722
|
* @remarks
|
|
22171
24723
|
* Fires when a player moved to a different dimension.
|
|
@@ -22271,12 +24823,31 @@ export class WorldAfterEvents {
|
|
|
22271
24823
|
*
|
|
22272
24824
|
*/
|
|
22273
24825
|
readonly playerSpawn: PlayerSpawnAfterEventSignal;
|
|
24826
|
+
/**
|
|
24827
|
+
* @beta
|
|
24828
|
+
* @remarks
|
|
24829
|
+
* This event fires when a player starts breaking a block.
|
|
24830
|
+
*
|
|
24831
|
+
* This property can be read in early-execution mode.
|
|
24832
|
+
*
|
|
24833
|
+
*/
|
|
24834
|
+
readonly playerStartBreakingBlock: PlayerStartBreakingBlockAfterEventSignal;
|
|
22274
24835
|
/**
|
|
22275
24836
|
* @remarks
|
|
22276
24837
|
* This property can be read in early-execution mode.
|
|
22277
24838
|
*
|
|
22278
24839
|
*/
|
|
22279
24840
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
24841
|
+
/**
|
|
24842
|
+
* @beta
|
|
24843
|
+
* @remarks
|
|
24844
|
+
* An event for when a player uses a named name tag on an
|
|
24845
|
+
* entity.
|
|
24846
|
+
*
|
|
24847
|
+
* This property can be read in early-execution mode.
|
|
24848
|
+
*
|
|
24849
|
+
*/
|
|
24850
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
22280
24851
|
/**
|
|
22281
24852
|
* @remarks
|
|
22282
24853
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -22311,6 +24882,15 @@ export class WorldAfterEvents {
|
|
|
22311
24882
|
*
|
|
22312
24883
|
*/
|
|
22313
24884
|
readonly projectileHitEntity: ProjectileHitEntityAfterEventSignal;
|
|
24885
|
+
/**
|
|
24886
|
+
* @beta
|
|
24887
|
+
* @remarks
|
|
24888
|
+
* A tracked sound's declared duration elapsed.
|
|
24889
|
+
*
|
|
24890
|
+
* This property can be read in early-execution mode.
|
|
24891
|
+
*
|
|
24892
|
+
*/
|
|
24893
|
+
readonly soundCompleted: SoundCompletedAfterEventSignal;
|
|
22314
24894
|
/**
|
|
22315
24895
|
* @remarks
|
|
22316
24896
|
* A target block was hit.
|
|
@@ -22353,6 +24933,43 @@ export class WorldAfterEvents {
|
|
|
22353
24933
|
*/
|
|
22354
24934
|
export class WorldBeforeEvents {
|
|
22355
24935
|
private constructor();
|
|
24936
|
+
/**
|
|
24937
|
+
* @beta
|
|
24938
|
+
* @remarks
|
|
24939
|
+
* This event is triggered after a chat message has been
|
|
24940
|
+
* broadcast or sent to players.
|
|
24941
|
+
*
|
|
24942
|
+
* This property can be read in early-execution mode.
|
|
24943
|
+
*
|
|
24944
|
+
* @example customCommand.ts
|
|
24945
|
+
* ```typescript
|
|
24946
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
24947
|
+
*
|
|
24948
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
24949
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
24950
|
+
* if (eventData.message.includes('cancel')) {
|
|
24951
|
+
* // Cancel event if the message contains "cancel"
|
|
24952
|
+
* eventData.cancel = true;
|
|
24953
|
+
* } else {
|
|
24954
|
+
* const args = eventData.message.split(' ');
|
|
24955
|
+
*
|
|
24956
|
+
* if (args.length > 0) {
|
|
24957
|
+
* switch (args[0].toLowerCase()) {
|
|
24958
|
+
* case 'echo':
|
|
24959
|
+
* // Send a modified version of chat message
|
|
24960
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
24961
|
+
* break;
|
|
24962
|
+
* case 'help':
|
|
24963
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
24964
|
+
* break;
|
|
24965
|
+
* }
|
|
24966
|
+
* }
|
|
24967
|
+
* }
|
|
24968
|
+
* });
|
|
24969
|
+
* }
|
|
24970
|
+
* ```
|
|
24971
|
+
*/
|
|
24972
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
22356
24973
|
/**
|
|
22357
24974
|
* @remarks
|
|
22358
24975
|
* This event is triggered after an event has been added to an
|
|
@@ -22391,6 +25008,15 @@ export class WorldBeforeEvents {
|
|
|
22391
25008
|
*
|
|
22392
25009
|
*/
|
|
22393
25010
|
readonly entityRemove: EntityRemoveBeforeEventSignal;
|
|
25011
|
+
/**
|
|
25012
|
+
* @beta
|
|
25013
|
+
* @remarks
|
|
25014
|
+
* Fires before an entity is tamed.
|
|
25015
|
+
*
|
|
25016
|
+
* This property can be read in early-execution mode.
|
|
25017
|
+
*
|
|
25018
|
+
*/
|
|
25019
|
+
readonly entityTamed: EntityTamedBeforeEventSignal;
|
|
22394
25020
|
/**
|
|
22395
25021
|
* @remarks
|
|
22396
25022
|
* This event is fired after an explosion occurs.
|
|
@@ -22446,6 +25072,15 @@ export class WorldBeforeEvents {
|
|
|
22446
25072
|
*
|
|
22447
25073
|
*/
|
|
22448
25074
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
25075
|
+
/**
|
|
25076
|
+
* @beta
|
|
25077
|
+
* @remarks
|
|
25078
|
+
* This event fires before a block is placed by a player.
|
|
25079
|
+
*
|
|
25080
|
+
* This property can be read in early-execution mode.
|
|
25081
|
+
*
|
|
25082
|
+
*/
|
|
25083
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
22449
25084
|
/**
|
|
22450
25085
|
* @remarks
|
|
22451
25086
|
* This property can be read in early-execution mode.
|
|
@@ -22523,13 +25158,27 @@ export interface BiomeFilter {
|
|
|
22523
25158
|
includeTags?: string[];
|
|
22524
25159
|
}
|
|
22525
25160
|
|
|
25161
|
+
/**
|
|
25162
|
+
* @beta
|
|
25163
|
+
* Contains additional options for searches for the
|
|
25164
|
+
* dimension.findNearestBiome API.
|
|
25165
|
+
*/
|
|
25166
|
+
export interface BiomeSearchOptions {
|
|
25167
|
+
/**
|
|
25168
|
+
* @remarks
|
|
25169
|
+
* Bounding volume size to look within.
|
|
25170
|
+
*
|
|
25171
|
+
*/
|
|
25172
|
+
boundingSize?: Vector3;
|
|
25173
|
+
}
|
|
25174
|
+
|
|
22526
25175
|
/**
|
|
22527
25176
|
* A BlockBoundingBox is an interface to an object which
|
|
22528
25177
|
* represents an AABB aligned rectangle.
|
|
22529
25178
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
22530
25179
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
22531
|
-
* created using the associated {@link
|
|
22532
|
-
*
|
|
25180
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
25181
|
+
* utility functions.
|
|
22533
25182
|
* The min/max coordinates represent the diametrically opposite
|
|
22534
25183
|
* corners of the rectangle.
|
|
22535
25184
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -22792,6 +25441,40 @@ export interface BlockHitInformation {
|
|
|
22792
25441
|
faceLocation: Vector3;
|
|
22793
25442
|
}
|
|
22794
25443
|
|
|
25444
|
+
/**
|
|
25445
|
+
* @beta
|
|
25446
|
+
* Options for querying blocks in a volume. Extends BlockFilter
|
|
25447
|
+
* with additional sorting and limiting options based on
|
|
25448
|
+
* distance from a location.
|
|
25449
|
+
*/
|
|
25450
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
25451
|
+
export interface BlockQueryOptions extends BlockFilter {
|
|
25452
|
+
/**
|
|
25453
|
+
* @remarks
|
|
25454
|
+
* If specified, returns the closest N blocks to the location.
|
|
25455
|
+
* Must be greater than 0. Cannot be used with farthest.
|
|
25456
|
+
* Requires location to be set.
|
|
25457
|
+
*
|
|
25458
|
+
*/
|
|
25459
|
+
closest?: number;
|
|
25460
|
+
/**
|
|
25461
|
+
* @remarks
|
|
25462
|
+
* If specified, returns the farthest N blocks from the
|
|
25463
|
+
* location. Must be greater than 0. Cannot be used with
|
|
25464
|
+
* closest. Requires location to be set.
|
|
25465
|
+
*
|
|
25466
|
+
*/
|
|
25467
|
+
farthest?: number;
|
|
25468
|
+
/**
|
|
25469
|
+
* @remarks
|
|
25470
|
+
* Location used as the reference point for closest or farthest
|
|
25471
|
+
* distance calculations. Required when closest or farthest is
|
|
25472
|
+
* specified.
|
|
25473
|
+
*
|
|
25474
|
+
*/
|
|
25475
|
+
location?: Vector3;
|
|
25476
|
+
}
|
|
25477
|
+
|
|
22795
25478
|
/**
|
|
22796
25479
|
* Contains information for block raycast hit results.
|
|
22797
25480
|
*/
|
|
@@ -22962,6 +25645,44 @@ export interface CameraSetRotOptions {
|
|
|
22962
25645
|
rotation: Vector2;
|
|
22963
25646
|
}
|
|
22964
25647
|
|
|
25648
|
+
/**
|
|
25649
|
+
* @beta
|
|
25650
|
+
* Options for applying a camera shake effect to a player's
|
|
25651
|
+
* camera via `Camera.addShake`. Each call to `addShake` queues
|
|
25652
|
+
* a new independent shake event for the specified `type`;
|
|
25653
|
+
* positional and rotational shakes are tracked in separate
|
|
25654
|
+
* queues and run concurrently. The rendered intensity at any
|
|
25655
|
+
* moment is the sum of all active events' intensities for that
|
|
25656
|
+
* type, capped at `4.0`. Events expire naturally when their
|
|
25657
|
+
* `duration` elapses.
|
|
25658
|
+
*/
|
|
25659
|
+
export interface CameraShakeOptions {
|
|
25660
|
+
/**
|
|
25661
|
+
* @remarks
|
|
25662
|
+
* How long this shake event lasts, in seconds. Must be a
|
|
25663
|
+
* positive value.
|
|
25664
|
+
*
|
|
25665
|
+
*/
|
|
25666
|
+
duration: number;
|
|
25667
|
+
/**
|
|
25668
|
+
* @remarks
|
|
25669
|
+
* The intensity of this shake event. Must be a positive value
|
|
25670
|
+
* with a maximum of `4.0`. Multiple active events of the same
|
|
25671
|
+
* `type` are summed, capped at `4.0`.
|
|
25672
|
+
*
|
|
25673
|
+
*/
|
|
25674
|
+
intensity: number;
|
|
25675
|
+
/**
|
|
25676
|
+
* @remarks
|
|
25677
|
+
* The type of camera shake to apply. Positional and rotational
|
|
25678
|
+
* shakes maintain separate event queues and are applied
|
|
25679
|
+
* concurrently, so adding a shake of each type does not cause
|
|
25680
|
+
* them to interfere with one another.
|
|
25681
|
+
*
|
|
25682
|
+
*/
|
|
25683
|
+
type: CameraShakeType;
|
|
25684
|
+
}
|
|
25685
|
+
|
|
22965
25686
|
/**
|
|
22966
25687
|
* Used to target an entity with a free camera.
|
|
22967
25688
|
*/
|
|
@@ -22980,6 +25701,40 @@ export interface CameraTargetOptions {
|
|
|
22980
25701
|
targetEntity: Entity;
|
|
22981
25702
|
}
|
|
22982
25703
|
|
|
25704
|
+
/**
|
|
25705
|
+
* @beta
|
|
25706
|
+
* This interface defines an entry into the {@link
|
|
25707
|
+
* CompoundBlockVolume} which represents a volume of positive
|
|
25708
|
+
* or negative space.
|
|
25709
|
+
*
|
|
25710
|
+
*/
|
|
25711
|
+
export interface CompoundBlockVolumeItem {
|
|
25712
|
+
/**
|
|
25713
|
+
* @remarks
|
|
25714
|
+
* The 'action' defines how the block volume is represented in
|
|
25715
|
+
* the compound block volume stack.
|
|
25716
|
+
* 'Add' creates a block volume which is positively selected
|
|
25717
|
+
* 'Subtract' creates a block volume which represents a hole or
|
|
25718
|
+
* negative space in the overall compound block volume.
|
|
25719
|
+
*
|
|
25720
|
+
*/
|
|
25721
|
+
action?: CompoundBlockVolumeAction;
|
|
25722
|
+
/**
|
|
25723
|
+
* @remarks
|
|
25724
|
+
* The relativity enumeration determines whether the
|
|
25725
|
+
* BlockVolume specified is positioned relative to the parent
|
|
25726
|
+
* compound block volume origin, or in absolute world space.
|
|
25727
|
+
*
|
|
25728
|
+
*/
|
|
25729
|
+
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
25730
|
+
/**
|
|
25731
|
+
* @remarks
|
|
25732
|
+
* The volume of space
|
|
25733
|
+
*
|
|
25734
|
+
*/
|
|
25735
|
+
volume: BlockVolume;
|
|
25736
|
+
}
|
|
25737
|
+
|
|
22983
25738
|
/**
|
|
22984
25739
|
* @rc
|
|
22985
25740
|
* Represents the source of a container access.
|
|
@@ -23091,6 +25846,15 @@ export interface CustomCommand {
|
|
|
23091
25846
|
* command.
|
|
23092
25847
|
*/
|
|
23093
25848
|
export interface CustomCommandParameter {
|
|
25849
|
+
/**
|
|
25850
|
+
* @beta
|
|
25851
|
+
* @remarks
|
|
25852
|
+
* Can be used to reference the enum name when {@link
|
|
25853
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
25854
|
+
* to be different from the enum name.
|
|
25855
|
+
*
|
|
25856
|
+
*/
|
|
25857
|
+
enumName?: string;
|
|
23094
25858
|
/**
|
|
23095
25859
|
* @remarks
|
|
23096
25860
|
* The name of parameter as it appears on the command line.
|
|
@@ -23172,6 +25936,14 @@ export interface DefinitionModifier {
|
|
|
23172
25936
|
*
|
|
23173
25937
|
*/
|
|
23174
25938
|
removedComponentGroups: string[];
|
|
25939
|
+
/**
|
|
25940
|
+
* @beta
|
|
25941
|
+
* @remarks
|
|
25942
|
+
* The list of entity definition events that will be fired via
|
|
25943
|
+
* this update.
|
|
25944
|
+
*
|
|
25945
|
+
*/
|
|
25946
|
+
triggers: Trigger[];
|
|
23175
25947
|
}
|
|
23176
25948
|
|
|
23177
25949
|
/**
|
|
@@ -23973,6 +26745,24 @@ export interface EntityRaycastOptions extends EntityFilter {
|
|
|
23973
26745
|
maxDistance?: number;
|
|
23974
26746
|
}
|
|
23975
26747
|
|
|
26748
|
+
/**
|
|
26749
|
+
* @beta
|
|
26750
|
+
* Options used to filter entity start sneaking and stop
|
|
26751
|
+
* sneaking events.
|
|
26752
|
+
*/
|
|
26753
|
+
export interface EntitySneakingChangedEventOptions {
|
|
26754
|
+
entityFilter?: EntityFilter;
|
|
26755
|
+
}
|
|
26756
|
+
|
|
26757
|
+
/**
|
|
26758
|
+
* @beta
|
|
26759
|
+
* Contains options for filtering entity tamed events.
|
|
26760
|
+
*/
|
|
26761
|
+
export interface EntityTamedEventFilter {
|
|
26762
|
+
entityFilter?: EntityFilter;
|
|
26763
|
+
tamingEntityFilter?: EntityFilter;
|
|
26764
|
+
}
|
|
26765
|
+
|
|
23976
26766
|
/**
|
|
23977
26767
|
* @rc
|
|
23978
26768
|
* Controls when a waypoint is visible based on the state of
|
|
@@ -24479,6 +27269,33 @@ export interface PlayerAimAssistSettings {
|
|
|
24479
27269
|
viewAngle?: Vector2;
|
|
24480
27270
|
}
|
|
24481
27271
|
|
|
27272
|
+
/**
|
|
27273
|
+
* @beta
|
|
27274
|
+
* An interface that is passed into {@link
|
|
27275
|
+
* PlayerStartBreakingBlockAfterEventSignal.subscribe} or
|
|
27276
|
+
* {@link PlayerCancelBreakingBlockAfterEventSignal.subscribe}
|
|
27277
|
+
* that filters out which events are passed to the provided
|
|
27278
|
+
* callback.
|
|
27279
|
+
*/
|
|
27280
|
+
export interface PlayerBreakingBlockEventOptions {
|
|
27281
|
+
/**
|
|
27282
|
+
* @remarks
|
|
27283
|
+
* The {@link BlockFilter} that the callback should be called
|
|
27284
|
+
* for. If undefined, the callback will be called for all
|
|
27285
|
+
* blocks.
|
|
27286
|
+
*
|
|
27287
|
+
*/
|
|
27288
|
+
blockFilter?: BlockFilter;
|
|
27289
|
+
/**
|
|
27290
|
+
* @remarks
|
|
27291
|
+
* The {@link EntityFilter} that the callback should be called
|
|
27292
|
+
* for. If undefined, the callback will be called for all
|
|
27293
|
+
* players.
|
|
27294
|
+
*
|
|
27295
|
+
*/
|
|
27296
|
+
playerFilter?: EntityFilter;
|
|
27297
|
+
}
|
|
27298
|
+
|
|
24482
27299
|
/**
|
|
24483
27300
|
* Additional options for how a sound plays for a player.
|
|
24484
27301
|
*/
|
|
@@ -24490,6 +27307,19 @@ export interface PlayerSoundOptions {
|
|
|
24490
27307
|
*
|
|
24491
27308
|
*/
|
|
24492
27309
|
location?: Vector3;
|
|
27310
|
+
/**
|
|
27311
|
+
* @beta
|
|
27312
|
+
* @remarks
|
|
27313
|
+
* Number of additional times to repeat the sound after the
|
|
27314
|
+
* initial play. `0` (the default) plays the sound once, `-1`
|
|
27315
|
+
* loops it forever, and a positive integer `N` plays the sound
|
|
27316
|
+
* `N + 1` times in total. For example, `loopCount: 1` plays
|
|
27317
|
+
* the sound twice. The loop count is fixed when the sound
|
|
27318
|
+
* starts and cannot be changed afterward. When using `-1`, see
|
|
27319
|
+
* `SoundInstance` for handle lifetime requirements.
|
|
27320
|
+
*
|
|
27321
|
+
*/
|
|
27322
|
+
loopCount?: number;
|
|
24493
27323
|
/**
|
|
24494
27324
|
* @remarks
|
|
24495
27325
|
* Optional pitch of the sound.
|
|
@@ -25316,6 +28146,19 @@ export interface WaypointTextureSelector {
|
|
|
25316
28146
|
* Contains additional options for a playSound occurrence.
|
|
25317
28147
|
*/
|
|
25318
28148
|
export interface WorldSoundOptions {
|
|
28149
|
+
/**
|
|
28150
|
+
* @beta
|
|
28151
|
+
* @remarks
|
|
28152
|
+
* Number of additional times to repeat the sound after the
|
|
28153
|
+
* initial play. `0` (the default) plays the sound once, `-1`
|
|
28154
|
+
* loops it forever, and a positive integer `N` plays the sound
|
|
28155
|
+
* `N + 1` times in total. For example, `loopCount: 1` plays
|
|
28156
|
+
* the sound twice. The loop count is fixed when the sound
|
|
28157
|
+
* starts and cannot be changed afterward. When using `-1`, see
|
|
28158
|
+
* `SoundInstance` for handle lifetime requirements.
|
|
28159
|
+
*
|
|
28160
|
+
*/
|
|
28161
|
+
loopCount?: number;
|
|
25319
28162
|
/**
|
|
25320
28163
|
* @remarks
|
|
25321
28164
|
* Pitch of the sound played.
|
|
@@ -25509,6 +28352,17 @@ export class EntitySpawnError extends Error {
|
|
|
25509
28352
|
private constructor();
|
|
25510
28353
|
}
|
|
25511
28354
|
|
|
28355
|
+
/**
|
|
28356
|
+
* @beta
|
|
28357
|
+
* Error thrown by {@link FogSettings} operations when the fog
|
|
28358
|
+
* stack limit is exceeded or an invalid fog identifier is
|
|
28359
|
+
* provided.
|
|
28360
|
+
*/
|
|
28361
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
28362
|
+
export class FogSettingsError extends Error {
|
|
28363
|
+
private constructor();
|
|
28364
|
+
}
|
|
28365
|
+
|
|
25512
28366
|
/**
|
|
25513
28367
|
* The error can occur when a block is invalid. This can also
|
|
25514
28368
|
* occur when accessing components on a block that doesn't have
|