@minecraft/server 2.9.0-beta.1.26.30-preview.30 → 2.9.0-rc.1.26.40-preview.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +173 -2358
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
Copyright (c) Microsoft Corporation.
|
|
8
8
|
***************************************************************************** */
|
|
9
9
|
/**
|
|
10
|
-
* @
|
|
10
|
+
* @preview
|
|
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.9.0
|
|
19
|
+
* "version": "2.9.0"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -47,10 +47,6 @@ export enum AimAssistTargetMode {
|
|
|
47
47
|
* function Block.getComponent.
|
|
48
48
|
*/
|
|
49
49
|
export enum BlockComponentTypes {
|
|
50
|
-
/**
|
|
51
|
-
* @beta
|
|
52
|
-
*/
|
|
53
|
-
DynamicProperties = 'minecraft:dynamic_properties',
|
|
54
50
|
FluidContainer = 'minecraft:fluid_container',
|
|
55
51
|
/**
|
|
56
52
|
* @remarks
|
|
@@ -233,55 +229,6 @@ export enum CommandPermissionLevel {
|
|
|
233
229
|
Owner = 4,
|
|
234
230
|
}
|
|
235
231
|
|
|
236
|
-
/**
|
|
237
|
-
* @beta
|
|
238
|
-
* The Action enum determines how the CompoundBlockVolume
|
|
239
|
-
* considers the associated CompoundBlockVolumeItem when
|
|
240
|
-
* performing inside/outside calculations.
|
|
241
|
-
*/
|
|
242
|
-
export enum CompoundBlockVolumeAction {
|
|
243
|
-
/**
|
|
244
|
-
* @remarks
|
|
245
|
-
* The associated BlockVolume is considered a positive space,
|
|
246
|
-
* and any intersection tests are considered hits
|
|
247
|
-
*
|
|
248
|
-
*/
|
|
249
|
-
Add = 0,
|
|
250
|
-
/**
|
|
251
|
-
* @remarks
|
|
252
|
-
* The associated BlockVolume is considered a negative or void
|
|
253
|
-
* space, and any intersection tests are considered misses.
|
|
254
|
-
* Using the Subtract action, it is possible to `punch holes`
|
|
255
|
-
* in block volumes so that any intersection tests may pass
|
|
256
|
-
* through such spaces
|
|
257
|
-
*
|
|
258
|
-
*/
|
|
259
|
-
Subtract = 1,
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* @beta
|
|
264
|
-
* An enum describing the relativity of the
|
|
265
|
-
* CompoundBlockVolumeItem, relative to the parent
|
|
266
|
-
* CompoundVolume.
|
|
267
|
-
*/
|
|
268
|
-
export enum CompoundBlockVolumePositionRelativity {
|
|
269
|
-
/**
|
|
270
|
-
* @remarks
|
|
271
|
-
* The locations within the associated BlockVolume are relative
|
|
272
|
-
* to the CompoundBlockVolume to which they were added
|
|
273
|
-
*
|
|
274
|
-
*/
|
|
275
|
-
Relative = 0,
|
|
276
|
-
/**
|
|
277
|
-
* @remarks
|
|
278
|
-
* The locations within the associated BlockVolume are in
|
|
279
|
-
* absolute world space
|
|
280
|
-
*
|
|
281
|
-
*/
|
|
282
|
-
Absolute = 1,
|
|
283
|
-
}
|
|
284
|
-
|
|
285
232
|
/**
|
|
286
233
|
* Reasons that the {@link
|
|
287
234
|
* @minecraft/server.ContainerRulesError} was thrown.
|
|
@@ -384,13 +331,6 @@ export enum CustomCommandErrorReason {
|
|
|
384
331
|
*
|
|
385
332
|
*/
|
|
386
333
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
387
|
-
/**
|
|
388
|
-
* @beta
|
|
389
|
-
* @remarks
|
|
390
|
-
* Non enum type command parameters cannot use enumName.
|
|
391
|
-
*
|
|
392
|
-
*/
|
|
393
|
-
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
394
334
|
}
|
|
395
335
|
|
|
396
336
|
/**
|
|
@@ -1128,14 +1068,6 @@ export enum EntityComponentTypes {
|
|
|
1128
1068
|
*
|
|
1129
1069
|
*/
|
|
1130
1070
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1131
|
-
/**
|
|
1132
|
-
* @beta
|
|
1133
|
-
* @remarks
|
|
1134
|
-
* Adds NPC capabilities to an entity such as custom skin,
|
|
1135
|
-
* name, and dialogue interactions.
|
|
1136
|
-
*
|
|
1137
|
-
*/
|
|
1138
|
-
Npc = 'minecraft:npc',
|
|
1139
1071
|
/**
|
|
1140
1072
|
* @remarks
|
|
1141
1073
|
* When present on an entity, this entity is on fire.
|
|
@@ -1149,15 +1081,6 @@ export enum EntityComponentTypes {
|
|
|
1149
1081
|
*
|
|
1150
1082
|
*/
|
|
1151
1083
|
Exhaustion = 'minecraft:player.exhaustion',
|
|
1152
|
-
/**
|
|
1153
|
-
* @beta
|
|
1154
|
-
* @remarks
|
|
1155
|
-
* Use this component to access and manipulate the fog
|
|
1156
|
-
* definitions stack of a player. This is only available on
|
|
1157
|
-
* players.
|
|
1158
|
-
*
|
|
1159
|
-
*/
|
|
1160
|
-
Fog = 'minecraft:player.fog',
|
|
1161
1084
|
/**
|
|
1162
1085
|
* @remarks
|
|
1163
1086
|
* Use this component to read the hunger of a player. This is
|
|
@@ -1629,14 +1552,6 @@ export enum EntitySwingSource {
|
|
|
1629
1552
|
* and mainhand slots.
|
|
1630
1553
|
*/
|
|
1631
1554
|
export enum EquipmentSlot {
|
|
1632
|
-
/**
|
|
1633
|
-
* @beta
|
|
1634
|
-
* @remarks
|
|
1635
|
-
* The body slot. This slot is used to hold armor for
|
|
1636
|
-
* non-humanoid mobs.
|
|
1637
|
-
*
|
|
1638
|
-
*/
|
|
1639
|
-
Body = 'Body',
|
|
1640
1555
|
/**
|
|
1641
1556
|
* @remarks
|
|
1642
1557
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1906,14 +1821,6 @@ export enum GameRule {
|
|
|
1906
1821
|
*
|
|
1907
1822
|
*/
|
|
1908
1823
|
PlayersSleepingPercentage = 'playersSleepingPercentage',
|
|
1909
|
-
/**
|
|
1910
|
-
* @beta
|
|
1911
|
-
* @remarks
|
|
1912
|
-
* Controls which player waypoints are automatically added to
|
|
1913
|
-
* the players locator bar.
|
|
1914
|
-
*
|
|
1915
|
-
*/
|
|
1916
|
-
PlayerWaypoints = 'playerWaypoints',
|
|
1917
1824
|
/**
|
|
1918
1825
|
* @remarks
|
|
1919
1826
|
* Controls whether projectiles (entities with a projectile
|
|
@@ -2704,14 +2611,6 @@ export enum PlayerPermissionLevel {
|
|
|
2704
2611
|
Custom = 3,
|
|
2705
2612
|
}
|
|
2706
2613
|
|
|
2707
|
-
/**
|
|
2708
|
-
* @beta
|
|
2709
|
-
*/
|
|
2710
|
-
export enum PlayerWaypointsMode {
|
|
2711
|
-
Everyone = 'Everyone',
|
|
2712
|
-
Off = 'Off',
|
|
2713
|
-
}
|
|
2714
|
-
|
|
2715
2614
|
/**
|
|
2716
2615
|
* Contains objectives and participants for the scoreboard.
|
|
2717
2616
|
*/
|
|
@@ -3038,29 +2937,6 @@ export enum TintMethod {
|
|
|
3038
2937
|
Water = 'Water',
|
|
3039
2938
|
}
|
|
3040
2939
|
|
|
3041
|
-
/**
|
|
3042
|
-
* @beta
|
|
3043
|
-
* An enumeration with the reason that a watchdog is deciding
|
|
3044
|
-
* to terminate execution of a behavior packs' script.
|
|
3045
|
-
*/
|
|
3046
|
-
export enum WatchdogTerminateReason {
|
|
3047
|
-
/**
|
|
3048
|
-
* @remarks
|
|
3049
|
-
* Script runtime for a behavior pack is terminated due to
|
|
3050
|
-
* non-responsiveness from script (a hang or infinite loop).
|
|
3051
|
-
*
|
|
3052
|
-
*/
|
|
3053
|
-
Hang = 'Hang',
|
|
3054
|
-
/**
|
|
3055
|
-
* @remarks
|
|
3056
|
-
* Script runtime for a behavior pack is terminated due to a
|
|
3057
|
-
* stack overflow (a long, and potentially infinite) chain of
|
|
3058
|
-
* function calls.
|
|
3059
|
-
*
|
|
3060
|
-
*/
|
|
3061
|
-
StackOverflow = 'StackOverflow',
|
|
3062
|
-
}
|
|
3063
|
-
|
|
3064
2940
|
/**
|
|
3065
2941
|
* @rc
|
|
3066
2942
|
* Enum representing different texture icons that can be
|
|
@@ -3123,11 +2999,9 @@ export type BlockComponentReturnType<T extends string> = T extends keyof BlockCo
|
|
|
3123
2999
|
: BlockCustomComponentInstance;
|
|
3124
3000
|
|
|
3125
3001
|
export type BlockComponentTypeMap = {
|
|
3126
|
-
dynamic_properties: BlockDynamicPropertiesComponent;
|
|
3127
3002
|
fluid_container: BlockFluidContainerComponent;
|
|
3128
3003
|
inventory: BlockInventoryComponent;
|
|
3129
3004
|
map_color: BlockMapColorComponent;
|
|
3130
|
-
'minecraft:dynamic_properties': BlockDynamicPropertiesComponent;
|
|
3131
3005
|
'minecraft:fluid_container': BlockFluidContainerComponent;
|
|
3132
3006
|
'minecraft:inventory': BlockInventoryComponent;
|
|
3133
3007
|
'minecraft:map_color': BlockMapColorComponent;
|
|
@@ -3248,10 +3122,8 @@ export type EntityComponentTypeMap = {
|
|
|
3248
3122
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
3249
3123
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
3250
3124
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3251
|
-
'minecraft:npc': EntityNpcComponent;
|
|
3252
3125
|
'minecraft:onfire': EntityOnFireComponent;
|
|
3253
3126
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
3254
|
-
'minecraft:player.fog': EntityFogComponent;
|
|
3255
3127
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
3256
3128
|
'minecraft:player.saturation': EntitySaturationComponent;
|
|
3257
3129
|
'minecraft:projectile': EntityProjectileComponent;
|
|
@@ -3283,10 +3155,8 @@ export type EntityComponentTypeMap = {
|
|
|
3283
3155
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3284
3156
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3285
3157
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3286
|
-
npc: EntityNpcComponent;
|
|
3287
3158
|
onfire: EntityOnFireComponent;
|
|
3288
3159
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3289
|
-
'player.fog': EntityFogComponent;
|
|
3290
3160
|
'player.hunger': EntityHungerComponent;
|
|
3291
3161
|
'player.saturation': EntitySaturationComponent;
|
|
3292
3162
|
projectile: EntityProjectileComponent;
|
|
@@ -3304,15 +3174,6 @@ export type EntityComponentTypeMap = {
|
|
|
3304
3174
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3305
3175
|
};
|
|
3306
3176
|
|
|
3307
|
-
/**
|
|
3308
|
-
* @beta
|
|
3309
|
-
*/
|
|
3310
|
-
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3311
|
-
? VanillaEntityIdentifier
|
|
3312
|
-
: T extends string
|
|
3313
|
-
? VanillaEntityIdentifier | T
|
|
3314
|
-
: never;
|
|
3315
|
-
|
|
3316
3177
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3317
3178
|
? ItemComponentTypeMap[T]
|
|
3318
3179
|
: ItemCustomComponentInstance;
|
|
@@ -3338,15 +3199,6 @@ export type ItemComponentTypeMap = {
|
|
|
3338
3199
|
potion: ItemPotionComponent;
|
|
3339
3200
|
};
|
|
3340
3201
|
|
|
3341
|
-
/**
|
|
3342
|
-
* @beta
|
|
3343
|
-
*/
|
|
3344
|
-
export type VanillaEntityIdentifier =
|
|
3345
|
-
| EntityType
|
|
3346
|
-
| minecraftvanilladata.MinecraftEntityTypes
|
|
3347
|
-
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3348
|
-
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3349
|
-
|
|
3350
3202
|
/**
|
|
3351
3203
|
* Handle to an aim-assist category that exists in the
|
|
3352
3204
|
* world.aimAssist registry.
|
|
@@ -3504,9 +3356,7 @@ export class AimAssistCategorySettings {
|
|
|
3504
3356
|
* A record mapping block Ids to their priority settings.
|
|
3505
3357
|
* Larger numbers have greater priority.
|
|
3506
3358
|
*/
|
|
3507
|
-
setBlockPriorities(
|
|
3508
|
-
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3509
|
-
): void;
|
|
3359
|
+
setBlockPriorities(blockPriorities: Record<string, number>): void;
|
|
3510
3360
|
/**
|
|
3511
3361
|
* @remarks
|
|
3512
3362
|
* Sets the priority settings used for block targeting.
|
|
@@ -3525,9 +3375,7 @@ export class AimAssistCategorySettings {
|
|
|
3525
3375
|
* A record mapping entity Ids to their priority settings.
|
|
3526
3376
|
* Larger numbers have greater priority.
|
|
3527
3377
|
*/
|
|
3528
|
-
setEntityPriorities(
|
|
3529
|
-
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3530
|
-
): void;
|
|
3378
|
+
setEntityPriorities(entityPriorities: Record<string, number>): void;
|
|
3531
3379
|
/**
|
|
3532
3380
|
* @remarks
|
|
3533
3381
|
* Sets the priority settings used for entity targeting.
|
|
@@ -3726,10 +3574,8 @@ export class AimAssistPresetSettings {
|
|
|
3726
3574
|
*
|
|
3727
3575
|
* This function can't be called in restricted-execution mode.
|
|
3728
3576
|
*
|
|
3729
|
-
* @param targets
|
|
3730
|
-
* An array of block tags.
|
|
3731
3577
|
*/
|
|
3732
|
-
setExcludedBlockTagTargets(
|
|
3578
|
+
setExcludedBlockTagTargets(blockTagTargets?: string[]): void;
|
|
3733
3579
|
/**
|
|
3734
3580
|
* @remarks
|
|
3735
3581
|
* Sets the list of block Ids to exclude from aim assist
|
|
@@ -3737,10 +3583,8 @@ export class AimAssistPresetSettings {
|
|
|
3737
3583
|
*
|
|
3738
3584
|
* This function can't be called in restricted-execution mode.
|
|
3739
3585
|
*
|
|
3740
|
-
* @param targets
|
|
3741
|
-
* An array of block Ids.
|
|
3742
3586
|
*/
|
|
3743
|
-
setExcludedBlockTargets(
|
|
3587
|
+
setExcludedBlockTargets(blockTargets?: string[]): void;
|
|
3744
3588
|
/**
|
|
3745
3589
|
* @remarks
|
|
3746
3590
|
* Sets the list of entity Ids to exclude from aim assist
|
|
@@ -3748,10 +3592,8 @@ export class AimAssistPresetSettings {
|
|
|
3748
3592
|
*
|
|
3749
3593
|
* This function can't be called in restricted-execution mode.
|
|
3750
3594
|
*
|
|
3751
|
-
* @param targets
|
|
3752
|
-
* An array of entity Ids.
|
|
3753
3595
|
*/
|
|
3754
|
-
setExcludedEntityTargets(
|
|
3596
|
+
setExcludedEntityTargets(entityTargets?: string[]): void;
|
|
3755
3597
|
/**
|
|
3756
3598
|
* @remarks
|
|
3757
3599
|
* Sets the list of entity type families to exclude from aim
|
|
@@ -3759,10 +3601,8 @@ export class AimAssistPresetSettings {
|
|
|
3759
3601
|
*
|
|
3760
3602
|
* This function can't be called in restricted-execution mode.
|
|
3761
3603
|
*
|
|
3762
|
-
* @param targets
|
|
3763
|
-
* An array of entity type families.
|
|
3764
3604
|
*/
|
|
3765
|
-
setExcludedEntityTypeFamilyTargets(
|
|
3605
|
+
setExcludedEntityTypeFamilyTargets(entityTypeFamilyTargets?: string[]): void;
|
|
3766
3606
|
/**
|
|
3767
3607
|
* @remarks
|
|
3768
3608
|
* Sets the per-item aim-assist category Ids.
|
|
@@ -3773,7 +3613,7 @@ export class AimAssistPresetSettings {
|
|
|
3773
3613
|
* A record mapping item Ids to aim-assist category Ids.
|
|
3774
3614
|
* Category Ids must have a namespace.
|
|
3775
3615
|
*/
|
|
3776
|
-
setItemSettings(itemSettings: Record<
|
|
3616
|
+
setItemSettings(itemSettings: Record<string, string>): void;
|
|
3777
3617
|
/**
|
|
3778
3618
|
* @remarks
|
|
3779
3619
|
* Sets the list of item Ids that will target liquid blocks
|
|
@@ -3784,7 +3624,7 @@ export class AimAssistPresetSettings {
|
|
|
3784
3624
|
* @param items
|
|
3785
3625
|
* An array of item Ids.
|
|
3786
3626
|
*/
|
|
3787
|
-
setLiquidTargetingItems(items?:
|
|
3627
|
+
setLiquidTargetingItems(items?: string[]): void;
|
|
3788
3628
|
}
|
|
3789
3629
|
|
|
3790
3630
|
/**
|
|
@@ -3890,28 +3730,6 @@ export class AimAssistRegistry {
|
|
|
3890
3730
|
getPresets(): AimAssistPreset[];
|
|
3891
3731
|
}
|
|
3892
3732
|
|
|
3893
|
-
/**
|
|
3894
|
-
* @beta
|
|
3895
|
-
* Describes a single banner pattern, which includes a colour
|
|
3896
|
-
* and a pattern type.
|
|
3897
|
-
*/
|
|
3898
|
-
export class BannerPattern {
|
|
3899
|
-
private constructor();
|
|
3900
|
-
/**
|
|
3901
|
-
* @remarks
|
|
3902
|
-
* The color to apply to this banner pattern.
|
|
3903
|
-
*
|
|
3904
|
-
*/
|
|
3905
|
-
readonly color: string;
|
|
3906
|
-
/**
|
|
3907
|
-
* @remarks
|
|
3908
|
-
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
3909
|
-
* apply to the banner.
|
|
3910
|
-
*
|
|
3911
|
-
*/
|
|
3912
|
-
readonly pattern: string;
|
|
3913
|
-
}
|
|
3914
|
-
|
|
3915
3733
|
/**
|
|
3916
3734
|
* Describes a type of biome.
|
|
3917
3735
|
*/
|
|
@@ -4005,20 +3823,6 @@ export class Block {
|
|
|
4005
3823
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4006
3824
|
*/
|
|
4007
3825
|
readonly isLiquid: boolean;
|
|
4008
|
-
/**
|
|
4009
|
-
* @beta
|
|
4010
|
-
* @remarks
|
|
4011
|
-
* Returns true if this block is solid and impassible - (e.g.,
|
|
4012
|
-
* a cobblestone block and a diamond block are solid, while a
|
|
4013
|
-
* ladder block and a fence block are not).
|
|
4014
|
-
*
|
|
4015
|
-
* @throws This property can throw when used.
|
|
4016
|
-
*
|
|
4017
|
-
* {@link LocationInUnloadedChunkError}
|
|
4018
|
-
*
|
|
4019
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
4020
|
-
*/
|
|
4021
|
-
readonly isSolid: boolean;
|
|
4022
3826
|
/**
|
|
4023
3827
|
* @remarks
|
|
4024
3828
|
* Returns true if this reference to a block is still valid
|
|
@@ -4184,30 +3988,6 @@ export class Block {
|
|
|
4184
3988
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4185
3989
|
*/
|
|
4186
3990
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4187
|
-
/**
|
|
4188
|
-
* @beta
|
|
4189
|
-
* @remarks
|
|
4190
|
-
* Checks to see whether it is valid to place the specified
|
|
4191
|
-
* block type or block permutation, on a specified face on this
|
|
4192
|
-
* block.
|
|
4193
|
-
*
|
|
4194
|
-
* @param blockToPlace
|
|
4195
|
-
* Block type or block permutation to check placement for.
|
|
4196
|
-
* @param faceToPlaceOn
|
|
4197
|
-
* Optional specific face of this block to check placement
|
|
4198
|
-
* against.
|
|
4199
|
-
* @returns
|
|
4200
|
-
* Returns `true` if the block type or permutation can be
|
|
4201
|
-
* placed on this block, else `false`.
|
|
4202
|
-
* @throws This function can throw errors.
|
|
4203
|
-
*
|
|
4204
|
-
* {@link Error}
|
|
4205
|
-
*
|
|
4206
|
-
* {@link LocationInUnloadedChunkError}
|
|
4207
|
-
*
|
|
4208
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
4209
|
-
*/
|
|
4210
|
-
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
4211
3991
|
/**
|
|
4212
3992
|
* @remarks
|
|
4213
3993
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -4304,29 +4084,6 @@ export class Block {
|
|
|
4304
4084
|
* {@link LocationInUnloadedChunkError}
|
|
4305
4085
|
*/
|
|
4306
4086
|
getLightLevel(): number;
|
|
4307
|
-
/**
|
|
4308
|
-
* @beta
|
|
4309
|
-
* @throws This function can throw errors.
|
|
4310
|
-
*
|
|
4311
|
-
* {@link LocationInUnloadedChunkError}
|
|
4312
|
-
*
|
|
4313
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
4314
|
-
*/
|
|
4315
|
-
getMapColor(): RGBA;
|
|
4316
|
-
/**
|
|
4317
|
-
* @beta
|
|
4318
|
-
* @remarks
|
|
4319
|
-
* Returns array of all loaded block parts if this block has
|
|
4320
|
-
* the 'minecraft:multi_block' trait. If it does not have the
|
|
4321
|
-
* trait returns undefined
|
|
4322
|
-
*
|
|
4323
|
-
* @throws This function can throw errors.
|
|
4324
|
-
*
|
|
4325
|
-
* {@link LocationInUnloadedChunkError}
|
|
4326
|
-
*
|
|
4327
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
4328
|
-
*/
|
|
4329
|
-
getParts(): Block[] | undefined;
|
|
4330
4087
|
/**
|
|
4331
4088
|
* @remarks
|
|
4332
4089
|
* Returns the net redstone power of this block.
|
|
@@ -4594,27 +4351,6 @@ export class Block {
|
|
|
4594
4351
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4595
4352
|
*/
|
|
4596
4353
|
south(steps?: number): Block | undefined;
|
|
4597
|
-
/**
|
|
4598
|
-
* @beta
|
|
4599
|
-
* @remarks
|
|
4600
|
-
* Tries to set the block in the dimension to the state of the
|
|
4601
|
-
* permutation by first checking if the placement is valid.
|
|
4602
|
-
*
|
|
4603
|
-
* This function can't be called in restricted-execution mode.
|
|
4604
|
-
*
|
|
4605
|
-
* @param permutation
|
|
4606
|
-
* Permutation that contains a set of property states for the
|
|
4607
|
-
* Block.
|
|
4608
|
-
* @returns
|
|
4609
|
-
* Returns `true` if the block permutation data was
|
|
4610
|
-
* successfully set, else `false`.
|
|
4611
|
-
* @throws This function can throw errors.
|
|
4612
|
-
*
|
|
4613
|
-
* {@link LocationInUnloadedChunkError}
|
|
4614
|
-
*
|
|
4615
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
4616
|
-
*/
|
|
4617
|
-
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4618
4354
|
/**
|
|
4619
4355
|
* @remarks
|
|
4620
4356
|
* Returns the {@link Block} to the west of this block
|
|
@@ -4632,137 +4368,6 @@ export class Block {
|
|
|
4632
4368
|
west(steps?: number): Block | undefined;
|
|
4633
4369
|
}
|
|
4634
4370
|
|
|
4635
|
-
/**
|
|
4636
|
-
* @beta
|
|
4637
|
-
* Bounding Box Utils is a utility class that provides a number
|
|
4638
|
-
* of useful functions for the creation and utility of {@link
|
|
4639
|
-
* BlockBoundingBox} objects
|
|
4640
|
-
*/
|
|
4641
|
-
export class BlockBoundingBoxUtils {
|
|
4642
|
-
private constructor();
|
|
4643
|
-
/**
|
|
4644
|
-
* @remarks
|
|
4645
|
-
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4646
|
-
* where the min and max components are guaranteed to be (min
|
|
4647
|
-
* <= max)
|
|
4648
|
-
*
|
|
4649
|
-
* This function can't be called in restricted-execution mode.
|
|
4650
|
-
*
|
|
4651
|
-
* @param min
|
|
4652
|
-
* A corner world location
|
|
4653
|
-
* @param max
|
|
4654
|
-
* A corner world location diametrically opposite
|
|
4655
|
-
*/
|
|
4656
|
-
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4657
|
-
/**
|
|
4658
|
-
* @remarks
|
|
4659
|
-
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4660
|
-
* each axis.
|
|
4661
|
-
* Sizes can be negative to perform contraction.
|
|
4662
|
-
* Note: corners can be inverted if the contraction size is
|
|
4663
|
-
* greater than the span, but the min/max relationship will
|
|
4664
|
-
* remain correct
|
|
4665
|
-
*
|
|
4666
|
-
* This function can't be called in restricted-execution mode.
|
|
4667
|
-
*
|
|
4668
|
-
* @returns
|
|
4669
|
-
* Return a new {@link BlockBoundingBox} object representing
|
|
4670
|
-
* the changes
|
|
4671
|
-
*/
|
|
4672
|
-
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4673
|
-
/**
|
|
4674
|
-
* @remarks
|
|
4675
|
-
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4676
|
-
*
|
|
4677
|
-
* This function can't be called in restricted-execution mode.
|
|
4678
|
-
*
|
|
4679
|
-
*/
|
|
4680
|
-
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4681
|
-
/**
|
|
4682
|
-
* @remarks
|
|
4683
|
-
* Expand the initial box object bounds to include the 2nd box
|
|
4684
|
-
* argument. The resultant {@link BlockBoundingBox} object
|
|
4685
|
-
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4686
|
-
* boxes.
|
|
4687
|
-
*
|
|
4688
|
-
* This function can't be called in restricted-execution mode.
|
|
4689
|
-
*
|
|
4690
|
-
* @returns
|
|
4691
|
-
* A new {@link BlockBoundingBox} instance representing the
|
|
4692
|
-
* smallest possible bounding box which can encompass both
|
|
4693
|
-
*/
|
|
4694
|
-
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4695
|
-
/**
|
|
4696
|
-
* @remarks
|
|
4697
|
-
* Calculate the center block of a given {@link
|
|
4698
|
-
* BlockBoundingBox} object.
|
|
4699
|
-
*
|
|
4700
|
-
* This function can't be called in restricted-execution mode.
|
|
4701
|
-
*
|
|
4702
|
-
* @returns
|
|
4703
|
-
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4704
|
-
* blocks, so the center of boxes which have odd numbered
|
|
4705
|
-
* bounds are not mathematically centered...
|
|
4706
|
-
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4707
|
-
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4708
|
-
*/
|
|
4709
|
-
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4710
|
-
/**
|
|
4711
|
-
* @remarks
|
|
4712
|
-
* Calculate the BlockBoundingBox which represents the union
|
|
4713
|
-
* area of two intersecting BlockBoundingBoxes
|
|
4714
|
-
*
|
|
4715
|
-
* This function can't be called in restricted-execution mode.
|
|
4716
|
-
*
|
|
4717
|
-
*/
|
|
4718
|
-
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4719
|
-
/**
|
|
4720
|
-
* @remarks
|
|
4721
|
-
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4722
|
-
*
|
|
4723
|
-
* This function can't be called in restricted-execution mode.
|
|
4724
|
-
*
|
|
4725
|
-
*/
|
|
4726
|
-
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4727
|
-
/**
|
|
4728
|
-
* @remarks
|
|
4729
|
-
* Check to see if two BlockBoundingBox objects intersect
|
|
4730
|
-
*
|
|
4731
|
-
* This function can't be called in restricted-execution mode.
|
|
4732
|
-
*
|
|
4733
|
-
*/
|
|
4734
|
-
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4735
|
-
/**
|
|
4736
|
-
* @remarks
|
|
4737
|
-
* Check to see if a given coordinate is inside a
|
|
4738
|
-
* BlockBoundingBox
|
|
4739
|
-
*
|
|
4740
|
-
* This function can't be called in restricted-execution mode.
|
|
4741
|
-
*
|
|
4742
|
-
*/
|
|
4743
|
-
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4744
|
-
/**
|
|
4745
|
-
* @remarks
|
|
4746
|
-
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4747
|
-
* max))
|
|
4748
|
-
*
|
|
4749
|
-
* This function can't be called in restricted-execution mode.
|
|
4750
|
-
*
|
|
4751
|
-
*/
|
|
4752
|
-
static isValid(box: BlockBoundingBox): boolean;
|
|
4753
|
-
/**
|
|
4754
|
-
* @remarks
|
|
4755
|
-
* Move a BlockBoundingBox by a given amount
|
|
4756
|
-
*
|
|
4757
|
-
* This function can't be called in restricted-execution mode.
|
|
4758
|
-
*
|
|
4759
|
-
* @returns
|
|
4760
|
-
* Return a new BlockBoundingBox object which represents the
|
|
4761
|
-
* change
|
|
4762
|
-
*/
|
|
4763
|
-
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4764
|
-
}
|
|
4765
|
-
|
|
4766
4371
|
/**
|
|
4767
4372
|
* Base type for components associated with blocks.
|
|
4768
4373
|
*/
|
|
@@ -4986,13 +4591,6 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
|
|
|
4986
4591
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4987
4592
|
export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
|
|
4988
4593
|
private constructor();
|
|
4989
|
-
/**
|
|
4990
|
-
* @beta
|
|
4991
|
-
* @remarks
|
|
4992
|
-
* The first update event for the redstone component.
|
|
4993
|
-
*
|
|
4994
|
-
*/
|
|
4995
|
-
readonly firstUpdate: boolean;
|
|
4996
4594
|
/**
|
|
4997
4595
|
* @remarks
|
|
4998
4596
|
* The redstone signal strength passing through this block. It
|
|
@@ -5189,123 +4787,21 @@ export class BlockCustomComponentInstance extends BlockComponent {
|
|
|
5189
4787
|
}
|
|
5190
4788
|
|
|
5191
4789
|
/**
|
|
5192
|
-
*
|
|
5193
|
-
*
|
|
5194
|
-
* Only available with block entities. Up to 1KBytes of data
|
|
5195
|
-
* can be stored per block entity in their dynamic properties
|
|
5196
|
-
* storage.
|
|
5197
|
-
* @example rememberPlayerInteraction.ts
|
|
5198
|
-
* ```typescript
|
|
5199
|
-
* import { system } from '@minecraft/server-wrapper';
|
|
5200
|
-
*
|
|
5201
|
-
* system.beforeEvents.startup.subscribe(initEvent => {
|
|
5202
|
-
* initEvent.blockComponentRegistry.registerCustomComponent('scripting_demo_pack:block_entity_onPlayerInteract', {
|
|
5203
|
-
* onPlayerInteract: e => {
|
|
5204
|
-
* if (e.player === undefined) {
|
|
5205
|
-
* return;
|
|
5206
|
-
* }
|
|
5207
|
-
*
|
|
5208
|
-
* const dynamicProperties = e.block.getComponent('minecraft:dynamic_properties');
|
|
5209
|
-
* if (!dynamicProperties) {
|
|
5210
|
-
* return;
|
|
5211
|
-
* }
|
|
5212
|
-
*
|
|
5213
|
-
* const lastInteractorValue = dynamicProperties.get('last_interactor');
|
|
5214
|
-
* const lastVisitor = typeof lastInteractorValue === 'string' ? lastInteractorValue : 'unknown';
|
|
5215
|
-
* const lastTick = Number(dynamicProperties.get('last_interact_tick') ?? system.currentTick);
|
|
5216
|
-
* const ticksAgo = Math.max(0, system.currentTick - lastTick);
|
|
5217
|
-
*
|
|
5218
|
-
* if (lastVisitor === e.player.name) {
|
|
5219
|
-
* e.player.sendMessage("do you remember that player? I 'member, it was here " + String(ticksAgo) + ' ticks ago!');
|
|
5220
|
-
* } else {
|
|
5221
|
-
* e.player.sendMessage("oh, I don't remember that player");
|
|
5222
|
-
* }
|
|
5223
|
-
*
|
|
5224
|
-
* dynamicProperties.set('last_interactor', e.player.name);
|
|
5225
|
-
* dynamicProperties.set('last_interact_tick', system.currentTick);
|
|
5226
|
-
* },
|
|
5227
|
-
* });
|
|
5228
|
-
* });
|
|
5229
|
-
* ```
|
|
4790
|
+
* Contains information regarding an event that impacts a
|
|
4791
|
+
* specific block.
|
|
5230
4792
|
*/
|
|
5231
|
-
|
|
5232
|
-
export class BlockDynamicPropertiesComponent extends BlockComponent {
|
|
4793
|
+
export class BlockEvent {
|
|
5233
4794
|
private constructor();
|
|
5234
|
-
static readonly componentId = 'minecraft:dynamic_properties';
|
|
5235
4795
|
/**
|
|
5236
4796
|
* @remarks
|
|
5237
|
-
*
|
|
5238
|
-
* key. Keys are unique to each content pack and cannot be used
|
|
5239
|
-
* to retrieve dynamic properties set from other content packs.
|
|
5240
|
-
* Returns undefined if the key was not found.
|
|
5241
|
-
*
|
|
5242
|
-
* @throws This function can throw errors.
|
|
5243
|
-
*
|
|
5244
|
-
* {@link Error}
|
|
5245
|
-
*
|
|
5246
|
-
* {@link InvalidBlockComponentError}
|
|
5247
|
-
*
|
|
5248
|
-
* {@link LocationInUnloadedChunkError}
|
|
4797
|
+
* Block currently in the world at the location of this event.
|
|
5249
4798
|
*
|
|
5250
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
5251
4799
|
*/
|
|
5252
|
-
|
|
4800
|
+
readonly block: Block;
|
|
5253
4801
|
/**
|
|
5254
4802
|
* @remarks
|
|
5255
|
-
*
|
|
5256
|
-
*
|
|
5257
|
-
* set dynamic properties for other content packs. Values can
|
|
5258
|
-
* be either a Number, a String or a Vector3. Setting a
|
|
5259
|
-
* property with an undefined value will remove it from the
|
|
5260
|
-
* storage.
|
|
5261
|
-
*
|
|
5262
|
-
* This function can't be called in restricted-execution mode.
|
|
5263
|
-
*
|
|
5264
|
-
* @throws This function can throw errors.
|
|
5265
|
-
*
|
|
5266
|
-
* {@link Error}
|
|
5267
|
-
*
|
|
5268
|
-
* {@link InvalidBlockComponentError}
|
|
5269
|
-
*
|
|
5270
|
-
* {@link LocationInUnloadedChunkError}
|
|
5271
|
-
*
|
|
5272
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
5273
|
-
*/
|
|
5274
|
-
set(key: string, value?: boolean | number | string | Vector3): void;
|
|
5275
|
-
/**
|
|
5276
|
-
* @remarks
|
|
5277
|
-
* Returns the current size, in bytes, of the dynamic
|
|
5278
|
-
* properties storage for this block entity.
|
|
5279
|
-
*
|
|
5280
|
-
* @throws This function can throw errors.
|
|
5281
|
-
*
|
|
5282
|
-
* {@link Error}
|
|
5283
|
-
*
|
|
5284
|
-
* {@link InvalidBlockComponentError}
|
|
5285
|
-
*
|
|
5286
|
-
* {@link LocationInUnloadedChunkError}
|
|
5287
|
-
*
|
|
5288
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
5289
|
-
*/
|
|
5290
|
-
totalByteCount(): number;
|
|
5291
|
-
}
|
|
5292
|
-
|
|
5293
|
-
/**
|
|
5294
|
-
* Contains information regarding an event that impacts a
|
|
5295
|
-
* specific block.
|
|
5296
|
-
*/
|
|
5297
|
-
export class BlockEvent {
|
|
5298
|
-
private constructor();
|
|
5299
|
-
/**
|
|
5300
|
-
* @remarks
|
|
5301
|
-
* Block currently in the world at the location of this event.
|
|
5302
|
-
*
|
|
5303
|
-
*/
|
|
5304
|
-
readonly block: Block;
|
|
5305
|
-
/**
|
|
5306
|
-
* @remarks
|
|
5307
|
-
* Dimension that contains the block that is the subject of
|
|
5308
|
-
* this event.
|
|
4803
|
+
* Dimension that contains the block that is the subject of
|
|
4804
|
+
* this event.
|
|
5309
4805
|
*
|
|
5310
4806
|
*/
|
|
5311
4807
|
readonly dimension: Dimension;
|
|
@@ -5499,18 +4995,6 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
5499
4995
|
*
|
|
5500
4996
|
*/
|
|
5501
4997
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5502
|
-
/**
|
|
5503
|
-
* @beta
|
|
5504
|
-
* @remarks
|
|
5505
|
-
* Checks if the underlining block volume has been invalidated.
|
|
5506
|
-
* Will return false if the block volume was modified between
|
|
5507
|
-
* creating the iterator and iterating it, and true otherwise.
|
|
5508
|
-
*
|
|
5509
|
-
* @throws This function can throw errors.
|
|
5510
|
-
*
|
|
5511
|
-
* {@link minecraftcommon.EngineError}
|
|
5512
|
-
*/
|
|
5513
|
-
isValid(): boolean;
|
|
5514
4998
|
/**
|
|
5515
4999
|
* @remarks
|
|
5516
5000
|
* This function can't be called in restricted-execution mode.
|
|
@@ -6427,15 +5911,6 @@ export class BlockVolumeBase {
|
|
|
6427
5911
|
*
|
|
6428
5912
|
*/
|
|
6429
5913
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
6430
|
-
/**
|
|
6431
|
-
* @beta
|
|
6432
|
-
* @remarks
|
|
6433
|
-
* Return a {@link BlockBoundingBox} object which represents
|
|
6434
|
-
* the validated min and max coordinates of the volume
|
|
6435
|
-
*
|
|
6436
|
-
* @throws This function can throw errors.
|
|
6437
|
-
*/
|
|
6438
|
-
getBoundingBox(): BlockBoundingBox;
|
|
6439
5914
|
/**
|
|
6440
5915
|
* @remarks
|
|
6441
5916
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -6666,23 +6141,6 @@ export class Camera {
|
|
|
6666
6141
|
| CameraSetRotOptions
|
|
6667
6142
|
| CameraTargetOptions,
|
|
6668
6143
|
): void;
|
|
6669
|
-
/**
|
|
6670
|
-
* @beta
|
|
6671
|
-
* @remarks
|
|
6672
|
-
* Sets the current active camera with easing.
|
|
6673
|
-
*
|
|
6674
|
-
* This function can't be called in restricted-execution mode.
|
|
6675
|
-
*
|
|
6676
|
-
* @param cameraPreset
|
|
6677
|
-
* Identifier of a camera preset file defined within JSON.
|
|
6678
|
-
* @param easeOptions
|
|
6679
|
-
* Options to ease the camera from the previous camera to the
|
|
6680
|
-
* current one.
|
|
6681
|
-
* @throws
|
|
6682
|
-
* Throws when easing to minecraft:first_person presets
|
|
6683
|
-
* currently without the experimental cameras toggle enabled.
|
|
6684
|
-
*/
|
|
6685
|
-
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
6686
6144
|
/**
|
|
6687
6145
|
* @remarks
|
|
6688
6146
|
* Sets the current active camera for the specified player and
|
|
@@ -6722,164 +6180,6 @@ export class CatmullRomSpline {
|
|
|
6722
6180
|
controlPoints: Vector3[];
|
|
6723
6181
|
}
|
|
6724
6182
|
|
|
6725
|
-
/**
|
|
6726
|
-
* @beta
|
|
6727
|
-
* An event that fires as players enter chat messages.
|
|
6728
|
-
*/
|
|
6729
|
-
export class ChatSendAfterEvent {
|
|
6730
|
-
private constructor();
|
|
6731
|
-
/**
|
|
6732
|
-
* @remarks
|
|
6733
|
-
* Message that is being broadcast.
|
|
6734
|
-
*
|
|
6735
|
-
*/
|
|
6736
|
-
readonly message: string;
|
|
6737
|
-
/**
|
|
6738
|
-
* @remarks
|
|
6739
|
-
* Player that sent the chat message.
|
|
6740
|
-
*
|
|
6741
|
-
*/
|
|
6742
|
-
readonly sender: Player;
|
|
6743
|
-
/**
|
|
6744
|
-
* @remarks
|
|
6745
|
-
* Optional list of players that will receive this message. If
|
|
6746
|
-
* defined, this message is directly targeted to one or more
|
|
6747
|
-
* players (i.e., is not broadcast.)
|
|
6748
|
-
*
|
|
6749
|
-
*/
|
|
6750
|
-
readonly targets?: Player[];
|
|
6751
|
-
}
|
|
6752
|
-
|
|
6753
|
-
/**
|
|
6754
|
-
* @beta
|
|
6755
|
-
* Manages callbacks that are connected to chat messages being
|
|
6756
|
-
* sent.
|
|
6757
|
-
*/
|
|
6758
|
-
export class ChatSendAfterEventSignal {
|
|
6759
|
-
private constructor();
|
|
6760
|
-
/**
|
|
6761
|
-
* @remarks
|
|
6762
|
-
* Adds a callback that will be called when new chat messages
|
|
6763
|
-
* are sent.
|
|
6764
|
-
*
|
|
6765
|
-
* This function can't be called in restricted-execution mode.
|
|
6766
|
-
*
|
|
6767
|
-
* This function can be called in early-execution mode.
|
|
6768
|
-
*
|
|
6769
|
-
*/
|
|
6770
|
-
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
6771
|
-
/**
|
|
6772
|
-
* @remarks
|
|
6773
|
-
* Removes a callback from being called when new chat messages
|
|
6774
|
-
* are sent.
|
|
6775
|
-
*
|
|
6776
|
-
* This function can't be called in restricted-execution mode.
|
|
6777
|
-
*
|
|
6778
|
-
* This function can be called in early-execution mode.
|
|
6779
|
-
*
|
|
6780
|
-
*/
|
|
6781
|
-
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
6782
|
-
}
|
|
6783
|
-
|
|
6784
|
-
/**
|
|
6785
|
-
* @beta
|
|
6786
|
-
* An event that fires as players enter chat messages.
|
|
6787
|
-
*/
|
|
6788
|
-
export class ChatSendBeforeEvent {
|
|
6789
|
-
private constructor();
|
|
6790
|
-
/**
|
|
6791
|
-
* @remarks
|
|
6792
|
-
* If set to true in a beforeChat event handler, this message
|
|
6793
|
-
* is not broadcast out.
|
|
6794
|
-
*
|
|
6795
|
-
*/
|
|
6796
|
-
cancel: boolean;
|
|
6797
|
-
/**
|
|
6798
|
-
* @remarks
|
|
6799
|
-
* Message that is being broadcast.
|
|
6800
|
-
*
|
|
6801
|
-
*/
|
|
6802
|
-
readonly message: string;
|
|
6803
|
-
/**
|
|
6804
|
-
* @remarks
|
|
6805
|
-
* Player that sent the chat message.
|
|
6806
|
-
*
|
|
6807
|
-
*/
|
|
6808
|
-
readonly sender: Player;
|
|
6809
|
-
/**
|
|
6810
|
-
* @remarks
|
|
6811
|
-
* Optional list of players that will receive this message. If
|
|
6812
|
-
* defined, this message is directly targeted to one or more
|
|
6813
|
-
* players (i.e., is not broadcast.)
|
|
6814
|
-
*
|
|
6815
|
-
*/
|
|
6816
|
-
readonly targets?: Player[];
|
|
6817
|
-
}
|
|
6818
|
-
|
|
6819
|
-
/**
|
|
6820
|
-
* @beta
|
|
6821
|
-
* Manages callbacks that are connected to an event that fires
|
|
6822
|
-
* before chat messages are sent.
|
|
6823
|
-
* @example customCommand.ts
|
|
6824
|
-
* ```typescript
|
|
6825
|
-
* import { world, DimensionLocation } from '@minecraft/server';
|
|
6826
|
-
*
|
|
6827
|
-
* function customCommand(targetLocation: DimensionLocation) {
|
|
6828
|
-
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
6829
|
-
* if (eventData.message.includes('cancel')) {
|
|
6830
|
-
* // Cancel event if the message contains "cancel"
|
|
6831
|
-
* eventData.cancel = true;
|
|
6832
|
-
* } else {
|
|
6833
|
-
* const args = eventData.message.split(' ');
|
|
6834
|
-
*
|
|
6835
|
-
* if (args.length > 0) {
|
|
6836
|
-
* switch (args[0].toLowerCase()) {
|
|
6837
|
-
* case 'echo':
|
|
6838
|
-
* // Send a modified version of chat message
|
|
6839
|
-
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
6840
|
-
* break;
|
|
6841
|
-
* case 'help':
|
|
6842
|
-
* world.sendMessage(`Available commands: echo <message>`);
|
|
6843
|
-
* break;
|
|
6844
|
-
* }
|
|
6845
|
-
* }
|
|
6846
|
-
* }
|
|
6847
|
-
* });
|
|
6848
|
-
* }
|
|
6849
|
-
* ```
|
|
6850
|
-
*/
|
|
6851
|
-
export class ChatSendBeforeEventSignal {
|
|
6852
|
-
private constructor();
|
|
6853
|
-
/**
|
|
6854
|
-
* @remarks
|
|
6855
|
-
* Adds a callback that will be called before new chat messages
|
|
6856
|
-
* are sent.
|
|
6857
|
-
*
|
|
6858
|
-
* This function can't be called in restricted-execution mode.
|
|
6859
|
-
*
|
|
6860
|
-
* This function can be called in early-execution mode.
|
|
6861
|
-
*
|
|
6862
|
-
* @param callback
|
|
6863
|
-
* This closure is called with restricted-execution privilege.
|
|
6864
|
-
* @returns
|
|
6865
|
-
* Closure that is called with restricted-execution privilege.
|
|
6866
|
-
*/
|
|
6867
|
-
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
6868
|
-
/**
|
|
6869
|
-
* @remarks
|
|
6870
|
-
* Removes a callback from being called before new chat
|
|
6871
|
-
* messages are sent.
|
|
6872
|
-
*
|
|
6873
|
-
* This function can't be called in restricted-execution mode.
|
|
6874
|
-
*
|
|
6875
|
-
* This function can be called in early-execution mode.
|
|
6876
|
-
*
|
|
6877
|
-
* @param callback
|
|
6878
|
-
* This closure is called with restricted-execution privilege.
|
|
6879
|
-
*/
|
|
6880
|
-
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
6881
|
-
}
|
|
6882
|
-
|
|
6883
6183
|
/**
|
|
6884
6184
|
* Contains the device information for a client instance.
|
|
6885
6185
|
*/
|
|
@@ -6953,372 +6253,120 @@ export class Component {
|
|
|
6953
6253
|
}
|
|
6954
6254
|
|
|
6955
6255
|
/**
|
|
6956
|
-
*
|
|
6957
|
-
*
|
|
6958
|
-
*
|
|
6959
|
-
*
|
|
6960
|
-
*
|
|
6961
|
-
*
|
|
6962
|
-
*
|
|
6963
|
-
*
|
|
6964
|
-
*
|
|
6965
|
-
*
|
|
6966
|
-
*
|
|
6967
|
-
*
|
|
6968
|
-
*
|
|
6969
|
-
*
|
|
6970
|
-
*
|
|
6971
|
-
*
|
|
6972
|
-
*
|
|
6973
|
-
*
|
|
6974
|
-
*
|
|
6975
|
-
*
|
|
6976
|
-
*
|
|
6977
|
-
*
|
|
6978
|
-
*
|
|
6256
|
+
* Represents a container that can hold sets of items. Used
|
|
6257
|
+
* with entities such as Players, Chest Minecarts, Llamas, and
|
|
6258
|
+
* more.
|
|
6259
|
+
* @example containers.ts
|
|
6260
|
+
* ```typescript
|
|
6261
|
+
* import { ItemStack, EntityInventoryComponent, BlockInventoryComponent, DimensionLocation } from '@minecraft/server';
|
|
6262
|
+
* import { MinecraftBlockTypes, MinecraftItemTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
6263
|
+
*
|
|
6264
|
+
* function containers(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
|
|
6265
|
+
* const xLocation = targetLocation; // left chest location
|
|
6266
|
+
* const xPlusTwoLocation = { x: targetLocation.x + 2, y: targetLocation.y, z: targetLocation.z }; // right chest
|
|
6267
|
+
*
|
|
6268
|
+
* const chestCart = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.ChestMinecart, {
|
|
6269
|
+
* x: targetLocation.x + 4,
|
|
6270
|
+
* y: targetLocation.y,
|
|
6271
|
+
* z: targetLocation.z,
|
|
6272
|
+
* });
|
|
6273
|
+
*
|
|
6274
|
+
* const xChestBlock = targetLocation.dimension.getBlock(xLocation);
|
|
6275
|
+
* const xPlusTwoChestBlock = targetLocation.dimension.getBlock(xPlusTwoLocation);
|
|
6276
|
+
*
|
|
6277
|
+
* if (!xChestBlock || !xPlusTwoChestBlock) {
|
|
6278
|
+
* log('Could not retrieve chest blocks.');
|
|
6279
|
+
* return;
|
|
6280
|
+
* }
|
|
6281
|
+
*
|
|
6282
|
+
* xChestBlock.setType(MinecraftBlockTypes.Chest);
|
|
6283
|
+
* xPlusTwoChestBlock.setType(MinecraftBlockTypes.Chest);
|
|
6284
|
+
*
|
|
6285
|
+
* const xPlusTwoChestInventoryComp = xPlusTwoChestBlock.getComponent('inventory') as BlockInventoryComponent;
|
|
6286
|
+
* const xChestInventoryComponent = xChestBlock.getComponent('inventory') as BlockInventoryComponent;
|
|
6287
|
+
* const chestCartInventoryComp = chestCart.getComponent('inventory') as EntityInventoryComponent;
|
|
6288
|
+
*
|
|
6289
|
+
* const xPlusTwoChestContainer = xPlusTwoChestInventoryComp.container;
|
|
6290
|
+
* const xChestContainer = xChestInventoryComponent.container;
|
|
6291
|
+
* const chestCartContainer = chestCartInventoryComp.container;
|
|
6292
|
+
*
|
|
6293
|
+
* if (!xPlusTwoChestContainer || !xChestContainer || !chestCartContainer) {
|
|
6294
|
+
* log('Could not retrieve chest containers.');
|
|
6295
|
+
* return;
|
|
6296
|
+
* }
|
|
6297
|
+
*
|
|
6298
|
+
* xPlusTwoChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Apple, 10));
|
|
6299
|
+
* if (xPlusTwoChestContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
|
|
6300
|
+
* log('Expected apple in x+2 container slot index 0', -1);
|
|
6301
|
+
* }
|
|
6302
|
+
*
|
|
6303
|
+
* xPlusTwoChestContainer.setItem(1, new ItemStack(MinecraftItemTypes.Emerald, 10));
|
|
6304
|
+
* if (xPlusTwoChestContainer.getItem(1)?.typeId !== MinecraftItemTypes.Emerald) {
|
|
6305
|
+
* log('Expected emerald in x+2 container slot index 1', -1);
|
|
6306
|
+
* }
|
|
6307
|
+
*
|
|
6308
|
+
* if (xPlusTwoChestContainer.size !== 27) {
|
|
6309
|
+
* log('Unexpected size: ' + xPlusTwoChestContainer.size, -1);
|
|
6310
|
+
* }
|
|
6311
|
+
*
|
|
6312
|
+
* if (xPlusTwoChestContainer.emptySlotsCount !== 25) {
|
|
6313
|
+
* log('Unexpected emptySlotsCount: ' + xPlusTwoChestContainer.emptySlotsCount, -1);
|
|
6314
|
+
* }
|
|
6315
|
+
*
|
|
6316
|
+
* xChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Cake, 10));
|
|
6317
|
+
*
|
|
6318
|
+
* xPlusTwoChestContainer.transferItem(0, chestCartContainer); // transfer the apple from the xPlusTwo chest to a chest cart
|
|
6319
|
+
* xPlusTwoChestContainer.swapItems(1, 0, xChestContainer); // swap the cake from x and the emerald from xPlusTwo
|
|
6320
|
+
*
|
|
6321
|
+
* if (chestCartContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
|
|
6322
|
+
* log('Expected apple in minecraft chest container slot index 0', -1);
|
|
6323
|
+
* }
|
|
6324
|
+
*
|
|
6325
|
+
* if (xChestContainer.getItem(0)?.typeId === MinecraftItemTypes.Emerald) {
|
|
6326
|
+
* log('Expected emerald in x container slot index 0', -1);
|
|
6327
|
+
* }
|
|
6328
|
+
*
|
|
6329
|
+
* if (xPlusTwoChestContainer.getItem(1)?.typeId === MinecraftItemTypes.Cake) {
|
|
6330
|
+
* log('Expected cake in x+2 container slot index 1', -1);
|
|
6331
|
+
* }
|
|
6332
|
+
* }
|
|
6333
|
+
* ```
|
|
6979
6334
|
*/
|
|
6980
|
-
export class
|
|
6335
|
+
export class Container {
|
|
6336
|
+
private constructor();
|
|
6981
6337
|
/**
|
|
6982
6338
|
* @remarks
|
|
6983
|
-
*
|
|
6984
|
-
*
|
|
6339
|
+
* If these rules are defined other container operations will
|
|
6340
|
+
* throw if they cause these rules to be invalidated. For
|
|
6341
|
+
* example, adding a shulker box to a vanilla bundle.
|
|
6985
6342
|
*
|
|
6986
6343
|
*/
|
|
6987
|
-
readonly
|
|
6988
|
-
readonly items: CompoundBlockVolumeItem[];
|
|
6989
|
-
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
6344
|
+
readonly containerRules?: ContainerRules;
|
|
6990
6345
|
/**
|
|
6991
6346
|
* @remarks
|
|
6992
|
-
*
|
|
6993
|
-
* volume stack
|
|
6347
|
+
* Count of the slots in the container that are empty.
|
|
6994
6348
|
*
|
|
6349
|
+
* @throws
|
|
6350
|
+
* Throws if the container is invalid.
|
|
6995
6351
|
*/
|
|
6996
|
-
readonly
|
|
6352
|
+
readonly emptySlotsCount: number;
|
|
6997
6353
|
/**
|
|
6998
6354
|
* @remarks
|
|
6999
|
-
*
|
|
6355
|
+
* Returns whether a container object (or the entity or block
|
|
6356
|
+
* that this container is associated with) is still available
|
|
6357
|
+
* for use in this context.
|
|
7000
6358
|
*
|
|
7001
|
-
* @param origin
|
|
7002
|
-
* An optional world space origin on which to center the
|
|
7003
|
-
* compound volume.
|
|
7004
|
-
* If not specified, the origin is set to (0,0,0)
|
|
7005
6359
|
*/
|
|
7006
|
-
|
|
6360
|
+
readonly isValid: boolean;
|
|
7007
6361
|
/**
|
|
7008
6362
|
* @remarks
|
|
7009
|
-
*
|
|
7010
|
-
*
|
|
7011
|
-
*
|
|
6363
|
+
* The number of slots in this container. For example, a
|
|
6364
|
+
* standard single-block chest has a size of 27. Note, a
|
|
6365
|
+
* player's inventory container contains a total of 36 slots, 9
|
|
6366
|
+
* hotbar slots plus 27 inventory slots.
|
|
7012
6367
|
*
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
/**
|
|
7016
|
-
* @remarks
|
|
7017
|
-
* Fetch a Block Location Iterator for the Compound Block
|
|
7018
|
-
* Volume. This iterator will allow a creator to iterate
|
|
7019
|
-
* across all of the selected volumes within the larger
|
|
7020
|
-
* bounding area.
|
|
7021
|
-
* Areas of a volume which have been overridden by a
|
|
7022
|
-
* subtractive volume will not be included in the iterator
|
|
7023
|
-
* step.
|
|
7024
|
-
* (i.e. if you push a cube to the stack, and then push a
|
|
7025
|
-
* subtractive volume to the same location, then the iterator
|
|
7026
|
-
* will step over the initial volume because it is considered
|
|
7027
|
-
* negative space)
|
|
7028
|
-
* Note that the Block Locations returned by this iterator are
|
|
7029
|
-
* in absolute world space (irrespective of whether the
|
|
7030
|
-
* compound volume items pushed are absolute or relative)
|
|
7031
|
-
*
|
|
7032
|
-
* This function can't be called in restricted-execution mode.
|
|
7033
|
-
*
|
|
7034
|
-
*/
|
|
7035
|
-
getBlockLocationIterator(): BlockLocationIterator;
|
|
7036
|
-
/**
|
|
7037
|
-
* @remarks
|
|
7038
|
-
* Get the largest bounding box that represents a container for
|
|
7039
|
-
* all of the volumes on the stack
|
|
7040
|
-
* Note that the bounding box returned is represented in
|
|
7041
|
-
* absolute world space (irrespective of whether the compound
|
|
7042
|
-
* volume items pushed are absolute or relative)
|
|
7043
|
-
*
|
|
7044
|
-
* This function can't be called in restricted-execution mode.
|
|
7045
|
-
*
|
|
7046
|
-
*/
|
|
7047
|
-
getBoundingBox(): BlockBoundingBox;
|
|
7048
|
-
/**
|
|
7049
|
-
* @remarks
|
|
7050
|
-
* Get the max block location of the outermost bounding
|
|
7051
|
-
* rectangle which represents the volumes on the stack.
|
|
7052
|
-
* Note that the max location returned is in absolute world
|
|
7053
|
-
* space (irrespective of whether the compound volume items
|
|
7054
|
-
* pushed are absolute or relative)
|
|
7055
|
-
*
|
|
7056
|
-
* This function can't be called in restricted-execution mode.
|
|
7057
|
-
*
|
|
7058
|
-
*/
|
|
7059
|
-
getMax(): Vector3;
|
|
7060
|
-
/**
|
|
7061
|
-
* @remarks
|
|
7062
|
-
* Get the min block location of the outermost bounding
|
|
7063
|
-
* rectangle which represents the volumes on the stack.
|
|
7064
|
-
* Note that the min location returned is in absolute world
|
|
7065
|
-
* space (irrespective of whether the compound volume items
|
|
7066
|
-
* pushed are absolute or relative)
|
|
7067
|
-
*
|
|
7068
|
-
* This function can't be called in restricted-execution mode.
|
|
7069
|
-
*
|
|
7070
|
-
*/
|
|
7071
|
-
getMin(): Vector3;
|
|
7072
|
-
/**
|
|
7073
|
-
* @remarks
|
|
7074
|
-
* Fetch the origin in world space of the compound volume
|
|
7075
|
-
*
|
|
7076
|
-
* This function can't be called in restricted-execution mode.
|
|
7077
|
-
*
|
|
7078
|
-
*/
|
|
7079
|
-
getOrigin(): Vector3;
|
|
7080
|
-
/**
|
|
7081
|
-
* @remarks
|
|
7082
|
-
* Return a boolean which signals if there are any volume items
|
|
7083
|
-
* pushed to the volume
|
|
7084
|
-
*
|
|
7085
|
-
* This function can't be called in restricted-execution mode.
|
|
7086
|
-
*
|
|
7087
|
-
*/
|
|
7088
|
-
isEmpty(): boolean;
|
|
7089
|
-
/**
|
|
7090
|
-
* @remarks
|
|
7091
|
-
* Return a boolean representing whether or not a given
|
|
7092
|
-
* absolute world space block location is inside a positive
|
|
7093
|
-
* block volume.
|
|
7094
|
-
* E.g. if the stack contains a large cube followed by a
|
|
7095
|
-
* slightly smaller negative cube, and the test location is
|
|
7096
|
-
* within the negative cube - the function will return false
|
|
7097
|
-
* because it's not 'inside' a volume (it IS inside the
|
|
7098
|
-
* bounding rectangle, but it is not inside a positively
|
|
7099
|
-
* defined location)
|
|
7100
|
-
*
|
|
7101
|
-
* This function can't be called in restricted-execution mode.
|
|
7102
|
-
*
|
|
7103
|
-
*/
|
|
7104
|
-
isInside(worldLocation: Vector3): boolean;
|
|
7105
|
-
/**
|
|
7106
|
-
* @remarks
|
|
7107
|
-
* Inspect the last entry pushed to the volume stack without
|
|
7108
|
-
* affecting the stack contents.
|
|
7109
|
-
*
|
|
7110
|
-
* This function can't be called in restricted-execution mode.
|
|
7111
|
-
*
|
|
7112
|
-
* @param forceRelativity
|
|
7113
|
-
* Determine whether the function returns a
|
|
7114
|
-
* CompoundBlockVolumeItem which is forced into either relative
|
|
7115
|
-
* or absolute coordinate system.
|
|
7116
|
-
* `true` = force returned item to be relative to volume origin
|
|
7117
|
-
* `false` = force returned item to be absolute world space
|
|
7118
|
-
* location
|
|
7119
|
-
*
|
|
7120
|
-
* If no flag is specified, the item returned retains whatever
|
|
7121
|
-
* relativity it had when it was pushed
|
|
7122
|
-
* @returns
|
|
7123
|
-
* Returns undefined if the stack is empty
|
|
7124
|
-
*/
|
|
7125
|
-
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
7126
|
-
/**
|
|
7127
|
-
* @remarks
|
|
7128
|
-
* Remove the last entry from the volume stack. This will
|
|
7129
|
-
* reduce the stack size by one
|
|
7130
|
-
*
|
|
7131
|
-
* This function can't be called in restricted-execution mode.
|
|
7132
|
-
*
|
|
7133
|
-
*/
|
|
7134
|
-
popVolume(): boolean;
|
|
7135
|
-
/**
|
|
7136
|
-
* @remarks
|
|
7137
|
-
* Push a volume item to the stack. The volume item contains
|
|
7138
|
-
* an 'action' parameter which determines whether this volume
|
|
7139
|
-
* is a positive or negative space.
|
|
7140
|
-
* The item also contains a `locationRelativity` which
|
|
7141
|
-
* determines whether it is relative or absolute to the
|
|
7142
|
-
* compound volume origin
|
|
7143
|
-
*
|
|
7144
|
-
* This function can't be called in restricted-execution mode.
|
|
7145
|
-
*
|
|
7146
|
-
* @param item
|
|
7147
|
-
* Item to push to the end of the stack
|
|
7148
|
-
*/
|
|
7149
|
-
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
7150
|
-
/**
|
|
7151
|
-
* @remarks
|
|
7152
|
-
* If the volume stack is empty, this function will push the
|
|
7153
|
-
* specified item to the stack.
|
|
7154
|
-
* If the volume stack is NOT empty, this function will replace
|
|
7155
|
-
* the last item on the stack with the new item.
|
|
7156
|
-
*
|
|
7157
|
-
* This function can't be called in restricted-execution mode.
|
|
7158
|
-
*
|
|
7159
|
-
* @param item
|
|
7160
|
-
* Item to add or replace
|
|
7161
|
-
*/
|
|
7162
|
-
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
7163
|
-
/**
|
|
7164
|
-
* @remarks
|
|
7165
|
-
* Set the origin of the compound volume to an absolute world
|
|
7166
|
-
* space location
|
|
7167
|
-
*
|
|
7168
|
-
* This function can't be called in restricted-execution mode.
|
|
7169
|
-
*
|
|
7170
|
-
* @param preserveExistingVolumes
|
|
7171
|
-
* This optional boolean flag determines whether the relative
|
|
7172
|
-
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
7173
|
-
* affected by the new origin.
|
|
7174
|
-
* Imagine a scenario where you have a series of relative
|
|
7175
|
-
* locations around an origin which make up a sphere; all of
|
|
7176
|
-
* these locations are in the range of -2 to 2.
|
|
7177
|
-
* Push each of these locations to the compound volume as
|
|
7178
|
-
* relative items.
|
|
7179
|
-
* Now, move the origin and all of the locations representing
|
|
7180
|
-
* the sphere move accordingly.
|
|
7181
|
-
* However, let's say you want to add a 2nd sphere next to the
|
|
7182
|
-
* 1st.
|
|
7183
|
-
* In this case, set the new origin a few locations over, but
|
|
7184
|
-
* 'preserveExistingVolumes' = true.
|
|
7185
|
-
* This will set a new origin, but the existing sphere
|
|
7186
|
-
* locations will remain relative to the original origin.
|
|
7187
|
-
* Now, you can push the relative sphere locations again (this
|
|
7188
|
-
* time they will be relative to the new origin) - resulting in
|
|
7189
|
-
* 2 spheres next to each other.
|
|
7190
|
-
*/
|
|
7191
|
-
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
7192
|
-
/**
|
|
7193
|
-
* @remarks
|
|
7194
|
-
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
7195
|
-
* function will translate the origin by a given delta to a new
|
|
7196
|
-
* position
|
|
7197
|
-
*
|
|
7198
|
-
* This function can't be called in restricted-execution mode.
|
|
7199
|
-
*
|
|
7200
|
-
* @param preserveExistingVolumes
|
|
7201
|
-
* See the description for the arguments to {@link
|
|
7202
|
-
* CompoundBlockVolume.setOrigin}
|
|
7203
|
-
*/
|
|
7204
|
-
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
7205
|
-
}
|
|
7206
|
-
|
|
7207
|
-
/**
|
|
7208
|
-
* Represents a container that can hold sets of items. Used
|
|
7209
|
-
* with entities such as Players, Chest Minecarts, Llamas, and
|
|
7210
|
-
* more.
|
|
7211
|
-
* @example containers.ts
|
|
7212
|
-
* ```typescript
|
|
7213
|
-
* import { ItemStack, EntityInventoryComponent, BlockInventoryComponent, DimensionLocation } from '@minecraft/server';
|
|
7214
|
-
* import { MinecraftBlockTypes, MinecraftItemTypes, MinecraftEntityTypes } from '@minecraft/vanilla-data';
|
|
7215
|
-
*
|
|
7216
|
-
* function containers(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
|
|
7217
|
-
* const xLocation = targetLocation; // left chest location
|
|
7218
|
-
* const xPlusTwoLocation = { x: targetLocation.x + 2, y: targetLocation.y, z: targetLocation.z }; // right chest
|
|
7219
|
-
*
|
|
7220
|
-
* const chestCart = targetLocation.dimension.spawnEntity(MinecraftEntityTypes.ChestMinecart, {
|
|
7221
|
-
* x: targetLocation.x + 4,
|
|
7222
|
-
* y: targetLocation.y,
|
|
7223
|
-
* z: targetLocation.z,
|
|
7224
|
-
* });
|
|
7225
|
-
*
|
|
7226
|
-
* const xChestBlock = targetLocation.dimension.getBlock(xLocation);
|
|
7227
|
-
* const xPlusTwoChestBlock = targetLocation.dimension.getBlock(xPlusTwoLocation);
|
|
7228
|
-
*
|
|
7229
|
-
* if (!xChestBlock || !xPlusTwoChestBlock) {
|
|
7230
|
-
* log('Could not retrieve chest blocks.');
|
|
7231
|
-
* return;
|
|
7232
|
-
* }
|
|
7233
|
-
*
|
|
7234
|
-
* xChestBlock.setType(MinecraftBlockTypes.Chest);
|
|
7235
|
-
* xPlusTwoChestBlock.setType(MinecraftBlockTypes.Chest);
|
|
7236
|
-
*
|
|
7237
|
-
* const xPlusTwoChestInventoryComp = xPlusTwoChestBlock.getComponent('inventory') as BlockInventoryComponent;
|
|
7238
|
-
* const xChestInventoryComponent = xChestBlock.getComponent('inventory') as BlockInventoryComponent;
|
|
7239
|
-
* const chestCartInventoryComp = chestCart.getComponent('inventory') as EntityInventoryComponent;
|
|
7240
|
-
*
|
|
7241
|
-
* const xPlusTwoChestContainer = xPlusTwoChestInventoryComp.container;
|
|
7242
|
-
* const xChestContainer = xChestInventoryComponent.container;
|
|
7243
|
-
* const chestCartContainer = chestCartInventoryComp.container;
|
|
7244
|
-
*
|
|
7245
|
-
* if (!xPlusTwoChestContainer || !xChestContainer || !chestCartContainer) {
|
|
7246
|
-
* log('Could not retrieve chest containers.');
|
|
7247
|
-
* return;
|
|
7248
|
-
* }
|
|
7249
|
-
*
|
|
7250
|
-
* xPlusTwoChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Apple, 10));
|
|
7251
|
-
* if (xPlusTwoChestContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
|
|
7252
|
-
* log('Expected apple in x+2 container slot index 0', -1);
|
|
7253
|
-
* }
|
|
7254
|
-
*
|
|
7255
|
-
* xPlusTwoChestContainer.setItem(1, new ItemStack(MinecraftItemTypes.Emerald, 10));
|
|
7256
|
-
* if (xPlusTwoChestContainer.getItem(1)?.typeId !== MinecraftItemTypes.Emerald) {
|
|
7257
|
-
* log('Expected emerald in x+2 container slot index 1', -1);
|
|
7258
|
-
* }
|
|
7259
|
-
*
|
|
7260
|
-
* if (xPlusTwoChestContainer.size !== 27) {
|
|
7261
|
-
* log('Unexpected size: ' + xPlusTwoChestContainer.size, -1);
|
|
7262
|
-
* }
|
|
7263
|
-
*
|
|
7264
|
-
* if (xPlusTwoChestContainer.emptySlotsCount !== 25) {
|
|
7265
|
-
* log('Unexpected emptySlotsCount: ' + xPlusTwoChestContainer.emptySlotsCount, -1);
|
|
7266
|
-
* }
|
|
7267
|
-
*
|
|
7268
|
-
* xChestContainer.setItem(0, new ItemStack(MinecraftItemTypes.Cake, 10));
|
|
7269
|
-
*
|
|
7270
|
-
* xPlusTwoChestContainer.transferItem(0, chestCartContainer); // transfer the apple from the xPlusTwo chest to a chest cart
|
|
7271
|
-
* xPlusTwoChestContainer.swapItems(1, 0, xChestContainer); // swap the cake from x and the emerald from xPlusTwo
|
|
7272
|
-
*
|
|
7273
|
-
* if (chestCartContainer.getItem(0)?.typeId !== MinecraftItemTypes.Apple) {
|
|
7274
|
-
* log('Expected apple in minecraft chest container slot index 0', -1);
|
|
7275
|
-
* }
|
|
7276
|
-
*
|
|
7277
|
-
* if (xChestContainer.getItem(0)?.typeId === MinecraftItemTypes.Emerald) {
|
|
7278
|
-
* log('Expected emerald in x container slot index 0', -1);
|
|
7279
|
-
* }
|
|
7280
|
-
*
|
|
7281
|
-
* if (xPlusTwoChestContainer.getItem(1)?.typeId === MinecraftItemTypes.Cake) {
|
|
7282
|
-
* log('Expected cake in x+2 container slot index 1', -1);
|
|
7283
|
-
* }
|
|
7284
|
-
* }
|
|
7285
|
-
* ```
|
|
7286
|
-
*/
|
|
7287
|
-
export class Container {
|
|
7288
|
-
private constructor();
|
|
7289
|
-
/**
|
|
7290
|
-
* @remarks
|
|
7291
|
-
* If these rules are defined other container operations will
|
|
7292
|
-
* throw if they cause these rules to be invalidated. For
|
|
7293
|
-
* example, adding a shulker box to a vanilla bundle.
|
|
7294
|
-
*
|
|
7295
|
-
*/
|
|
7296
|
-
readonly containerRules?: ContainerRules;
|
|
7297
|
-
/**
|
|
7298
|
-
* @remarks
|
|
7299
|
-
* Count of the slots in the container that are empty.
|
|
7300
|
-
*
|
|
7301
|
-
* @throws
|
|
7302
|
-
* Throws if the container is invalid.
|
|
7303
|
-
*/
|
|
7304
|
-
readonly emptySlotsCount: number;
|
|
7305
|
-
/**
|
|
7306
|
-
* @remarks
|
|
7307
|
-
* Returns whether a container object (or the entity or block
|
|
7308
|
-
* that this container is associated with) is still available
|
|
7309
|
-
* for use in this context.
|
|
7310
|
-
*
|
|
7311
|
-
*/
|
|
7312
|
-
readonly isValid: boolean;
|
|
7313
|
-
/**
|
|
7314
|
-
* @remarks
|
|
7315
|
-
* The number of slots in this container. For example, a
|
|
7316
|
-
* standard single-block chest has a size of 27. Note, a
|
|
7317
|
-
* player's inventory container contains a total of 36 slots, 9
|
|
7318
|
-
* hotbar slots plus 27 inventory slots.
|
|
7319
|
-
*
|
|
7320
|
-
* @throws
|
|
7321
|
-
* Throws if the container is invalid.
|
|
6368
|
+
* @throws
|
|
6369
|
+
* Throws if the container is invalid.
|
|
7322
6370
|
*/
|
|
7323
6371
|
readonly size: number;
|
|
7324
6372
|
/**
|
|
@@ -7341,9 +6389,7 @@ export class Container {
|
|
|
7341
6389
|
*
|
|
7342
6390
|
* @param itemStack
|
|
7343
6391
|
* The stack of items to add.
|
|
7344
|
-
* @throws
|
|
7345
|
-
* Won't throw {@link ContainerRules} error for over weight
|
|
7346
|
-
* limit but will instead add items up to the weight limit.
|
|
6392
|
+
* @throws This function can throw errors.
|
|
7347
6393
|
*
|
|
7348
6394
|
* {@link ContainerRulesError}
|
|
7349
6395
|
*
|
|
@@ -7581,8 +6627,6 @@ export class Container {
|
|
|
7581
6627
|
* @throws
|
|
7582
6628
|
* Throws if either this container or `toContainer` are invalid
|
|
7583
6629
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
7584
|
-
* Won't throw {@link ContainerRules} error for over weight
|
|
7585
|
-
* limit but will instead add items up to the weight limit.
|
|
7586
6630
|
*
|
|
7587
6631
|
* {@link ContainerRulesError}
|
|
7588
6632
|
*
|
|
@@ -8365,30 +7409,6 @@ export class Dimension {
|
|
|
8365
7409
|
block: BlockPermutation | BlockType | string,
|
|
8366
7410
|
options?: BlockFillOptions,
|
|
8367
7411
|
): ListBlockVolume;
|
|
8368
|
-
/**
|
|
8369
|
-
* @beta
|
|
8370
|
-
* @remarks
|
|
8371
|
-
* Finds the location of the closest biome of a particular
|
|
8372
|
-
* type. Note that the findClosestBiome operation can take some
|
|
8373
|
-
* time to complete, so avoid using many of these calls within
|
|
8374
|
-
* a particular tick.
|
|
8375
|
-
*
|
|
8376
|
-
* @param pos
|
|
8377
|
-
* Starting location to look for a biome to find.
|
|
8378
|
-
* @param biomeToFind
|
|
8379
|
-
* Identifier of the biome to look for.
|
|
8380
|
-
* @param options
|
|
8381
|
-
* Additional selection criteria for a biome search.
|
|
8382
|
-
* @returns
|
|
8383
|
-
* Returns a location of the biome, or undefined if a biome
|
|
8384
|
-
* could not be found.
|
|
8385
|
-
* @throws This function can throw errors.
|
|
8386
|
-
*
|
|
8387
|
-
* {@link minecraftcommon.EngineError}
|
|
8388
|
-
*
|
|
8389
|
-
* {@link Error}
|
|
8390
|
-
*/
|
|
8391
|
-
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
8392
7412
|
/**
|
|
8393
7413
|
* @remarks
|
|
8394
7414
|
* Returns the biome type at the specified location.
|
|
@@ -8490,8 +7510,12 @@ export class Dimension {
|
|
|
8490
7510
|
* locations that satisfied the block filter.
|
|
8491
7511
|
* @throws This function can throw errors.
|
|
8492
7512
|
*
|
|
7513
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
7514
|
+
*
|
|
8493
7515
|
* {@link Error}
|
|
8494
7516
|
*
|
|
7517
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7518
|
+
*
|
|
8495
7519
|
* {@link UnloadedChunksError}
|
|
8496
7520
|
*/
|
|
8497
7521
|
getBlocks(volume: BlockVolumeBase, filter: BlockFilter, allowUnloadedChunks?: boolean): ListBlockVolume;
|
|
@@ -8608,26 +7632,6 @@ export class Dimension {
|
|
|
8608
7632
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
8609
7633
|
*/
|
|
8610
7634
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8611
|
-
/**
|
|
8612
|
-
* @beta
|
|
8613
|
-
* @remarks
|
|
8614
|
-
* Returns a vector of generated structures that contain the
|
|
8615
|
-
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
8616
|
-
* The vector will be empty if no structures are found.
|
|
8617
|
-
*
|
|
8618
|
-
* @param location
|
|
8619
|
-
* Location at which to check for structures.
|
|
8620
|
-
* @throws
|
|
8621
|
-
* An error will be thrown if the location is out of world
|
|
8622
|
-
* bounds.
|
|
8623
|
-
* An error will be thrown if the location is in an unloaded
|
|
8624
|
-
* chunk.
|
|
8625
|
-
*
|
|
8626
|
-
* {@link LocationInUnloadedChunkError}
|
|
8627
|
-
*
|
|
8628
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
8629
|
-
*/
|
|
8630
|
-
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
8631
7635
|
/**
|
|
8632
7636
|
* @remarks
|
|
8633
7637
|
* Returns the total brightness level of light shining on a
|
|
@@ -8689,16 +7693,6 @@ export class Dimension {
|
|
|
8689
7693
|
* @throws This function can throw errors.
|
|
8690
7694
|
*/
|
|
8691
7695
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
8692
|
-
/**
|
|
8693
|
-
* @beta
|
|
8694
|
-
* @remarks
|
|
8695
|
-
* Returns the current weather.
|
|
8696
|
-
*
|
|
8697
|
-
* @returns
|
|
8698
|
-
* Returns a WeatherType that explains the broad category of
|
|
8699
|
-
* weather that is currently going on.
|
|
8700
|
-
*/
|
|
8701
|
-
getWeather(): WeatherType;
|
|
8702
7696
|
/**
|
|
8703
7697
|
* @remarks
|
|
8704
7698
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -8944,11 +7938,7 @@ export class Dimension {
|
|
|
8944
7938
|
* }
|
|
8945
7939
|
* ```
|
|
8946
7940
|
*/
|
|
8947
|
-
spawnEntity
|
|
8948
|
-
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
8949
|
-
location: Vector3,
|
|
8950
|
-
options?: SpawnEntityOptions,
|
|
8951
|
-
): Entity;
|
|
7941
|
+
spawnEntity(identifier: EntityType | string, location: Vector3, options?: SpawnEntityOptions): Entity;
|
|
8952
7942
|
/**
|
|
8953
7943
|
* @remarks
|
|
8954
7944
|
* Creates a new item stack as an entity at the specified
|
|
@@ -9043,63 +8033,23 @@ export class Dimension {
|
|
|
9043
8033
|
* ```
|
|
9044
8034
|
*/
|
|
9045
8035
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
8036
|
+
}
|
|
8037
|
+
|
|
8038
|
+
/**
|
|
8039
|
+
* @rc
|
|
8040
|
+
* Provides the functionality for registering custom
|
|
8041
|
+
* dimensions. Custom dimensions can only be registered during
|
|
8042
|
+
* the system startup event.
|
|
8043
|
+
*/
|
|
8044
|
+
export class DimensionRegistry {
|
|
8045
|
+
private constructor();
|
|
9046
8046
|
/**
|
|
9047
|
-
* @beta
|
|
9048
8047
|
* @remarks
|
|
9049
|
-
*
|
|
9050
|
-
* dimension
|
|
8048
|
+
* Registers a new custom dimension type. Must be called during
|
|
8049
|
+
* the system startup event. The dimension will be created
|
|
8050
|
+
* using the void generator.
|
|
9051
8051
|
*
|
|
9052
|
-
* This function can
|
|
9053
|
-
*
|
|
9054
|
-
* @param location
|
|
9055
|
-
* The location at which to spawn the experience orb.
|
|
9056
|
-
* @param amount
|
|
9057
|
-
* The amount of experience to give the experience orb.
|
|
9058
|
-
* Bounds: [1, 12000]
|
|
9059
|
-
* @throws This function can throw errors.
|
|
9060
|
-
*
|
|
9061
|
-
* {@link LocationInUnloadedChunkError}
|
|
9062
|
-
*
|
|
9063
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
9064
|
-
*/
|
|
9065
|
-
spawnXp(location: Vector3, amount: number): void;
|
|
9066
|
-
/**
|
|
9067
|
-
* @beta
|
|
9068
|
-
* @remarks
|
|
9069
|
-
* Stops all sounds from playing for all players.
|
|
9070
|
-
*
|
|
9071
|
-
* This function can't be called in restricted-execution mode.
|
|
9072
|
-
*
|
|
9073
|
-
*/
|
|
9074
|
-
stopAllSounds(): void;
|
|
9075
|
-
/**
|
|
9076
|
-
* @beta
|
|
9077
|
-
* @remarks
|
|
9078
|
-
* Stops a sound from playing for all players.
|
|
9079
|
-
*
|
|
9080
|
-
* This function can't be called in restricted-execution mode.
|
|
9081
|
-
*
|
|
9082
|
-
* @param soundId
|
|
9083
|
-
* Identifier of the sound.
|
|
9084
|
-
*/
|
|
9085
|
-
stopSound(soundId: string): void;
|
|
9086
|
-
}
|
|
9087
|
-
|
|
9088
|
-
/**
|
|
9089
|
-
* @rc
|
|
9090
|
-
* Provides the functionality for registering custom
|
|
9091
|
-
* dimensions. Custom dimensions can only be registered during
|
|
9092
|
-
* the system startup event.
|
|
9093
|
-
*/
|
|
9094
|
-
export class DimensionRegistry {
|
|
9095
|
-
private constructor();
|
|
9096
|
-
/**
|
|
9097
|
-
* @remarks
|
|
9098
|
-
* Registers a new custom dimension type. Must be called during
|
|
9099
|
-
* the system startup event. The dimension will be created
|
|
9100
|
-
* using the void generator.
|
|
9101
|
-
*
|
|
9102
|
-
* This function can be called in early-execution mode.
|
|
8052
|
+
* This function can be called in early-execution mode.
|
|
9103
8053
|
*
|
|
9104
8054
|
* @param typeId
|
|
9105
8055
|
* The namespaced identifier for the custom dimension (e.g.,
|
|
@@ -9635,7 +8585,7 @@ export class Entity {
|
|
|
9635
8585
|
*/
|
|
9636
8586
|
readonly location: Vector3;
|
|
9637
8587
|
/**
|
|
9638
|
-
* @
|
|
8588
|
+
* @rc
|
|
9639
8589
|
* @remarks
|
|
9640
8590
|
* Boolean which determines if the player nameplate should be
|
|
9641
8591
|
* depth tested for visibility.
|
|
@@ -9645,7 +8595,7 @@ export class Entity {
|
|
|
9645
8595
|
*/
|
|
9646
8596
|
nameplateDepthTested: boolean;
|
|
9647
8597
|
/**
|
|
9648
|
-
* @
|
|
8598
|
+
* @rc
|
|
9649
8599
|
* @remarks
|
|
9650
8600
|
* Float that determines the render distance of this entity's
|
|
9651
8601
|
* nameplate.
|
|
@@ -9669,18 +8619,6 @@ export class Entity {
|
|
|
9669
8619
|
*
|
|
9670
8620
|
*/
|
|
9671
8621
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
9672
|
-
/**
|
|
9673
|
-
* @beta
|
|
9674
|
-
* @remarks
|
|
9675
|
-
* Retrieves or sets an entity that is used as the target of
|
|
9676
|
-
* AI-related behaviors, like attacking. If the entity
|
|
9677
|
-
* currently has no target returns undefined.
|
|
9678
|
-
*
|
|
9679
|
-
* @throws This property can throw when used.
|
|
9680
|
-
*
|
|
9681
|
-
* {@link InvalidEntityError}
|
|
9682
|
-
*/
|
|
9683
|
-
readonly target?: Entity;
|
|
9684
8622
|
/**
|
|
9685
8623
|
* @remarks
|
|
9686
8624
|
* Identifier of the type of the entity - for example,
|
|
@@ -10921,18 +9859,6 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
10921
9859
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10922
9860
|
export class EntityBreathableComponent extends EntityComponent {
|
|
10923
9861
|
private constructor();
|
|
10924
|
-
/**
|
|
10925
|
-
* @beta
|
|
10926
|
-
* @remarks
|
|
10927
|
-
* The current air supply of the entity.
|
|
10928
|
-
*
|
|
10929
|
-
* This property can't be edited in restricted-execution mode.
|
|
10930
|
-
*
|
|
10931
|
-
* @throws
|
|
10932
|
-
* Will throw an error if the air supply is out of bounds
|
|
10933
|
-
* [suffocationTime, maxAirSupply].
|
|
10934
|
-
*/
|
|
10935
|
-
airSupply: number;
|
|
10936
9862
|
/**
|
|
10937
9863
|
* @remarks
|
|
10938
9864
|
* If true, this entity can breathe in air.
|
|
@@ -10961,14 +9887,6 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
10961
9887
|
* @throws This property can throw when used.
|
|
10962
9888
|
*/
|
|
10963
9889
|
readonly breathesWater: boolean;
|
|
10964
|
-
/**
|
|
10965
|
-
* @beta
|
|
10966
|
-
* @remarks
|
|
10967
|
-
* If true, the entity is able to breathe.
|
|
10968
|
-
*
|
|
10969
|
-
* @throws This property can throw when used.
|
|
10970
|
-
*/
|
|
10971
|
-
readonly canBreathe: boolean;
|
|
10972
9890
|
/**
|
|
10973
9891
|
* @remarks
|
|
10974
9892
|
* If true, this entity will have visible bubbles while in
|
|
@@ -11444,140 +10362,6 @@ export class EntityFlyingSpeedComponent extends EntityComponent {
|
|
|
11444
10362
|
static readonly componentId = 'minecraft:flying_speed';
|
|
11445
10363
|
}
|
|
11446
10364
|
|
|
11447
|
-
/**
|
|
11448
|
-
* @beta
|
|
11449
|
-
* Provides access to the fog definitions stack of a player
|
|
11450
|
-
* entity, allowing scripts to push, pop, remove, and query
|
|
11451
|
-
* active fog definitions.
|
|
11452
|
-
*/
|
|
11453
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11454
|
-
export class EntityFogComponent extends EntityComponent {
|
|
11455
|
-
private constructor();
|
|
11456
|
-
static readonly componentId = 'minecraft:player.fog';
|
|
11457
|
-
/**
|
|
11458
|
-
* @remarks
|
|
11459
|
-
* Sets the player's fog stack to the given list of fog
|
|
11460
|
-
* identifiers, replacing any existing entries.
|
|
11461
|
-
*
|
|
11462
|
-
* This function can't be called in restricted-execution mode.
|
|
11463
|
-
*
|
|
11464
|
-
* @param fogIds
|
|
11465
|
-
* A stack of fog definition identifiers to set on the player's
|
|
11466
|
-
* fog stack (e.g. ['minecraft:fog_bamboo_jungle']). Maximum of
|
|
11467
|
-
* 16 entries.
|
|
11468
|
-
* @param tag
|
|
11469
|
-
* An optional tag to associate with the new entries, used to
|
|
11470
|
-
* target them with pop or remove.
|
|
11471
|
-
* @throws
|
|
11472
|
-
* Throws if the entity is invalid, if more than 16 fog
|
|
11473
|
-
* identifiers are provided, or if any fog identifier is
|
|
11474
|
-
* invalid.
|
|
11475
|
-
*
|
|
11476
|
-
* {@link EntityFogComponentError}
|
|
11477
|
-
*
|
|
11478
|
-
* {@link InvalidEntityError}
|
|
11479
|
-
*/
|
|
11480
|
-
applyStack(fogIds: string[], tag?: string): void;
|
|
11481
|
-
/**
|
|
11482
|
-
* @remarks
|
|
11483
|
-
* Returns the list of fog identifiers currently on the
|
|
11484
|
-
* player's fog stack, ordered from bottom to top.
|
|
11485
|
-
*
|
|
11486
|
-
* This function can't be called in restricted-execution mode.
|
|
11487
|
-
*
|
|
11488
|
-
* @returns
|
|
11489
|
-
* An array of fog definition identifiers currently on the
|
|
11490
|
-
* stack.
|
|
11491
|
-
* @throws
|
|
11492
|
-
* Throws if the entity is invalid.
|
|
11493
|
-
*
|
|
11494
|
-
* {@link InvalidEntityError}
|
|
11495
|
-
*/
|
|
11496
|
-
getStack(): string[];
|
|
11497
|
-
/**
|
|
11498
|
-
* @remarks
|
|
11499
|
-
* Returns the list of tags currently present on the player's
|
|
11500
|
-
* fog stack.
|
|
11501
|
-
*
|
|
11502
|
-
* This function can't be called in restricted-execution mode.
|
|
11503
|
-
*
|
|
11504
|
-
* @returns
|
|
11505
|
-
* An array of tag strings associated with fog settings on the
|
|
11506
|
-
* stack.
|
|
11507
|
-
* @throws
|
|
11508
|
-
* Throws if the entity is invalid.
|
|
11509
|
-
*
|
|
11510
|
-
* {@link InvalidEntityError}
|
|
11511
|
-
*/
|
|
11512
|
-
getTags(): string[];
|
|
11513
|
-
/**
|
|
11514
|
-
* @remarks
|
|
11515
|
-
* Removes the most recently pushed fog definition from the
|
|
11516
|
-
* player's fog stack.
|
|
11517
|
-
*
|
|
11518
|
-
* This function can't be called in restricted-execution mode.
|
|
11519
|
-
*
|
|
11520
|
-
* @param tag
|
|
11521
|
-
* An optional tag identifying which entry to pop. If provided,
|
|
11522
|
-
* searches the stack from top to bottom and removes the most
|
|
11523
|
-
* recently pushed entry with this tag. If omitted, removes the
|
|
11524
|
-
* most recently pushed entry regardless of tag.
|
|
11525
|
-
* @returns
|
|
11526
|
-
* Returns the identifier of the popped fog definition, or
|
|
11527
|
-
* undefined if the stack was unchanged.
|
|
11528
|
-
* @throws
|
|
11529
|
-
* Throws if the entity is invalid.
|
|
11530
|
-
*
|
|
11531
|
-
* {@link InvalidEntityError}
|
|
11532
|
-
*/
|
|
11533
|
-
pop(tag?: string): string | undefined;
|
|
11534
|
-
/**
|
|
11535
|
-
* @remarks
|
|
11536
|
-
* Pushes a new fog definition onto the player's fog stack.
|
|
11537
|
-
*
|
|
11538
|
-
* This function can't be called in restricted-execution mode.
|
|
11539
|
-
*
|
|
11540
|
-
* @param fogId
|
|
11541
|
-
* The identifier of the fog definition to push onto the stack
|
|
11542
|
-
* (e.g. 'minecraft:fog_bamboo_jungle').
|
|
11543
|
-
* @param tag
|
|
11544
|
-
* An optional tag used to label this fog definition on the
|
|
11545
|
-
* stack, allowing it to be targeted by pop or remove. If
|
|
11546
|
-
* omitted, the entry is stored with the tag 'untagged'.
|
|
11547
|
-
* @returns
|
|
11548
|
-
* Returns the zero-based index at which the fog definition was
|
|
11549
|
-
* inserted into the stack.
|
|
11550
|
-
* @throws
|
|
11551
|
-
* Throws if the entity is invalid, the fog identifier is
|
|
11552
|
-
* invalid, or if the stack limit of 16 has been exceeded.
|
|
11553
|
-
*
|
|
11554
|
-
* {@link EntityFogComponentError}
|
|
11555
|
-
*
|
|
11556
|
-
* {@link InvalidEntityError}
|
|
11557
|
-
*/
|
|
11558
|
-
push(fogId: string, tag?: string): number;
|
|
11559
|
-
/**
|
|
11560
|
-
* @remarks
|
|
11561
|
-
* Removes all fog definitions with the given tag from the
|
|
11562
|
-
* player's fog stack. If no tag is provided, clears all fog
|
|
11563
|
-
* definitions.
|
|
11564
|
-
*
|
|
11565
|
-
* This function can't be called in restricted-execution mode.
|
|
11566
|
-
*
|
|
11567
|
-
* @param tag
|
|
11568
|
-
* An optional tag identifying which the entries to remove. If
|
|
11569
|
-
* omitted, clears all fog definitions regardless of tag.
|
|
11570
|
-
* @returns
|
|
11571
|
-
* Returns true if at least one entry was removed, or false if
|
|
11572
|
-
* the stack was unchanged.
|
|
11573
|
-
* @throws
|
|
11574
|
-
* Throws if the entity is invalid.
|
|
11575
|
-
*
|
|
11576
|
-
* {@link InvalidEntityError}
|
|
11577
|
-
*/
|
|
11578
|
-
remove(tag?: string): boolean;
|
|
11579
|
-
}
|
|
11580
|
-
|
|
11581
10365
|
/**
|
|
11582
10366
|
* Defines how much friction affects this entity.
|
|
11583
10367
|
*/
|
|
@@ -13058,42 +11842,6 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
13058
11842
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
13059
11843
|
}
|
|
13060
11844
|
|
|
13061
|
-
/**
|
|
13062
|
-
* @beta
|
|
13063
|
-
* Adds NPC capabilities to an entity such as custom skin,
|
|
13064
|
-
* name, and dialogue interactions.
|
|
13065
|
-
*/
|
|
13066
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13067
|
-
export class EntityNpcComponent extends EntityComponent {
|
|
13068
|
-
private constructor();
|
|
13069
|
-
/**
|
|
13070
|
-
* @remarks
|
|
13071
|
-
* The DialogueScene that is opened when players first interact
|
|
13072
|
-
* with the NPC.
|
|
13073
|
-
*
|
|
13074
|
-
* This property can't be edited in restricted-execution mode.
|
|
13075
|
-
*
|
|
13076
|
-
*/
|
|
13077
|
-
defaultScene: string;
|
|
13078
|
-
/**
|
|
13079
|
-
* @remarks
|
|
13080
|
-
* The name of the NPC as it is displayed to players.
|
|
13081
|
-
*
|
|
13082
|
-
* This property can't be edited in restricted-execution mode.
|
|
13083
|
-
*
|
|
13084
|
-
*/
|
|
13085
|
-
name: string;
|
|
13086
|
-
/**
|
|
13087
|
-
* @remarks
|
|
13088
|
-
* The index of the skin the NPC will use.
|
|
13089
|
-
*
|
|
13090
|
-
* This property can't be edited in restricted-execution mode.
|
|
13091
|
-
*
|
|
13092
|
-
*/
|
|
13093
|
-
skinIndex: number;
|
|
13094
|
-
static readonly componentId = 'minecraft:npc';
|
|
13095
|
-
}
|
|
13096
|
-
|
|
13097
11845
|
/**
|
|
13098
11846
|
* When present on an entity, this entity is on fire.
|
|
13099
11847
|
* @example setOnFire.ts
|
|
@@ -13766,54 +12514,6 @@ export class EntitySpawnAfterEventSignal {
|
|
|
13766
12514
|
unsubscribe(callback: (arg0: EntitySpawnAfterEvent) => void): void;
|
|
13767
12515
|
}
|
|
13768
12516
|
|
|
13769
|
-
/**
|
|
13770
|
-
* @beta
|
|
13771
|
-
* Contains data related to an entity beginning to sneak.
|
|
13772
|
-
*/
|
|
13773
|
-
export class EntityStartSneakingAfterEvent {
|
|
13774
|
-
private constructor();
|
|
13775
|
-
/**
|
|
13776
|
-
* @remarks
|
|
13777
|
-
* Entity that has started sneaking.
|
|
13778
|
-
*
|
|
13779
|
-
*/
|
|
13780
|
-
readonly entity: Entity;
|
|
13781
|
-
}
|
|
13782
|
-
|
|
13783
|
-
/**
|
|
13784
|
-
* @beta
|
|
13785
|
-
* Manages callbacks that are connected to when an entity
|
|
13786
|
-
* begins sneaking.
|
|
13787
|
-
*/
|
|
13788
|
-
export class EntityStartSneakingAfterEventSignal {
|
|
13789
|
-
private constructor();
|
|
13790
|
-
/**
|
|
13791
|
-
* @remarks
|
|
13792
|
-
* Adds a callback that will be called when an entity begins
|
|
13793
|
-
* sneaking.
|
|
13794
|
-
*
|
|
13795
|
-
* This function can't be called in restricted-execution mode.
|
|
13796
|
-
*
|
|
13797
|
-
* This function can be called in early-execution mode.
|
|
13798
|
-
*
|
|
13799
|
-
*/
|
|
13800
|
-
subscribe(
|
|
13801
|
-
callback: (arg0: EntityStartSneakingAfterEvent) => void,
|
|
13802
|
-
options?: EntitySneakingChangedEventOptions,
|
|
13803
|
-
): (arg0: EntityStartSneakingAfterEvent) => void;
|
|
13804
|
-
/**
|
|
13805
|
-
* @remarks
|
|
13806
|
-
* Removes a callback from being called when an entity begins
|
|
13807
|
-
* sneaking.
|
|
13808
|
-
*
|
|
13809
|
-
* This function can't be called in restricted-execution mode.
|
|
13810
|
-
*
|
|
13811
|
-
* This function can be called in early-execution mode.
|
|
13812
|
-
*
|
|
13813
|
-
*/
|
|
13814
|
-
unsubscribe(callback: (arg0: EntityStartSneakingAfterEvent) => void): void;
|
|
13815
|
-
}
|
|
13816
|
-
|
|
13817
12517
|
/**
|
|
13818
12518
|
* Defines the entity's ability to carry items. An entity with
|
|
13819
12519
|
* a higher strength would have higher potential carry capacity
|
|
@@ -14013,7 +12713,7 @@ export class EntityTypes {
|
|
|
14013
12713
|
* Retrieves an entity type using a string-based identifier.
|
|
14014
12714
|
*
|
|
14015
12715
|
*/
|
|
14016
|
-
static get
|
|
12716
|
+
static get(identifier: string): EntityType | undefined;
|
|
14017
12717
|
/**
|
|
14018
12718
|
* @remarks
|
|
14019
12719
|
* Retrieves a set of all entity types within this world.
|
|
@@ -14610,13 +13310,6 @@ export class GameRules {
|
|
|
14610
13310
|
*
|
|
14611
13311
|
*/
|
|
14612
13312
|
playersSleepingPercentage: number;
|
|
14613
|
-
/**
|
|
14614
|
-
* @beta
|
|
14615
|
-
* @remarks
|
|
14616
|
-
* This property can't be edited in restricted-execution mode.
|
|
14617
|
-
*
|
|
14618
|
-
*/
|
|
14619
|
-
playerWaypoints: PlayerWaypointsMode;
|
|
14620
13313
|
/**
|
|
14621
13314
|
* @remarks
|
|
14622
13315
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -17120,10 +15813,6 @@ export class LootingEnchantFunction extends LootItemFunction {
|
|
|
17120
15813
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
17121
15814
|
export class LootItem extends LootPoolEntry {
|
|
17122
15815
|
private constructor();
|
|
17123
|
-
/**
|
|
17124
|
-
* @beta
|
|
17125
|
-
*/
|
|
17126
|
-
readonly conditions: LootItemCondition[];
|
|
17127
15816
|
readonly functions: LootItemFunction[];
|
|
17128
15817
|
/**
|
|
17129
15818
|
* @remarks
|
|
@@ -17479,33 +16168,6 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
17479
16168
|
readonly itemTagsNone: string[];
|
|
17480
16169
|
}
|
|
17481
16170
|
|
|
17482
|
-
/**
|
|
17483
|
-
* @beta
|
|
17484
|
-
* A specific currently-internal event used for passing
|
|
17485
|
-
* messages from client to server.
|
|
17486
|
-
*/
|
|
17487
|
-
export class MessageReceiveAfterEvent {
|
|
17488
|
-
private constructor();
|
|
17489
|
-
/**
|
|
17490
|
-
* @remarks
|
|
17491
|
-
* The message identifier.
|
|
17492
|
-
*
|
|
17493
|
-
*/
|
|
17494
|
-
readonly id: string;
|
|
17495
|
-
/**
|
|
17496
|
-
* @remarks
|
|
17497
|
-
* The message.
|
|
17498
|
-
*
|
|
17499
|
-
*/
|
|
17500
|
-
readonly message: string;
|
|
17501
|
-
/**
|
|
17502
|
-
* @remarks
|
|
17503
|
-
* The player who sent the message.
|
|
17504
|
-
*
|
|
17505
|
-
*/
|
|
17506
|
-
readonly player: Player;
|
|
17507
|
-
}
|
|
17508
|
-
|
|
17509
16171
|
/**
|
|
17510
16172
|
* Contains a set of additional variable values for further
|
|
17511
16173
|
* defining how rendering and animations function.
|
|
@@ -17574,49 +16236,6 @@ export class MolangVariableMap {
|
|
|
17574
16236
|
setVector3(variableName: string, vector: Vector3): void;
|
|
17575
16237
|
}
|
|
17576
16238
|
|
|
17577
|
-
/**
|
|
17578
|
-
* @beta
|
|
17579
|
-
* Pack setting name and value that changed.
|
|
17580
|
-
*/
|
|
17581
|
-
export class PackSettingChangeAfterEvent {
|
|
17582
|
-
private constructor();
|
|
17583
|
-
/**
|
|
17584
|
-
* @remarks
|
|
17585
|
-
* The name of the setting.
|
|
17586
|
-
*
|
|
17587
|
-
*/
|
|
17588
|
-
readonly settingName: string;
|
|
17589
|
-
/**
|
|
17590
|
-
* @remarks
|
|
17591
|
-
* The value of the setting.
|
|
17592
|
-
*
|
|
17593
|
-
*/
|
|
17594
|
-
readonly settingValue: boolean | number | string;
|
|
17595
|
-
}
|
|
17596
|
-
|
|
17597
|
-
/**
|
|
17598
|
-
* @beta
|
|
17599
|
-
*/
|
|
17600
|
-
export class PackSettingChangeAfterEventSignal {
|
|
17601
|
-
private constructor();
|
|
17602
|
-
/**
|
|
17603
|
-
* @remarks
|
|
17604
|
-
* This function can't be called in restricted-execution mode.
|
|
17605
|
-
*
|
|
17606
|
-
* This function can be called in early-execution mode.
|
|
17607
|
-
*
|
|
17608
|
-
*/
|
|
17609
|
-
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
17610
|
-
/**
|
|
17611
|
-
* @remarks
|
|
17612
|
-
* This function can't be called in restricted-execution mode.
|
|
17613
|
-
*
|
|
17614
|
-
* This function can be called in early-execution mode.
|
|
17615
|
-
*
|
|
17616
|
-
*/
|
|
17617
|
-
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
17618
|
-
}
|
|
17619
|
-
|
|
17620
16239
|
/**
|
|
17621
16240
|
* Loot item condition that checks whether the looting entity
|
|
17622
16241
|
* is currently a passenger of a specific type of entity.
|
|
@@ -17784,62 +16403,6 @@ export class Player extends Entity {
|
|
|
17784
16403
|
* @throws This property can throw when used.
|
|
17785
16404
|
*/
|
|
17786
16405
|
readonly camera: Camera;
|
|
17787
|
-
/**
|
|
17788
|
-
* @beta
|
|
17789
|
-
* @remarks
|
|
17790
|
-
* The player's chat display name, composed from {@link
|
|
17791
|
-
* Player.chatNamePrefix} + {@link Player.name} + {@link
|
|
17792
|
-
* Player.chatNameSuffix}. This is the name shown as the author
|
|
17793
|
-
* of chat messages sent by this player. To change the name
|
|
17794
|
-
* shown above the player's head, use {@link Entity.nameTag}.
|
|
17795
|
-
*
|
|
17796
|
-
* @throws This property can throw when used.
|
|
17797
|
-
*
|
|
17798
|
-
* {@link InvalidEntityError}
|
|
17799
|
-
*/
|
|
17800
|
-
readonly chatDisplayName: string;
|
|
17801
|
-
/**
|
|
17802
|
-
* @beta
|
|
17803
|
-
* @remarks
|
|
17804
|
-
* An optional string that, when set, is prepended to the text
|
|
17805
|
-
* of chat messages sent by this player. Useful for applying
|
|
17806
|
-
* formatting or color codes to a player's messages (e.g., '§a'
|
|
17807
|
-
* to make their messages green). Does not affect the player's
|
|
17808
|
-
* name display - use {@link Player.chatNamePrefix} for the
|
|
17809
|
-
* name shown in chat, or {@link Entity.nameTag} for the name
|
|
17810
|
-
* above the player's head. Set to undefined to clear.
|
|
17811
|
-
*
|
|
17812
|
-
* This property can't be edited in restricted-execution mode.
|
|
17813
|
-
*
|
|
17814
|
-
*/
|
|
17815
|
-
chatMessagePrefix?: string;
|
|
17816
|
-
/**
|
|
17817
|
-
* @beta
|
|
17818
|
-
* @remarks
|
|
17819
|
-
* An optional string that, when set, is prepended to the
|
|
17820
|
-
* player's name in chat messages. Does not affect the name tag
|
|
17821
|
-
* above the player's head or the player list - use {@link
|
|
17822
|
-
* Entity.nameTag} for that. To prefix the message text itself,
|
|
17823
|
-
* use {@link Player.chatMessagePrefix}. Set to undefined to
|
|
17824
|
-
* clear.
|
|
17825
|
-
*
|
|
17826
|
-
* This property can't be edited in restricted-execution mode.
|
|
17827
|
-
*
|
|
17828
|
-
*/
|
|
17829
|
-
chatNamePrefix?: string;
|
|
17830
|
-
/**
|
|
17831
|
-
* @beta
|
|
17832
|
-
* @remarks
|
|
17833
|
-
* An optional string that, when set, is appended to the
|
|
17834
|
-
* player's name in chat messages. Does not affect the name tag
|
|
17835
|
-
* above the player's head or the player list - use {@link
|
|
17836
|
-
* Entity.nameTag} for that. See also {@link
|
|
17837
|
-
* Player.chatNamePrefix}. Set to undefined to clear.
|
|
17838
|
-
*
|
|
17839
|
-
* This property can't be edited in restricted-execution mode.
|
|
17840
|
-
*
|
|
17841
|
-
*/
|
|
17842
|
-
chatNameSuffix?: string;
|
|
17843
16406
|
/**
|
|
17844
16407
|
* @remarks
|
|
17845
16408
|
* Contains the player's device information.
|
|
@@ -17943,18 +16506,6 @@ export class Player extends Entity {
|
|
|
17943
16506
|
* {@link InvalidEntityError}
|
|
17944
16507
|
*/
|
|
17945
16508
|
readonly playerPermissionLevel: PlayerPermissionLevel;
|
|
17946
|
-
/**
|
|
17947
|
-
* @beta
|
|
17948
|
-
* @remarks
|
|
17949
|
-
* Gets the player's Playfab ID.
|
|
17950
|
-
*
|
|
17951
|
-
* @throws This property can throw when used.
|
|
17952
|
-
*
|
|
17953
|
-
* {@link minecraftcommon.EngineError}
|
|
17954
|
-
*
|
|
17955
|
-
* {@link InvalidEntityError}
|
|
17956
|
-
*/
|
|
17957
|
-
readonly playfabId: string;
|
|
17958
16509
|
/**
|
|
17959
16510
|
* @remarks
|
|
17960
16511
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -18022,20 +16573,6 @@ export class Player extends Entity {
|
|
|
18022
16573
|
* Throws if the Entity or Entity ID is invalid.
|
|
18023
16574
|
*/
|
|
18024
16575
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
18025
|
-
/**
|
|
18026
|
-
* @beta
|
|
18027
|
-
* @remarks
|
|
18028
|
-
* Eats an item, providing the item's hunger and saturation
|
|
18029
|
-
* effects to the player. Can only be used on food items.
|
|
18030
|
-
*
|
|
18031
|
-
* This function can't be called in restricted-execution mode.
|
|
18032
|
-
*
|
|
18033
|
-
* @param itemStack
|
|
18034
|
-
* The item to eat.
|
|
18035
|
-
* @throws
|
|
18036
|
-
* Throws if the item is not a food item.
|
|
18037
|
-
*/
|
|
18038
|
-
eatItem(itemStack: ItemStack): void;
|
|
18039
16576
|
/**
|
|
18040
16577
|
* @remarks
|
|
18041
16578
|
* The player's aim-assist settings.
|
|
@@ -18069,22 +16606,6 @@ export class Player extends Entity {
|
|
|
18069
16606
|
* @throws This function can throw errors.
|
|
18070
16607
|
*/
|
|
18071
16608
|
getItemCooldown(cooldownCategory: string): number;
|
|
18072
|
-
/**
|
|
18073
|
-
* @beta
|
|
18074
|
-
* @remarks
|
|
18075
|
-
* Gets the player's ping in milliseconds.
|
|
18076
|
-
*
|
|
18077
|
-
* This function can't be called in restricted-execution mode.
|
|
18078
|
-
*
|
|
18079
|
-
* @returns
|
|
18080
|
-
* The player's ping in milliseconds.
|
|
18081
|
-
* @throws This function can throw errors.
|
|
18082
|
-
*
|
|
18083
|
-
* {@link minecraftcommon.EngineError}
|
|
18084
|
-
*
|
|
18085
|
-
* {@link InvalidEntityError}
|
|
18086
|
-
*/
|
|
18087
|
-
getPing(): number;
|
|
18088
16609
|
/**
|
|
18089
16610
|
* @remarks
|
|
18090
16611
|
* Gets the current spawn point of the player.
|
|
@@ -18156,17 +16677,6 @@ export class Player extends Entity {
|
|
|
18156
16677
|
* ```
|
|
18157
16678
|
*/
|
|
18158
16679
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): SoundInstance;
|
|
18159
|
-
/**
|
|
18160
|
-
* @beta
|
|
18161
|
-
* @remarks
|
|
18162
|
-
* This is an internal-facing method for posting a system
|
|
18163
|
-
* message to downstream clients.
|
|
18164
|
-
*
|
|
18165
|
-
* This function can't be called in restricted-execution mode.
|
|
18166
|
-
*
|
|
18167
|
-
* @throws This function can throw errors.
|
|
18168
|
-
*/
|
|
18169
|
-
postClientMessage(id: string, value: string): void;
|
|
18170
16680
|
/**
|
|
18171
16681
|
* @remarks
|
|
18172
16682
|
* Queues an additional music track that only this particular
|
|
@@ -18442,18 +16952,6 @@ export class Player extends Entity {
|
|
|
18442
16952
|
* @throws This function can throw errors.
|
|
18443
16953
|
*/
|
|
18444
16954
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
18445
|
-
/**
|
|
18446
|
-
* @beta
|
|
18447
|
-
* @remarks
|
|
18448
|
-
* Stops all sounds from playing for this particular player.
|
|
18449
|
-
*
|
|
18450
|
-
* This function can't be called in restricted-execution mode.
|
|
18451
|
-
*
|
|
18452
|
-
* @throws This function can throw errors.
|
|
18453
|
-
*
|
|
18454
|
-
* {@link InvalidEntityError}
|
|
18455
|
-
*/
|
|
18456
|
-
stopAllSounds(): void;
|
|
18457
16955
|
/**
|
|
18458
16956
|
* @remarks
|
|
18459
16957
|
* Stops any music tracks from playing for this particular
|
|
@@ -18464,20 +16962,6 @@ export class Player extends Entity {
|
|
|
18464
16962
|
* @throws This function can throw errors.
|
|
18465
16963
|
*/
|
|
18466
16964
|
stopMusic(): void;
|
|
18467
|
-
/**
|
|
18468
|
-
* @beta
|
|
18469
|
-
* @remarks
|
|
18470
|
-
* Stops a sound from playing for this particular player.
|
|
18471
|
-
*
|
|
18472
|
-
* This function can't be called in restricted-execution mode.
|
|
18473
|
-
*
|
|
18474
|
-
* @param soundId
|
|
18475
|
-
* Identifier of the sound.
|
|
18476
|
-
* @throws This function can throw errors.
|
|
18477
|
-
*
|
|
18478
|
-
* {@link InvalidEntityError}
|
|
18479
|
-
*/
|
|
18480
|
-
stopSound(soundId: string): void;
|
|
18481
16965
|
}
|
|
18482
16966
|
|
|
18483
16967
|
/**
|
|
@@ -18711,83 +17195,6 @@ export class PlayerButtonInputAfterEventSignal {
|
|
|
18711
17195
|
unsubscribe(callback: (arg0: PlayerButtonInputAfterEvent) => void): void;
|
|
18712
17196
|
}
|
|
18713
17197
|
|
|
18714
|
-
/**
|
|
18715
|
-
* @beta
|
|
18716
|
-
* Contains information regarding an event after a player
|
|
18717
|
-
* cancels breaking a block.
|
|
18718
|
-
*/
|
|
18719
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18720
|
-
export class PlayerCancelBreakingBlockAfterEvent extends BlockEvent {
|
|
18721
|
-
private constructor();
|
|
18722
|
-
/**
|
|
18723
|
-
* @remarks
|
|
18724
|
-
* The permutation of the block that the player cancelled
|
|
18725
|
-
* breaking.
|
|
18726
|
-
*
|
|
18727
|
-
*/
|
|
18728
|
-
readonly blockPermutation: BlockPermutation;
|
|
18729
|
-
/**
|
|
18730
|
-
* @remarks
|
|
18731
|
-
* The progress of breaking the block when the player cancelled
|
|
18732
|
-
* in the exclusive range (0, 1).
|
|
18733
|
-
*
|
|
18734
|
-
*/
|
|
18735
|
-
readonly breakProgress: number;
|
|
18736
|
-
/**
|
|
18737
|
-
* @remarks
|
|
18738
|
-
* The face of the block that was being broken.
|
|
18739
|
-
*
|
|
18740
|
-
*/
|
|
18741
|
-
readonly face: Direction;
|
|
18742
|
-
/**
|
|
18743
|
-
* @remarks
|
|
18744
|
-
* The item stack that the player was using to break the block,
|
|
18745
|
-
* or undefined if empty hand.
|
|
18746
|
-
*
|
|
18747
|
-
*/
|
|
18748
|
-
readonly heldItemStack?: ItemStack;
|
|
18749
|
-
/**
|
|
18750
|
-
* @remarks
|
|
18751
|
-
* Player that cancelled breaking the block for this event.
|
|
18752
|
-
*
|
|
18753
|
-
*/
|
|
18754
|
-
readonly player: Player;
|
|
18755
|
-
}
|
|
18756
|
-
|
|
18757
|
-
/**
|
|
18758
|
-
* @beta
|
|
18759
|
-
* Manages callbacks that are connected to when a player
|
|
18760
|
-
* cancels breaking a block.
|
|
18761
|
-
*/
|
|
18762
|
-
export class PlayerCancelBreakingBlockAfterEventSignal {
|
|
18763
|
-
private constructor();
|
|
18764
|
-
/**
|
|
18765
|
-
* @remarks
|
|
18766
|
-
* Adds a callback that will be called when a player cancels
|
|
18767
|
-
* breaking a block.
|
|
18768
|
-
*
|
|
18769
|
-
* This function can't be called in restricted-execution mode.
|
|
18770
|
-
*
|
|
18771
|
-
* This function can be called in early-execution mode.
|
|
18772
|
-
*
|
|
18773
|
-
*/
|
|
18774
|
-
subscribe(
|
|
18775
|
-
callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void,
|
|
18776
|
-
options?: PlayerBreakingBlockEventOptions,
|
|
18777
|
-
): (arg0: PlayerCancelBreakingBlockAfterEvent) => void;
|
|
18778
|
-
/**
|
|
18779
|
-
* @remarks
|
|
18780
|
-
* Removes a callback from being called when a player cancels
|
|
18781
|
-
* breaking a block.
|
|
18782
|
-
*
|
|
18783
|
-
* This function can't be called in restricted-execution mode.
|
|
18784
|
-
*
|
|
18785
|
-
* This function can be called in early-execution mode.
|
|
18786
|
-
*
|
|
18787
|
-
*/
|
|
18788
|
-
unsubscribe(callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void): void;
|
|
18789
|
-
}
|
|
18790
|
-
|
|
18791
17198
|
/**
|
|
18792
17199
|
* Represents the players cursor inventory. Used when moving
|
|
18793
17200
|
* items between between containers in the inventory UI. Not
|
|
@@ -19839,88 +18246,6 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
19839
18246
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
19840
18247
|
}
|
|
19841
18248
|
|
|
19842
|
-
/**
|
|
19843
|
-
* @beta
|
|
19844
|
-
* Contains information regarding an event before a player
|
|
19845
|
-
* places a block.
|
|
19846
|
-
*/
|
|
19847
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19848
|
-
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
19849
|
-
private constructor();
|
|
19850
|
-
/**
|
|
19851
|
-
* @remarks
|
|
19852
|
-
* If set to true, cancels the block place event.
|
|
19853
|
-
*
|
|
19854
|
-
*/
|
|
19855
|
-
cancel: boolean;
|
|
19856
|
-
/**
|
|
19857
|
-
* @remarks
|
|
19858
|
-
* The face of the block that the new block is being placed on.
|
|
19859
|
-
*
|
|
19860
|
-
*/
|
|
19861
|
-
readonly face: Direction;
|
|
19862
|
-
/**
|
|
19863
|
-
* @remarks
|
|
19864
|
-
* Location relative to the bottom north-west corner of the
|
|
19865
|
-
* block where the new block is being placed onto.
|
|
19866
|
-
*
|
|
19867
|
-
*/
|
|
19868
|
-
readonly faceLocation: Vector3;
|
|
19869
|
-
/**
|
|
19870
|
-
* @remarks
|
|
19871
|
-
* The block permutation that will be placed if the event is
|
|
19872
|
-
* not cancelled.
|
|
19873
|
-
*
|
|
19874
|
-
*/
|
|
19875
|
-
readonly permutationToPlace: BlockPermutation;
|
|
19876
|
-
/**
|
|
19877
|
-
* @remarks
|
|
19878
|
-
* Player that is placing the block for this event.
|
|
19879
|
-
*
|
|
19880
|
-
*/
|
|
19881
|
-
readonly player: Player;
|
|
19882
|
-
}
|
|
19883
|
-
|
|
19884
|
-
/**
|
|
19885
|
-
* @beta
|
|
19886
|
-
* Manages callbacks that are connected to before a block is
|
|
19887
|
-
* placed by a player.
|
|
19888
|
-
*/
|
|
19889
|
-
export class PlayerPlaceBlockBeforeEventSignal {
|
|
19890
|
-
private constructor();
|
|
19891
|
-
/**
|
|
19892
|
-
* @remarks
|
|
19893
|
-
* Adds a callback that will be called before a block is placed
|
|
19894
|
-
* by a player.
|
|
19895
|
-
*
|
|
19896
|
-
* This function can't be called in restricted-execution mode.
|
|
19897
|
-
*
|
|
19898
|
-
* This function can be called in early-execution mode.
|
|
19899
|
-
*
|
|
19900
|
-
* @param callback
|
|
19901
|
-
* This closure is called with restricted-execution privilege.
|
|
19902
|
-
* @returns
|
|
19903
|
-
* Closure that is called with restricted-execution privilege.
|
|
19904
|
-
*/
|
|
19905
|
-
subscribe(
|
|
19906
|
-
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
19907
|
-
options?: BlockEventOptions,
|
|
19908
|
-
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
19909
|
-
/**
|
|
19910
|
-
* @remarks
|
|
19911
|
-
* Removes a callback from being called before an block is
|
|
19912
|
-
* placed by a player.
|
|
19913
|
-
*
|
|
19914
|
-
* This function can't be called in restricted-execution mode.
|
|
19915
|
-
*
|
|
19916
|
-
* This function can be called in early-execution mode.
|
|
19917
|
-
*
|
|
19918
|
-
* @param callback
|
|
19919
|
-
* This closure is called with restricted-execution privilege.
|
|
19920
|
-
*/
|
|
19921
|
-
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
19922
|
-
}
|
|
19923
|
-
|
|
19924
18249
|
/**
|
|
19925
18250
|
* An event that contains more information about a player
|
|
19926
18251
|
* spawning.
|
|
@@ -19975,76 +18300,6 @@ export class PlayerSpawnAfterEventSignal {
|
|
|
19975
18300
|
unsubscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): void;
|
|
19976
18301
|
}
|
|
19977
18302
|
|
|
19978
|
-
/**
|
|
19979
|
-
* @beta
|
|
19980
|
-
* Contains information regarding an event after a player
|
|
19981
|
-
* starts breaking a block.
|
|
19982
|
-
*/
|
|
19983
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19984
|
-
export class PlayerStartBreakingBlockAfterEvent extends BlockEvent {
|
|
19985
|
-
private constructor();
|
|
19986
|
-
/**
|
|
19987
|
-
* @remarks
|
|
19988
|
-
* The permutation of the block that the player is starting to
|
|
19989
|
-
* break.
|
|
19990
|
-
*
|
|
19991
|
-
*/
|
|
19992
|
-
readonly blockPermutation: BlockPermutation;
|
|
19993
|
-
/**
|
|
19994
|
-
* @remarks
|
|
19995
|
-
* The face of the block being broken.
|
|
19996
|
-
*
|
|
19997
|
-
*/
|
|
19998
|
-
readonly face: Direction;
|
|
19999
|
-
/**
|
|
20000
|
-
* @remarks
|
|
20001
|
-
* The item stack that the player is using to break the block,
|
|
20002
|
-
* or undefined if empty hand.
|
|
20003
|
-
*
|
|
20004
|
-
*/
|
|
20005
|
-
readonly heldItemStack?: ItemStack;
|
|
20006
|
-
/**
|
|
20007
|
-
* @remarks
|
|
20008
|
-
* Player that started breaking the block for this event.
|
|
20009
|
-
*
|
|
20010
|
-
*/
|
|
20011
|
-
readonly player: Player;
|
|
20012
|
-
}
|
|
20013
|
-
|
|
20014
|
-
/**
|
|
20015
|
-
* @beta
|
|
20016
|
-
* Manages callbacks that are connected to when a player starts
|
|
20017
|
-
* breaking a block.
|
|
20018
|
-
*/
|
|
20019
|
-
export class PlayerStartBreakingBlockAfterEventSignal {
|
|
20020
|
-
private constructor();
|
|
20021
|
-
/**
|
|
20022
|
-
* @remarks
|
|
20023
|
-
* Adds a callback that will be called when a player starts
|
|
20024
|
-
* breaking a block.
|
|
20025
|
-
*
|
|
20026
|
-
* This function can't be called in restricted-execution mode.
|
|
20027
|
-
*
|
|
20028
|
-
* This function can be called in early-execution mode.
|
|
20029
|
-
*
|
|
20030
|
-
*/
|
|
20031
|
-
subscribe(
|
|
20032
|
-
callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void,
|
|
20033
|
-
options?: PlayerBreakingBlockEventOptions,
|
|
20034
|
-
): (arg0: PlayerStartBreakingBlockAfterEvent) => void;
|
|
20035
|
-
/**
|
|
20036
|
-
* @remarks
|
|
20037
|
-
* Removes a callback from being called when a player starts
|
|
20038
|
-
* breaking a block.
|
|
20039
|
-
*
|
|
20040
|
-
* This function can't be called in restricted-execution mode.
|
|
20041
|
-
*
|
|
20042
|
-
* This function can be called in early-execution mode.
|
|
20043
|
-
*
|
|
20044
|
-
*/
|
|
20045
|
-
unsubscribe(callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void): void;
|
|
20046
|
-
}
|
|
20047
|
-
|
|
20048
18303
|
/**
|
|
20049
18304
|
* Contains information regarding a player starting to swing
|
|
20050
18305
|
* their arm.
|
|
@@ -20060,127 +18315,53 @@ export class PlayerSwingStartAfterEvent {
|
|
|
20060
18315
|
readonly heldItemStack?: ItemStack;
|
|
20061
18316
|
/**
|
|
20062
18317
|
* @remarks
|
|
20063
|
-
* Source Player for this event.
|
|
20064
|
-
*
|
|
20065
|
-
*/
|
|
20066
|
-
readonly player: Player;
|
|
20067
|
-
/**
|
|
20068
|
-
* @remarks
|
|
20069
|
-
* The source of the Player swing, see {@link
|
|
20070
|
-
* EntitySwingSource}.
|
|
20071
|
-
*
|
|
20072
|
-
*/
|
|
20073
|
-
readonly swingSource: EntitySwingSource;
|
|
20074
|
-
}
|
|
20075
|
-
|
|
20076
|
-
/**
|
|
20077
|
-
* Manages callbacks that are connected to when a player starts
|
|
20078
|
-
* to swing their arm (e.g. attacking, using an item,
|
|
20079
|
-
* interacting).
|
|
20080
|
-
*/
|
|
20081
|
-
export class PlayerSwingStartAfterEventSignal {
|
|
20082
|
-
private constructor();
|
|
20083
|
-
/**
|
|
20084
|
-
* @remarks
|
|
20085
|
-
* Adds a callback that will be called when a player starts to
|
|
20086
|
-
* swing their arm (e.g. attacking, using an item,
|
|
20087
|
-
* interacting).
|
|
20088
|
-
*
|
|
20089
|
-
* This function can't be called in restricted-execution mode.
|
|
20090
|
-
*
|
|
20091
|
-
* This function can be called in early-execution mode.
|
|
20092
|
-
*
|
|
20093
|
-
*/
|
|
20094
|
-
subscribe(
|
|
20095
|
-
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
20096
|
-
options?: PlayerSwingEventOptions,
|
|
20097
|
-
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
20098
|
-
/**
|
|
20099
|
-
* @remarks
|
|
20100
|
-
* Removes a callback from being called when a player starts to
|
|
20101
|
-
* swing their arm (e.g. attacking, using an item,
|
|
20102
|
-
* interacting).
|
|
20103
|
-
*
|
|
20104
|
-
* This function can't be called in restricted-execution mode.
|
|
20105
|
-
*
|
|
20106
|
-
* This function can be called in early-execution mode.
|
|
20107
|
-
*
|
|
20108
|
-
*/
|
|
20109
|
-
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
20110
|
-
}
|
|
20111
|
-
|
|
20112
|
-
/**
|
|
20113
|
-
* @beta
|
|
20114
|
-
* Contains information related to when a player successfully
|
|
20115
|
-
* names an Entity with a named Name Tag item.
|
|
20116
|
-
*/
|
|
20117
|
-
export class PlayerUseNameTagAfterEvent {
|
|
20118
|
-
private constructor();
|
|
20119
|
-
/**
|
|
20120
|
-
* @remarks
|
|
20121
|
-
* The entity that was named by the player.
|
|
20122
|
-
*
|
|
20123
|
-
* This property can't be edited in restricted-execution mode.
|
|
20124
|
-
*
|
|
20125
|
-
*/
|
|
20126
|
-
entityNamed: Entity;
|
|
20127
|
-
/**
|
|
20128
|
-
* @remarks
|
|
20129
|
-
* The new name that the player has given to the entity.
|
|
20130
|
-
*
|
|
20131
|
-
* This property can't be edited in restricted-execution mode.
|
|
20132
|
-
*
|
|
20133
|
-
*/
|
|
20134
|
-
newName: string;
|
|
20135
|
-
/**
|
|
20136
|
-
* @remarks
|
|
20137
|
-
* Handle to the player that used the name tag.
|
|
20138
|
-
*
|
|
20139
|
-
* This property can't be edited in restricted-execution mode.
|
|
18318
|
+
* Source Player for this event.
|
|
20140
18319
|
*
|
|
20141
18320
|
*/
|
|
20142
|
-
player: Player;
|
|
18321
|
+
readonly player: Player;
|
|
20143
18322
|
/**
|
|
20144
18323
|
* @remarks
|
|
20145
|
-
* The
|
|
20146
|
-
*
|
|
20147
|
-
* previously named.
|
|
20148
|
-
*
|
|
20149
|
-
* This property can't be edited in restricted-execution mode.
|
|
18324
|
+
* The source of the Player swing, see {@link
|
|
18325
|
+
* EntitySwingSource}.
|
|
20150
18326
|
*
|
|
20151
18327
|
*/
|
|
20152
|
-
|
|
18328
|
+
readonly swingSource: EntitySwingSource;
|
|
20153
18329
|
}
|
|
20154
18330
|
|
|
20155
18331
|
/**
|
|
20156
|
-
*
|
|
20157
|
-
*
|
|
20158
|
-
*
|
|
18332
|
+
* Manages callbacks that are connected to when a player starts
|
|
18333
|
+
* to swing their arm (e.g. attacking, using an item,
|
|
18334
|
+
* interacting).
|
|
20159
18335
|
*/
|
|
20160
|
-
export class
|
|
18336
|
+
export class PlayerSwingStartAfterEventSignal {
|
|
20161
18337
|
private constructor();
|
|
20162
18338
|
/**
|
|
20163
18339
|
* @remarks
|
|
20164
|
-
*
|
|
20165
|
-
*
|
|
18340
|
+
* Adds a callback that will be called when a player starts to
|
|
18341
|
+
* swing their arm (e.g. attacking, using an item,
|
|
18342
|
+
* interacting).
|
|
20166
18343
|
*
|
|
20167
18344
|
* This function can't be called in restricted-execution mode.
|
|
20168
18345
|
*
|
|
20169
18346
|
* This function can be called in early-execution mode.
|
|
20170
18347
|
*
|
|
20171
18348
|
*/
|
|
20172
|
-
subscribe(
|
|
18349
|
+
subscribe(
|
|
18350
|
+
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
18351
|
+
options?: PlayerSwingEventOptions,
|
|
18352
|
+
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
20173
18353
|
/**
|
|
20174
18354
|
* @remarks
|
|
20175
|
-
* Removes
|
|
20176
|
-
*
|
|
18355
|
+
* Removes a callback from being called when a player starts to
|
|
18356
|
+
* swing their arm (e.g. attacking, using an item,
|
|
18357
|
+
* interacting).
|
|
20177
18358
|
*
|
|
20178
18359
|
* This function can't be called in restricted-execution mode.
|
|
20179
18360
|
*
|
|
20180
18361
|
* This function can be called in early-execution mode.
|
|
20181
18362
|
*
|
|
20182
18363
|
*/
|
|
20183
|
-
unsubscribe(callback: (arg0:
|
|
18364
|
+
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
20184
18365
|
}
|
|
20185
18366
|
|
|
20186
18367
|
/**
|
|
@@ -20299,10 +18480,10 @@ export class Potions {
|
|
|
20299
18480
|
*
|
|
20300
18481
|
* {@link InvalidPotionEffectTypeError}
|
|
20301
18482
|
*/
|
|
20302
|
-
static resolve
|
|
20303
|
-
|
|
20304
|
-
|
|
20305
|
-
|
|
18483
|
+
static resolve(
|
|
18484
|
+
potionEffectType: PotionEffectType | string,
|
|
18485
|
+
potionDeliveryType: PotionDeliveryType | string,
|
|
18486
|
+
): ItemStack;
|
|
20306
18487
|
}
|
|
20307
18488
|
|
|
20308
18489
|
/**
|
|
@@ -21511,38 +19692,6 @@ export class Seat {
|
|
|
21511
19692
|
readonly seatRotation: number;
|
|
21512
19693
|
}
|
|
21513
19694
|
|
|
21514
|
-
/**
|
|
21515
|
-
* @beta
|
|
21516
|
-
* Manages callbacks that are message passing to a server. This
|
|
21517
|
-
* event is not currently fully implemented, and should not be
|
|
21518
|
-
* used.
|
|
21519
|
-
*/
|
|
21520
|
-
export class ServerMessageAfterEventSignal {
|
|
21521
|
-
private constructor();
|
|
21522
|
-
/**
|
|
21523
|
-
* @remarks
|
|
21524
|
-
* Adds a callback that will be called when an internal message
|
|
21525
|
-
* is passed.
|
|
21526
|
-
*
|
|
21527
|
-
* This function can't be called in restricted-execution mode.
|
|
21528
|
-
*
|
|
21529
|
-
* This function can be called in early-execution mode.
|
|
21530
|
-
*
|
|
21531
|
-
*/
|
|
21532
|
-
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
21533
|
-
/**
|
|
21534
|
-
* @remarks
|
|
21535
|
-
* Removes a callback from being called when an internal
|
|
21536
|
-
* message is passed.
|
|
21537
|
-
*
|
|
21538
|
-
* This function can't be called in restricted-execution mode.
|
|
21539
|
-
*
|
|
21540
|
-
* This function can be called in early-execution mode.
|
|
21541
|
-
*
|
|
21542
|
-
*/
|
|
21543
|
-
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
21544
|
-
}
|
|
21545
|
-
|
|
21546
19695
|
/**
|
|
21547
19696
|
* Loot item function that modifies the trim on a dropped armor
|
|
21548
19697
|
* item.
|
|
@@ -21571,21 +19720,6 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
21571
19720
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21572
19721
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
21573
19722
|
private constructor();
|
|
21574
|
-
/**
|
|
21575
|
-
* @beta
|
|
21576
|
-
* @remarks
|
|
21577
|
-
* The base color for the dropped banner.
|
|
21578
|
-
*
|
|
21579
|
-
*/
|
|
21580
|
-
readonly baseColor: string;
|
|
21581
|
-
/**
|
|
21582
|
-
* @beta
|
|
21583
|
-
* @remarks
|
|
21584
|
-
* An array of {@link BannerPattern} objects used to decorate
|
|
21585
|
-
* the banner, including color and pattern type.
|
|
21586
|
-
*
|
|
21587
|
-
*/
|
|
21588
|
-
readonly patterns: BannerPattern[];
|
|
21589
19723
|
/**
|
|
21590
19724
|
* @remarks
|
|
21591
19725
|
* The type of banner to drop.
|
|
@@ -21831,14 +19965,20 @@ export class SmeltItemFunction extends LootItemFunction {
|
|
|
21831
19965
|
}
|
|
21832
19966
|
|
|
21833
19967
|
/**
|
|
21834
|
-
*
|
|
21835
|
-
*
|
|
19968
|
+
* Represents a handle to a sound that has been played. The
|
|
19969
|
+
* handle is required to control the sound while it is playing
|
|
19970
|
+
* (for example, to call `stop`, `setVolume`, `setPitch`,
|
|
19971
|
+
* `fade`, or `seekTo`). Infinitely-looping sounds (started
|
|
19972
|
+
* with `loop: -1`) stop automatically when the last
|
|
19973
|
+
* `SoundInstance` reference is dropped; retain the handle for
|
|
19974
|
+
* as long as the sound should keep playing.
|
|
21836
19975
|
*/
|
|
21837
19976
|
export class SoundInstance {
|
|
21838
19977
|
private constructor();
|
|
21839
19978
|
/**
|
|
19979
|
+
* @rc
|
|
21840
19980
|
* @remarks
|
|
21841
|
-
* Stops this sound from playing.
|
|
19981
|
+
* Stops this sound instance from playing.
|
|
21842
19982
|
*
|
|
21843
19983
|
* This function can't be called in restricted-execution mode.
|
|
21844
19984
|
*
|
|
@@ -22561,19 +20701,6 @@ export class SystemBeforeEvents {
|
|
|
22561
20701
|
*
|
|
22562
20702
|
*/
|
|
22563
20703
|
readonly startup: StartupBeforeEventSignal;
|
|
22564
|
-
/**
|
|
22565
|
-
* @beta
|
|
22566
|
-
* @remarks
|
|
22567
|
-
* Fires when the scripting watchdog shuts down the server. The
|
|
22568
|
-
* can be due to using too much memory, or by causing
|
|
22569
|
-
* significant slowdown or hang.
|
|
22570
|
-
* To prevent shutdown, set the event's cancel property to
|
|
22571
|
-
* true.
|
|
22572
|
-
*
|
|
22573
|
-
* This property can be read in early-execution mode.
|
|
22574
|
-
*
|
|
22575
|
-
*/
|
|
22576
|
-
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
22577
20704
|
}
|
|
22578
20705
|
|
|
22579
20706
|
/**
|
|
@@ -22960,71 +21087,6 @@ export class TripWireTripAfterEventSignal {
|
|
|
22960
21087
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
22961
21088
|
}
|
|
22962
21089
|
|
|
22963
|
-
/**
|
|
22964
|
-
* @beta
|
|
22965
|
-
* Contains information related to a script watchdog
|
|
22966
|
-
* termination.
|
|
22967
|
-
*/
|
|
22968
|
-
export class WatchdogTerminateBeforeEvent {
|
|
22969
|
-
private constructor();
|
|
22970
|
-
/**
|
|
22971
|
-
* @remarks
|
|
22972
|
-
* If set to true, cancels the termination of the script
|
|
22973
|
-
* runtime. Note that depending on server configuration
|
|
22974
|
-
* settings, cancellation of the termination may not be
|
|
22975
|
-
* allowed.
|
|
22976
|
-
*
|
|
22977
|
-
*/
|
|
22978
|
-
cancel: boolean;
|
|
22979
|
-
/**
|
|
22980
|
-
* @remarks
|
|
22981
|
-
* Contains the reason why a script runtime is to be
|
|
22982
|
-
* terminated.
|
|
22983
|
-
*
|
|
22984
|
-
*/
|
|
22985
|
-
readonly terminateReason: WatchdogTerminateReason;
|
|
22986
|
-
}
|
|
22987
|
-
|
|
22988
|
-
/**
|
|
22989
|
-
* @beta
|
|
22990
|
-
* Manages callbacks that are connected to a callback that will
|
|
22991
|
-
* be called when a script runtime is being terminated due to a
|
|
22992
|
-
* violation of the performance watchdog system.
|
|
22993
|
-
*/
|
|
22994
|
-
export class WatchdogTerminateBeforeEventSignal {
|
|
22995
|
-
private constructor();
|
|
22996
|
-
/**
|
|
22997
|
-
* @remarks
|
|
22998
|
-
* Adds a callback that will be called when a script runtime is
|
|
22999
|
-
* being terminated due to a violation of the performance
|
|
23000
|
-
* watchdog system.
|
|
23001
|
-
*
|
|
23002
|
-
* This function can't be called in restricted-execution mode.
|
|
23003
|
-
*
|
|
23004
|
-
* This function can be called in early-execution mode.
|
|
23005
|
-
*
|
|
23006
|
-
* @param callback
|
|
23007
|
-
* This closure is called with restricted-execution privilege.
|
|
23008
|
-
* @returns
|
|
23009
|
-
* Closure that is called with restricted-execution privilege.
|
|
23010
|
-
*/
|
|
23011
|
-
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
23012
|
-
/**
|
|
23013
|
-
* @remarks
|
|
23014
|
-
* Removes a callback from being called when a script runtime
|
|
23015
|
-
* is being terminated due to a violation of the performance
|
|
23016
|
-
* watchdog system.
|
|
23017
|
-
*
|
|
23018
|
-
* This function can't be called in restricted-execution mode.
|
|
23019
|
-
*
|
|
23020
|
-
* This function can be called in early-execution mode.
|
|
23021
|
-
*
|
|
23022
|
-
* @param callback
|
|
23023
|
-
* This closure is called with restricted-execution privilege.
|
|
23024
|
-
*/
|
|
23025
|
-
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
23026
|
-
}
|
|
23027
|
-
|
|
23028
21090
|
/**
|
|
23029
21091
|
* @rc
|
|
23030
21092
|
* Base class for waypoints displayed on the player's locator
|
|
@@ -23241,15 +21303,6 @@ export class World {
|
|
|
23241
21303
|
*
|
|
23242
21304
|
*/
|
|
23243
21305
|
readonly afterEvents: WorldAfterEvents;
|
|
23244
|
-
/**
|
|
23245
|
-
* @beta
|
|
23246
|
-
* @remarks
|
|
23247
|
-
* Enables or disables cheats.
|
|
23248
|
-
*
|
|
23249
|
-
* This property can't be edited in restricted-execution mode.
|
|
23250
|
-
*
|
|
23251
|
-
*/
|
|
23252
|
-
allowCheats: boolean;
|
|
23253
21306
|
/**
|
|
23254
21307
|
* @remarks
|
|
23255
21308
|
* Contains a set of events that are applicable to the entirety
|
|
@@ -23328,20 +21381,6 @@ export class World {
|
|
|
23328
21381
|
*
|
|
23329
21382
|
*/
|
|
23330
21383
|
readonly tickingAreaManager: TickingAreaManager;
|
|
23331
|
-
/**
|
|
23332
|
-
* @beta
|
|
23333
|
-
* @remarks
|
|
23334
|
-
* A method that is internal-only, used for broadcasting
|
|
23335
|
-
* specific messages between client and server.
|
|
23336
|
-
*
|
|
23337
|
-
* This function can't be called in restricted-execution mode.
|
|
23338
|
-
*
|
|
23339
|
-
* @param id
|
|
23340
|
-
* The message identifier.
|
|
23341
|
-
* @param value
|
|
23342
|
-
* The message.
|
|
23343
|
-
*/
|
|
23344
|
-
broadcastClientMessage(id: string, value: string): void;
|
|
23345
21384
|
/**
|
|
23346
21385
|
* @remarks
|
|
23347
21386
|
* Clears the set of dynamic properties declared for this
|
|
@@ -23834,16 +21873,6 @@ export class WorldAfterEvents {
|
|
|
23834
21873
|
*
|
|
23835
21874
|
*/
|
|
23836
21875
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
23837
|
-
/**
|
|
23838
|
-
* @beta
|
|
23839
|
-
* @remarks
|
|
23840
|
-
* This event is triggered after a chat message has been
|
|
23841
|
-
* broadcast or sent to players.
|
|
23842
|
-
*
|
|
23843
|
-
* This property can be read in early-execution mode.
|
|
23844
|
-
*
|
|
23845
|
-
*/
|
|
23846
|
-
readonly chatSend: ChatSendAfterEventSignal;
|
|
23847
21876
|
/**
|
|
23848
21877
|
* @remarks
|
|
23849
21878
|
* This event is fired when an entity event has been triggered
|
|
@@ -23970,15 +21999,6 @@ export class WorldAfterEvents {
|
|
|
23970
21999
|
*
|
|
23971
22000
|
*/
|
|
23972
22001
|
readonly entitySpawn: EntitySpawnAfterEventSignal;
|
|
23973
|
-
/**
|
|
23974
|
-
* @beta
|
|
23975
|
-
* @remarks
|
|
23976
|
-
* This event fires when an entity starts sneaking.
|
|
23977
|
-
*
|
|
23978
|
-
* This property can be read in early-execution mode.
|
|
23979
|
-
*
|
|
23980
|
-
*/
|
|
23981
|
-
readonly entityStartSneaking: EntityStartSneakingAfterEventSignal;
|
|
23982
22002
|
/**
|
|
23983
22003
|
* @rc
|
|
23984
22004
|
* @remarks
|
|
@@ -24075,25 +22095,6 @@ export class WorldAfterEvents {
|
|
|
24075
22095
|
*
|
|
24076
22096
|
*/
|
|
24077
22097
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
24078
|
-
/**
|
|
24079
|
-
* @beta
|
|
24080
|
-
* @remarks
|
|
24081
|
-
* This event is an internal implementation detail, and is
|
|
24082
|
-
* otherwise not currently functional.
|
|
24083
|
-
*
|
|
24084
|
-
* This property can be read in early-execution mode.
|
|
24085
|
-
*
|
|
24086
|
-
*/
|
|
24087
|
-
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
24088
|
-
/**
|
|
24089
|
-
* @beta
|
|
24090
|
-
* @remarks
|
|
24091
|
-
* This event is triggered when a pack setting is changed.
|
|
24092
|
-
*
|
|
24093
|
-
* This property can be read in early-execution mode.
|
|
24094
|
-
*
|
|
24095
|
-
*/
|
|
24096
|
-
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
24097
22098
|
/**
|
|
24098
22099
|
* @remarks
|
|
24099
22100
|
* This event fires when a piston expands or retracts.
|
|
@@ -24119,15 +22120,6 @@ export class WorldAfterEvents {
|
|
|
24119
22120
|
*
|
|
24120
22121
|
*/
|
|
24121
22122
|
readonly playerButtonInput: PlayerButtonInputAfterEventSignal;
|
|
24122
|
-
/**
|
|
24123
|
-
* @beta
|
|
24124
|
-
* @remarks
|
|
24125
|
-
* This event fires when a player cancels breaking a block.
|
|
24126
|
-
*
|
|
24127
|
-
* This property can be read in early-execution mode.
|
|
24128
|
-
*
|
|
24129
|
-
*/
|
|
24130
|
-
readonly playerCancelBreakingBlock: PlayerCancelBreakingBlockAfterEventSignal;
|
|
24131
22123
|
/**
|
|
24132
22124
|
* @remarks
|
|
24133
22125
|
* Fires when a player moved to a different dimension.
|
|
@@ -24233,31 +22225,12 @@ export class WorldAfterEvents {
|
|
|
24233
22225
|
*
|
|
24234
22226
|
*/
|
|
24235
22227
|
readonly playerSpawn: PlayerSpawnAfterEventSignal;
|
|
24236
|
-
/**
|
|
24237
|
-
* @beta
|
|
24238
|
-
* @remarks
|
|
24239
|
-
* This event fires when a player starts breaking a block.
|
|
24240
|
-
*
|
|
24241
|
-
* This property can be read in early-execution mode.
|
|
24242
|
-
*
|
|
24243
|
-
*/
|
|
24244
|
-
readonly playerStartBreakingBlock: PlayerStartBreakingBlockAfterEventSignal;
|
|
24245
22228
|
/**
|
|
24246
22229
|
* @remarks
|
|
24247
22230
|
* This property can be read in early-execution mode.
|
|
24248
22231
|
*
|
|
24249
22232
|
*/
|
|
24250
22233
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
24251
|
-
/**
|
|
24252
|
-
* @beta
|
|
24253
|
-
* @remarks
|
|
24254
|
-
* An event for when a player uses a named name tag on an
|
|
24255
|
-
* entity.
|
|
24256
|
-
*
|
|
24257
|
-
* This property can be read in early-execution mode.
|
|
24258
|
-
*
|
|
24259
|
-
*/
|
|
24260
|
-
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
24261
22234
|
/**
|
|
24262
22235
|
* @remarks
|
|
24263
22236
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -24334,43 +22307,6 @@ export class WorldAfterEvents {
|
|
|
24334
22307
|
*/
|
|
24335
22308
|
export class WorldBeforeEvents {
|
|
24336
22309
|
private constructor();
|
|
24337
|
-
/**
|
|
24338
|
-
* @beta
|
|
24339
|
-
* @remarks
|
|
24340
|
-
* This event is triggered after a chat message has been
|
|
24341
|
-
* broadcast or sent to players.
|
|
24342
|
-
*
|
|
24343
|
-
* This property can be read in early-execution mode.
|
|
24344
|
-
*
|
|
24345
|
-
* @example customCommand.ts
|
|
24346
|
-
* ```typescript
|
|
24347
|
-
* import { world, DimensionLocation } from '@minecraft/server';
|
|
24348
|
-
*
|
|
24349
|
-
* function customCommand(targetLocation: DimensionLocation) {
|
|
24350
|
-
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
24351
|
-
* if (eventData.message.includes('cancel')) {
|
|
24352
|
-
* // Cancel event if the message contains "cancel"
|
|
24353
|
-
* eventData.cancel = true;
|
|
24354
|
-
* } else {
|
|
24355
|
-
* const args = eventData.message.split(' ');
|
|
24356
|
-
*
|
|
24357
|
-
* if (args.length > 0) {
|
|
24358
|
-
* switch (args[0].toLowerCase()) {
|
|
24359
|
-
* case 'echo':
|
|
24360
|
-
* // Send a modified version of chat message
|
|
24361
|
-
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
24362
|
-
* break;
|
|
24363
|
-
* case 'help':
|
|
24364
|
-
* world.sendMessage(`Available commands: echo <message>`);
|
|
24365
|
-
* break;
|
|
24366
|
-
* }
|
|
24367
|
-
* }
|
|
24368
|
-
* }
|
|
24369
|
-
* });
|
|
24370
|
-
* }
|
|
24371
|
-
* ```
|
|
24372
|
-
*/
|
|
24373
|
-
readonly chatSend: ChatSendBeforeEventSignal;
|
|
24374
22310
|
/**
|
|
24375
22311
|
* @remarks
|
|
24376
22312
|
* This event is triggered after an event has been added to an
|
|
@@ -24464,15 +22400,6 @@ export class WorldBeforeEvents {
|
|
|
24464
22400
|
*
|
|
24465
22401
|
*/
|
|
24466
22402
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
24467
|
-
/**
|
|
24468
|
-
* @beta
|
|
24469
|
-
* @remarks
|
|
24470
|
-
* This event fires before a block is placed by a player.
|
|
24471
|
-
*
|
|
24472
|
-
* This property can be read in early-execution mode.
|
|
24473
|
-
*
|
|
24474
|
-
*/
|
|
24475
|
-
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
24476
22403
|
/**
|
|
24477
22404
|
* @remarks
|
|
24478
22405
|
* This property can be read in early-execution mode.
|
|
@@ -24550,27 +22477,13 @@ export interface BiomeFilter {
|
|
|
24550
22477
|
includeTags?: string[];
|
|
24551
22478
|
}
|
|
24552
22479
|
|
|
24553
|
-
/**
|
|
24554
|
-
* @beta
|
|
24555
|
-
* Contains additional options for searches for the
|
|
24556
|
-
* dimension.findNearestBiome API.
|
|
24557
|
-
*/
|
|
24558
|
-
export interface BiomeSearchOptions {
|
|
24559
|
-
/**
|
|
24560
|
-
* @remarks
|
|
24561
|
-
* Bounding volume size to look within.
|
|
24562
|
-
*
|
|
24563
|
-
*/
|
|
24564
|
-
boundingSize?: Vector3;
|
|
24565
|
-
}
|
|
24566
|
-
|
|
24567
22480
|
/**
|
|
24568
22481
|
* A BlockBoundingBox is an interface to an object which
|
|
24569
22482
|
* represents an AABB aligned rectangle.
|
|
24570
22483
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
24571
22484
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
24572
|
-
* created using the associated {@link
|
|
24573
|
-
* utility functions.
|
|
22485
|
+
* created using the associated {@link
|
|
22486
|
+
* @minecraft/server.BlockBoundingBoxUtils} utility functions.
|
|
24574
22487
|
* The min/max coordinates represent the diametrically opposite
|
|
24575
22488
|
* corners of the rectangle.
|
|
24576
22489
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -25021,40 +22934,6 @@ export interface CameraTargetOptions {
|
|
|
25021
22934
|
targetEntity: Entity;
|
|
25022
22935
|
}
|
|
25023
22936
|
|
|
25024
|
-
/**
|
|
25025
|
-
* @beta
|
|
25026
|
-
* This interface defines an entry into the {@link
|
|
25027
|
-
* CompoundBlockVolume} which represents a volume of positive
|
|
25028
|
-
* or negative space.
|
|
25029
|
-
*
|
|
25030
|
-
*/
|
|
25031
|
-
export interface CompoundBlockVolumeItem {
|
|
25032
|
-
/**
|
|
25033
|
-
* @remarks
|
|
25034
|
-
* The 'action' defines how the block volume is represented in
|
|
25035
|
-
* the compound block volume stack.
|
|
25036
|
-
* 'Add' creates a block volume which is positively selected
|
|
25037
|
-
* 'Subtract' creates a block volume which represents a hole or
|
|
25038
|
-
* negative space in the overall compound block volume.
|
|
25039
|
-
*
|
|
25040
|
-
*/
|
|
25041
|
-
action?: CompoundBlockVolumeAction;
|
|
25042
|
-
/**
|
|
25043
|
-
* @remarks
|
|
25044
|
-
* The relativity enumeration determines whether the
|
|
25045
|
-
* BlockVolume specified is positioned relative to the parent
|
|
25046
|
-
* compound block volume origin, or in absolute world space.
|
|
25047
|
-
*
|
|
25048
|
-
*/
|
|
25049
|
-
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
25050
|
-
/**
|
|
25051
|
-
* @remarks
|
|
25052
|
-
* The volume of space
|
|
25053
|
-
*
|
|
25054
|
-
*/
|
|
25055
|
-
volume: BlockVolume;
|
|
25056
|
-
}
|
|
25057
|
-
|
|
25058
22937
|
/**
|
|
25059
22938
|
* @rc
|
|
25060
22939
|
* Represents the source of a container access.
|
|
@@ -25166,15 +23045,6 @@ export interface CustomCommand {
|
|
|
25166
23045
|
* command.
|
|
25167
23046
|
*/
|
|
25168
23047
|
export interface CustomCommandParameter {
|
|
25169
|
-
/**
|
|
25170
|
-
* @beta
|
|
25171
|
-
* @remarks
|
|
25172
|
-
* Can be used to reference the enum name when {@link
|
|
25173
|
-
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
25174
|
-
* to be different from the enum name.
|
|
25175
|
-
*
|
|
25176
|
-
*/
|
|
25177
|
-
enumName?: string;
|
|
25178
23048
|
/**
|
|
25179
23049
|
* @remarks
|
|
25180
23050
|
* The name of parameter as it appears on the command line.
|
|
@@ -25256,14 +23126,6 @@ export interface DefinitionModifier {
|
|
|
25256
23126
|
*
|
|
25257
23127
|
*/
|
|
25258
23128
|
removedComponentGroups: string[];
|
|
25259
|
-
/**
|
|
25260
|
-
* @beta
|
|
25261
|
-
* @remarks
|
|
25262
|
-
* The list of entity definition events that will be fired via
|
|
25263
|
-
* this update.
|
|
25264
|
-
*
|
|
25265
|
-
*/
|
|
25266
|
-
triggers: Trigger[];
|
|
25267
23129
|
}
|
|
25268
23130
|
|
|
25269
23131
|
/**
|
|
@@ -26065,15 +23927,6 @@ export interface EntityRaycastOptions extends EntityFilter {
|
|
|
26065
23927
|
maxDistance?: number;
|
|
26066
23928
|
}
|
|
26067
23929
|
|
|
26068
|
-
/**
|
|
26069
|
-
* @beta
|
|
26070
|
-
* Options used to filter entity start sneaking and stop
|
|
26071
|
-
* sneaking events.
|
|
26072
|
-
*/
|
|
26073
|
-
export interface EntitySneakingChangedEventOptions {
|
|
26074
|
-
entityFilter?: EntityFilter;
|
|
26075
|
-
}
|
|
26076
|
-
|
|
26077
23930
|
/**
|
|
26078
23931
|
* @rc
|
|
26079
23932
|
* Controls when a waypoint is visible based on the state of
|
|
@@ -26580,33 +24433,6 @@ export interface PlayerAimAssistSettings {
|
|
|
26580
24433
|
viewAngle?: Vector2;
|
|
26581
24434
|
}
|
|
26582
24435
|
|
|
26583
|
-
/**
|
|
26584
|
-
* @beta
|
|
26585
|
-
* An interface that is passed into {@link
|
|
26586
|
-
* PlayerStartBreakingBlockAfterEventSignal.subscribe} or
|
|
26587
|
-
* {@link PlayerCancelBreakingBlockAfterEventSignal.subscribe}
|
|
26588
|
-
* that filters out which events are passed to the provided
|
|
26589
|
-
* callback.
|
|
26590
|
-
*/
|
|
26591
|
-
export interface PlayerBreakingBlockEventOptions {
|
|
26592
|
-
/**
|
|
26593
|
-
* @remarks
|
|
26594
|
-
* The {@link BlockFilter} that the callback should be called
|
|
26595
|
-
* for. If undefined, the callback will be called for all
|
|
26596
|
-
* blocks.
|
|
26597
|
-
*
|
|
26598
|
-
*/
|
|
26599
|
-
blockFilter?: BlockFilter;
|
|
26600
|
-
/**
|
|
26601
|
-
* @remarks
|
|
26602
|
-
* The {@link EntityFilter} that the callback should be called
|
|
26603
|
-
* for. If undefined, the callback will be called for all
|
|
26604
|
-
* players.
|
|
26605
|
-
*
|
|
26606
|
-
*/
|
|
26607
|
-
playerFilter?: EntityFilter;
|
|
26608
|
-
}
|
|
26609
|
-
|
|
26610
24436
|
/**
|
|
26611
24437
|
* Additional options for how a sound plays for a player.
|
|
26612
24438
|
*/
|
|
@@ -27632,17 +25458,6 @@ export class EnchantmentTypeUnknownIdError extends Error {
|
|
|
27632
25458
|
private constructor();
|
|
27633
25459
|
}
|
|
27634
25460
|
|
|
27635
|
-
/**
|
|
27636
|
-
* @beta
|
|
27637
|
-
* Error thrown by {@link EntityFogComponent} operations when
|
|
27638
|
-
* the fog stack limit is exceeded or an invalid fog identifier
|
|
27639
|
-
* is provided.
|
|
27640
|
-
*/
|
|
27641
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27642
|
-
export class EntityFogComponentError extends Error {
|
|
27643
|
-
private constructor();
|
|
27644
|
-
}
|
|
27645
|
-
|
|
27646
25461
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27647
25462
|
export class EntitySpawnError extends Error {
|
|
27648
25463
|
private constructor();
|