@minecraft/server 2.7.0-rc.1.26.20-preview.22 → 2.8.0-beta.1.26.20-preview.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2837 -68
- 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.8.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
|
/**
|
|
@@ -780,6 +836,13 @@ export enum EntityComponentTypes {
|
|
|
780
836
|
*/
|
|
781
837
|
Color2 = 'minecraft:color2',
|
|
782
838
|
CursorInventory = 'minecraft:cursor_inventory',
|
|
839
|
+
/**
|
|
840
|
+
* @beta
|
|
841
|
+
* @remarks
|
|
842
|
+
* Represents this entity's ender inventory properties.
|
|
843
|
+
*
|
|
844
|
+
*/
|
|
845
|
+
EnderInventory = 'minecraft:ender_inventory',
|
|
783
846
|
/**
|
|
784
847
|
* @remarks
|
|
785
848
|
* Provides access to a mob's equipment slots. This component
|
|
@@ -1061,6 +1124,14 @@ export enum EntityComponentTypes {
|
|
|
1061
1124
|
*
|
|
1062
1125
|
*/
|
|
1063
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',
|
|
1064
1135
|
/**
|
|
1065
1136
|
* @remarks
|
|
1066
1137
|
* When present on an entity, this entity is on fire.
|
|
@@ -1538,6 +1609,14 @@ export enum EntitySwingSource {
|
|
|
1538
1609
|
* and mainhand slots.
|
|
1539
1610
|
*/
|
|
1540
1611
|
export enum EquipmentSlot {
|
|
1612
|
+
/**
|
|
1613
|
+
* @beta
|
|
1614
|
+
* @remarks
|
|
1615
|
+
* The body slot. This slot is used to hold armor for
|
|
1616
|
+
* non-humanoid mobs.
|
|
1617
|
+
*
|
|
1618
|
+
*/
|
|
1619
|
+
Body = 'Body',
|
|
1541
1620
|
/**
|
|
1542
1621
|
* @remarks
|
|
1543
1622
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1780,6 +1859,10 @@ export enum GameRule {
|
|
|
1780
1859
|
*
|
|
1781
1860
|
*/
|
|
1782
1861
|
KeepInventory = 'keepInventory',
|
|
1862
|
+
/**
|
|
1863
|
+
* @beta
|
|
1864
|
+
*/
|
|
1865
|
+
LocatorBar = 'locatorBar',
|
|
1783
1866
|
/**
|
|
1784
1867
|
* @remarks
|
|
1785
1868
|
* The maximum number of chained commands that can execute per
|
|
@@ -2251,6 +2334,34 @@ export enum LiquidType {
|
|
|
2251
2334
|
Water = 'Water',
|
|
2252
2335
|
}
|
|
2253
2336
|
|
|
2337
|
+
/**
|
|
2338
|
+
* @beta
|
|
2339
|
+
* Enum representing the different reasons why a locator bar
|
|
2340
|
+
* operation may fail.
|
|
2341
|
+
*/
|
|
2342
|
+
export enum LocatorBarErrorReason {
|
|
2343
|
+
/**
|
|
2344
|
+
* @remarks
|
|
2345
|
+
* The waypoint already exists in the locator bar and cannot be
|
|
2346
|
+
* added again.
|
|
2347
|
+
*
|
|
2348
|
+
*/
|
|
2349
|
+
WaypointAlreadyExists = 'WaypointAlreadyExists',
|
|
2350
|
+
/**
|
|
2351
|
+
* @remarks
|
|
2352
|
+
* The maximum number of waypoints has been reached and no more
|
|
2353
|
+
* can be added.
|
|
2354
|
+
*
|
|
2355
|
+
*/
|
|
2356
|
+
WaypointLimitExceeded = 'WaypointLimitExceeded',
|
|
2357
|
+
/**
|
|
2358
|
+
* @remarks
|
|
2359
|
+
* The specified waypoint does not exist in the locator bar.
|
|
2360
|
+
*
|
|
2361
|
+
*/
|
|
2362
|
+
WaypointNotFound = 'WaypointNotFound',
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2254
2365
|
/**
|
|
2255
2366
|
* Describes the memory of a device.
|
|
2256
2367
|
*/
|
|
@@ -2895,6 +3006,61 @@ export enum TintMethod {
|
|
|
2895
3006
|
Water = 'Water',
|
|
2896
3007
|
}
|
|
2897
3008
|
|
|
3009
|
+
/**
|
|
3010
|
+
* @beta
|
|
3011
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
3012
|
+
* to terminate execution of a behavior packs' script.
|
|
3013
|
+
*/
|
|
3014
|
+
export enum WatchdogTerminateReason {
|
|
3015
|
+
/**
|
|
3016
|
+
* @remarks
|
|
3017
|
+
* Script runtime for a behavior pack is terminated due to
|
|
3018
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
3019
|
+
*
|
|
3020
|
+
*/
|
|
3021
|
+
Hang = 'Hang',
|
|
3022
|
+
/**
|
|
3023
|
+
* @remarks
|
|
3024
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3025
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3026
|
+
* function calls.
|
|
3027
|
+
*
|
|
3028
|
+
*/
|
|
3029
|
+
StackOverflow = 'StackOverflow',
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
/**
|
|
3033
|
+
* @beta
|
|
3034
|
+
* Enum representing different texture icons that can be
|
|
3035
|
+
* displayed for waypoints on the locator bar.
|
|
3036
|
+
*/
|
|
3037
|
+
export enum WaypointTexture {
|
|
3038
|
+
/**
|
|
3039
|
+
* @remarks
|
|
3040
|
+
* Circle waypoint icon texture.
|
|
3041
|
+
*
|
|
3042
|
+
*/
|
|
3043
|
+
Circle = 'minecraft:circle',
|
|
3044
|
+
/**
|
|
3045
|
+
* @remarks
|
|
3046
|
+
* Small square waypoint icon texture.
|
|
3047
|
+
*
|
|
3048
|
+
*/
|
|
3049
|
+
SmallSquare = 'minecraft:small_square',
|
|
3050
|
+
/**
|
|
3051
|
+
* @remarks
|
|
3052
|
+
* Small star waypoint icon texture.
|
|
3053
|
+
*
|
|
3054
|
+
*/
|
|
3055
|
+
SmallStar = 'minecraft:small_star',
|
|
3056
|
+
/**
|
|
3057
|
+
* @remarks
|
|
3058
|
+
* Square waypoint icon texture.
|
|
3059
|
+
*
|
|
3060
|
+
*/
|
|
3061
|
+
Square = 'minecraft:square',
|
|
3062
|
+
}
|
|
3063
|
+
|
|
2898
3064
|
/**
|
|
2899
3065
|
* Used to specify the type of weather condition within the
|
|
2900
3066
|
* world.
|
|
@@ -2971,6 +3137,7 @@ export type EntityComponentTypeMap = {
|
|
|
2971
3137
|
color: EntityColorComponent;
|
|
2972
3138
|
color2: EntityColor2Component;
|
|
2973
3139
|
cursor_inventory: PlayerCursorInventoryComponent;
|
|
3140
|
+
ender_inventory: EntityEnderInventoryComponent;
|
|
2974
3141
|
equippable: EntityEquippableComponent;
|
|
2975
3142
|
fire_immune: EntityFireImmuneComponent;
|
|
2976
3143
|
floats_in_liquid: EntityFloatsInLiquidComponent;
|
|
@@ -3005,6 +3172,7 @@ export type EntityComponentTypeMap = {
|
|
|
3005
3172
|
'minecraft:color': EntityColorComponent;
|
|
3006
3173
|
'minecraft:color2': EntityColor2Component;
|
|
3007
3174
|
'minecraft:cursor_inventory': PlayerCursorInventoryComponent;
|
|
3175
|
+
'minecraft:ender_inventory': EntityEnderInventoryComponent;
|
|
3008
3176
|
'minecraft:equippable': EntityEquippableComponent;
|
|
3009
3177
|
'minecraft:fire_immune': EntityFireImmuneComponent;
|
|
3010
3178
|
'minecraft:floats_in_liquid': EntityFloatsInLiquidComponent;
|
|
@@ -3046,6 +3214,7 @@ export type EntityComponentTypeMap = {
|
|
|
3046
3214
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
3047
3215
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
3048
3216
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3217
|
+
'minecraft:npc': EntityNpcComponent;
|
|
3049
3218
|
'minecraft:onfire': EntityOnFireComponent;
|
|
3050
3219
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
3051
3220
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -3079,6 +3248,7 @@ export type EntityComponentTypeMap = {
|
|
|
3079
3248
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3080
3249
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3081
3250
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3251
|
+
npc: EntityNpcComponent;
|
|
3082
3252
|
onfire: EntityOnFireComponent;
|
|
3083
3253
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3084
3254
|
'player.hunger': EntityHungerComponent;
|
|
@@ -3098,6 +3268,15 @@ export type EntityComponentTypeMap = {
|
|
|
3098
3268
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3099
3269
|
};
|
|
3100
3270
|
|
|
3271
|
+
/**
|
|
3272
|
+
* @beta
|
|
3273
|
+
*/
|
|
3274
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3275
|
+
? VanillaEntityIdentifier
|
|
3276
|
+
: T extends string
|
|
3277
|
+
? VanillaEntityIdentifier | T
|
|
3278
|
+
: never;
|
|
3279
|
+
|
|
3101
3280
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3102
3281
|
? ItemComponentTypeMap[T]
|
|
3103
3282
|
: ItemCustomComponentInstance;
|
|
@@ -3123,6 +3302,15 @@ export type ItemComponentTypeMap = {
|
|
|
3123
3302
|
potion: ItemPotionComponent;
|
|
3124
3303
|
};
|
|
3125
3304
|
|
|
3305
|
+
/**
|
|
3306
|
+
* @beta
|
|
3307
|
+
*/
|
|
3308
|
+
export type VanillaEntityIdentifier =
|
|
3309
|
+
| EntityType
|
|
3310
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3311
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3312
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3313
|
+
|
|
3126
3314
|
/**
|
|
3127
3315
|
* Handle to an aim-assist category that exists in the
|
|
3128
3316
|
* world.aimAssist registry.
|
|
@@ -3280,7 +3468,9 @@ export class AimAssistCategorySettings {
|
|
|
3280
3468
|
* A record mapping block Ids to their priority settings.
|
|
3281
3469
|
* Larger numbers have greater priority.
|
|
3282
3470
|
*/
|
|
3283
|
-
setBlockPriorities(
|
|
3471
|
+
setBlockPriorities(
|
|
3472
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3473
|
+
): void;
|
|
3284
3474
|
/**
|
|
3285
3475
|
* @remarks
|
|
3286
3476
|
* Sets the priority settings used for block targeting.
|
|
@@ -3299,7 +3489,9 @@ export class AimAssistCategorySettings {
|
|
|
3299
3489
|
* A record mapping entity Ids to their priority settings.
|
|
3300
3490
|
* Larger numbers have greater priority.
|
|
3301
3491
|
*/
|
|
3302
|
-
setEntityPriorities(
|
|
3492
|
+
setEntityPriorities(
|
|
3493
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3494
|
+
): void;
|
|
3303
3495
|
/**
|
|
3304
3496
|
* @remarks
|
|
3305
3497
|
* Sets the priority settings used for entity targeting.
|
|
@@ -3498,8 +3690,10 @@ export class AimAssistPresetSettings {
|
|
|
3498
3690
|
*
|
|
3499
3691
|
* This function can't be called in restricted-execution mode.
|
|
3500
3692
|
*
|
|
3693
|
+
* @param targets
|
|
3694
|
+
* An array of block tags.
|
|
3501
3695
|
*/
|
|
3502
|
-
setExcludedBlockTagTargets(
|
|
3696
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3503
3697
|
/**
|
|
3504
3698
|
* @remarks
|
|
3505
3699
|
* Sets the list of block Ids to exclude from aim assist
|
|
@@ -3507,8 +3701,10 @@ export class AimAssistPresetSettings {
|
|
|
3507
3701
|
*
|
|
3508
3702
|
* This function can't be called in restricted-execution mode.
|
|
3509
3703
|
*
|
|
3704
|
+
* @param targets
|
|
3705
|
+
* An array of block Ids.
|
|
3510
3706
|
*/
|
|
3511
|
-
setExcludedBlockTargets(
|
|
3707
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3512
3708
|
/**
|
|
3513
3709
|
* @remarks
|
|
3514
3710
|
* Sets the list of entity Ids to exclude from aim assist
|
|
@@ -3516,8 +3712,10 @@ export class AimAssistPresetSettings {
|
|
|
3516
3712
|
*
|
|
3517
3713
|
* This function can't be called in restricted-execution mode.
|
|
3518
3714
|
*
|
|
3715
|
+
* @param targets
|
|
3716
|
+
* An array of entity Ids.
|
|
3519
3717
|
*/
|
|
3520
|
-
setExcludedEntityTargets(
|
|
3718
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3521
3719
|
/**
|
|
3522
3720
|
* @remarks
|
|
3523
3721
|
* Sets the list of entity type families to exclude from aim
|
|
@@ -3525,8 +3723,10 @@ export class AimAssistPresetSettings {
|
|
|
3525
3723
|
*
|
|
3526
3724
|
* This function can't be called in restricted-execution mode.
|
|
3527
3725
|
*
|
|
3726
|
+
* @param targets
|
|
3727
|
+
* An array of entity type families.
|
|
3528
3728
|
*/
|
|
3529
|
-
setExcludedEntityTypeFamilyTargets(
|
|
3729
|
+
setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
|
|
3530
3730
|
/**
|
|
3531
3731
|
* @remarks
|
|
3532
3732
|
* Sets the per-item aim-assist category Ids.
|
|
@@ -3537,7 +3737,7 @@ export class AimAssistPresetSettings {
|
|
|
3537
3737
|
* A record mapping item Ids to aim-assist category Ids.
|
|
3538
3738
|
* Category Ids must have a namespace.
|
|
3539
3739
|
*/
|
|
3540
|
-
setItemSettings(itemSettings: Record<string, string>): void;
|
|
3740
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3541
3741
|
/**
|
|
3542
3742
|
* @remarks
|
|
3543
3743
|
* Sets the list of item Ids that will target liquid blocks
|
|
@@ -3548,7 +3748,7 @@ export class AimAssistPresetSettings {
|
|
|
3548
3748
|
* @param items
|
|
3549
3749
|
* An array of item Ids.
|
|
3550
3750
|
*/
|
|
3551
|
-
setLiquidTargetingItems(items?: string[]): void;
|
|
3751
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3552
3752
|
}
|
|
3553
3753
|
|
|
3554
3754
|
/**
|
|
@@ -3654,6 +3854,28 @@ export class AimAssistRegistry {
|
|
|
3654
3854
|
getPresets(): AimAssistPreset[];
|
|
3655
3855
|
}
|
|
3656
3856
|
|
|
3857
|
+
/**
|
|
3858
|
+
* @beta
|
|
3859
|
+
* Describes a single banner pattern, which includes a colour
|
|
3860
|
+
* and a pattern type.
|
|
3861
|
+
*/
|
|
3862
|
+
export class BannerPattern {
|
|
3863
|
+
private constructor();
|
|
3864
|
+
/**
|
|
3865
|
+
* @remarks
|
|
3866
|
+
* The color to apply to this banner pattern.
|
|
3867
|
+
*
|
|
3868
|
+
*/
|
|
3869
|
+
readonly color: string;
|
|
3870
|
+
/**
|
|
3871
|
+
* @remarks
|
|
3872
|
+
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
3873
|
+
* apply to the banner.
|
|
3874
|
+
*
|
|
3875
|
+
*/
|
|
3876
|
+
readonly pattern: string;
|
|
3877
|
+
}
|
|
3878
|
+
|
|
3657
3879
|
/**
|
|
3658
3880
|
* Describes a type of biome.
|
|
3659
3881
|
*/
|
|
@@ -3750,6 +3972,20 @@ export class Block {
|
|
|
3750
3972
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3751
3973
|
*/
|
|
3752
3974
|
readonly isLiquid: boolean;
|
|
3975
|
+
/**
|
|
3976
|
+
* @beta
|
|
3977
|
+
* @remarks
|
|
3978
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
3979
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
3980
|
+
* ladder block and a fence block are not).
|
|
3981
|
+
*
|
|
3982
|
+
* @throws This property can throw when used.
|
|
3983
|
+
*
|
|
3984
|
+
* {@link LocationInUnloadedChunkError}
|
|
3985
|
+
*
|
|
3986
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3987
|
+
*/
|
|
3988
|
+
readonly isSolid: boolean;
|
|
3753
3989
|
/**
|
|
3754
3990
|
* @remarks
|
|
3755
3991
|
* Returns true if this reference to a block is still valid
|
|
@@ -3915,6 +4151,30 @@ export class Block {
|
|
|
3915
4151
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3916
4152
|
*/
|
|
3917
4153
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4154
|
+
/**
|
|
4155
|
+
* @beta
|
|
4156
|
+
* @remarks
|
|
4157
|
+
* Checks to see whether it is valid to place the specified
|
|
4158
|
+
* block type or block permutation, on a specified face on this
|
|
4159
|
+
* block.
|
|
4160
|
+
*
|
|
4161
|
+
* @param blockToPlace
|
|
4162
|
+
* Block type or block permutation to check placement for.
|
|
4163
|
+
* @param faceToPlaceOn
|
|
4164
|
+
* Optional specific face of this block to check placement
|
|
4165
|
+
* against.
|
|
4166
|
+
* @returns
|
|
4167
|
+
* Returns `true` if the block type or permutation can be
|
|
4168
|
+
* placed on this block, else `false`.
|
|
4169
|
+
* @throws This function can throw errors.
|
|
4170
|
+
*
|
|
4171
|
+
* {@link Error}
|
|
4172
|
+
*
|
|
4173
|
+
* {@link LocationInUnloadedChunkError}
|
|
4174
|
+
*
|
|
4175
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4176
|
+
*/
|
|
4177
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
3918
4178
|
/**
|
|
3919
4179
|
* @remarks
|
|
3920
4180
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -4011,6 +4271,29 @@ export class Block {
|
|
|
4011
4271
|
* {@link LocationInUnloadedChunkError}
|
|
4012
4272
|
*/
|
|
4013
4273
|
getLightLevel(): number;
|
|
4274
|
+
/**
|
|
4275
|
+
* @beta
|
|
4276
|
+
* @throws This function can throw errors.
|
|
4277
|
+
*
|
|
4278
|
+
* {@link LocationInUnloadedChunkError}
|
|
4279
|
+
*
|
|
4280
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4281
|
+
*/
|
|
4282
|
+
getMapColor(): RGBA;
|
|
4283
|
+
/**
|
|
4284
|
+
* @beta
|
|
4285
|
+
* @remarks
|
|
4286
|
+
* Returns array of all loaded block parts if this block has
|
|
4287
|
+
* the 'minecraft:multi_block' trait. If it does not have the
|
|
4288
|
+
* trait returns undefined
|
|
4289
|
+
*
|
|
4290
|
+
* @throws This function can throw errors.
|
|
4291
|
+
*
|
|
4292
|
+
* {@link LocationInUnloadedChunkError}
|
|
4293
|
+
*
|
|
4294
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4295
|
+
*/
|
|
4296
|
+
getParts(): Block[] | undefined;
|
|
4014
4297
|
/**
|
|
4015
4298
|
* @remarks
|
|
4016
4299
|
* Returns the net redstone power of this block.
|
|
@@ -4278,6 +4561,27 @@ export class Block {
|
|
|
4278
4561
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4279
4562
|
*/
|
|
4280
4563
|
south(steps?: number): Block | undefined;
|
|
4564
|
+
/**
|
|
4565
|
+
* @beta
|
|
4566
|
+
* @remarks
|
|
4567
|
+
* Tries to set the block in the dimension to the state of the
|
|
4568
|
+
* permutation by first checking if the placement is valid.
|
|
4569
|
+
*
|
|
4570
|
+
* This function can't be called in restricted-execution mode.
|
|
4571
|
+
*
|
|
4572
|
+
* @param permutation
|
|
4573
|
+
* Permutation that contains a set of property states for the
|
|
4574
|
+
* Block.
|
|
4575
|
+
* @returns
|
|
4576
|
+
* Returns `true` if the block permutation data was
|
|
4577
|
+
* successfully set, else `false`.
|
|
4578
|
+
* @throws This function can throw errors.
|
|
4579
|
+
*
|
|
4580
|
+
* {@link LocationInUnloadedChunkError}
|
|
4581
|
+
*
|
|
4582
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4583
|
+
*/
|
|
4584
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4281
4585
|
/**
|
|
4282
4586
|
* @remarks
|
|
4283
4587
|
* Returns the {@link Block} to the west of this block
|
|
@@ -4295,6 +4599,137 @@ export class Block {
|
|
|
4295
4599
|
west(steps?: number): Block | undefined;
|
|
4296
4600
|
}
|
|
4297
4601
|
|
|
4602
|
+
/**
|
|
4603
|
+
* @beta
|
|
4604
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4605
|
+
* of useful functions for the creation and utility of {@link
|
|
4606
|
+
* BlockBoundingBox} objects
|
|
4607
|
+
*/
|
|
4608
|
+
export class BlockBoundingBoxUtils {
|
|
4609
|
+
private constructor();
|
|
4610
|
+
/**
|
|
4611
|
+
* @remarks
|
|
4612
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4613
|
+
* where the min and max components are guaranteed to be (min
|
|
4614
|
+
* <= max)
|
|
4615
|
+
*
|
|
4616
|
+
* This function can't be called in restricted-execution mode.
|
|
4617
|
+
*
|
|
4618
|
+
* @param min
|
|
4619
|
+
* A corner world location
|
|
4620
|
+
* @param max
|
|
4621
|
+
* A corner world location diametrically opposite
|
|
4622
|
+
*/
|
|
4623
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4624
|
+
/**
|
|
4625
|
+
* @remarks
|
|
4626
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4627
|
+
* each axis.
|
|
4628
|
+
* Sizes can be negative to perform contraction.
|
|
4629
|
+
* Note: corners can be inverted if the contraction size is
|
|
4630
|
+
* greater than the span, but the min/max relationship will
|
|
4631
|
+
* remain correct
|
|
4632
|
+
*
|
|
4633
|
+
* This function can't be called in restricted-execution mode.
|
|
4634
|
+
*
|
|
4635
|
+
* @returns
|
|
4636
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4637
|
+
* the changes
|
|
4638
|
+
*/
|
|
4639
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4640
|
+
/**
|
|
4641
|
+
* @remarks
|
|
4642
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4643
|
+
*
|
|
4644
|
+
* This function can't be called in restricted-execution mode.
|
|
4645
|
+
*
|
|
4646
|
+
*/
|
|
4647
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4648
|
+
/**
|
|
4649
|
+
* @remarks
|
|
4650
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4651
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4652
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4653
|
+
* boxes.
|
|
4654
|
+
*
|
|
4655
|
+
* This function can't be called in restricted-execution mode.
|
|
4656
|
+
*
|
|
4657
|
+
* @returns
|
|
4658
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4659
|
+
* smallest possible bounding box which can encompass both
|
|
4660
|
+
*/
|
|
4661
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4662
|
+
/**
|
|
4663
|
+
* @remarks
|
|
4664
|
+
* Calculate the center block of a given {@link
|
|
4665
|
+
* BlockBoundingBox} object.
|
|
4666
|
+
*
|
|
4667
|
+
* This function can't be called in restricted-execution mode.
|
|
4668
|
+
*
|
|
4669
|
+
* @returns
|
|
4670
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4671
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4672
|
+
* bounds are not mathematically centered...
|
|
4673
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4674
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4675
|
+
*/
|
|
4676
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4677
|
+
/**
|
|
4678
|
+
* @remarks
|
|
4679
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4680
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4681
|
+
*
|
|
4682
|
+
* This function can't be called in restricted-execution mode.
|
|
4683
|
+
*
|
|
4684
|
+
*/
|
|
4685
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4686
|
+
/**
|
|
4687
|
+
* @remarks
|
|
4688
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4689
|
+
*
|
|
4690
|
+
* This function can't be called in restricted-execution mode.
|
|
4691
|
+
*
|
|
4692
|
+
*/
|
|
4693
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4694
|
+
/**
|
|
4695
|
+
* @remarks
|
|
4696
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4697
|
+
*
|
|
4698
|
+
* This function can't be called in restricted-execution mode.
|
|
4699
|
+
*
|
|
4700
|
+
*/
|
|
4701
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4702
|
+
/**
|
|
4703
|
+
* @remarks
|
|
4704
|
+
* Check to see if a given coordinate is inside a
|
|
4705
|
+
* BlockBoundingBox
|
|
4706
|
+
*
|
|
4707
|
+
* This function can't be called in restricted-execution mode.
|
|
4708
|
+
*
|
|
4709
|
+
*/
|
|
4710
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4711
|
+
/**
|
|
4712
|
+
* @remarks
|
|
4713
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4714
|
+
* max))
|
|
4715
|
+
*
|
|
4716
|
+
* This function can't be called in restricted-execution mode.
|
|
4717
|
+
*
|
|
4718
|
+
*/
|
|
4719
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4720
|
+
/**
|
|
4721
|
+
* @remarks
|
|
4722
|
+
* Move a BlockBoundingBox by a given amount
|
|
4723
|
+
*
|
|
4724
|
+
* This function can't be called in restricted-execution mode.
|
|
4725
|
+
*
|
|
4726
|
+
* @returns
|
|
4727
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4728
|
+
* change
|
|
4729
|
+
*/
|
|
4730
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4731
|
+
}
|
|
4732
|
+
|
|
4298
4733
|
/**
|
|
4299
4734
|
* Base type for components associated with blocks.
|
|
4300
4735
|
*/
|
|
@@ -4585,26 +5020,130 @@ export class BlockComponentTickEvent extends BlockEvent {
|
|
|
4585
5020
|
}
|
|
4586
5021
|
|
|
4587
5022
|
/**
|
|
4588
|
-
*
|
|
5023
|
+
* @beta
|
|
5024
|
+
* Contains information regarding a specific container block
|
|
5025
|
+
* being closed.
|
|
4589
5026
|
*/
|
|
4590
5027
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4591
|
-
export class
|
|
5028
|
+
export class BlockContainerClosedAfterEvent extends BlockEvent {
|
|
4592
5029
|
private constructor();
|
|
4593
|
-
|
|
5030
|
+
/**
|
|
5031
|
+
* @remarks
|
|
5032
|
+
* The source of the block container being closed.
|
|
5033
|
+
*
|
|
5034
|
+
* This property can't be edited in restricted-execution mode.
|
|
5035
|
+
*
|
|
5036
|
+
*/
|
|
5037
|
+
closeSource: ContainerAccessSource;
|
|
4594
5038
|
}
|
|
4595
5039
|
|
|
4596
5040
|
/**
|
|
4597
|
-
*
|
|
4598
|
-
*
|
|
5041
|
+
* @beta
|
|
5042
|
+
* Manages callbacks that are connected to when a block
|
|
5043
|
+
* container is closed.
|
|
4599
5044
|
*/
|
|
4600
|
-
export class
|
|
5045
|
+
export class BlockContainerClosedAfterEventSignal {
|
|
4601
5046
|
private constructor();
|
|
4602
5047
|
/**
|
|
4603
5048
|
* @remarks
|
|
4604
|
-
*
|
|
5049
|
+
* Adds a callback that will be called when a block container
|
|
5050
|
+
* is closed.
|
|
4605
5051
|
*
|
|
4606
|
-
|
|
4607
|
-
|
|
5052
|
+
* This function can't be called in restricted-execution mode.
|
|
5053
|
+
*
|
|
5054
|
+
* This function can be called in early-execution mode.
|
|
5055
|
+
*
|
|
5056
|
+
*/
|
|
5057
|
+
subscribe(
|
|
5058
|
+
callback: (arg0: BlockContainerClosedAfterEvent) => void,
|
|
5059
|
+
options?: BlockContainerAccessEventOptions,
|
|
5060
|
+
): (arg0: BlockContainerClosedAfterEvent) => void;
|
|
5061
|
+
/**
|
|
5062
|
+
* @remarks
|
|
5063
|
+
* Removes a callback from being called when a block container
|
|
5064
|
+
* is closed.
|
|
5065
|
+
*
|
|
5066
|
+
* This function can't be called in restricted-execution mode.
|
|
5067
|
+
*
|
|
5068
|
+
* This function can be called in early-execution mode.
|
|
5069
|
+
*
|
|
5070
|
+
*/
|
|
5071
|
+
unsubscribe(callback: (arg0: BlockContainerClosedAfterEvent) => void): void;
|
|
5072
|
+
}
|
|
5073
|
+
|
|
5074
|
+
/**
|
|
5075
|
+
* @beta
|
|
5076
|
+
* Contains information regarding a specific container block
|
|
5077
|
+
* being opened.
|
|
5078
|
+
*/
|
|
5079
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5080
|
+
export class BlockContainerOpenedAfterEvent extends BlockEvent {
|
|
5081
|
+
private constructor();
|
|
5082
|
+
/**
|
|
5083
|
+
* @remarks
|
|
5084
|
+
* The source of the block container being opened.
|
|
5085
|
+
*
|
|
5086
|
+
* This property can't be edited in restricted-execution mode.
|
|
5087
|
+
*
|
|
5088
|
+
*/
|
|
5089
|
+
openSource: ContainerAccessSource;
|
|
5090
|
+
}
|
|
5091
|
+
|
|
5092
|
+
/**
|
|
5093
|
+
* @beta
|
|
5094
|
+
* Manages callbacks that are connected to when a block
|
|
5095
|
+
* container is opened.
|
|
5096
|
+
*/
|
|
5097
|
+
export class BlockContainerOpenedAfterEventSignal {
|
|
5098
|
+
private constructor();
|
|
5099
|
+
/**
|
|
5100
|
+
* @remarks
|
|
5101
|
+
* Adds a callback that will be called when a block container
|
|
5102
|
+
* is opened.
|
|
5103
|
+
*
|
|
5104
|
+
* This function can't be called in restricted-execution mode.
|
|
5105
|
+
*
|
|
5106
|
+
* This function can be called in early-execution mode.
|
|
5107
|
+
*
|
|
5108
|
+
*/
|
|
5109
|
+
subscribe(
|
|
5110
|
+
callback: (arg0: BlockContainerOpenedAfterEvent) => void,
|
|
5111
|
+
options?: BlockContainerAccessEventOptions,
|
|
5112
|
+
): (arg0: BlockContainerOpenedAfterEvent) => void;
|
|
5113
|
+
/**
|
|
5114
|
+
* @remarks
|
|
5115
|
+
* Removes a callback from being called when a block container
|
|
5116
|
+
* is opened.
|
|
5117
|
+
*
|
|
5118
|
+
* This function can't be called in restricted-execution mode.
|
|
5119
|
+
*
|
|
5120
|
+
* This function can be called in early-execution mode.
|
|
5121
|
+
*
|
|
5122
|
+
*/
|
|
5123
|
+
unsubscribe(callback: (arg0: BlockContainerOpenedAfterEvent) => void): void;
|
|
5124
|
+
}
|
|
5125
|
+
|
|
5126
|
+
/**
|
|
5127
|
+
* An instance of a custom component on a block.
|
|
5128
|
+
*/
|
|
5129
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5130
|
+
export class BlockCustomComponentInstance extends BlockComponent {
|
|
5131
|
+
private constructor();
|
|
5132
|
+
readonly customComponentParameters: CustomComponentParameters;
|
|
5133
|
+
}
|
|
5134
|
+
|
|
5135
|
+
/**
|
|
5136
|
+
* Contains information regarding an event that impacts a
|
|
5137
|
+
* specific block.
|
|
5138
|
+
*/
|
|
5139
|
+
export class BlockEvent {
|
|
5140
|
+
private constructor();
|
|
5141
|
+
/**
|
|
5142
|
+
* @remarks
|
|
5143
|
+
* Block currently in the world at the location of this event.
|
|
5144
|
+
*
|
|
5145
|
+
*/
|
|
5146
|
+
readonly block: Block;
|
|
4608
5147
|
/**
|
|
4609
5148
|
* @remarks
|
|
4610
5149
|
* Dimension that contains the block that is the subject of
|
|
@@ -4802,6 +5341,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
4802
5341
|
*
|
|
4803
5342
|
*/
|
|
4804
5343
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5344
|
+
/**
|
|
5345
|
+
* @beta
|
|
5346
|
+
* @remarks
|
|
5347
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5348
|
+
* Will return false if the block volume was modified between
|
|
5349
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5350
|
+
*
|
|
5351
|
+
* @throws This function can throw errors.
|
|
5352
|
+
*
|
|
5353
|
+
* {@link minecraftcommon.EngineError}
|
|
5354
|
+
*/
|
|
5355
|
+
isValid(): boolean;
|
|
4805
5356
|
/**
|
|
4806
5357
|
* @remarks
|
|
4807
5358
|
* This function can't be called in restricted-execution mode.
|
|
@@ -5704,6 +6255,15 @@ export class BlockVolumeBase {
|
|
|
5704
6255
|
*
|
|
5705
6256
|
*/
|
|
5706
6257
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
6258
|
+
/**
|
|
6259
|
+
* @beta
|
|
6260
|
+
* @remarks
|
|
6261
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
6262
|
+
* the validated min and max coordinates of the volume
|
|
6263
|
+
*
|
|
6264
|
+
* @throws This function can throw errors.
|
|
6265
|
+
*/
|
|
6266
|
+
getBoundingBox(): BlockBoundingBox;
|
|
5707
6267
|
/**
|
|
5708
6268
|
* @remarks
|
|
5709
6269
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -5934,6 +6494,23 @@ export class Camera {
|
|
|
5934
6494
|
| CameraSetRotOptions
|
|
5935
6495
|
| CameraTargetOptions,
|
|
5936
6496
|
): void;
|
|
6497
|
+
/**
|
|
6498
|
+
* @beta
|
|
6499
|
+
* @remarks
|
|
6500
|
+
* Sets the current active camera with easing.
|
|
6501
|
+
*
|
|
6502
|
+
* This function can't be called in restricted-execution mode.
|
|
6503
|
+
*
|
|
6504
|
+
* @param cameraPreset
|
|
6505
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6506
|
+
* @param easeOptions
|
|
6507
|
+
* Options to ease the camera from the previous camera to the
|
|
6508
|
+
* current one.
|
|
6509
|
+
* @throws
|
|
6510
|
+
* Throws when easing to minecraft:first_person presets
|
|
6511
|
+
* currently without the experimental cameras toggle enabled.
|
|
6512
|
+
*/
|
|
6513
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
5937
6514
|
/**
|
|
5938
6515
|
* @remarks
|
|
5939
6516
|
* Sets the current active camera for the specified player and
|
|
@@ -5973,12 +6550,185 @@ export class CatmullRomSpline {
|
|
|
5973
6550
|
controlPoints: Vector3[];
|
|
5974
6551
|
}
|
|
5975
6552
|
|
|
6553
|
+
/**
|
|
6554
|
+
* @beta
|
|
6555
|
+
* An event that fires as players enter chat messages.
|
|
6556
|
+
*/
|
|
6557
|
+
export class ChatSendAfterEvent {
|
|
6558
|
+
private constructor();
|
|
6559
|
+
/**
|
|
6560
|
+
* @remarks
|
|
6561
|
+
* Message that is being broadcast.
|
|
6562
|
+
*
|
|
6563
|
+
*/
|
|
6564
|
+
readonly message: string;
|
|
6565
|
+
/**
|
|
6566
|
+
* @remarks
|
|
6567
|
+
* Player that sent the chat message.
|
|
6568
|
+
*
|
|
6569
|
+
*/
|
|
6570
|
+
readonly sender: Player;
|
|
6571
|
+
/**
|
|
6572
|
+
* @remarks
|
|
6573
|
+
* Optional list of players that will receive this message. If
|
|
6574
|
+
* defined, this message is directly targeted to one or more
|
|
6575
|
+
* players (i.e., is not broadcast.)
|
|
6576
|
+
*
|
|
6577
|
+
*/
|
|
6578
|
+
readonly targets?: Player[];
|
|
6579
|
+
}
|
|
6580
|
+
|
|
6581
|
+
/**
|
|
6582
|
+
* @beta
|
|
6583
|
+
* Manages callbacks that are connected to chat messages being
|
|
6584
|
+
* sent.
|
|
6585
|
+
*/
|
|
6586
|
+
export class ChatSendAfterEventSignal {
|
|
6587
|
+
private constructor();
|
|
6588
|
+
/**
|
|
6589
|
+
* @remarks
|
|
6590
|
+
* Adds a callback that will be called when new chat messages
|
|
6591
|
+
* are sent.
|
|
6592
|
+
*
|
|
6593
|
+
* This function can't be called in restricted-execution mode.
|
|
6594
|
+
*
|
|
6595
|
+
* This function can be called in early-execution mode.
|
|
6596
|
+
*
|
|
6597
|
+
*/
|
|
6598
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
6599
|
+
/**
|
|
6600
|
+
* @remarks
|
|
6601
|
+
* Removes a callback from being called when new chat messages
|
|
6602
|
+
* are sent.
|
|
6603
|
+
*
|
|
6604
|
+
* This function can't be called in restricted-execution mode.
|
|
6605
|
+
*
|
|
6606
|
+
* This function can be called in early-execution mode.
|
|
6607
|
+
*
|
|
6608
|
+
*/
|
|
6609
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
6610
|
+
}
|
|
6611
|
+
|
|
6612
|
+
/**
|
|
6613
|
+
* @beta
|
|
6614
|
+
* An event that fires as players enter chat messages.
|
|
6615
|
+
*/
|
|
6616
|
+
export class ChatSendBeforeEvent {
|
|
6617
|
+
private constructor();
|
|
6618
|
+
/**
|
|
6619
|
+
* @remarks
|
|
6620
|
+
* If set to true in a beforeChat event handler, this message
|
|
6621
|
+
* is not broadcast out.
|
|
6622
|
+
*
|
|
6623
|
+
*/
|
|
6624
|
+
cancel: boolean;
|
|
6625
|
+
/**
|
|
6626
|
+
* @remarks
|
|
6627
|
+
* Message that is being broadcast.
|
|
6628
|
+
*
|
|
6629
|
+
*/
|
|
6630
|
+
readonly message: string;
|
|
6631
|
+
/**
|
|
6632
|
+
* @remarks
|
|
6633
|
+
* Player that sent the chat message.
|
|
6634
|
+
*
|
|
6635
|
+
*/
|
|
6636
|
+
readonly sender: Player;
|
|
6637
|
+
/**
|
|
6638
|
+
* @remarks
|
|
6639
|
+
* Optional list of players that will receive this message. If
|
|
6640
|
+
* defined, this message is directly targeted to one or more
|
|
6641
|
+
* players (i.e., is not broadcast.)
|
|
6642
|
+
*
|
|
6643
|
+
*/
|
|
6644
|
+
readonly targets?: Player[];
|
|
6645
|
+
}
|
|
6646
|
+
|
|
6647
|
+
/**
|
|
6648
|
+
* @beta
|
|
6649
|
+
* Manages callbacks that are connected to an event that fires
|
|
6650
|
+
* before chat messages are sent.
|
|
6651
|
+
* @example customCommand.ts
|
|
6652
|
+
* ```typescript
|
|
6653
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
6654
|
+
*
|
|
6655
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
6656
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
6657
|
+
* if (eventData.message.includes('cancel')) {
|
|
6658
|
+
* // Cancel event if the message contains "cancel"
|
|
6659
|
+
* eventData.cancel = true;
|
|
6660
|
+
* } else {
|
|
6661
|
+
* const args = eventData.message.split(' ');
|
|
6662
|
+
*
|
|
6663
|
+
* if (args.length > 0) {
|
|
6664
|
+
* switch (args[0].toLowerCase()) {
|
|
6665
|
+
* case 'echo':
|
|
6666
|
+
* // Send a modified version of chat message
|
|
6667
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
6668
|
+
* break;
|
|
6669
|
+
* case 'help':
|
|
6670
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
6671
|
+
* break;
|
|
6672
|
+
* }
|
|
6673
|
+
* }
|
|
6674
|
+
* }
|
|
6675
|
+
* });
|
|
6676
|
+
* }
|
|
6677
|
+
* ```
|
|
6678
|
+
*/
|
|
6679
|
+
export class ChatSendBeforeEventSignal {
|
|
6680
|
+
private constructor();
|
|
6681
|
+
/**
|
|
6682
|
+
* @remarks
|
|
6683
|
+
* Adds a callback that will be called before new chat messages
|
|
6684
|
+
* are sent.
|
|
6685
|
+
*
|
|
6686
|
+
* This function can't be called in restricted-execution mode.
|
|
6687
|
+
*
|
|
6688
|
+
* This function can be called in early-execution mode.
|
|
6689
|
+
*
|
|
6690
|
+
* @param callback
|
|
6691
|
+
* This closure is called with restricted-execution privilege.
|
|
6692
|
+
* @returns
|
|
6693
|
+
* Closure that is called with restricted-execution privilege.
|
|
6694
|
+
*/
|
|
6695
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
6696
|
+
/**
|
|
6697
|
+
* @remarks
|
|
6698
|
+
* Removes a callback from being called before new chat
|
|
6699
|
+
* messages are sent.
|
|
6700
|
+
*
|
|
6701
|
+
* This function can't be called in restricted-execution mode.
|
|
6702
|
+
*
|
|
6703
|
+
* This function can be called in early-execution mode.
|
|
6704
|
+
*
|
|
6705
|
+
* @param callback
|
|
6706
|
+
* This closure is called with restricted-execution privilege.
|
|
6707
|
+
*/
|
|
6708
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
6709
|
+
}
|
|
6710
|
+
|
|
5976
6711
|
/**
|
|
5977
6712
|
* Contains the device information for a client instance.
|
|
5978
6713
|
*/
|
|
5979
6714
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5980
6715
|
export class ClientSystemInfo extends SystemInfo {
|
|
5981
6716
|
private constructor();
|
|
6717
|
+
/**
|
|
6718
|
+
* @beta
|
|
6719
|
+
* @remarks
|
|
6720
|
+
* The locale selected by the client (e.g., en_US, fr_FR,
|
|
6721
|
+
* ja_JP). Note that in most cases, server scripts should not
|
|
6722
|
+
* use this property to manually localize text. Instead, use
|
|
6723
|
+
* {@link RawMessage} with a translate field to send
|
|
6724
|
+
* localization keys, allowing each client to resolve them in
|
|
6725
|
+
* their own language automatically. Direct use of locale for
|
|
6726
|
+
* localization is fragile and may produce unexpected results
|
|
6727
|
+
* when players with different languages are on the same
|
|
6728
|
+
* server.
|
|
6729
|
+
*
|
|
6730
|
+
*/
|
|
6731
|
+
readonly locale: string;
|
|
5982
6732
|
/**
|
|
5983
6733
|
* @remarks
|
|
5984
6734
|
* The max render distance for the device in chunks.
|
|
@@ -6030,6 +6780,258 @@ export class Component {
|
|
|
6030
6780
|
readonly typeId: string;
|
|
6031
6781
|
}
|
|
6032
6782
|
|
|
6783
|
+
/**
|
|
6784
|
+
* @beta
|
|
6785
|
+
* The Compound Block Volume is a collection of individual
|
|
6786
|
+
* block volume definitions which, as a collection, define a
|
|
6787
|
+
* larger volume of (sometimes non-contiguous) irregular
|
|
6788
|
+
* shapes.
|
|
6789
|
+
* This class is loosely based on the concept of CSG
|
|
6790
|
+
* (Computational Solid Geometry) and allows a user to create
|
|
6791
|
+
* complex volumes by building a stack of volumes and voids to
|
|
6792
|
+
* make a larger single volume.
|
|
6793
|
+
* For example - normally a creator would create a hollow cube
|
|
6794
|
+
* by creating 6 "wall" surfaces for each face.
|
|
6795
|
+
* With a Compound Block Volume, a creator can define a hollow
|
|
6796
|
+
* cube by creating a single outer solid cube, and then
|
|
6797
|
+
* defining a further single 'void' cube inside the larger one.
|
|
6798
|
+
* Similarly, the Compound Block Volume can represent irregular
|
|
6799
|
+
* shaped volumes (e.g. a tree consists of a trunk and lots of
|
|
6800
|
+
* leaf cubes which are not necessarily contiguously placed).
|
|
6801
|
+
* Each of the volumes added to the CompoundBlockVolume are (by
|
|
6802
|
+
* default) relative to the origin set (either at construction
|
|
6803
|
+
* or via one of the set functions).
|
|
6804
|
+
* However, it is also possible to push volumes to the compound
|
|
6805
|
+
* collection which are absolute in nature and are not affected
|
|
6806
|
+
* by origin changes.
|
|
6807
|
+
*/
|
|
6808
|
+
export class CompoundBlockVolume {
|
|
6809
|
+
/**
|
|
6810
|
+
* @remarks
|
|
6811
|
+
* Return the 'capacity' of the bounding rectangle which
|
|
6812
|
+
* represents the collection of volumes in the stack
|
|
6813
|
+
*
|
|
6814
|
+
*/
|
|
6815
|
+
readonly capacity: number;
|
|
6816
|
+
readonly items: CompoundBlockVolumeItem[];
|
|
6817
|
+
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
6818
|
+
/**
|
|
6819
|
+
* @remarks
|
|
6820
|
+
* Return the number of volumes (positive and negative) in the
|
|
6821
|
+
* volume stack
|
|
6822
|
+
*
|
|
6823
|
+
*/
|
|
6824
|
+
readonly volumeCount: number;
|
|
6825
|
+
/**
|
|
6826
|
+
* @remarks
|
|
6827
|
+
* Create a CompoundBlockVolume object
|
|
6828
|
+
*
|
|
6829
|
+
* @param origin
|
|
6830
|
+
* An optional world space origin on which to center the
|
|
6831
|
+
* compound volume.
|
|
6832
|
+
* If not specified, the origin is set to (0,0,0)
|
|
6833
|
+
*/
|
|
6834
|
+
constructor(origin?: Vector3);
|
|
6835
|
+
/**
|
|
6836
|
+
* @remarks
|
|
6837
|
+
* Clear the contents of the volume stack
|
|
6838
|
+
*
|
|
6839
|
+
* This function can't be called in restricted-execution mode.
|
|
6840
|
+
*
|
|
6841
|
+
*/
|
|
6842
|
+
clear(): void;
|
|
6843
|
+
/**
|
|
6844
|
+
* @remarks
|
|
6845
|
+
* Fetch a Block Location Iterator for the Compound Block
|
|
6846
|
+
* Volume. This iterator will allow a creator to iterate
|
|
6847
|
+
* across all of the selected volumes within the larger
|
|
6848
|
+
* bounding area.
|
|
6849
|
+
* Areas of a volume which have been overridden by a
|
|
6850
|
+
* subtractive volume will not be included in the iterator
|
|
6851
|
+
* step.
|
|
6852
|
+
* (i.e. if you push a cube to the stack, and then push a
|
|
6853
|
+
* subtractive volume to the same location, then the iterator
|
|
6854
|
+
* will step over the initial volume because it is considered
|
|
6855
|
+
* negative space)
|
|
6856
|
+
* Note that the Block Locations returned by this iterator are
|
|
6857
|
+
* in absolute world space (irrespective of whether the
|
|
6858
|
+
* compound volume items pushed are absolute or relative)
|
|
6859
|
+
*
|
|
6860
|
+
* This function can't be called in restricted-execution mode.
|
|
6861
|
+
*
|
|
6862
|
+
*/
|
|
6863
|
+
getBlockLocationIterator(): BlockLocationIterator;
|
|
6864
|
+
/**
|
|
6865
|
+
* @remarks
|
|
6866
|
+
* Get the largest bounding box that represents a container for
|
|
6867
|
+
* all of the volumes on the stack
|
|
6868
|
+
* Note that the bounding box returned is represented in
|
|
6869
|
+
* absolute world space (irrespective of whether the compound
|
|
6870
|
+
* volume items pushed are absolute or relative)
|
|
6871
|
+
*
|
|
6872
|
+
* This function can't be called in restricted-execution mode.
|
|
6873
|
+
*
|
|
6874
|
+
*/
|
|
6875
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6876
|
+
/**
|
|
6877
|
+
* @remarks
|
|
6878
|
+
* Get the max block location of the outermost bounding
|
|
6879
|
+
* rectangle which represents the volumes on the stack.
|
|
6880
|
+
* Note that the max location returned is in absolute world
|
|
6881
|
+
* space (irrespective of whether the compound volume items
|
|
6882
|
+
* pushed are absolute or relative)
|
|
6883
|
+
*
|
|
6884
|
+
* This function can't be called in restricted-execution mode.
|
|
6885
|
+
*
|
|
6886
|
+
*/
|
|
6887
|
+
getMax(): Vector3;
|
|
6888
|
+
/**
|
|
6889
|
+
* @remarks
|
|
6890
|
+
* Get the min block location of the outermost bounding
|
|
6891
|
+
* rectangle which represents the volumes on the stack.
|
|
6892
|
+
* Note that the min location returned is in absolute world
|
|
6893
|
+
* space (irrespective of whether the compound volume items
|
|
6894
|
+
* pushed are absolute or relative)
|
|
6895
|
+
*
|
|
6896
|
+
* This function can't be called in restricted-execution mode.
|
|
6897
|
+
*
|
|
6898
|
+
*/
|
|
6899
|
+
getMin(): Vector3;
|
|
6900
|
+
/**
|
|
6901
|
+
* @remarks
|
|
6902
|
+
* Fetch the origin in world space of the compound volume
|
|
6903
|
+
*
|
|
6904
|
+
* This function can't be called in restricted-execution mode.
|
|
6905
|
+
*
|
|
6906
|
+
*/
|
|
6907
|
+
getOrigin(): Vector3;
|
|
6908
|
+
/**
|
|
6909
|
+
* @remarks
|
|
6910
|
+
* Return a boolean which signals if there are any volume items
|
|
6911
|
+
* pushed to the volume
|
|
6912
|
+
*
|
|
6913
|
+
* This function can't be called in restricted-execution mode.
|
|
6914
|
+
*
|
|
6915
|
+
*/
|
|
6916
|
+
isEmpty(): boolean;
|
|
6917
|
+
/**
|
|
6918
|
+
* @remarks
|
|
6919
|
+
* Return a boolean representing whether or not a given
|
|
6920
|
+
* absolute world space block location is inside a positive
|
|
6921
|
+
* block volume.
|
|
6922
|
+
* E.g. if the stack contains a large cube followed by a
|
|
6923
|
+
* slightly smaller negative cube, and the test location is
|
|
6924
|
+
* within the negative cube - the function will return false
|
|
6925
|
+
* because it's not 'inside' a volume (it IS inside the
|
|
6926
|
+
* bounding rectangle, but it is not inside a positively
|
|
6927
|
+
* defined location)
|
|
6928
|
+
*
|
|
6929
|
+
* This function can't be called in restricted-execution mode.
|
|
6930
|
+
*
|
|
6931
|
+
*/
|
|
6932
|
+
isInside(worldLocation: Vector3): boolean;
|
|
6933
|
+
/**
|
|
6934
|
+
* @remarks
|
|
6935
|
+
* Inspect the last entry pushed to the volume stack without
|
|
6936
|
+
* affecting the stack contents.
|
|
6937
|
+
*
|
|
6938
|
+
* This function can't be called in restricted-execution mode.
|
|
6939
|
+
*
|
|
6940
|
+
* @param forceRelativity
|
|
6941
|
+
* Determine whether the function returns a
|
|
6942
|
+
* CompoundBlockVolumeItem which is forced into either relative
|
|
6943
|
+
* or absolute coordinate system.
|
|
6944
|
+
* `true` = force returned item to be relative to volume origin
|
|
6945
|
+
* `false` = force returned item to be absolute world space
|
|
6946
|
+
* location
|
|
6947
|
+
*
|
|
6948
|
+
* If no flag is specified, the item returned retains whatever
|
|
6949
|
+
* relativity it had when it was pushed
|
|
6950
|
+
* @returns
|
|
6951
|
+
* Returns undefined if the stack is empty
|
|
6952
|
+
*/
|
|
6953
|
+
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
6954
|
+
/**
|
|
6955
|
+
* @remarks
|
|
6956
|
+
* Remove the last entry from the volume stack. This will
|
|
6957
|
+
* reduce the stack size by one
|
|
6958
|
+
*
|
|
6959
|
+
* This function can't be called in restricted-execution mode.
|
|
6960
|
+
*
|
|
6961
|
+
*/
|
|
6962
|
+
popVolume(): boolean;
|
|
6963
|
+
/**
|
|
6964
|
+
* @remarks
|
|
6965
|
+
* Push a volume item to the stack. The volume item contains
|
|
6966
|
+
* an 'action' parameter which determines whether this volume
|
|
6967
|
+
* is a positive or negative space.
|
|
6968
|
+
* The item also contains a `locationRelativity` which
|
|
6969
|
+
* determines whether it is relative or absolute to the
|
|
6970
|
+
* compound volume origin
|
|
6971
|
+
*
|
|
6972
|
+
* This function can't be called in restricted-execution mode.
|
|
6973
|
+
*
|
|
6974
|
+
* @param item
|
|
6975
|
+
* Item to push to the end of the stack
|
|
6976
|
+
*/
|
|
6977
|
+
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
6978
|
+
/**
|
|
6979
|
+
* @remarks
|
|
6980
|
+
* If the volume stack is empty, this function will push the
|
|
6981
|
+
* specified item to the stack.
|
|
6982
|
+
* If the volume stack is NOT empty, this function will replace
|
|
6983
|
+
* the last item on the stack with the new item.
|
|
6984
|
+
*
|
|
6985
|
+
* This function can't be called in restricted-execution mode.
|
|
6986
|
+
*
|
|
6987
|
+
* @param item
|
|
6988
|
+
* Item to add or replace
|
|
6989
|
+
*/
|
|
6990
|
+
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
6991
|
+
/**
|
|
6992
|
+
* @remarks
|
|
6993
|
+
* Set the origin of the compound volume to an absolute world
|
|
6994
|
+
* space location
|
|
6995
|
+
*
|
|
6996
|
+
* This function can't be called in restricted-execution mode.
|
|
6997
|
+
*
|
|
6998
|
+
* @param preserveExistingVolumes
|
|
6999
|
+
* This optional boolean flag determines whether the relative
|
|
7000
|
+
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
7001
|
+
* affected by the new origin.
|
|
7002
|
+
* Imagine a scenario where you have a series of relative
|
|
7003
|
+
* locations around an origin which make up a sphere; all of
|
|
7004
|
+
* these locations are in the range of -2 to 2.
|
|
7005
|
+
* Push each of these locations to the compound volume as
|
|
7006
|
+
* relative items.
|
|
7007
|
+
* Now, move the origin and all of the locations representing
|
|
7008
|
+
* the sphere move accordingly.
|
|
7009
|
+
* However, let's say you want to add a 2nd sphere next to the
|
|
7010
|
+
* 1st.
|
|
7011
|
+
* In this case, set the new origin a few locations over, but
|
|
7012
|
+
* 'preserveExistingVolumes' = true.
|
|
7013
|
+
* This will set a new origin, but the existing sphere
|
|
7014
|
+
* locations will remain relative to the original origin.
|
|
7015
|
+
* Now, you can push the relative sphere locations again (this
|
|
7016
|
+
* time they will be relative to the new origin) - resulting in
|
|
7017
|
+
* 2 spheres next to each other.
|
|
7018
|
+
*/
|
|
7019
|
+
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
7020
|
+
/**
|
|
7021
|
+
* @remarks
|
|
7022
|
+
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
7023
|
+
* function will translate the origin by a given delta to a new
|
|
7024
|
+
* position
|
|
7025
|
+
*
|
|
7026
|
+
* This function can't be called in restricted-execution mode.
|
|
7027
|
+
*
|
|
7028
|
+
* @param preserveExistingVolumes
|
|
7029
|
+
* See the description for the arguments to {@link
|
|
7030
|
+
* CompoundBlockVolume.setOrigin}
|
|
7031
|
+
*/
|
|
7032
|
+
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
7033
|
+
}
|
|
7034
|
+
|
|
6033
7035
|
/**
|
|
6034
7036
|
* Represents a container that can hold sets of items. Used
|
|
6035
7037
|
* with entities such as Players, Chest Minecarts, Llamas, and
|
|
@@ -6167,7 +7169,9 @@ export class Container {
|
|
|
6167
7169
|
*
|
|
6168
7170
|
* @param itemStack
|
|
6169
7171
|
* The stack of items to add.
|
|
6170
|
-
* @throws
|
|
7172
|
+
* @throws
|
|
7173
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7174
|
+
* limit but will instead add items up to the weight limit.
|
|
6171
7175
|
*
|
|
6172
7176
|
* {@link ContainerRulesError}
|
|
6173
7177
|
*
|
|
@@ -6405,6 +7409,8 @@ export class Container {
|
|
|
6405
7409
|
* @throws
|
|
6406
7410
|
* Throws if either this container or `toContainer` are invalid
|
|
6407
7411
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
7412
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7413
|
+
* limit but will instead add items up to the weight limit.
|
|
6408
7414
|
*
|
|
6409
7415
|
* {@link ContainerRulesError}
|
|
6410
7416
|
*
|
|
@@ -7187,6 +8193,30 @@ export class Dimension {
|
|
|
7187
8193
|
block: BlockPermutation | BlockType | string,
|
|
7188
8194
|
options?: BlockFillOptions,
|
|
7189
8195
|
): ListBlockVolume;
|
|
8196
|
+
/**
|
|
8197
|
+
* @beta
|
|
8198
|
+
* @remarks
|
|
8199
|
+
* Finds the location of the closest biome of a particular
|
|
8200
|
+
* type. Note that the findClosestBiome operation can take some
|
|
8201
|
+
* time to complete, so avoid using many of these calls within
|
|
8202
|
+
* a particular tick.
|
|
8203
|
+
*
|
|
8204
|
+
* @param pos
|
|
8205
|
+
* Starting location to look for a biome to find.
|
|
8206
|
+
* @param biomeToFind
|
|
8207
|
+
* Identifier of the biome to look for.
|
|
8208
|
+
* @param options
|
|
8209
|
+
* Additional selection criteria for a biome search.
|
|
8210
|
+
* @returns
|
|
8211
|
+
* Returns a location of the biome, or undefined if a biome
|
|
8212
|
+
* could not be found.
|
|
8213
|
+
* @throws This function can throw errors.
|
|
8214
|
+
*
|
|
8215
|
+
* {@link minecraftcommon.EngineError}
|
|
8216
|
+
*
|
|
8217
|
+
* {@link Error}
|
|
8218
|
+
*/
|
|
8219
|
+
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
7190
8220
|
/**
|
|
7191
8221
|
* @remarks
|
|
7192
8222
|
* Returns the biome type at the specified location.
|
|
@@ -7406,6 +8436,26 @@ export class Dimension {
|
|
|
7406
8436
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7407
8437
|
*/
|
|
7408
8438
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8439
|
+
/**
|
|
8440
|
+
* @beta
|
|
8441
|
+
* @remarks
|
|
8442
|
+
* Returns a vector of generated structures that contain the
|
|
8443
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
8444
|
+
* The vector will be empty if no structures are found.
|
|
8445
|
+
*
|
|
8446
|
+
* @param location
|
|
8447
|
+
* Location at which to check for structures.
|
|
8448
|
+
* @throws
|
|
8449
|
+
* An error will be thrown if the location is out of world
|
|
8450
|
+
* bounds.
|
|
8451
|
+
* An error will be thrown if the location is in an unloaded
|
|
8452
|
+
* chunk.
|
|
8453
|
+
*
|
|
8454
|
+
* {@link LocationInUnloadedChunkError}
|
|
8455
|
+
*
|
|
8456
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8457
|
+
*/
|
|
8458
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
7409
8459
|
/**
|
|
7410
8460
|
* @remarks
|
|
7411
8461
|
* Returns the total brightness level of light shining on a
|
|
@@ -7467,6 +8517,16 @@ export class Dimension {
|
|
|
7467
8517
|
* @throws This function can throw errors.
|
|
7468
8518
|
*/
|
|
7469
8519
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
8520
|
+
/**
|
|
8521
|
+
* @beta
|
|
8522
|
+
* @remarks
|
|
8523
|
+
* Returns the current weather.
|
|
8524
|
+
*
|
|
8525
|
+
* @returns
|
|
8526
|
+
* Returns a WeatherType that explains the broad category of
|
|
8527
|
+
* weather that is currently going on.
|
|
8528
|
+
*/
|
|
8529
|
+
getWeather(): WeatherType;
|
|
7470
8530
|
/**
|
|
7471
8531
|
* @remarks
|
|
7472
8532
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -7710,7 +8770,11 @@ export class Dimension {
|
|
|
7710
8770
|
* }
|
|
7711
8771
|
* ```
|
|
7712
8772
|
*/
|
|
7713
|
-
spawnEntity
|
|
8773
|
+
spawnEntity<T = never>(
|
|
8774
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
8775
|
+
location: Vector3,
|
|
8776
|
+
options?: SpawnEntityOptions,
|
|
8777
|
+
): Entity;
|
|
7714
8778
|
/**
|
|
7715
8779
|
* @remarks
|
|
7716
8780
|
* Creates a new item stack as an entity at the specified
|
|
@@ -7805,6 +8869,26 @@ export class Dimension {
|
|
|
7805
8869
|
* ```
|
|
7806
8870
|
*/
|
|
7807
8871
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
8872
|
+
/**
|
|
8873
|
+
* @beta
|
|
8874
|
+
* @remarks
|
|
8875
|
+
* Stops all sounds from playing for all players.
|
|
8876
|
+
*
|
|
8877
|
+
* This function can't be called in restricted-execution mode.
|
|
8878
|
+
*
|
|
8879
|
+
*/
|
|
8880
|
+
stopAllSounds(): void;
|
|
8881
|
+
/**
|
|
8882
|
+
* @beta
|
|
8883
|
+
* @remarks
|
|
8884
|
+
* Stops a sound from playing for all players.
|
|
8885
|
+
*
|
|
8886
|
+
* This function can't be called in restricted-execution mode.
|
|
8887
|
+
*
|
|
8888
|
+
* @param soundId
|
|
8889
|
+
* Identifier of the sound.
|
|
8890
|
+
*/
|
|
8891
|
+
stopSound(soundId: string): void;
|
|
7808
8892
|
}
|
|
7809
8893
|
|
|
7810
8894
|
/**
|
|
@@ -8329,6 +9413,18 @@ export class Entity {
|
|
|
8329
9413
|
*
|
|
8330
9414
|
*/
|
|
8331
9415
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
9416
|
+
/**
|
|
9417
|
+
* @beta
|
|
9418
|
+
* @remarks
|
|
9419
|
+
* Retrieves or sets an entity that is used as the target of
|
|
9420
|
+
* AI-related behaviors, like attacking. If the entity
|
|
9421
|
+
* currently has no target returns undefined.
|
|
9422
|
+
*
|
|
9423
|
+
* @throws This property can throw when used.
|
|
9424
|
+
*
|
|
9425
|
+
* {@link InvalidEntityError}
|
|
9426
|
+
*/
|
|
9427
|
+
readonly target?: Entity;
|
|
8332
9428
|
/**
|
|
8333
9429
|
* @remarks
|
|
8334
9430
|
* Identifier of the type of the entity - for example,
|
|
@@ -8409,6 +9505,27 @@ export class Entity {
|
|
|
8409
9505
|
* ```
|
|
8410
9506
|
*/
|
|
8411
9507
|
addEffect(effectType: EffectType | string, duration: number, options?: EntityEffectOptions): Effect | undefined;
|
|
9508
|
+
/**
|
|
9509
|
+
* @beta
|
|
9510
|
+
* @remarks
|
|
9511
|
+
* Adds an item to the entity's inventory.
|
|
9512
|
+
*
|
|
9513
|
+
* This function can't be called in restricted-execution mode.
|
|
9514
|
+
*
|
|
9515
|
+
* @returns
|
|
9516
|
+
* Returns undefined if the item was fully added or returns an
|
|
9517
|
+
* ItemStack with the remaining count.
|
|
9518
|
+
* @throws This function can throw errors.
|
|
9519
|
+
*
|
|
9520
|
+
* {@link ContainerRulesError}
|
|
9521
|
+
*
|
|
9522
|
+
* {@link Error}
|
|
9523
|
+
*
|
|
9524
|
+
* {@link InvalidEntityComponentError}
|
|
9525
|
+
*
|
|
9526
|
+
* {@link InvalidEntityError}
|
|
9527
|
+
*/
|
|
9528
|
+
addItem(itemStack: ItemStack): ItemStack | undefined;
|
|
8412
9529
|
/**
|
|
8413
9530
|
* @remarks
|
|
8414
9531
|
* Adds a specified tag to an entity.
|
|
@@ -9549,6 +10666,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
9549
10666
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
9550
10667
|
export class EntityBreathableComponent extends EntityComponent {
|
|
9551
10668
|
private constructor();
|
|
10669
|
+
/**
|
|
10670
|
+
* @beta
|
|
10671
|
+
* @remarks
|
|
10672
|
+
* The current air supply of the entity.
|
|
10673
|
+
*
|
|
10674
|
+
* This property can't be edited in restricted-execution mode.
|
|
10675
|
+
*
|
|
10676
|
+
* @throws
|
|
10677
|
+
* Will throw an error if the air supply is out of bounds
|
|
10678
|
+
* [suffocationTime, maxAirSupply].
|
|
10679
|
+
*/
|
|
10680
|
+
airSupply: number;
|
|
9552
10681
|
/**
|
|
9553
10682
|
* @remarks
|
|
9554
10683
|
* If true, this entity can breathe in air.
|
|
@@ -9577,6 +10706,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
9577
10706
|
* @throws This property can throw when used.
|
|
9578
10707
|
*/
|
|
9579
10708
|
readonly breathesWater: boolean;
|
|
10709
|
+
/**
|
|
10710
|
+
* @beta
|
|
10711
|
+
* @remarks
|
|
10712
|
+
* If true, the entity is able to breathe.
|
|
10713
|
+
*
|
|
10714
|
+
* @throws This property can throw when used.
|
|
10715
|
+
*/
|
|
10716
|
+
readonly canBreathe: boolean;
|
|
9580
10717
|
/**
|
|
9581
10718
|
* @remarks
|
|
9582
10719
|
* If true, this entity will have visible bubbles while in
|
|
@@ -9678,36 +10815,136 @@ export class EntityColor2Component extends EntityComponent {
|
|
|
9678
10815
|
* that have predefined color values (e.g., sheep, llama,
|
|
9679
10816
|
* shulker).
|
|
9680
10817
|
*/
|
|
9681
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
9682
|
-
export class EntityColorComponent extends EntityComponent {
|
|
10818
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10819
|
+
export class EntityColorComponent extends EntityComponent {
|
|
10820
|
+
private constructor();
|
|
10821
|
+
/**
|
|
10822
|
+
* @remarks
|
|
10823
|
+
* Value of this particular color.
|
|
10824
|
+
*
|
|
10825
|
+
* This property can't be edited in restricted-execution mode.
|
|
10826
|
+
*
|
|
10827
|
+
*/
|
|
10828
|
+
value: number;
|
|
10829
|
+
static readonly componentId = 'minecraft:color';
|
|
10830
|
+
}
|
|
10831
|
+
|
|
10832
|
+
/**
|
|
10833
|
+
* Base class for downstream entity components.
|
|
10834
|
+
*/
|
|
10835
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10836
|
+
export class EntityComponent extends Component {
|
|
10837
|
+
private constructor();
|
|
10838
|
+
/**
|
|
10839
|
+
* @remarks
|
|
10840
|
+
* The entity that owns this component. The entity will be
|
|
10841
|
+
* undefined if it has been removed.
|
|
10842
|
+
*
|
|
10843
|
+
* @throws This property can throw when used.
|
|
10844
|
+
*
|
|
10845
|
+
* {@link InvalidEntityError}
|
|
10846
|
+
*/
|
|
10847
|
+
readonly entity: Entity;
|
|
10848
|
+
}
|
|
10849
|
+
|
|
10850
|
+
/**
|
|
10851
|
+
* @beta
|
|
10852
|
+
* Contains information regarding a specific entity container
|
|
10853
|
+
* being closed.
|
|
10854
|
+
*/
|
|
10855
|
+
export class EntityContainerClosedAfterEvent {
|
|
10856
|
+
private constructor();
|
|
10857
|
+
/**
|
|
10858
|
+
* @remarks
|
|
10859
|
+
* The source of the entity container being closed.
|
|
10860
|
+
*
|
|
10861
|
+
*/
|
|
10862
|
+
readonly closeSource: ContainerAccessSource;
|
|
10863
|
+
readonly entity: Entity;
|
|
10864
|
+
}
|
|
10865
|
+
|
|
10866
|
+
/**
|
|
10867
|
+
* @beta
|
|
10868
|
+
* Manages callbacks that are connected to when an entity
|
|
10869
|
+
* container is closed.
|
|
10870
|
+
*/
|
|
10871
|
+
export class EntityContainerClosedAfterEventSignal {
|
|
10872
|
+
private constructor();
|
|
10873
|
+
/**
|
|
10874
|
+
* @remarks
|
|
10875
|
+
* Adds a callback that will be called when an entity container
|
|
10876
|
+
* is closed.
|
|
10877
|
+
*
|
|
10878
|
+
* This function can't be called in restricted-execution mode.
|
|
10879
|
+
*
|
|
10880
|
+
* This function can be called in early-execution mode.
|
|
10881
|
+
*
|
|
10882
|
+
*/
|
|
10883
|
+
subscribe(
|
|
10884
|
+
callback: (arg0: EntityContainerClosedAfterEvent) => void,
|
|
10885
|
+
options?: EntityContainerAccessEventOptions,
|
|
10886
|
+
): (arg0: EntityContainerClosedAfterEvent) => void;
|
|
10887
|
+
/**
|
|
10888
|
+
* @remarks
|
|
10889
|
+
* Removes a callback from being called when an entity
|
|
10890
|
+
* container is closed.
|
|
10891
|
+
*
|
|
10892
|
+
* This function can't be called in restricted-execution mode.
|
|
10893
|
+
*
|
|
10894
|
+
* This function can be called in early-execution mode.
|
|
10895
|
+
*
|
|
10896
|
+
*/
|
|
10897
|
+
unsubscribe(callback: (arg0: EntityContainerClosedAfterEvent) => void): void;
|
|
10898
|
+
}
|
|
10899
|
+
|
|
10900
|
+
/**
|
|
10901
|
+
* @beta
|
|
10902
|
+
* Contains information regarding a specific entity container
|
|
10903
|
+
* being opened.
|
|
10904
|
+
*/
|
|
10905
|
+
export class EntityContainerOpenedAfterEvent {
|
|
9683
10906
|
private constructor();
|
|
10907
|
+
readonly entity: Entity;
|
|
9684
10908
|
/**
|
|
9685
10909
|
* @remarks
|
|
9686
|
-
*
|
|
9687
|
-
*
|
|
9688
|
-
* This property can't be edited in restricted-execution mode.
|
|
10910
|
+
* The source of the entity container being opened.
|
|
9689
10911
|
*
|
|
9690
10912
|
*/
|
|
9691
|
-
|
|
9692
|
-
static readonly componentId = 'minecraft:color';
|
|
10913
|
+
readonly openSource: ContainerAccessSource;
|
|
9693
10914
|
}
|
|
9694
10915
|
|
|
9695
10916
|
/**
|
|
9696
|
-
*
|
|
10917
|
+
* @beta
|
|
10918
|
+
* Manages callbacks that are connected to when an entity
|
|
10919
|
+
* container is opened.
|
|
9697
10920
|
*/
|
|
9698
|
-
|
|
9699
|
-
export class EntityComponent extends Component {
|
|
10921
|
+
export class EntityContainerOpenedAfterEventSignal {
|
|
9700
10922
|
private constructor();
|
|
9701
10923
|
/**
|
|
9702
10924
|
* @remarks
|
|
9703
|
-
*
|
|
9704
|
-
*
|
|
10925
|
+
* Adds a callback that will be called when an entity container
|
|
10926
|
+
* is opened.
|
|
9705
10927
|
*
|
|
9706
|
-
*
|
|
10928
|
+
* This function can't be called in restricted-execution mode.
|
|
10929
|
+
*
|
|
10930
|
+
* This function can be called in early-execution mode.
|
|
9707
10931
|
*
|
|
9708
|
-
* {@link InvalidEntityError}
|
|
9709
10932
|
*/
|
|
9710
|
-
|
|
10933
|
+
subscribe(
|
|
10934
|
+
callback: (arg0: EntityContainerOpenedAfterEvent) => void,
|
|
10935
|
+
options?: EntityContainerAccessEventOptions,
|
|
10936
|
+
): (arg0: EntityContainerOpenedAfterEvent) => void;
|
|
10937
|
+
/**
|
|
10938
|
+
* @remarks
|
|
10939
|
+
* Removes a callback from being called when an entity
|
|
10940
|
+
* container is opened.
|
|
10941
|
+
*
|
|
10942
|
+
* This function can't be called in restricted-execution mode.
|
|
10943
|
+
*
|
|
10944
|
+
* This function can be called in early-execution mode.
|
|
10945
|
+
*
|
|
10946
|
+
*/
|
|
10947
|
+
unsubscribe(callback: (arg0: EntityContainerOpenedAfterEvent) => void): void;
|
|
9711
10948
|
}
|
|
9712
10949
|
|
|
9713
10950
|
/**
|
|
@@ -9803,6 +11040,29 @@ export class EntityDieAfterEventSignal {
|
|
|
9803
11040
|
unsubscribe(callback: (arg0: EntityDieAfterEvent) => void): void;
|
|
9804
11041
|
}
|
|
9805
11042
|
|
|
11043
|
+
/**
|
|
11044
|
+
* @beta
|
|
11045
|
+
* Represents this entity's ender inventory properties. This
|
|
11046
|
+
* component is always present on players and any items in its
|
|
11047
|
+
* container will display for the player when they access an
|
|
11048
|
+
* ender chest.
|
|
11049
|
+
*/
|
|
11050
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11051
|
+
export class EntityEnderInventoryComponent extends EntityComponent {
|
|
11052
|
+
private constructor();
|
|
11053
|
+
/**
|
|
11054
|
+
* @remarks
|
|
11055
|
+
* Defines the ender inventory container for this entity. The
|
|
11056
|
+
* container will be undefined if the entity has been removed.
|
|
11057
|
+
*
|
|
11058
|
+
* @throws This property can throw when used.
|
|
11059
|
+
*
|
|
11060
|
+
* {@link InvalidEntityError}
|
|
11061
|
+
*/
|
|
11062
|
+
readonly container: Container;
|
|
11063
|
+
static readonly componentId = 'minecraft:ender_inventory';
|
|
11064
|
+
}
|
|
11065
|
+
|
|
9806
11066
|
/**
|
|
9807
11067
|
* Provides access to a mob's equipment slots. This component
|
|
9808
11068
|
* exists on player entities.
|
|
@@ -11409,6 +12669,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
11409
12669
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
11410
12670
|
}
|
|
11411
12671
|
|
|
12672
|
+
/**
|
|
12673
|
+
* @beta
|
|
12674
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
12675
|
+
* name, and dialogue interactions.
|
|
12676
|
+
*/
|
|
12677
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12678
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
12679
|
+
private constructor();
|
|
12680
|
+
/**
|
|
12681
|
+
* @remarks
|
|
12682
|
+
* The DialogueScene that is opened when players first interact
|
|
12683
|
+
* with the NPC.
|
|
12684
|
+
*
|
|
12685
|
+
* This property can't be edited in restricted-execution mode.
|
|
12686
|
+
*
|
|
12687
|
+
*/
|
|
12688
|
+
defaultScene: string;
|
|
12689
|
+
/**
|
|
12690
|
+
* @remarks
|
|
12691
|
+
* The name of the NPC as it is displayed to players.
|
|
12692
|
+
*
|
|
12693
|
+
* This property can't be edited in restricted-execution mode.
|
|
12694
|
+
*
|
|
12695
|
+
*/
|
|
12696
|
+
name: string;
|
|
12697
|
+
/**
|
|
12698
|
+
* @remarks
|
|
12699
|
+
* The index of the skin the NPC will use.
|
|
12700
|
+
*
|
|
12701
|
+
* This property can't be edited in restricted-execution mode.
|
|
12702
|
+
*
|
|
12703
|
+
*/
|
|
12704
|
+
skinIndex: number;
|
|
12705
|
+
static readonly componentId = 'minecraft:npc';
|
|
12706
|
+
}
|
|
12707
|
+
|
|
11412
12708
|
/**
|
|
11413
12709
|
* When present on an entity, this entity is on fire.
|
|
11414
12710
|
* @example setOnFire.ts
|
|
@@ -12280,7 +13576,7 @@ export class EntityTypes {
|
|
|
12280
13576
|
* Retrieves an entity type using a string-based identifier.
|
|
12281
13577
|
*
|
|
12282
13578
|
*/
|
|
12283
|
-
static get(identifier:
|
|
13579
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
12284
13580
|
/**
|
|
12285
13581
|
* @remarks
|
|
12286
13582
|
* Retrieves a set of all entity types within this world.
|
|
@@ -12327,6 +13623,51 @@ export class EntityWantsJockeyComponent extends EntityComponent {
|
|
|
12327
13623
|
static readonly componentId = 'minecraft:wants_jockey';
|
|
12328
13624
|
}
|
|
12329
13625
|
|
|
13626
|
+
/**
|
|
13627
|
+
* @beta
|
|
13628
|
+
* Waypoint that tracks an entity's position. The waypoint
|
|
13629
|
+
* automatically updates as the entity moves and becomes
|
|
13630
|
+
* invalid when the entity is removed.
|
|
13631
|
+
*/
|
|
13632
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13633
|
+
export class EntityWaypoint extends Waypoint {
|
|
13634
|
+
/**
|
|
13635
|
+
* @remarks
|
|
13636
|
+
* The entity being tracked by this waypoint.
|
|
13637
|
+
*
|
|
13638
|
+
* @throws This property can throw when used.
|
|
13639
|
+
*
|
|
13640
|
+
* {@link InvalidWaypointError}
|
|
13641
|
+
*
|
|
13642
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
13643
|
+
*/
|
|
13644
|
+
readonly entity: Entity;
|
|
13645
|
+
/**
|
|
13646
|
+
* @remarks
|
|
13647
|
+
* The visibility rules that control when the waypoint is shown
|
|
13648
|
+
* based on the entity's state (e.g., sneaking, invisible,
|
|
13649
|
+
* dead).
|
|
13650
|
+
*
|
|
13651
|
+
* @throws This property can throw when used.
|
|
13652
|
+
*
|
|
13653
|
+
* {@link InvalidWaypointError}
|
|
13654
|
+
*
|
|
13655
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
13656
|
+
*/
|
|
13657
|
+
readonly entityRules: EntityVisibilityRules;
|
|
13658
|
+
/**
|
|
13659
|
+
* @throws This function can throw errors.
|
|
13660
|
+
*
|
|
13661
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
13662
|
+
*/
|
|
13663
|
+
constructor(
|
|
13664
|
+
entity: Entity,
|
|
13665
|
+
textureSelector: WaypointTextureSelector,
|
|
13666
|
+
entityRules: EntityVisibilityRules,
|
|
13667
|
+
color?: RGB,
|
|
13668
|
+
);
|
|
13669
|
+
}
|
|
13670
|
+
|
|
12330
13671
|
/**
|
|
12331
13672
|
* Loot item function that modifies a dropped treasure map to
|
|
12332
13673
|
* mark a location.
|
|
@@ -12746,6 +14087,13 @@ export class GameRules {
|
|
|
12746
14087
|
*
|
|
12747
14088
|
*/
|
|
12748
14089
|
keepInventory: boolean;
|
|
14090
|
+
/**
|
|
14091
|
+
* @beta
|
|
14092
|
+
* @remarks
|
|
14093
|
+
* This property can't be edited in restricted-execution mode.
|
|
14094
|
+
*
|
|
14095
|
+
*/
|
|
14096
|
+
locatorBar: boolean;
|
|
12749
14097
|
/**
|
|
12750
14098
|
* @remarks
|
|
12751
14099
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -15077,6 +16425,175 @@ export class ListBlockVolume extends BlockVolumeBase {
|
|
|
15077
16425
|
remove(locations: Vector3[]): void;
|
|
15078
16426
|
}
|
|
15079
16427
|
|
|
16428
|
+
/**
|
|
16429
|
+
* @beta
|
|
16430
|
+
* Waypoint that points to a fixed location in the world.
|
|
16431
|
+
* Unlike entity waypoints, location waypoints always remain
|
|
16432
|
+
* valid and their position can be updated.
|
|
16433
|
+
*/
|
|
16434
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
16435
|
+
export class LocationWaypoint extends Waypoint {
|
|
16436
|
+
/**
|
|
16437
|
+
* @throws This function can throw errors.
|
|
16438
|
+
*
|
|
16439
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
16440
|
+
*/
|
|
16441
|
+
constructor(dimensionLocation: DimensionLocation, textureSelector: WaypointTextureSelector, color?: RGB);
|
|
16442
|
+
/**
|
|
16443
|
+
* @remarks
|
|
16444
|
+
* Updates the dimension and location that this waypoint points
|
|
16445
|
+
* to.
|
|
16446
|
+
*
|
|
16447
|
+
* This function can't be called in restricted-execution mode.
|
|
16448
|
+
*
|
|
16449
|
+
* @param dimensionLocation
|
|
16450
|
+
* The new {@link DimensionLocation} (dimension and
|
|
16451
|
+
* coordinates) for the waypoint.
|
|
16452
|
+
*/
|
|
16453
|
+
setDimensionLocation(dimensionLocation: DimensionLocation): void;
|
|
16454
|
+
}
|
|
16455
|
+
|
|
16456
|
+
/**
|
|
16457
|
+
* @beta
|
|
16458
|
+
* Manages the collection of waypoints displayed on a player's
|
|
16459
|
+
* locator bar. Allows adding, removing, and querying waypoints
|
|
16460
|
+
* with a maximum capacity limit.
|
|
16461
|
+
*
|
|
16462
|
+
* Invalid waypoints in the locator bar will be automatically
|
|
16463
|
+
* removed in the next tick. This includes waypoints tied to
|
|
16464
|
+
* entities that have been removed from the world.
|
|
16465
|
+
*
|
|
16466
|
+
* Note: You can control whether vanilla player waypoints are
|
|
16467
|
+
* automatically added to the locator bar using the
|
|
16468
|
+
* `locatorbar` {@link GameRule}. This game rule is currently
|
|
16469
|
+
* named `locatorbar` but will likely be renamed in a future
|
|
16470
|
+
* update to be more descriptive.
|
|
16471
|
+
*
|
|
16472
|
+
* Note: You can only modify, remove, or query waypoints that
|
|
16473
|
+
* were added by this pack.
|
|
16474
|
+
* @example sharedWaypoint.ts
|
|
16475
|
+
* ```typescript
|
|
16476
|
+
* /\*
|
|
16477
|
+
* import { world, LocationWaypoint, WaypointTextureSelector, WaypointTexture } from "@minecraft/server"
|
|
16478
|
+
*
|
|
16479
|
+
* function sharedWaypoint() {
|
|
16480
|
+
* const players = world.getAllPlayers();
|
|
16481
|
+
*
|
|
16482
|
+
* if (players.length < 2) {
|
|
16483
|
+
* console.warn("Need at least 2 players for this example.");
|
|
16484
|
+
* return;
|
|
16485
|
+
* }
|
|
16486
|
+
*
|
|
16487
|
+
* const playerA = players[0];
|
|
16488
|
+
* const playerB = players[1];
|
|
16489
|
+
*
|
|
16490
|
+
* // Create a single waypoint at a specific location
|
|
16491
|
+
* const textureSelector: WaypointTextureSelector = {
|
|
16492
|
+
* textureBoundsList: [
|
|
16493
|
+
* { lowerBound: 0, texture: WaypointTexture.Circle }
|
|
16494
|
+
* ]
|
|
16495
|
+
* };
|
|
16496
|
+
*
|
|
16497
|
+
* const waypoint = new LocationWaypoint(
|
|
16498
|
+
* { dimension: playerA.dimension, x: 100, y: 64, z: 100 },
|
|
16499
|
+
* textureSelector,
|
|
16500
|
+
* { red: 1, green: 0, blue: 0 } // Initially red
|
|
16501
|
+
* );
|
|
16502
|
+
*
|
|
16503
|
+
* // Add the same waypoint to both players' locator bars
|
|
16504
|
+
* playerA.locatorBar.addWaypoint(waypoint);
|
|
16505
|
+
* playerB.locatorBar.addWaypoint(waypoint);
|
|
16506
|
+
*
|
|
16507
|
+
* // Change the color - this affects both players
|
|
16508
|
+
* waypoint.color = { red: 0, green: 1, blue: 0 }; // Now green for both players
|
|
16509
|
+
* }
|
|
16510
|
+
* *\/
|
|
16511
|
+
* ```
|
|
16512
|
+
*/
|
|
16513
|
+
export class LocatorBar {
|
|
16514
|
+
private constructor();
|
|
16515
|
+
/**
|
|
16516
|
+
* @remarks
|
|
16517
|
+
* The current number of waypoints in the locator bar.
|
|
16518
|
+
*
|
|
16519
|
+
*/
|
|
16520
|
+
readonly count: number;
|
|
16521
|
+
/**
|
|
16522
|
+
* @remarks
|
|
16523
|
+
* The maximum number of waypoints that can be added to the
|
|
16524
|
+
* locator bar.
|
|
16525
|
+
*
|
|
16526
|
+
*/
|
|
16527
|
+
readonly maxCount: number;
|
|
16528
|
+
/**
|
|
16529
|
+
* @remarks
|
|
16530
|
+
* Adds a waypoint to the locator bar. Throws an error if the
|
|
16531
|
+
* waypoint already exists, the maximum waypoint limit has been
|
|
16532
|
+
* reached, or the waypoint is invalid.
|
|
16533
|
+
*
|
|
16534
|
+
* This function can't be called in restricted-execution mode.
|
|
16535
|
+
*
|
|
16536
|
+
* @param waypoint
|
|
16537
|
+
* The {@link Waypoint} to add to the locator bar.
|
|
16538
|
+
* @throws This function can throw errors.
|
|
16539
|
+
*
|
|
16540
|
+
* {@link minecraftcommon.EngineError}
|
|
16541
|
+
*
|
|
16542
|
+
* {@link InvalidWaypointError}
|
|
16543
|
+
*
|
|
16544
|
+
* {@link LocatorBarError}
|
|
16545
|
+
*/
|
|
16546
|
+
addWaypoint(waypoint: Waypoint): void;
|
|
16547
|
+
/**
|
|
16548
|
+
* @remarks
|
|
16549
|
+
* Returns an array of all waypoints currently in the locator
|
|
16550
|
+
* bar.
|
|
16551
|
+
*
|
|
16552
|
+
* This function can't be called in restricted-execution mode.
|
|
16553
|
+
*
|
|
16554
|
+
*/
|
|
16555
|
+
getAllWaypoints(): Waypoint[];
|
|
16556
|
+
/**
|
|
16557
|
+
* @remarks
|
|
16558
|
+
* Checks whether the specified waypoint exists in the locator
|
|
16559
|
+
* bar.
|
|
16560
|
+
*
|
|
16561
|
+
* This function can't be called in restricted-execution mode.
|
|
16562
|
+
*
|
|
16563
|
+
* @param waypoint
|
|
16564
|
+
* The {@link Waypoint} to check for.
|
|
16565
|
+
*/
|
|
16566
|
+
hasWaypoint(waypoint: Waypoint): boolean;
|
|
16567
|
+
/**
|
|
16568
|
+
* @remarks
|
|
16569
|
+
* Removes all waypoints from the locator bar, clearing it
|
|
16570
|
+
* completely.
|
|
16571
|
+
*
|
|
16572
|
+
* This function can't be called in restricted-execution mode.
|
|
16573
|
+
*
|
|
16574
|
+
* @throws This function can throw errors.
|
|
16575
|
+
*
|
|
16576
|
+
* {@link minecraftcommon.EngineError}
|
|
16577
|
+
*/
|
|
16578
|
+
removeAllWaypoints(): void;
|
|
16579
|
+
/**
|
|
16580
|
+
* @remarks
|
|
16581
|
+
* Removes a specific waypoint from the locator bar. Returns an
|
|
16582
|
+
* error if the waypoint does not exist in the locator bar.
|
|
16583
|
+
*
|
|
16584
|
+
* This function can't be called in restricted-execution mode.
|
|
16585
|
+
*
|
|
16586
|
+
* @param waypoint
|
|
16587
|
+
* The {@link Waypoint} to remove from the locator bar.
|
|
16588
|
+
* @throws This function can throw errors.
|
|
16589
|
+
*
|
|
16590
|
+
* {@link minecraftcommon.EngineError}
|
|
16591
|
+
*
|
|
16592
|
+
* {@link LocatorBarError}
|
|
16593
|
+
*/
|
|
16594
|
+
removeWaypoint(waypoint: Waypoint): void;
|
|
16595
|
+
}
|
|
16596
|
+
|
|
15080
16597
|
/**
|
|
15081
16598
|
* Loot item function that drops extra items if the provided
|
|
15082
16599
|
* tool has the looting enchant.
|
|
@@ -15455,6 +16972,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
15455
16972
|
readonly itemTagsNone: string[];
|
|
15456
16973
|
}
|
|
15457
16974
|
|
|
16975
|
+
/**
|
|
16976
|
+
* @beta
|
|
16977
|
+
* A specific currently-internal event used for passing
|
|
16978
|
+
* messages from client to server.
|
|
16979
|
+
*/
|
|
16980
|
+
export class MessageReceiveAfterEvent {
|
|
16981
|
+
private constructor();
|
|
16982
|
+
/**
|
|
16983
|
+
* @remarks
|
|
16984
|
+
* The message identifier.
|
|
16985
|
+
*
|
|
16986
|
+
*/
|
|
16987
|
+
readonly id: string;
|
|
16988
|
+
/**
|
|
16989
|
+
* @remarks
|
|
16990
|
+
* The message.
|
|
16991
|
+
*
|
|
16992
|
+
*/
|
|
16993
|
+
readonly message: string;
|
|
16994
|
+
/**
|
|
16995
|
+
* @remarks
|
|
16996
|
+
* The player who sent the message.
|
|
16997
|
+
*
|
|
16998
|
+
*/
|
|
16999
|
+
readonly player: Player;
|
|
17000
|
+
}
|
|
17001
|
+
|
|
15458
17002
|
/**
|
|
15459
17003
|
* Contains a set of additional variable values for further
|
|
15460
17004
|
* defining how rendering and animations function.
|
|
@@ -15523,6 +17067,49 @@ export class MolangVariableMap {
|
|
|
15523
17067
|
setVector3(variableName: string, vector: Vector3): void;
|
|
15524
17068
|
}
|
|
15525
17069
|
|
|
17070
|
+
/**
|
|
17071
|
+
* @beta
|
|
17072
|
+
* Pack setting name and value that changed.
|
|
17073
|
+
*/
|
|
17074
|
+
export class PackSettingChangeAfterEvent {
|
|
17075
|
+
private constructor();
|
|
17076
|
+
/**
|
|
17077
|
+
* @remarks
|
|
17078
|
+
* The name of the setting.
|
|
17079
|
+
*
|
|
17080
|
+
*/
|
|
17081
|
+
readonly settingName: string;
|
|
17082
|
+
/**
|
|
17083
|
+
* @remarks
|
|
17084
|
+
* The value of the setting.
|
|
17085
|
+
*
|
|
17086
|
+
*/
|
|
17087
|
+
readonly settingValue: boolean | number | string;
|
|
17088
|
+
}
|
|
17089
|
+
|
|
17090
|
+
/**
|
|
17091
|
+
* @beta
|
|
17092
|
+
*/
|
|
17093
|
+
export class PackSettingChangeAfterEventSignal {
|
|
17094
|
+
private constructor();
|
|
17095
|
+
/**
|
|
17096
|
+
* @remarks
|
|
17097
|
+
* This function can't be called in restricted-execution mode.
|
|
17098
|
+
*
|
|
17099
|
+
* This function can be called in early-execution mode.
|
|
17100
|
+
*
|
|
17101
|
+
*/
|
|
17102
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
17103
|
+
/**
|
|
17104
|
+
* @remarks
|
|
17105
|
+
* This function can't be called in restricted-execution mode.
|
|
17106
|
+
*
|
|
17107
|
+
* This function can be called in early-execution mode.
|
|
17108
|
+
*
|
|
17109
|
+
*/
|
|
17110
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
17111
|
+
}
|
|
17112
|
+
|
|
15526
17113
|
/**
|
|
15527
17114
|
* Loot item condition that checks whether the looting entity
|
|
15528
17115
|
* is currently a passenger of a specific type of entity.
|
|
@@ -15764,6 +17351,14 @@ export class Player extends Entity {
|
|
|
15764
17351
|
* @throws This property can throw when used.
|
|
15765
17352
|
*/
|
|
15766
17353
|
readonly level: number;
|
|
17354
|
+
/**
|
|
17355
|
+
* @beta
|
|
17356
|
+
* @remarks
|
|
17357
|
+
* The player's Locator Bar. This property is used for managing
|
|
17358
|
+
* waypoints displayed on the HUD.
|
|
17359
|
+
*
|
|
17360
|
+
*/
|
|
17361
|
+
readonly locatorBar: LocatorBar;
|
|
15767
17362
|
/**
|
|
15768
17363
|
* @remarks
|
|
15769
17364
|
* Name of the player.
|
|
@@ -15779,6 +17374,13 @@ export class Player extends Entity {
|
|
|
15779
17374
|
* @throws This property can throw when used.
|
|
15780
17375
|
*/
|
|
15781
17376
|
readonly onScreenDisplay: ScreenDisplay;
|
|
17377
|
+
/**
|
|
17378
|
+
* @beta
|
|
17379
|
+
* @throws This property can throw when used.
|
|
17380
|
+
*
|
|
17381
|
+
* {@link InvalidEntityError}
|
|
17382
|
+
*/
|
|
17383
|
+
readonly partyId?: string;
|
|
15782
17384
|
/**
|
|
15783
17385
|
* @throws This property can throw when used.
|
|
15784
17386
|
*
|
|
@@ -15849,9 +17451,23 @@ export class Player extends Entity {
|
|
|
15849
17451
|
* The Entity or the ID of the Entity whose Entity Property
|
|
15850
17452
|
* overrides are being cleared.
|
|
15851
17453
|
* @throws
|
|
15852
|
-
* Throws if the Entity or Entity ID is invalid.
|
|
17454
|
+
* Throws if the Entity or Entity ID is invalid.
|
|
17455
|
+
*/
|
|
17456
|
+
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
17457
|
+
/**
|
|
17458
|
+
* @beta
|
|
17459
|
+
* @remarks
|
|
17460
|
+
* Eats an item, providing the item's hunger and saturation
|
|
17461
|
+
* effects to the player. Can only be used on food items.
|
|
17462
|
+
*
|
|
17463
|
+
* This function can't be called in restricted-execution mode.
|
|
17464
|
+
*
|
|
17465
|
+
* @param itemStack
|
|
17466
|
+
* The item to eat.
|
|
17467
|
+
* @throws
|
|
17468
|
+
* Throws if the item is not a food item.
|
|
15853
17469
|
*/
|
|
15854
|
-
|
|
17470
|
+
eatItem(itemStack: ItemStack): void;
|
|
15855
17471
|
/**
|
|
15856
17472
|
* @remarks
|
|
15857
17473
|
* The player's aim-assist settings.
|
|
@@ -15952,6 +17568,17 @@ export class Player extends Entity {
|
|
|
15952
17568
|
* ```
|
|
15953
17569
|
*/
|
|
15954
17570
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
|
|
17571
|
+
/**
|
|
17572
|
+
* @beta
|
|
17573
|
+
* @remarks
|
|
17574
|
+
* This is an internal-facing method for posting a system
|
|
17575
|
+
* message to downstream clients.
|
|
17576
|
+
*
|
|
17577
|
+
* This function can't be called in restricted-execution mode.
|
|
17578
|
+
*
|
|
17579
|
+
* @throws This function can throw errors.
|
|
17580
|
+
*/
|
|
17581
|
+
postClientMessage(id: string, value: string): void;
|
|
15955
17582
|
/**
|
|
15956
17583
|
* @remarks
|
|
15957
17584
|
* Queues an additional music track that only this particular
|
|
@@ -16227,6 +17854,18 @@ export class Player extends Entity {
|
|
|
16227
17854
|
* @throws This function can throw errors.
|
|
16228
17855
|
*/
|
|
16229
17856
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
17857
|
+
/**
|
|
17858
|
+
* @beta
|
|
17859
|
+
* @remarks
|
|
17860
|
+
* Stops all sounds from playing for this particular player.
|
|
17861
|
+
*
|
|
17862
|
+
* This function can't be called in restricted-execution mode.
|
|
17863
|
+
*
|
|
17864
|
+
* @throws This function can throw errors.
|
|
17865
|
+
*
|
|
17866
|
+
* {@link InvalidEntityError}
|
|
17867
|
+
*/
|
|
17868
|
+
stopAllSounds(): void;
|
|
16230
17869
|
/**
|
|
16231
17870
|
* @remarks
|
|
16232
17871
|
* Stops any music tracks from playing for this particular
|
|
@@ -16237,6 +17876,20 @@ export class Player extends Entity {
|
|
|
16237
17876
|
* @throws This function can throw errors.
|
|
16238
17877
|
*/
|
|
16239
17878
|
stopMusic(): void;
|
|
17879
|
+
/**
|
|
17880
|
+
* @beta
|
|
17881
|
+
* @remarks
|
|
17882
|
+
* Stops a sound from playing for this particular player.
|
|
17883
|
+
*
|
|
17884
|
+
* This function can't be called in restricted-execution mode.
|
|
17885
|
+
*
|
|
17886
|
+
* @param soundId
|
|
17887
|
+
* Identifier of the sound.
|
|
17888
|
+
* @throws This function can throw errors.
|
|
17889
|
+
*
|
|
17890
|
+
* {@link InvalidEntityError}
|
|
17891
|
+
*/
|
|
17892
|
+
stopSound(soundId: string): void;
|
|
16240
17893
|
}
|
|
16241
17894
|
|
|
16242
17895
|
/**
|
|
@@ -17521,6 +19174,88 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
17521
19174
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
17522
19175
|
}
|
|
17523
19176
|
|
|
19177
|
+
/**
|
|
19178
|
+
* @beta
|
|
19179
|
+
* Contains information regarding an event before a player
|
|
19180
|
+
* places a block.
|
|
19181
|
+
*/
|
|
19182
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19183
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
19184
|
+
private constructor();
|
|
19185
|
+
/**
|
|
19186
|
+
* @remarks
|
|
19187
|
+
* If set to true, cancels the block place event.
|
|
19188
|
+
*
|
|
19189
|
+
*/
|
|
19190
|
+
cancel: boolean;
|
|
19191
|
+
/**
|
|
19192
|
+
* @remarks
|
|
19193
|
+
* The face of the block that the new block is being placed on.
|
|
19194
|
+
*
|
|
19195
|
+
*/
|
|
19196
|
+
readonly face: Direction;
|
|
19197
|
+
/**
|
|
19198
|
+
* @remarks
|
|
19199
|
+
* Location relative to the bottom north-west corner of the
|
|
19200
|
+
* block where the new block is being placed onto.
|
|
19201
|
+
*
|
|
19202
|
+
*/
|
|
19203
|
+
readonly faceLocation: Vector3;
|
|
19204
|
+
/**
|
|
19205
|
+
* @remarks
|
|
19206
|
+
* The block permutation that will be placed if the event is
|
|
19207
|
+
* not cancelled.
|
|
19208
|
+
*
|
|
19209
|
+
*/
|
|
19210
|
+
readonly permutationToPlace: BlockPermutation;
|
|
19211
|
+
/**
|
|
19212
|
+
* @remarks
|
|
19213
|
+
* Player that is placing the block for this event.
|
|
19214
|
+
*
|
|
19215
|
+
*/
|
|
19216
|
+
readonly player: Player;
|
|
19217
|
+
}
|
|
19218
|
+
|
|
19219
|
+
/**
|
|
19220
|
+
* @beta
|
|
19221
|
+
* Manages callbacks that are connected to before a block is
|
|
19222
|
+
* placed by a player.
|
|
19223
|
+
*/
|
|
19224
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
19225
|
+
private constructor();
|
|
19226
|
+
/**
|
|
19227
|
+
* @remarks
|
|
19228
|
+
* Adds a callback that will be called before a block is placed
|
|
19229
|
+
* by a player.
|
|
19230
|
+
*
|
|
19231
|
+
* This function can't be called in restricted-execution mode.
|
|
19232
|
+
*
|
|
19233
|
+
* This function can be called in early-execution mode.
|
|
19234
|
+
*
|
|
19235
|
+
* @param callback
|
|
19236
|
+
* This closure is called with restricted-execution privilege.
|
|
19237
|
+
* @returns
|
|
19238
|
+
* Closure that is called with restricted-execution privilege.
|
|
19239
|
+
*/
|
|
19240
|
+
subscribe(
|
|
19241
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
19242
|
+
options?: BlockEventOptions,
|
|
19243
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
19244
|
+
/**
|
|
19245
|
+
* @remarks
|
|
19246
|
+
* Removes a callback from being called before an block is
|
|
19247
|
+
* placed by a player.
|
|
19248
|
+
*
|
|
19249
|
+
* This function can't be called in restricted-execution mode.
|
|
19250
|
+
*
|
|
19251
|
+
* This function can be called in early-execution mode.
|
|
19252
|
+
*
|
|
19253
|
+
* @param callback
|
|
19254
|
+
* This closure is called with restricted-execution privilege.
|
|
19255
|
+
*/
|
|
19256
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
19257
|
+
}
|
|
19258
|
+
|
|
17524
19259
|
/**
|
|
17525
19260
|
* An event that contains more information about a player
|
|
17526
19261
|
* spawning.
|
|
@@ -17639,6 +19374,114 @@ export class PlayerSwingStartAfterEventSignal {
|
|
|
17639
19374
|
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
17640
19375
|
}
|
|
17641
19376
|
|
|
19377
|
+
/**
|
|
19378
|
+
* @beta
|
|
19379
|
+
* Contains information related to when a player successfully
|
|
19380
|
+
* names an Entity with a named Name Tag item.
|
|
19381
|
+
*/
|
|
19382
|
+
export class PlayerUseNameTagAfterEvent {
|
|
19383
|
+
private constructor();
|
|
19384
|
+
/**
|
|
19385
|
+
* @remarks
|
|
19386
|
+
* The entity that was named by the player.
|
|
19387
|
+
*
|
|
19388
|
+
* This property can't be edited in restricted-execution mode.
|
|
19389
|
+
*
|
|
19390
|
+
*/
|
|
19391
|
+
entityNamed: Entity;
|
|
19392
|
+
/**
|
|
19393
|
+
* @remarks
|
|
19394
|
+
* The new name that the player has given to the entity.
|
|
19395
|
+
*
|
|
19396
|
+
* This property can't be edited in restricted-execution mode.
|
|
19397
|
+
*
|
|
19398
|
+
*/
|
|
19399
|
+
newName: string;
|
|
19400
|
+
/**
|
|
19401
|
+
* @remarks
|
|
19402
|
+
* Handle to the player that used the name tag.
|
|
19403
|
+
*
|
|
19404
|
+
* This property can't be edited in restricted-execution mode.
|
|
19405
|
+
*
|
|
19406
|
+
*/
|
|
19407
|
+
player: Player;
|
|
19408
|
+
/**
|
|
19409
|
+
* @remarks
|
|
19410
|
+
* The previous name of the entity before the player used the
|
|
19411
|
+
* name tag. This will be undefined if the entity was not
|
|
19412
|
+
* previously named.
|
|
19413
|
+
*
|
|
19414
|
+
* This property can't be edited in restricted-execution mode.
|
|
19415
|
+
*
|
|
19416
|
+
*/
|
|
19417
|
+
previousName?: string;
|
|
19418
|
+
}
|
|
19419
|
+
|
|
19420
|
+
/**
|
|
19421
|
+
* @beta
|
|
19422
|
+
* Manages callbacks that are connected to when a player
|
|
19423
|
+
* successfully names an Entity with a named Name Tag item.
|
|
19424
|
+
*/
|
|
19425
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
19426
|
+
private constructor();
|
|
19427
|
+
/**
|
|
19428
|
+
* @remarks
|
|
19429
|
+
* Subscribes the specified callback to a player use name tag
|
|
19430
|
+
* after event.
|
|
19431
|
+
*
|
|
19432
|
+
* This function can't be called in restricted-execution mode.
|
|
19433
|
+
*
|
|
19434
|
+
* This function can be called in early-execution mode.
|
|
19435
|
+
*
|
|
19436
|
+
*/
|
|
19437
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
19438
|
+
/**
|
|
19439
|
+
* @remarks
|
|
19440
|
+
* Removes the specified callback from a player use name tag
|
|
19441
|
+
* after event.
|
|
19442
|
+
*
|
|
19443
|
+
* This function can't be called in restricted-execution mode.
|
|
19444
|
+
*
|
|
19445
|
+
* This function can be called in early-execution mode.
|
|
19446
|
+
*
|
|
19447
|
+
*/
|
|
19448
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
19449
|
+
}
|
|
19450
|
+
|
|
19451
|
+
/**
|
|
19452
|
+
* @beta
|
|
19453
|
+
* Waypoint that tracks a player's position. Extends {@link
|
|
19454
|
+
* EntityWaypoint} with additional player-specific visibility
|
|
19455
|
+
* rules such as hidden state and spectator mode.
|
|
19456
|
+
*/
|
|
19457
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19458
|
+
export class PlayerWaypoint extends EntityWaypoint {
|
|
19459
|
+
/**
|
|
19460
|
+
* @remarks
|
|
19461
|
+
* The {@link PlayerVisibilityRules} that control when the
|
|
19462
|
+
* waypoint is shown based on the player's state (e.g., hidden,
|
|
19463
|
+
* spectator mode, spectator viewing another spectator).
|
|
19464
|
+
*
|
|
19465
|
+
* @throws This property can throw when used.
|
|
19466
|
+
*
|
|
19467
|
+
* {@link InvalidWaypointError}
|
|
19468
|
+
*
|
|
19469
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
19470
|
+
*/
|
|
19471
|
+
readonly playerRules: PlayerVisibilityRules;
|
|
19472
|
+
/**
|
|
19473
|
+
* @throws This function can throw errors.
|
|
19474
|
+
*
|
|
19475
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
19476
|
+
*/
|
|
19477
|
+
constructor(
|
|
19478
|
+
player: Player,
|
|
19479
|
+
textureSelector: WaypointTextureSelector,
|
|
19480
|
+
playerRules: PlayerVisibilityRules,
|
|
19481
|
+
color?: RGB,
|
|
19482
|
+
);
|
|
19483
|
+
}
|
|
19484
|
+
|
|
17642
19485
|
/**
|
|
17643
19486
|
* Represents how the potion effect is delivered.
|
|
17644
19487
|
*/
|
|
@@ -17721,10 +19564,10 @@ export class Potions {
|
|
|
17721
19564
|
*
|
|
17722
19565
|
* {@link InvalidPotionEffectTypeError}
|
|
17723
19566
|
*/
|
|
17724
|
-
static resolve
|
|
17725
|
-
|
|
17726
|
-
|
|
17727
|
-
): ItemStack;
|
|
19567
|
+
static resolve<
|
|
19568
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
19569
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
19570
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
17728
19571
|
}
|
|
17729
19572
|
|
|
17730
19573
|
/**
|
|
@@ -17803,40 +19646,185 @@ export class PressurePlatePushAfterEvent extends BlockEvent {
|
|
|
17803
19646
|
readonly redstonePower: number;
|
|
17804
19647
|
/**
|
|
17805
19648
|
* @remarks
|
|
17806
|
-
* Source that triggered the pressure plate push.
|
|
19649
|
+
* Source that triggered the pressure plate push.
|
|
19650
|
+
*
|
|
19651
|
+
*/
|
|
19652
|
+
readonly source: Entity;
|
|
19653
|
+
}
|
|
19654
|
+
|
|
19655
|
+
/**
|
|
19656
|
+
* Manages callbacks that are connected to when a pressure
|
|
19657
|
+
* plate is pushed.
|
|
19658
|
+
*/
|
|
19659
|
+
export class PressurePlatePushAfterEventSignal {
|
|
19660
|
+
private constructor();
|
|
19661
|
+
/**
|
|
19662
|
+
* @remarks
|
|
19663
|
+
* Adds a callback that will be called when a pressure plate is
|
|
19664
|
+
* pushed.
|
|
19665
|
+
*
|
|
19666
|
+
* This function can't be called in restricted-execution mode.
|
|
19667
|
+
*
|
|
19668
|
+
* This function can be called in early-execution mode.
|
|
19669
|
+
*
|
|
19670
|
+
*/
|
|
19671
|
+
subscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): (arg0: PressurePlatePushAfterEvent) => void;
|
|
19672
|
+
/**
|
|
19673
|
+
* @remarks
|
|
19674
|
+
* Removes a callback from being called when a pressure plate
|
|
19675
|
+
* is pushed.
|
|
19676
|
+
*
|
|
19677
|
+
* This function can't be called in restricted-execution mode.
|
|
19678
|
+
*
|
|
19679
|
+
* This function can be called in early-execution mode.
|
|
19680
|
+
*
|
|
19681
|
+
*/
|
|
19682
|
+
unsubscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): void;
|
|
19683
|
+
}
|
|
19684
|
+
|
|
19685
|
+
/**
|
|
19686
|
+
* @beta
|
|
19687
|
+
* The base class for a text primitive. Represents an object in
|
|
19688
|
+
* the world and its base properties.
|
|
19689
|
+
*/
|
|
19690
|
+
export class PrimitiveShape {
|
|
19691
|
+
private constructor();
|
|
19692
|
+
/**
|
|
19693
|
+
* @remarks
|
|
19694
|
+
* The entity this shape is attached to. When set, this shape
|
|
19695
|
+
* will copy the root location of the attached entity and the
|
|
19696
|
+
* shape's position will be used as an offset.
|
|
19697
|
+
*
|
|
19698
|
+
*/
|
|
19699
|
+
attachedTo?: Entity;
|
|
19700
|
+
/**
|
|
19701
|
+
* @remarks
|
|
19702
|
+
* The color of the shape.
|
|
19703
|
+
*
|
|
19704
|
+
*/
|
|
19705
|
+
color: RGBA;
|
|
19706
|
+
/**
|
|
19707
|
+
* @remarks
|
|
19708
|
+
* The dimension the shape is visible within. If the dimension
|
|
19709
|
+
* is undefined, it will display in all dimensions.
|
|
19710
|
+
*
|
|
19711
|
+
*/
|
|
19712
|
+
readonly dimension: Dimension;
|
|
19713
|
+
/**
|
|
19714
|
+
* @remarks
|
|
19715
|
+
* Returns true if the shape has a limited time span before
|
|
19716
|
+
* being removed.
|
|
19717
|
+
*
|
|
19718
|
+
*/
|
|
19719
|
+
readonly hasDuration: boolean;
|
|
19720
|
+
/**
|
|
19721
|
+
* @remarks
|
|
19722
|
+
* The location of the shape.
|
|
19723
|
+
*
|
|
19724
|
+
*/
|
|
19725
|
+
readonly location: Vector3;
|
|
19726
|
+
/**
|
|
19727
|
+
* @remarks
|
|
19728
|
+
* If defined, this distance will be used to determine how far
|
|
19729
|
+
* away this primitive will be rendered for each client. By
|
|
19730
|
+
* default the distance will match the client's render distance
|
|
19731
|
+
* setting.
|
|
19732
|
+
*
|
|
19733
|
+
* Minimum Value: 0
|
|
19734
|
+
*/
|
|
19735
|
+
maximumRenderDistance?: number;
|
|
19736
|
+
/**
|
|
19737
|
+
* @remarks
|
|
19738
|
+
* The rotation of the shape (Euler angles - [Pitch, Yaw,
|
|
19739
|
+
* Roll]).
|
|
19740
|
+
*
|
|
19741
|
+
*/
|
|
19742
|
+
rotation: Vector3;
|
|
19743
|
+
/**
|
|
19744
|
+
* @remarks
|
|
19745
|
+
* The scale of the shape.
|
|
19746
|
+
*
|
|
19747
|
+
* Bounds: [-1000, 1000]
|
|
19748
|
+
*/
|
|
19749
|
+
scale: number;
|
|
19750
|
+
/**
|
|
19751
|
+
* @remarks
|
|
19752
|
+
* The time left (in seconds) until this shape is automatically
|
|
19753
|
+
* removed. Returns undefined if the shape does not have a
|
|
19754
|
+
* limited life-span.
|
|
19755
|
+
*
|
|
19756
|
+
*/
|
|
19757
|
+
timeLeft?: number;
|
|
19758
|
+
/**
|
|
19759
|
+
* @remarks
|
|
19760
|
+
* The total initial time-span (in seconds) until this shape is
|
|
19761
|
+
* automatically removed. Returns undefined if the shape does
|
|
19762
|
+
* not have a limited life-span.
|
|
19763
|
+
*
|
|
19764
|
+
*/
|
|
19765
|
+
readonly totalTimeLeft?: number;
|
|
19766
|
+
/**
|
|
19767
|
+
* @remarks
|
|
19768
|
+
* The list of players that this shape will be visible to. If
|
|
19769
|
+
* left empty, the shape will be visible to all players.
|
|
19770
|
+
*
|
|
19771
|
+
*/
|
|
19772
|
+
visibleTo: Player[];
|
|
19773
|
+
/**
|
|
19774
|
+
* @remarks
|
|
19775
|
+
* Removes this shape from the world. The shape can be re-added
|
|
19776
|
+
* via the PrimitiveShapesManager's addText method.
|
|
19777
|
+
*
|
|
19778
|
+
*/
|
|
19779
|
+
remove(): void;
|
|
19780
|
+
/**
|
|
19781
|
+
* @remarks
|
|
19782
|
+
* Set the location and dimension of the shape. If the
|
|
19783
|
+
* dimension is undefined, it will display in all dimensions.
|
|
17807
19784
|
*
|
|
17808
19785
|
*/
|
|
17809
|
-
|
|
19786
|
+
setLocation(location: DimensionLocation | Vector3): void;
|
|
17810
19787
|
}
|
|
17811
19788
|
|
|
17812
19789
|
/**
|
|
17813
|
-
*
|
|
17814
|
-
*
|
|
19790
|
+
* @beta
|
|
19791
|
+
* Primitive Shapes class used to allow adding and removing
|
|
19792
|
+
* text primitives to the world.
|
|
17815
19793
|
*/
|
|
17816
|
-
export class
|
|
19794
|
+
export class PrimitiveShapesManager {
|
|
17817
19795
|
private constructor();
|
|
17818
19796
|
/**
|
|
17819
19797
|
* @remarks
|
|
17820
|
-
*
|
|
17821
|
-
* pushed.
|
|
19798
|
+
* This is the maximum number of allowed primitive shapes.
|
|
17822
19799
|
*
|
|
17823
|
-
|
|
19800
|
+
*/
|
|
19801
|
+
readonly maxShapes: number;
|
|
19802
|
+
/**
|
|
19803
|
+
* @remarks
|
|
19804
|
+
* Adds a new text primitive to the world.
|
|
17824
19805
|
*
|
|
17825
|
-
*
|
|
19806
|
+
* @param text
|
|
19807
|
+
* The text primitive to be added.
|
|
19808
|
+
* @throws This function can throw errors.
|
|
19809
|
+
*
|
|
19810
|
+
* {@link minecraftcommon.EngineError}
|
|
17826
19811
|
*
|
|
19812
|
+
* {@link PrimitiveShapeError}
|
|
17827
19813
|
*/
|
|
17828
|
-
|
|
19814
|
+
addText(text: TextPrimitive, dimension?: Dimension): void;
|
|
17829
19815
|
/**
|
|
17830
19816
|
* @remarks
|
|
17831
|
-
* Removes
|
|
17832
|
-
* is pushed.
|
|
17833
|
-
*
|
|
17834
|
-
* This function can't be called in restricted-execution mode.
|
|
19817
|
+
* Removes all text primitives from the world.
|
|
17835
19818
|
*
|
|
17836
|
-
|
|
19819
|
+
*/
|
|
19820
|
+
removeAll(): void;
|
|
19821
|
+
/**
|
|
19822
|
+
* @remarks
|
|
19823
|
+
* Removes an instance of a text primitive from the world. This
|
|
19824
|
+
* is equivalent to calling remove on the text itself.
|
|
17837
19825
|
*
|
|
17838
19826
|
*/
|
|
17839
|
-
|
|
19827
|
+
removeText(text: TextPrimitive): void;
|
|
17840
19828
|
}
|
|
17841
19829
|
|
|
17842
19830
|
/**
|
|
@@ -18788,6 +20776,38 @@ export class Seat {
|
|
|
18788
20776
|
readonly seatRotation: number;
|
|
18789
20777
|
}
|
|
18790
20778
|
|
|
20779
|
+
/**
|
|
20780
|
+
* @beta
|
|
20781
|
+
* Manages callbacks that are message passing to a server. This
|
|
20782
|
+
* event is not currently fully implemented, and should not be
|
|
20783
|
+
* used.
|
|
20784
|
+
*/
|
|
20785
|
+
export class ServerMessageAfterEventSignal {
|
|
20786
|
+
private constructor();
|
|
20787
|
+
/**
|
|
20788
|
+
* @remarks
|
|
20789
|
+
* Adds a callback that will be called when an internal message
|
|
20790
|
+
* is passed.
|
|
20791
|
+
*
|
|
20792
|
+
* This function can't be called in restricted-execution mode.
|
|
20793
|
+
*
|
|
20794
|
+
* This function can be called in early-execution mode.
|
|
20795
|
+
*
|
|
20796
|
+
*/
|
|
20797
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
20798
|
+
/**
|
|
20799
|
+
* @remarks
|
|
20800
|
+
* Removes a callback from being called when an internal
|
|
20801
|
+
* message is passed.
|
|
20802
|
+
*
|
|
20803
|
+
* This function can't be called in restricted-execution mode.
|
|
20804
|
+
*
|
|
20805
|
+
* This function can be called in early-execution mode.
|
|
20806
|
+
*
|
|
20807
|
+
*/
|
|
20808
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
20809
|
+
}
|
|
20810
|
+
|
|
18791
20811
|
/**
|
|
18792
20812
|
* Loot item function that modifies the trim on a dropped armor
|
|
18793
20813
|
* item.
|
|
@@ -18816,6 +20836,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
18816
20836
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18817
20837
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
18818
20838
|
private constructor();
|
|
20839
|
+
/**
|
|
20840
|
+
* @beta
|
|
20841
|
+
* @remarks
|
|
20842
|
+
* The base color for the dropped banner.
|
|
20843
|
+
*
|
|
20844
|
+
*/
|
|
20845
|
+
readonly baseColor: string;
|
|
20846
|
+
/**
|
|
20847
|
+
* @beta
|
|
20848
|
+
* @remarks
|
|
20849
|
+
* An array of {@link BannerPattern} objects used to decorate
|
|
20850
|
+
* the banner, including color and pattern type.
|
|
20851
|
+
*
|
|
20852
|
+
*/
|
|
20853
|
+
readonly patterns: BannerPattern[];
|
|
18819
20854
|
/**
|
|
18820
20855
|
* @remarks
|
|
18821
20856
|
* The type of banner to drop.
|
|
@@ -19358,6 +21393,19 @@ export class StructureManager {
|
|
|
19358
21393
|
* Returns a Structure if it exists, otherwise undefined.
|
|
19359
21394
|
*/
|
|
19360
21395
|
get(identifier: string): Structure | undefined;
|
|
21396
|
+
/**
|
|
21397
|
+
* @beta
|
|
21398
|
+
* @remarks
|
|
21399
|
+
* Returns a list of all structures contained in behavior
|
|
21400
|
+
* packs. Does not include structures saved to the world or in
|
|
21401
|
+
* memory.
|
|
21402
|
+
*
|
|
21403
|
+
* This function can't be called in restricted-execution mode.
|
|
21404
|
+
*
|
|
21405
|
+
* @returns
|
|
21406
|
+
* The list of structure identifiers.
|
|
21407
|
+
*/
|
|
21408
|
+
getPackStructureIds(): string[];
|
|
19361
21409
|
/**
|
|
19362
21410
|
* @remarks
|
|
19363
21411
|
* Returns a list of all structures saved to the world and to
|
|
@@ -19754,6 +21802,19 @@ export class SystemBeforeEvents {
|
|
|
19754
21802
|
*
|
|
19755
21803
|
*/
|
|
19756
21804
|
readonly startup: StartupBeforeEventSignal;
|
|
21805
|
+
/**
|
|
21806
|
+
* @beta
|
|
21807
|
+
* @remarks
|
|
21808
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
21809
|
+
* can be due to using too much memory, or by causing
|
|
21810
|
+
* significant slowdown or hang.
|
|
21811
|
+
* To prevent shutdown, set the event's cancel property to
|
|
21812
|
+
* true.
|
|
21813
|
+
*
|
|
21814
|
+
* This property can be read in early-execution mode.
|
|
21815
|
+
*
|
|
21816
|
+
*/
|
|
21817
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
19757
21818
|
}
|
|
19758
21819
|
|
|
19759
21820
|
/**
|
|
@@ -19832,6 +21893,71 @@ export class TargetBlockHitAfterEventSignal {
|
|
|
19832
21893
|
unsubscribe(callback: (arg0: TargetBlockHitAfterEvent) => void): void;
|
|
19833
21894
|
}
|
|
19834
21895
|
|
|
21896
|
+
/**
|
|
21897
|
+
* @beta
|
|
21898
|
+
* A primitive shape class that represents a text label in the
|
|
21899
|
+
* world with a background.
|
|
21900
|
+
*/
|
|
21901
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21902
|
+
export class TextPrimitive extends PrimitiveShape {
|
|
21903
|
+
/**
|
|
21904
|
+
* @remarks
|
|
21905
|
+
* If set to true, the text primitive will render the back-face
|
|
21906
|
+
* of the background. Defaults to true but will always be false
|
|
21907
|
+
* if 'useRotation' is set to false.
|
|
21908
|
+
*
|
|
21909
|
+
*/
|
|
21910
|
+
backfaceVisible: boolean;
|
|
21911
|
+
/**
|
|
21912
|
+
* @remarks
|
|
21913
|
+
* The color of the background plate of the text. If set to
|
|
21914
|
+
* undefined, it will use the default color.
|
|
21915
|
+
*
|
|
21916
|
+
*/
|
|
21917
|
+
backgroundColorOverride?: RGBA;
|
|
21918
|
+
/**
|
|
21919
|
+
* @remarks
|
|
21920
|
+
* If set to true, the text will be hidden behind blocks or
|
|
21921
|
+
* entities. By default this is set to false (will always
|
|
21922
|
+
* render).
|
|
21923
|
+
*
|
|
21924
|
+
*/
|
|
21925
|
+
depthTest: boolean;
|
|
21926
|
+
/**
|
|
21927
|
+
* @remarks
|
|
21928
|
+
* Get the text of the debug text shape. Returns the RawText of
|
|
21929
|
+
* the debug text if `setText` was called with a RawMessage or
|
|
21930
|
+
* a RawText object, otherwise returns a string.
|
|
21931
|
+
*
|
|
21932
|
+
*/
|
|
21933
|
+
readonly text: RawMessage | string;
|
|
21934
|
+
/**
|
|
21935
|
+
* @remarks
|
|
21936
|
+
* If set to true, the text primitive will render the back-face
|
|
21937
|
+
* of the text. Defaults to true but will always be false if
|
|
21938
|
+
* 'useRotation' is set to false.
|
|
21939
|
+
*
|
|
21940
|
+
*/
|
|
21941
|
+
textBackfaceVisible: boolean;
|
|
21942
|
+
/**
|
|
21943
|
+
* @remarks
|
|
21944
|
+
* If set to true, the text will not face the camera and
|
|
21945
|
+
* instead will use the rotation from the shape.
|
|
21946
|
+
*
|
|
21947
|
+
*/
|
|
21948
|
+
useRotation: boolean;
|
|
21949
|
+
constructor(location: DimensionLocation | Vector3, text: RawMessage | string);
|
|
21950
|
+
/**
|
|
21951
|
+
* @remarks
|
|
21952
|
+
* Sets the text to display.
|
|
21953
|
+
*
|
|
21954
|
+
* @throws This function can throw errors.
|
|
21955
|
+
*
|
|
21956
|
+
* {@link RawMessageError}
|
|
21957
|
+
*/
|
|
21958
|
+
setText(text: RawMessage | string): void;
|
|
21959
|
+
}
|
|
21960
|
+
|
|
19835
21961
|
/**
|
|
19836
21962
|
* This manager is used to add, remove or query temporary
|
|
19837
21963
|
* ticking areas to a dimension. These ticking areas are
|
|
@@ -20073,6 +22199,151 @@ export class TripWireTripAfterEventSignal {
|
|
|
20073
22199
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
20074
22200
|
}
|
|
20075
22201
|
|
|
22202
|
+
/**
|
|
22203
|
+
* @beta
|
|
22204
|
+
* Contains information related to a script watchdog
|
|
22205
|
+
* termination.
|
|
22206
|
+
*/
|
|
22207
|
+
export class WatchdogTerminateBeforeEvent {
|
|
22208
|
+
private constructor();
|
|
22209
|
+
/**
|
|
22210
|
+
* @remarks
|
|
22211
|
+
* If set to true, cancels the termination of the script
|
|
22212
|
+
* runtime. Note that depending on server configuration
|
|
22213
|
+
* settings, cancellation of the termination may not be
|
|
22214
|
+
* allowed.
|
|
22215
|
+
*
|
|
22216
|
+
*/
|
|
22217
|
+
cancel: boolean;
|
|
22218
|
+
/**
|
|
22219
|
+
* @remarks
|
|
22220
|
+
* Contains the reason why a script runtime is to be
|
|
22221
|
+
* terminated.
|
|
22222
|
+
*
|
|
22223
|
+
*/
|
|
22224
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
22225
|
+
}
|
|
22226
|
+
|
|
22227
|
+
/**
|
|
22228
|
+
* @beta
|
|
22229
|
+
* Manages callbacks that are connected to a callback that will
|
|
22230
|
+
* be called when a script runtime is being terminated due to a
|
|
22231
|
+
* violation of the performance watchdog system.
|
|
22232
|
+
*/
|
|
22233
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
22234
|
+
private constructor();
|
|
22235
|
+
/**
|
|
22236
|
+
* @remarks
|
|
22237
|
+
* Adds a callback that will be called when a script runtime is
|
|
22238
|
+
* being terminated due to a violation of the performance
|
|
22239
|
+
* watchdog system.
|
|
22240
|
+
*
|
|
22241
|
+
* This function can't be called in restricted-execution mode.
|
|
22242
|
+
*
|
|
22243
|
+
* This function can be called in early-execution mode.
|
|
22244
|
+
*
|
|
22245
|
+
* @param callback
|
|
22246
|
+
* This closure is called with restricted-execution privilege.
|
|
22247
|
+
* @returns
|
|
22248
|
+
* Closure that is called with restricted-execution privilege.
|
|
22249
|
+
*/
|
|
22250
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
22251
|
+
/**
|
|
22252
|
+
* @remarks
|
|
22253
|
+
* Removes a callback from being called when a script runtime
|
|
22254
|
+
* is being terminated due to a violation of the performance
|
|
22255
|
+
* watchdog system.
|
|
22256
|
+
*
|
|
22257
|
+
* This function can't be called in restricted-execution mode.
|
|
22258
|
+
*
|
|
22259
|
+
* This function can be called in early-execution mode.
|
|
22260
|
+
*
|
|
22261
|
+
* @param callback
|
|
22262
|
+
* This closure is called with restricted-execution privilege.
|
|
22263
|
+
*/
|
|
22264
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
22265
|
+
}
|
|
22266
|
+
|
|
22267
|
+
/**
|
|
22268
|
+
* @beta
|
|
22269
|
+
* Base class for waypoints displayed on the player's locator
|
|
22270
|
+
* bar. Waypoints can track locations or entities and are
|
|
22271
|
+
* rendered with customizable textures and colors.
|
|
22272
|
+
*
|
|
22273
|
+
* Waypoints act as shared handles that can be added to
|
|
22274
|
+
* multiple players' locator bars. When you modify a waypoint's
|
|
22275
|
+
* properties (such as color, texture, or enabled state), the
|
|
22276
|
+
* changes are reflected for all players who have that waypoint
|
|
22277
|
+
* in their locator bar. This allows you to efficiently manage
|
|
22278
|
+
* waypoints across multiple players without creating separate
|
|
22279
|
+
* instances for each player.
|
|
22280
|
+
*/
|
|
22281
|
+
export class Waypoint {
|
|
22282
|
+
private constructor();
|
|
22283
|
+
/**
|
|
22284
|
+
* @remarks
|
|
22285
|
+
* Optional {@link RGB} color tint applied to the waypoint
|
|
22286
|
+
* icon. If not specified, the waypoint uses its default color.
|
|
22287
|
+
*
|
|
22288
|
+
* This property can't be edited in restricted-execution mode.
|
|
22289
|
+
*
|
|
22290
|
+
*/
|
|
22291
|
+
color?: RGB;
|
|
22292
|
+
/**
|
|
22293
|
+
* @remarks
|
|
22294
|
+
* Controls whether the waypoint is currently displayed on the
|
|
22295
|
+
* player's screen. When disabled, the waypoint is hidden but
|
|
22296
|
+
* remains valid.
|
|
22297
|
+
*
|
|
22298
|
+
* This property can't be edited in restricted-execution mode.
|
|
22299
|
+
*
|
|
22300
|
+
*/
|
|
22301
|
+
isEnabled: boolean;
|
|
22302
|
+
/**
|
|
22303
|
+
* @remarks
|
|
22304
|
+
* Returns whether the waypoint is currently valid. A waypoint
|
|
22305
|
+
* becomes invalid when its tracked entity is no longer valid.
|
|
22306
|
+
*
|
|
22307
|
+
*/
|
|
22308
|
+
readonly isValid: boolean;
|
|
22309
|
+
/**
|
|
22310
|
+
* @remarks
|
|
22311
|
+
* The {@link WaypointTextureSelector} that determines which
|
|
22312
|
+
* icon texture is displayed for the waypoint based on distance
|
|
22313
|
+
* or other criteria.
|
|
22314
|
+
*
|
|
22315
|
+
* This property can't be edited in restricted-execution mode.
|
|
22316
|
+
*
|
|
22317
|
+
*/
|
|
22318
|
+
textureSelector: WaypointTextureSelector;
|
|
22319
|
+
/**
|
|
22320
|
+
* @remarks
|
|
22321
|
+
* Gets the current {@link DimensionLocation} of the waypoint.
|
|
22322
|
+
* For entity waypoints, this returns the entity's current
|
|
22323
|
+
* position. For location waypoints, this returns the stored
|
|
22324
|
+
* location.
|
|
22325
|
+
*
|
|
22326
|
+
* This function can't be called in restricted-execution mode.
|
|
22327
|
+
*
|
|
22328
|
+
* @throws This function can throw errors.
|
|
22329
|
+
*
|
|
22330
|
+
* {@link InvalidWaypointError}
|
|
22331
|
+
*
|
|
22332
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
22333
|
+
*/
|
|
22334
|
+
getDimensionLocation(): DimensionLocation;
|
|
22335
|
+
/**
|
|
22336
|
+
* @remarks
|
|
22337
|
+
* Removes the waypoint from all locator bars it has been added
|
|
22338
|
+
* to. This affects all players who have this waypoint in their
|
|
22339
|
+
* locator bar.
|
|
22340
|
+
*
|
|
22341
|
+
* This function can't be called in restricted-execution mode.
|
|
22342
|
+
*
|
|
22343
|
+
*/
|
|
22344
|
+
remove(): void;
|
|
22345
|
+
}
|
|
22346
|
+
|
|
20076
22347
|
/**
|
|
20077
22348
|
* Contains information related to changes in weather in the
|
|
20078
22349
|
* environment.
|
|
@@ -20209,6 +22480,15 @@ export class World {
|
|
|
20209
22480
|
*
|
|
20210
22481
|
*/
|
|
20211
22482
|
readonly afterEvents: WorldAfterEvents;
|
|
22483
|
+
/**
|
|
22484
|
+
* @beta
|
|
22485
|
+
* @remarks
|
|
22486
|
+
* Enables or disables cheats.
|
|
22487
|
+
*
|
|
22488
|
+
* This property can't be edited in restricted-execution mode.
|
|
22489
|
+
*
|
|
22490
|
+
*/
|
|
22491
|
+
allowCheats: boolean;
|
|
20212
22492
|
/**
|
|
20213
22493
|
* @remarks
|
|
20214
22494
|
* Contains a set of events that are applicable to the entirety
|
|
@@ -20253,6 +22533,14 @@ export class World {
|
|
|
20253
22533
|
*/
|
|
20254
22534
|
readonly gameRules: GameRules;
|
|
20255
22535
|
readonly isHardcore: boolean;
|
|
22536
|
+
/**
|
|
22537
|
+
* @beta
|
|
22538
|
+
* @remarks
|
|
22539
|
+
* Manager for adding and removing primitive text objects in
|
|
22540
|
+
* the world.
|
|
22541
|
+
*
|
|
22542
|
+
*/
|
|
22543
|
+
readonly primitiveShapesManager: PrimitiveShapesManager;
|
|
20256
22544
|
/**
|
|
20257
22545
|
* @remarks
|
|
20258
22546
|
* Returns the general global scoreboard that applies to the
|
|
@@ -20279,6 +22567,20 @@ export class World {
|
|
|
20279
22567
|
*
|
|
20280
22568
|
*/
|
|
20281
22569
|
readonly tickingAreaManager: TickingAreaManager;
|
|
22570
|
+
/**
|
|
22571
|
+
* @beta
|
|
22572
|
+
* @remarks
|
|
22573
|
+
* A method that is internal-only, used for broadcasting
|
|
22574
|
+
* specific messages between client and server.
|
|
22575
|
+
*
|
|
22576
|
+
* This function can't be called in restricted-execution mode.
|
|
22577
|
+
*
|
|
22578
|
+
* @param id
|
|
22579
|
+
* The message identifier.
|
|
22580
|
+
* @param value
|
|
22581
|
+
* The message.
|
|
22582
|
+
*/
|
|
22583
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
20282
22584
|
/**
|
|
20283
22585
|
* @remarks
|
|
20284
22586
|
* Clears the set of dynamic properties declared for this
|
|
@@ -20472,6 +22774,15 @@ export class World {
|
|
|
20472
22774
|
*
|
|
20473
22775
|
*/
|
|
20474
22776
|
getMoonPhase(): MoonPhase;
|
|
22777
|
+
/**
|
|
22778
|
+
* @beta
|
|
22779
|
+
* @remarks
|
|
22780
|
+
* Returns a map of pack setting name and value pairs.
|
|
22781
|
+
*
|
|
22782
|
+
* This function can be called in early-execution mode.
|
|
22783
|
+
*
|
|
22784
|
+
*/
|
|
22785
|
+
getPackSettings(): Record<string, boolean | number | string>;
|
|
20475
22786
|
/**
|
|
20476
22787
|
* @remarks
|
|
20477
22788
|
* Returns a set of players based on a set of conditions
|
|
@@ -20726,6 +23037,24 @@ export class World {
|
|
|
20726
23037
|
*/
|
|
20727
23038
|
export class WorldAfterEvents {
|
|
20728
23039
|
private constructor();
|
|
23040
|
+
/**
|
|
23041
|
+
* @beta
|
|
23042
|
+
* @remarks
|
|
23043
|
+
* This event fires when a block container is closed.
|
|
23044
|
+
*
|
|
23045
|
+
* This property can be read in early-execution mode.
|
|
23046
|
+
*
|
|
23047
|
+
*/
|
|
23048
|
+
readonly blockContainerClosed: BlockContainerClosedAfterEventSignal;
|
|
23049
|
+
/**
|
|
23050
|
+
* @beta
|
|
23051
|
+
* @remarks
|
|
23052
|
+
* This event fires when a block container is opened.
|
|
23053
|
+
*
|
|
23054
|
+
* This property can be read in early-execution mode.
|
|
23055
|
+
*
|
|
23056
|
+
*/
|
|
23057
|
+
readonly blockContainerOpened: BlockContainerOpenedAfterEventSignal;
|
|
20729
23058
|
/**
|
|
20730
23059
|
* @remarks
|
|
20731
23060
|
* This event fires for each BlockLocation destroyed by an
|
|
@@ -20745,24 +23074,52 @@ export class WorldAfterEvents {
|
|
|
20745
23074
|
*/
|
|
20746
23075
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
20747
23076
|
/**
|
|
23077
|
+
* @beta
|
|
23078
|
+
* @remarks
|
|
23079
|
+
* This event is triggered after a chat message has been
|
|
23080
|
+
* broadcast or sent to players.
|
|
23081
|
+
*
|
|
23082
|
+
* This property can be read in early-execution mode.
|
|
23083
|
+
*
|
|
23084
|
+
*/
|
|
23085
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
23086
|
+
/**
|
|
23087
|
+
* @remarks
|
|
23088
|
+
* This event is fired when an entity event has been triggered
|
|
23089
|
+
* that will update the component definition state of an
|
|
23090
|
+
* entity.
|
|
23091
|
+
*
|
|
23092
|
+
* This property can be read in early-execution mode.
|
|
23093
|
+
*
|
|
23094
|
+
*/
|
|
23095
|
+
readonly dataDrivenEntityTrigger: DataDrivenEntityTriggerAfterEventSignal;
|
|
23096
|
+
/**
|
|
23097
|
+
* @remarks
|
|
23098
|
+
* This event fires when an effect, like poisoning, is added to
|
|
23099
|
+
* an entity.
|
|
23100
|
+
*
|
|
23101
|
+
* This property can be read in early-execution mode.
|
|
23102
|
+
*
|
|
23103
|
+
*/
|
|
23104
|
+
readonly effectAdd: EffectAddAfterEventSignal;
|
|
23105
|
+
/**
|
|
23106
|
+
* @beta
|
|
20748
23107
|
* @remarks
|
|
20749
|
-
* This event
|
|
20750
|
-
* that will update the component definition state of an
|
|
20751
|
-
* entity.
|
|
23108
|
+
* This event fires when an entity container is closed.
|
|
20752
23109
|
*
|
|
20753
23110
|
* This property can be read in early-execution mode.
|
|
20754
23111
|
*
|
|
20755
23112
|
*/
|
|
20756
|
-
readonly
|
|
23113
|
+
readonly entityContainerClosed: EntityContainerClosedAfterEventSignal;
|
|
20757
23114
|
/**
|
|
23115
|
+
* @beta
|
|
20758
23116
|
* @remarks
|
|
20759
|
-
* This event fires when an
|
|
20760
|
-
* an entity.
|
|
23117
|
+
* This event fires when an entity container is opened.
|
|
20761
23118
|
*
|
|
20762
23119
|
* This property can be read in early-execution mode.
|
|
20763
23120
|
*
|
|
20764
23121
|
*/
|
|
20765
|
-
readonly
|
|
23122
|
+
readonly entityContainerOpened: EntityContainerOpenedAfterEventSignal;
|
|
20766
23123
|
/**
|
|
20767
23124
|
* @remarks
|
|
20768
23125
|
* This event fires when an entity dies.
|
|
@@ -20941,6 +23298,25 @@ export class WorldAfterEvents {
|
|
|
20941
23298
|
*
|
|
20942
23299
|
*/
|
|
20943
23300
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
23301
|
+
/**
|
|
23302
|
+
* @beta
|
|
23303
|
+
* @remarks
|
|
23304
|
+
* This event is an internal implementation detail, and is
|
|
23305
|
+
* otherwise not currently functional.
|
|
23306
|
+
*
|
|
23307
|
+
* This property can be read in early-execution mode.
|
|
23308
|
+
*
|
|
23309
|
+
*/
|
|
23310
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
23311
|
+
/**
|
|
23312
|
+
* @beta
|
|
23313
|
+
* @remarks
|
|
23314
|
+
* This event is triggered when a pack setting is changed.
|
|
23315
|
+
*
|
|
23316
|
+
* This property can be read in early-execution mode.
|
|
23317
|
+
*
|
|
23318
|
+
*/
|
|
23319
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
20944
23320
|
/**
|
|
20945
23321
|
* @remarks
|
|
20946
23322
|
* This event fires when a piston expands or retracts.
|
|
@@ -21077,6 +23453,16 @@ export class WorldAfterEvents {
|
|
|
21077
23453
|
*
|
|
21078
23454
|
*/
|
|
21079
23455
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
23456
|
+
/**
|
|
23457
|
+
* @beta
|
|
23458
|
+
* @remarks
|
|
23459
|
+
* An event for when a player uses a named name tag on an
|
|
23460
|
+
* entity.
|
|
23461
|
+
*
|
|
23462
|
+
* This property can be read in early-execution mode.
|
|
23463
|
+
*
|
|
23464
|
+
*/
|
|
23465
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
21080
23466
|
/**
|
|
21081
23467
|
* @remarks
|
|
21082
23468
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -21153,6 +23539,43 @@ export class WorldAfterEvents {
|
|
|
21153
23539
|
*/
|
|
21154
23540
|
export class WorldBeforeEvents {
|
|
21155
23541
|
private constructor();
|
|
23542
|
+
/**
|
|
23543
|
+
* @beta
|
|
23544
|
+
* @remarks
|
|
23545
|
+
* This event is triggered after a chat message has been
|
|
23546
|
+
* broadcast or sent to players.
|
|
23547
|
+
*
|
|
23548
|
+
* This property can be read in early-execution mode.
|
|
23549
|
+
*
|
|
23550
|
+
* @example customCommand.ts
|
|
23551
|
+
* ```typescript
|
|
23552
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
23553
|
+
*
|
|
23554
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
23555
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
23556
|
+
* if (eventData.message.includes('cancel')) {
|
|
23557
|
+
* // Cancel event if the message contains "cancel"
|
|
23558
|
+
* eventData.cancel = true;
|
|
23559
|
+
* } else {
|
|
23560
|
+
* const args = eventData.message.split(' ');
|
|
23561
|
+
*
|
|
23562
|
+
* if (args.length > 0) {
|
|
23563
|
+
* switch (args[0].toLowerCase()) {
|
|
23564
|
+
* case 'echo':
|
|
23565
|
+
* // Send a modified version of chat message
|
|
23566
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
23567
|
+
* break;
|
|
23568
|
+
* case 'help':
|
|
23569
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
23570
|
+
* break;
|
|
23571
|
+
* }
|
|
23572
|
+
* }
|
|
23573
|
+
* }
|
|
23574
|
+
* });
|
|
23575
|
+
* }
|
|
23576
|
+
* ```
|
|
23577
|
+
*/
|
|
23578
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
21156
23579
|
/**
|
|
21157
23580
|
* @remarks
|
|
21158
23581
|
* This event is triggered after an event has been added to an
|
|
@@ -21246,6 +23669,15 @@ export class WorldBeforeEvents {
|
|
|
21246
23669
|
*
|
|
21247
23670
|
*/
|
|
21248
23671
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
23672
|
+
/**
|
|
23673
|
+
* @beta
|
|
23674
|
+
* @remarks
|
|
23675
|
+
* This event fires before a block is placed by a player.
|
|
23676
|
+
*
|
|
23677
|
+
* This property can be read in early-execution mode.
|
|
23678
|
+
*
|
|
23679
|
+
*/
|
|
23680
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
21249
23681
|
/**
|
|
21250
23682
|
* @remarks
|
|
21251
23683
|
* This property can be read in early-execution mode.
|
|
@@ -21323,13 +23755,27 @@ export interface BiomeFilter {
|
|
|
21323
23755
|
includeTags?: string[];
|
|
21324
23756
|
}
|
|
21325
23757
|
|
|
23758
|
+
/**
|
|
23759
|
+
* @beta
|
|
23760
|
+
* Contains additional options for searches for the
|
|
23761
|
+
* dimension.findNearestBiome API.
|
|
23762
|
+
*/
|
|
23763
|
+
export interface BiomeSearchOptions {
|
|
23764
|
+
/**
|
|
23765
|
+
* @remarks
|
|
23766
|
+
* Bounding volume size to look within.
|
|
23767
|
+
*
|
|
23768
|
+
*/
|
|
23769
|
+
boundingSize?: Vector3;
|
|
23770
|
+
}
|
|
23771
|
+
|
|
21326
23772
|
/**
|
|
21327
23773
|
* A BlockBoundingBox is an interface to an object which
|
|
21328
23774
|
* represents an AABB aligned rectangle.
|
|
21329
23775
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
21330
23776
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
21331
|
-
* created using the associated {@link
|
|
21332
|
-
*
|
|
23777
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
23778
|
+
* utility functions.
|
|
21333
23779
|
* The min/max coordinates represent the diametrically opposite
|
|
21334
23780
|
* corners of the rectangle.
|
|
21335
23781
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -21356,6 +23802,27 @@ export interface BlockBoundingBox {
|
|
|
21356
23802
|
min: Vector3;
|
|
21357
23803
|
}
|
|
21358
23804
|
|
|
23805
|
+
/**
|
|
23806
|
+
* @beta
|
|
23807
|
+
* Options used to filter block container access events.
|
|
23808
|
+
*/
|
|
23809
|
+
export interface BlockContainerAccessEventOptions {
|
|
23810
|
+
/**
|
|
23811
|
+
* @remarks
|
|
23812
|
+
* If present will filter which container access sources can
|
|
23813
|
+
* trigger the event.
|
|
23814
|
+
*
|
|
23815
|
+
*/
|
|
23816
|
+
accessSourceFilter?: ContainerAccessSourceFilter;
|
|
23817
|
+
/**
|
|
23818
|
+
* @remarks
|
|
23819
|
+
* If present will filter which container blocks can trigger
|
|
23820
|
+
* the event.
|
|
23821
|
+
*
|
|
23822
|
+
*/
|
|
23823
|
+
blockFilter?: BlockFilter;
|
|
23824
|
+
}
|
|
23825
|
+
|
|
21359
23826
|
/**
|
|
21360
23827
|
* Contains a set of events that will be raised for a block.
|
|
21361
23828
|
* This object must be bound using the BlockRegistry.
|
|
@@ -21755,6 +24222,67 @@ export interface CameraTargetOptions {
|
|
|
21755
24222
|
targetEntity: Entity;
|
|
21756
24223
|
}
|
|
21757
24224
|
|
|
24225
|
+
/**
|
|
24226
|
+
* @beta
|
|
24227
|
+
* This interface defines an entry into the {@link
|
|
24228
|
+
* CompoundBlockVolume} which represents a volume of positive
|
|
24229
|
+
* or negative space.
|
|
24230
|
+
*
|
|
24231
|
+
*/
|
|
24232
|
+
export interface CompoundBlockVolumeItem {
|
|
24233
|
+
/**
|
|
24234
|
+
* @remarks
|
|
24235
|
+
* The 'action' defines how the block volume is represented in
|
|
24236
|
+
* the compound block volume stack.
|
|
24237
|
+
* 'Add' creates a block volume which is positively selected
|
|
24238
|
+
* 'Subtract' creates a block volume which represents a hole or
|
|
24239
|
+
* negative space in the overall compound block volume.
|
|
24240
|
+
*
|
|
24241
|
+
*/
|
|
24242
|
+
action?: CompoundBlockVolumeAction;
|
|
24243
|
+
/**
|
|
24244
|
+
* @remarks
|
|
24245
|
+
* The relativity enumeration determines whether the
|
|
24246
|
+
* BlockVolume specified is positioned relative to the parent
|
|
24247
|
+
* compound block volume origin, or in absolute world space.
|
|
24248
|
+
*
|
|
24249
|
+
*/
|
|
24250
|
+
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
24251
|
+
/**
|
|
24252
|
+
* @remarks
|
|
24253
|
+
* The volume of space
|
|
24254
|
+
*
|
|
24255
|
+
*/
|
|
24256
|
+
volume: BlockVolume;
|
|
24257
|
+
}
|
|
24258
|
+
|
|
24259
|
+
/**
|
|
24260
|
+
* @beta
|
|
24261
|
+
* Represents the source of a container access.
|
|
24262
|
+
*/
|
|
24263
|
+
export interface ContainerAccessSource {
|
|
24264
|
+
/**
|
|
24265
|
+
* @remarks
|
|
24266
|
+
* The entity that triggered the container access.
|
|
24267
|
+
*
|
|
24268
|
+
*/
|
|
24269
|
+
entity?: Entity;
|
|
24270
|
+
}
|
|
24271
|
+
|
|
24272
|
+
/**
|
|
24273
|
+
* @beta
|
|
24274
|
+
* Options for use when filtering container access sources.
|
|
24275
|
+
*/
|
|
24276
|
+
export interface ContainerAccessSourceFilter {
|
|
24277
|
+
/**
|
|
24278
|
+
* @remarks
|
|
24279
|
+
* Filter options for the source entity accessing the
|
|
24280
|
+
* container.
|
|
24281
|
+
*
|
|
24282
|
+
*/
|
|
24283
|
+
entityFilter?: EntityFilter;
|
|
24284
|
+
}
|
|
24285
|
+
|
|
21758
24286
|
/**
|
|
21759
24287
|
* Rules that if broken on container operations will throw an
|
|
21760
24288
|
* error.
|
|
@@ -21839,6 +24367,15 @@ export interface CustomCommand {
|
|
|
21839
24367
|
* command.
|
|
21840
24368
|
*/
|
|
21841
24369
|
export interface CustomCommandParameter {
|
|
24370
|
+
/**
|
|
24371
|
+
* @beta
|
|
24372
|
+
* @remarks
|
|
24373
|
+
* Can be used to reference the enum name when {@link
|
|
24374
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
24375
|
+
* to be different from the enum name.
|
|
24376
|
+
*
|
|
24377
|
+
*/
|
|
24378
|
+
enumName?: string;
|
|
21842
24379
|
/**
|
|
21843
24380
|
* @remarks
|
|
21844
24381
|
* The name of parameter as it appears on the command line.
|
|
@@ -21872,6 +24409,35 @@ export interface CustomCommandResult {
|
|
|
21872
24409
|
status: CustomCommandStatus;
|
|
21873
24410
|
}
|
|
21874
24411
|
|
|
24412
|
+
/**
|
|
24413
|
+
* @beta
|
|
24414
|
+
*/
|
|
24415
|
+
export interface CustomTexture {
|
|
24416
|
+
/**
|
|
24417
|
+
* @remarks
|
|
24418
|
+
* The height of the icon, in relative units. Value must be
|
|
24419
|
+
* between 0.0 and 1.0, inclusive.
|
|
24420
|
+
*
|
|
24421
|
+
* Bounds: [0, 1]
|
|
24422
|
+
*/
|
|
24423
|
+
iconHeight: number;
|
|
24424
|
+
/**
|
|
24425
|
+
* @remarks
|
|
24426
|
+
* The width of the icon, in relative units. Value must be
|
|
24427
|
+
* between 0.0 and 1.0, inclusive.
|
|
24428
|
+
*
|
|
24429
|
+
* Bounds: [0, 1]
|
|
24430
|
+
*/
|
|
24431
|
+
iconWidth: number;
|
|
24432
|
+
/**
|
|
24433
|
+
* @remarks
|
|
24434
|
+
* The resource path to the custom texture. This should be a
|
|
24435
|
+
* valid string path to a texture asset.
|
|
24436
|
+
*
|
|
24437
|
+
*/
|
|
24438
|
+
path: string;
|
|
24439
|
+
}
|
|
24440
|
+
|
|
21875
24441
|
/**
|
|
21876
24442
|
* Contains a set of updates to the component definition state
|
|
21877
24443
|
* of an entity.
|
|
@@ -21891,6 +24457,14 @@ export interface DefinitionModifier {
|
|
|
21891
24457
|
*
|
|
21892
24458
|
*/
|
|
21893
24459
|
removedComponentGroups: string[];
|
|
24460
|
+
/**
|
|
24461
|
+
* @beta
|
|
24462
|
+
* @remarks
|
|
24463
|
+
* The list of entity definition events that will be fired via
|
|
24464
|
+
* this update.
|
|
24465
|
+
*
|
|
24466
|
+
*/
|
|
24467
|
+
triggers: Trigger[];
|
|
21894
24468
|
}
|
|
21895
24469
|
|
|
21896
24470
|
/**
|
|
@@ -21999,6 +24573,27 @@ export interface EntityApplyDamageOptions {
|
|
|
21999
24573
|
damagingEntity?: Entity;
|
|
22000
24574
|
}
|
|
22001
24575
|
|
|
24576
|
+
/**
|
|
24577
|
+
* @beta
|
|
24578
|
+
* Options used to filter entity container access events.
|
|
24579
|
+
*/
|
|
24580
|
+
export interface EntityContainerAccessEventOptions {
|
|
24581
|
+
/**
|
|
24582
|
+
* @remarks
|
|
24583
|
+
* If present will filter which container access sources can
|
|
24584
|
+
* trigger the event.
|
|
24585
|
+
*
|
|
24586
|
+
*/
|
|
24587
|
+
accessSourceFilter?: ContainerAccessSourceFilter;
|
|
24588
|
+
/**
|
|
24589
|
+
* @remarks
|
|
24590
|
+
* If present will filter which entity containers can trigger
|
|
24591
|
+
* the event.
|
|
24592
|
+
*
|
|
24593
|
+
*/
|
|
24594
|
+
entityFilter?: EntityFilter;
|
|
24595
|
+
}
|
|
24596
|
+
|
|
22002
24597
|
/**
|
|
22003
24598
|
* Provides information about how damage has been applied to an
|
|
22004
24599
|
* entity.
|
|
@@ -22674,6 +25269,37 @@ export interface EntityRaycastOptions extends EntityFilter {
|
|
|
22674
25269
|
maxDistance?: number;
|
|
22675
25270
|
}
|
|
22676
25271
|
|
|
25272
|
+
/**
|
|
25273
|
+
* @beta
|
|
25274
|
+
* Controls when a waypoint is visible based on the state of
|
|
25275
|
+
* the entity it tracks. These rules allow filtering waypoint
|
|
25276
|
+
* visibility by entity conditions like sneaking, invisibility,
|
|
25277
|
+
* and death state.
|
|
25278
|
+
*/
|
|
25279
|
+
export interface EntityVisibilityRules {
|
|
25280
|
+
/**
|
|
25281
|
+
* @remarks
|
|
25282
|
+
* Controls whether the waypoint is shown when the tracked
|
|
25283
|
+
* entity is dead. If undefined, defaults to true.
|
|
25284
|
+
*
|
|
25285
|
+
*/
|
|
25286
|
+
showDead?: boolean;
|
|
25287
|
+
/**
|
|
25288
|
+
* @remarks
|
|
25289
|
+
* Controls whether the waypoint is shown when the tracked
|
|
25290
|
+
* entity is invisible. If undefined, defaults to true.
|
|
25291
|
+
*
|
|
25292
|
+
*/
|
|
25293
|
+
showInvisible?: boolean;
|
|
25294
|
+
/**
|
|
25295
|
+
* @remarks
|
|
25296
|
+
* Controls whether the waypoint is shown when the tracked
|
|
25297
|
+
* entity is sneaking. If undefined, defaults to true.
|
|
25298
|
+
*
|
|
25299
|
+
*/
|
|
25300
|
+
showSneaking?: boolean;
|
|
25301
|
+
}
|
|
25302
|
+
|
|
22677
25303
|
/**
|
|
22678
25304
|
* Equal to operator.
|
|
22679
25305
|
*/
|
|
@@ -23200,6 +25826,39 @@ export interface PlayerSwingEventOptions {
|
|
|
23200
25826
|
swingSource?: EntitySwingSource;
|
|
23201
25827
|
}
|
|
23202
25828
|
|
|
25829
|
+
/**
|
|
25830
|
+
* @beta
|
|
25831
|
+
* Controls when a waypoint is visible based on player-specific
|
|
25832
|
+
* states. Extends {@link EntityVisibilityRules} with
|
|
25833
|
+
* additional rules for player-only states like hidden mode and
|
|
25834
|
+
* spectator mode.
|
|
25835
|
+
*/
|
|
25836
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
25837
|
+
export interface PlayerVisibilityRules extends EntityVisibilityRules {
|
|
25838
|
+
/**
|
|
25839
|
+
* @remarks
|
|
25840
|
+
* Controls whether the waypoint is shown when the tracked
|
|
25841
|
+
* player is hidden. If undefined, defaults to true.
|
|
25842
|
+
*
|
|
25843
|
+
*/
|
|
25844
|
+
showHidden?: boolean;
|
|
25845
|
+
/**
|
|
25846
|
+
* @remarks
|
|
25847
|
+
* Controls whether the waypoint is shown when the tracked
|
|
25848
|
+
* player is in spectator mode. If undefined, defaults to true.
|
|
25849
|
+
*
|
|
25850
|
+
*/
|
|
25851
|
+
showSpectator?: boolean;
|
|
25852
|
+
/**
|
|
25853
|
+
* @remarks
|
|
25854
|
+
* Controls whether the waypoint is shown when a spectator is
|
|
25855
|
+
* viewing another spectator player. If undefined, defaults to
|
|
25856
|
+
* true.
|
|
25857
|
+
*
|
|
25858
|
+
*/
|
|
25859
|
+
showSpectatorToSpectator?: boolean;
|
|
25860
|
+
}
|
|
25861
|
+
|
|
23203
25862
|
/**
|
|
23204
25863
|
* Key frame that holds the progress of the camera animation.
|
|
23205
25864
|
*/
|
|
@@ -23896,6 +26555,60 @@ export interface VectorXZ {
|
|
|
23896
26555
|
z: number;
|
|
23897
26556
|
}
|
|
23898
26557
|
|
|
26558
|
+
/**
|
|
26559
|
+
* @beta
|
|
26560
|
+
* Defines a texture and the distance range in which it should
|
|
26561
|
+
* be displayed. Used within a {@link WaypointTextureSelector}
|
|
26562
|
+
* to create distance-based texture switching.
|
|
26563
|
+
*/
|
|
26564
|
+
export interface WaypointTextureBounds {
|
|
26565
|
+
/**
|
|
26566
|
+
* @remarks
|
|
26567
|
+
* The lower distance bound for this texture. The texture is
|
|
26568
|
+
* displayed when the distance to the waypoint is greater than
|
|
26569
|
+
* this value. Value must be greater than or equal to 0.
|
|
26570
|
+
*
|
|
26571
|
+
* Minimum Value: 0
|
|
26572
|
+
*/
|
|
26573
|
+
lowerBound: number;
|
|
26574
|
+
/**
|
|
26575
|
+
* @remarks
|
|
26576
|
+
* The {@link WaypointTexture} or {@link CustomTexture} to
|
|
26577
|
+
* display within this distance range.
|
|
26578
|
+
*
|
|
26579
|
+
*/
|
|
26580
|
+
texture: CustomTexture | WaypointTexture;
|
|
26581
|
+
/**
|
|
26582
|
+
* @remarks
|
|
26583
|
+
* The upper distance bound for this texture. The texture is
|
|
26584
|
+
* displayed when the distance to the waypoint is less than or
|
|
26585
|
+
* equal to this value. If undefined, there is no upper limit.
|
|
26586
|
+
* Value must be greater than or equal to 0.
|
|
26587
|
+
*
|
|
26588
|
+
* Minimum Value: 0
|
|
26589
|
+
*/
|
|
26590
|
+
upperBound?: number;
|
|
26591
|
+
}
|
|
26592
|
+
|
|
26593
|
+
/**
|
|
26594
|
+
* @beta
|
|
26595
|
+
* Defines how waypoint textures change based on distance.
|
|
26596
|
+
* Contains a list of texture bounds that determine which
|
|
26597
|
+
* texture is displayed at different distance ranges.
|
|
26598
|
+
*/
|
|
26599
|
+
export interface WaypointTextureSelector {
|
|
26600
|
+
/**
|
|
26601
|
+
* @remarks
|
|
26602
|
+
* An array of {@link WaypointTextureBounds} that define which
|
|
26603
|
+
* textures are displayed at different distance ranges. The
|
|
26604
|
+
* system evaluates these bounds to determine the appropriate
|
|
26605
|
+
* texture based on the current distance to the waypoint. The
|
|
26606
|
+
* list has a maximum size limit of 16.
|
|
26607
|
+
*
|
|
26608
|
+
*/
|
|
26609
|
+
textureBoundsList: WaypointTextureBounds[];
|
|
26610
|
+
}
|
|
26611
|
+
|
|
23899
26612
|
/**
|
|
23900
26613
|
* Contains additional options for a playSound occurrence.
|
|
23901
26614
|
*/
|
|
@@ -24079,6 +26792,16 @@ export class InvalidContainerSlotError extends Error {
|
|
|
24079
26792
|
private constructor();
|
|
24080
26793
|
}
|
|
24081
26794
|
|
|
26795
|
+
/**
|
|
26796
|
+
* @beta
|
|
26797
|
+
* This error can occur when accessing components on an entity
|
|
26798
|
+
* that doesn't have them.
|
|
26799
|
+
*/
|
|
26800
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
26801
|
+
export class InvalidEntityComponentError extends Error {
|
|
26802
|
+
private constructor();
|
|
26803
|
+
}
|
|
26804
|
+
|
|
24082
26805
|
/**
|
|
24083
26806
|
* The error called when an entity is invalid. This can occur
|
|
24084
26807
|
* when accessing components on a removed entity.
|
|
@@ -24145,6 +26868,25 @@ export class InvalidStructureError extends Error {
|
|
|
24145
26868
|
private constructor();
|
|
24146
26869
|
}
|
|
24147
26870
|
|
|
26871
|
+
/**
|
|
26872
|
+
* @beta
|
|
26873
|
+
* Error thrown when attempting to perform operations on an
|
|
26874
|
+
* invalid waypoint. A waypoint becomes invalid when it is
|
|
26875
|
+
* removed or when the entity it tracks is no longer valid.
|
|
26876
|
+
*/
|
|
26877
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
26878
|
+
export class InvalidWaypointError extends Error {
|
|
26879
|
+
private constructor();
|
|
26880
|
+
}
|
|
26881
|
+
|
|
26882
|
+
/**
|
|
26883
|
+
* @beta
|
|
26884
|
+
*/
|
|
26885
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
26886
|
+
export class InvalidWaypointTextureSelectorError extends Error {
|
|
26887
|
+
private constructor();
|
|
26888
|
+
}
|
|
26889
|
+
|
|
24148
26890
|
/**
|
|
24149
26891
|
* Thrown when trying to register an item custom component with
|
|
24150
26892
|
* a name that has already been registered.
|
|
@@ -24201,6 +26943,25 @@ export class LocationOutOfWorldBoundariesError extends Error {
|
|
|
24201
26943
|
private constructor();
|
|
24202
26944
|
}
|
|
24203
26945
|
|
|
26946
|
+
/**
|
|
26947
|
+
* @beta
|
|
26948
|
+
* Error thrown when a locator bar operation fails. Contains a
|
|
26949
|
+
* reason code indicating the specific cause of the error.
|
|
26950
|
+
*/
|
|
26951
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
26952
|
+
export class LocatorBarError extends Error {
|
|
26953
|
+
private constructor();
|
|
26954
|
+
/**
|
|
26955
|
+
* @remarks
|
|
26956
|
+
* The {@link LocatorBarErrorReason} code that indicates why
|
|
26957
|
+
* the locator bar operation failed.
|
|
26958
|
+
*
|
|
26959
|
+
* This property can be read in early-execution mode.
|
|
26960
|
+
*
|
|
26961
|
+
*/
|
|
26962
|
+
readonly reason: LocatorBarErrorReason;
|
|
26963
|
+
}
|
|
26964
|
+
|
|
24204
26965
|
/**
|
|
24205
26966
|
* Thrown when a name requires a namespace and an error occurs
|
|
24206
26967
|
* when validating that namespace
|
|
@@ -24221,6 +26982,14 @@ export class PlaceJigsawError extends Error {
|
|
|
24221
26982
|
private constructor();
|
|
24222
26983
|
}
|
|
24223
26984
|
|
|
26985
|
+
/**
|
|
26986
|
+
* @beta
|
|
26987
|
+
*/
|
|
26988
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
26989
|
+
export class PrimitiveShapeError extends Error {
|
|
26990
|
+
private constructor();
|
|
26991
|
+
}
|
|
26992
|
+
|
|
24224
26993
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
24225
26994
|
export class RawMessageError extends Error {
|
|
24226
26995
|
private constructor();
|