@minecraft/server 2.10.0-rc.1.26.50-preview.22 → 2.11.0-beta.1.26.50-preview.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1807 -60
- 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.11.0-beta"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -220,6 +220,34 @@ export enum CameraShakeType {
|
|
|
220
220
|
Rotational = 'Rotational',
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
/**
|
|
224
|
+
* @beta
|
|
225
|
+
* An enumeration for the clone modes used when cloning blocks.
|
|
226
|
+
*/
|
|
227
|
+
export enum CloneMode {
|
|
228
|
+
/**
|
|
229
|
+
* @remarks
|
|
230
|
+
* Clones the blocks from the source region to the destination,
|
|
231
|
+
* leaving the source intact.
|
|
232
|
+
*
|
|
233
|
+
*/
|
|
234
|
+
Copy = 0,
|
|
235
|
+
/**
|
|
236
|
+
* @remarks
|
|
237
|
+
* Clones the blocks from the source region to the destination,
|
|
238
|
+
* allowing the source and destination regions to overlap.
|
|
239
|
+
*
|
|
240
|
+
*/
|
|
241
|
+
ForceCopy = 1,
|
|
242
|
+
/**
|
|
243
|
+
* @remarks
|
|
244
|
+
* Clones the blocks from the source region to the destination
|
|
245
|
+
* and replaces the source region with air.
|
|
246
|
+
*
|
|
247
|
+
*/
|
|
248
|
+
Move = 2,
|
|
249
|
+
}
|
|
250
|
+
|
|
223
251
|
/**
|
|
224
252
|
* The required permission level to execute the custom command.
|
|
225
253
|
*/
|
|
@@ -358,6 +386,13 @@ export enum CustomCommandErrorReason {
|
|
|
358
386
|
*
|
|
359
387
|
*/
|
|
360
388
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
389
|
+
/**
|
|
390
|
+
* @beta
|
|
391
|
+
* @remarks
|
|
392
|
+
* Non enum type command parameters cannot use enumName.
|
|
393
|
+
*
|
|
394
|
+
*/
|
|
395
|
+
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
361
396
|
}
|
|
362
397
|
|
|
363
398
|
/**
|
|
@@ -1094,6 +1129,14 @@ export enum EntityComponentTypes {
|
|
|
1094
1129
|
*
|
|
1095
1130
|
*/
|
|
1096
1131
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1132
|
+
/**
|
|
1133
|
+
* @beta
|
|
1134
|
+
* @remarks
|
|
1135
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
1136
|
+
* name, and dialogue interactions.
|
|
1137
|
+
*
|
|
1138
|
+
*/
|
|
1139
|
+
Npc = 'minecraft:npc',
|
|
1097
1140
|
/**
|
|
1098
1141
|
* @remarks
|
|
1099
1142
|
* When present on an entity, this entity is on fire.
|
|
@@ -1577,6 +1620,14 @@ export enum EntitySwingSource {
|
|
|
1577
1620
|
* and mainhand slots.
|
|
1578
1621
|
*/
|
|
1579
1622
|
export enum EquipmentSlot {
|
|
1623
|
+
/**
|
|
1624
|
+
* @beta
|
|
1625
|
+
* @remarks
|
|
1626
|
+
* The body slot. This slot is used to hold armor for
|
|
1627
|
+
* non-humanoid mobs.
|
|
1628
|
+
*
|
|
1629
|
+
*/
|
|
1630
|
+
Body = 'Body',
|
|
1580
1631
|
/**
|
|
1581
1632
|
* @remarks
|
|
1582
1633
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1846,6 +1897,14 @@ export enum GameRule {
|
|
|
1846
1897
|
*
|
|
1847
1898
|
*/
|
|
1848
1899
|
PlayersSleepingPercentage = 'playersSleepingPercentage',
|
|
1900
|
+
/**
|
|
1901
|
+
* @beta
|
|
1902
|
+
* @remarks
|
|
1903
|
+
* Controls which player waypoints are automatically added to
|
|
1904
|
+
* the players locator bar.
|
|
1905
|
+
*
|
|
1906
|
+
*/
|
|
1907
|
+
PlayerWaypoints = 'playerWaypoints',
|
|
1849
1908
|
/**
|
|
1850
1909
|
* @remarks
|
|
1851
1910
|
* Controls whether projectiles (entities with a projectile
|
|
@@ -2671,6 +2730,14 @@ export enum PlayerSplitScreenSlot {
|
|
|
2671
2730
|
Third = 'Third',
|
|
2672
2731
|
}
|
|
2673
2732
|
|
|
2733
|
+
/**
|
|
2734
|
+
* @beta
|
|
2735
|
+
*/
|
|
2736
|
+
export enum PlayerWaypointsMode {
|
|
2737
|
+
Everyone = 'Everyone',
|
|
2738
|
+
Off = 'Off',
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2674
2741
|
/**
|
|
2675
2742
|
* Contains objectives and participants for the scoreboard.
|
|
2676
2743
|
*/
|
|
@@ -2997,6 +3064,29 @@ export enum TintMethod {
|
|
|
2997
3064
|
Water = 'Water',
|
|
2998
3065
|
}
|
|
2999
3066
|
|
|
3067
|
+
/**
|
|
3068
|
+
* @beta
|
|
3069
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
3070
|
+
* to terminate execution of a behavior packs' script.
|
|
3071
|
+
*/
|
|
3072
|
+
export enum WatchdogTerminateReason {
|
|
3073
|
+
/**
|
|
3074
|
+
* @remarks
|
|
3075
|
+
* Script runtime for a behavior pack is terminated due to
|
|
3076
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
3077
|
+
*
|
|
3078
|
+
*/
|
|
3079
|
+
Hang = 'Hang',
|
|
3080
|
+
/**
|
|
3081
|
+
* @remarks
|
|
3082
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3083
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3084
|
+
* function calls.
|
|
3085
|
+
*
|
|
3086
|
+
*/
|
|
3087
|
+
StackOverflow = 'StackOverflow',
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3000
3090
|
/**
|
|
3001
3091
|
* Enum representing different texture icons that can be
|
|
3002
3092
|
* displayed for waypoints on the locator bar.
|
|
@@ -3185,6 +3275,7 @@ export type EntityComponentTypeMap = {
|
|
|
3185
3275
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
3186
3276
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
3187
3277
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3278
|
+
'minecraft:npc': EntityNpcComponent;
|
|
3188
3279
|
'minecraft:onfire': EntityOnFireComponent;
|
|
3189
3280
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
3190
3281
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -3218,6 +3309,7 @@ export type EntityComponentTypeMap = {
|
|
|
3218
3309
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3219
3310
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3220
3311
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3312
|
+
npc: EntityNpcComponent;
|
|
3221
3313
|
onfire: EntityOnFireComponent;
|
|
3222
3314
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3223
3315
|
'player.hunger': EntityHungerComponent;
|
|
@@ -3237,6 +3329,15 @@ export type EntityComponentTypeMap = {
|
|
|
3237
3329
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3238
3330
|
};
|
|
3239
3331
|
|
|
3332
|
+
/**
|
|
3333
|
+
* @beta
|
|
3334
|
+
*/
|
|
3335
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3336
|
+
? VanillaEntityIdentifier
|
|
3337
|
+
: T extends string
|
|
3338
|
+
? VanillaEntityIdentifier | T
|
|
3339
|
+
: never;
|
|
3340
|
+
|
|
3240
3341
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3241
3342
|
? ItemComponentTypeMap[T]
|
|
3242
3343
|
: ItemCustomComponentInstance;
|
|
@@ -3264,6 +3365,15 @@ export type ItemComponentTypeMap = {
|
|
|
3264
3365
|
potion: ItemPotionComponent;
|
|
3265
3366
|
};
|
|
3266
3367
|
|
|
3368
|
+
/**
|
|
3369
|
+
* @beta
|
|
3370
|
+
*/
|
|
3371
|
+
export type VanillaEntityIdentifier =
|
|
3372
|
+
| EntityType
|
|
3373
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3374
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3375
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3376
|
+
|
|
3267
3377
|
/**
|
|
3268
3378
|
* Handle to an aim-assist category that exists in the
|
|
3269
3379
|
* world.aimAssist registry.
|
|
@@ -3421,7 +3531,9 @@ export class AimAssistCategorySettings {
|
|
|
3421
3531
|
* A record mapping block Ids to their priority settings.
|
|
3422
3532
|
* Larger numbers have greater priority.
|
|
3423
3533
|
*/
|
|
3424
|
-
setBlockPriorities(
|
|
3534
|
+
setBlockPriorities(
|
|
3535
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3536
|
+
): void;
|
|
3425
3537
|
/**
|
|
3426
3538
|
* @remarks
|
|
3427
3539
|
* Sets the priority settings used for block targeting.
|
|
@@ -3440,7 +3552,9 @@ export class AimAssistCategorySettings {
|
|
|
3440
3552
|
* A record mapping entity Ids to their priority settings.
|
|
3441
3553
|
* Larger numbers have greater priority.
|
|
3442
3554
|
*/
|
|
3443
|
-
setEntityPriorities(
|
|
3555
|
+
setEntityPriorities(
|
|
3556
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3557
|
+
): void;
|
|
3444
3558
|
/**
|
|
3445
3559
|
* @remarks
|
|
3446
3560
|
* Sets the priority settings used for entity targeting.
|
|
@@ -3639,8 +3753,10 @@ export class AimAssistPresetSettings {
|
|
|
3639
3753
|
*
|
|
3640
3754
|
* This function can't be called in restricted-execution mode.
|
|
3641
3755
|
*
|
|
3756
|
+
* @param targets
|
|
3757
|
+
* An array of block tags.
|
|
3642
3758
|
*/
|
|
3643
|
-
setExcludedBlockTagTargets(
|
|
3759
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3644
3760
|
/**
|
|
3645
3761
|
* @remarks
|
|
3646
3762
|
* Sets the list of block Ids to exclude from aim assist
|
|
@@ -3648,8 +3764,10 @@ export class AimAssistPresetSettings {
|
|
|
3648
3764
|
*
|
|
3649
3765
|
* This function can't be called in restricted-execution mode.
|
|
3650
3766
|
*
|
|
3767
|
+
* @param targets
|
|
3768
|
+
* An array of block Ids.
|
|
3651
3769
|
*/
|
|
3652
|
-
setExcludedBlockTargets(
|
|
3770
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3653
3771
|
/**
|
|
3654
3772
|
* @remarks
|
|
3655
3773
|
* Sets the list of entity Ids to exclude from aim assist
|
|
@@ -3657,8 +3775,10 @@ export class AimAssistPresetSettings {
|
|
|
3657
3775
|
*
|
|
3658
3776
|
* This function can't be called in restricted-execution mode.
|
|
3659
3777
|
*
|
|
3778
|
+
* @param targets
|
|
3779
|
+
* An array of entity Ids.
|
|
3660
3780
|
*/
|
|
3661
|
-
setExcludedEntityTargets(
|
|
3781
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3662
3782
|
/**
|
|
3663
3783
|
* @remarks
|
|
3664
3784
|
* Sets the list of entity type families to exclude from aim
|
|
@@ -3666,8 +3786,10 @@ export class AimAssistPresetSettings {
|
|
|
3666
3786
|
*
|
|
3667
3787
|
* This function can't be called in restricted-execution mode.
|
|
3668
3788
|
*
|
|
3789
|
+
* @param targets
|
|
3790
|
+
* An array of entity type families.
|
|
3669
3791
|
*/
|
|
3670
|
-
setExcludedEntityTypeFamilyTargets(
|
|
3792
|
+
setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
|
|
3671
3793
|
/**
|
|
3672
3794
|
* @remarks
|
|
3673
3795
|
* Sets the per-item aim-assist category Ids.
|
|
@@ -3678,7 +3800,7 @@ export class AimAssistPresetSettings {
|
|
|
3678
3800
|
* A record mapping item Ids to aim-assist category Ids.
|
|
3679
3801
|
* Category Ids must have a namespace.
|
|
3680
3802
|
*/
|
|
3681
|
-
setItemSettings(itemSettings: Record<string, string>): void;
|
|
3803
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3682
3804
|
/**
|
|
3683
3805
|
* @remarks
|
|
3684
3806
|
* Sets the list of item Ids that will target liquid blocks
|
|
@@ -3689,7 +3811,7 @@ export class AimAssistPresetSettings {
|
|
|
3689
3811
|
* @param items
|
|
3690
3812
|
* An array of item Ids.
|
|
3691
3813
|
*/
|
|
3692
|
-
setLiquidTargetingItems(items?: string[]): void;
|
|
3814
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3693
3815
|
}
|
|
3694
3816
|
|
|
3695
3817
|
/**
|
|
@@ -3795,6 +3917,28 @@ export class AimAssistRegistry {
|
|
|
3795
3917
|
getPresets(): AimAssistPreset[];
|
|
3796
3918
|
}
|
|
3797
3919
|
|
|
3920
|
+
/**
|
|
3921
|
+
* @beta
|
|
3922
|
+
* Describes a single banner pattern, which includes a colour
|
|
3923
|
+
* and a pattern type.
|
|
3924
|
+
*/
|
|
3925
|
+
export class BannerPattern {
|
|
3926
|
+
private constructor();
|
|
3927
|
+
/**
|
|
3928
|
+
* @remarks
|
|
3929
|
+
* The color to apply to this banner pattern.
|
|
3930
|
+
*
|
|
3931
|
+
*/
|
|
3932
|
+
readonly color: string;
|
|
3933
|
+
/**
|
|
3934
|
+
* @remarks
|
|
3935
|
+
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
3936
|
+
* apply to the banner.
|
|
3937
|
+
*
|
|
3938
|
+
*/
|
|
3939
|
+
readonly pattern: string;
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3798
3942
|
/**
|
|
3799
3943
|
* Describes a type of biome.
|
|
3800
3944
|
*/
|
|
@@ -3888,6 +4032,20 @@ export class Block {
|
|
|
3888
4032
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3889
4033
|
*/
|
|
3890
4034
|
readonly isLiquid: boolean;
|
|
4035
|
+
/**
|
|
4036
|
+
* @beta
|
|
4037
|
+
* @remarks
|
|
4038
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
4039
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
4040
|
+
* ladder block and a fence block are not).
|
|
4041
|
+
*
|
|
4042
|
+
* @throws This property can throw when used.
|
|
4043
|
+
*
|
|
4044
|
+
* {@link LocationInUnloadedChunkError}
|
|
4045
|
+
*
|
|
4046
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4047
|
+
*/
|
|
4048
|
+
readonly isSolid: boolean;
|
|
3891
4049
|
/**
|
|
3892
4050
|
* @remarks
|
|
3893
4051
|
* Returns true if this reference to a block is still valid
|
|
@@ -4053,6 +4211,30 @@ export class Block {
|
|
|
4053
4211
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4054
4212
|
*/
|
|
4055
4213
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4214
|
+
/**
|
|
4215
|
+
* @beta
|
|
4216
|
+
* @remarks
|
|
4217
|
+
* Checks to see whether it is valid to place the specified
|
|
4218
|
+
* block type or block permutation, on a specified face on this
|
|
4219
|
+
* block.
|
|
4220
|
+
*
|
|
4221
|
+
* @param blockToPlace
|
|
4222
|
+
* Block type or block permutation to check placement for.
|
|
4223
|
+
* @param faceToPlaceOn
|
|
4224
|
+
* Optional specific face of this block to check placement
|
|
4225
|
+
* against.
|
|
4226
|
+
* @returns
|
|
4227
|
+
* Returns `true` if the block type or permutation can be
|
|
4228
|
+
* placed on this block, else `false`.
|
|
4229
|
+
* @throws This function can throw errors.
|
|
4230
|
+
*
|
|
4231
|
+
* {@link Error}
|
|
4232
|
+
*
|
|
4233
|
+
* {@link LocationInUnloadedChunkError}
|
|
4234
|
+
*
|
|
4235
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4236
|
+
*/
|
|
4237
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
4056
4238
|
/**
|
|
4057
4239
|
* @remarks
|
|
4058
4240
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -4149,6 +4331,15 @@ export class Block {
|
|
|
4149
4331
|
* {@link LocationInUnloadedChunkError}
|
|
4150
4332
|
*/
|
|
4151
4333
|
getLightLevel(): number;
|
|
4334
|
+
/**
|
|
4335
|
+
* @beta
|
|
4336
|
+
* @throws This function can throw errors.
|
|
4337
|
+
*
|
|
4338
|
+
* {@link LocationInUnloadedChunkError}
|
|
4339
|
+
*
|
|
4340
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4341
|
+
*/
|
|
4342
|
+
getMapColor(): RGBA;
|
|
4152
4343
|
/**
|
|
4153
4344
|
* @rc
|
|
4154
4345
|
* @remarks
|
|
@@ -4430,6 +4621,27 @@ export class Block {
|
|
|
4430
4621
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4431
4622
|
*/
|
|
4432
4623
|
south(steps?: number): Block | undefined;
|
|
4624
|
+
/**
|
|
4625
|
+
* @beta
|
|
4626
|
+
* @remarks
|
|
4627
|
+
* Tries to set the block in the dimension to the state of the
|
|
4628
|
+
* permutation by first checking if the placement is valid.
|
|
4629
|
+
*
|
|
4630
|
+
* This function can't be called in restricted-execution mode.
|
|
4631
|
+
*
|
|
4632
|
+
* @param permutation
|
|
4633
|
+
* Permutation that contains a set of property states for the
|
|
4634
|
+
* Block.
|
|
4635
|
+
* @returns
|
|
4636
|
+
* Returns `true` if the block permutation data was
|
|
4637
|
+
* successfully set, else `false`.
|
|
4638
|
+
* @throws This function can throw errors.
|
|
4639
|
+
*
|
|
4640
|
+
* {@link LocationInUnloadedChunkError}
|
|
4641
|
+
*
|
|
4642
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4643
|
+
*/
|
|
4644
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4433
4645
|
/**
|
|
4434
4646
|
* @remarks
|
|
4435
4647
|
* Returns the {@link Block} to the west of this block
|
|
@@ -4447,6 +4659,137 @@ export class Block {
|
|
|
4447
4659
|
west(steps?: number): Block | undefined;
|
|
4448
4660
|
}
|
|
4449
4661
|
|
|
4662
|
+
/**
|
|
4663
|
+
* @beta
|
|
4664
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4665
|
+
* of useful functions for the creation and utility of {@link
|
|
4666
|
+
* BlockBoundingBox} objects
|
|
4667
|
+
*/
|
|
4668
|
+
export class BlockBoundingBoxUtils {
|
|
4669
|
+
private constructor();
|
|
4670
|
+
/**
|
|
4671
|
+
* @remarks
|
|
4672
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4673
|
+
* where the min and max components are guaranteed to be (min
|
|
4674
|
+
* <= max)
|
|
4675
|
+
*
|
|
4676
|
+
* This function can't be called in restricted-execution mode.
|
|
4677
|
+
*
|
|
4678
|
+
* @param min
|
|
4679
|
+
* A corner world location
|
|
4680
|
+
* @param max
|
|
4681
|
+
* A corner world location diametrically opposite
|
|
4682
|
+
*/
|
|
4683
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4684
|
+
/**
|
|
4685
|
+
* @remarks
|
|
4686
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4687
|
+
* each axis.
|
|
4688
|
+
* Sizes can be negative to perform contraction.
|
|
4689
|
+
* Note: corners can be inverted if the contraction size is
|
|
4690
|
+
* greater than the span, but the min/max relationship will
|
|
4691
|
+
* remain correct
|
|
4692
|
+
*
|
|
4693
|
+
* This function can't be called in restricted-execution mode.
|
|
4694
|
+
*
|
|
4695
|
+
* @returns
|
|
4696
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4697
|
+
* the changes
|
|
4698
|
+
*/
|
|
4699
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4700
|
+
/**
|
|
4701
|
+
* @remarks
|
|
4702
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4703
|
+
*
|
|
4704
|
+
* This function can't be called in restricted-execution mode.
|
|
4705
|
+
*
|
|
4706
|
+
*/
|
|
4707
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4708
|
+
/**
|
|
4709
|
+
* @remarks
|
|
4710
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4711
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4712
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4713
|
+
* boxes.
|
|
4714
|
+
*
|
|
4715
|
+
* This function can't be called in restricted-execution mode.
|
|
4716
|
+
*
|
|
4717
|
+
* @returns
|
|
4718
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4719
|
+
* smallest possible bounding box which can encompass both
|
|
4720
|
+
*/
|
|
4721
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4722
|
+
/**
|
|
4723
|
+
* @remarks
|
|
4724
|
+
* Calculate the center block of a given {@link
|
|
4725
|
+
* BlockBoundingBox} object.
|
|
4726
|
+
*
|
|
4727
|
+
* This function can't be called in restricted-execution mode.
|
|
4728
|
+
*
|
|
4729
|
+
* @returns
|
|
4730
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4731
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4732
|
+
* bounds are not mathematically centered...
|
|
4733
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4734
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4735
|
+
*/
|
|
4736
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4737
|
+
/**
|
|
4738
|
+
* @remarks
|
|
4739
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4740
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4741
|
+
*
|
|
4742
|
+
* This function can't be called in restricted-execution mode.
|
|
4743
|
+
*
|
|
4744
|
+
*/
|
|
4745
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4746
|
+
/**
|
|
4747
|
+
* @remarks
|
|
4748
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4749
|
+
*
|
|
4750
|
+
* This function can't be called in restricted-execution mode.
|
|
4751
|
+
*
|
|
4752
|
+
*/
|
|
4753
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4754
|
+
/**
|
|
4755
|
+
* @remarks
|
|
4756
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4757
|
+
*
|
|
4758
|
+
* This function can't be called in restricted-execution mode.
|
|
4759
|
+
*
|
|
4760
|
+
*/
|
|
4761
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4762
|
+
/**
|
|
4763
|
+
* @remarks
|
|
4764
|
+
* Check to see if a given coordinate is inside a
|
|
4765
|
+
* BlockBoundingBox
|
|
4766
|
+
*
|
|
4767
|
+
* This function can't be called in restricted-execution mode.
|
|
4768
|
+
*
|
|
4769
|
+
*/
|
|
4770
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4771
|
+
/**
|
|
4772
|
+
* @remarks
|
|
4773
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4774
|
+
* max))
|
|
4775
|
+
*
|
|
4776
|
+
* This function can't be called in restricted-execution mode.
|
|
4777
|
+
*
|
|
4778
|
+
*/
|
|
4779
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4780
|
+
/**
|
|
4781
|
+
* @remarks
|
|
4782
|
+
* Move a BlockBoundingBox by a given amount
|
|
4783
|
+
*
|
|
4784
|
+
* This function can't be called in restricted-execution mode.
|
|
4785
|
+
*
|
|
4786
|
+
* @returns
|
|
4787
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4788
|
+
* change
|
|
4789
|
+
*/
|
|
4790
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4791
|
+
}
|
|
4792
|
+
|
|
4450
4793
|
/**
|
|
4451
4794
|
* Base type for components associated with blocks.
|
|
4452
4795
|
*/
|
|
@@ -4669,6 +5012,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
|
|
|
4669
5012
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4670
5013
|
export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
|
|
4671
5014
|
private constructor();
|
|
5015
|
+
/**
|
|
5016
|
+
* @beta
|
|
5017
|
+
* @remarks
|
|
5018
|
+
* The first update event for the redstone component.
|
|
5019
|
+
*
|
|
5020
|
+
*/
|
|
5021
|
+
readonly firstUpdate: boolean;
|
|
4672
5022
|
/**
|
|
4673
5023
|
* @remarks
|
|
4674
5024
|
* The redstone signal strength passing through this block. It
|
|
@@ -5225,6 +5575,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
5225
5575
|
*
|
|
5226
5576
|
*/
|
|
5227
5577
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5578
|
+
/**
|
|
5579
|
+
* @beta
|
|
5580
|
+
* @remarks
|
|
5581
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5582
|
+
* Will return false if the block volume was modified between
|
|
5583
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5584
|
+
*
|
|
5585
|
+
* @throws This function can throw errors.
|
|
5586
|
+
*
|
|
5587
|
+
* {@link minecraftcommon.EngineError}
|
|
5588
|
+
*/
|
|
5589
|
+
isValid(): boolean;
|
|
5228
5590
|
/**
|
|
5229
5591
|
* @remarks
|
|
5230
5592
|
* This function can't be called in restricted-execution mode.
|
|
@@ -6140,6 +6502,15 @@ export class BlockVolumeBase {
|
|
|
6140
6502
|
*
|
|
6141
6503
|
*/
|
|
6142
6504
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
6505
|
+
/**
|
|
6506
|
+
* @beta
|
|
6507
|
+
* @remarks
|
|
6508
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
6509
|
+
* the validated min and max coordinates of the volume
|
|
6510
|
+
*
|
|
6511
|
+
* @throws This function can throw errors.
|
|
6512
|
+
*/
|
|
6513
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6143
6514
|
/**
|
|
6144
6515
|
* @remarks
|
|
6145
6516
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -6414,6 +6785,23 @@ export class Camera {
|
|
|
6414
6785
|
| CameraSetRotOptions
|
|
6415
6786
|
| CameraTargetOptions,
|
|
6416
6787
|
): void;
|
|
6788
|
+
/**
|
|
6789
|
+
* @beta
|
|
6790
|
+
* @remarks
|
|
6791
|
+
* Sets the current active camera with easing.
|
|
6792
|
+
*
|
|
6793
|
+
* This function can't be called in restricted-execution mode.
|
|
6794
|
+
*
|
|
6795
|
+
* @param cameraPreset
|
|
6796
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6797
|
+
* @param easeOptions
|
|
6798
|
+
* Options to ease the camera from the previous camera to the
|
|
6799
|
+
* current one.
|
|
6800
|
+
* @throws
|
|
6801
|
+
* Throws when easing to minecraft:first_person presets
|
|
6802
|
+
* currently without the experimental cameras toggle enabled.
|
|
6803
|
+
*/
|
|
6804
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
6417
6805
|
/**
|
|
6418
6806
|
* @remarks
|
|
6419
6807
|
* Sets the current active camera for the specified player and
|
|
@@ -6449,6 +6837,24 @@ export class Camera {
|
|
|
6449
6837
|
stopShaking(): void;
|
|
6450
6838
|
}
|
|
6451
6839
|
|
|
6840
|
+
/**
|
|
6841
|
+
* @beta
|
|
6842
|
+
* Loot item function that will try to copy the block entity
|
|
6843
|
+
* data from the destroyed block to the dropped item.
|
|
6844
|
+
*/
|
|
6845
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6846
|
+
export class CarryOverBlockEntityDataFunction extends LootItemFunction {
|
|
6847
|
+
private constructor();
|
|
6848
|
+
/**
|
|
6849
|
+
* @remarks
|
|
6850
|
+
* If true, and if the block entity had dynamic_properties, the
|
|
6851
|
+
* function will copy the dynamic properties from the block
|
|
6852
|
+
* entity to the dropped item.
|
|
6853
|
+
*
|
|
6854
|
+
*/
|
|
6855
|
+
readonly dynamicProperties: boolean;
|
|
6856
|
+
}
|
|
6857
|
+
|
|
6452
6858
|
/**
|
|
6453
6859
|
* CatmullRom spline creation.
|
|
6454
6860
|
*/
|
|
@@ -6464,54 +6870,213 @@ export class CatmullRomSpline {
|
|
|
6464
6870
|
}
|
|
6465
6871
|
|
|
6466
6872
|
/**
|
|
6467
|
-
*
|
|
6873
|
+
* @beta
|
|
6874
|
+
* An event that fires as players enter chat messages.
|
|
6468
6875
|
*/
|
|
6469
|
-
|
|
6470
|
-
export class ClientSystemInfo extends SystemInfo {
|
|
6876
|
+
export class ChatSendAfterEvent {
|
|
6471
6877
|
private constructor();
|
|
6472
6878
|
/**
|
|
6473
6879
|
* @remarks
|
|
6474
|
-
*
|
|
6475
|
-
* ja_JP). Note that in most cases, server scripts should not
|
|
6476
|
-
* use this property to manually localize text. Instead, use
|
|
6477
|
-
* {@link RawMessage} with a translate field to send
|
|
6478
|
-
* localization keys, allowing each client to resolve them in
|
|
6479
|
-
* their own language automatically. Direct use of locale for
|
|
6480
|
-
* localization is fragile and may produce unexpected results
|
|
6481
|
-
* when players with different languages are on the same
|
|
6482
|
-
* server.
|
|
6880
|
+
* Message that is being broadcast.
|
|
6483
6881
|
*
|
|
6484
6882
|
*/
|
|
6485
|
-
readonly
|
|
6883
|
+
readonly message: string;
|
|
6486
6884
|
/**
|
|
6487
6885
|
* @remarks
|
|
6488
|
-
*
|
|
6886
|
+
* Player that sent the chat message.
|
|
6489
6887
|
*
|
|
6490
6888
|
*/
|
|
6491
|
-
readonly
|
|
6889
|
+
readonly sender: Player;
|
|
6492
6890
|
/**
|
|
6493
6891
|
* @remarks
|
|
6494
|
-
*
|
|
6892
|
+
* Optional list of players that will receive this message. If
|
|
6893
|
+
* defined, this message is directly targeted to one or more
|
|
6894
|
+
* players (i.e., is not broadcast.)
|
|
6495
6895
|
*
|
|
6496
6896
|
*/
|
|
6497
|
-
readonly
|
|
6897
|
+
readonly targets?: Player[];
|
|
6498
6898
|
}
|
|
6499
6899
|
|
|
6500
6900
|
/**
|
|
6501
|
-
*
|
|
6901
|
+
* @beta
|
|
6902
|
+
* Manages callbacks that are connected to chat messages being
|
|
6903
|
+
* sent.
|
|
6502
6904
|
*/
|
|
6503
|
-
export class
|
|
6905
|
+
export class ChatSendAfterEventSignal {
|
|
6504
6906
|
private constructor();
|
|
6505
6907
|
/**
|
|
6506
6908
|
* @remarks
|
|
6507
|
-
*
|
|
6508
|
-
*
|
|
6509
|
-
*
|
|
6909
|
+
* Adds a callback that will be called when new chat messages
|
|
6910
|
+
* are sent.
|
|
6911
|
+
*
|
|
6912
|
+
* This function can't be called in restricted-execution mode.
|
|
6913
|
+
*
|
|
6914
|
+
* This function can be called in early-execution mode.
|
|
6510
6915
|
*
|
|
6511
6916
|
*/
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6917
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
6918
|
+
/**
|
|
6919
|
+
* @remarks
|
|
6920
|
+
* Removes a callback from being called when new chat messages
|
|
6921
|
+
* are sent.
|
|
6922
|
+
*
|
|
6923
|
+
* This function can't be called in restricted-execution mode.
|
|
6924
|
+
*
|
|
6925
|
+
* This function can be called in early-execution mode.
|
|
6926
|
+
*
|
|
6927
|
+
*/
|
|
6928
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
6929
|
+
}
|
|
6930
|
+
|
|
6931
|
+
/**
|
|
6932
|
+
* @beta
|
|
6933
|
+
* An event that fires as players enter chat messages.
|
|
6934
|
+
*/
|
|
6935
|
+
export class ChatSendBeforeEvent {
|
|
6936
|
+
private constructor();
|
|
6937
|
+
/**
|
|
6938
|
+
* @remarks
|
|
6939
|
+
* If set to true in a beforeChat event handler, this message
|
|
6940
|
+
* is not broadcast out.
|
|
6941
|
+
*
|
|
6942
|
+
*/
|
|
6943
|
+
cancel: boolean;
|
|
6944
|
+
/**
|
|
6945
|
+
* @remarks
|
|
6946
|
+
* Message that is being broadcast.
|
|
6947
|
+
*
|
|
6948
|
+
*/
|
|
6949
|
+
readonly message: string;
|
|
6950
|
+
/**
|
|
6951
|
+
* @remarks
|
|
6952
|
+
* Player that sent the chat message.
|
|
6953
|
+
*
|
|
6954
|
+
*/
|
|
6955
|
+
readonly sender: Player;
|
|
6956
|
+
/**
|
|
6957
|
+
* @remarks
|
|
6958
|
+
* Optional list of players that will receive this message. If
|
|
6959
|
+
* defined, this message is directly targeted to one or more
|
|
6960
|
+
* players (i.e., is not broadcast). This list can be modified
|
|
6961
|
+
* to change the message recipients.
|
|
6962
|
+
*
|
|
6963
|
+
*/
|
|
6964
|
+
targets?: Player[];
|
|
6965
|
+
}
|
|
6966
|
+
|
|
6967
|
+
/**
|
|
6968
|
+
* @beta
|
|
6969
|
+
* Manages callbacks that are connected to an event that fires
|
|
6970
|
+
* before chat messages are sent.
|
|
6971
|
+
* @example customCommand.ts
|
|
6972
|
+
* ```typescript
|
|
6973
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
6974
|
+
*
|
|
6975
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
6976
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
6977
|
+
* if (eventData.message.includes('cancel')) {
|
|
6978
|
+
* // Cancel event if the message contains "cancel"
|
|
6979
|
+
* eventData.cancel = true;
|
|
6980
|
+
* } else {
|
|
6981
|
+
* const args = eventData.message.split(' ');
|
|
6982
|
+
*
|
|
6983
|
+
* if (args.length > 0) {
|
|
6984
|
+
* switch (args[0].toLowerCase()) {
|
|
6985
|
+
* case 'echo':
|
|
6986
|
+
* // Send a modified version of chat message
|
|
6987
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
6988
|
+
* break;
|
|
6989
|
+
* case 'help':
|
|
6990
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
6991
|
+
* break;
|
|
6992
|
+
* }
|
|
6993
|
+
* }
|
|
6994
|
+
* }
|
|
6995
|
+
* });
|
|
6996
|
+
* }
|
|
6997
|
+
* ```
|
|
6998
|
+
*/
|
|
6999
|
+
export class ChatSendBeforeEventSignal {
|
|
7000
|
+
private constructor();
|
|
7001
|
+
/**
|
|
7002
|
+
* @remarks
|
|
7003
|
+
* Adds a callback that will be called before new chat messages
|
|
7004
|
+
* are sent.
|
|
7005
|
+
*
|
|
7006
|
+
* This function can't be called in restricted-execution mode.
|
|
7007
|
+
*
|
|
7008
|
+
* This function can be called in early-execution mode.
|
|
7009
|
+
*
|
|
7010
|
+
* @param callback
|
|
7011
|
+
* This closure is called with restricted-execution privilege.
|
|
7012
|
+
* @returns
|
|
7013
|
+
* Closure that is called with restricted-execution privilege.
|
|
7014
|
+
*/
|
|
7015
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
7016
|
+
/**
|
|
7017
|
+
* @remarks
|
|
7018
|
+
* Removes a callback from being called before new chat
|
|
7019
|
+
* messages are sent.
|
|
7020
|
+
*
|
|
7021
|
+
* This function can't be called in restricted-execution mode.
|
|
7022
|
+
*
|
|
7023
|
+
* This function can be called in early-execution mode.
|
|
7024
|
+
*
|
|
7025
|
+
* @param callback
|
|
7026
|
+
* This closure is called with restricted-execution privilege.
|
|
7027
|
+
*/
|
|
7028
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
7029
|
+
}
|
|
7030
|
+
|
|
7031
|
+
/**
|
|
7032
|
+
* Contains the device information for a client instance.
|
|
7033
|
+
*/
|
|
7034
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
7035
|
+
export class ClientSystemInfo extends SystemInfo {
|
|
7036
|
+
private constructor();
|
|
7037
|
+
/**
|
|
7038
|
+
* @remarks
|
|
7039
|
+
* The locale selected by the client (e.g., en_US, fr_FR,
|
|
7040
|
+
* ja_JP). Note that in most cases, server scripts should not
|
|
7041
|
+
* use this property to manually localize text. Instead, use
|
|
7042
|
+
* {@link RawMessage} with a translate field to send
|
|
7043
|
+
* localization keys, allowing each client to resolve them in
|
|
7044
|
+
* their own language automatically. Direct use of locale for
|
|
7045
|
+
* localization is fragile and may produce unexpected results
|
|
7046
|
+
* when players with different languages are on the same
|
|
7047
|
+
* server.
|
|
7048
|
+
*
|
|
7049
|
+
*/
|
|
7050
|
+
readonly locale: string;
|
|
7051
|
+
/**
|
|
7052
|
+
* @remarks
|
|
7053
|
+
* The max render distance for the device in chunks.
|
|
7054
|
+
*
|
|
7055
|
+
*/
|
|
7056
|
+
readonly maxRenderDistance: number;
|
|
7057
|
+
/**
|
|
7058
|
+
* @remarks
|
|
7059
|
+
* The platform type of the device.
|
|
7060
|
+
*
|
|
7061
|
+
*/
|
|
7062
|
+
readonly platformType: PlatformType;
|
|
7063
|
+
}
|
|
7064
|
+
|
|
7065
|
+
/**
|
|
7066
|
+
* Contains return data on the result of a command execution.
|
|
7067
|
+
*/
|
|
7068
|
+
export class CommandResult {
|
|
7069
|
+
private constructor();
|
|
7070
|
+
/**
|
|
7071
|
+
* @remarks
|
|
7072
|
+
* If the command operates against a number of entities,
|
|
7073
|
+
* blocks, or items, this returns the number of successful
|
|
7074
|
+
* applications of this command.
|
|
7075
|
+
*
|
|
7076
|
+
*/
|
|
7077
|
+
readonly successCount: number;
|
|
7078
|
+
}
|
|
7079
|
+
|
|
6515
7080
|
/**
|
|
6516
7081
|
* Base class for downstream Component implementations.
|
|
6517
7082
|
*/
|
|
@@ -6671,7 +7236,9 @@ export class Container {
|
|
|
6671
7236
|
*
|
|
6672
7237
|
* @param itemStack
|
|
6673
7238
|
* The stack of items to add.
|
|
6674
|
-
* @throws
|
|
7239
|
+
* @throws
|
|
7240
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7241
|
+
* limit but will instead add items up to the weight limit.
|
|
6675
7242
|
*
|
|
6676
7243
|
* {@link ContainerRulesError}
|
|
6677
7244
|
*
|
|
@@ -6909,6 +7476,8 @@ export class Container {
|
|
|
6909
7476
|
* @throws
|
|
6910
7477
|
* Throws if either this container or `toContainer` are invalid
|
|
6911
7478
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
7479
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7480
|
+
* limit but will instead add items up to the weight limit.
|
|
6912
7481
|
*
|
|
6913
7482
|
* {@link ContainerRulesError}
|
|
6914
7483
|
*
|
|
@@ -7567,6 +8136,40 @@ export class Dimension {
|
|
|
7567
8136
|
biomeToFind: BiomeType | string,
|
|
7568
8137
|
options?: BiomeSearchOptions,
|
|
7569
8138
|
): Vector3 | undefined;
|
|
8139
|
+
/**
|
|
8140
|
+
* @beta
|
|
8141
|
+
* @remarks
|
|
8142
|
+
* Clones a region of blocks from one area of the dimension to
|
|
8143
|
+
* another.
|
|
8144
|
+
*
|
|
8145
|
+
* This function can't be called in restricted-execution mode.
|
|
8146
|
+
*
|
|
8147
|
+
* @param beginLocation
|
|
8148
|
+
* The lower northwest starting corner of the area to clone
|
|
8149
|
+
* from.
|
|
8150
|
+
* @param endLocation
|
|
8151
|
+
* The upper southeast ending corner of the area to clone from.
|
|
8152
|
+
* @param destination
|
|
8153
|
+
* The lower northwest starting corner of the area to clone to.
|
|
8154
|
+
* @param cloneMode
|
|
8155
|
+
* Specifies how the cloned blocks should be placed at the
|
|
8156
|
+
* destination.
|
|
8157
|
+
* @param filter
|
|
8158
|
+
* An optional block filter used to include only matching
|
|
8159
|
+
* blocks from the source area.
|
|
8160
|
+
* @throws This function can throw errors.
|
|
8161
|
+
*
|
|
8162
|
+
* {@link Error}
|
|
8163
|
+
*
|
|
8164
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8165
|
+
*/
|
|
8166
|
+
cloneBlocks(
|
|
8167
|
+
beginLocation: Vector3,
|
|
8168
|
+
endLocation: Vector3,
|
|
8169
|
+
destination: Vector3,
|
|
8170
|
+
cloneMode: CloneMode,
|
|
8171
|
+
filter?: BlockFilter,
|
|
8172
|
+
): void;
|
|
7570
8173
|
/**
|
|
7571
8174
|
* @remarks
|
|
7572
8175
|
* Checks if an area contains the specified biomes. If the area
|
|
@@ -7807,10 +8410,14 @@ export class Dimension {
|
|
|
7807
8410
|
/**
|
|
7808
8411
|
* @rc
|
|
7809
8412
|
* @remarks
|
|
7810
|
-
* Gets all the blocks in a volume that satisfy the
|
|
8413
|
+
* Gets all the blocks in a volume that satisfy the block query
|
|
8414
|
+
* options.
|
|
7811
8415
|
*
|
|
7812
8416
|
* @param volume
|
|
7813
8417
|
* Volume of blocks that will be checked.
|
|
8418
|
+
* @param options
|
|
8419
|
+
* Block query options including filter criteria and optional
|
|
8420
|
+
* closest/farthest distance sorting from a location.
|
|
7814
8421
|
* @param allowUnloadedChunks
|
|
7815
8422
|
* If set to true will suppress the UnloadedChunksError if some
|
|
7816
8423
|
* or all of the block volume is outside of the loaded chunks.
|
|
@@ -7819,7 +8426,7 @@ export class Dimension {
|
|
|
7819
8426
|
* Defaults to: false
|
|
7820
8427
|
* @returns
|
|
7821
8428
|
* Returns the ListBlockVolume that contains all the block
|
|
7822
|
-
* locations that satisfied the block
|
|
8429
|
+
* locations that satisfied the block query options.
|
|
7823
8430
|
* @throws This function can throw errors.
|
|
7824
8431
|
*
|
|
7825
8432
|
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
@@ -7944,6 +8551,26 @@ export class Dimension {
|
|
|
7944
8551
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7945
8552
|
*/
|
|
7946
8553
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8554
|
+
/**
|
|
8555
|
+
* @beta
|
|
8556
|
+
* @remarks
|
|
8557
|
+
* Returns a vector of generated structures that contain the
|
|
8558
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
8559
|
+
* The vector will be empty if no structures are found.
|
|
8560
|
+
*
|
|
8561
|
+
* @param location
|
|
8562
|
+
* Location at which to check for structures.
|
|
8563
|
+
* @throws
|
|
8564
|
+
* An error will be thrown if the location is out of world
|
|
8565
|
+
* bounds.
|
|
8566
|
+
* An error will be thrown if the location is in an unloaded
|
|
8567
|
+
* chunk.
|
|
8568
|
+
*
|
|
8569
|
+
* {@link LocationInUnloadedChunkError}
|
|
8570
|
+
*
|
|
8571
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8572
|
+
*/
|
|
8573
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
7947
8574
|
/**
|
|
7948
8575
|
* @remarks
|
|
7949
8576
|
* Returns the total brightness level of light shining on a
|
|
@@ -8005,6 +8632,16 @@ export class Dimension {
|
|
|
8005
8632
|
* @throws This function can throw errors.
|
|
8006
8633
|
*/
|
|
8007
8634
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
8635
|
+
/**
|
|
8636
|
+
* @beta
|
|
8637
|
+
* @remarks
|
|
8638
|
+
* Returns the current weather.
|
|
8639
|
+
*
|
|
8640
|
+
* @returns
|
|
8641
|
+
* Returns a WeatherType that explains the broad category of
|
|
8642
|
+
* weather that is currently going on.
|
|
8643
|
+
*/
|
|
8644
|
+
getWeather(): WeatherType;
|
|
8008
8645
|
/**
|
|
8009
8646
|
* @remarks
|
|
8010
8647
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -8250,7 +8887,11 @@ export class Dimension {
|
|
|
8250
8887
|
* }
|
|
8251
8888
|
* ```
|
|
8252
8889
|
*/
|
|
8253
|
-
spawnEntity
|
|
8890
|
+
spawnEntity<T = never>(
|
|
8891
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
8892
|
+
location: Vector3,
|
|
8893
|
+
options?: SpawnEntityOptions,
|
|
8894
|
+
): Entity;
|
|
8254
8895
|
/**
|
|
8255
8896
|
* @remarks
|
|
8256
8897
|
* Creates a new item stack as an entity at the specified
|
|
@@ -8345,6 +8986,46 @@ export class Dimension {
|
|
|
8345
8986
|
* ```
|
|
8346
8987
|
*/
|
|
8347
8988
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
8989
|
+
/**
|
|
8990
|
+
* @beta
|
|
8991
|
+
* @remarks
|
|
8992
|
+
* Spawns an experience orb at a specified location in the
|
|
8993
|
+
* dimension.
|
|
8994
|
+
*
|
|
8995
|
+
* This function can't be called in restricted-execution mode.
|
|
8996
|
+
*
|
|
8997
|
+
* @param location
|
|
8998
|
+
* The location at which to spawn the experience orb.
|
|
8999
|
+
* @param amount
|
|
9000
|
+
* The amount of experience to give the experience orb.
|
|
9001
|
+
* Bounds: [1, 12000]
|
|
9002
|
+
* @throws This function can throw errors.
|
|
9003
|
+
*
|
|
9004
|
+
* {@link LocationInUnloadedChunkError}
|
|
9005
|
+
*
|
|
9006
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
9007
|
+
*/
|
|
9008
|
+
spawnXp(location: Vector3, amount: number): void;
|
|
9009
|
+
/**
|
|
9010
|
+
* @beta
|
|
9011
|
+
* @remarks
|
|
9012
|
+
* Stops all sounds from playing for all players.
|
|
9013
|
+
*
|
|
9014
|
+
* This function can't be called in restricted-execution mode.
|
|
9015
|
+
*
|
|
9016
|
+
*/
|
|
9017
|
+
stopAllSounds(): void;
|
|
9018
|
+
/**
|
|
9019
|
+
* @beta
|
|
9020
|
+
* @remarks
|
|
9021
|
+
* Stops a sound from playing for all players.
|
|
9022
|
+
*
|
|
9023
|
+
* This function can't be called in restricted-execution mode.
|
|
9024
|
+
*
|
|
9025
|
+
* @param soundId
|
|
9026
|
+
* Identifier of the sound.
|
|
9027
|
+
*/
|
|
9028
|
+
stopSound(soundId: string): void;
|
|
8348
9029
|
}
|
|
8349
9030
|
|
|
8350
9031
|
/**
|
|
@@ -8924,6 +9605,18 @@ export class Entity {
|
|
|
8924
9605
|
*
|
|
8925
9606
|
*/
|
|
8926
9607
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
9608
|
+
/**
|
|
9609
|
+
* @beta
|
|
9610
|
+
* @remarks
|
|
9611
|
+
* Retrieves or sets an entity that is used as the target of
|
|
9612
|
+
* AI-related behaviors, like attacking. If the entity
|
|
9613
|
+
* currently has no target returns undefined.
|
|
9614
|
+
*
|
|
9615
|
+
* @throws This property can throw when used.
|
|
9616
|
+
*
|
|
9617
|
+
* {@link InvalidEntityError}
|
|
9618
|
+
*/
|
|
9619
|
+
readonly target?: Entity;
|
|
8927
9620
|
/**
|
|
8928
9621
|
* @remarks
|
|
8929
9622
|
* Identifier of the type of the entity - for example,
|
|
@@ -10164,6 +10857,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
10164
10857
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10165
10858
|
export class EntityBreathableComponent extends EntityComponent {
|
|
10166
10859
|
private constructor();
|
|
10860
|
+
/**
|
|
10861
|
+
* @beta
|
|
10862
|
+
* @remarks
|
|
10863
|
+
* The current air supply of the entity.
|
|
10864
|
+
*
|
|
10865
|
+
* This property can't be edited in restricted-execution mode.
|
|
10866
|
+
*
|
|
10867
|
+
* @throws
|
|
10868
|
+
* Will throw an error if the air supply is out of bounds
|
|
10869
|
+
* [suffocationTime, maxAirSupply].
|
|
10870
|
+
*/
|
|
10871
|
+
airSupply: number;
|
|
10167
10872
|
/**
|
|
10168
10873
|
* @remarks
|
|
10169
10874
|
* If true, this entity can breathe in air.
|
|
@@ -10192,6 +10897,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
10192
10897
|
* @throws This property can throw when used.
|
|
10193
10898
|
*/
|
|
10194
10899
|
readonly breathesWater: boolean;
|
|
10900
|
+
/**
|
|
10901
|
+
* @beta
|
|
10902
|
+
* @remarks
|
|
10903
|
+
* If true, the entity is able to breathe.
|
|
10904
|
+
*
|
|
10905
|
+
* @throws This property can throw when used.
|
|
10906
|
+
*/
|
|
10907
|
+
readonly canBreathe: boolean;
|
|
10195
10908
|
/**
|
|
10196
10909
|
* @remarks
|
|
10197
10910
|
* If true, this entity will have visible bubbles while in
|
|
@@ -12142,6 +12855,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
12142
12855
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
12143
12856
|
}
|
|
12144
12857
|
|
|
12858
|
+
/**
|
|
12859
|
+
* @beta
|
|
12860
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
12861
|
+
* name, and dialogue interactions.
|
|
12862
|
+
*/
|
|
12863
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12864
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
12865
|
+
private constructor();
|
|
12866
|
+
/**
|
|
12867
|
+
* @remarks
|
|
12868
|
+
* The DialogueScene that is opened when players first interact
|
|
12869
|
+
* with the NPC.
|
|
12870
|
+
*
|
|
12871
|
+
* This property can't be edited in restricted-execution mode.
|
|
12872
|
+
*
|
|
12873
|
+
*/
|
|
12874
|
+
defaultScene: string;
|
|
12875
|
+
/**
|
|
12876
|
+
* @remarks
|
|
12877
|
+
* The name of the NPC as it is displayed to players.
|
|
12878
|
+
*
|
|
12879
|
+
* This property can't be edited in restricted-execution mode.
|
|
12880
|
+
*
|
|
12881
|
+
*/
|
|
12882
|
+
name: string;
|
|
12883
|
+
/**
|
|
12884
|
+
* @remarks
|
|
12885
|
+
* The index of the skin the NPC will use.
|
|
12886
|
+
*
|
|
12887
|
+
* This property can't be edited in restricted-execution mode.
|
|
12888
|
+
*
|
|
12889
|
+
*/
|
|
12890
|
+
skinIndex: number;
|
|
12891
|
+
static readonly componentId = 'minecraft:npc';
|
|
12892
|
+
}
|
|
12893
|
+
|
|
12145
12894
|
/**
|
|
12146
12895
|
* When present on an entity, this entity is on fire.
|
|
12147
12896
|
* @example setOnFire.ts
|
|
@@ -13208,7 +13957,7 @@ export class EntityTypes {
|
|
|
13208
13957
|
* Retrieves an entity type using a string-based identifier.
|
|
13209
13958
|
*
|
|
13210
13959
|
*/
|
|
13211
|
-
static get(identifier:
|
|
13960
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
13212
13961
|
/**
|
|
13213
13962
|
* @remarks
|
|
13214
13963
|
* Retrieves a set of all entity types within this world.
|
|
@@ -13934,6 +14683,13 @@ export class GameRules {
|
|
|
13934
14683
|
*
|
|
13935
14684
|
*/
|
|
13936
14685
|
playersSleepingPercentage: number;
|
|
14686
|
+
/**
|
|
14687
|
+
* @beta
|
|
14688
|
+
* @remarks
|
|
14689
|
+
* This property can't be edited in restricted-execution mode.
|
|
14690
|
+
*
|
|
14691
|
+
*/
|
|
14692
|
+
playerWaypoints: PlayerWaypointsMode;
|
|
13937
14693
|
/**
|
|
13938
14694
|
* @remarks
|
|
13939
14695
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -16850,6 +17606,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
16850
17606
|
readonly itemTagsNone: string[];
|
|
16851
17607
|
}
|
|
16852
17608
|
|
|
17609
|
+
/**
|
|
17610
|
+
* @beta
|
|
17611
|
+
* A specific currently-internal event used for passing
|
|
17612
|
+
* messages from client to server.
|
|
17613
|
+
*/
|
|
17614
|
+
export class MessageReceiveAfterEvent {
|
|
17615
|
+
private constructor();
|
|
17616
|
+
/**
|
|
17617
|
+
* @remarks
|
|
17618
|
+
* The message identifier.
|
|
17619
|
+
*
|
|
17620
|
+
*/
|
|
17621
|
+
readonly id: string;
|
|
17622
|
+
/**
|
|
17623
|
+
* @remarks
|
|
17624
|
+
* The message.
|
|
17625
|
+
*
|
|
17626
|
+
*/
|
|
17627
|
+
readonly message: string;
|
|
17628
|
+
/**
|
|
17629
|
+
* @remarks
|
|
17630
|
+
* The player who sent the message.
|
|
17631
|
+
*
|
|
17632
|
+
*/
|
|
17633
|
+
readonly player: Player;
|
|
17634
|
+
}
|
|
17635
|
+
|
|
16853
17636
|
/**
|
|
16854
17637
|
* Contains a set of additional variable values for further
|
|
16855
17638
|
* defining how rendering and animations function.
|
|
@@ -16919,15 +17702,58 @@ export class MolangVariableMap {
|
|
|
16919
17702
|
}
|
|
16920
17703
|
|
|
16921
17704
|
/**
|
|
16922
|
-
*
|
|
16923
|
-
*
|
|
17705
|
+
* @beta
|
|
17706
|
+
* Pack setting name and value that changed.
|
|
16924
17707
|
*/
|
|
16925
|
-
|
|
16926
|
-
export class PassengerOfEntityCondition extends LootItemCondition {
|
|
17708
|
+
export class PackSettingChangeAfterEvent {
|
|
16927
17709
|
private constructor();
|
|
16928
17710
|
/**
|
|
16929
17711
|
* @remarks
|
|
16930
|
-
* The
|
|
17712
|
+
* The name of the setting.
|
|
17713
|
+
*
|
|
17714
|
+
*/
|
|
17715
|
+
readonly settingName: string;
|
|
17716
|
+
/**
|
|
17717
|
+
* @remarks
|
|
17718
|
+
* The value of the setting.
|
|
17719
|
+
*
|
|
17720
|
+
*/
|
|
17721
|
+
readonly settingValue: boolean | number | string;
|
|
17722
|
+
}
|
|
17723
|
+
|
|
17724
|
+
/**
|
|
17725
|
+
* @beta
|
|
17726
|
+
*/
|
|
17727
|
+
export class PackSettingChangeAfterEventSignal {
|
|
17728
|
+
private constructor();
|
|
17729
|
+
/**
|
|
17730
|
+
* @remarks
|
|
17731
|
+
* This function can't be called in restricted-execution mode.
|
|
17732
|
+
*
|
|
17733
|
+
* This function can be called in early-execution mode.
|
|
17734
|
+
*
|
|
17735
|
+
*/
|
|
17736
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
17737
|
+
/**
|
|
17738
|
+
* @remarks
|
|
17739
|
+
* This function can't be called in restricted-execution mode.
|
|
17740
|
+
*
|
|
17741
|
+
* This function can be called in early-execution mode.
|
|
17742
|
+
*
|
|
17743
|
+
*/
|
|
17744
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
17745
|
+
}
|
|
17746
|
+
|
|
17747
|
+
/**
|
|
17748
|
+
* Loot item condition that checks whether the looting entity
|
|
17749
|
+
* is currently a passenger of a specific type of entity.
|
|
17750
|
+
*/
|
|
17751
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
17752
|
+
export class PassengerOfEntityCondition extends LootItemCondition {
|
|
17753
|
+
private constructor();
|
|
17754
|
+
/**
|
|
17755
|
+
* @remarks
|
|
17756
|
+
* The entity type required for this condition to pass.
|
|
16931
17757
|
*
|
|
16932
17758
|
*/
|
|
16933
17759
|
readonly entityType: string;
|
|
@@ -17085,6 +17911,62 @@ export class Player extends Entity {
|
|
|
17085
17911
|
* @throws This property can throw when used.
|
|
17086
17912
|
*/
|
|
17087
17913
|
readonly camera: Camera;
|
|
17914
|
+
/**
|
|
17915
|
+
* @beta
|
|
17916
|
+
* @remarks
|
|
17917
|
+
* The player's chat display name, composed from {@link
|
|
17918
|
+
* Player.chatNamePrefix} + {@link Player.name} + {@link
|
|
17919
|
+
* Player.chatNameSuffix}. This is the name shown as the author
|
|
17920
|
+
* of chat messages sent by this player. To change the name
|
|
17921
|
+
* shown above the player's head, use {@link Entity.nameTag}.
|
|
17922
|
+
*
|
|
17923
|
+
* @throws This property can throw when used.
|
|
17924
|
+
*
|
|
17925
|
+
* {@link InvalidEntityError}
|
|
17926
|
+
*/
|
|
17927
|
+
readonly chatDisplayName: string;
|
|
17928
|
+
/**
|
|
17929
|
+
* @beta
|
|
17930
|
+
* @remarks
|
|
17931
|
+
* An optional string that, when set, is prepended to the text
|
|
17932
|
+
* of chat messages sent by this player. Useful for applying
|
|
17933
|
+
* formatting or color codes to a player's messages (e.g., '§a'
|
|
17934
|
+
* to make their messages green). Does not affect the player's
|
|
17935
|
+
* name display - use {@link Player.chatNamePrefix} for the
|
|
17936
|
+
* name shown in chat, or {@link Entity.nameTag} for the name
|
|
17937
|
+
* above the player's head. Set to undefined to clear.
|
|
17938
|
+
*
|
|
17939
|
+
* This property can't be edited in restricted-execution mode.
|
|
17940
|
+
*
|
|
17941
|
+
*/
|
|
17942
|
+
chatMessagePrefix?: string;
|
|
17943
|
+
/**
|
|
17944
|
+
* @beta
|
|
17945
|
+
* @remarks
|
|
17946
|
+
* An optional string that, when set, is prepended to the
|
|
17947
|
+
* player's name in chat messages. Does not affect the name tag
|
|
17948
|
+
* above the player's head or the player list - use {@link
|
|
17949
|
+
* Entity.nameTag} for that. To prefix the message text itself,
|
|
17950
|
+
* use {@link Player.chatMessagePrefix}. Set to undefined to
|
|
17951
|
+
* clear.
|
|
17952
|
+
*
|
|
17953
|
+
* This property can't be edited in restricted-execution mode.
|
|
17954
|
+
*
|
|
17955
|
+
*/
|
|
17956
|
+
chatNamePrefix?: string;
|
|
17957
|
+
/**
|
|
17958
|
+
* @beta
|
|
17959
|
+
* @remarks
|
|
17960
|
+
* An optional string that, when set, is appended to the
|
|
17961
|
+
* player's name in chat messages. Does not affect the name tag
|
|
17962
|
+
* above the player's head or the player list - use {@link
|
|
17963
|
+
* Entity.nameTag} for that. See also {@link
|
|
17964
|
+
* Player.chatNamePrefix}. Set to undefined to clear.
|
|
17965
|
+
*
|
|
17966
|
+
* This property can't be edited in restricted-execution mode.
|
|
17967
|
+
*
|
|
17968
|
+
*/
|
|
17969
|
+
chatNameSuffix?: string;
|
|
17088
17970
|
/**
|
|
17089
17971
|
* @remarks
|
|
17090
17972
|
* Contains the player's device information.
|
|
@@ -17189,6 +18071,19 @@ export class Player extends Entity {
|
|
|
17189
18071
|
* @throws This property can throw when used.
|
|
17190
18072
|
*/
|
|
17191
18073
|
readonly onScreenDisplay: ScreenDisplay;
|
|
18074
|
+
/**
|
|
18075
|
+
* @beta
|
|
18076
|
+
* @remarks
|
|
18077
|
+
* An identifier that can be used to identify a player across
|
|
18078
|
+
* sessions.
|
|
18079
|
+
*
|
|
18080
|
+
* @throws This property can throw when used.
|
|
18081
|
+
*
|
|
18082
|
+
* {@link minecraftcommon.EngineError}
|
|
18083
|
+
*
|
|
18084
|
+
* {@link InvalidEntityError}
|
|
18085
|
+
*/
|
|
18086
|
+
readonly persistentId: string;
|
|
17192
18087
|
/**
|
|
17193
18088
|
* @throws This property can throw when used.
|
|
17194
18089
|
*
|
|
@@ -17262,6 +18157,20 @@ export class Player extends Entity {
|
|
|
17262
18157
|
* Throws if the Entity or Entity ID is invalid.
|
|
17263
18158
|
*/
|
|
17264
18159
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
18160
|
+
/**
|
|
18161
|
+
* @beta
|
|
18162
|
+
* @remarks
|
|
18163
|
+
* Eats an item, providing the item's hunger and saturation
|
|
18164
|
+
* effects to the player. Can only be used on food items.
|
|
18165
|
+
*
|
|
18166
|
+
* This function can't be called in restricted-execution mode.
|
|
18167
|
+
*
|
|
18168
|
+
* @param itemStack
|
|
18169
|
+
* The item to eat.
|
|
18170
|
+
* @throws
|
|
18171
|
+
* Throws if the item is not a food item.
|
|
18172
|
+
*/
|
|
18173
|
+
eatItem(itemStack: ItemStack): void;
|
|
17265
18174
|
/**
|
|
17266
18175
|
* @remarks
|
|
17267
18176
|
* The player's aim-assist settings.
|
|
@@ -17295,6 +18204,20 @@ export class Player extends Entity {
|
|
|
17295
18204
|
* @throws This function can throw errors.
|
|
17296
18205
|
*/
|
|
17297
18206
|
getItemCooldown(cooldownCategory: string): number;
|
|
18207
|
+
/**
|
|
18208
|
+
* @beta
|
|
18209
|
+
* @remarks
|
|
18210
|
+
* Gets the player's ping in milliseconds.
|
|
18211
|
+
*
|
|
18212
|
+
* @returns
|
|
18213
|
+
* The player's ping in milliseconds.
|
|
18214
|
+
* @throws This function can throw errors.
|
|
18215
|
+
*
|
|
18216
|
+
* {@link minecraftcommon.EngineError}
|
|
18217
|
+
*
|
|
18218
|
+
* {@link InvalidEntityError}
|
|
18219
|
+
*/
|
|
18220
|
+
getPing(): number;
|
|
17298
18221
|
/**
|
|
17299
18222
|
* @remarks
|
|
17300
18223
|
* Gets the current spawn point of the player.
|
|
@@ -17302,6 +18225,21 @@ export class Player extends Entity {
|
|
|
17302
18225
|
* @throws This function can throw errors.
|
|
17303
18226
|
*/
|
|
17304
18227
|
getSpawnPoint(): DimensionLocation | undefined;
|
|
18228
|
+
/**
|
|
18229
|
+
* @beta
|
|
18230
|
+
* @remarks
|
|
18231
|
+
* Returns the split screen slot of the player.
|
|
18232
|
+
*
|
|
18233
|
+
* @returns
|
|
18234
|
+
* The split screen slot of the player or undefined if the
|
|
18235
|
+
* player is not in a split screen session.
|
|
18236
|
+
* @throws This function can throw errors.
|
|
18237
|
+
*
|
|
18238
|
+
* {@link minecraftcommon.EngineError}
|
|
18239
|
+
*
|
|
18240
|
+
* {@link InvalidEntityError}
|
|
18241
|
+
*/
|
|
18242
|
+
getSplitScreenSlot(): PlayerSplitScreenSlot | undefined;
|
|
17305
18243
|
/**
|
|
17306
18244
|
* @remarks
|
|
17307
18245
|
* Gets the total experience of the Player.
|
|
@@ -17365,7 +18303,18 @@ export class Player extends Entity {
|
|
|
17365
18303
|
* }
|
|
17366
18304
|
* ```
|
|
17367
18305
|
*/
|
|
17368
|
-
playSound(soundId: string, soundOptions?: PlayerSoundOptions): SoundInstance;
|
|
18306
|
+
playSound(soundId: SoundDefinition | string, soundOptions?: PlayerSoundOptions): SoundInstance;
|
|
18307
|
+
/**
|
|
18308
|
+
* @beta
|
|
18309
|
+
* @remarks
|
|
18310
|
+
* This is an internal-facing method for posting a system
|
|
18311
|
+
* message to downstream clients.
|
|
18312
|
+
*
|
|
18313
|
+
* This function can't be called in restricted-execution mode.
|
|
18314
|
+
*
|
|
18315
|
+
* @throws This function can throw errors.
|
|
18316
|
+
*/
|
|
18317
|
+
postClientMessage(id: string, value: string): void;
|
|
17369
18318
|
/**
|
|
17370
18319
|
* @remarks
|
|
17371
18320
|
* Queues an additional music track that only this particular
|
|
@@ -17641,6 +18590,18 @@ export class Player extends Entity {
|
|
|
17641
18590
|
* @throws This function can throw errors.
|
|
17642
18591
|
*/
|
|
17643
18592
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
18593
|
+
/**
|
|
18594
|
+
* @beta
|
|
18595
|
+
* @remarks
|
|
18596
|
+
* Stops all sounds from playing for this particular player.
|
|
18597
|
+
*
|
|
18598
|
+
* This function can't be called in restricted-execution mode.
|
|
18599
|
+
*
|
|
18600
|
+
* @throws This function can throw errors.
|
|
18601
|
+
*
|
|
18602
|
+
* {@link InvalidEntityError}
|
|
18603
|
+
*/
|
|
18604
|
+
stopAllSounds(): void;
|
|
17644
18605
|
/**
|
|
17645
18606
|
* @remarks
|
|
17646
18607
|
* Stops any music tracks from playing for this particular
|
|
@@ -17651,6 +18612,20 @@ export class Player extends Entity {
|
|
|
17651
18612
|
* @throws This function can throw errors.
|
|
17652
18613
|
*/
|
|
17653
18614
|
stopMusic(): void;
|
|
18615
|
+
/**
|
|
18616
|
+
* @beta
|
|
18617
|
+
* @remarks
|
|
18618
|
+
* Stops a sound from playing for this particular player.
|
|
18619
|
+
*
|
|
18620
|
+
* This function can't be called in restricted-execution mode.
|
|
18621
|
+
*
|
|
18622
|
+
* @param soundId
|
|
18623
|
+
* Identifier of the sound.
|
|
18624
|
+
* @throws This function can throw errors.
|
|
18625
|
+
*
|
|
18626
|
+
* {@link InvalidEntityError}
|
|
18627
|
+
*/
|
|
18628
|
+
stopSound(soundId: string): void;
|
|
17654
18629
|
}
|
|
17655
18630
|
|
|
17656
18631
|
/**
|
|
@@ -19012,6 +19987,88 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
19012
19987
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
19013
19988
|
}
|
|
19014
19989
|
|
|
19990
|
+
/**
|
|
19991
|
+
* @beta
|
|
19992
|
+
* Contains information regarding an event before a player
|
|
19993
|
+
* places a block.
|
|
19994
|
+
*/
|
|
19995
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19996
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
19997
|
+
private constructor();
|
|
19998
|
+
/**
|
|
19999
|
+
* @remarks
|
|
20000
|
+
* If set to true, cancels the block place event.
|
|
20001
|
+
*
|
|
20002
|
+
*/
|
|
20003
|
+
cancel: boolean;
|
|
20004
|
+
/**
|
|
20005
|
+
* @remarks
|
|
20006
|
+
* The face of the block that the new block is being placed on.
|
|
20007
|
+
*
|
|
20008
|
+
*/
|
|
20009
|
+
readonly face: Direction;
|
|
20010
|
+
/**
|
|
20011
|
+
* @remarks
|
|
20012
|
+
* Location relative to the bottom north-west corner of the
|
|
20013
|
+
* block where the new block is being placed onto.
|
|
20014
|
+
*
|
|
20015
|
+
*/
|
|
20016
|
+
readonly faceLocation: Vector3;
|
|
20017
|
+
/**
|
|
20018
|
+
* @remarks
|
|
20019
|
+
* The block permutation that will be placed if the event is
|
|
20020
|
+
* not cancelled.
|
|
20021
|
+
*
|
|
20022
|
+
*/
|
|
20023
|
+
readonly permutationToPlace: BlockPermutation;
|
|
20024
|
+
/**
|
|
20025
|
+
* @remarks
|
|
20026
|
+
* Player that is placing the block for this event.
|
|
20027
|
+
*
|
|
20028
|
+
*/
|
|
20029
|
+
readonly player: Player;
|
|
20030
|
+
}
|
|
20031
|
+
|
|
20032
|
+
/**
|
|
20033
|
+
* @beta
|
|
20034
|
+
* Manages callbacks that are connected to before a block is
|
|
20035
|
+
* placed by a player.
|
|
20036
|
+
*/
|
|
20037
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
20038
|
+
private constructor();
|
|
20039
|
+
/**
|
|
20040
|
+
* @remarks
|
|
20041
|
+
* Adds a callback that will be called before a block is placed
|
|
20042
|
+
* by a player.
|
|
20043
|
+
*
|
|
20044
|
+
* This function can't be called in restricted-execution mode.
|
|
20045
|
+
*
|
|
20046
|
+
* This function can be called in early-execution mode.
|
|
20047
|
+
*
|
|
20048
|
+
* @param callback
|
|
20049
|
+
* This closure is called with restricted-execution privilege.
|
|
20050
|
+
* @returns
|
|
20051
|
+
* Closure that is called with restricted-execution privilege.
|
|
20052
|
+
*/
|
|
20053
|
+
subscribe(
|
|
20054
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
20055
|
+
options?: BlockEventOptions,
|
|
20056
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
20057
|
+
/**
|
|
20058
|
+
* @remarks
|
|
20059
|
+
* Removes a callback from being called before an block is
|
|
20060
|
+
* placed by a player.
|
|
20061
|
+
*
|
|
20062
|
+
* This function can't be called in restricted-execution mode.
|
|
20063
|
+
*
|
|
20064
|
+
* This function can be called in early-execution mode.
|
|
20065
|
+
*
|
|
20066
|
+
* @param callback
|
|
20067
|
+
* This closure is called with restricted-execution privilege.
|
|
20068
|
+
*/
|
|
20069
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
20070
|
+
}
|
|
20071
|
+
|
|
19015
20072
|
/**
|
|
19016
20073
|
* An event that contains more information about a player
|
|
19017
20074
|
* spawning.
|
|
@@ -19200,6 +20257,80 @@ export class PlayerSwingStartAfterEventSignal {
|
|
|
19200
20257
|
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
19201
20258
|
}
|
|
19202
20259
|
|
|
20260
|
+
/**
|
|
20261
|
+
* @beta
|
|
20262
|
+
* Contains information related to when a player successfully
|
|
20263
|
+
* names an Entity with a named Name Tag item.
|
|
20264
|
+
*/
|
|
20265
|
+
export class PlayerUseNameTagAfterEvent {
|
|
20266
|
+
private constructor();
|
|
20267
|
+
/**
|
|
20268
|
+
* @remarks
|
|
20269
|
+
* The entity that was named by the player.
|
|
20270
|
+
*
|
|
20271
|
+
* This property can't be edited in restricted-execution mode.
|
|
20272
|
+
*
|
|
20273
|
+
*/
|
|
20274
|
+
entityNamed: Entity;
|
|
20275
|
+
/**
|
|
20276
|
+
* @remarks
|
|
20277
|
+
* The new name that the player has given to the entity.
|
|
20278
|
+
*
|
|
20279
|
+
* This property can't be edited in restricted-execution mode.
|
|
20280
|
+
*
|
|
20281
|
+
*/
|
|
20282
|
+
newName: string;
|
|
20283
|
+
/**
|
|
20284
|
+
* @remarks
|
|
20285
|
+
* Handle to the player that used the name tag.
|
|
20286
|
+
*
|
|
20287
|
+
* This property can't be edited in restricted-execution mode.
|
|
20288
|
+
*
|
|
20289
|
+
*/
|
|
20290
|
+
player: Player;
|
|
20291
|
+
/**
|
|
20292
|
+
* @remarks
|
|
20293
|
+
* The previous name of the entity before the player used the
|
|
20294
|
+
* name tag. This will be undefined if the entity was not
|
|
20295
|
+
* previously named.
|
|
20296
|
+
*
|
|
20297
|
+
* This property can't be edited in restricted-execution mode.
|
|
20298
|
+
*
|
|
20299
|
+
*/
|
|
20300
|
+
previousName?: string;
|
|
20301
|
+
}
|
|
20302
|
+
|
|
20303
|
+
/**
|
|
20304
|
+
* @beta
|
|
20305
|
+
* Manages callbacks that are connected to when a player
|
|
20306
|
+
* successfully names an Entity with a named Name Tag item.
|
|
20307
|
+
*/
|
|
20308
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
20309
|
+
private constructor();
|
|
20310
|
+
/**
|
|
20311
|
+
* @remarks
|
|
20312
|
+
* Subscribes the specified callback to a player use name tag
|
|
20313
|
+
* after event.
|
|
20314
|
+
*
|
|
20315
|
+
* This function can't be called in restricted-execution mode.
|
|
20316
|
+
*
|
|
20317
|
+
* This function can be called in early-execution mode.
|
|
20318
|
+
*
|
|
20319
|
+
*/
|
|
20320
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
20321
|
+
/**
|
|
20322
|
+
* @remarks
|
|
20323
|
+
* Removes the specified callback from a player use name tag
|
|
20324
|
+
* after event.
|
|
20325
|
+
*
|
|
20326
|
+
* This function can't be called in restricted-execution mode.
|
|
20327
|
+
*
|
|
20328
|
+
* This function can be called in early-execution mode.
|
|
20329
|
+
*
|
|
20330
|
+
*/
|
|
20331
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
20332
|
+
}
|
|
20333
|
+
|
|
19203
20334
|
/**
|
|
19204
20335
|
* Waypoint that tracks a player's position. Extends {@link
|
|
19205
20336
|
* EntityWaypoint} with additional player-specific visibility
|
|
@@ -19315,10 +20446,10 @@ export class Potions {
|
|
|
19315
20446
|
*
|
|
19316
20447
|
* {@link InvalidPotionEffectTypeError}
|
|
19317
20448
|
*/
|
|
19318
|
-
static resolve
|
|
19319
|
-
|
|
19320
|
-
|
|
19321
|
-
): ItemStack;
|
|
20449
|
+
static resolve<
|
|
20450
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
20451
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
20452
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
19322
20453
|
}
|
|
19323
20454
|
|
|
19324
20455
|
/**
|
|
@@ -19561,6 +20692,18 @@ export class PrimitiveShapesManager {
|
|
|
19561
20692
|
* {@link PrimitiveShapeError}
|
|
19562
20693
|
*/
|
|
19563
20694
|
addText(text: TextPrimitive, dimension?: Dimension): void;
|
|
20695
|
+
/**
|
|
20696
|
+
* @beta
|
|
20697
|
+
* @remarks
|
|
20698
|
+
* Fetches and queries all primitive shapes stored in the
|
|
20699
|
+
* manager and returns the results as an array of shape
|
|
20700
|
+
* handles.
|
|
20701
|
+
*
|
|
20702
|
+
* @param options
|
|
20703
|
+
* Optional options for querying existing shapes to narrow down
|
|
20704
|
+
* the results.
|
|
20705
|
+
*/
|
|
20706
|
+
getShapes(options?: PrimitiveShapeQueryOptions): PrimitiveShape[];
|
|
19564
20707
|
/**
|
|
19565
20708
|
* @remarks
|
|
19566
20709
|
* Removes all text primitives from the world.
|
|
@@ -20525,6 +21668,38 @@ export class Seat {
|
|
|
20525
21668
|
readonly seatRotation: number;
|
|
20526
21669
|
}
|
|
20527
21670
|
|
|
21671
|
+
/**
|
|
21672
|
+
* @beta
|
|
21673
|
+
* Manages callbacks that are message passing to a server. This
|
|
21674
|
+
* event is not currently fully implemented, and should not be
|
|
21675
|
+
* used.
|
|
21676
|
+
*/
|
|
21677
|
+
export class ServerMessageAfterEventSignal {
|
|
21678
|
+
private constructor();
|
|
21679
|
+
/**
|
|
21680
|
+
* @remarks
|
|
21681
|
+
* Adds a callback that will be called when an internal message
|
|
21682
|
+
* is passed.
|
|
21683
|
+
*
|
|
21684
|
+
* This function can't be called in restricted-execution mode.
|
|
21685
|
+
*
|
|
21686
|
+
* This function can be called in early-execution mode.
|
|
21687
|
+
*
|
|
21688
|
+
*/
|
|
21689
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
21690
|
+
/**
|
|
21691
|
+
* @remarks
|
|
21692
|
+
* Removes a callback from being called when an internal
|
|
21693
|
+
* message is passed.
|
|
21694
|
+
*
|
|
21695
|
+
* This function can't be called in restricted-execution mode.
|
|
21696
|
+
*
|
|
21697
|
+
* This function can be called in early-execution mode.
|
|
21698
|
+
*
|
|
21699
|
+
*/
|
|
21700
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
21701
|
+
}
|
|
21702
|
+
|
|
20528
21703
|
/**
|
|
20529
21704
|
* Loot item function that modifies the trim on a dropped armor
|
|
20530
21705
|
* item.
|
|
@@ -20553,6 +21728,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
20553
21728
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20554
21729
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
20555
21730
|
private constructor();
|
|
21731
|
+
/**
|
|
21732
|
+
* @beta
|
|
21733
|
+
* @remarks
|
|
21734
|
+
* The base color for the dropped banner.
|
|
21735
|
+
*
|
|
21736
|
+
*/
|
|
21737
|
+
readonly baseColor: string;
|
|
21738
|
+
/**
|
|
21739
|
+
* @beta
|
|
21740
|
+
* @remarks
|
|
21741
|
+
* An array of {@link BannerPattern} objects used to decorate
|
|
21742
|
+
* the banner, including color and pattern type.
|
|
21743
|
+
*
|
|
21744
|
+
*/
|
|
21745
|
+
readonly patterns: BannerPattern[];
|
|
20556
21746
|
/**
|
|
20557
21747
|
* @remarks
|
|
20558
21748
|
* The type of banner to drop.
|
|
@@ -20845,6 +22035,73 @@ export class SoundCompletedAfterEventSignal {
|
|
|
20845
22035
|
unsubscribe(callback: (arg0: SoundCompletedAfterEvent) => void): void;
|
|
20846
22036
|
}
|
|
20847
22037
|
|
|
22038
|
+
/**
|
|
22039
|
+
* @beta
|
|
22040
|
+
* Static metadata about a sound declared in a
|
|
22041
|
+
* sound_definitions.json file.
|
|
22042
|
+
*/
|
|
22043
|
+
export class SoundDefinition {
|
|
22044
|
+
private constructor();
|
|
22045
|
+
/**
|
|
22046
|
+
* @remarks
|
|
22047
|
+
* Duration metadata declared for this sound. Undefined when
|
|
22048
|
+
* the sound definition does not specify a duration.
|
|
22049
|
+
*
|
|
22050
|
+
*/
|
|
22051
|
+
readonly durationInfo?: SoundDefinitionDurationInfo;
|
|
22052
|
+
/**
|
|
22053
|
+
* @remarks
|
|
22054
|
+
* Music metadata declared for this sound. Undefined when the
|
|
22055
|
+
* sound definition does not specify a music_info block.
|
|
22056
|
+
*
|
|
22057
|
+
*/
|
|
22058
|
+
readonly musicInfo?: SoundDefinitionMusicInfo;
|
|
22059
|
+
/**
|
|
22060
|
+
* @remarks
|
|
22061
|
+
* Identifier of the sound event this definition declares, in
|
|
22062
|
+
* the form 'namespace:name'.
|
|
22063
|
+
*
|
|
22064
|
+
*/
|
|
22065
|
+
readonly soundEventId: string;
|
|
22066
|
+
/**
|
|
22067
|
+
* @remarks
|
|
22068
|
+
* Tag metadata declared for this sound, as a record mapping
|
|
22069
|
+
* each tag name to its declared values. A tag declared with a
|
|
22070
|
+
* single string value is exposed as a single-element array.
|
|
22071
|
+
* Undefined when the sound definition does not specify any
|
|
22072
|
+
* tags.
|
|
22073
|
+
*
|
|
22074
|
+
*/
|
|
22075
|
+
readonly tags?: Record<string, string[]>;
|
|
22076
|
+
}
|
|
22077
|
+
|
|
22078
|
+
/**
|
|
22079
|
+
* @beta
|
|
22080
|
+
* Provides read-only access to the sound definitions loaded
|
|
22081
|
+
* for the current world.
|
|
22082
|
+
*/
|
|
22083
|
+
export class SoundDefinitionRegistry {
|
|
22084
|
+
private constructor();
|
|
22085
|
+
/**
|
|
22086
|
+
* @remarks
|
|
22087
|
+
* Returns the sound definitions in the registry, optionally
|
|
22088
|
+
* narrowed by a filter.
|
|
22089
|
+
*
|
|
22090
|
+
* @param filter
|
|
22091
|
+
* Optional filter applied to each definition. When omitted,
|
|
22092
|
+
* every definition is returned.
|
|
22093
|
+
* @returns
|
|
22094
|
+
* All sound definitions matching the filter, or every sound
|
|
22095
|
+
* definition when no filter is supplied.
|
|
22096
|
+
* @throws
|
|
22097
|
+
* An error will be thrown if filter.minDuration is greater
|
|
22098
|
+
* than filter.maxDuration.
|
|
22099
|
+
*
|
|
22100
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
22101
|
+
*/
|
|
22102
|
+
getDefinitions(filter?: SoundDefinitionFilter): SoundDefinition[];
|
|
22103
|
+
}
|
|
22104
|
+
|
|
20848
22105
|
/**
|
|
20849
22106
|
* @rc
|
|
20850
22107
|
* Provides duration and playback information for a sound whose
|
|
@@ -20902,22 +22159,100 @@ export class SoundInstance {
|
|
|
20902
22159
|
* Unique identifier of this sound instance.
|
|
20903
22160
|
*
|
|
20904
22161
|
*/
|
|
20905
|
-
readonly id: string;
|
|
22162
|
+
readonly id: string;
|
|
22163
|
+
/**
|
|
22164
|
+
* @rc
|
|
22165
|
+
* @remarks
|
|
22166
|
+
* Gets the player this sound was played for.
|
|
22167
|
+
*
|
|
22168
|
+
*/
|
|
22169
|
+
readonly recipient?: Player;
|
|
22170
|
+
/**
|
|
22171
|
+
* @rc
|
|
22172
|
+
* @remarks
|
|
22173
|
+
* Gets the identifier of the sound event this instance was
|
|
22174
|
+
* started with.
|
|
22175
|
+
*
|
|
22176
|
+
*/
|
|
22177
|
+
readonly soundEventId: string;
|
|
22178
|
+
/**
|
|
22179
|
+
* @beta
|
|
22180
|
+
* @remarks
|
|
22181
|
+
* Fades this sound instance from its current volume to the
|
|
22182
|
+
* target volume over the specified duration. To fade in from
|
|
22183
|
+
* silence, call `setVolume(0.0)` first; to fade out, pass a
|
|
22184
|
+
* target volume of `0.0`.
|
|
22185
|
+
*
|
|
22186
|
+
* This function can't be called in restricted-execution mode.
|
|
22187
|
+
*
|
|
22188
|
+
* @param duration
|
|
22189
|
+
* Duration of the fade in seconds. Must be non-negative.
|
|
22190
|
+
* Minimum value: 0
|
|
22191
|
+
* @param targetVolume
|
|
22192
|
+
* Volume to fade to. Must be non-negative.
|
|
22193
|
+
* Minimum value: 0
|
|
22194
|
+
*/
|
|
22195
|
+
fade(duration: number, targetVolume: number): void;
|
|
22196
|
+
/**
|
|
22197
|
+
* @beta
|
|
22198
|
+
* @remarks
|
|
22199
|
+
* Pauses this sound.
|
|
22200
|
+
*
|
|
22201
|
+
* This function can't be called in restricted-execution mode.
|
|
22202
|
+
*
|
|
22203
|
+
*/
|
|
22204
|
+
pause(): void;
|
|
22205
|
+
/**
|
|
22206
|
+
* @beta
|
|
22207
|
+
* @remarks
|
|
22208
|
+
* Resumes this sound after a pause.
|
|
22209
|
+
*
|
|
22210
|
+
* This function can't be called in restricted-execution mode.
|
|
22211
|
+
*
|
|
22212
|
+
*/
|
|
22213
|
+
resume(): void;
|
|
22214
|
+
/**
|
|
22215
|
+
* @beta
|
|
22216
|
+
* @remarks
|
|
22217
|
+
* Sets the playback position of this sound instance.
|
|
22218
|
+
*
|
|
22219
|
+
* This function can't be called in restricted-execution mode.
|
|
22220
|
+
*
|
|
22221
|
+
* @param seconds
|
|
22222
|
+
* Position to seek to in seconds. Must be non-negative.
|
|
22223
|
+
* Bounds: [0, 107374184]
|
|
22224
|
+
* @throws
|
|
22225
|
+
* Throws if `seconds` is negative, or if the sound has a known
|
|
22226
|
+
* duration and `seconds` is greater than that duration.
|
|
22227
|
+
*
|
|
22228
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
22229
|
+
*/
|
|
22230
|
+
seekTo(seconds: number): void;
|
|
20906
22231
|
/**
|
|
20907
|
-
* @
|
|
22232
|
+
* @beta
|
|
20908
22233
|
* @remarks
|
|
20909
|
-
*
|
|
22234
|
+
* Sets the pitch of this sound instance.
|
|
22235
|
+
*
|
|
22236
|
+
* This function can't be called in restricted-execution mode.
|
|
20910
22237
|
*
|
|
22238
|
+
* @param pitch
|
|
22239
|
+
* Pitch multiplier between 0.01 and 10.0. A value of 1.0 is
|
|
22240
|
+
* normal pitch.
|
|
22241
|
+
* Bounds: [0.009999999776482582, 10]
|
|
20911
22242
|
*/
|
|
20912
|
-
|
|
22243
|
+
setPitch(pitch: number): void;
|
|
20913
22244
|
/**
|
|
20914
|
-
* @
|
|
22245
|
+
* @beta
|
|
20915
22246
|
* @remarks
|
|
20916
|
-
*
|
|
20917
|
-
* started with.
|
|
22247
|
+
* Sets the volume of this sound instance.
|
|
20918
22248
|
*
|
|
22249
|
+
* This function can't be called in restricted-execution mode.
|
|
22250
|
+
*
|
|
22251
|
+
* @param volume
|
|
22252
|
+
* Volume level between 0.0 and 10.0.
|
|
22253
|
+
* Bounds: [0, 10]
|
|
20919
22254
|
*/
|
|
20920
|
-
|
|
22255
|
+
setVolume(volume: number): void;
|
|
20921
22256
|
/**
|
|
20922
22257
|
* @rc
|
|
20923
22258
|
* @remarks
|
|
@@ -21642,6 +22977,19 @@ export class SystemBeforeEvents {
|
|
|
21642
22977
|
*
|
|
21643
22978
|
*/
|
|
21644
22979
|
readonly startup: StartupBeforeEventSignal;
|
|
22980
|
+
/**
|
|
22981
|
+
* @beta
|
|
22982
|
+
* @remarks
|
|
22983
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
22984
|
+
* can be due to using too much memory, or by causing
|
|
22985
|
+
* significant slowdown or hang.
|
|
22986
|
+
* To prevent shutdown, set the event's cancel property to
|
|
22987
|
+
* true.
|
|
22988
|
+
*
|
|
22989
|
+
* This property can be read in early-execution mode.
|
|
22990
|
+
*
|
|
22991
|
+
*/
|
|
22992
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
21645
22993
|
}
|
|
21646
22994
|
|
|
21647
22995
|
/**
|
|
@@ -21749,6 +23097,14 @@ export class TextPrimitive extends PrimitiveShape {
|
|
|
21749
23097
|
*
|
|
21750
23098
|
*/
|
|
21751
23099
|
depthTest: boolean;
|
|
23100
|
+
/**
|
|
23101
|
+
* @beta
|
|
23102
|
+
* @remarks
|
|
23103
|
+
* This value determines the gap between lines for the
|
|
23104
|
+
* TextPrimitive. By default the line gap height is 0.
|
|
23105
|
+
*
|
|
23106
|
+
*/
|
|
23107
|
+
lineGapHeight: number;
|
|
21752
23108
|
/**
|
|
21753
23109
|
* @remarks
|
|
21754
23110
|
* Get the text of the debug text shape. Returns the RawText of
|
|
@@ -22027,6 +23383,71 @@ export class TripWireTripAfterEventSignal {
|
|
|
22027
23383
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
22028
23384
|
}
|
|
22029
23385
|
|
|
23386
|
+
/**
|
|
23387
|
+
* @beta
|
|
23388
|
+
* Contains information related to a script watchdog
|
|
23389
|
+
* termination.
|
|
23390
|
+
*/
|
|
23391
|
+
export class WatchdogTerminateBeforeEvent {
|
|
23392
|
+
private constructor();
|
|
23393
|
+
/**
|
|
23394
|
+
* @remarks
|
|
23395
|
+
* If set to true, cancels the termination of the script
|
|
23396
|
+
* runtime. Note that depending on server configuration
|
|
23397
|
+
* settings, cancellation of the termination may not be
|
|
23398
|
+
* allowed.
|
|
23399
|
+
*
|
|
23400
|
+
*/
|
|
23401
|
+
cancel: boolean;
|
|
23402
|
+
/**
|
|
23403
|
+
* @remarks
|
|
23404
|
+
* Contains the reason why a script runtime is to be
|
|
23405
|
+
* terminated.
|
|
23406
|
+
*
|
|
23407
|
+
*/
|
|
23408
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
23409
|
+
}
|
|
23410
|
+
|
|
23411
|
+
/**
|
|
23412
|
+
* @beta
|
|
23413
|
+
* Manages callbacks that are connected to a callback that will
|
|
23414
|
+
* be called when a script runtime is being terminated due to a
|
|
23415
|
+
* violation of the performance watchdog system.
|
|
23416
|
+
*/
|
|
23417
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
23418
|
+
private constructor();
|
|
23419
|
+
/**
|
|
23420
|
+
* @remarks
|
|
23421
|
+
* Adds a callback that will be called when a script runtime is
|
|
23422
|
+
* being terminated due to a violation of the performance
|
|
23423
|
+
* watchdog system.
|
|
23424
|
+
*
|
|
23425
|
+
* This function can't be called in restricted-execution mode.
|
|
23426
|
+
*
|
|
23427
|
+
* This function can be called in early-execution mode.
|
|
23428
|
+
*
|
|
23429
|
+
* @param callback
|
|
23430
|
+
* This closure is called with restricted-execution privilege.
|
|
23431
|
+
* @returns
|
|
23432
|
+
* Closure that is called with restricted-execution privilege.
|
|
23433
|
+
*/
|
|
23434
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
23435
|
+
/**
|
|
23436
|
+
* @remarks
|
|
23437
|
+
* Removes a callback from being called when a script runtime
|
|
23438
|
+
* is being terminated due to a violation of the performance
|
|
23439
|
+
* watchdog system.
|
|
23440
|
+
*
|
|
23441
|
+
* This function can't be called in restricted-execution mode.
|
|
23442
|
+
*
|
|
23443
|
+
* This function can be called in early-execution mode.
|
|
23444
|
+
*
|
|
23445
|
+
* @param callback
|
|
23446
|
+
* This closure is called with restricted-execution privilege.
|
|
23447
|
+
*/
|
|
23448
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
23449
|
+
}
|
|
23450
|
+
|
|
22030
23451
|
/**
|
|
22031
23452
|
* Base class for waypoints displayed on the player's locator
|
|
22032
23453
|
* bar. Waypoints can track locations or entities and are
|
|
@@ -22242,6 +23663,15 @@ export class World {
|
|
|
22242
23663
|
*
|
|
22243
23664
|
*/
|
|
22244
23665
|
readonly afterEvents: WorldAfterEvents;
|
|
23666
|
+
/**
|
|
23667
|
+
* @beta
|
|
23668
|
+
* @remarks
|
|
23669
|
+
* Enables or disables cheats.
|
|
23670
|
+
*
|
|
23671
|
+
* This property can't be edited in restricted-execution mode.
|
|
23672
|
+
*
|
|
23673
|
+
*/
|
|
23674
|
+
allowCheats: boolean;
|
|
22245
23675
|
/**
|
|
22246
23676
|
* @remarks
|
|
22247
23677
|
* Contains a set of events that are applicable to the entirety
|
|
@@ -22306,6 +23736,14 @@ export class World {
|
|
|
22306
23736
|
*
|
|
22307
23737
|
*/
|
|
22308
23738
|
readonly seed: string;
|
|
23739
|
+
/**
|
|
23740
|
+
* @beta
|
|
23741
|
+
* @remarks
|
|
23742
|
+
* Provides read-only access to the sound definitions loaded
|
|
23743
|
+
* for this world.
|
|
23744
|
+
*
|
|
23745
|
+
*/
|
|
23746
|
+
readonly soundDefinitionRegistry: SoundDefinitionRegistry;
|
|
22309
23747
|
/**
|
|
22310
23748
|
* @remarks
|
|
22311
23749
|
* Returns the manager for {@link Structure} related APIs.
|
|
@@ -22319,6 +23757,20 @@ export class World {
|
|
|
22319
23757
|
*
|
|
22320
23758
|
*/
|
|
22321
23759
|
readonly tickingAreaManager: TickingAreaManager;
|
|
23760
|
+
/**
|
|
23761
|
+
* @beta
|
|
23762
|
+
* @remarks
|
|
23763
|
+
* A method that is internal-only, used for broadcasting
|
|
23764
|
+
* specific messages between client and server.
|
|
23765
|
+
*
|
|
23766
|
+
* This function can't be called in restricted-execution mode.
|
|
23767
|
+
*
|
|
23768
|
+
* @param id
|
|
23769
|
+
* The message identifier.
|
|
23770
|
+
* @param value
|
|
23771
|
+
* The message.
|
|
23772
|
+
*/
|
|
23773
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
22322
23774
|
/**
|
|
22323
23775
|
* @remarks
|
|
22324
23776
|
* Clears the set of dynamic properties declared for this
|
|
@@ -22808,6 +24260,16 @@ export class WorldAfterEvents {
|
|
|
22808
24260
|
*
|
|
22809
24261
|
*/
|
|
22810
24262
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
24263
|
+
/**
|
|
24264
|
+
* @beta
|
|
24265
|
+
* @remarks
|
|
24266
|
+
* This event is triggered after a chat message has been
|
|
24267
|
+
* broadcast or sent to players.
|
|
24268
|
+
*
|
|
24269
|
+
* This property can be read in early-execution mode.
|
|
24270
|
+
*
|
|
24271
|
+
*/
|
|
24272
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
22811
24273
|
/**
|
|
22812
24274
|
* @remarks
|
|
22813
24275
|
* This event is fired when an entity event has been triggered
|
|
@@ -23054,6 +24516,25 @@ export class WorldAfterEvents {
|
|
|
23054
24516
|
*
|
|
23055
24517
|
*/
|
|
23056
24518
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
24519
|
+
/**
|
|
24520
|
+
* @beta
|
|
24521
|
+
* @remarks
|
|
24522
|
+
* This event is an internal implementation detail, and is
|
|
24523
|
+
* otherwise not currently functional.
|
|
24524
|
+
*
|
|
24525
|
+
* This property can be read in early-execution mode.
|
|
24526
|
+
*
|
|
24527
|
+
*/
|
|
24528
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
24529
|
+
/**
|
|
24530
|
+
* @beta
|
|
24531
|
+
* @remarks
|
|
24532
|
+
* This event is triggered when a pack setting is changed.
|
|
24533
|
+
*
|
|
24534
|
+
* This property can be read in early-execution mode.
|
|
24535
|
+
*
|
|
24536
|
+
*/
|
|
24537
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
23057
24538
|
/**
|
|
23058
24539
|
* @remarks
|
|
23059
24540
|
* This event fires when a piston expands or retracts.
|
|
@@ -23208,6 +24689,16 @@ export class WorldAfterEvents {
|
|
|
23208
24689
|
*
|
|
23209
24690
|
*/
|
|
23210
24691
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
24692
|
+
/**
|
|
24693
|
+
* @beta
|
|
24694
|
+
* @remarks
|
|
24695
|
+
* An event for when a player uses a named name tag on an
|
|
24696
|
+
* entity.
|
|
24697
|
+
*
|
|
24698
|
+
* This property can be read in early-execution mode.
|
|
24699
|
+
*
|
|
24700
|
+
*/
|
|
24701
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
23211
24702
|
/**
|
|
23212
24703
|
* @remarks
|
|
23213
24704
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -23293,6 +24784,43 @@ export class WorldAfterEvents {
|
|
|
23293
24784
|
*/
|
|
23294
24785
|
export class WorldBeforeEvents {
|
|
23295
24786
|
private constructor();
|
|
24787
|
+
/**
|
|
24788
|
+
* @beta
|
|
24789
|
+
* @remarks
|
|
24790
|
+
* This event is triggered after a chat message has been
|
|
24791
|
+
* broadcast or sent to players.
|
|
24792
|
+
*
|
|
24793
|
+
* This property can be read in early-execution mode.
|
|
24794
|
+
*
|
|
24795
|
+
* @example customCommand.ts
|
|
24796
|
+
* ```typescript
|
|
24797
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
24798
|
+
*
|
|
24799
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
24800
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
24801
|
+
* if (eventData.message.includes('cancel')) {
|
|
24802
|
+
* // Cancel event if the message contains "cancel"
|
|
24803
|
+
* eventData.cancel = true;
|
|
24804
|
+
* } else {
|
|
24805
|
+
* const args = eventData.message.split(' ');
|
|
24806
|
+
*
|
|
24807
|
+
* if (args.length > 0) {
|
|
24808
|
+
* switch (args[0].toLowerCase()) {
|
|
24809
|
+
* case 'echo':
|
|
24810
|
+
* // Send a modified version of chat message
|
|
24811
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
24812
|
+
* break;
|
|
24813
|
+
* case 'help':
|
|
24814
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
24815
|
+
* break;
|
|
24816
|
+
* }
|
|
24817
|
+
* }
|
|
24818
|
+
* }
|
|
24819
|
+
* });
|
|
24820
|
+
* }
|
|
24821
|
+
* ```
|
|
24822
|
+
*/
|
|
24823
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
23296
24824
|
/**
|
|
23297
24825
|
* @remarks
|
|
23298
24826
|
* This event is triggered after an event has been added to an
|
|
@@ -23395,6 +24923,15 @@ export class WorldBeforeEvents {
|
|
|
23395
24923
|
*
|
|
23396
24924
|
*/
|
|
23397
24925
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
24926
|
+
/**
|
|
24927
|
+
* @beta
|
|
24928
|
+
* @remarks
|
|
24929
|
+
* This event fires before a block is placed by a player.
|
|
24930
|
+
*
|
|
24931
|
+
* This property can be read in early-execution mode.
|
|
24932
|
+
*
|
|
24933
|
+
*/
|
|
24934
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
23398
24935
|
/**
|
|
23399
24936
|
* @remarks
|
|
23400
24937
|
* This property can be read in early-execution mode.
|
|
@@ -23491,8 +25028,8 @@ export interface BiomeSearchOptions {
|
|
|
23491
25028
|
* represents an AABB aligned rectangle.
|
|
23492
25029
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
23493
25030
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
23494
|
-
* created using the associated {@link
|
|
23495
|
-
*
|
|
25031
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
25032
|
+
* utility functions.
|
|
23496
25033
|
* The min/max coordinates represent the diametrically opposite
|
|
23497
25034
|
* corners of the rectangle.
|
|
23498
25035
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -24120,6 +25657,15 @@ export interface CustomCommand {
|
|
|
24120
25657
|
* command.
|
|
24121
25658
|
*/
|
|
24122
25659
|
export interface CustomCommandParameter {
|
|
25660
|
+
/**
|
|
25661
|
+
* @beta
|
|
25662
|
+
* @remarks
|
|
25663
|
+
* Can be used to reference the enum name when {@link
|
|
25664
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
25665
|
+
* to be different from the enum name.
|
|
25666
|
+
*
|
|
25667
|
+
*/
|
|
25668
|
+
enumName?: string;
|
|
24123
25669
|
/**
|
|
24124
25670
|
* @remarks
|
|
24125
25671
|
* The name of parameter as it appears on the command line.
|
|
@@ -24198,6 +25744,14 @@ export interface DefinitionModifier {
|
|
|
24198
25744
|
*
|
|
24199
25745
|
*/
|
|
24200
25746
|
removedComponentGroups: string[];
|
|
25747
|
+
/**
|
|
25748
|
+
* @beta
|
|
25749
|
+
* @remarks
|
|
25750
|
+
* The list of entity definition events that will be fired via
|
|
25751
|
+
* this update.
|
|
25752
|
+
*
|
|
25753
|
+
*/
|
|
25754
|
+
triggers: Trigger[];
|
|
24201
25755
|
}
|
|
24202
25756
|
|
|
24203
25757
|
/**
|
|
@@ -25559,6 +27113,19 @@ export interface PlayerSoundOptions {
|
|
|
25559
27113
|
*
|
|
25560
27114
|
*/
|
|
25561
27115
|
location?: Vector3;
|
|
27116
|
+
/**
|
|
27117
|
+
* @beta
|
|
27118
|
+
* @remarks
|
|
27119
|
+
* Number of additional times to repeat the sound after the
|
|
27120
|
+
* initial play. `0` (the default) plays the sound once, `-1`
|
|
27121
|
+
* loops it forever, and a positive integer `N` plays the sound
|
|
27122
|
+
* `N + 1` times in total. For example, `loopCount: 1` plays
|
|
27123
|
+
* the sound twice. The loop count is fixed when the sound
|
|
27124
|
+
* starts and cannot be changed afterward. When using `-1`, see
|
|
27125
|
+
* `SoundInstance` for handle lifetime requirements.
|
|
27126
|
+
*
|
|
27127
|
+
*/
|
|
27128
|
+
loopCount?: number;
|
|
25562
27129
|
/**
|
|
25563
27130
|
* @remarks
|
|
25564
27131
|
* Optional pitch of the sound.
|
|
@@ -25630,6 +27197,43 @@ export interface PlayerVisibilityRules extends EntityVisibilityRules {
|
|
|
25630
27197
|
showSpectatorToSpectator?: boolean;
|
|
25631
27198
|
}
|
|
25632
27199
|
|
|
27200
|
+
/**
|
|
27201
|
+
* @beta
|
|
27202
|
+
* Contains optional filters that control which primitive
|
|
27203
|
+
* shapes are returned from a primitive shapes query.
|
|
27204
|
+
*/
|
|
27205
|
+
export interface PrimitiveShapeQueryOptions {
|
|
27206
|
+
/**
|
|
27207
|
+
* @remarks
|
|
27208
|
+
* If specified, only returns shapes attached to this entity.
|
|
27209
|
+
*
|
|
27210
|
+
*/
|
|
27211
|
+
attachedTo?: Entity;
|
|
27212
|
+
/**
|
|
27213
|
+
* @remarks
|
|
27214
|
+
* Adds a seed location to the query that is used in
|
|
27215
|
+
* conjunction with distance properties.
|
|
27216
|
+
*
|
|
27217
|
+
*/
|
|
27218
|
+
location?: Vector3;
|
|
27219
|
+
/**
|
|
27220
|
+
* @remarks
|
|
27221
|
+
* If specified, only includes shapes that are less than this
|
|
27222
|
+
* distance away from the location specified in the location
|
|
27223
|
+
* property.
|
|
27224
|
+
*
|
|
27225
|
+
*/
|
|
27226
|
+
maxDistance?: number;
|
|
27227
|
+
/**
|
|
27228
|
+
* @remarks
|
|
27229
|
+
* If specified, only includes shapes that are at least this
|
|
27230
|
+
* distance away from the location specified in the location
|
|
27231
|
+
* property.
|
|
27232
|
+
*
|
|
27233
|
+
*/
|
|
27234
|
+
minDistance?: number;
|
|
27235
|
+
}
|
|
27236
|
+
|
|
25633
27237
|
/**
|
|
25634
27238
|
* Key frame that holds the progress of the camera animation.
|
|
25635
27239
|
*/
|
|
@@ -25951,6 +27555,136 @@ export interface ScriptEventMessageFilterOptions {
|
|
|
25951
27555
|
namespaces: string[];
|
|
25952
27556
|
}
|
|
25953
27557
|
|
|
27558
|
+
/**
|
|
27559
|
+
* @beta
|
|
27560
|
+
* Duration metadata declared in a sound definition.
|
|
27561
|
+
*/
|
|
27562
|
+
export interface SoundDefinitionDurationInfo {
|
|
27563
|
+
/**
|
|
27564
|
+
* @remarks
|
|
27565
|
+
* Total duration of the sound in seconds, as declared in the
|
|
27566
|
+
* sound definition.
|
|
27567
|
+
*
|
|
27568
|
+
*/
|
|
27569
|
+
duration: number;
|
|
27570
|
+
}
|
|
27571
|
+
|
|
27572
|
+
/**
|
|
27573
|
+
* @beta
|
|
27574
|
+
* Criteria used to narrow a set of sound definitions. Each
|
|
27575
|
+
* field is optional and applies its constraint only when
|
|
27576
|
+
* defined; a definition must satisfy every defined field to
|
|
27577
|
+
* pass.
|
|
27578
|
+
*/
|
|
27579
|
+
export interface SoundDefinitionFilter {
|
|
27580
|
+
/**
|
|
27581
|
+
* @remarks
|
|
27582
|
+
* Artist names to match against the definition's
|
|
27583
|
+
* music_info.artist. Comparison is case-insensitive. When
|
|
27584
|
+
* defined as a non-empty array, a definition passes only when
|
|
27585
|
+
* its declared artist matches one of the supplied values. When
|
|
27586
|
+
* undefined, no constraint on artist is applied.
|
|
27587
|
+
*
|
|
27588
|
+
*/
|
|
27589
|
+
artists?: string[];
|
|
27590
|
+
/**
|
|
27591
|
+
* @remarks
|
|
27592
|
+
* Genres to match against the definition's music_info.genres.
|
|
27593
|
+
* Comparison is case-insensitive. When defined as a non-empty
|
|
27594
|
+
* array, a definition passes only when at least one of its
|
|
27595
|
+
* declared genres matches one of the supplied values. When
|
|
27596
|
+
* undefined, no constraint on genres is applied.
|
|
27597
|
+
*
|
|
27598
|
+
*/
|
|
27599
|
+
genres?: string[];
|
|
27600
|
+
/**
|
|
27601
|
+
* @remarks
|
|
27602
|
+
* Upper bound in seconds, inclusive. When defined, definitions
|
|
27603
|
+
* with a longer duration and definitions without a declared
|
|
27604
|
+
* duration are excluded. When undefined, no upper bound is
|
|
27605
|
+
* applied.
|
|
27606
|
+
*
|
|
27607
|
+
*/
|
|
27608
|
+
maxDuration?: number;
|
|
27609
|
+
/**
|
|
27610
|
+
* @remarks
|
|
27611
|
+
* Lower bound in seconds, inclusive. When defined, definitions
|
|
27612
|
+
* with a shorter duration and definitions without a declared
|
|
27613
|
+
* duration are excluded. When undefined, no lower bound is
|
|
27614
|
+
* applied.
|
|
27615
|
+
*
|
|
27616
|
+
*/
|
|
27617
|
+
minDuration?: number;
|
|
27618
|
+
/**
|
|
27619
|
+
* @remarks
|
|
27620
|
+
* Moods to match against the definition's music_info.moods.
|
|
27621
|
+
* Comparison is case-insensitive. When defined as a non-empty
|
|
27622
|
+
* array, a definition passes only when at least one of its
|
|
27623
|
+
* declared moods matches one of the supplied values. When
|
|
27624
|
+
* undefined, no constraint on moods is applied.
|
|
27625
|
+
*
|
|
27626
|
+
*/
|
|
27627
|
+
moods?: string[];
|
|
27628
|
+
/**
|
|
27629
|
+
* @remarks
|
|
27630
|
+
* Tag constraints to match against the definition's tags.
|
|
27631
|
+
* Comparisons of tag names and values are case-insensitive.
|
|
27632
|
+
* When defined as a non-empty record, a definition passes only
|
|
27633
|
+
* when, for each entry with a non-empty value array, the tag
|
|
27634
|
+
* name is present on the definition with at least one matching
|
|
27635
|
+
* value. When undefined, no constraint on tags is applied.
|
|
27636
|
+
*
|
|
27637
|
+
*/
|
|
27638
|
+
tags?: Record<string, string[]>;
|
|
27639
|
+
/**
|
|
27640
|
+
* @remarks
|
|
27641
|
+
* Titles to match against the definition's music_info.title.
|
|
27642
|
+
* Comparison is case-insensitive. When defined as a non-empty
|
|
27643
|
+
* array, a definition passes only when its declared title
|
|
27644
|
+
* matches one of the supplied values. When undefined, no
|
|
27645
|
+
* constraint on title is applied.
|
|
27646
|
+
*
|
|
27647
|
+
*/
|
|
27648
|
+
titles?: string[];
|
|
27649
|
+
}
|
|
27650
|
+
|
|
27651
|
+
/**
|
|
27652
|
+
* @beta
|
|
27653
|
+
* Music metadata declared on a sound definition. Each field is
|
|
27654
|
+
* optional and is undefined when the sound definition does not
|
|
27655
|
+
* declare a value for it.
|
|
27656
|
+
*/
|
|
27657
|
+
export interface SoundDefinitionMusicInfo {
|
|
27658
|
+
/**
|
|
27659
|
+
* @remarks
|
|
27660
|
+
* Artist declared for this sound. Undefined when no artist was
|
|
27661
|
+
* declared.
|
|
27662
|
+
*
|
|
27663
|
+
*/
|
|
27664
|
+
artist?: string;
|
|
27665
|
+
/**
|
|
27666
|
+
* @remarks
|
|
27667
|
+
* Genres declared for this sound. Undefined when no genres
|
|
27668
|
+
* were declared.
|
|
27669
|
+
*
|
|
27670
|
+
*/
|
|
27671
|
+
genres?: string[];
|
|
27672
|
+
/**
|
|
27673
|
+
* @remarks
|
|
27674
|
+
* Moods declared for this sound. Undefined when no moods were
|
|
27675
|
+
* declared.
|
|
27676
|
+
*
|
|
27677
|
+
*/
|
|
27678
|
+
moods?: string[];
|
|
27679
|
+
/**
|
|
27680
|
+
* @remarks
|
|
27681
|
+
* Title declared for this sound. Undefined when no title was
|
|
27682
|
+
* declared.
|
|
27683
|
+
*
|
|
27684
|
+
*/
|
|
27685
|
+
title?: string;
|
|
27686
|
+
}
|
|
27687
|
+
|
|
25954
27688
|
/**
|
|
25955
27689
|
* Contains additional options for spawning an Entity.
|
|
25956
27690
|
*/
|
|
@@ -26386,6 +28120,19 @@ export interface WaypointTextureSelector {
|
|
|
26386
28120
|
* Contains additional options for a playSound occurrence.
|
|
26387
28121
|
*/
|
|
26388
28122
|
export interface WorldSoundOptions {
|
|
28123
|
+
/**
|
|
28124
|
+
* @beta
|
|
28125
|
+
* @remarks
|
|
28126
|
+
* Number of additional times to repeat the sound after the
|
|
28127
|
+
* initial play. `0` (the default) plays the sound once, `-1`
|
|
28128
|
+
* loops it forever, and a positive integer `N` plays the sound
|
|
28129
|
+
* `N + 1` times in total. For example, `loopCount: 1` plays
|
|
28130
|
+
* the sound twice. The loop count is fixed when the sound
|
|
28131
|
+
* starts and cannot be changed afterward. When using `-1`, see
|
|
28132
|
+
* `SoundInstance` for handle lifetime requirements.
|
|
28133
|
+
*
|
|
28134
|
+
*/
|
|
28135
|
+
loopCount?: number;
|
|
26389
28136
|
/**
|
|
26390
28137
|
* @remarks
|
|
26391
28138
|
* Pitch of the sound played.
|