@minecraft/server 2.8.0-rc.1.26.30-preview.21 → 2.9.0-beta.1.26.30-preview.21
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 +2989 -254
- 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.9.0-beta"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -229,6 +229,55 @@ export enum CommandPermissionLevel {
|
|
|
229
229
|
Owner = 4,
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
+
/**
|
|
233
|
+
* @beta
|
|
234
|
+
* The Action enum determines how the CompoundBlockVolume
|
|
235
|
+
* considers the associated CompoundBlockVolumeItem when
|
|
236
|
+
* performing inside/outside calculations.
|
|
237
|
+
*/
|
|
238
|
+
export enum CompoundBlockVolumeAction {
|
|
239
|
+
/**
|
|
240
|
+
* @remarks
|
|
241
|
+
* The associated BlockVolume is considered a positive space,
|
|
242
|
+
* and any intersection tests are considered hits
|
|
243
|
+
*
|
|
244
|
+
*/
|
|
245
|
+
Add = 0,
|
|
246
|
+
/**
|
|
247
|
+
* @remarks
|
|
248
|
+
* The associated BlockVolume is considered a negative or void
|
|
249
|
+
* space, and any intersection tests are considered misses.
|
|
250
|
+
* Using the Subtract action, it is possible to `punch holes`
|
|
251
|
+
* in block volumes so that any intersection tests may pass
|
|
252
|
+
* through such spaces
|
|
253
|
+
*
|
|
254
|
+
*/
|
|
255
|
+
Subtract = 1,
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @beta
|
|
260
|
+
* An enum describing the relativity of the
|
|
261
|
+
* CompoundBlockVolumeItem, relative to the parent
|
|
262
|
+
* CompoundVolume.
|
|
263
|
+
*/
|
|
264
|
+
export enum CompoundBlockVolumePositionRelativity {
|
|
265
|
+
/**
|
|
266
|
+
* @remarks
|
|
267
|
+
* The locations within the associated BlockVolume are relative
|
|
268
|
+
* to the CompoundBlockVolume to which they were added
|
|
269
|
+
*
|
|
270
|
+
*/
|
|
271
|
+
Relative = 0,
|
|
272
|
+
/**
|
|
273
|
+
* @remarks
|
|
274
|
+
* The locations within the associated BlockVolume are in
|
|
275
|
+
* absolute world space
|
|
276
|
+
*
|
|
277
|
+
*/
|
|
278
|
+
Absolute = 1,
|
|
279
|
+
}
|
|
280
|
+
|
|
232
281
|
/**
|
|
233
282
|
* Reasons that the {@link
|
|
234
283
|
* @minecraft/server.ContainerRulesError} was thrown.
|
|
@@ -331,6 +380,13 @@ export enum CustomCommandErrorReason {
|
|
|
331
380
|
*
|
|
332
381
|
*/
|
|
333
382
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
383
|
+
/**
|
|
384
|
+
* @beta
|
|
385
|
+
* @remarks
|
|
386
|
+
* Non enum type command parameters cannot use enumName.
|
|
387
|
+
*
|
|
388
|
+
*/
|
|
389
|
+
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
334
390
|
}
|
|
335
391
|
|
|
336
392
|
/**
|
|
@@ -1068,6 +1124,14 @@ export enum EntityComponentTypes {
|
|
|
1068
1124
|
*
|
|
1069
1125
|
*/
|
|
1070
1126
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1127
|
+
/**
|
|
1128
|
+
* @beta
|
|
1129
|
+
* @remarks
|
|
1130
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
1131
|
+
* name, and dialogue interactions.
|
|
1132
|
+
*
|
|
1133
|
+
*/
|
|
1134
|
+
Npc = 'minecraft:npc',
|
|
1071
1135
|
/**
|
|
1072
1136
|
* @remarks
|
|
1073
1137
|
* When present on an entity, this entity is on fire.
|
|
@@ -1438,6 +1502,13 @@ export enum EntityHealCause {
|
|
|
1438
1502
|
*
|
|
1439
1503
|
*/
|
|
1440
1504
|
SelfHeal = 'SelfHeal',
|
|
1505
|
+
/**
|
|
1506
|
+
* @beta
|
|
1507
|
+
* @remarks
|
|
1508
|
+
* Healing caused when Totem of Undying is activated.
|
|
1509
|
+
*
|
|
1510
|
+
*/
|
|
1511
|
+
TotemOfUndying = 'TotemOfUndying',
|
|
1441
1512
|
}
|
|
1442
1513
|
|
|
1443
1514
|
/**
|
|
@@ -1545,6 +1616,14 @@ export enum EntitySwingSource {
|
|
|
1545
1616
|
* and mainhand slots.
|
|
1546
1617
|
*/
|
|
1547
1618
|
export enum EquipmentSlot {
|
|
1619
|
+
/**
|
|
1620
|
+
* @beta
|
|
1621
|
+
* @remarks
|
|
1622
|
+
* The body slot. This slot is used to hold armor for
|
|
1623
|
+
* non-humanoid mobs.
|
|
1624
|
+
*
|
|
1625
|
+
*/
|
|
1626
|
+
Body = 'Body',
|
|
1548
1627
|
/**
|
|
1549
1628
|
* @remarks
|
|
1550
1629
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1814,6 +1893,14 @@ export enum GameRule {
|
|
|
1814
1893
|
*
|
|
1815
1894
|
*/
|
|
1816
1895
|
PlayersSleepingPercentage = 'playersSleepingPercentage',
|
|
1896
|
+
/**
|
|
1897
|
+
* @beta
|
|
1898
|
+
* @remarks
|
|
1899
|
+
* Controls which player waypoints are automatically added to
|
|
1900
|
+
* the players locator bar.
|
|
1901
|
+
*
|
|
1902
|
+
*/
|
|
1903
|
+
PlayerWaypoints = 'playerWaypoints',
|
|
1817
1904
|
/**
|
|
1818
1905
|
* @remarks
|
|
1819
1906
|
* Controls whether projectiles (entities with a projectile
|
|
@@ -2258,6 +2345,34 @@ export enum LiquidType {
|
|
|
2258
2345
|
Water = 'Water',
|
|
2259
2346
|
}
|
|
2260
2347
|
|
|
2348
|
+
/**
|
|
2349
|
+
* @beta
|
|
2350
|
+
* Enum representing the different reasons why a locator bar
|
|
2351
|
+
* operation may fail.
|
|
2352
|
+
*/
|
|
2353
|
+
export enum LocatorBarErrorReason {
|
|
2354
|
+
/**
|
|
2355
|
+
* @remarks
|
|
2356
|
+
* The waypoint already exists in the locator bar and cannot be
|
|
2357
|
+
* added again.
|
|
2358
|
+
*
|
|
2359
|
+
*/
|
|
2360
|
+
WaypointAlreadyExists = 'WaypointAlreadyExists',
|
|
2361
|
+
/**
|
|
2362
|
+
* @remarks
|
|
2363
|
+
* The maximum number of waypoints has been reached and no more
|
|
2364
|
+
* can be added.
|
|
2365
|
+
*
|
|
2366
|
+
*/
|
|
2367
|
+
WaypointLimitExceeded = 'WaypointLimitExceeded',
|
|
2368
|
+
/**
|
|
2369
|
+
* @remarks
|
|
2370
|
+
* The specified waypoint does not exist in the locator bar.
|
|
2371
|
+
*
|
|
2372
|
+
*/
|
|
2373
|
+
WaypointNotFound = 'WaypointNotFound',
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2261
2376
|
/**
|
|
2262
2377
|
* Describes the memory of a device.
|
|
2263
2378
|
*/
|
|
@@ -2576,6 +2691,14 @@ export enum PlayerPermissionLevel {
|
|
|
2576
2691
|
Custom = 3,
|
|
2577
2692
|
}
|
|
2578
2693
|
|
|
2694
|
+
/**
|
|
2695
|
+
* @beta
|
|
2696
|
+
*/
|
|
2697
|
+
export enum PlayerWaypointsMode {
|
|
2698
|
+
Everyone = 'Everyone',
|
|
2699
|
+
Off = 'Off',
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2579
2702
|
/**
|
|
2580
2703
|
* Contains objectives and participants for the scoreboard.
|
|
2581
2704
|
*/
|
|
@@ -2902,6 +3025,61 @@ export enum TintMethod {
|
|
|
2902
3025
|
Water = 'Water',
|
|
2903
3026
|
}
|
|
2904
3027
|
|
|
3028
|
+
/**
|
|
3029
|
+
* @beta
|
|
3030
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
3031
|
+
* to terminate execution of a behavior packs' script.
|
|
3032
|
+
*/
|
|
3033
|
+
export enum WatchdogTerminateReason {
|
|
3034
|
+
/**
|
|
3035
|
+
* @remarks
|
|
3036
|
+
* Script runtime for a behavior pack is terminated due to
|
|
3037
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
3038
|
+
*
|
|
3039
|
+
*/
|
|
3040
|
+
Hang = 'Hang',
|
|
3041
|
+
/**
|
|
3042
|
+
* @remarks
|
|
3043
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3044
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3045
|
+
* function calls.
|
|
3046
|
+
*
|
|
3047
|
+
*/
|
|
3048
|
+
StackOverflow = 'StackOverflow',
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* @beta
|
|
3053
|
+
* Enum representing different texture icons that can be
|
|
3054
|
+
* displayed for waypoints on the locator bar.
|
|
3055
|
+
*/
|
|
3056
|
+
export enum WaypointTexture {
|
|
3057
|
+
/**
|
|
3058
|
+
* @remarks
|
|
3059
|
+
* Circle waypoint icon texture.
|
|
3060
|
+
*
|
|
3061
|
+
*/
|
|
3062
|
+
Circle = 'minecraft:circle',
|
|
3063
|
+
/**
|
|
3064
|
+
* @remarks
|
|
3065
|
+
* Small square waypoint icon texture.
|
|
3066
|
+
*
|
|
3067
|
+
*/
|
|
3068
|
+
SmallSquare = 'minecraft:small_square',
|
|
3069
|
+
/**
|
|
3070
|
+
* @remarks
|
|
3071
|
+
* Small star waypoint icon texture.
|
|
3072
|
+
*
|
|
3073
|
+
*/
|
|
3074
|
+
SmallStar = 'minecraft:small_star',
|
|
3075
|
+
/**
|
|
3076
|
+
* @remarks
|
|
3077
|
+
* Square waypoint icon texture.
|
|
3078
|
+
*
|
|
3079
|
+
*/
|
|
3080
|
+
Square = 'minecraft:square',
|
|
3081
|
+
}
|
|
3082
|
+
|
|
2905
3083
|
/**
|
|
2906
3084
|
* Used to specify the type of weather condition within the
|
|
2907
3085
|
* world.
|
|
@@ -3055,6 +3233,7 @@ export type EntityComponentTypeMap = {
|
|
|
3055
3233
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
3056
3234
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
3057
3235
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3236
|
+
'minecraft:npc': EntityNpcComponent;
|
|
3058
3237
|
'minecraft:onfire': EntityOnFireComponent;
|
|
3059
3238
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
3060
3239
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -3088,6 +3267,7 @@ export type EntityComponentTypeMap = {
|
|
|
3088
3267
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3089
3268
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3090
3269
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3270
|
+
npc: EntityNpcComponent;
|
|
3091
3271
|
onfire: EntityOnFireComponent;
|
|
3092
3272
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3093
3273
|
'player.hunger': EntityHungerComponent;
|
|
@@ -3107,6 +3287,15 @@ export type EntityComponentTypeMap = {
|
|
|
3107
3287
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3108
3288
|
};
|
|
3109
3289
|
|
|
3290
|
+
/**
|
|
3291
|
+
* @beta
|
|
3292
|
+
*/
|
|
3293
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3294
|
+
? VanillaEntityIdentifier
|
|
3295
|
+
: T extends string
|
|
3296
|
+
? VanillaEntityIdentifier | T
|
|
3297
|
+
: never;
|
|
3298
|
+
|
|
3110
3299
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3111
3300
|
? ItemComponentTypeMap[T]
|
|
3112
3301
|
: ItemCustomComponentInstance;
|
|
@@ -3132,6 +3321,15 @@ export type ItemComponentTypeMap = {
|
|
|
3132
3321
|
potion: ItemPotionComponent;
|
|
3133
3322
|
};
|
|
3134
3323
|
|
|
3324
|
+
/**
|
|
3325
|
+
* @beta
|
|
3326
|
+
*/
|
|
3327
|
+
export type VanillaEntityIdentifier =
|
|
3328
|
+
| EntityType
|
|
3329
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3330
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3331
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3332
|
+
|
|
3135
3333
|
/**
|
|
3136
3334
|
* Handle to an aim-assist category that exists in the
|
|
3137
3335
|
* world.aimAssist registry.
|
|
@@ -3289,7 +3487,9 @@ export class AimAssistCategorySettings {
|
|
|
3289
3487
|
* A record mapping block Ids to their priority settings.
|
|
3290
3488
|
* Larger numbers have greater priority.
|
|
3291
3489
|
*/
|
|
3292
|
-
setBlockPriorities(
|
|
3490
|
+
setBlockPriorities(
|
|
3491
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3492
|
+
): void;
|
|
3293
3493
|
/**
|
|
3294
3494
|
* @remarks
|
|
3295
3495
|
* Sets the priority settings used for block targeting.
|
|
@@ -3308,7 +3508,9 @@ export class AimAssistCategorySettings {
|
|
|
3308
3508
|
* A record mapping entity Ids to their priority settings.
|
|
3309
3509
|
* Larger numbers have greater priority.
|
|
3310
3510
|
*/
|
|
3311
|
-
setEntityPriorities(
|
|
3511
|
+
setEntityPriorities(
|
|
3512
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3513
|
+
): void;
|
|
3312
3514
|
/**
|
|
3313
3515
|
* @remarks
|
|
3314
3516
|
* Sets the priority settings used for entity targeting.
|
|
@@ -3507,8 +3709,10 @@ export class AimAssistPresetSettings {
|
|
|
3507
3709
|
*
|
|
3508
3710
|
* This function can't be called in restricted-execution mode.
|
|
3509
3711
|
*
|
|
3712
|
+
* @param targets
|
|
3713
|
+
* An array of block tags.
|
|
3510
3714
|
*/
|
|
3511
|
-
setExcludedBlockTagTargets(
|
|
3715
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3512
3716
|
/**
|
|
3513
3717
|
* @remarks
|
|
3514
3718
|
* Sets the list of block Ids to exclude from aim assist
|
|
@@ -3516,8 +3720,10 @@ export class AimAssistPresetSettings {
|
|
|
3516
3720
|
*
|
|
3517
3721
|
* This function can't be called in restricted-execution mode.
|
|
3518
3722
|
*
|
|
3723
|
+
* @param targets
|
|
3724
|
+
* An array of block Ids.
|
|
3519
3725
|
*/
|
|
3520
|
-
setExcludedBlockTargets(
|
|
3726
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3521
3727
|
/**
|
|
3522
3728
|
* @remarks
|
|
3523
3729
|
* Sets the list of entity Ids to exclude from aim assist
|
|
@@ -3525,8 +3731,10 @@ export class AimAssistPresetSettings {
|
|
|
3525
3731
|
*
|
|
3526
3732
|
* This function can't be called in restricted-execution mode.
|
|
3527
3733
|
*
|
|
3734
|
+
* @param targets
|
|
3735
|
+
* An array of entity Ids.
|
|
3528
3736
|
*/
|
|
3529
|
-
setExcludedEntityTargets(
|
|
3737
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3530
3738
|
/**
|
|
3531
3739
|
* @remarks
|
|
3532
3740
|
* Sets the list of entity type families to exclude from aim
|
|
@@ -3534,8 +3742,10 @@ export class AimAssistPresetSettings {
|
|
|
3534
3742
|
*
|
|
3535
3743
|
* This function can't be called in restricted-execution mode.
|
|
3536
3744
|
*
|
|
3745
|
+
* @param targets
|
|
3746
|
+
* An array of entity type families.
|
|
3537
3747
|
*/
|
|
3538
|
-
setExcludedEntityTypeFamilyTargets(
|
|
3748
|
+
setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
|
|
3539
3749
|
/**
|
|
3540
3750
|
* @remarks
|
|
3541
3751
|
* Sets the per-item aim-assist category Ids.
|
|
@@ -3546,7 +3756,7 @@ export class AimAssistPresetSettings {
|
|
|
3546
3756
|
* A record mapping item Ids to aim-assist category Ids.
|
|
3547
3757
|
* Category Ids must have a namespace.
|
|
3548
3758
|
*/
|
|
3549
|
-
setItemSettings(itemSettings: Record<string, string>): void;
|
|
3759
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3550
3760
|
/**
|
|
3551
3761
|
* @remarks
|
|
3552
3762
|
* Sets the list of item Ids that will target liquid blocks
|
|
@@ -3557,7 +3767,7 @@ export class AimAssistPresetSettings {
|
|
|
3557
3767
|
* @param items
|
|
3558
3768
|
* An array of item Ids.
|
|
3559
3769
|
*/
|
|
3560
|
-
setLiquidTargetingItems(items?: string[]): void;
|
|
3770
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3561
3771
|
}
|
|
3562
3772
|
|
|
3563
3773
|
/**
|
|
@@ -3663,6 +3873,28 @@ export class AimAssistRegistry {
|
|
|
3663
3873
|
getPresets(): AimAssistPreset[];
|
|
3664
3874
|
}
|
|
3665
3875
|
|
|
3876
|
+
/**
|
|
3877
|
+
* @beta
|
|
3878
|
+
* Describes a single banner pattern, which includes a colour
|
|
3879
|
+
* and a pattern type.
|
|
3880
|
+
*/
|
|
3881
|
+
export class BannerPattern {
|
|
3882
|
+
private constructor();
|
|
3883
|
+
/**
|
|
3884
|
+
* @remarks
|
|
3885
|
+
* The color to apply to this banner pattern.
|
|
3886
|
+
*
|
|
3887
|
+
*/
|
|
3888
|
+
readonly color: string;
|
|
3889
|
+
/**
|
|
3890
|
+
* @remarks
|
|
3891
|
+
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
3892
|
+
* apply to the banner.
|
|
3893
|
+
*
|
|
3894
|
+
*/
|
|
3895
|
+
readonly pattern: string;
|
|
3896
|
+
}
|
|
3897
|
+
|
|
3666
3898
|
/**
|
|
3667
3899
|
* Describes a type of biome.
|
|
3668
3900
|
*/
|
|
@@ -3759,6 +3991,20 @@ export class Block {
|
|
|
3759
3991
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3760
3992
|
*/
|
|
3761
3993
|
readonly isLiquid: boolean;
|
|
3994
|
+
/**
|
|
3995
|
+
* @beta
|
|
3996
|
+
* @remarks
|
|
3997
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
3998
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
3999
|
+
* ladder block and a fence block are not).
|
|
4000
|
+
*
|
|
4001
|
+
* @throws This property can throw when used.
|
|
4002
|
+
*
|
|
4003
|
+
* {@link LocationInUnloadedChunkError}
|
|
4004
|
+
*
|
|
4005
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4006
|
+
*/
|
|
4007
|
+
readonly isSolid: boolean;
|
|
3762
4008
|
/**
|
|
3763
4009
|
* @remarks
|
|
3764
4010
|
* Returns true if this reference to a block is still valid
|
|
@@ -3924,6 +4170,30 @@ export class Block {
|
|
|
3924
4170
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3925
4171
|
*/
|
|
3926
4172
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4173
|
+
/**
|
|
4174
|
+
* @beta
|
|
4175
|
+
* @remarks
|
|
4176
|
+
* Checks to see whether it is valid to place the specified
|
|
4177
|
+
* block type or block permutation, on a specified face on this
|
|
4178
|
+
* block.
|
|
4179
|
+
*
|
|
4180
|
+
* @param blockToPlace
|
|
4181
|
+
* Block type or block permutation to check placement for.
|
|
4182
|
+
* @param faceToPlaceOn
|
|
4183
|
+
* Optional specific face of this block to check placement
|
|
4184
|
+
* against.
|
|
4185
|
+
* @returns
|
|
4186
|
+
* Returns `true` if the block type or permutation can be
|
|
4187
|
+
* placed on this block, else `false`.
|
|
4188
|
+
* @throws This function can throw errors.
|
|
4189
|
+
*
|
|
4190
|
+
* {@link Error}
|
|
4191
|
+
*
|
|
4192
|
+
* {@link LocationInUnloadedChunkError}
|
|
4193
|
+
*
|
|
4194
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4195
|
+
*/
|
|
4196
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
3927
4197
|
/**
|
|
3928
4198
|
* @remarks
|
|
3929
4199
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -4020,6 +4290,29 @@ export class Block {
|
|
|
4020
4290
|
* {@link LocationInUnloadedChunkError}
|
|
4021
4291
|
*/
|
|
4022
4292
|
getLightLevel(): number;
|
|
4293
|
+
/**
|
|
4294
|
+
* @beta
|
|
4295
|
+
* @throws This function can throw errors.
|
|
4296
|
+
*
|
|
4297
|
+
* {@link LocationInUnloadedChunkError}
|
|
4298
|
+
*
|
|
4299
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4300
|
+
*/
|
|
4301
|
+
getMapColor(): RGBA;
|
|
4302
|
+
/**
|
|
4303
|
+
* @beta
|
|
4304
|
+
* @remarks
|
|
4305
|
+
* Returns array of all loaded block parts if this block has
|
|
4306
|
+
* the 'minecraft:multi_block' trait. If it does not have the
|
|
4307
|
+
* trait returns undefined
|
|
4308
|
+
*
|
|
4309
|
+
* @throws This function can throw errors.
|
|
4310
|
+
*
|
|
4311
|
+
* {@link LocationInUnloadedChunkError}
|
|
4312
|
+
*
|
|
4313
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4314
|
+
*/
|
|
4315
|
+
getParts(): Block[] | undefined;
|
|
4023
4316
|
/**
|
|
4024
4317
|
* @remarks
|
|
4025
4318
|
* Returns the net redstone power of this block.
|
|
@@ -4287,6 +4580,27 @@ export class Block {
|
|
|
4287
4580
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4288
4581
|
*/
|
|
4289
4582
|
south(steps?: number): Block | undefined;
|
|
4583
|
+
/**
|
|
4584
|
+
* @beta
|
|
4585
|
+
* @remarks
|
|
4586
|
+
* Tries to set the block in the dimension to the state of the
|
|
4587
|
+
* permutation by first checking if the placement is valid.
|
|
4588
|
+
*
|
|
4589
|
+
* This function can't be called in restricted-execution mode.
|
|
4590
|
+
*
|
|
4591
|
+
* @param permutation
|
|
4592
|
+
* Permutation that contains a set of property states for the
|
|
4593
|
+
* Block.
|
|
4594
|
+
* @returns
|
|
4595
|
+
* Returns `true` if the block permutation data was
|
|
4596
|
+
* successfully set, else `false`.
|
|
4597
|
+
* @throws This function can throw errors.
|
|
4598
|
+
*
|
|
4599
|
+
* {@link LocationInUnloadedChunkError}
|
|
4600
|
+
*
|
|
4601
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4602
|
+
*/
|
|
4603
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4290
4604
|
/**
|
|
4291
4605
|
* @remarks
|
|
4292
4606
|
* Returns the {@link Block} to the west of this block
|
|
@@ -4304,6 +4618,137 @@ export class Block {
|
|
|
4304
4618
|
west(steps?: number): Block | undefined;
|
|
4305
4619
|
}
|
|
4306
4620
|
|
|
4621
|
+
/**
|
|
4622
|
+
* @beta
|
|
4623
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4624
|
+
* of useful functions for the creation and utility of {@link
|
|
4625
|
+
* BlockBoundingBox} objects
|
|
4626
|
+
*/
|
|
4627
|
+
export class BlockBoundingBoxUtils {
|
|
4628
|
+
private constructor();
|
|
4629
|
+
/**
|
|
4630
|
+
* @remarks
|
|
4631
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4632
|
+
* where the min and max components are guaranteed to be (min
|
|
4633
|
+
* <= max)
|
|
4634
|
+
*
|
|
4635
|
+
* This function can't be called in restricted-execution mode.
|
|
4636
|
+
*
|
|
4637
|
+
* @param min
|
|
4638
|
+
* A corner world location
|
|
4639
|
+
* @param max
|
|
4640
|
+
* A corner world location diametrically opposite
|
|
4641
|
+
*/
|
|
4642
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4643
|
+
/**
|
|
4644
|
+
* @remarks
|
|
4645
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4646
|
+
* each axis.
|
|
4647
|
+
* Sizes can be negative to perform contraction.
|
|
4648
|
+
* Note: corners can be inverted if the contraction size is
|
|
4649
|
+
* greater than the span, but the min/max relationship will
|
|
4650
|
+
* remain correct
|
|
4651
|
+
*
|
|
4652
|
+
* This function can't be called in restricted-execution mode.
|
|
4653
|
+
*
|
|
4654
|
+
* @returns
|
|
4655
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4656
|
+
* the changes
|
|
4657
|
+
*/
|
|
4658
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4659
|
+
/**
|
|
4660
|
+
* @remarks
|
|
4661
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4662
|
+
*
|
|
4663
|
+
* This function can't be called in restricted-execution mode.
|
|
4664
|
+
*
|
|
4665
|
+
*/
|
|
4666
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4667
|
+
/**
|
|
4668
|
+
* @remarks
|
|
4669
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4670
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4671
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4672
|
+
* boxes.
|
|
4673
|
+
*
|
|
4674
|
+
* This function can't be called in restricted-execution mode.
|
|
4675
|
+
*
|
|
4676
|
+
* @returns
|
|
4677
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4678
|
+
* smallest possible bounding box which can encompass both
|
|
4679
|
+
*/
|
|
4680
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4681
|
+
/**
|
|
4682
|
+
* @remarks
|
|
4683
|
+
* Calculate the center block of a given {@link
|
|
4684
|
+
* BlockBoundingBox} object.
|
|
4685
|
+
*
|
|
4686
|
+
* This function can't be called in restricted-execution mode.
|
|
4687
|
+
*
|
|
4688
|
+
* @returns
|
|
4689
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4690
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4691
|
+
* bounds are not mathematically centered...
|
|
4692
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4693
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4694
|
+
*/
|
|
4695
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4696
|
+
/**
|
|
4697
|
+
* @remarks
|
|
4698
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4699
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4700
|
+
*
|
|
4701
|
+
* This function can't be called in restricted-execution mode.
|
|
4702
|
+
*
|
|
4703
|
+
*/
|
|
4704
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4705
|
+
/**
|
|
4706
|
+
* @remarks
|
|
4707
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4708
|
+
*
|
|
4709
|
+
* This function can't be called in restricted-execution mode.
|
|
4710
|
+
*
|
|
4711
|
+
*/
|
|
4712
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4713
|
+
/**
|
|
4714
|
+
* @remarks
|
|
4715
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4716
|
+
*
|
|
4717
|
+
* This function can't be called in restricted-execution mode.
|
|
4718
|
+
*
|
|
4719
|
+
*/
|
|
4720
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4721
|
+
/**
|
|
4722
|
+
* @remarks
|
|
4723
|
+
* Check to see if a given coordinate is inside a
|
|
4724
|
+
* BlockBoundingBox
|
|
4725
|
+
*
|
|
4726
|
+
* This function can't be called in restricted-execution mode.
|
|
4727
|
+
*
|
|
4728
|
+
*/
|
|
4729
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4730
|
+
/**
|
|
4731
|
+
* @remarks
|
|
4732
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4733
|
+
* max))
|
|
4734
|
+
*
|
|
4735
|
+
* This function can't be called in restricted-execution mode.
|
|
4736
|
+
*
|
|
4737
|
+
*/
|
|
4738
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4739
|
+
/**
|
|
4740
|
+
* @remarks
|
|
4741
|
+
* Move a BlockBoundingBox by a given amount
|
|
4742
|
+
*
|
|
4743
|
+
* This function can't be called in restricted-execution mode.
|
|
4744
|
+
*
|
|
4745
|
+
* @returns
|
|
4746
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4747
|
+
* change
|
|
4748
|
+
*/
|
|
4749
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4750
|
+
}
|
|
4751
|
+
|
|
4307
4752
|
/**
|
|
4308
4753
|
* Base type for components associated with blocks.
|
|
4309
4754
|
*/
|
|
@@ -4347,22 +4792,38 @@ export class BlockComponentBlockBreakEvent extends BlockEvent {
|
|
|
4347
4792
|
}
|
|
4348
4793
|
|
|
4349
4794
|
/**
|
|
4350
|
-
*
|
|
4351
|
-
*
|
|
4795
|
+
* @beta
|
|
4796
|
+
* Contains information regarding a specific block permutation
|
|
4797
|
+
* that was changed from a previous permutation.
|
|
4352
4798
|
*/
|
|
4353
4799
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4354
|
-
export class
|
|
4800
|
+
export class BlockComponentBlockStateChangeEvent extends BlockEvent {
|
|
4355
4801
|
private constructor();
|
|
4356
4802
|
/**
|
|
4357
4803
|
* @remarks
|
|
4358
|
-
*
|
|
4359
|
-
* the event.
|
|
4804
|
+
* The previous BlockPermutation.
|
|
4360
4805
|
*
|
|
4361
4806
|
*/
|
|
4362
|
-
readonly
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4807
|
+
readonly previousPermutation: BlockPermutation;
|
|
4808
|
+
}
|
|
4809
|
+
|
|
4810
|
+
/**
|
|
4811
|
+
* Contains information regarding an event sent by an entity to
|
|
4812
|
+
* this block in the world.
|
|
4813
|
+
*/
|
|
4814
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4815
|
+
export class BlockComponentEntityEvent extends BlockEvent {
|
|
4816
|
+
private constructor();
|
|
4817
|
+
/**
|
|
4818
|
+
* @remarks
|
|
4819
|
+
* Returns permutation information about the block receiving
|
|
4820
|
+
* the event.
|
|
4821
|
+
*
|
|
4822
|
+
*/
|
|
4823
|
+
readonly blockPermutation: BlockPermutation;
|
|
4824
|
+
/**
|
|
4825
|
+
* @remarks
|
|
4826
|
+
* The entity that sent the event.
|
|
4366
4827
|
*
|
|
4367
4828
|
*/
|
|
4368
4829
|
readonly entitySource: Entity;
|
|
@@ -4511,6 +4972,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
|
|
|
4511
4972
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4512
4973
|
export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
|
|
4513
4974
|
private constructor();
|
|
4975
|
+
/**
|
|
4976
|
+
* @beta
|
|
4977
|
+
* @remarks
|
|
4978
|
+
* The first update event for the redstone component.
|
|
4979
|
+
*
|
|
4980
|
+
*/
|
|
4981
|
+
readonly firstUpdate: boolean;
|
|
4514
4982
|
/**
|
|
4515
4983
|
* @remarks
|
|
4516
4984
|
* The redstone signal strength passing through this block. It
|
|
@@ -4915,6 +5383,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
4915
5383
|
*
|
|
4916
5384
|
*/
|
|
4917
5385
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5386
|
+
/**
|
|
5387
|
+
* @beta
|
|
5388
|
+
* @remarks
|
|
5389
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5390
|
+
* Will return false if the block volume was modified between
|
|
5391
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5392
|
+
*
|
|
5393
|
+
* @throws This function can throw errors.
|
|
5394
|
+
*
|
|
5395
|
+
* {@link minecraftcommon.EngineError}
|
|
5396
|
+
*/
|
|
5397
|
+
isValid(): boolean;
|
|
4918
5398
|
/**
|
|
4919
5399
|
* @remarks
|
|
4920
5400
|
* This function can't be called in restricted-execution mode.
|
|
@@ -5286,6 +5766,20 @@ export class BlockPrecipitationInteractionsComponent extends BlockComponent {
|
|
|
5286
5766
|
* {@link LocationOutOfWorldBoundariesError}
|
|
5287
5767
|
*/
|
|
5288
5768
|
accumulatesSnow(): boolean;
|
|
5769
|
+
/**
|
|
5770
|
+
* @beta
|
|
5771
|
+
* @remarks
|
|
5772
|
+
* Returns `true` if this block can have snow within it, like a
|
|
5773
|
+
* flower submerged in snow. Returns `false` if this block
|
|
5774
|
+
* cannot have snow within it.
|
|
5775
|
+
*
|
|
5776
|
+
* @throws This function can throw errors.
|
|
5777
|
+
*
|
|
5778
|
+
* {@link LocationInUnloadedChunkError}
|
|
5779
|
+
*
|
|
5780
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5781
|
+
*/
|
|
5782
|
+
isSnowLoggable(): boolean;
|
|
5289
5783
|
/**
|
|
5290
5784
|
* @remarks
|
|
5291
5785
|
* Returns `true` if rain will not go through the block.
|
|
@@ -5817,6 +6311,15 @@ export class BlockVolumeBase {
|
|
|
5817
6311
|
*
|
|
5818
6312
|
*/
|
|
5819
6313
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
6314
|
+
/**
|
|
6315
|
+
* @beta
|
|
6316
|
+
* @remarks
|
|
6317
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
6318
|
+
* the validated min and max coordinates of the volume
|
|
6319
|
+
*
|
|
6320
|
+
* @throws This function can throw errors.
|
|
6321
|
+
*/
|
|
6322
|
+
getBoundingBox(): BlockBoundingBox;
|
|
5820
6323
|
/**
|
|
5821
6324
|
* @remarks
|
|
5822
6325
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -6047,6 +6550,23 @@ export class Camera {
|
|
|
6047
6550
|
| CameraSetRotOptions
|
|
6048
6551
|
| CameraTargetOptions,
|
|
6049
6552
|
): void;
|
|
6553
|
+
/**
|
|
6554
|
+
* @beta
|
|
6555
|
+
* @remarks
|
|
6556
|
+
* Sets the current active camera with easing.
|
|
6557
|
+
*
|
|
6558
|
+
* This function can't be called in restricted-execution mode.
|
|
6559
|
+
*
|
|
6560
|
+
* @param cameraPreset
|
|
6561
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6562
|
+
* @param easeOptions
|
|
6563
|
+
* Options to ease the camera from the previous camera to the
|
|
6564
|
+
* current one.
|
|
6565
|
+
* @throws
|
|
6566
|
+
* Throws when easing to minecraft:first_person presets
|
|
6567
|
+
* currently without the experimental cameras toggle enabled.
|
|
6568
|
+
*/
|
|
6569
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
6050
6570
|
/**
|
|
6051
6571
|
* @remarks
|
|
6052
6572
|
* Sets the current active camera for the specified player and
|
|
@@ -6086,6 +6606,164 @@ export class CatmullRomSpline {
|
|
|
6086
6606
|
controlPoints: Vector3[];
|
|
6087
6607
|
}
|
|
6088
6608
|
|
|
6609
|
+
/**
|
|
6610
|
+
* @beta
|
|
6611
|
+
* An event that fires as players enter chat messages.
|
|
6612
|
+
*/
|
|
6613
|
+
export class ChatSendAfterEvent {
|
|
6614
|
+
private constructor();
|
|
6615
|
+
/**
|
|
6616
|
+
* @remarks
|
|
6617
|
+
* Message that is being broadcast.
|
|
6618
|
+
*
|
|
6619
|
+
*/
|
|
6620
|
+
readonly message: string;
|
|
6621
|
+
/**
|
|
6622
|
+
* @remarks
|
|
6623
|
+
* Player that sent the chat message.
|
|
6624
|
+
*
|
|
6625
|
+
*/
|
|
6626
|
+
readonly sender: Player;
|
|
6627
|
+
/**
|
|
6628
|
+
* @remarks
|
|
6629
|
+
* Optional list of players that will receive this message. If
|
|
6630
|
+
* defined, this message is directly targeted to one or more
|
|
6631
|
+
* players (i.e., is not broadcast.)
|
|
6632
|
+
*
|
|
6633
|
+
*/
|
|
6634
|
+
readonly targets?: Player[];
|
|
6635
|
+
}
|
|
6636
|
+
|
|
6637
|
+
/**
|
|
6638
|
+
* @beta
|
|
6639
|
+
* Manages callbacks that are connected to chat messages being
|
|
6640
|
+
* sent.
|
|
6641
|
+
*/
|
|
6642
|
+
export class ChatSendAfterEventSignal {
|
|
6643
|
+
private constructor();
|
|
6644
|
+
/**
|
|
6645
|
+
* @remarks
|
|
6646
|
+
* Adds a callback that will be called when new chat messages
|
|
6647
|
+
* are sent.
|
|
6648
|
+
*
|
|
6649
|
+
* This function can't be called in restricted-execution mode.
|
|
6650
|
+
*
|
|
6651
|
+
* This function can be called in early-execution mode.
|
|
6652
|
+
*
|
|
6653
|
+
*/
|
|
6654
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
6655
|
+
/**
|
|
6656
|
+
* @remarks
|
|
6657
|
+
* Removes a callback from being called when new chat messages
|
|
6658
|
+
* are sent.
|
|
6659
|
+
*
|
|
6660
|
+
* This function can't be called in restricted-execution mode.
|
|
6661
|
+
*
|
|
6662
|
+
* This function can be called in early-execution mode.
|
|
6663
|
+
*
|
|
6664
|
+
*/
|
|
6665
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
6666
|
+
}
|
|
6667
|
+
|
|
6668
|
+
/**
|
|
6669
|
+
* @beta
|
|
6670
|
+
* An event that fires as players enter chat messages.
|
|
6671
|
+
*/
|
|
6672
|
+
export class ChatSendBeforeEvent {
|
|
6673
|
+
private constructor();
|
|
6674
|
+
/**
|
|
6675
|
+
* @remarks
|
|
6676
|
+
* If set to true in a beforeChat event handler, this message
|
|
6677
|
+
* is not broadcast out.
|
|
6678
|
+
*
|
|
6679
|
+
*/
|
|
6680
|
+
cancel: boolean;
|
|
6681
|
+
/**
|
|
6682
|
+
* @remarks
|
|
6683
|
+
* Message that is being broadcast.
|
|
6684
|
+
*
|
|
6685
|
+
*/
|
|
6686
|
+
readonly message: string;
|
|
6687
|
+
/**
|
|
6688
|
+
* @remarks
|
|
6689
|
+
* Player that sent the chat message.
|
|
6690
|
+
*
|
|
6691
|
+
*/
|
|
6692
|
+
readonly sender: Player;
|
|
6693
|
+
/**
|
|
6694
|
+
* @remarks
|
|
6695
|
+
* Optional list of players that will receive this message. If
|
|
6696
|
+
* defined, this message is directly targeted to one or more
|
|
6697
|
+
* players (i.e., is not broadcast.)
|
|
6698
|
+
*
|
|
6699
|
+
*/
|
|
6700
|
+
readonly targets?: Player[];
|
|
6701
|
+
}
|
|
6702
|
+
|
|
6703
|
+
/**
|
|
6704
|
+
* @beta
|
|
6705
|
+
* Manages callbacks that are connected to an event that fires
|
|
6706
|
+
* before chat messages are sent.
|
|
6707
|
+
* @example customCommand.ts
|
|
6708
|
+
* ```typescript
|
|
6709
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
6710
|
+
*
|
|
6711
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
6712
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
6713
|
+
* if (eventData.message.includes('cancel')) {
|
|
6714
|
+
* // Cancel event if the message contains "cancel"
|
|
6715
|
+
* eventData.cancel = true;
|
|
6716
|
+
* } else {
|
|
6717
|
+
* const args = eventData.message.split(' ');
|
|
6718
|
+
*
|
|
6719
|
+
* if (args.length > 0) {
|
|
6720
|
+
* switch (args[0].toLowerCase()) {
|
|
6721
|
+
* case 'echo':
|
|
6722
|
+
* // Send a modified version of chat message
|
|
6723
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
6724
|
+
* break;
|
|
6725
|
+
* case 'help':
|
|
6726
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
6727
|
+
* break;
|
|
6728
|
+
* }
|
|
6729
|
+
* }
|
|
6730
|
+
* }
|
|
6731
|
+
* });
|
|
6732
|
+
* }
|
|
6733
|
+
* ```
|
|
6734
|
+
*/
|
|
6735
|
+
export class ChatSendBeforeEventSignal {
|
|
6736
|
+
private constructor();
|
|
6737
|
+
/**
|
|
6738
|
+
* @remarks
|
|
6739
|
+
* Adds a callback that will be called before new chat messages
|
|
6740
|
+
* are sent.
|
|
6741
|
+
*
|
|
6742
|
+
* This function can't be called in restricted-execution mode.
|
|
6743
|
+
*
|
|
6744
|
+
* This function can be called in early-execution mode.
|
|
6745
|
+
*
|
|
6746
|
+
* @param callback
|
|
6747
|
+
* This closure is called with restricted-execution privilege.
|
|
6748
|
+
* @returns
|
|
6749
|
+
* Closure that is called with restricted-execution privilege.
|
|
6750
|
+
*/
|
|
6751
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
6752
|
+
/**
|
|
6753
|
+
* @remarks
|
|
6754
|
+
* Removes a callback from being called before new chat
|
|
6755
|
+
* messages are sent.
|
|
6756
|
+
*
|
|
6757
|
+
* This function can't be called in restricted-execution mode.
|
|
6758
|
+
*
|
|
6759
|
+
* This function can be called in early-execution mode.
|
|
6760
|
+
*
|
|
6761
|
+
* @param callback
|
|
6762
|
+
* This closure is called with restricted-execution privilege.
|
|
6763
|
+
*/
|
|
6764
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
6765
|
+
}
|
|
6766
|
+
|
|
6089
6767
|
/**
|
|
6090
6768
|
* Contains the device information for a client instance.
|
|
6091
6769
|
*/
|
|
@@ -6159,125 +6837,377 @@ export class Component {
|
|
|
6159
6837
|
}
|
|
6160
6838
|
|
|
6161
6839
|
/**
|
|
6162
|
-
*
|
|
6163
|
-
*
|
|
6164
|
-
*
|
|
6165
|
-
*
|
|
6166
|
-
*
|
|
6167
|
-
*
|
|
6168
|
-
*
|
|
6169
|
-
*
|
|
6170
|
-
*
|
|
6171
|
-
*
|
|
6172
|
-
*
|
|
6173
|
-
*
|
|
6174
|
-
*
|
|
6175
|
-
*
|
|
6176
|
-
*
|
|
6177
|
-
*
|
|
6178
|
-
*
|
|
6179
|
-
*
|
|
6180
|
-
*
|
|
6181
|
-
*
|
|
6182
|
-
*
|
|
6183
|
-
*
|
|
6184
|
-
*
|
|
6185
|
-
* return;
|
|
6186
|
-
* }
|
|
6187
|
-
*
|
|
6188
|
-
* xChestBlock.setType(MinecraftBlockTypes.Chest);
|
|
6189
|
-
* xPlusTwoChestBlock.setType(MinecraftBlockTypes.Chest);
|
|
6190
|
-
*
|
|
6191
|
-
* const xPlusTwoChestInventoryComp = xPlusTwoChestBlock.getComponent('inventory') as BlockInventoryComponent;
|
|
6192
|
-
* const xChestInventoryComponent = xChestBlock.getComponent('inventory') as BlockInventoryComponent;
|
|
6193
|
-
* const chestCartInventoryComp = chestCart.getComponent('inventory') as EntityInventoryComponent;
|
|
6194
|
-
*
|
|
6195
|
-
* const xPlusTwoChestContainer = xPlusTwoChestInventoryComp.container;
|
|
6196
|
-
* const xChestContainer = xChestInventoryComponent.container;
|
|
6197
|
-
* const chestCartContainer = chestCartInventoryComp.container;
|
|
6198
|
-
*
|
|
6199
|
-
* if (!xPlusTwoChestContainer || !xChestContainer || !chestCartContainer) {
|
|
6200
|
-
* log('Could not retrieve chest containers.');
|
|
6201
|
-
* return;
|
|
6202
|
-
* }
|
|
6203
|
-
*
|
|
6204
|
-
* xPlusTwoChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Apple, 10));
|
|
6205
|
-
* if (xPlusTwoChestContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
|
|
6206
|
-
* log('Expected apple in x+2 container slot index 0', -1);
|
|
6207
|
-
* }
|
|
6208
|
-
*
|
|
6209
|
-
* xPlusTwoChestContainer.setItem(1, new ItemStack(MinecraftItemTypes.Emerald, 10));
|
|
6210
|
-
* if (xPlusTwoChestContainer.getItem(1)?.typeId !== MinecraftItemTypes.Emerald) {
|
|
6211
|
-
* log('Expected emerald in x+2 container slot index 1', -1);
|
|
6212
|
-
* }
|
|
6213
|
-
*
|
|
6214
|
-
* if (xPlusTwoChestContainer.size !== 27) {
|
|
6215
|
-
* log('Unexpected size: ' + xPlusTwoChestContainer.size, -1);
|
|
6216
|
-
* }
|
|
6217
|
-
*
|
|
6218
|
-
* if (xPlusTwoChestContainer.emptySlotsCount !== 25) {
|
|
6219
|
-
* log('Unexpected emptySlotsCount: ' + xPlusTwoChestContainer.emptySlotsCount, -1);
|
|
6220
|
-
* }
|
|
6221
|
-
*
|
|
6222
|
-
* xChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Cake, 10));
|
|
6223
|
-
*
|
|
6224
|
-
* xPlusTwoChestContainer.transferItem(0, chestCartContainer); // transfer the apple from the xPlusTwo chest to a chest cart
|
|
6225
|
-
* xPlusTwoChestContainer.swapItems(1, 0, xChestContainer); // swap the cake from x and the emerald from xPlusTwo
|
|
6226
|
-
*
|
|
6227
|
-
* if (chestCartContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
|
|
6228
|
-
* log('Expected apple in minecraft chest container slot index 0', -1);
|
|
6229
|
-
* }
|
|
6230
|
-
*
|
|
6231
|
-
* if (xChestContainer.getItem(0)?.typeId === MinecraftItemTypes.Emerald) {
|
|
6232
|
-
* log('Expected emerald in x container slot index 0', -1);
|
|
6233
|
-
* }
|
|
6234
|
-
*
|
|
6235
|
-
* if (xPlusTwoChestContainer.getItem(1)?.typeId === MinecraftItemTypes.Cake) {
|
|
6236
|
-
* log('Expected cake in x+2 container slot index 1', -1);
|
|
6237
|
-
* }
|
|
6238
|
-
* }
|
|
6239
|
-
* ```
|
|
6840
|
+
* @beta
|
|
6841
|
+
* The Compound Block Volume is a collection of individual
|
|
6842
|
+
* block volume definitions which, as a collection, define a
|
|
6843
|
+
* larger volume of (sometimes non-contiguous) irregular
|
|
6844
|
+
* shapes.
|
|
6845
|
+
* This class is loosely based on the concept of CSG
|
|
6846
|
+
* (Computational Solid Geometry) and allows a user to create
|
|
6847
|
+
* complex volumes by building a stack of volumes and voids to
|
|
6848
|
+
* make a larger single volume.
|
|
6849
|
+
* For example - normally a creator would create a hollow cube
|
|
6850
|
+
* by creating 6 "wall" surfaces for each face.
|
|
6851
|
+
* With a Compound Block Volume, a creator can define a hollow
|
|
6852
|
+
* cube by creating a single outer solid cube, and then
|
|
6853
|
+
* defining a further single 'void' cube inside the larger one.
|
|
6854
|
+
* Similarly, the Compound Block Volume can represent irregular
|
|
6855
|
+
* shaped volumes (e.g. a tree consists of a trunk and lots of
|
|
6856
|
+
* leaf cubes which are not necessarily contiguously placed).
|
|
6857
|
+
* Each of the volumes added to the CompoundBlockVolume are (by
|
|
6858
|
+
* default) relative to the origin set (either at construction
|
|
6859
|
+
* or via one of the set functions).
|
|
6860
|
+
* However, it is also possible to push volumes to the compound
|
|
6861
|
+
* collection which are absolute in nature and are not affected
|
|
6862
|
+
* by origin changes.
|
|
6240
6863
|
*/
|
|
6241
|
-
export class
|
|
6242
|
-
private constructor();
|
|
6864
|
+
export class CompoundBlockVolume {
|
|
6243
6865
|
/**
|
|
6244
6866
|
* @remarks
|
|
6245
|
-
*
|
|
6246
|
-
*
|
|
6247
|
-
* example, adding a shulker box to a vanilla bundle.
|
|
6867
|
+
* Return the 'capacity' of the bounding rectangle which
|
|
6868
|
+
* represents the collection of volumes in the stack
|
|
6248
6869
|
*
|
|
6249
6870
|
*/
|
|
6250
|
-
readonly
|
|
6871
|
+
readonly capacity: number;
|
|
6872
|
+
readonly items: CompoundBlockVolumeItem[];
|
|
6873
|
+
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
6251
6874
|
/**
|
|
6252
6875
|
* @remarks
|
|
6253
|
-
*
|
|
6876
|
+
* Return the number of volumes (positive and negative) in the
|
|
6877
|
+
* volume stack
|
|
6254
6878
|
*
|
|
6255
|
-
* @throws
|
|
6256
|
-
* Throws if the container is invalid.
|
|
6257
6879
|
*/
|
|
6258
|
-
readonly
|
|
6880
|
+
readonly volumeCount: number;
|
|
6259
6881
|
/**
|
|
6260
6882
|
* @remarks
|
|
6261
|
-
*
|
|
6262
|
-
* that this container is associated with) is still available
|
|
6263
|
-
* for use in this context.
|
|
6883
|
+
* Create a CompoundBlockVolume object
|
|
6264
6884
|
*
|
|
6885
|
+
* @param origin
|
|
6886
|
+
* An optional world space origin on which to center the
|
|
6887
|
+
* compound volume.
|
|
6888
|
+
* If not specified, the origin is set to (0,0,0)
|
|
6265
6889
|
*/
|
|
6266
|
-
|
|
6890
|
+
constructor(origin?: Vector3);
|
|
6267
6891
|
/**
|
|
6268
6892
|
* @remarks
|
|
6269
|
-
*
|
|
6270
|
-
*
|
|
6271
|
-
*
|
|
6272
|
-
* hotbar slots plus 27 inventory slots.
|
|
6893
|
+
* Clear the contents of the volume stack
|
|
6894
|
+
*
|
|
6895
|
+
* This function can't be called in restricted-execution mode.
|
|
6273
6896
|
*
|
|
6274
|
-
* @throws
|
|
6275
|
-
* Throws if the container is invalid.
|
|
6276
6897
|
*/
|
|
6277
|
-
|
|
6898
|
+
clear(): void;
|
|
6278
6899
|
/**
|
|
6279
6900
|
* @remarks
|
|
6280
|
-
*
|
|
6901
|
+
* Fetch a Block Location Iterator for the Compound Block
|
|
6902
|
+
* Volume. This iterator will allow a creator to iterate
|
|
6903
|
+
* across all of the selected volumes within the larger
|
|
6904
|
+
* bounding area.
|
|
6905
|
+
* Areas of a volume which have been overridden by a
|
|
6906
|
+
* subtractive volume will not be included in the iterator
|
|
6907
|
+
* step.
|
|
6908
|
+
* (i.e. if you push a cube to the stack, and then push a
|
|
6909
|
+
* subtractive volume to the same location, then the iterator
|
|
6910
|
+
* will step over the initial volume because it is considered
|
|
6911
|
+
* negative space)
|
|
6912
|
+
* Note that the Block Locations returned by this iterator are
|
|
6913
|
+
* in absolute world space (irrespective of whether the
|
|
6914
|
+
* compound volume items pushed are absolute or relative)
|
|
6915
|
+
*
|
|
6916
|
+
* This function can't be called in restricted-execution mode.
|
|
6917
|
+
*
|
|
6918
|
+
*/
|
|
6919
|
+
getBlockLocationIterator(): BlockLocationIterator;
|
|
6920
|
+
/**
|
|
6921
|
+
* @remarks
|
|
6922
|
+
* Get the largest bounding box that represents a container for
|
|
6923
|
+
* all of the volumes on the stack
|
|
6924
|
+
* Note that the bounding box returned is represented in
|
|
6925
|
+
* absolute world space (irrespective of whether the compound
|
|
6926
|
+
* volume items pushed are absolute or relative)
|
|
6927
|
+
*
|
|
6928
|
+
* This function can't be called in restricted-execution mode.
|
|
6929
|
+
*
|
|
6930
|
+
*/
|
|
6931
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6932
|
+
/**
|
|
6933
|
+
* @remarks
|
|
6934
|
+
* Get the max block location of the outermost bounding
|
|
6935
|
+
* rectangle which represents the volumes on the stack.
|
|
6936
|
+
* Note that the max location returned is in absolute world
|
|
6937
|
+
* space (irrespective of whether the compound volume items
|
|
6938
|
+
* pushed are absolute or relative)
|
|
6939
|
+
*
|
|
6940
|
+
* This function can't be called in restricted-execution mode.
|
|
6941
|
+
*
|
|
6942
|
+
*/
|
|
6943
|
+
getMax(): Vector3;
|
|
6944
|
+
/**
|
|
6945
|
+
* @remarks
|
|
6946
|
+
* Get the min block location of the outermost bounding
|
|
6947
|
+
* rectangle which represents the volumes on the stack.
|
|
6948
|
+
* Note that the min location returned is in absolute world
|
|
6949
|
+
* space (irrespective of whether the compound volume items
|
|
6950
|
+
* pushed are absolute or relative)
|
|
6951
|
+
*
|
|
6952
|
+
* This function can't be called in restricted-execution mode.
|
|
6953
|
+
*
|
|
6954
|
+
*/
|
|
6955
|
+
getMin(): Vector3;
|
|
6956
|
+
/**
|
|
6957
|
+
* @remarks
|
|
6958
|
+
* Fetch the origin in world space of the compound volume
|
|
6959
|
+
*
|
|
6960
|
+
* This function can't be called in restricted-execution mode.
|
|
6961
|
+
*
|
|
6962
|
+
*/
|
|
6963
|
+
getOrigin(): Vector3;
|
|
6964
|
+
/**
|
|
6965
|
+
* @remarks
|
|
6966
|
+
* Return a boolean which signals if there are any volume items
|
|
6967
|
+
* pushed to the volume
|
|
6968
|
+
*
|
|
6969
|
+
* This function can't be called in restricted-execution mode.
|
|
6970
|
+
*
|
|
6971
|
+
*/
|
|
6972
|
+
isEmpty(): boolean;
|
|
6973
|
+
/**
|
|
6974
|
+
* @remarks
|
|
6975
|
+
* Return a boolean representing whether or not a given
|
|
6976
|
+
* absolute world space block location is inside a positive
|
|
6977
|
+
* block volume.
|
|
6978
|
+
* E.g. if the stack contains a large cube followed by a
|
|
6979
|
+
* slightly smaller negative cube, and the test location is
|
|
6980
|
+
* within the negative cube - the function will return false
|
|
6981
|
+
* because it's not 'inside' a volume (it IS inside the
|
|
6982
|
+
* bounding rectangle, but it is not inside a positively
|
|
6983
|
+
* defined location)
|
|
6984
|
+
*
|
|
6985
|
+
* This function can't be called in restricted-execution mode.
|
|
6986
|
+
*
|
|
6987
|
+
*/
|
|
6988
|
+
isInside(worldLocation: Vector3): boolean;
|
|
6989
|
+
/**
|
|
6990
|
+
* @remarks
|
|
6991
|
+
* Inspect the last entry pushed to the volume stack without
|
|
6992
|
+
* affecting the stack contents.
|
|
6993
|
+
*
|
|
6994
|
+
* This function can't be called in restricted-execution mode.
|
|
6995
|
+
*
|
|
6996
|
+
* @param forceRelativity
|
|
6997
|
+
* Determine whether the function returns a
|
|
6998
|
+
* CompoundBlockVolumeItem which is forced into either relative
|
|
6999
|
+
* or absolute coordinate system.
|
|
7000
|
+
* `true` = force returned item to be relative to volume origin
|
|
7001
|
+
* `false` = force returned item to be absolute world space
|
|
7002
|
+
* location
|
|
7003
|
+
*
|
|
7004
|
+
* If no flag is specified, the item returned retains whatever
|
|
7005
|
+
* relativity it had when it was pushed
|
|
7006
|
+
* @returns
|
|
7007
|
+
* Returns undefined if the stack is empty
|
|
7008
|
+
*/
|
|
7009
|
+
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
7010
|
+
/**
|
|
7011
|
+
* @remarks
|
|
7012
|
+
* Remove the last entry from the volume stack. This will
|
|
7013
|
+
* reduce the stack size by one
|
|
7014
|
+
*
|
|
7015
|
+
* This function can't be called in restricted-execution mode.
|
|
7016
|
+
*
|
|
7017
|
+
*/
|
|
7018
|
+
popVolume(): boolean;
|
|
7019
|
+
/**
|
|
7020
|
+
* @remarks
|
|
7021
|
+
* Push a volume item to the stack. The volume item contains
|
|
7022
|
+
* an 'action' parameter which determines whether this volume
|
|
7023
|
+
* is a positive or negative space.
|
|
7024
|
+
* The item also contains a `locationRelativity` which
|
|
7025
|
+
* determines whether it is relative or absolute to the
|
|
7026
|
+
* compound volume origin
|
|
7027
|
+
*
|
|
7028
|
+
* This function can't be called in restricted-execution mode.
|
|
7029
|
+
*
|
|
7030
|
+
* @param item
|
|
7031
|
+
* Item to push to the end of the stack
|
|
7032
|
+
*/
|
|
7033
|
+
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
7034
|
+
/**
|
|
7035
|
+
* @remarks
|
|
7036
|
+
* If the volume stack is empty, this function will push the
|
|
7037
|
+
* specified item to the stack.
|
|
7038
|
+
* If the volume stack is NOT empty, this function will replace
|
|
7039
|
+
* the last item on the stack with the new item.
|
|
7040
|
+
*
|
|
7041
|
+
* This function can't be called in restricted-execution mode.
|
|
7042
|
+
*
|
|
7043
|
+
* @param item
|
|
7044
|
+
* Item to add or replace
|
|
7045
|
+
*/
|
|
7046
|
+
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
7047
|
+
/**
|
|
7048
|
+
* @remarks
|
|
7049
|
+
* Set the origin of the compound volume to an absolute world
|
|
7050
|
+
* space location
|
|
7051
|
+
*
|
|
7052
|
+
* This function can't be called in restricted-execution mode.
|
|
7053
|
+
*
|
|
7054
|
+
* @param preserveExistingVolumes
|
|
7055
|
+
* This optional boolean flag determines whether the relative
|
|
7056
|
+
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
7057
|
+
* affected by the new origin.
|
|
7058
|
+
* Imagine a scenario where you have a series of relative
|
|
7059
|
+
* locations around an origin which make up a sphere; all of
|
|
7060
|
+
* these locations are in the range of -2 to 2.
|
|
7061
|
+
* Push each of these locations to the compound volume as
|
|
7062
|
+
* relative items.
|
|
7063
|
+
* Now, move the origin and all of the locations representing
|
|
7064
|
+
* the sphere move accordingly.
|
|
7065
|
+
* However, let's say you want to add a 2nd sphere next to the
|
|
7066
|
+
* 1st.
|
|
7067
|
+
* In this case, set the new origin a few locations over, but
|
|
7068
|
+
* 'preserveExistingVolumes' = true.
|
|
7069
|
+
* This will set a new origin, but the existing sphere
|
|
7070
|
+
* locations will remain relative to the original origin.
|
|
7071
|
+
* Now, you can push the relative sphere locations again (this
|
|
7072
|
+
* time they will be relative to the new origin) - resulting in
|
|
7073
|
+
* 2 spheres next to each other.
|
|
7074
|
+
*/
|
|
7075
|
+
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
7076
|
+
/**
|
|
7077
|
+
* @remarks
|
|
7078
|
+
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
7079
|
+
* function will translate the origin by a given delta to a new
|
|
7080
|
+
* position
|
|
7081
|
+
*
|
|
7082
|
+
* This function can't be called in restricted-execution mode.
|
|
7083
|
+
*
|
|
7084
|
+
* @param preserveExistingVolumes
|
|
7085
|
+
* See the description for the arguments to {@link
|
|
7086
|
+
* CompoundBlockVolume.setOrigin}
|
|
7087
|
+
*/
|
|
7088
|
+
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
7089
|
+
}
|
|
7090
|
+
|
|
7091
|
+
/**
|
|
7092
|
+
* Represents a container that can hold sets of items. Used
|
|
7093
|
+
* with entities such as Players, Chest Minecarts, Llamas, and
|
|
7094
|
+
* more.
|
|
7095
|
+
* @example containers.ts
|
|
7096
|
+
* ```typescript
|
|
7097
|
+
* import { ItemStack, EntityInventoryComponent, BlockInventoryComponent, DimensionLocation } from '@minecraft/server';
|
|
7098
|
+
* import { MinecraftBlockTypes, MinecraftItemTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
7099
|
+
*
|
|
7100
|
+
* function containers(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
|
|
7101
|
+
* const xLocation = targetLocation; // left chest location
|
|
7102
|
+
* const xPlusTwoLocation = { x: targetLocation.x + 2, y: targetLocation.y, z: targetLocation.z }; // right chest
|
|
7103
|
+
*
|
|
7104
|
+
* const chestCart = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.ChestMinecart, {
|
|
7105
|
+
* x: targetLocation.x + 4,
|
|
7106
|
+
* y: targetLocation.y,
|
|
7107
|
+
* z: targetLocation.z,
|
|
7108
|
+
* });
|
|
7109
|
+
*
|
|
7110
|
+
* const xChestBlock = targetLocation.dimension.getBlock(xLocation);
|
|
7111
|
+
* const xPlusTwoChestBlock = targetLocation.dimension.getBlock(xPlusTwoLocation);
|
|
7112
|
+
*
|
|
7113
|
+
* if (!xChestBlock || !xPlusTwoChestBlock) {
|
|
7114
|
+
* log('Could not retrieve chest blocks.');
|
|
7115
|
+
* return;
|
|
7116
|
+
* }
|
|
7117
|
+
*
|
|
7118
|
+
* xChestBlock.setType(MinecraftBlockTypes.Chest);
|
|
7119
|
+
* xPlusTwoChestBlock.setType(MinecraftBlockTypes.Chest);
|
|
7120
|
+
*
|
|
7121
|
+
* const xPlusTwoChestInventoryComp = xPlusTwoChestBlock.getComponent('inventory') as BlockInventoryComponent;
|
|
7122
|
+
* const xChestInventoryComponent = xChestBlock.getComponent('inventory') as BlockInventoryComponent;
|
|
7123
|
+
* const chestCartInventoryComp = chestCart.getComponent('inventory') as EntityInventoryComponent;
|
|
7124
|
+
*
|
|
7125
|
+
* const xPlusTwoChestContainer = xPlusTwoChestInventoryComp.container;
|
|
7126
|
+
* const xChestContainer = xChestInventoryComponent.container;
|
|
7127
|
+
* const chestCartContainer = chestCartInventoryComp.container;
|
|
7128
|
+
*
|
|
7129
|
+
* if (!xPlusTwoChestContainer || !xChestContainer || !chestCartContainer) {
|
|
7130
|
+
* log('Could not retrieve chest containers.');
|
|
7131
|
+
* return;
|
|
7132
|
+
* }
|
|
7133
|
+
*
|
|
7134
|
+
* xPlusTwoChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Apple, 10));
|
|
7135
|
+
* if (xPlusTwoChestContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
|
|
7136
|
+
* log('Expected apple in x+2 container slot index 0', -1);
|
|
7137
|
+
* }
|
|
7138
|
+
*
|
|
7139
|
+
* xPlusTwoChestContainer.setItem(1, new ItemStack(MinecraftItemTypes.Emerald, 10));
|
|
7140
|
+
* if (xPlusTwoChestContainer.getItem(1)?.typeId !== MinecraftItemTypes.Emerald) {
|
|
7141
|
+
* log('Expected emerald in x+2 container slot index 1', -1);
|
|
7142
|
+
* }
|
|
7143
|
+
*
|
|
7144
|
+
* if (xPlusTwoChestContainer.size !== 27) {
|
|
7145
|
+
* log('Unexpected size: ' + xPlusTwoChestContainer.size, -1);
|
|
7146
|
+
* }
|
|
7147
|
+
*
|
|
7148
|
+
* if (xPlusTwoChestContainer.emptySlotsCount !== 25) {
|
|
7149
|
+
* log('Unexpected emptySlotsCount: ' + xPlusTwoChestContainer.emptySlotsCount, -1);
|
|
7150
|
+
* }
|
|
7151
|
+
*
|
|
7152
|
+
* xChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Cake, 10));
|
|
7153
|
+
*
|
|
7154
|
+
* xPlusTwoChestContainer.transferItem(0, chestCartContainer); // transfer the apple from the xPlusTwo chest to a chest cart
|
|
7155
|
+
* xPlusTwoChestContainer.swapItems(1, 0, xChestContainer); // swap the cake from x and the emerald from xPlusTwo
|
|
7156
|
+
*
|
|
7157
|
+
* if (chestCartContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
|
|
7158
|
+
* log('Expected apple in minecraft chest container slot index 0', -1);
|
|
7159
|
+
* }
|
|
7160
|
+
*
|
|
7161
|
+
* if (xChestContainer.getItem(0)?.typeId === MinecraftItemTypes.Emerald) {
|
|
7162
|
+
* log('Expected emerald in x container slot index 0', -1);
|
|
7163
|
+
* }
|
|
7164
|
+
*
|
|
7165
|
+
* if (xPlusTwoChestContainer.getItem(1)?.typeId === MinecraftItemTypes.Cake) {
|
|
7166
|
+
* log('Expected cake in x+2 container slot index 1', -1);
|
|
7167
|
+
* }
|
|
7168
|
+
* }
|
|
7169
|
+
* ```
|
|
7170
|
+
*/
|
|
7171
|
+
export class Container {
|
|
7172
|
+
private constructor();
|
|
7173
|
+
/**
|
|
7174
|
+
* @remarks
|
|
7175
|
+
* If these rules are defined other container operations will
|
|
7176
|
+
* throw if they cause these rules to be invalidated. For
|
|
7177
|
+
* example, adding a shulker box to a vanilla bundle.
|
|
7178
|
+
*
|
|
7179
|
+
*/
|
|
7180
|
+
readonly containerRules?: ContainerRules;
|
|
7181
|
+
/**
|
|
7182
|
+
* @remarks
|
|
7183
|
+
* Count of the slots in the container that are empty.
|
|
7184
|
+
*
|
|
7185
|
+
* @throws
|
|
7186
|
+
* Throws if the container is invalid.
|
|
7187
|
+
*/
|
|
7188
|
+
readonly emptySlotsCount: number;
|
|
7189
|
+
/**
|
|
7190
|
+
* @remarks
|
|
7191
|
+
* Returns whether a container object (or the entity or block
|
|
7192
|
+
* that this container is associated with) is still available
|
|
7193
|
+
* for use in this context.
|
|
7194
|
+
*
|
|
7195
|
+
*/
|
|
7196
|
+
readonly isValid: boolean;
|
|
7197
|
+
/**
|
|
7198
|
+
* @remarks
|
|
7199
|
+
* The number of slots in this container. For example, a
|
|
7200
|
+
* standard single-block chest has a size of 27. Note, a
|
|
7201
|
+
* player's inventory container contains a total of 36 slots, 9
|
|
7202
|
+
* hotbar slots plus 27 inventory slots.
|
|
7203
|
+
*
|
|
7204
|
+
* @throws
|
|
7205
|
+
* Throws if the container is invalid.
|
|
7206
|
+
*/
|
|
7207
|
+
readonly size: number;
|
|
7208
|
+
/**
|
|
7209
|
+
* @remarks
|
|
7210
|
+
* The combined weight of all items in the container.
|
|
6281
7211
|
*
|
|
6282
7212
|
* @throws This property can throw when used.
|
|
6283
7213
|
*
|
|
@@ -6295,7 +7225,9 @@ export class Container {
|
|
|
6295
7225
|
*
|
|
6296
7226
|
* @param itemStack
|
|
6297
7227
|
* The stack of items to add.
|
|
6298
|
-
* @throws
|
|
7228
|
+
* @throws
|
|
7229
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7230
|
+
* limit but will instead add items up to the weight limit.
|
|
6299
7231
|
*
|
|
6300
7232
|
* {@link ContainerRulesError}
|
|
6301
7233
|
*
|
|
@@ -6533,6 +7465,8 @@ export class Container {
|
|
|
6533
7465
|
* @throws
|
|
6534
7466
|
* Throws if either this container or `toContainer` are invalid
|
|
6535
7467
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
7468
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7469
|
+
* limit but will instead add items up to the weight limit.
|
|
6536
7470
|
*
|
|
6537
7471
|
* {@link ContainerRulesError}
|
|
6538
7472
|
*
|
|
@@ -7315,6 +8249,30 @@ export class Dimension {
|
|
|
7315
8249
|
block: BlockPermutation | BlockType | string,
|
|
7316
8250
|
options?: BlockFillOptions,
|
|
7317
8251
|
): ListBlockVolume;
|
|
8252
|
+
/**
|
|
8253
|
+
* @beta
|
|
8254
|
+
* @remarks
|
|
8255
|
+
* Finds the location of the closest biome of a particular
|
|
8256
|
+
* type. Note that the findClosestBiome operation can take some
|
|
8257
|
+
* time to complete, so avoid using many of these calls within
|
|
8258
|
+
* a particular tick.
|
|
8259
|
+
*
|
|
8260
|
+
* @param pos
|
|
8261
|
+
* Starting location to look for a biome to find.
|
|
8262
|
+
* @param biomeToFind
|
|
8263
|
+
* Identifier of the biome to look for.
|
|
8264
|
+
* @param options
|
|
8265
|
+
* Additional selection criteria for a biome search.
|
|
8266
|
+
* @returns
|
|
8267
|
+
* Returns a location of the biome, or undefined if a biome
|
|
8268
|
+
* could not be found.
|
|
8269
|
+
* @throws This function can throw errors.
|
|
8270
|
+
*
|
|
8271
|
+
* {@link minecraftcommon.EngineError}
|
|
8272
|
+
*
|
|
8273
|
+
* {@link Error}
|
|
8274
|
+
*/
|
|
8275
|
+
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
7318
8276
|
/**
|
|
7319
8277
|
* @remarks
|
|
7320
8278
|
* Returns the biome type at the specified location.
|
|
@@ -7534,6 +8492,26 @@ export class Dimension {
|
|
|
7534
8492
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7535
8493
|
*/
|
|
7536
8494
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8495
|
+
/**
|
|
8496
|
+
* @beta
|
|
8497
|
+
* @remarks
|
|
8498
|
+
* Returns a vector of generated structures that contain the
|
|
8499
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
8500
|
+
* The vector will be empty if no structures are found.
|
|
8501
|
+
*
|
|
8502
|
+
* @param location
|
|
8503
|
+
* Location at which to check for structures.
|
|
8504
|
+
* @throws
|
|
8505
|
+
* An error will be thrown if the location is out of world
|
|
8506
|
+
* bounds.
|
|
8507
|
+
* An error will be thrown if the location is in an unloaded
|
|
8508
|
+
* chunk.
|
|
8509
|
+
*
|
|
8510
|
+
* {@link LocationInUnloadedChunkError}
|
|
8511
|
+
*
|
|
8512
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8513
|
+
*/
|
|
8514
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
7537
8515
|
/**
|
|
7538
8516
|
* @remarks
|
|
7539
8517
|
* Returns the total brightness level of light shining on a
|
|
@@ -7595,6 +8573,16 @@ export class Dimension {
|
|
|
7595
8573
|
* @throws This function can throw errors.
|
|
7596
8574
|
*/
|
|
7597
8575
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
8576
|
+
/**
|
|
8577
|
+
* @beta
|
|
8578
|
+
* @remarks
|
|
8579
|
+
* Returns the current weather.
|
|
8580
|
+
*
|
|
8581
|
+
* @returns
|
|
8582
|
+
* Returns a WeatherType that explains the broad category of
|
|
8583
|
+
* weather that is currently going on.
|
|
8584
|
+
*/
|
|
8585
|
+
getWeather(): WeatherType;
|
|
7598
8586
|
/**
|
|
7599
8587
|
* @remarks
|
|
7600
8588
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -7838,7 +8826,11 @@ export class Dimension {
|
|
|
7838
8826
|
* }
|
|
7839
8827
|
* ```
|
|
7840
8828
|
*/
|
|
7841
|
-
spawnEntity
|
|
8829
|
+
spawnEntity<T = never>(
|
|
8830
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
8831
|
+
location: Vector3,
|
|
8832
|
+
options?: SpawnEntityOptions,
|
|
8833
|
+
): Entity;
|
|
7842
8834
|
/**
|
|
7843
8835
|
* @remarks
|
|
7844
8836
|
* Creates a new item stack as an entity at the specified
|
|
@@ -7933,18 +8925,95 @@ export class Dimension {
|
|
|
7933
8925
|
* ```
|
|
7934
8926
|
*/
|
|
7935
8927
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
7936
|
-
}
|
|
7937
|
-
|
|
7938
|
-
/**
|
|
7939
|
-
* Represents a type of dimension. Currently only works with
|
|
7940
|
-
* Vanilla dimensions.
|
|
7941
|
-
*/
|
|
7942
|
-
export class DimensionType {
|
|
7943
|
-
private constructor();
|
|
7944
8928
|
/**
|
|
8929
|
+
* @beta
|
|
7945
8930
|
* @remarks
|
|
7946
|
-
*
|
|
7947
|
-
*
|
|
8931
|
+
* Spawns an experience orb at a specified location in the
|
|
8932
|
+
* dimension.
|
|
8933
|
+
*
|
|
8934
|
+
* This function can't be called in restricted-execution mode.
|
|
8935
|
+
*
|
|
8936
|
+
* @param location
|
|
8937
|
+
* The location at which to spawn the experience orb.
|
|
8938
|
+
* @param amount
|
|
8939
|
+
* The amount of experience to give the experience orb.
|
|
8940
|
+
* Bounds: [1, 12000]
|
|
8941
|
+
* @throws This function can throw errors.
|
|
8942
|
+
*
|
|
8943
|
+
* {@link LocationInUnloadedChunkError}
|
|
8944
|
+
*
|
|
8945
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8946
|
+
*/
|
|
8947
|
+
spawnXp(location: Vector3, amount: number): void;
|
|
8948
|
+
/**
|
|
8949
|
+
* @beta
|
|
8950
|
+
* @remarks
|
|
8951
|
+
* Stops all sounds from playing for all players.
|
|
8952
|
+
*
|
|
8953
|
+
* This function can't be called in restricted-execution mode.
|
|
8954
|
+
*
|
|
8955
|
+
*/
|
|
8956
|
+
stopAllSounds(): void;
|
|
8957
|
+
/**
|
|
8958
|
+
* @beta
|
|
8959
|
+
* @remarks
|
|
8960
|
+
* Stops a sound from playing for all players.
|
|
8961
|
+
*
|
|
8962
|
+
* This function can't be called in restricted-execution mode.
|
|
8963
|
+
*
|
|
8964
|
+
* @param soundId
|
|
8965
|
+
* Identifier of the sound.
|
|
8966
|
+
*/
|
|
8967
|
+
stopSound(soundId: string): void;
|
|
8968
|
+
}
|
|
8969
|
+
|
|
8970
|
+
/**
|
|
8971
|
+
* @beta
|
|
8972
|
+
* Provides the functionality for registering custom
|
|
8973
|
+
* dimensions. Custom dimensions can only be registered during
|
|
8974
|
+
* the system startup event.
|
|
8975
|
+
*/
|
|
8976
|
+
export class DimensionRegistry {
|
|
8977
|
+
private constructor();
|
|
8978
|
+
/**
|
|
8979
|
+
* @remarks
|
|
8980
|
+
* Registers a new custom dimension type. Must be called during
|
|
8981
|
+
* the system startup event. The dimension will be created
|
|
8982
|
+
* using the void generator.
|
|
8983
|
+
*
|
|
8984
|
+
* This function can be called in early-execution mode.
|
|
8985
|
+
*
|
|
8986
|
+
* @param typeId
|
|
8987
|
+
* The namespaced identifier for the custom dimension (e.g.,
|
|
8988
|
+
* 'mypack:my_dimension'). Must include a namespace and use
|
|
8989
|
+
* only valid identifier characters.
|
|
8990
|
+
* @throws This function can throw errors.
|
|
8991
|
+
*
|
|
8992
|
+
* {@link CustomDimensionAlreadyRegisteredError}
|
|
8993
|
+
*
|
|
8994
|
+
* {@link CustomDimensionInvalidRegistryError}
|
|
8995
|
+
*
|
|
8996
|
+
* {@link CustomDimensionNameError}
|
|
8997
|
+
*
|
|
8998
|
+
* {@link CustomDimensionReloadNewDimensionError}
|
|
8999
|
+
*
|
|
9000
|
+
* {@link minecraftcommon.EngineError}
|
|
9001
|
+
*
|
|
9002
|
+
* {@link NamespaceNameError}
|
|
9003
|
+
*/
|
|
9004
|
+
registerCustomDimension(typeId: string): void;
|
|
9005
|
+
}
|
|
9006
|
+
|
|
9007
|
+
/**
|
|
9008
|
+
* Represents a type of dimension. Currently only works with
|
|
9009
|
+
* Vanilla dimensions.
|
|
9010
|
+
*/
|
|
9011
|
+
export class DimensionType {
|
|
9012
|
+
private constructor();
|
|
9013
|
+
/**
|
|
9014
|
+
* @remarks
|
|
9015
|
+
* Identifier of the dimension type. Currently only works with
|
|
9016
|
+
* Vanilla dimensions.
|
|
7948
9017
|
*
|
|
7949
9018
|
*/
|
|
7950
9019
|
readonly typeId: string;
|
|
@@ -8447,6 +9516,26 @@ export class Entity {
|
|
|
8447
9516
|
* {@link InvalidEntityError}
|
|
8448
9517
|
*/
|
|
8449
9518
|
readonly location: Vector3;
|
|
9519
|
+
/**
|
|
9520
|
+
* @beta
|
|
9521
|
+
* @remarks
|
|
9522
|
+
* Boolean which determines if the player nameplate should be
|
|
9523
|
+
* depth tested for visibility.
|
|
9524
|
+
*
|
|
9525
|
+
* This property can't be edited in restricted-execution mode.
|
|
9526
|
+
*
|
|
9527
|
+
*/
|
|
9528
|
+
nameplateDepthTested: boolean;
|
|
9529
|
+
/**
|
|
9530
|
+
* @beta
|
|
9531
|
+
* @remarks
|
|
9532
|
+
* Float that determines the render distance of this entity's
|
|
9533
|
+
* nameplate.
|
|
9534
|
+
*
|
|
9535
|
+
* This property can't be edited in restricted-execution mode.
|
|
9536
|
+
*
|
|
9537
|
+
*/
|
|
9538
|
+
nameplateRenderDistance: number;
|
|
8450
9539
|
/**
|
|
8451
9540
|
* @remarks
|
|
8452
9541
|
* Given name of the entity.
|
|
@@ -8462,6 +9551,18 @@ export class Entity {
|
|
|
8462
9551
|
*
|
|
8463
9552
|
*/
|
|
8464
9553
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
9554
|
+
/**
|
|
9555
|
+
* @beta
|
|
9556
|
+
* @remarks
|
|
9557
|
+
* Retrieves or sets an entity that is used as the target of
|
|
9558
|
+
* AI-related behaviors, like attacking. If the entity
|
|
9559
|
+
* currently has no target returns undefined.
|
|
9560
|
+
*
|
|
9561
|
+
* @throws This property can throw when used.
|
|
9562
|
+
*
|
|
9563
|
+
* {@link InvalidEntityError}
|
|
9564
|
+
*/
|
|
9565
|
+
readonly target?: Entity;
|
|
8465
9566
|
/**
|
|
8466
9567
|
* @remarks
|
|
8467
9568
|
* Identifier of the type of the entity - for example,
|
|
@@ -9703,6 +10804,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
9703
10804
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
9704
10805
|
export class EntityBreathableComponent extends EntityComponent {
|
|
9705
10806
|
private constructor();
|
|
10807
|
+
/**
|
|
10808
|
+
* @beta
|
|
10809
|
+
* @remarks
|
|
10810
|
+
* The current air supply of the entity.
|
|
10811
|
+
*
|
|
10812
|
+
* This property can't be edited in restricted-execution mode.
|
|
10813
|
+
*
|
|
10814
|
+
* @throws
|
|
10815
|
+
* Will throw an error if the air supply is out of bounds
|
|
10816
|
+
* [suffocationTime, maxAirSupply].
|
|
10817
|
+
*/
|
|
10818
|
+
airSupply: number;
|
|
9706
10819
|
/**
|
|
9707
10820
|
* @remarks
|
|
9708
10821
|
* If true, this entity can breathe in air.
|
|
@@ -9731,6 +10844,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
9731
10844
|
* @throws This property can throw when used.
|
|
9732
10845
|
*/
|
|
9733
10846
|
readonly breathesWater: boolean;
|
|
10847
|
+
/**
|
|
10848
|
+
* @beta
|
|
10849
|
+
* @remarks
|
|
10850
|
+
* If true, the entity is able to breathe.
|
|
10851
|
+
*
|
|
10852
|
+
* @throws This property can throw when used.
|
|
10853
|
+
*/
|
|
10854
|
+
readonly canBreathe: boolean;
|
|
9734
10855
|
/**
|
|
9735
10856
|
* @remarks
|
|
9736
10857
|
* If true, this entity will have visible bubbles while in
|
|
@@ -11686,6 +12807,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
11686
12807
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
11687
12808
|
}
|
|
11688
12809
|
|
|
12810
|
+
/**
|
|
12811
|
+
* @beta
|
|
12812
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
12813
|
+
* name, and dialogue interactions.
|
|
12814
|
+
*/
|
|
12815
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12816
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
12817
|
+
private constructor();
|
|
12818
|
+
/**
|
|
12819
|
+
* @remarks
|
|
12820
|
+
* The DialogueScene that is opened when players first interact
|
|
12821
|
+
* with the NPC.
|
|
12822
|
+
*
|
|
12823
|
+
* This property can't be edited in restricted-execution mode.
|
|
12824
|
+
*
|
|
12825
|
+
*/
|
|
12826
|
+
defaultScene: string;
|
|
12827
|
+
/**
|
|
12828
|
+
* @remarks
|
|
12829
|
+
* The name of the NPC as it is displayed to players.
|
|
12830
|
+
*
|
|
12831
|
+
* This property can't be edited in restricted-execution mode.
|
|
12832
|
+
*
|
|
12833
|
+
*/
|
|
12834
|
+
name: string;
|
|
12835
|
+
/**
|
|
12836
|
+
* @remarks
|
|
12837
|
+
* The index of the skin the NPC will use.
|
|
12838
|
+
*
|
|
12839
|
+
* This property can't be edited in restricted-execution mode.
|
|
12840
|
+
*
|
|
12841
|
+
*/
|
|
12842
|
+
skinIndex: number;
|
|
12843
|
+
static readonly componentId = 'minecraft:npc';
|
|
12844
|
+
}
|
|
12845
|
+
|
|
11689
12846
|
/**
|
|
11690
12847
|
* When present on an entity, this entity is on fire.
|
|
11691
12848
|
* @example setOnFire.ts
|
|
@@ -12557,7 +13714,7 @@ export class EntityTypes {
|
|
|
12557
13714
|
* Retrieves an entity type using a string-based identifier.
|
|
12558
13715
|
*
|
|
12559
13716
|
*/
|
|
12560
|
-
static get(identifier:
|
|
13717
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
12561
13718
|
/**
|
|
12562
13719
|
* @remarks
|
|
12563
13720
|
* Retrieves a set of all entity types within this world.
|
|
@@ -12576,6 +13733,68 @@ export class EntityUnderwaterMovementComponent extends EntityAttributeComponent
|
|
|
12576
13733
|
static readonly componentId = 'minecraft:underwater_movement';
|
|
12577
13734
|
}
|
|
12578
13735
|
|
|
13736
|
+
/**
|
|
13737
|
+
* @beta
|
|
13738
|
+
* Contains information related to firing of a data driven
|
|
13739
|
+
* entity version upgrade.
|
|
13740
|
+
*/
|
|
13741
|
+
export class EntityUpgradeAfterEvent {
|
|
13742
|
+
private constructor();
|
|
13743
|
+
/**
|
|
13744
|
+
* @remarks
|
|
13745
|
+
* Entity that the upgrade triggered on.
|
|
13746
|
+
*
|
|
13747
|
+
*/
|
|
13748
|
+
readonly entity: Entity;
|
|
13749
|
+
/**
|
|
13750
|
+
* @remarks
|
|
13751
|
+
* Name of the data driven upgrade being triggered.
|
|
13752
|
+
*
|
|
13753
|
+
*/
|
|
13754
|
+
readonly upgradeId: string;
|
|
13755
|
+
/**
|
|
13756
|
+
* @remarks
|
|
13757
|
+
* An updateable list of modifications to component state that
|
|
13758
|
+
* are the effect of this triggered upgrade.
|
|
13759
|
+
*
|
|
13760
|
+
*/
|
|
13761
|
+
getModifiers(): DefinitionModifier[];
|
|
13762
|
+
}
|
|
13763
|
+
|
|
13764
|
+
/**
|
|
13765
|
+
* @beta
|
|
13766
|
+
* Contains event registration related to firing of a data
|
|
13767
|
+
* driven entity version upgrade.
|
|
13768
|
+
*/
|
|
13769
|
+
export class EntityUpgradeAfterEventSignal {
|
|
13770
|
+
private constructor();
|
|
13771
|
+
/**
|
|
13772
|
+
* @remarks
|
|
13773
|
+
* Adds a callback that will be called after a data driven
|
|
13774
|
+
* entity version upgrade is triggered.
|
|
13775
|
+
*
|
|
13776
|
+
* This function can't be called in restricted-execution mode.
|
|
13777
|
+
*
|
|
13778
|
+
* This function can be called in early-execution mode.
|
|
13779
|
+
*
|
|
13780
|
+
*/
|
|
13781
|
+
subscribe(
|
|
13782
|
+
callback: (arg0: EntityUpgradeAfterEvent) => void,
|
|
13783
|
+
options?: EntityDataDrivenTriggerEventOptions,
|
|
13784
|
+
): (arg0: EntityUpgradeAfterEvent) => void;
|
|
13785
|
+
/**
|
|
13786
|
+
* @remarks
|
|
13787
|
+
* Removes a callback that will be called after a data driven
|
|
13788
|
+
* entity version upgrade is triggered.
|
|
13789
|
+
*
|
|
13790
|
+
* This function can't be called in restricted-execution mode.
|
|
13791
|
+
*
|
|
13792
|
+
* This function can be called in early-execution mode.
|
|
13793
|
+
*
|
|
13794
|
+
*/
|
|
13795
|
+
unsubscribe(callback: (arg0: EntityUpgradeAfterEvent) => void): void;
|
|
13796
|
+
}
|
|
13797
|
+
|
|
12579
13798
|
/**
|
|
12580
13799
|
* Used to differentiate the component group of a variant of an
|
|
12581
13800
|
* entity from others. (e.g. ocelot, villager).
|
|
@@ -12604,6 +13823,51 @@ export class EntityWantsJockeyComponent extends EntityComponent {
|
|
|
12604
13823
|
static readonly componentId = 'minecraft:wants_jockey';
|
|
12605
13824
|
}
|
|
12606
13825
|
|
|
13826
|
+
/**
|
|
13827
|
+
* @beta
|
|
13828
|
+
* Waypoint that tracks an entity's position. The waypoint
|
|
13829
|
+
* automatically updates as the entity moves and becomes
|
|
13830
|
+
* invalid when the entity is removed.
|
|
13831
|
+
*/
|
|
13832
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13833
|
+
export class EntityWaypoint extends Waypoint {
|
|
13834
|
+
/**
|
|
13835
|
+
* @remarks
|
|
13836
|
+
* The entity being tracked by this waypoint.
|
|
13837
|
+
*
|
|
13838
|
+
* @throws This property can throw when used.
|
|
13839
|
+
*
|
|
13840
|
+
* {@link InvalidWaypointError}
|
|
13841
|
+
*
|
|
13842
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
13843
|
+
*/
|
|
13844
|
+
readonly entity: Entity;
|
|
13845
|
+
/**
|
|
13846
|
+
* @remarks
|
|
13847
|
+
* The visibility rules that control when the waypoint is shown
|
|
13848
|
+
* based on the entity's state (e.g., sneaking, invisible,
|
|
13849
|
+
* dead).
|
|
13850
|
+
*
|
|
13851
|
+
* @throws This property can throw when used.
|
|
13852
|
+
*
|
|
13853
|
+
* {@link InvalidWaypointError}
|
|
13854
|
+
*
|
|
13855
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
13856
|
+
*/
|
|
13857
|
+
readonly entityRules: EntityVisibilityRules;
|
|
13858
|
+
/**
|
|
13859
|
+
* @throws This function can throw errors.
|
|
13860
|
+
*
|
|
13861
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
13862
|
+
*/
|
|
13863
|
+
constructor(
|
|
13864
|
+
entity: Entity,
|
|
13865
|
+
textureSelector: WaypointTextureSelector,
|
|
13866
|
+
entityRules: EntityVisibilityRules,
|
|
13867
|
+
color?: RGB,
|
|
13868
|
+
);
|
|
13869
|
+
}
|
|
13870
|
+
|
|
12607
13871
|
/**
|
|
12608
13872
|
* Loot item function that modifies a dropped treasure map to
|
|
12609
13873
|
* mark a location.
|
|
@@ -13047,6 +14311,13 @@ export class GameRules {
|
|
|
13047
14311
|
*
|
|
13048
14312
|
*/
|
|
13049
14313
|
playersSleepingPercentage: number;
|
|
14314
|
+
/**
|
|
14315
|
+
* @beta
|
|
14316
|
+
* @remarks
|
|
14317
|
+
* This property can't be edited in restricted-execution mode.
|
|
14318
|
+
*
|
|
14319
|
+
*/
|
|
14320
|
+
playerWaypoints: PlayerWaypointsMode;
|
|
13050
14321
|
/**
|
|
13051
14322
|
* @remarks
|
|
13052
14323
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -15355,84 +16626,253 @@ export class ListBlockVolume extends BlockVolumeBase {
|
|
|
15355
16626
|
}
|
|
15356
16627
|
|
|
15357
16628
|
/**
|
|
15358
|
-
*
|
|
15359
|
-
*
|
|
16629
|
+
* @beta
|
|
16630
|
+
* Waypoint that points to a fixed location in the world.
|
|
16631
|
+
* Unlike entity waypoints, location waypoints always remain
|
|
16632
|
+
* valid and their position can be updated.
|
|
15360
16633
|
*/
|
|
15361
16634
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15362
|
-
export class
|
|
15363
|
-
private constructor();
|
|
16635
|
+
export class LocationWaypoint extends Waypoint {
|
|
15364
16636
|
/**
|
|
15365
|
-
* @
|
|
15366
|
-
* The value range from which the function randomly chooses the
|
|
15367
|
-
* number of extra items to drop. Contains minimum and maximum
|
|
15368
|
-
* values.
|
|
16637
|
+
* @throws This function can throw errors.
|
|
15369
16638
|
*
|
|
16639
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
15370
16640
|
*/
|
|
15371
|
-
|
|
15372
|
-
}
|
|
15373
|
-
|
|
15374
|
-
/**
|
|
15375
|
-
* Represents a loot pool entry containing an item to drop.
|
|
15376
|
-
*/
|
|
15377
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15378
|
-
export class LootItem extends LootPoolEntry {
|
|
15379
|
-
private constructor();
|
|
15380
|
-
readonly functions: LootItemFunction[];
|
|
16641
|
+
constructor(dimensionLocation: DimensionLocation, textureSelector: WaypointTextureSelector, color?: RGB);
|
|
15381
16642
|
/**
|
|
15382
16643
|
* @remarks
|
|
15383
|
-
*
|
|
16644
|
+
* Updates the dimension and location that this waypoint points
|
|
16645
|
+
* to.
|
|
16646
|
+
*
|
|
16647
|
+
* This function can't be called in restricted-execution mode.
|
|
15384
16648
|
*
|
|
16649
|
+
* @param dimensionLocation
|
|
16650
|
+
* The new {@link DimensionLocation} (dimension and
|
|
16651
|
+
* coordinates) for the waypoint.
|
|
15385
16652
|
*/
|
|
15386
|
-
|
|
15387
|
-
}
|
|
15388
|
-
|
|
15389
|
-
/**
|
|
15390
|
-
* An abstract base class from which all loot item conditions
|
|
15391
|
-
* are derived. A loot item condition is a set of rules or
|
|
15392
|
-
* requirements which must be met for a loot drop to happen.
|
|
15393
|
-
*/
|
|
15394
|
-
export class LootItemCondition {
|
|
15395
|
-
private constructor();
|
|
15396
|
-
}
|
|
15397
|
-
|
|
15398
|
-
/**
|
|
15399
|
-
* An abstract base class from which all loot item functions
|
|
15400
|
-
* are derived. Loot item functions can modify loot drops in a
|
|
15401
|
-
* variety of ways as they happen, optionally dependent on a
|
|
15402
|
-
* set of conditions which must be met.
|
|
15403
|
-
*/
|
|
15404
|
-
export class LootItemFunction {
|
|
15405
|
-
private constructor();
|
|
15406
|
-
readonly conditions: LootItemCondition[];
|
|
16653
|
+
setDimensionLocation(dimensionLocation: DimensionLocation): void;
|
|
15407
16654
|
}
|
|
15408
16655
|
|
|
15409
16656
|
/**
|
|
15410
|
-
*
|
|
15411
|
-
*
|
|
15412
|
-
*
|
|
16657
|
+
* @beta
|
|
16658
|
+
* Manages the collection of waypoints displayed on a player's
|
|
16659
|
+
* locator bar. Allows adding, removing, and querying waypoints
|
|
16660
|
+
* with a maximum capacity limit.
|
|
16661
|
+
*
|
|
16662
|
+
* Invalid waypoints in the locator bar will be automatically
|
|
16663
|
+
* removed in the next tick. This includes waypoints tied to
|
|
16664
|
+
* entities that have been removed from the world.
|
|
16665
|
+
*
|
|
16666
|
+
* Note: You can control whether vanilla player waypoints are
|
|
16667
|
+
* automatically added to the locator bar using the
|
|
16668
|
+
* `playerWaypoints` {@link GameRule}. Accepted values are
|
|
16669
|
+
* `off` (players are not shown on the locator bar) and
|
|
16670
|
+
* `everyone` (all players are visible on the locator bar).
|
|
16671
|
+
*
|
|
16672
|
+
* Note: You can only modify, remove, or query waypoints that
|
|
16673
|
+
* were added by this pack.
|
|
16674
|
+
* @example sharedWaypoint.ts
|
|
16675
|
+
* ```typescript
|
|
16676
|
+
* /\*
|
|
16677
|
+
* import { world, LocationWaypoint, WaypointTextureSelector, WaypointTexture } from "@minecraft/server"
|
|
16678
|
+
*
|
|
16679
|
+
* function sharedWaypoint() {
|
|
16680
|
+
* const players = world.getAllPlayers();
|
|
16681
|
+
*
|
|
16682
|
+
* if (players.length < 2) {
|
|
16683
|
+
* console.warn("Need at least 2 players for this example.");
|
|
16684
|
+
* return;
|
|
16685
|
+
* }
|
|
16686
|
+
*
|
|
16687
|
+
* const playerA = players[0];
|
|
16688
|
+
* const playerB = players[1];
|
|
16689
|
+
*
|
|
16690
|
+
* // Create a single waypoint at a specific location
|
|
16691
|
+
* const textureSelector: WaypointTextureSelector = {
|
|
16692
|
+
* textureBoundsList: [
|
|
16693
|
+
* { lowerBound: 0, texture: WaypointTexture.Circle }
|
|
16694
|
+
* ]
|
|
16695
|
+
* };
|
|
16696
|
+
*
|
|
16697
|
+
* const waypoint = new LocationWaypoint(
|
|
16698
|
+
* { dimension: playerA.dimension, x: 100, y: 64, z: 100 },
|
|
16699
|
+
* textureSelector,
|
|
16700
|
+
* { red: 1, green: 0, blue: 0 } // Initially red
|
|
16701
|
+
* );
|
|
16702
|
+
*
|
|
16703
|
+
* // Add the same waypoint to both players' locator bars
|
|
16704
|
+
* playerA.locatorBar.addWaypoint(waypoint);
|
|
16705
|
+
* playerB.locatorBar.addWaypoint(waypoint);
|
|
16706
|
+
*
|
|
16707
|
+
* // Change the color - this affects both players
|
|
16708
|
+
* waypoint.color = { red: 0, green: 1, blue: 0 }; // Now green for both players
|
|
16709
|
+
* }
|
|
16710
|
+
* *\/
|
|
16711
|
+
* ```
|
|
15413
16712
|
*/
|
|
15414
|
-
export class
|
|
16713
|
+
export class LocatorBar {
|
|
15415
16714
|
private constructor();
|
|
15416
16715
|
/**
|
|
15417
16716
|
* @remarks
|
|
15418
|
-
*
|
|
15419
|
-
* based on the player's luck level, represented as a range
|
|
15420
|
-
* from minimum to maximum rolls.
|
|
16717
|
+
* The current number of waypoints in the locator bar.
|
|
15421
16718
|
*
|
|
15422
16719
|
*/
|
|
15423
|
-
readonly
|
|
15424
|
-
readonly conditions: LootItemCondition[];
|
|
16720
|
+
readonly count: number;
|
|
15425
16721
|
/**
|
|
15426
16722
|
* @remarks
|
|
15427
|
-
*
|
|
15428
|
-
*
|
|
16723
|
+
* The maximum number of waypoints that can be added to the
|
|
16724
|
+
* locator bar.
|
|
15429
16725
|
*
|
|
15430
16726
|
*/
|
|
15431
|
-
readonly
|
|
16727
|
+
readonly maxCount: number;
|
|
15432
16728
|
/**
|
|
15433
16729
|
* @remarks
|
|
15434
|
-
*
|
|
15435
|
-
*
|
|
16730
|
+
* Adds a waypoint to the locator bar. Throws an error if the
|
|
16731
|
+
* waypoint already exists, the maximum waypoint limit has been
|
|
16732
|
+
* reached, or the waypoint is invalid.
|
|
16733
|
+
*
|
|
16734
|
+
* This function can't be called in restricted-execution mode.
|
|
16735
|
+
*
|
|
16736
|
+
* @param waypoint
|
|
16737
|
+
* The {@link Waypoint} to add to the locator bar.
|
|
16738
|
+
* @throws This function can throw errors.
|
|
16739
|
+
*
|
|
16740
|
+
* {@link minecraftcommon.EngineError}
|
|
16741
|
+
*
|
|
16742
|
+
* {@link InvalidWaypointError}
|
|
16743
|
+
*
|
|
16744
|
+
* {@link LocatorBarError}
|
|
16745
|
+
*/
|
|
16746
|
+
addWaypoint(waypoint: Waypoint): void;
|
|
16747
|
+
/**
|
|
16748
|
+
* @remarks
|
|
16749
|
+
* Returns an array of all waypoints currently in the locator
|
|
16750
|
+
* bar.
|
|
16751
|
+
*
|
|
16752
|
+
* This function can't be called in restricted-execution mode.
|
|
16753
|
+
*
|
|
16754
|
+
*/
|
|
16755
|
+
getAllWaypoints(): Waypoint[];
|
|
16756
|
+
/**
|
|
16757
|
+
* @remarks
|
|
16758
|
+
* Checks whether the specified waypoint exists in the locator
|
|
16759
|
+
* bar.
|
|
16760
|
+
*
|
|
16761
|
+
* This function can't be called in restricted-execution mode.
|
|
16762
|
+
*
|
|
16763
|
+
* @param waypoint
|
|
16764
|
+
* The {@link Waypoint} to check for.
|
|
16765
|
+
*/
|
|
16766
|
+
hasWaypoint(waypoint: Waypoint): boolean;
|
|
16767
|
+
/**
|
|
16768
|
+
* @remarks
|
|
16769
|
+
* Removes all waypoints from the locator bar, clearing it
|
|
16770
|
+
* completely.
|
|
16771
|
+
*
|
|
16772
|
+
* This function can't be called in restricted-execution mode.
|
|
16773
|
+
*
|
|
16774
|
+
* @throws This function can throw errors.
|
|
16775
|
+
*
|
|
16776
|
+
* {@link minecraftcommon.EngineError}
|
|
16777
|
+
*/
|
|
16778
|
+
removeAllWaypoints(): void;
|
|
16779
|
+
/**
|
|
16780
|
+
* @remarks
|
|
16781
|
+
* Removes a specific waypoint from the locator bar. Returns an
|
|
16782
|
+
* error if the waypoint does not exist in the locator bar.
|
|
16783
|
+
*
|
|
16784
|
+
* This function can't be called in restricted-execution mode.
|
|
16785
|
+
*
|
|
16786
|
+
* @param waypoint
|
|
16787
|
+
* The {@link Waypoint} to remove from the locator bar.
|
|
16788
|
+
* @throws This function can throw errors.
|
|
16789
|
+
*
|
|
16790
|
+
* {@link minecraftcommon.EngineError}
|
|
16791
|
+
*
|
|
16792
|
+
* {@link LocatorBarError}
|
|
16793
|
+
*/
|
|
16794
|
+
removeWaypoint(waypoint: Waypoint): void;
|
|
16795
|
+
}
|
|
16796
|
+
|
|
16797
|
+
/**
|
|
16798
|
+
* Loot item function that drops extra items if the provided
|
|
16799
|
+
* tool has the looting enchant.
|
|
16800
|
+
*/
|
|
16801
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
16802
|
+
export class LootingEnchantFunction extends LootItemFunction {
|
|
16803
|
+
private constructor();
|
|
16804
|
+
/**
|
|
16805
|
+
* @remarks
|
|
16806
|
+
* The value range from which the function randomly chooses the
|
|
16807
|
+
* number of extra items to drop. Contains minimum and maximum
|
|
16808
|
+
* values.
|
|
16809
|
+
*
|
|
16810
|
+
*/
|
|
16811
|
+
readonly count: minecraftcommon.NumberRange;
|
|
16812
|
+
}
|
|
16813
|
+
|
|
16814
|
+
/**
|
|
16815
|
+
* Represents a loot pool entry containing an item to drop.
|
|
16816
|
+
*/
|
|
16817
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
16818
|
+
export class LootItem extends LootPoolEntry {
|
|
16819
|
+
private constructor();
|
|
16820
|
+
readonly functions: LootItemFunction[];
|
|
16821
|
+
/**
|
|
16822
|
+
* @remarks
|
|
16823
|
+
* The name of the item contained in this entry.
|
|
16824
|
+
*
|
|
16825
|
+
*/
|
|
16826
|
+
readonly name?: ItemType;
|
|
16827
|
+
}
|
|
16828
|
+
|
|
16829
|
+
/**
|
|
16830
|
+
* An abstract base class from which all loot item conditions
|
|
16831
|
+
* are derived. A loot item condition is a set of rules or
|
|
16832
|
+
* requirements which must be met for a loot drop to happen.
|
|
16833
|
+
*/
|
|
16834
|
+
export class LootItemCondition {
|
|
16835
|
+
private constructor();
|
|
16836
|
+
}
|
|
16837
|
+
|
|
16838
|
+
/**
|
|
16839
|
+
* An abstract base class from which all loot item functions
|
|
16840
|
+
* are derived. Loot item functions can modify loot drops in a
|
|
16841
|
+
* variety of ways as they happen, optionally dependent on a
|
|
16842
|
+
* set of conditions which must be met.
|
|
16843
|
+
*/
|
|
16844
|
+
export class LootItemFunction {
|
|
16845
|
+
private constructor();
|
|
16846
|
+
readonly conditions: LootItemCondition[];
|
|
16847
|
+
}
|
|
16848
|
+
|
|
16849
|
+
/**
|
|
16850
|
+
* A collection of entries which individually determine loot
|
|
16851
|
+
* drops. Can contain values determining drop outcomes,
|
|
16852
|
+
* including rolls, bonus rolls and tiers.
|
|
16853
|
+
*/
|
|
16854
|
+
export class LootPool {
|
|
16855
|
+
private constructor();
|
|
16856
|
+
/**
|
|
16857
|
+
* @remarks
|
|
16858
|
+
* Returns the number of extra times a loot pool will be rolled
|
|
16859
|
+
* based on the player's luck level, represented as a range
|
|
16860
|
+
* from minimum to maximum rolls.
|
|
16861
|
+
*
|
|
16862
|
+
*/
|
|
16863
|
+
readonly bonusRolls: minecraftcommon.NumberRange;
|
|
16864
|
+
readonly conditions: LootItemCondition[];
|
|
16865
|
+
/**
|
|
16866
|
+
* @remarks
|
|
16867
|
+
* Gets a complete list of all loot pool entries contained in
|
|
16868
|
+
* the loot pool.
|
|
16869
|
+
*
|
|
16870
|
+
*/
|
|
16871
|
+
readonly entries: LootPoolEntry[];
|
|
16872
|
+
/**
|
|
16873
|
+
* @remarks
|
|
16874
|
+
* Returns the number of times a loot pool will be rolled,
|
|
16875
|
+
* represented as a range from minimum to maximum rolls.
|
|
15436
16876
|
*
|
|
15437
16877
|
*/
|
|
15438
16878
|
readonly rolls: minecraftcommon.NumberRange;
|
|
@@ -15732,6 +17172,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
15732
17172
|
readonly itemTagsNone: string[];
|
|
15733
17173
|
}
|
|
15734
17174
|
|
|
17175
|
+
/**
|
|
17176
|
+
* @beta
|
|
17177
|
+
* A specific currently-internal event used for passing
|
|
17178
|
+
* messages from client to server.
|
|
17179
|
+
*/
|
|
17180
|
+
export class MessageReceiveAfterEvent {
|
|
17181
|
+
private constructor();
|
|
17182
|
+
/**
|
|
17183
|
+
* @remarks
|
|
17184
|
+
* The message identifier.
|
|
17185
|
+
*
|
|
17186
|
+
*/
|
|
17187
|
+
readonly id: string;
|
|
17188
|
+
/**
|
|
17189
|
+
* @remarks
|
|
17190
|
+
* The message.
|
|
17191
|
+
*
|
|
17192
|
+
*/
|
|
17193
|
+
readonly message: string;
|
|
17194
|
+
/**
|
|
17195
|
+
* @remarks
|
|
17196
|
+
* The player who sent the message.
|
|
17197
|
+
*
|
|
17198
|
+
*/
|
|
17199
|
+
readonly player: Player;
|
|
17200
|
+
}
|
|
17201
|
+
|
|
15735
17202
|
/**
|
|
15736
17203
|
* Contains a set of additional variable values for further
|
|
15737
17204
|
* defining how rendering and animations function.
|
|
@@ -15800,6 +17267,49 @@ export class MolangVariableMap {
|
|
|
15800
17267
|
setVector3(variableName: string, vector: Vector3): void;
|
|
15801
17268
|
}
|
|
15802
17269
|
|
|
17270
|
+
/**
|
|
17271
|
+
* @beta
|
|
17272
|
+
* Pack setting name and value that changed.
|
|
17273
|
+
*/
|
|
17274
|
+
export class PackSettingChangeAfterEvent {
|
|
17275
|
+
private constructor();
|
|
17276
|
+
/**
|
|
17277
|
+
* @remarks
|
|
17278
|
+
* The name of the setting.
|
|
17279
|
+
*
|
|
17280
|
+
*/
|
|
17281
|
+
readonly settingName: string;
|
|
17282
|
+
/**
|
|
17283
|
+
* @remarks
|
|
17284
|
+
* The value of the setting.
|
|
17285
|
+
*
|
|
17286
|
+
*/
|
|
17287
|
+
readonly settingValue: boolean | number | string;
|
|
17288
|
+
}
|
|
17289
|
+
|
|
17290
|
+
/**
|
|
17291
|
+
* @beta
|
|
17292
|
+
*/
|
|
17293
|
+
export class PackSettingChangeAfterEventSignal {
|
|
17294
|
+
private constructor();
|
|
17295
|
+
/**
|
|
17296
|
+
* @remarks
|
|
17297
|
+
* This function can't be called in restricted-execution mode.
|
|
17298
|
+
*
|
|
17299
|
+
* This function can be called in early-execution mode.
|
|
17300
|
+
*
|
|
17301
|
+
*/
|
|
17302
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
17303
|
+
/**
|
|
17304
|
+
* @remarks
|
|
17305
|
+
* This function can't be called in restricted-execution mode.
|
|
17306
|
+
*
|
|
17307
|
+
* This function can be called in early-execution mode.
|
|
17308
|
+
*
|
|
17309
|
+
*/
|
|
17310
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
17311
|
+
}
|
|
17312
|
+
|
|
15803
17313
|
/**
|
|
15804
17314
|
* Loot item condition that checks whether the looting entity
|
|
15805
17315
|
* is currently a passenger of a specific type of entity.
|
|
@@ -15967,6 +17477,62 @@ export class Player extends Entity {
|
|
|
15967
17477
|
* @throws This property can throw when used.
|
|
15968
17478
|
*/
|
|
15969
17479
|
readonly camera: Camera;
|
|
17480
|
+
/**
|
|
17481
|
+
* @beta
|
|
17482
|
+
* @remarks
|
|
17483
|
+
* The player's chat display name, composed from {@link
|
|
17484
|
+
* Player.chatNamePrefix} + {@link Player.name} + {@link
|
|
17485
|
+
* Player.chatNameSuffix}. This is the name shown as the author
|
|
17486
|
+
* of chat messages sent by this player. To change the name
|
|
17487
|
+
* shown above the player's head, use {@link Entity.nameTag}.
|
|
17488
|
+
*
|
|
17489
|
+
* @throws This property can throw when used.
|
|
17490
|
+
*
|
|
17491
|
+
* {@link InvalidEntityError}
|
|
17492
|
+
*/
|
|
17493
|
+
readonly chatDisplayName: string;
|
|
17494
|
+
/**
|
|
17495
|
+
* @beta
|
|
17496
|
+
* @remarks
|
|
17497
|
+
* An optional string that, when set, is prepended to the text
|
|
17498
|
+
* of chat messages sent by this player. Useful for applying
|
|
17499
|
+
* formatting or color codes to a player's messages (e.g., '§a'
|
|
17500
|
+
* to make their messages green). Does not affect the player's
|
|
17501
|
+
* name display - use {@link Player.chatNamePrefix} for the
|
|
17502
|
+
* name shown in chat, or {@link Entity.nameTag} for the name
|
|
17503
|
+
* above the player's head. Set to undefined to clear.
|
|
17504
|
+
*
|
|
17505
|
+
* This property can't be edited in restricted-execution mode.
|
|
17506
|
+
*
|
|
17507
|
+
*/
|
|
17508
|
+
chatMessagePrefix?: string;
|
|
17509
|
+
/**
|
|
17510
|
+
* @beta
|
|
17511
|
+
* @remarks
|
|
17512
|
+
* An optional string that, when set, is prepended to the
|
|
17513
|
+
* player's name in chat messages. Does not affect the name tag
|
|
17514
|
+
* above the player's head or the player list - use {@link
|
|
17515
|
+
* Entity.nameTag} for that. To prefix the message text itself,
|
|
17516
|
+
* use {@link Player.chatMessagePrefix}. Set to undefined to
|
|
17517
|
+
* clear.
|
|
17518
|
+
*
|
|
17519
|
+
* This property can't be edited in restricted-execution mode.
|
|
17520
|
+
*
|
|
17521
|
+
*/
|
|
17522
|
+
chatNamePrefix?: string;
|
|
17523
|
+
/**
|
|
17524
|
+
* @beta
|
|
17525
|
+
* @remarks
|
|
17526
|
+
* An optional string that, when set, is appended to the
|
|
17527
|
+
* player's name in chat messages. Does not affect the name tag
|
|
17528
|
+
* above the player's head or the player list - use {@link
|
|
17529
|
+
* Entity.nameTag} for that. See also {@link
|
|
17530
|
+
* Player.chatNamePrefix}. Set to undefined to clear.
|
|
17531
|
+
*
|
|
17532
|
+
* This property can't be edited in restricted-execution mode.
|
|
17533
|
+
*
|
|
17534
|
+
*/
|
|
17535
|
+
chatNameSuffix?: string;
|
|
15970
17536
|
/**
|
|
15971
17537
|
* @remarks
|
|
15972
17538
|
* Contains the player's device information.
|
|
@@ -16041,6 +17607,14 @@ export class Player extends Entity {
|
|
|
16041
17607
|
* @throws This property can throw when used.
|
|
16042
17608
|
*/
|
|
16043
17609
|
readonly level: number;
|
|
17610
|
+
/**
|
|
17611
|
+
* @beta
|
|
17612
|
+
* @remarks
|
|
17613
|
+
* The player's Locator Bar. This property is used for managing
|
|
17614
|
+
* waypoints displayed on the HUD.
|
|
17615
|
+
*
|
|
17616
|
+
*/
|
|
17617
|
+
readonly locatorBar: LocatorBar;
|
|
16044
17618
|
/**
|
|
16045
17619
|
* @remarks
|
|
16046
17620
|
* Name of the player.
|
|
@@ -16056,12 +17630,35 @@ export class Player extends Entity {
|
|
|
16056
17630
|
* @throws This property can throw when used.
|
|
16057
17631
|
*/
|
|
16058
17632
|
readonly onScreenDisplay: ScreenDisplay;
|
|
17633
|
+
/**
|
|
17634
|
+
* @beta
|
|
17635
|
+
* @remarks
|
|
17636
|
+
* The party information for this player, or undefined if the
|
|
17637
|
+
* player is not in a party.
|
|
17638
|
+
*
|
|
17639
|
+
* @throws This property can throw when used.
|
|
17640
|
+
*
|
|
17641
|
+
* {@link InvalidEntityError}
|
|
17642
|
+
*/
|
|
17643
|
+
readonly partyInfo?: PartyInfo;
|
|
16059
17644
|
/**
|
|
16060
17645
|
* @throws This property can throw when used.
|
|
16061
17646
|
*
|
|
16062
17647
|
* {@link InvalidEntityError}
|
|
16063
17648
|
*/
|
|
16064
17649
|
readonly playerPermissionLevel: PlayerPermissionLevel;
|
|
17650
|
+
/**
|
|
17651
|
+
* @beta
|
|
17652
|
+
* @remarks
|
|
17653
|
+
* Gets the player's Playfab ID.
|
|
17654
|
+
*
|
|
17655
|
+
* @throws This property can throw when used.
|
|
17656
|
+
*
|
|
17657
|
+
* {@link minecraftcommon.EngineError}
|
|
17658
|
+
*
|
|
17659
|
+
* {@link InvalidEntityError}
|
|
17660
|
+
*/
|
|
17661
|
+
readonly playfabId: string;
|
|
16065
17662
|
/**
|
|
16066
17663
|
* @remarks
|
|
16067
17664
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -16129,6 +17726,20 @@ export class Player extends Entity {
|
|
|
16129
17726
|
* Throws if the Entity or Entity ID is invalid.
|
|
16130
17727
|
*/
|
|
16131
17728
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
17729
|
+
/**
|
|
17730
|
+
* @beta
|
|
17731
|
+
* @remarks
|
|
17732
|
+
* Eats an item, providing the item's hunger and saturation
|
|
17733
|
+
* effects to the player. Can only be used on food items.
|
|
17734
|
+
*
|
|
17735
|
+
* This function can't be called in restricted-execution mode.
|
|
17736
|
+
*
|
|
17737
|
+
* @param itemStack
|
|
17738
|
+
* The item to eat.
|
|
17739
|
+
* @throws
|
|
17740
|
+
* Throws if the item is not a food item.
|
|
17741
|
+
*/
|
|
17742
|
+
eatItem(itemStack: ItemStack): void;
|
|
16132
17743
|
/**
|
|
16133
17744
|
* @remarks
|
|
16134
17745
|
* The player's aim-assist settings.
|
|
@@ -16162,6 +17773,22 @@ export class Player extends Entity {
|
|
|
16162
17773
|
* @throws This function can throw errors.
|
|
16163
17774
|
*/
|
|
16164
17775
|
getItemCooldown(cooldownCategory: string): number;
|
|
17776
|
+
/**
|
|
17777
|
+
* @beta
|
|
17778
|
+
* @remarks
|
|
17779
|
+
* Gets the player's ping in milliseconds.
|
|
17780
|
+
*
|
|
17781
|
+
* This function can't be called in restricted-execution mode.
|
|
17782
|
+
*
|
|
17783
|
+
* @returns
|
|
17784
|
+
* The player's ping in milliseconds.
|
|
17785
|
+
* @throws This function can throw errors.
|
|
17786
|
+
*
|
|
17787
|
+
* {@link minecraftcommon.EngineError}
|
|
17788
|
+
*
|
|
17789
|
+
* {@link InvalidEntityError}
|
|
17790
|
+
*/
|
|
17791
|
+
getPing(): number;
|
|
16165
17792
|
/**
|
|
16166
17793
|
* @remarks
|
|
16167
17794
|
* Gets the current spawn point of the player.
|
|
@@ -16229,6 +17856,17 @@ export class Player extends Entity {
|
|
|
16229
17856
|
* ```
|
|
16230
17857
|
*/
|
|
16231
17858
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
|
|
17859
|
+
/**
|
|
17860
|
+
* @beta
|
|
17861
|
+
* @remarks
|
|
17862
|
+
* This is an internal-facing method for posting a system
|
|
17863
|
+
* message to downstream clients.
|
|
17864
|
+
*
|
|
17865
|
+
* This function can't be called in restricted-execution mode.
|
|
17866
|
+
*
|
|
17867
|
+
* @throws This function can throw errors.
|
|
17868
|
+
*/
|
|
17869
|
+
postClientMessage(id: string, value: string): void;
|
|
16232
17870
|
/**
|
|
16233
17871
|
* @remarks
|
|
16234
17872
|
* Queues an additional music track that only this particular
|
|
@@ -16504,6 +18142,18 @@ export class Player extends Entity {
|
|
|
16504
18142
|
* @throws This function can throw errors.
|
|
16505
18143
|
*/
|
|
16506
18144
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
18145
|
+
/**
|
|
18146
|
+
* @beta
|
|
18147
|
+
* @remarks
|
|
18148
|
+
* Stops all sounds from playing for this particular player.
|
|
18149
|
+
*
|
|
18150
|
+
* This function can't be called in restricted-execution mode.
|
|
18151
|
+
*
|
|
18152
|
+
* @throws This function can throw errors.
|
|
18153
|
+
*
|
|
18154
|
+
* {@link InvalidEntityError}
|
|
18155
|
+
*/
|
|
18156
|
+
stopAllSounds(): void;
|
|
16507
18157
|
/**
|
|
16508
18158
|
* @remarks
|
|
16509
18159
|
* Stops any music tracks from playing for this particular
|
|
@@ -16514,8 +18164,22 @@ export class Player extends Entity {
|
|
|
16514
18164
|
* @throws This function can throw errors.
|
|
16515
18165
|
*/
|
|
16516
18166
|
stopMusic(): void;
|
|
16517
|
-
|
|
16518
|
-
|
|
18167
|
+
/**
|
|
18168
|
+
* @beta
|
|
18169
|
+
* @remarks
|
|
18170
|
+
* Stops a sound from playing for this particular player.
|
|
18171
|
+
*
|
|
18172
|
+
* This function can't be called in restricted-execution mode.
|
|
18173
|
+
*
|
|
18174
|
+
* @param soundId
|
|
18175
|
+
* Identifier of the sound.
|
|
18176
|
+
* @throws This function can throw errors.
|
|
18177
|
+
*
|
|
18178
|
+
* {@link InvalidEntityError}
|
|
18179
|
+
*/
|
|
18180
|
+
stopSound(soundId: string): void;
|
|
18181
|
+
}
|
|
18182
|
+
|
|
16519
18183
|
/**
|
|
16520
18184
|
* A container for APIs related to player aim-assist.
|
|
16521
18185
|
*/
|
|
@@ -17798,6 +19462,88 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
17798
19462
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
17799
19463
|
}
|
|
17800
19464
|
|
|
19465
|
+
/**
|
|
19466
|
+
* @beta
|
|
19467
|
+
* Contains information regarding an event before a player
|
|
19468
|
+
* places a block.
|
|
19469
|
+
*/
|
|
19470
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19471
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
19472
|
+
private constructor();
|
|
19473
|
+
/**
|
|
19474
|
+
* @remarks
|
|
19475
|
+
* If set to true, cancels the block place event.
|
|
19476
|
+
*
|
|
19477
|
+
*/
|
|
19478
|
+
cancel: boolean;
|
|
19479
|
+
/**
|
|
19480
|
+
* @remarks
|
|
19481
|
+
* The face of the block that the new block is being placed on.
|
|
19482
|
+
*
|
|
19483
|
+
*/
|
|
19484
|
+
readonly face: Direction;
|
|
19485
|
+
/**
|
|
19486
|
+
* @remarks
|
|
19487
|
+
* Location relative to the bottom north-west corner of the
|
|
19488
|
+
* block where the new block is being placed onto.
|
|
19489
|
+
*
|
|
19490
|
+
*/
|
|
19491
|
+
readonly faceLocation: Vector3;
|
|
19492
|
+
/**
|
|
19493
|
+
* @remarks
|
|
19494
|
+
* The block permutation that will be placed if the event is
|
|
19495
|
+
* not cancelled.
|
|
19496
|
+
*
|
|
19497
|
+
*/
|
|
19498
|
+
readonly permutationToPlace: BlockPermutation;
|
|
19499
|
+
/**
|
|
19500
|
+
* @remarks
|
|
19501
|
+
* Player that is placing the block for this event.
|
|
19502
|
+
*
|
|
19503
|
+
*/
|
|
19504
|
+
readonly player: Player;
|
|
19505
|
+
}
|
|
19506
|
+
|
|
19507
|
+
/**
|
|
19508
|
+
* @beta
|
|
19509
|
+
* Manages callbacks that are connected to before a block is
|
|
19510
|
+
* placed by a player.
|
|
19511
|
+
*/
|
|
19512
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
19513
|
+
private constructor();
|
|
19514
|
+
/**
|
|
19515
|
+
* @remarks
|
|
19516
|
+
* Adds a callback that will be called before a block is placed
|
|
19517
|
+
* by a player.
|
|
19518
|
+
*
|
|
19519
|
+
* This function can't be called in restricted-execution mode.
|
|
19520
|
+
*
|
|
19521
|
+
* This function can be called in early-execution mode.
|
|
19522
|
+
*
|
|
19523
|
+
* @param callback
|
|
19524
|
+
* This closure is called with restricted-execution privilege.
|
|
19525
|
+
* @returns
|
|
19526
|
+
* Closure that is called with restricted-execution privilege.
|
|
19527
|
+
*/
|
|
19528
|
+
subscribe(
|
|
19529
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
19530
|
+
options?: BlockEventOptions,
|
|
19531
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
19532
|
+
/**
|
|
19533
|
+
* @remarks
|
|
19534
|
+
* Removes a callback from being called before an block is
|
|
19535
|
+
* placed by a player.
|
|
19536
|
+
*
|
|
19537
|
+
* This function can't be called in restricted-execution mode.
|
|
19538
|
+
*
|
|
19539
|
+
* This function can be called in early-execution mode.
|
|
19540
|
+
*
|
|
19541
|
+
* @param callback
|
|
19542
|
+
* This closure is called with restricted-execution privilege.
|
|
19543
|
+
*/
|
|
19544
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
19545
|
+
}
|
|
19546
|
+
|
|
17801
19547
|
/**
|
|
17802
19548
|
* An event that contains more information about a player
|
|
17803
19549
|
* spawning.
|
|
@@ -17916,6 +19662,114 @@ export class PlayerSwingStartAfterEventSignal {
|
|
|
17916
19662
|
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
17917
19663
|
}
|
|
17918
19664
|
|
|
19665
|
+
/**
|
|
19666
|
+
* @beta
|
|
19667
|
+
* Contains information related to when a player successfully
|
|
19668
|
+
* names an Entity with a named Name Tag item.
|
|
19669
|
+
*/
|
|
19670
|
+
export class PlayerUseNameTagAfterEvent {
|
|
19671
|
+
private constructor();
|
|
19672
|
+
/**
|
|
19673
|
+
* @remarks
|
|
19674
|
+
* The entity that was named by the player.
|
|
19675
|
+
*
|
|
19676
|
+
* This property can't be edited in restricted-execution mode.
|
|
19677
|
+
*
|
|
19678
|
+
*/
|
|
19679
|
+
entityNamed: Entity;
|
|
19680
|
+
/**
|
|
19681
|
+
* @remarks
|
|
19682
|
+
* The new name that the player has given to the entity.
|
|
19683
|
+
*
|
|
19684
|
+
* This property can't be edited in restricted-execution mode.
|
|
19685
|
+
*
|
|
19686
|
+
*/
|
|
19687
|
+
newName: string;
|
|
19688
|
+
/**
|
|
19689
|
+
* @remarks
|
|
19690
|
+
* Handle to the player that used the name tag.
|
|
19691
|
+
*
|
|
19692
|
+
* This property can't be edited in restricted-execution mode.
|
|
19693
|
+
*
|
|
19694
|
+
*/
|
|
19695
|
+
player: Player;
|
|
19696
|
+
/**
|
|
19697
|
+
* @remarks
|
|
19698
|
+
* The previous name of the entity before the player used the
|
|
19699
|
+
* name tag. This will be undefined if the entity was not
|
|
19700
|
+
* previously named.
|
|
19701
|
+
*
|
|
19702
|
+
* This property can't be edited in restricted-execution mode.
|
|
19703
|
+
*
|
|
19704
|
+
*/
|
|
19705
|
+
previousName?: string;
|
|
19706
|
+
}
|
|
19707
|
+
|
|
19708
|
+
/**
|
|
19709
|
+
* @beta
|
|
19710
|
+
* Manages callbacks that are connected to when a player
|
|
19711
|
+
* successfully names an Entity with a named Name Tag item.
|
|
19712
|
+
*/
|
|
19713
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
19714
|
+
private constructor();
|
|
19715
|
+
/**
|
|
19716
|
+
* @remarks
|
|
19717
|
+
* Subscribes the specified callback to a player use name tag
|
|
19718
|
+
* after event.
|
|
19719
|
+
*
|
|
19720
|
+
* This function can't be called in restricted-execution mode.
|
|
19721
|
+
*
|
|
19722
|
+
* This function can be called in early-execution mode.
|
|
19723
|
+
*
|
|
19724
|
+
*/
|
|
19725
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
19726
|
+
/**
|
|
19727
|
+
* @remarks
|
|
19728
|
+
* Removes the specified callback from a player use name tag
|
|
19729
|
+
* after event.
|
|
19730
|
+
*
|
|
19731
|
+
* This function can't be called in restricted-execution mode.
|
|
19732
|
+
*
|
|
19733
|
+
* This function can be called in early-execution mode.
|
|
19734
|
+
*
|
|
19735
|
+
*/
|
|
19736
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
19737
|
+
}
|
|
19738
|
+
|
|
19739
|
+
/**
|
|
19740
|
+
* @beta
|
|
19741
|
+
* Waypoint that tracks a player's position. Extends {@link
|
|
19742
|
+
* EntityWaypoint} with additional player-specific visibility
|
|
19743
|
+
* rules such as hidden state and spectator mode.
|
|
19744
|
+
*/
|
|
19745
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19746
|
+
export class PlayerWaypoint extends EntityWaypoint {
|
|
19747
|
+
/**
|
|
19748
|
+
* @remarks
|
|
19749
|
+
* The {@link PlayerVisibilityRules} that control when the
|
|
19750
|
+
* waypoint is shown based on the player's state (e.g., hidden,
|
|
19751
|
+
* spectator mode, spectator viewing another spectator).
|
|
19752
|
+
*
|
|
19753
|
+
* @throws This property can throw when used.
|
|
19754
|
+
*
|
|
19755
|
+
* {@link InvalidWaypointError}
|
|
19756
|
+
*
|
|
19757
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
19758
|
+
*/
|
|
19759
|
+
readonly playerRules: PlayerVisibilityRules;
|
|
19760
|
+
/**
|
|
19761
|
+
* @throws This function can throw errors.
|
|
19762
|
+
*
|
|
19763
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
19764
|
+
*/
|
|
19765
|
+
constructor(
|
|
19766
|
+
player: Player,
|
|
19767
|
+
textureSelector: WaypointTextureSelector,
|
|
19768
|
+
playerRules: PlayerVisibilityRules,
|
|
19769
|
+
color?: RGB,
|
|
19770
|
+
);
|
|
19771
|
+
}
|
|
19772
|
+
|
|
17919
19773
|
/**
|
|
17920
19774
|
* Represents how the potion effect is delivered.
|
|
17921
19775
|
*/
|
|
@@ -17998,10 +19852,10 @@ export class Potions {
|
|
|
17998
19852
|
*
|
|
17999
19853
|
* {@link InvalidPotionEffectTypeError}
|
|
18000
19854
|
*/
|
|
18001
|
-
static resolve
|
|
18002
|
-
|
|
18003
|
-
|
|
18004
|
-
): ItemStack;
|
|
19855
|
+
static resolve<
|
|
19856
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
19857
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
19858
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
18005
19859
|
}
|
|
18006
19860
|
|
|
18007
19861
|
/**
|
|
@@ -18013,107 +19867,252 @@ export class PressurePlatePopAfterEvent extends BlockEvent {
|
|
|
18013
19867
|
private constructor();
|
|
18014
19868
|
/**
|
|
18015
19869
|
* @remarks
|
|
18016
|
-
* The redstone power of the pressure plate before it was
|
|
18017
|
-
* popped.
|
|
19870
|
+
* The redstone power of the pressure plate before it was
|
|
19871
|
+
* popped.
|
|
19872
|
+
*
|
|
19873
|
+
*/
|
|
19874
|
+
readonly previousRedstonePower: number;
|
|
19875
|
+
/**
|
|
19876
|
+
* @remarks
|
|
19877
|
+
* The redstone power of the pressure plate at the time of the
|
|
19878
|
+
* pop.
|
|
19879
|
+
*
|
|
19880
|
+
*/
|
|
19881
|
+
readonly redstonePower: number;
|
|
19882
|
+
}
|
|
19883
|
+
|
|
19884
|
+
/**
|
|
19885
|
+
* Manages callbacks that are connected to when a pressure
|
|
19886
|
+
* plate is popped.
|
|
19887
|
+
*/
|
|
19888
|
+
export class PressurePlatePopAfterEventSignal {
|
|
19889
|
+
private constructor();
|
|
19890
|
+
/**
|
|
19891
|
+
* @remarks
|
|
19892
|
+
* Adds a callback that will be called when a pressure plate is
|
|
19893
|
+
* popped.
|
|
19894
|
+
*
|
|
19895
|
+
* This function can't be called in restricted-execution mode.
|
|
19896
|
+
*
|
|
19897
|
+
* This function can be called in early-execution mode.
|
|
19898
|
+
*
|
|
19899
|
+
*/
|
|
19900
|
+
subscribe(callback: (arg0: PressurePlatePopAfterEvent) => void): (arg0: PressurePlatePopAfterEvent) => void;
|
|
19901
|
+
/**
|
|
19902
|
+
* @remarks
|
|
19903
|
+
* Removes a callback from being called when a pressure plate
|
|
19904
|
+
* is popped.
|
|
19905
|
+
*
|
|
19906
|
+
* This function can't be called in restricted-execution mode.
|
|
19907
|
+
*
|
|
19908
|
+
* This function can be called in early-execution mode.
|
|
19909
|
+
*
|
|
19910
|
+
*/
|
|
19911
|
+
unsubscribe(callback: (arg0: PressurePlatePopAfterEvent) => void): void;
|
|
19912
|
+
}
|
|
19913
|
+
|
|
19914
|
+
/**
|
|
19915
|
+
* Contains information related to changes to a pressure plate
|
|
19916
|
+
* push.
|
|
19917
|
+
*/
|
|
19918
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19919
|
+
export class PressurePlatePushAfterEvent extends BlockEvent {
|
|
19920
|
+
private constructor();
|
|
19921
|
+
/**
|
|
19922
|
+
* @remarks
|
|
19923
|
+
* The redstone power of the pressure plate before it was
|
|
19924
|
+
* pushed.
|
|
19925
|
+
*
|
|
19926
|
+
*/
|
|
19927
|
+
readonly previousRedstonePower: number;
|
|
19928
|
+
/**
|
|
19929
|
+
* @remarks
|
|
19930
|
+
* The redstone power of the pressure plate at the time of the
|
|
19931
|
+
* push.
|
|
19932
|
+
*
|
|
19933
|
+
*/
|
|
19934
|
+
readonly redstonePower: number;
|
|
19935
|
+
/**
|
|
19936
|
+
* @remarks
|
|
19937
|
+
* Source that triggered the pressure plate push.
|
|
19938
|
+
*
|
|
19939
|
+
*/
|
|
19940
|
+
readonly source: Entity;
|
|
19941
|
+
}
|
|
19942
|
+
|
|
19943
|
+
/**
|
|
19944
|
+
* Manages callbacks that are connected to when a pressure
|
|
19945
|
+
* plate is pushed.
|
|
19946
|
+
*/
|
|
19947
|
+
export class PressurePlatePushAfterEventSignal {
|
|
19948
|
+
private constructor();
|
|
19949
|
+
/**
|
|
19950
|
+
* @remarks
|
|
19951
|
+
* Adds a callback that will be called when a pressure plate is
|
|
19952
|
+
* pushed.
|
|
19953
|
+
*
|
|
19954
|
+
* This function can't be called in restricted-execution mode.
|
|
19955
|
+
*
|
|
19956
|
+
* This function can be called in early-execution mode.
|
|
19957
|
+
*
|
|
19958
|
+
*/
|
|
19959
|
+
subscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): (arg0: PressurePlatePushAfterEvent) => void;
|
|
19960
|
+
/**
|
|
19961
|
+
* @remarks
|
|
19962
|
+
* Removes a callback from being called when a pressure plate
|
|
19963
|
+
* is pushed.
|
|
19964
|
+
*
|
|
19965
|
+
* This function can't be called in restricted-execution mode.
|
|
19966
|
+
*
|
|
19967
|
+
* This function can be called in early-execution mode.
|
|
19968
|
+
*
|
|
19969
|
+
*/
|
|
19970
|
+
unsubscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): void;
|
|
19971
|
+
}
|
|
19972
|
+
|
|
19973
|
+
/**
|
|
19974
|
+
* @beta
|
|
19975
|
+
* The base class for a text primitive. Represents an object in
|
|
19976
|
+
* the world and its base properties.
|
|
19977
|
+
*/
|
|
19978
|
+
export class PrimitiveShape {
|
|
19979
|
+
private constructor();
|
|
19980
|
+
/**
|
|
19981
|
+
* @remarks
|
|
19982
|
+
* The entity this shape is attached to. When set, this shape
|
|
19983
|
+
* will copy the root location of the attached entity and the
|
|
19984
|
+
* shape's position will be used as an offset.
|
|
19985
|
+
*
|
|
19986
|
+
*/
|
|
19987
|
+
attachedTo?: Entity;
|
|
19988
|
+
/**
|
|
19989
|
+
* @remarks
|
|
19990
|
+
* The color of the shape.
|
|
19991
|
+
*
|
|
19992
|
+
*/
|
|
19993
|
+
color: RGBA;
|
|
19994
|
+
/**
|
|
19995
|
+
* @remarks
|
|
19996
|
+
* The dimension the shape is visible within. If the dimension
|
|
19997
|
+
* is undefined, it will display in all dimensions.
|
|
19998
|
+
*
|
|
19999
|
+
*/
|
|
20000
|
+
readonly dimension: Dimension;
|
|
20001
|
+
/**
|
|
20002
|
+
* @remarks
|
|
20003
|
+
* Returns true if the shape has a limited time span before
|
|
20004
|
+
* being removed.
|
|
20005
|
+
*
|
|
20006
|
+
*/
|
|
20007
|
+
readonly hasDuration: boolean;
|
|
20008
|
+
/**
|
|
20009
|
+
* @remarks
|
|
20010
|
+
* The location of the shape.
|
|
20011
|
+
*
|
|
20012
|
+
*/
|
|
20013
|
+
readonly location: Vector3;
|
|
20014
|
+
/**
|
|
20015
|
+
* @remarks
|
|
20016
|
+
* If defined, this distance will be used to determine how far
|
|
20017
|
+
* away this primitive will be rendered for each client. By
|
|
20018
|
+
* default the distance will match the client's render distance
|
|
20019
|
+
* setting.
|
|
20020
|
+
*
|
|
20021
|
+
* Minimum Value: 0
|
|
20022
|
+
*/
|
|
20023
|
+
maximumRenderDistance?: number;
|
|
20024
|
+
/**
|
|
20025
|
+
* @remarks
|
|
20026
|
+
* The rotation of the shape (Euler angles - [Pitch, Yaw,
|
|
20027
|
+
* Roll]).
|
|
18018
20028
|
*
|
|
18019
20029
|
*/
|
|
18020
|
-
|
|
20030
|
+
rotation: Vector3;
|
|
18021
20031
|
/**
|
|
18022
20032
|
* @remarks
|
|
18023
|
-
* The
|
|
18024
|
-
* pop.
|
|
20033
|
+
* The scale of the shape.
|
|
18025
20034
|
*
|
|
20035
|
+
* Bounds: [-1000, 1000]
|
|
18026
20036
|
*/
|
|
18027
|
-
|
|
18028
|
-
}
|
|
18029
|
-
|
|
18030
|
-
/**
|
|
18031
|
-
* Manages callbacks that are connected to when a pressure
|
|
18032
|
-
* plate is popped.
|
|
18033
|
-
*/
|
|
18034
|
-
export class PressurePlatePopAfterEventSignal {
|
|
18035
|
-
private constructor();
|
|
20037
|
+
scale: number;
|
|
18036
20038
|
/**
|
|
18037
20039
|
* @remarks
|
|
18038
|
-
*
|
|
18039
|
-
*
|
|
18040
|
-
*
|
|
18041
|
-
* This function can't be called in restricted-execution mode.
|
|
18042
|
-
*
|
|
18043
|
-
* This function can be called in early-execution mode.
|
|
20040
|
+
* The time left (in seconds) until this shape is automatically
|
|
20041
|
+
* removed. Returns undefined if the shape does not have a
|
|
20042
|
+
* limited life-span.
|
|
18044
20043
|
*
|
|
18045
20044
|
*/
|
|
18046
|
-
|
|
20045
|
+
timeLeft?: number;
|
|
18047
20046
|
/**
|
|
18048
20047
|
* @remarks
|
|
18049
|
-
*
|
|
18050
|
-
*
|
|
18051
|
-
*
|
|
18052
|
-
* This function can't be called in restricted-execution mode.
|
|
18053
|
-
*
|
|
18054
|
-
* This function can be called in early-execution mode.
|
|
20048
|
+
* The total initial time-span (in seconds) until this shape is
|
|
20049
|
+
* automatically removed. Returns undefined if the shape does
|
|
20050
|
+
* not have a limited life-span.
|
|
18055
20051
|
*
|
|
18056
20052
|
*/
|
|
18057
|
-
|
|
18058
|
-
}
|
|
18059
|
-
|
|
18060
|
-
/**
|
|
18061
|
-
* Contains information related to changes to a pressure plate
|
|
18062
|
-
* push.
|
|
18063
|
-
*/
|
|
18064
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18065
|
-
export class PressurePlatePushAfterEvent extends BlockEvent {
|
|
18066
|
-
private constructor();
|
|
20053
|
+
readonly totalTimeLeft?: number;
|
|
18067
20054
|
/**
|
|
18068
20055
|
* @remarks
|
|
18069
|
-
* The
|
|
18070
|
-
*
|
|
20056
|
+
* The list of players that this shape will be visible to. If
|
|
20057
|
+
* left empty, the shape will be visible to all players.
|
|
18071
20058
|
*
|
|
18072
20059
|
*/
|
|
18073
|
-
|
|
20060
|
+
visibleTo: Player[];
|
|
18074
20061
|
/**
|
|
18075
20062
|
* @remarks
|
|
18076
|
-
*
|
|
18077
|
-
*
|
|
20063
|
+
* Removes this shape from the world. The shape can be re-added
|
|
20064
|
+
* via the PrimitiveShapesManager's addText method.
|
|
18078
20065
|
*
|
|
18079
20066
|
*/
|
|
18080
|
-
|
|
20067
|
+
remove(): void;
|
|
18081
20068
|
/**
|
|
18082
20069
|
* @remarks
|
|
18083
|
-
*
|
|
20070
|
+
* Set the location and dimension of the shape. If the
|
|
20071
|
+
* dimension is undefined, it will display in all dimensions.
|
|
18084
20072
|
*
|
|
18085
20073
|
*/
|
|
18086
|
-
|
|
20074
|
+
setLocation(location: DimensionLocation | Vector3): void;
|
|
18087
20075
|
}
|
|
18088
20076
|
|
|
18089
20077
|
/**
|
|
18090
|
-
*
|
|
18091
|
-
*
|
|
20078
|
+
* @beta
|
|
20079
|
+
* Primitive Shapes class used to allow adding and removing
|
|
20080
|
+
* text primitives to the world.
|
|
18092
20081
|
*/
|
|
18093
|
-
export class
|
|
20082
|
+
export class PrimitiveShapesManager {
|
|
18094
20083
|
private constructor();
|
|
18095
20084
|
/**
|
|
18096
20085
|
* @remarks
|
|
18097
|
-
*
|
|
18098
|
-
* pushed.
|
|
20086
|
+
* This is the maximum number of allowed primitive shapes.
|
|
18099
20087
|
*
|
|
18100
|
-
|
|
20088
|
+
*/
|
|
20089
|
+
readonly maxShapes: number;
|
|
20090
|
+
/**
|
|
20091
|
+
* @remarks
|
|
20092
|
+
* Adds a new text primitive to the world.
|
|
18101
20093
|
*
|
|
18102
|
-
*
|
|
20094
|
+
* @param text
|
|
20095
|
+
* The text primitive to be added.
|
|
20096
|
+
* @throws This function can throw errors.
|
|
18103
20097
|
*
|
|
20098
|
+
* {@link minecraftcommon.EngineError}
|
|
20099
|
+
*
|
|
20100
|
+
* {@link PrimitiveShapeError}
|
|
18104
20101
|
*/
|
|
18105
|
-
|
|
20102
|
+
addText(text: TextPrimitive, dimension?: Dimension): void;
|
|
18106
20103
|
/**
|
|
18107
20104
|
* @remarks
|
|
18108
|
-
* Removes
|
|
18109
|
-
* is pushed.
|
|
18110
|
-
*
|
|
18111
|
-
* This function can't be called in restricted-execution mode.
|
|
20105
|
+
* Removes all text primitives from the world.
|
|
18112
20106
|
*
|
|
18113
|
-
|
|
20107
|
+
*/
|
|
20108
|
+
removeAll(): void;
|
|
20109
|
+
/**
|
|
20110
|
+
* @remarks
|
|
20111
|
+
* Removes an instance of a text primitive from the world. This
|
|
20112
|
+
* is equivalent to calling remove on the text itself.
|
|
18114
20113
|
*
|
|
18115
20114
|
*/
|
|
18116
|
-
|
|
20115
|
+
removeText(text: TextPrimitive): void;
|
|
18117
20116
|
}
|
|
18118
20117
|
|
|
18119
20118
|
/**
|
|
@@ -19065,6 +21064,38 @@ export class Seat {
|
|
|
19065
21064
|
readonly seatRotation: number;
|
|
19066
21065
|
}
|
|
19067
21066
|
|
|
21067
|
+
/**
|
|
21068
|
+
* @beta
|
|
21069
|
+
* Manages callbacks that are message passing to a server. This
|
|
21070
|
+
* event is not currently fully implemented, and should not be
|
|
21071
|
+
* used.
|
|
21072
|
+
*/
|
|
21073
|
+
export class ServerMessageAfterEventSignal {
|
|
21074
|
+
private constructor();
|
|
21075
|
+
/**
|
|
21076
|
+
* @remarks
|
|
21077
|
+
* Adds a callback that will be called when an internal message
|
|
21078
|
+
* is passed.
|
|
21079
|
+
*
|
|
21080
|
+
* This function can't be called in restricted-execution mode.
|
|
21081
|
+
*
|
|
21082
|
+
* This function can be called in early-execution mode.
|
|
21083
|
+
*
|
|
21084
|
+
*/
|
|
21085
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
21086
|
+
/**
|
|
21087
|
+
* @remarks
|
|
21088
|
+
* Removes a callback from being called when an internal
|
|
21089
|
+
* message is passed.
|
|
21090
|
+
*
|
|
21091
|
+
* This function can't be called in restricted-execution mode.
|
|
21092
|
+
*
|
|
21093
|
+
* This function can be called in early-execution mode.
|
|
21094
|
+
*
|
|
21095
|
+
*/
|
|
21096
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
21097
|
+
}
|
|
21098
|
+
|
|
19068
21099
|
/**
|
|
19069
21100
|
* Loot item function that modifies the trim on a dropped armor
|
|
19070
21101
|
* item.
|
|
@@ -19093,6 +21124,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
19093
21124
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19094
21125
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
19095
21126
|
private constructor();
|
|
21127
|
+
/**
|
|
21128
|
+
* @beta
|
|
21129
|
+
* @remarks
|
|
21130
|
+
* The base color for the dropped banner.
|
|
21131
|
+
*
|
|
21132
|
+
*/
|
|
21133
|
+
readonly baseColor: string;
|
|
21134
|
+
/**
|
|
21135
|
+
* @beta
|
|
21136
|
+
* @remarks
|
|
21137
|
+
* An array of {@link BannerPattern} objects used to decorate
|
|
21138
|
+
* the banner, including color and pattern type.
|
|
21139
|
+
*
|
|
21140
|
+
*/
|
|
21141
|
+
readonly patterns: BannerPattern[];
|
|
19096
21142
|
/**
|
|
19097
21143
|
* @remarks
|
|
19098
21144
|
* The type of banner to drop.
|
|
@@ -19387,6 +21433,13 @@ export class StartupEvent {
|
|
|
19387
21433
|
*
|
|
19388
21434
|
*/
|
|
19389
21435
|
readonly customCommandRegistry: CustomCommandRegistry;
|
|
21436
|
+
/**
|
|
21437
|
+
* @beta
|
|
21438
|
+
* @remarks
|
|
21439
|
+
* This property can be read in early-execution mode.
|
|
21440
|
+
*
|
|
21441
|
+
*/
|
|
21442
|
+
readonly dimensionRegistry: DimensionRegistry;
|
|
19390
21443
|
/**
|
|
19391
21444
|
* @remarks
|
|
19392
21445
|
* This property can be read in early-execution mode.
|
|
@@ -20044,6 +22097,19 @@ export class SystemBeforeEvents {
|
|
|
20044
22097
|
*
|
|
20045
22098
|
*/
|
|
20046
22099
|
readonly startup: StartupBeforeEventSignal;
|
|
22100
|
+
/**
|
|
22101
|
+
* @beta
|
|
22102
|
+
* @remarks
|
|
22103
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
22104
|
+
* can be due to using too much memory, or by causing
|
|
22105
|
+
* significant slowdown or hang.
|
|
22106
|
+
* To prevent shutdown, set the event's cancel property to
|
|
22107
|
+
* true.
|
|
22108
|
+
*
|
|
22109
|
+
* This property can be read in early-execution mode.
|
|
22110
|
+
*
|
|
22111
|
+
*/
|
|
22112
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
20047
22113
|
}
|
|
20048
22114
|
|
|
20049
22115
|
/**
|
|
@@ -20122,6 +22188,73 @@ export class TargetBlockHitAfterEventSignal {
|
|
|
20122
22188
|
unsubscribe(callback: (arg0: TargetBlockHitAfterEvent) => void): void;
|
|
20123
22189
|
}
|
|
20124
22190
|
|
|
22191
|
+
/**
|
|
22192
|
+
* @beta
|
|
22193
|
+
* A primitive shape class that represents a text label in the
|
|
22194
|
+
* world with a background.
|
|
22195
|
+
*/
|
|
22196
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
22197
|
+
export class TextPrimitive extends PrimitiveShape {
|
|
22198
|
+
/**
|
|
22199
|
+
* @remarks
|
|
22200
|
+
* If set to true, the text primitive will render the back-face
|
|
22201
|
+
* of the background. Defaults to true but will always be false
|
|
22202
|
+
* if 'useRotation' is set to false.
|
|
22203
|
+
*
|
|
22204
|
+
*/
|
|
22205
|
+
backfaceVisible: boolean;
|
|
22206
|
+
/**
|
|
22207
|
+
* @remarks
|
|
22208
|
+
* The color of the background plate of the text. If set to
|
|
22209
|
+
* undefined, it will use the default color.
|
|
22210
|
+
*
|
|
22211
|
+
*/
|
|
22212
|
+
backgroundColorOverride?: RGBA;
|
|
22213
|
+
/**
|
|
22214
|
+
* @remarks
|
|
22215
|
+
* If set to true, the text will be hidden behind blocks or
|
|
22216
|
+
* entities. By default this is set to false (will always
|
|
22217
|
+
* render).
|
|
22218
|
+
*
|
|
22219
|
+
*/
|
|
22220
|
+
depthTest: boolean;
|
|
22221
|
+
/**
|
|
22222
|
+
* @remarks
|
|
22223
|
+
* Get the text of the debug text shape. Returns the RawText of
|
|
22224
|
+
* the debug text if `setText` was called with a RawMessage or
|
|
22225
|
+
* a RawText object, otherwise returns a string.
|
|
22226
|
+
*
|
|
22227
|
+
*/
|
|
22228
|
+
readonly text: RawMessage | string;
|
|
22229
|
+
/**
|
|
22230
|
+
* @remarks
|
|
22231
|
+
* If set to true, the text primitive will render the back-face
|
|
22232
|
+
* of the text. Defaults to true but will always be false if
|
|
22233
|
+
* 'useRotation' is set to false.
|
|
22234
|
+
*
|
|
22235
|
+
*/
|
|
22236
|
+
textBackfaceVisible: boolean;
|
|
22237
|
+
/**
|
|
22238
|
+
* @remarks
|
|
22239
|
+
* If set to true, the text will not face the camera and
|
|
22240
|
+
* instead will use the rotation from the shape.
|
|
22241
|
+
*
|
|
22242
|
+
*/
|
|
22243
|
+
useRotation: boolean;
|
|
22244
|
+
constructor(location: DimensionLocation | Vector3, text: RawMessage | string);
|
|
22245
|
+
/**
|
|
22246
|
+
* @remarks
|
|
22247
|
+
* Sets the text to display.
|
|
22248
|
+
*
|
|
22249
|
+
* @throws This function can throw errors.
|
|
22250
|
+
*
|
|
22251
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
22252
|
+
*
|
|
22253
|
+
* {@link RawMessageError}
|
|
22254
|
+
*/
|
|
22255
|
+
setText(text: RawMessage | string): void;
|
|
22256
|
+
}
|
|
22257
|
+
|
|
20125
22258
|
/**
|
|
20126
22259
|
* This manager is used to add, remove or query temporary
|
|
20127
22260
|
* ticking areas to a dimension. These ticking areas are
|
|
@@ -20363,6 +22496,151 @@ export class TripWireTripAfterEventSignal {
|
|
|
20363
22496
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
20364
22497
|
}
|
|
20365
22498
|
|
|
22499
|
+
/**
|
|
22500
|
+
* @beta
|
|
22501
|
+
* Contains information related to a script watchdog
|
|
22502
|
+
* termination.
|
|
22503
|
+
*/
|
|
22504
|
+
export class WatchdogTerminateBeforeEvent {
|
|
22505
|
+
private constructor();
|
|
22506
|
+
/**
|
|
22507
|
+
* @remarks
|
|
22508
|
+
* If set to true, cancels the termination of the script
|
|
22509
|
+
* runtime. Note that depending on server configuration
|
|
22510
|
+
* settings, cancellation of the termination may not be
|
|
22511
|
+
* allowed.
|
|
22512
|
+
*
|
|
22513
|
+
*/
|
|
22514
|
+
cancel: boolean;
|
|
22515
|
+
/**
|
|
22516
|
+
* @remarks
|
|
22517
|
+
* Contains the reason why a script runtime is to be
|
|
22518
|
+
* terminated.
|
|
22519
|
+
*
|
|
22520
|
+
*/
|
|
22521
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
22522
|
+
}
|
|
22523
|
+
|
|
22524
|
+
/**
|
|
22525
|
+
* @beta
|
|
22526
|
+
* Manages callbacks that are connected to a callback that will
|
|
22527
|
+
* be called when a script runtime is being terminated due to a
|
|
22528
|
+
* violation of the performance watchdog system.
|
|
22529
|
+
*/
|
|
22530
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
22531
|
+
private constructor();
|
|
22532
|
+
/**
|
|
22533
|
+
* @remarks
|
|
22534
|
+
* Adds a callback that will be called when a script runtime is
|
|
22535
|
+
* being terminated due to a violation of the performance
|
|
22536
|
+
* watchdog system.
|
|
22537
|
+
*
|
|
22538
|
+
* This function can't be called in restricted-execution mode.
|
|
22539
|
+
*
|
|
22540
|
+
* This function can be called in early-execution mode.
|
|
22541
|
+
*
|
|
22542
|
+
* @param callback
|
|
22543
|
+
* This closure is called with restricted-execution privilege.
|
|
22544
|
+
* @returns
|
|
22545
|
+
* Closure that is called with restricted-execution privilege.
|
|
22546
|
+
*/
|
|
22547
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
22548
|
+
/**
|
|
22549
|
+
* @remarks
|
|
22550
|
+
* Removes a callback from being called when a script runtime
|
|
22551
|
+
* is being terminated due to a violation of the performance
|
|
22552
|
+
* watchdog system.
|
|
22553
|
+
*
|
|
22554
|
+
* This function can't be called in restricted-execution mode.
|
|
22555
|
+
*
|
|
22556
|
+
* This function can be called in early-execution mode.
|
|
22557
|
+
*
|
|
22558
|
+
* @param callback
|
|
22559
|
+
* This closure is called with restricted-execution privilege.
|
|
22560
|
+
*/
|
|
22561
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
22562
|
+
}
|
|
22563
|
+
|
|
22564
|
+
/**
|
|
22565
|
+
* @beta
|
|
22566
|
+
* Base class for waypoints displayed on the player's locator
|
|
22567
|
+
* bar. Waypoints can track locations or entities and are
|
|
22568
|
+
* rendered with customizable textures and colors.
|
|
22569
|
+
*
|
|
22570
|
+
* Waypoints act as shared handles that can be added to
|
|
22571
|
+
* multiple players' locator bars. When you modify a waypoint's
|
|
22572
|
+
* properties (such as color, texture, or enabled state), the
|
|
22573
|
+
* changes are reflected for all players who have that waypoint
|
|
22574
|
+
* in their locator bar. This allows you to efficiently manage
|
|
22575
|
+
* waypoints across multiple players without creating separate
|
|
22576
|
+
* instances for each player.
|
|
22577
|
+
*/
|
|
22578
|
+
export class Waypoint {
|
|
22579
|
+
private constructor();
|
|
22580
|
+
/**
|
|
22581
|
+
* @remarks
|
|
22582
|
+
* Optional {@link RGB} color tint applied to the waypoint
|
|
22583
|
+
* icon. If not specified, the waypoint uses its default color.
|
|
22584
|
+
*
|
|
22585
|
+
* This property can't be edited in restricted-execution mode.
|
|
22586
|
+
*
|
|
22587
|
+
*/
|
|
22588
|
+
color?: RGB;
|
|
22589
|
+
/**
|
|
22590
|
+
* @remarks
|
|
22591
|
+
* Controls whether the waypoint is currently displayed on the
|
|
22592
|
+
* player's screen. When disabled, the waypoint is hidden but
|
|
22593
|
+
* remains valid.
|
|
22594
|
+
*
|
|
22595
|
+
* This property can't be edited in restricted-execution mode.
|
|
22596
|
+
*
|
|
22597
|
+
*/
|
|
22598
|
+
isEnabled: boolean;
|
|
22599
|
+
/**
|
|
22600
|
+
* @remarks
|
|
22601
|
+
* Returns whether the waypoint is currently valid. A waypoint
|
|
22602
|
+
* becomes invalid when its tracked entity is no longer valid.
|
|
22603
|
+
*
|
|
22604
|
+
*/
|
|
22605
|
+
readonly isValid: boolean;
|
|
22606
|
+
/**
|
|
22607
|
+
* @remarks
|
|
22608
|
+
* The {@link WaypointTextureSelector} that determines which
|
|
22609
|
+
* icon texture is displayed for the waypoint based on distance
|
|
22610
|
+
* or other criteria.
|
|
22611
|
+
*
|
|
22612
|
+
* This property can't be edited in restricted-execution mode.
|
|
22613
|
+
*
|
|
22614
|
+
*/
|
|
22615
|
+
textureSelector: WaypointTextureSelector;
|
|
22616
|
+
/**
|
|
22617
|
+
* @remarks
|
|
22618
|
+
* Gets the current {@link DimensionLocation} of the waypoint.
|
|
22619
|
+
* For entity waypoints, this returns the entity's current
|
|
22620
|
+
* position. For location waypoints, this returns the stored
|
|
22621
|
+
* location.
|
|
22622
|
+
*
|
|
22623
|
+
* This function can't be called in restricted-execution mode.
|
|
22624
|
+
*
|
|
22625
|
+
* @throws This function can throw errors.
|
|
22626
|
+
*
|
|
22627
|
+
* {@link InvalidWaypointError}
|
|
22628
|
+
*
|
|
22629
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
22630
|
+
*/
|
|
22631
|
+
getDimensionLocation(): DimensionLocation;
|
|
22632
|
+
/**
|
|
22633
|
+
* @remarks
|
|
22634
|
+
* Removes the waypoint from all locator bars it has been added
|
|
22635
|
+
* to. This affects all players who have this waypoint in their
|
|
22636
|
+
* locator bar.
|
|
22637
|
+
*
|
|
22638
|
+
* This function can't be called in restricted-execution mode.
|
|
22639
|
+
*
|
|
22640
|
+
*/
|
|
22641
|
+
remove(): void;
|
|
22642
|
+
}
|
|
22643
|
+
|
|
20366
22644
|
/**
|
|
20367
22645
|
* Contains information related to changes in weather in the
|
|
20368
22646
|
* environment.
|
|
@@ -20499,6 +22777,15 @@ export class World {
|
|
|
20499
22777
|
*
|
|
20500
22778
|
*/
|
|
20501
22779
|
readonly afterEvents: WorldAfterEvents;
|
|
22780
|
+
/**
|
|
22781
|
+
* @beta
|
|
22782
|
+
* @remarks
|
|
22783
|
+
* Enables or disables cheats.
|
|
22784
|
+
*
|
|
22785
|
+
* This property can't be edited in restricted-execution mode.
|
|
22786
|
+
*
|
|
22787
|
+
*/
|
|
22788
|
+
allowCheats: boolean;
|
|
20502
22789
|
/**
|
|
20503
22790
|
* @remarks
|
|
20504
22791
|
* Contains a set of events that are applicable to the entirety
|
|
@@ -20543,6 +22830,14 @@ export class World {
|
|
|
20543
22830
|
*/
|
|
20544
22831
|
readonly gameRules: GameRules;
|
|
20545
22832
|
readonly isHardcore: boolean;
|
|
22833
|
+
/**
|
|
22834
|
+
* @beta
|
|
22835
|
+
* @remarks
|
|
22836
|
+
* Manager for adding and removing primitive text objects in
|
|
22837
|
+
* the world.
|
|
22838
|
+
*
|
|
22839
|
+
*/
|
|
22840
|
+
readonly primitiveShapesManager: PrimitiveShapesManager;
|
|
20546
22841
|
/**
|
|
20547
22842
|
* @remarks
|
|
20548
22843
|
* Returns the general global scoreboard that applies to the
|
|
@@ -20568,7 +22863,21 @@ export class World {
|
|
|
20568
22863
|
* ticking areas.
|
|
20569
22864
|
*
|
|
20570
22865
|
*/
|
|
20571
|
-
readonly tickingAreaManager: TickingAreaManager;
|
|
22866
|
+
readonly tickingAreaManager: TickingAreaManager;
|
|
22867
|
+
/**
|
|
22868
|
+
* @beta
|
|
22869
|
+
* @remarks
|
|
22870
|
+
* A method that is internal-only, used for broadcasting
|
|
22871
|
+
* specific messages between client and server.
|
|
22872
|
+
*
|
|
22873
|
+
* This function can't be called in restricted-execution mode.
|
|
22874
|
+
*
|
|
22875
|
+
* @param id
|
|
22876
|
+
* The message identifier.
|
|
22877
|
+
* @param value
|
|
22878
|
+
* The message.
|
|
22879
|
+
*/
|
|
22880
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
20572
22881
|
/**
|
|
20573
22882
|
* @remarks
|
|
20574
22883
|
* Clears the set of dynamic properties declared for this
|
|
@@ -20762,6 +23071,15 @@ export class World {
|
|
|
20762
23071
|
*
|
|
20763
23072
|
*/
|
|
20764
23073
|
getMoonPhase(): MoonPhase;
|
|
23074
|
+
/**
|
|
23075
|
+
* @beta
|
|
23076
|
+
* @remarks
|
|
23077
|
+
* Returns a map of pack setting name and value pairs.
|
|
23078
|
+
*
|
|
23079
|
+
* This function can be called in early-execution mode.
|
|
23080
|
+
*
|
|
23081
|
+
*/
|
|
23082
|
+
getPackSettings(): Record<string, boolean | number | string>;
|
|
20765
23083
|
/**
|
|
20766
23084
|
* @remarks
|
|
20767
23085
|
* Returns a set of players based on a set of conditions
|
|
@@ -21052,6 +23370,16 @@ export class WorldAfterEvents {
|
|
|
21052
23370
|
*
|
|
21053
23371
|
*/
|
|
21054
23372
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
23373
|
+
/**
|
|
23374
|
+
* @beta
|
|
23375
|
+
* @remarks
|
|
23376
|
+
* This event is triggered after a chat message has been
|
|
23377
|
+
* broadcast or sent to players.
|
|
23378
|
+
*
|
|
23379
|
+
* This property can be read in early-execution mode.
|
|
23380
|
+
*
|
|
23381
|
+
*/
|
|
23382
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
21055
23383
|
/**
|
|
21056
23384
|
* @remarks
|
|
21057
23385
|
* This event is fired when an entity event has been triggered
|
|
@@ -21178,6 +23506,13 @@ export class WorldAfterEvents {
|
|
|
21178
23506
|
*
|
|
21179
23507
|
*/
|
|
21180
23508
|
readonly entitySpawn: EntitySpawnAfterEventSignal;
|
|
23509
|
+
/**
|
|
23510
|
+
* @beta
|
|
23511
|
+
* @remarks
|
|
23512
|
+
* This property can be read in early-execution mode.
|
|
23513
|
+
*
|
|
23514
|
+
*/
|
|
23515
|
+
readonly entityUpgrade: EntityUpgradeAfterEventSignal;
|
|
21181
23516
|
/**
|
|
21182
23517
|
* @remarks
|
|
21183
23518
|
* This event is fired after an explosion occurs.
|
|
@@ -21267,6 +23602,25 @@ export class WorldAfterEvents {
|
|
|
21267
23602
|
*
|
|
21268
23603
|
*/
|
|
21269
23604
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
23605
|
+
/**
|
|
23606
|
+
* @beta
|
|
23607
|
+
* @remarks
|
|
23608
|
+
* This event is an internal implementation detail, and is
|
|
23609
|
+
* otherwise not currently functional.
|
|
23610
|
+
*
|
|
23611
|
+
* This property can be read in early-execution mode.
|
|
23612
|
+
*
|
|
23613
|
+
*/
|
|
23614
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
23615
|
+
/**
|
|
23616
|
+
* @beta
|
|
23617
|
+
* @remarks
|
|
23618
|
+
* This event is triggered when a pack setting is changed.
|
|
23619
|
+
*
|
|
23620
|
+
* This property can be read in early-execution mode.
|
|
23621
|
+
*
|
|
23622
|
+
*/
|
|
23623
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
21270
23624
|
/**
|
|
21271
23625
|
* @remarks
|
|
21272
23626
|
* This event fires when a piston expands or retracts.
|
|
@@ -21403,6 +23757,16 @@ export class WorldAfterEvents {
|
|
|
21403
23757
|
*
|
|
21404
23758
|
*/
|
|
21405
23759
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
23760
|
+
/**
|
|
23761
|
+
* @beta
|
|
23762
|
+
* @remarks
|
|
23763
|
+
* An event for when a player uses a named name tag on an
|
|
23764
|
+
* entity.
|
|
23765
|
+
*
|
|
23766
|
+
* This property can be read in early-execution mode.
|
|
23767
|
+
*
|
|
23768
|
+
*/
|
|
23769
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
21406
23770
|
/**
|
|
21407
23771
|
* @remarks
|
|
21408
23772
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -21479,6 +23843,43 @@ export class WorldAfterEvents {
|
|
|
21479
23843
|
*/
|
|
21480
23844
|
export class WorldBeforeEvents {
|
|
21481
23845
|
private constructor();
|
|
23846
|
+
/**
|
|
23847
|
+
* @beta
|
|
23848
|
+
* @remarks
|
|
23849
|
+
* This event is triggered after a chat message has been
|
|
23850
|
+
* broadcast or sent to players.
|
|
23851
|
+
*
|
|
23852
|
+
* This property can be read in early-execution mode.
|
|
23853
|
+
*
|
|
23854
|
+
* @example customCommand.ts
|
|
23855
|
+
* ```typescript
|
|
23856
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
23857
|
+
*
|
|
23858
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
23859
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
23860
|
+
* if (eventData.message.includes('cancel')) {
|
|
23861
|
+
* // Cancel event if the message contains "cancel"
|
|
23862
|
+
* eventData.cancel = true;
|
|
23863
|
+
* } else {
|
|
23864
|
+
* const args = eventData.message.split(' ');
|
|
23865
|
+
*
|
|
23866
|
+
* if (args.length > 0) {
|
|
23867
|
+
* switch (args[0].toLowerCase()) {
|
|
23868
|
+
* case 'echo':
|
|
23869
|
+
* // Send a modified version of chat message
|
|
23870
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
23871
|
+
* break;
|
|
23872
|
+
* case 'help':
|
|
23873
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
23874
|
+
* break;
|
|
23875
|
+
* }
|
|
23876
|
+
* }
|
|
23877
|
+
* }
|
|
23878
|
+
* });
|
|
23879
|
+
* }
|
|
23880
|
+
* ```
|
|
23881
|
+
*/
|
|
23882
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
21482
23883
|
/**
|
|
21483
23884
|
* @remarks
|
|
21484
23885
|
* This event is triggered after an event has been added to an
|
|
@@ -21572,6 +23973,15 @@ export class WorldBeforeEvents {
|
|
|
21572
23973
|
*
|
|
21573
23974
|
*/
|
|
21574
23975
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
23976
|
+
/**
|
|
23977
|
+
* @beta
|
|
23978
|
+
* @remarks
|
|
23979
|
+
* This event fires before a block is placed by a player.
|
|
23980
|
+
*
|
|
23981
|
+
* This property can be read in early-execution mode.
|
|
23982
|
+
*
|
|
23983
|
+
*/
|
|
23984
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
21575
23985
|
/**
|
|
21576
23986
|
* @remarks
|
|
21577
23987
|
* This property can be read in early-execution mode.
|
|
@@ -21649,13 +24059,27 @@ export interface BiomeFilter {
|
|
|
21649
24059
|
includeTags?: string[];
|
|
21650
24060
|
}
|
|
21651
24061
|
|
|
24062
|
+
/**
|
|
24063
|
+
* @beta
|
|
24064
|
+
* Contains additional options for searches for the
|
|
24065
|
+
* dimension.findNearestBiome API.
|
|
24066
|
+
*/
|
|
24067
|
+
export interface BiomeSearchOptions {
|
|
24068
|
+
/**
|
|
24069
|
+
* @remarks
|
|
24070
|
+
* Bounding volume size to look within.
|
|
24071
|
+
*
|
|
24072
|
+
*/
|
|
24073
|
+
boundingSize?: Vector3;
|
|
24074
|
+
}
|
|
24075
|
+
|
|
21652
24076
|
/**
|
|
21653
24077
|
* A BlockBoundingBox is an interface to an object which
|
|
21654
24078
|
* represents an AABB aligned rectangle.
|
|
21655
24079
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
21656
24080
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
21657
|
-
* created using the associated {@link
|
|
21658
|
-
*
|
|
24081
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
24082
|
+
* utility functions.
|
|
21659
24083
|
* The min/max coordinates represent the diametrically opposite
|
|
21660
24084
|
* corners of the rectangle.
|
|
21661
24085
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -21715,6 +24139,10 @@ export interface BlockCustomComponent {
|
|
|
21715
24139
|
*
|
|
21716
24140
|
*/
|
|
21717
24141
|
beforeOnPlayerPlace?: (arg0: BlockComponentPlayerPlaceBeforeEvent, arg1: CustomComponentParameters) => void;
|
|
24142
|
+
/**
|
|
24143
|
+
* @beta
|
|
24144
|
+
*/
|
|
24145
|
+
onBlockStateChange?: (arg0: BlockComponentBlockStateChangeEvent, arg1: CustomComponentParameters) => void;
|
|
21718
24146
|
/**
|
|
21719
24147
|
* @remarks
|
|
21720
24148
|
* This function will be called when a specific block is
|
|
@@ -22102,6 +24530,40 @@ export interface CameraTargetOptions {
|
|
|
22102
24530
|
targetEntity: Entity;
|
|
22103
24531
|
}
|
|
22104
24532
|
|
|
24533
|
+
/**
|
|
24534
|
+
* @beta
|
|
24535
|
+
* This interface defines an entry into the {@link
|
|
24536
|
+
* CompoundBlockVolume} which represents a volume of positive
|
|
24537
|
+
* or negative space.
|
|
24538
|
+
*
|
|
24539
|
+
*/
|
|
24540
|
+
export interface CompoundBlockVolumeItem {
|
|
24541
|
+
/**
|
|
24542
|
+
* @remarks
|
|
24543
|
+
* The 'action' defines how the block volume is represented in
|
|
24544
|
+
* the compound block volume stack.
|
|
24545
|
+
* 'Add' creates a block volume which is positively selected
|
|
24546
|
+
* 'Subtract' creates a block volume which represents a hole or
|
|
24547
|
+
* negative space in the overall compound block volume.
|
|
24548
|
+
*
|
|
24549
|
+
*/
|
|
24550
|
+
action?: CompoundBlockVolumeAction;
|
|
24551
|
+
/**
|
|
24552
|
+
* @remarks
|
|
24553
|
+
* The relativity enumeration determines whether the
|
|
24554
|
+
* BlockVolume specified is positioned relative to the parent
|
|
24555
|
+
* compound block volume origin, or in absolute world space.
|
|
24556
|
+
*
|
|
24557
|
+
*/
|
|
24558
|
+
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
24559
|
+
/**
|
|
24560
|
+
* @remarks
|
|
24561
|
+
* The volume of space
|
|
24562
|
+
*
|
|
24563
|
+
*/
|
|
24564
|
+
volume: BlockVolume;
|
|
24565
|
+
}
|
|
24566
|
+
|
|
22105
24567
|
/**
|
|
22106
24568
|
* @rc
|
|
22107
24569
|
* Represents the source of a container access.
|
|
@@ -22213,6 +24675,15 @@ export interface CustomCommand {
|
|
|
22213
24675
|
* command.
|
|
22214
24676
|
*/
|
|
22215
24677
|
export interface CustomCommandParameter {
|
|
24678
|
+
/**
|
|
24679
|
+
* @beta
|
|
24680
|
+
* @remarks
|
|
24681
|
+
* Can be used to reference the enum name when {@link
|
|
24682
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
24683
|
+
* to be different from the enum name.
|
|
24684
|
+
*
|
|
24685
|
+
*/
|
|
24686
|
+
enumName?: string;
|
|
22216
24687
|
/**
|
|
22217
24688
|
* @remarks
|
|
22218
24689
|
* The name of parameter as it appears on the command line.
|
|
@@ -22246,6 +24717,35 @@ export interface CustomCommandResult {
|
|
|
22246
24717
|
status: CustomCommandStatus;
|
|
22247
24718
|
}
|
|
22248
24719
|
|
|
24720
|
+
/**
|
|
24721
|
+
* @beta
|
|
24722
|
+
*/
|
|
24723
|
+
export interface CustomTexture {
|
|
24724
|
+
/**
|
|
24725
|
+
* @remarks
|
|
24726
|
+
* The height of the icon, in relative units. Value must be
|
|
24727
|
+
* between 0.0 and 1.0, inclusive.
|
|
24728
|
+
*
|
|
24729
|
+
* Bounds: [0, 1]
|
|
24730
|
+
*/
|
|
24731
|
+
iconHeight: number;
|
|
24732
|
+
/**
|
|
24733
|
+
* @remarks
|
|
24734
|
+
* The width of the icon, in relative units. Value must be
|
|
24735
|
+
* between 0.0 and 1.0, inclusive.
|
|
24736
|
+
*
|
|
24737
|
+
* Bounds: [0, 1]
|
|
24738
|
+
*/
|
|
24739
|
+
iconWidth: number;
|
|
24740
|
+
/**
|
|
24741
|
+
* @remarks
|
|
24742
|
+
* The resource path to the custom texture. This should be a
|
|
24743
|
+
* valid string path to a texture asset.
|
|
24744
|
+
*
|
|
24745
|
+
*/
|
|
24746
|
+
path: string;
|
|
24747
|
+
}
|
|
24748
|
+
|
|
22249
24749
|
/**
|
|
22250
24750
|
* Contains a set of updates to the component definition state
|
|
22251
24751
|
* of an entity.
|
|
@@ -22265,6 +24765,14 @@ export interface DefinitionModifier {
|
|
|
22265
24765
|
*
|
|
22266
24766
|
*/
|
|
22267
24767
|
removedComponentGroups: string[];
|
|
24768
|
+
/**
|
|
24769
|
+
* @beta
|
|
24770
|
+
* @remarks
|
|
24771
|
+
* The list of entity definition events that will be fired via
|
|
24772
|
+
* this update.
|
|
24773
|
+
*
|
|
24774
|
+
*/
|
|
24775
|
+
triggers: Trigger[];
|
|
22268
24776
|
}
|
|
22269
24777
|
|
|
22270
24778
|
/**
|
|
@@ -23066,6 +25574,37 @@ export interface EntityRaycastOptions extends EntityFilter {
|
|
|
23066
25574
|
maxDistance?: number;
|
|
23067
25575
|
}
|
|
23068
25576
|
|
|
25577
|
+
/**
|
|
25578
|
+
* @beta
|
|
25579
|
+
* Controls when a waypoint is visible based on the state of
|
|
25580
|
+
* the entity it tracks. These rules allow filtering waypoint
|
|
25581
|
+
* visibility by entity conditions like sneaking, invisibility,
|
|
25582
|
+
* and death state.
|
|
25583
|
+
*/
|
|
25584
|
+
export interface EntityVisibilityRules {
|
|
25585
|
+
/**
|
|
25586
|
+
* @remarks
|
|
25587
|
+
* Controls whether the waypoint is shown when the tracked
|
|
25588
|
+
* entity is dead. If undefined, defaults to true.
|
|
25589
|
+
*
|
|
25590
|
+
*/
|
|
25591
|
+
showDead?: boolean;
|
|
25592
|
+
/**
|
|
25593
|
+
* @remarks
|
|
25594
|
+
* Controls whether the waypoint is shown when the tracked
|
|
25595
|
+
* entity is invisible. If undefined, defaults to true.
|
|
25596
|
+
*
|
|
25597
|
+
*/
|
|
25598
|
+
showInvisible?: boolean;
|
|
25599
|
+
/**
|
|
25600
|
+
* @remarks
|
|
25601
|
+
* Controls whether the waypoint is shown when the tracked
|
|
25602
|
+
* entity is sneaking. If undefined, defaults to true.
|
|
25603
|
+
*
|
|
25604
|
+
*/
|
|
25605
|
+
showSneaking?: boolean;
|
|
25606
|
+
}
|
|
25607
|
+
|
|
23069
25608
|
/**
|
|
23070
25609
|
* Equal to operator.
|
|
23071
25610
|
*/
|
|
@@ -23472,6 +26011,27 @@ export interface NotEqualsComparison {
|
|
|
23472
26011
|
notEquals: boolean | number | string;
|
|
23473
26012
|
}
|
|
23474
26013
|
|
|
26014
|
+
/**
|
|
26015
|
+
* @beta
|
|
26016
|
+
* Contains information about a player's party membership. This
|
|
26017
|
+
* object is a snapshot of the player's party state at the time
|
|
26018
|
+
* it was retrieved and is not kept up to date.
|
|
26019
|
+
*/
|
|
26020
|
+
export interface PartyInfo {
|
|
26021
|
+
/**
|
|
26022
|
+
* @remarks
|
|
26023
|
+
* Whether this player is the leader of their party.
|
|
26024
|
+
*
|
|
26025
|
+
*/
|
|
26026
|
+
isLeader: boolean;
|
|
26027
|
+
/**
|
|
26028
|
+
* @remarks
|
|
26029
|
+
* The unique identifier of the party this player belongs to.
|
|
26030
|
+
*
|
|
26031
|
+
*/
|
|
26032
|
+
partyId: string;
|
|
26033
|
+
}
|
|
26034
|
+
|
|
23475
26035
|
/**
|
|
23476
26036
|
* Contains additional options for how an animation is played.
|
|
23477
26037
|
*/
|
|
@@ -23591,6 +26151,39 @@ export interface PlayerSwingEventOptions {
|
|
|
23591
26151
|
swingSource?: EntitySwingSource;
|
|
23592
26152
|
}
|
|
23593
26153
|
|
|
26154
|
+
/**
|
|
26155
|
+
* @beta
|
|
26156
|
+
* Controls when a waypoint is visible based on player-specific
|
|
26157
|
+
* states. Extends {@link EntityVisibilityRules} with
|
|
26158
|
+
* additional rules for player-only states like hidden mode and
|
|
26159
|
+
* spectator mode.
|
|
26160
|
+
*/
|
|
26161
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
26162
|
+
export interface PlayerVisibilityRules extends EntityVisibilityRules {
|
|
26163
|
+
/**
|
|
26164
|
+
* @remarks
|
|
26165
|
+
* Controls whether the waypoint is shown when the tracked
|
|
26166
|
+
* player is hidden. If undefined, defaults to true.
|
|
26167
|
+
*
|
|
26168
|
+
*/
|
|
26169
|
+
showHidden?: boolean;
|
|
26170
|
+
/**
|
|
26171
|
+
* @remarks
|
|
26172
|
+
* Controls whether the waypoint is shown when the tracked
|
|
26173
|
+
* player is in spectator mode. If undefined, defaults to true.
|
|
26174
|
+
*
|
|
26175
|
+
*/
|
|
26176
|
+
showSpectator?: boolean;
|
|
26177
|
+
/**
|
|
26178
|
+
* @remarks
|
|
26179
|
+
* Controls whether the waypoint is shown when a spectator is
|
|
26180
|
+
* viewing another spectator player. If undefined, defaults to
|
|
26181
|
+
* true.
|
|
26182
|
+
*
|
|
26183
|
+
*/
|
|
26184
|
+
showSpectatorToSpectator?: boolean;
|
|
26185
|
+
}
|
|
26186
|
+
|
|
23594
26187
|
/**
|
|
23595
26188
|
* Key frame that holds the progress of the camera animation.
|
|
23596
26189
|
*/
|
|
@@ -24287,6 +26880,60 @@ export interface VectorXZ {
|
|
|
24287
26880
|
z: number;
|
|
24288
26881
|
}
|
|
24289
26882
|
|
|
26883
|
+
/**
|
|
26884
|
+
* @beta
|
|
26885
|
+
* Defines a texture and the distance range in which it should
|
|
26886
|
+
* be displayed. Used within a {@link WaypointTextureSelector}
|
|
26887
|
+
* to create distance-based texture switching.
|
|
26888
|
+
*/
|
|
26889
|
+
export interface WaypointTextureBounds {
|
|
26890
|
+
/**
|
|
26891
|
+
* @remarks
|
|
26892
|
+
* The lower distance bound for this texture. The texture is
|
|
26893
|
+
* displayed when the distance to the waypoint is greater than
|
|
26894
|
+
* this value. Value must be greater than or equal to 0.
|
|
26895
|
+
*
|
|
26896
|
+
* Minimum Value: 0
|
|
26897
|
+
*/
|
|
26898
|
+
lowerBound: number;
|
|
26899
|
+
/**
|
|
26900
|
+
* @remarks
|
|
26901
|
+
* The {@link WaypointTexture} or {@link CustomTexture} to
|
|
26902
|
+
* display within this distance range.
|
|
26903
|
+
*
|
|
26904
|
+
*/
|
|
26905
|
+
texture: CustomTexture | WaypointTexture;
|
|
26906
|
+
/**
|
|
26907
|
+
* @remarks
|
|
26908
|
+
* The upper distance bound for this texture. The texture is
|
|
26909
|
+
* displayed when the distance to the waypoint is less than or
|
|
26910
|
+
* equal to this value. If undefined, there is no upper limit.
|
|
26911
|
+
* Value must be greater than or equal to 0.
|
|
26912
|
+
*
|
|
26913
|
+
* Minimum Value: 0
|
|
26914
|
+
*/
|
|
26915
|
+
upperBound?: number;
|
|
26916
|
+
}
|
|
26917
|
+
|
|
26918
|
+
/**
|
|
26919
|
+
* @beta
|
|
26920
|
+
* Defines how waypoint textures change based on distance.
|
|
26921
|
+
* Contains a list of texture bounds that determine which
|
|
26922
|
+
* texture is displayed at different distance ranges.
|
|
26923
|
+
*/
|
|
26924
|
+
export interface WaypointTextureSelector {
|
|
26925
|
+
/**
|
|
26926
|
+
* @remarks
|
|
26927
|
+
* An array of {@link WaypointTextureBounds} that define which
|
|
26928
|
+
* textures are displayed at different distance ranges. The
|
|
26929
|
+
* system evaluates these bounds to determine the appropriate
|
|
26930
|
+
* texture based on the current distance to the waypoint. The
|
|
26931
|
+
* list has a maximum size limit of 16.
|
|
26932
|
+
*
|
|
26933
|
+
*/
|
|
26934
|
+
textureBoundsList: WaypointTextureBounds[];
|
|
26935
|
+
}
|
|
26936
|
+
|
|
24290
26937
|
/**
|
|
24291
26938
|
* Contains additional options for a playSound occurrence.
|
|
24292
26939
|
*/
|
|
@@ -24422,6 +27069,48 @@ export class CustomComponentNameError extends Error {
|
|
|
24422
27069
|
readonly reason: CustomComponentNameErrorReason;
|
|
24423
27070
|
}
|
|
24424
27071
|
|
|
27072
|
+
/**
|
|
27073
|
+
* @beta
|
|
27074
|
+
* Thrown when trying to register a custom dimension with a
|
|
27075
|
+
* name that has already been registered.
|
|
27076
|
+
*/
|
|
27077
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27078
|
+
export class CustomDimensionAlreadyRegisteredError extends Error {
|
|
27079
|
+
private constructor();
|
|
27080
|
+
}
|
|
27081
|
+
|
|
27082
|
+
/**
|
|
27083
|
+
* @beta
|
|
27084
|
+
* Thrown when trying to register a custom dimension outside of
|
|
27085
|
+
* the system startup event.
|
|
27086
|
+
*/
|
|
27087
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27088
|
+
export class CustomDimensionInvalidRegistryError extends Error {
|
|
27089
|
+
private constructor();
|
|
27090
|
+
}
|
|
27091
|
+
|
|
27092
|
+
/**
|
|
27093
|
+
* @beta
|
|
27094
|
+
* Thrown when trying to register a custom dimension with a
|
|
27095
|
+
* name that contains invalid characters.
|
|
27096
|
+
*/
|
|
27097
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27098
|
+
export class CustomDimensionNameError extends Error {
|
|
27099
|
+
private constructor();
|
|
27100
|
+
}
|
|
27101
|
+
|
|
27102
|
+
/**
|
|
27103
|
+
* @beta
|
|
27104
|
+
* Thrown after using the /reload command when trying to
|
|
27105
|
+
* register a custom dimension that was not previously
|
|
27106
|
+
* registered. New custom dimensions cannot be added during a
|
|
27107
|
+
* reload.
|
|
27108
|
+
*/
|
|
27109
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27110
|
+
export class CustomDimensionReloadNewDimensionError extends Error {
|
|
27111
|
+
private constructor();
|
|
27112
|
+
}
|
|
27113
|
+
|
|
24425
27114
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
24426
27115
|
export class EnchantmentLevelOutOfBoundsError extends Error {
|
|
24427
27116
|
private constructor();
|
|
@@ -24546,6 +27235,25 @@ export class InvalidStructureError extends Error {
|
|
|
24546
27235
|
private constructor();
|
|
24547
27236
|
}
|
|
24548
27237
|
|
|
27238
|
+
/**
|
|
27239
|
+
* @beta
|
|
27240
|
+
* Error thrown when attempting to perform operations on an
|
|
27241
|
+
* invalid waypoint. A waypoint becomes invalid when it is
|
|
27242
|
+
* removed or when the entity it tracks is no longer valid.
|
|
27243
|
+
*/
|
|
27244
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27245
|
+
export class InvalidWaypointError extends Error {
|
|
27246
|
+
private constructor();
|
|
27247
|
+
}
|
|
27248
|
+
|
|
27249
|
+
/**
|
|
27250
|
+
* @beta
|
|
27251
|
+
*/
|
|
27252
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27253
|
+
export class InvalidWaypointTextureSelectorError extends Error {
|
|
27254
|
+
private constructor();
|
|
27255
|
+
}
|
|
27256
|
+
|
|
24549
27257
|
/**
|
|
24550
27258
|
* Thrown when trying to register an item custom component with
|
|
24551
27259
|
* a name that has already been registered.
|
|
@@ -24602,6 +27310,25 @@ export class LocationOutOfWorldBoundariesError extends Error {
|
|
|
24602
27310
|
private constructor();
|
|
24603
27311
|
}
|
|
24604
27312
|
|
|
27313
|
+
/**
|
|
27314
|
+
* @beta
|
|
27315
|
+
* Error thrown when a locator bar operation fails. Contains a
|
|
27316
|
+
* reason code indicating the specific cause of the error.
|
|
27317
|
+
*/
|
|
27318
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27319
|
+
export class LocatorBarError extends Error {
|
|
27320
|
+
private constructor();
|
|
27321
|
+
/**
|
|
27322
|
+
* @remarks
|
|
27323
|
+
* The {@link LocatorBarErrorReason} code that indicates why
|
|
27324
|
+
* the locator bar operation failed.
|
|
27325
|
+
*
|
|
27326
|
+
* This property can be read in early-execution mode.
|
|
27327
|
+
*
|
|
27328
|
+
*/
|
|
27329
|
+
readonly reason: LocatorBarErrorReason;
|
|
27330
|
+
}
|
|
27331
|
+
|
|
24605
27332
|
/**
|
|
24606
27333
|
* Thrown when a name requires a namespace and an error occurs
|
|
24607
27334
|
* when validating that namespace
|
|
@@ -24622,6 +27349,14 @@ export class PlaceJigsawError extends Error {
|
|
|
24622
27349
|
private constructor();
|
|
24623
27350
|
}
|
|
24624
27351
|
|
|
27352
|
+
/**
|
|
27353
|
+
* @beta
|
|
27354
|
+
*/
|
|
27355
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27356
|
+
export class PrimitiveShapeError extends Error {
|
|
27357
|
+
private constructor();
|
|
27358
|
+
}
|
|
27359
|
+
|
|
24625
27360
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
24626
27361
|
export class RawMessageError extends Error {
|
|
24627
27362
|
private constructor();
|