@minecraft/server 2.12.0-rc.1.26.70-preview.20 → 2.13.0-beta.1.26.70-preview.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +3183 -205
- 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
|
+
* @beta
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
* Contains many types related to manipulating a Minecraft
|
|
13
13
|
* world, including entities, blocks, dimensions, and more.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* ```json
|
|
17
17
|
* {
|
|
18
18
|
* "module_name": "@minecraft/server",
|
|
19
|
-
* "version": "2.
|
|
19
|
+
* "version": "2.13.0-beta"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -48,6 +48,10 @@ export enum AimAssistTargetMode {
|
|
|
48
48
|
*/
|
|
49
49
|
export enum BlockComponentTypes {
|
|
50
50
|
DynamicProperties = 'minecraft:dynamic_properties',
|
|
51
|
+
/**
|
|
52
|
+
* @beta
|
|
53
|
+
*/
|
|
54
|
+
EntityStorage = 'minecraft:entity_storage',
|
|
51
55
|
FluidContainer = 'minecraft:fluid_container',
|
|
52
56
|
Instrument = 'minecraft:instrument_sound',
|
|
53
57
|
/**
|
|
@@ -83,6 +87,14 @@ export enum BlockComponentTypes {
|
|
|
83
87
|
*
|
|
84
88
|
*/
|
|
85
89
|
PrecipitationInteractions = 'minecraft:precipitation_interactions',
|
|
90
|
+
/**
|
|
91
|
+
* @beta
|
|
92
|
+
*/
|
|
93
|
+
RecipeCrafting = 'minecraft:recipe_crafting',
|
|
94
|
+
/**
|
|
95
|
+
* @beta
|
|
96
|
+
*/
|
|
97
|
+
RecipeProcessing = 'minecraft:recipe_processing',
|
|
86
98
|
/**
|
|
87
99
|
* @remarks
|
|
88
100
|
* Represents a block that can play a record.
|
|
@@ -101,6 +113,10 @@ export enum BlockComponentTypes {
|
|
|
101
113
|
*
|
|
102
114
|
*/
|
|
103
115
|
Sign = 'minecraft:sign',
|
|
116
|
+
/**
|
|
117
|
+
* @beta
|
|
118
|
+
*/
|
|
119
|
+
VibrationProperties = 'minecraft:vibration_properties',
|
|
104
120
|
}
|
|
105
121
|
|
|
106
122
|
/**
|
|
@@ -377,6 +393,13 @@ export enum CustomCommandErrorReason {
|
|
|
377
393
|
*
|
|
378
394
|
*/
|
|
379
395
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
396
|
+
/**
|
|
397
|
+
* @beta
|
|
398
|
+
* @remarks
|
|
399
|
+
* Non enum type command parameters cannot use enumName.
|
|
400
|
+
*
|
|
401
|
+
*/
|
|
402
|
+
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
380
403
|
}
|
|
381
404
|
|
|
382
405
|
/**
|
|
@@ -1112,6 +1135,14 @@ export enum EntityComponentTypes {
|
|
|
1112
1135
|
*
|
|
1113
1136
|
*/
|
|
1114
1137
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1138
|
+
/**
|
|
1139
|
+
* @beta
|
|
1140
|
+
* @remarks
|
|
1141
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
1142
|
+
* name, and dialogue interactions.
|
|
1143
|
+
*
|
|
1144
|
+
*/
|
|
1145
|
+
Npc = 'minecraft:npc',
|
|
1115
1146
|
/**
|
|
1116
1147
|
* @remarks
|
|
1117
1148
|
* When present on an entity, this entity is on fire.
|
|
@@ -1595,6 +1626,14 @@ export enum EntitySwingSource {
|
|
|
1595
1626
|
* and mainhand slots.
|
|
1596
1627
|
*/
|
|
1597
1628
|
export enum EquipmentSlot {
|
|
1629
|
+
/**
|
|
1630
|
+
* @beta
|
|
1631
|
+
* @remarks
|
|
1632
|
+
* The body slot. This slot is used to hold armor for
|
|
1633
|
+
* non-humanoid mobs.
|
|
1634
|
+
*
|
|
1635
|
+
*/
|
|
1636
|
+
Body = 'Body',
|
|
1598
1637
|
/**
|
|
1599
1638
|
* @remarks
|
|
1600
1639
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1864,6 +1903,14 @@ export enum GameRule {
|
|
|
1864
1903
|
*
|
|
1865
1904
|
*/
|
|
1866
1905
|
PlayersSleepingPercentage = 'playersSleepingPercentage',
|
|
1906
|
+
/**
|
|
1907
|
+
* @beta
|
|
1908
|
+
* @remarks
|
|
1909
|
+
* Controls which player waypoints are automatically added to
|
|
1910
|
+
* the players locator bar.
|
|
1911
|
+
*
|
|
1912
|
+
*/
|
|
1913
|
+
PlayerWaypoints = 'playerWaypoints',
|
|
1867
1914
|
/**
|
|
1868
1915
|
* @remarks
|
|
1869
1916
|
* Controls whether projectiles (entities with a projectile
|
|
@@ -2105,6 +2152,13 @@ export enum InputMode {
|
|
|
2105
2152
|
*
|
|
2106
2153
|
*/
|
|
2107
2154
|
Gamepad = 'Gamepad',
|
|
2155
|
+
/**
|
|
2156
|
+
* @rc
|
|
2157
|
+
* @remarks
|
|
2158
|
+
* Gamepad and mouse input.
|
|
2159
|
+
*
|
|
2160
|
+
*/
|
|
2161
|
+
GamepadAndMouse = 'GamepadAndMouse',
|
|
2108
2162
|
/**
|
|
2109
2163
|
* @remarks
|
|
2110
2164
|
* Keyboard and mouse input.
|
|
@@ -2214,7 +2268,11 @@ export enum InputPermissionCategory {
|
|
|
2214
2268
|
* function ItemStack.getComponent.
|
|
2215
2269
|
*/
|
|
2216
2270
|
export enum ItemComponentTypes {
|
|
2217
|
-
BlockDynamicProperties = 'minecraft:
|
|
2271
|
+
BlockDynamicProperties = 'minecraft:block_dynamic_properties',
|
|
2272
|
+
/**
|
|
2273
|
+
* @beta
|
|
2274
|
+
*/
|
|
2275
|
+
BlockEntityStorage = 'minecraft:block_entity_storage',
|
|
2218
2276
|
/**
|
|
2219
2277
|
* @remarks
|
|
2220
2278
|
* The minecraft:book component.
|
|
@@ -2586,6 +2644,31 @@ export enum PaletteColor {
|
|
|
2586
2644
|
Black = 15,
|
|
2587
2645
|
}
|
|
2588
2646
|
|
|
2647
|
+
/**
|
|
2648
|
+
* @beta
|
|
2649
|
+
* Specifies the pose of an entity passenger of a block.
|
|
2650
|
+
*/
|
|
2651
|
+
export enum PassengerOfBlockEmoteType {
|
|
2652
|
+
/**
|
|
2653
|
+
* @remarks
|
|
2654
|
+
* The entity will be laying on the block.
|
|
2655
|
+
*
|
|
2656
|
+
*/
|
|
2657
|
+
Laying = 'Laying',
|
|
2658
|
+
/**
|
|
2659
|
+
* @remarks
|
|
2660
|
+
* The entity will be sitting on the block.
|
|
2661
|
+
*
|
|
2662
|
+
*/
|
|
2663
|
+
Riding = 'Riding',
|
|
2664
|
+
/**
|
|
2665
|
+
* @remarks
|
|
2666
|
+
* The entity will be standing on the block.
|
|
2667
|
+
*
|
|
2668
|
+
*/
|
|
2669
|
+
Standing = 'Standing',
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2589
2672
|
/**
|
|
2590
2673
|
* Describes what kind of platform is a device.
|
|
2591
2674
|
*/
|
|
@@ -2686,6 +2769,42 @@ export enum PlayerSplitScreenSlot {
|
|
|
2686
2769
|
Third = 'Third',
|
|
2687
2770
|
}
|
|
2688
2771
|
|
|
2772
|
+
/**
|
|
2773
|
+
* @beta
|
|
2774
|
+
*/
|
|
2775
|
+
export enum PlayerWaypointsMode {
|
|
2776
|
+
Everyone = 'Everyone',
|
|
2777
|
+
Off = 'Off',
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
/**
|
|
2781
|
+
* @rc
|
|
2782
|
+
* Specifies how a block point-of-interest query filters
|
|
2783
|
+
* instances by ticket occupancy.
|
|
2784
|
+
*/
|
|
2785
|
+
export enum PoiBlockOccupancyFilter {
|
|
2786
|
+
/**
|
|
2787
|
+
* @remarks
|
|
2788
|
+
* Includes POI instances regardless of their occupancy or
|
|
2789
|
+
* available ticket count.
|
|
2790
|
+
*
|
|
2791
|
+
*/
|
|
2792
|
+
Any = 'Any',
|
|
2793
|
+
/**
|
|
2794
|
+
* @remarks
|
|
2795
|
+
* Includes POI instances with no available tickets.
|
|
2796
|
+
*
|
|
2797
|
+
*/
|
|
2798
|
+
Full = 'Full',
|
|
2799
|
+
/**
|
|
2800
|
+
* @remarks
|
|
2801
|
+
* Includes POI instances with at least one ticket available to
|
|
2802
|
+
* be claimed.
|
|
2803
|
+
*
|
|
2804
|
+
*/
|
|
2805
|
+
HasVacancy = 'HasVacancy',
|
|
2806
|
+
}
|
|
2807
|
+
|
|
2689
2808
|
/**
|
|
2690
2809
|
* Contains objectives and participants for the scoreboard.
|
|
2691
2810
|
*/
|
|
@@ -3011,6 +3130,29 @@ export enum TintMethod {
|
|
|
3011
3130
|
Water = 'Water',
|
|
3012
3131
|
}
|
|
3013
3132
|
|
|
3133
|
+
/**
|
|
3134
|
+
* @beta
|
|
3135
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
3136
|
+
* to terminate execution of a behavior packs' script.
|
|
3137
|
+
*/
|
|
3138
|
+
export enum WatchdogTerminateReason {
|
|
3139
|
+
/**
|
|
3140
|
+
* @remarks
|
|
3141
|
+
* Script runtime for a behavior pack is terminated due to
|
|
3142
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
3143
|
+
*
|
|
3144
|
+
*/
|
|
3145
|
+
Hang = 'Hang',
|
|
3146
|
+
/**
|
|
3147
|
+
* @remarks
|
|
3148
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3149
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3150
|
+
* function calls.
|
|
3151
|
+
*
|
|
3152
|
+
*/
|
|
3153
|
+
StackOverflow = 'StackOverflow',
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3014
3156
|
/**
|
|
3015
3157
|
* Enum representing different texture icons that can be
|
|
3016
3158
|
* displayed for waypoints on the locator bar.
|
|
@@ -3073,11 +3215,13 @@ export type BlockComponentReturnType<T extends string> = T extends keyof BlockCo
|
|
|
3073
3215
|
|
|
3074
3216
|
export type BlockComponentTypeMap = {
|
|
3075
3217
|
dynamic_properties: BlockDynamicPropertiesComponent;
|
|
3218
|
+
entity_storage: BlockEntityStorageComponent;
|
|
3076
3219
|
fluid_container: BlockFluidContainerComponent;
|
|
3077
3220
|
instrument_sound: BlockInstrumentComponent;
|
|
3078
3221
|
inventory: BlockInventoryComponent;
|
|
3079
3222
|
map_color: BlockMapColorComponent;
|
|
3080
3223
|
'minecraft:dynamic_properties': BlockDynamicPropertiesComponent;
|
|
3224
|
+
'minecraft:entity_storage': BlockEntityStorageComponent;
|
|
3081
3225
|
'minecraft:fluid_container': BlockFluidContainerComponent;
|
|
3082
3226
|
'minecraft:instrument_sound': BlockInstrumentComponent;
|
|
3083
3227
|
'minecraft:inventory': BlockInventoryComponent;
|
|
@@ -3085,15 +3229,21 @@ export type BlockComponentTypeMap = {
|
|
|
3085
3229
|
'minecraft:movable': BlockMovableComponent;
|
|
3086
3230
|
'minecraft:piston': BlockPistonComponent;
|
|
3087
3231
|
'minecraft:precipitation_interactions': BlockPrecipitationInteractionsComponent;
|
|
3232
|
+
'minecraft:recipe_crafting': BlockRecipeCraftingComponent;
|
|
3233
|
+
'minecraft:recipe_processing': BlockRecipeProcessingComponent;
|
|
3088
3234
|
'minecraft:record_player': BlockRecordPlayerComponent;
|
|
3089
3235
|
'minecraft:redstone_producer': BlockRedstoneProducerComponent;
|
|
3090
3236
|
'minecraft:sign': BlockSignComponent;
|
|
3237
|
+
'minecraft:vibration_properties': BlockVibrationPropertiesComponent;
|
|
3091
3238
|
movable: BlockMovableComponent;
|
|
3092
3239
|
piston: BlockPistonComponent;
|
|
3093
3240
|
precipitation_interactions: BlockPrecipitationInteractionsComponent;
|
|
3241
|
+
recipe_crafting: BlockRecipeCraftingComponent;
|
|
3242
|
+
recipe_processing: BlockRecipeProcessingComponent;
|
|
3094
3243
|
record_player: BlockRecordPlayerComponent;
|
|
3095
3244
|
redstone_producer: BlockRedstoneProducerComponent;
|
|
3096
3245
|
sign: BlockSignComponent;
|
|
3246
|
+
vibration_properties: BlockVibrationPropertiesComponent;
|
|
3097
3247
|
};
|
|
3098
3248
|
|
|
3099
3249
|
/**
|
|
@@ -3197,6 +3347,7 @@ export type EntityComponentTypeMap = {
|
|
|
3197
3347
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
3198
3348
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
3199
3349
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3350
|
+
'minecraft:npc': EntityNpcComponent;
|
|
3200
3351
|
'minecraft:onfire': EntityOnFireComponent;
|
|
3201
3352
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
3202
3353
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -3230,6 +3381,7 @@ export type EntityComponentTypeMap = {
|
|
|
3230
3381
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3231
3382
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3232
3383
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3384
|
+
npc: EntityNpcComponent;
|
|
3233
3385
|
onfire: EntityOnFireComponent;
|
|
3234
3386
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3235
3387
|
'player.hunger': EntityHungerComponent;
|
|
@@ -3249,12 +3401,22 @@ export type EntityComponentTypeMap = {
|
|
|
3249
3401
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3250
3402
|
};
|
|
3251
3403
|
|
|
3404
|
+
/**
|
|
3405
|
+
* @beta
|
|
3406
|
+
*/
|
|
3407
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3408
|
+
? VanillaEntityIdentifier
|
|
3409
|
+
: T extends string
|
|
3410
|
+
? VanillaEntityIdentifier | T
|
|
3411
|
+
: never;
|
|
3412
|
+
|
|
3252
3413
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3253
3414
|
? ItemComponentTypeMap[T]
|
|
3254
3415
|
: ItemCustomComponentInstance;
|
|
3255
3416
|
|
|
3256
3417
|
export type ItemComponentTypeMap = {
|
|
3257
|
-
|
|
3418
|
+
block_dynamic_properties: ItemBlockDynamicPropertiesComponent;
|
|
3419
|
+
block_entity_storage: ItemBlockEntityStorageComponent;
|
|
3258
3420
|
book: ItemBookComponent;
|
|
3259
3421
|
compostable: ItemCompostableComponent;
|
|
3260
3422
|
cooldown: ItemCooldownComponent;
|
|
@@ -3263,7 +3425,8 @@ export type ItemComponentTypeMap = {
|
|
|
3263
3425
|
enchantable: ItemEnchantableComponent;
|
|
3264
3426
|
food: ItemFoodComponent;
|
|
3265
3427
|
inventory: ItemInventoryComponent;
|
|
3266
|
-
'minecraft:
|
|
3428
|
+
'minecraft:block_dynamic_properties': ItemBlockDynamicPropertiesComponent;
|
|
3429
|
+
'minecraft:block_entity_storage': ItemBlockEntityStorageComponent;
|
|
3267
3430
|
'minecraft:book': ItemBookComponent;
|
|
3268
3431
|
'minecraft:compostable': ItemCompostableComponent;
|
|
3269
3432
|
'minecraft:cooldown': ItemCooldownComponent;
|
|
@@ -3276,6 +3439,15 @@ export type ItemComponentTypeMap = {
|
|
|
3276
3439
|
potion: ItemPotionComponent;
|
|
3277
3440
|
};
|
|
3278
3441
|
|
|
3442
|
+
/**
|
|
3443
|
+
* @beta
|
|
3444
|
+
*/
|
|
3445
|
+
export type VanillaEntityIdentifier =
|
|
3446
|
+
| EntityType
|
|
3447
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3448
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3449
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3450
|
+
|
|
3279
3451
|
/**
|
|
3280
3452
|
* Handle to an aim-assist category that exists in the
|
|
3281
3453
|
* world.aimAssist registry.
|
|
@@ -3433,7 +3605,9 @@ export class AimAssistCategorySettings {
|
|
|
3433
3605
|
* A record mapping block Ids to their priority settings.
|
|
3434
3606
|
* Larger numbers have greater priority.
|
|
3435
3607
|
*/
|
|
3436
|
-
setBlockPriorities(
|
|
3608
|
+
setBlockPriorities(
|
|
3609
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3610
|
+
): void;
|
|
3437
3611
|
/**
|
|
3438
3612
|
* @remarks
|
|
3439
3613
|
* Sets the priority settings used for block targeting.
|
|
@@ -3452,7 +3626,9 @@ export class AimAssistCategorySettings {
|
|
|
3452
3626
|
* A record mapping entity Ids to their priority settings.
|
|
3453
3627
|
* Larger numbers have greater priority.
|
|
3454
3628
|
*/
|
|
3455
|
-
setEntityPriorities(
|
|
3629
|
+
setEntityPriorities(
|
|
3630
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3631
|
+
): void;
|
|
3456
3632
|
/**
|
|
3457
3633
|
* @remarks
|
|
3458
3634
|
* Sets the priority settings used for entity targeting.
|
|
@@ -3651,8 +3827,10 @@ export class AimAssistPresetSettings {
|
|
|
3651
3827
|
*
|
|
3652
3828
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
3653
3829
|
*
|
|
3830
|
+
* @param targets
|
|
3831
|
+
* An array of block tags.
|
|
3654
3832
|
*/
|
|
3655
|
-
setExcludedBlockTagTargets(
|
|
3833
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3656
3834
|
/**
|
|
3657
3835
|
* @remarks
|
|
3658
3836
|
* Sets the list of block Ids to exclude from aim assist
|
|
@@ -3660,8 +3838,10 @@ export class AimAssistPresetSettings {
|
|
|
3660
3838
|
*
|
|
3661
3839
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
3662
3840
|
*
|
|
3841
|
+
* @param targets
|
|
3842
|
+
* An array of block Ids.
|
|
3663
3843
|
*/
|
|
3664
|
-
setExcludedBlockTargets(
|
|
3844
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3665
3845
|
/**
|
|
3666
3846
|
* @remarks
|
|
3667
3847
|
* Sets the list of entity Ids to exclude from aim assist
|
|
@@ -3669,8 +3849,10 @@ export class AimAssistPresetSettings {
|
|
|
3669
3849
|
*
|
|
3670
3850
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
3671
3851
|
*
|
|
3852
|
+
* @param targets
|
|
3853
|
+
* An array of entity Ids.
|
|
3672
3854
|
*/
|
|
3673
|
-
setExcludedEntityTargets(
|
|
3855
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3674
3856
|
/**
|
|
3675
3857
|
* @remarks
|
|
3676
3858
|
* Sets the list of entity type families to exclude from aim
|
|
@@ -3678,8 +3860,10 @@ export class AimAssistPresetSettings {
|
|
|
3678
3860
|
*
|
|
3679
3861
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
3680
3862
|
*
|
|
3863
|
+
* @param targets
|
|
3864
|
+
* An array of entity type families.
|
|
3681
3865
|
*/
|
|
3682
|
-
setExcludedEntityTypeFamilyTargets(
|
|
3866
|
+
setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
|
|
3683
3867
|
/**
|
|
3684
3868
|
* @remarks
|
|
3685
3869
|
* Sets the per-item aim-assist category Ids.
|
|
@@ -3690,7 +3874,7 @@ export class AimAssistPresetSettings {
|
|
|
3690
3874
|
* A record mapping item Ids to aim-assist category Ids.
|
|
3691
3875
|
* Category Ids must have a namespace.
|
|
3692
3876
|
*/
|
|
3693
|
-
setItemSettings(itemSettings: Record<string, string>): void;
|
|
3877
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3694
3878
|
/**
|
|
3695
3879
|
* @remarks
|
|
3696
3880
|
* Sets the list of item Ids that will target liquid blocks
|
|
@@ -3701,7 +3885,7 @@ export class AimAssistPresetSettings {
|
|
|
3701
3885
|
* @param items
|
|
3702
3886
|
* An array of item Ids.
|
|
3703
3887
|
*/
|
|
3704
|
-
setLiquidTargetingItems(items?: string[]): void;
|
|
3888
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3705
3889
|
}
|
|
3706
3890
|
|
|
3707
3891
|
/**
|
|
@@ -3807,6 +3991,28 @@ export class AimAssistRegistry {
|
|
|
3807
3991
|
getPresets(): AimAssistPreset[];
|
|
3808
3992
|
}
|
|
3809
3993
|
|
|
3994
|
+
/**
|
|
3995
|
+
* @beta
|
|
3996
|
+
* Describes a single banner pattern, which includes a colour
|
|
3997
|
+
* and a pattern type.
|
|
3998
|
+
*/
|
|
3999
|
+
export class BannerPattern {
|
|
4000
|
+
private constructor();
|
|
4001
|
+
/**
|
|
4002
|
+
* @remarks
|
|
4003
|
+
* The color to apply to this banner pattern.
|
|
4004
|
+
*
|
|
4005
|
+
*/
|
|
4006
|
+
readonly color: string;
|
|
4007
|
+
/**
|
|
4008
|
+
* @remarks
|
|
4009
|
+
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
4010
|
+
* apply to the banner.
|
|
4011
|
+
*
|
|
4012
|
+
*/
|
|
4013
|
+
readonly pattern: string;
|
|
4014
|
+
}
|
|
4015
|
+
|
|
3810
4016
|
/**
|
|
3811
4017
|
* Describes a type of biome.
|
|
3812
4018
|
*/
|
|
@@ -3900,6 +4106,20 @@ export class Block {
|
|
|
3900
4106
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3901
4107
|
*/
|
|
3902
4108
|
readonly isLiquid: boolean;
|
|
4109
|
+
/**
|
|
4110
|
+
* @beta
|
|
4111
|
+
* @remarks
|
|
4112
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
4113
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
4114
|
+
* ladder block and a fence block are not).
|
|
4115
|
+
*
|
|
4116
|
+
* @throws This property can throw when used.
|
|
4117
|
+
*
|
|
4118
|
+
* {@link LocationInUnloadedChunkError}
|
|
4119
|
+
*
|
|
4120
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4121
|
+
*/
|
|
4122
|
+
readonly isSolid: boolean;
|
|
3903
4123
|
/**
|
|
3904
4124
|
* @remarks
|
|
3905
4125
|
* Returns true if this reference to a block is still valid
|
|
@@ -4065,6 +4285,30 @@ export class Block {
|
|
|
4065
4285
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4066
4286
|
*/
|
|
4067
4287
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4288
|
+
/**
|
|
4289
|
+
* @beta
|
|
4290
|
+
* @remarks
|
|
4291
|
+
* Checks to see whether it is valid to place the specified
|
|
4292
|
+
* block type or block permutation, on a specified face on this
|
|
4293
|
+
* block.
|
|
4294
|
+
*
|
|
4295
|
+
* @param blockToPlace
|
|
4296
|
+
* Block type or block permutation to check placement for.
|
|
4297
|
+
* @param faceToPlaceOn
|
|
4298
|
+
* Optional specific face of this block to check placement
|
|
4299
|
+
* against.
|
|
4300
|
+
* @returns
|
|
4301
|
+
* Returns `true` if the block type or permutation can be
|
|
4302
|
+
* placed on this block, else `false`.
|
|
4303
|
+
* @throws This function can throw errors.
|
|
4304
|
+
*
|
|
4305
|
+
* {@link Error}
|
|
4306
|
+
*
|
|
4307
|
+
* {@link LocationInUnloadedChunkError}
|
|
4308
|
+
*
|
|
4309
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4310
|
+
*/
|
|
4311
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
4068
4312
|
/**
|
|
4069
4313
|
* @remarks
|
|
4070
4314
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -4087,6 +4331,23 @@ export class Block {
|
|
|
4087
4331
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4088
4332
|
*/
|
|
4089
4333
|
east(steps?: number): Block | undefined;
|
|
4334
|
+
/**
|
|
4335
|
+
* @beta
|
|
4336
|
+
* @remarks
|
|
4337
|
+
* Returns the named tick events scheduled at this block by the
|
|
4338
|
+
* calling script pack.
|
|
4339
|
+
*
|
|
4340
|
+
* @returns
|
|
4341
|
+
* The scheduled named tick events. Each event contains its
|
|
4342
|
+
* eventName and the number of ticks until it is raised as
|
|
4343
|
+
* tickDelay.
|
|
4344
|
+
* @throws This function can throw errors.
|
|
4345
|
+
*
|
|
4346
|
+
* {@link LocationInUnloadedChunkError}
|
|
4347
|
+
*
|
|
4348
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4349
|
+
*/
|
|
4350
|
+
getAllScheduledNamedTicks(): ScheduledNamedTick[];
|
|
4090
4351
|
/**
|
|
4091
4352
|
* @remarks
|
|
4092
4353
|
* Gets a component (that represents additional capabilities)
|
|
@@ -4161,6 +4422,15 @@ export class Block {
|
|
|
4161
4422
|
* {@link LocationInUnloadedChunkError}
|
|
4162
4423
|
*/
|
|
4163
4424
|
getLightLevel(): number;
|
|
4425
|
+
/**
|
|
4426
|
+
* @beta
|
|
4427
|
+
* @throws This function can throw errors.
|
|
4428
|
+
*
|
|
4429
|
+
* {@link LocationInUnloadedChunkError}
|
|
4430
|
+
*
|
|
4431
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4432
|
+
*/
|
|
4433
|
+
getMapColor(): RGBA;
|
|
4164
4434
|
/**
|
|
4165
4435
|
* @remarks
|
|
4166
4436
|
* Returns array of all loaded block parts if this block has
|
|
@@ -4188,6 +4458,22 @@ export class Block {
|
|
|
4188
4458
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4189
4459
|
*/
|
|
4190
4460
|
getRedstonePower(): number | undefined;
|
|
4461
|
+
/**
|
|
4462
|
+
* @beta
|
|
4463
|
+
* @remarks
|
|
4464
|
+
* Returns the number of named tick events scheduled at this
|
|
4465
|
+
* block, regardless of which script pack scheduled them.
|
|
4466
|
+
*
|
|
4467
|
+
* @returns
|
|
4468
|
+
* The number of named tick events currently scheduled at this
|
|
4469
|
+
* block.
|
|
4470
|
+
* @throws This function can throw errors.
|
|
4471
|
+
*
|
|
4472
|
+
* {@link LocationInUnloadedChunkError}
|
|
4473
|
+
*
|
|
4474
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4475
|
+
*/
|
|
4476
|
+
getScheduledNamedTickCount(): number;
|
|
4191
4477
|
/**
|
|
4192
4478
|
* @remarks
|
|
4193
4479
|
* Returns the brightness level of light shining from the sky
|
|
@@ -4233,6 +4519,15 @@ export class Block {
|
|
|
4233
4519
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4234
4520
|
*/
|
|
4235
4521
|
hasComponent(componentId: string): boolean;
|
|
4522
|
+
/**
|
|
4523
|
+
* @beta
|
|
4524
|
+
* @throws This function can throw errors.
|
|
4525
|
+
*
|
|
4526
|
+
* {@link LocationInUnloadedChunkError}
|
|
4527
|
+
*
|
|
4528
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4529
|
+
*/
|
|
4530
|
+
hasScheduledNamedTick(eventName: string): boolean;
|
|
4236
4531
|
/**
|
|
4237
4532
|
* @remarks
|
|
4238
4533
|
* Checks to see if the permutation of this block has a
|
|
@@ -4373,6 +4668,47 @@ export class Block {
|
|
|
4373
4668
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4374
4669
|
*/
|
|
4375
4670
|
offset(offset: Vector3): Block | undefined;
|
|
4671
|
+
/**
|
|
4672
|
+
* @beta
|
|
4673
|
+
* @remarks
|
|
4674
|
+
* Removes all scheduled named tick events from this block with
|
|
4675
|
+
* the specified event name.
|
|
4676
|
+
*
|
|
4677
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4678
|
+
*
|
|
4679
|
+
* @param eventName
|
|
4680
|
+
* Name of the scheduled event to remove.
|
|
4681
|
+
* @throws This function can throw errors.
|
|
4682
|
+
*
|
|
4683
|
+
* {@link LocationInUnloadedChunkError}
|
|
4684
|
+
*
|
|
4685
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4686
|
+
*/
|
|
4687
|
+
removeScheduledNamedTicks(eventName: string): void;
|
|
4688
|
+
/**
|
|
4689
|
+
* @beta
|
|
4690
|
+
* @remarks
|
|
4691
|
+
* Schedules a named tick event for this block. The event will
|
|
4692
|
+
* be delivered to block custom components registered with the
|
|
4693
|
+
* `onNamedTick` callback after the specified delay.
|
|
4694
|
+
*
|
|
4695
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4696
|
+
*
|
|
4697
|
+
* @param eventName
|
|
4698
|
+
* Name of the event to schedule. Up to 31 characters.
|
|
4699
|
+
* @param tickDelay
|
|
4700
|
+
* Number of ticks to wait before the event is raised. Must be
|
|
4701
|
+
* at least 1.
|
|
4702
|
+
* Minimum value: 1
|
|
4703
|
+
* @throws This function can throw errors.
|
|
4704
|
+
*
|
|
4705
|
+
* {@link Error}
|
|
4706
|
+
*
|
|
4707
|
+
* {@link LocationInUnloadedChunkError}
|
|
4708
|
+
*
|
|
4709
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4710
|
+
*/
|
|
4711
|
+
scheduleNamedTick(eventName: string, tickDelay: number): void;
|
|
4376
4712
|
/**
|
|
4377
4713
|
* @remarks
|
|
4378
4714
|
* Sets the block in the dimension to the state of the
|
|
@@ -4441,6 +4777,27 @@ export class Block {
|
|
|
4441
4777
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4442
4778
|
*/
|
|
4443
4779
|
south(steps?: number): Block | undefined;
|
|
4780
|
+
/**
|
|
4781
|
+
* @beta
|
|
4782
|
+
* @remarks
|
|
4783
|
+
* Tries to set the block in the dimension to the state of the
|
|
4784
|
+
* permutation by first checking if the placement is valid.
|
|
4785
|
+
*
|
|
4786
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4787
|
+
*
|
|
4788
|
+
* @param permutation
|
|
4789
|
+
* Permutation that contains a set of property states for the
|
|
4790
|
+
* Block.
|
|
4791
|
+
* @returns
|
|
4792
|
+
* Returns `true` if the block permutation data was
|
|
4793
|
+
* successfully set, else `false`.
|
|
4794
|
+
* @throws This function can throw errors.
|
|
4795
|
+
*
|
|
4796
|
+
* {@link LocationInUnloadedChunkError}
|
|
4797
|
+
*
|
|
4798
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4799
|
+
*/
|
|
4800
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4444
4801
|
/**
|
|
4445
4802
|
* @remarks
|
|
4446
4803
|
* Returns the {@link Block} to the west of this block
|
|
@@ -4459,69 +4816,200 @@ export class Block {
|
|
|
4459
4816
|
}
|
|
4460
4817
|
|
|
4461
4818
|
/**
|
|
4462
|
-
*
|
|
4819
|
+
* @beta
|
|
4820
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4821
|
+
* of useful functions for the creation and utility of
|
|
4822
|
+
* {@link BlockBoundingBox} objects
|
|
4463
4823
|
*/
|
|
4464
|
-
|
|
4465
|
-
export class BlockComponent extends Component {
|
|
4824
|
+
export class BlockBoundingBoxUtils {
|
|
4466
4825
|
private constructor();
|
|
4467
4826
|
/**
|
|
4468
4827
|
* @remarks
|
|
4469
|
-
*
|
|
4828
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4829
|
+
* where the min and max components are guaranteed to be (min
|
|
4830
|
+
* <= max)
|
|
4831
|
+
*
|
|
4832
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4470
4833
|
*
|
|
4834
|
+
* @param min
|
|
4835
|
+
* A corner world location
|
|
4836
|
+
* @param max
|
|
4837
|
+
* A corner world location diametrically opposite
|
|
4471
4838
|
*/
|
|
4472
|
-
|
|
4473
|
-
}
|
|
4474
|
-
|
|
4475
|
-
/**
|
|
4476
|
-
* Contains information regarding a specific block being
|
|
4477
|
-
* broken.
|
|
4478
|
-
*/
|
|
4479
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4480
|
-
export class BlockComponentBlockBreakEvent extends BlockEvent {
|
|
4481
|
-
private constructor();
|
|
4839
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4482
4840
|
/**
|
|
4483
4841
|
* @remarks
|
|
4484
|
-
*
|
|
4842
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4843
|
+
* each axis.
|
|
4844
|
+
* Sizes can be negative to perform contraction.
|
|
4845
|
+
* Note: corners can be inverted if the contraction size is
|
|
4846
|
+
* greater than the span, but the min/max relationship will
|
|
4847
|
+
* remain correct
|
|
4848
|
+
*
|
|
4849
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4485
4850
|
*
|
|
4851
|
+
* @returns
|
|
4852
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4853
|
+
* the changes
|
|
4486
4854
|
*/
|
|
4487
|
-
|
|
4855
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4488
4856
|
/**
|
|
4489
4857
|
* @remarks
|
|
4490
|
-
*
|
|
4491
|
-
*
|
|
4858
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4859
|
+
*
|
|
4860
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4492
4861
|
*
|
|
4493
4862
|
*/
|
|
4494
|
-
|
|
4863
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4495
4864
|
/**
|
|
4496
4865
|
* @remarks
|
|
4497
|
-
*
|
|
4866
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4867
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4868
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4869
|
+
* boxes.
|
|
4870
|
+
*
|
|
4871
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4498
4872
|
*
|
|
4873
|
+
* @returns
|
|
4874
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4875
|
+
* smallest possible bounding box which can encompass both
|
|
4499
4876
|
*/
|
|
4500
|
-
|
|
4501
|
-
}
|
|
4502
|
-
|
|
4503
|
-
/**
|
|
4504
|
-
* Contains information regarding a specific block permutation
|
|
4505
|
-
* that was changed from a previous permutation.
|
|
4506
|
-
*/
|
|
4507
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4508
|
-
export class BlockComponentBlockStateChangeEvent extends BlockEvent {
|
|
4509
|
-
private constructor();
|
|
4877
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4510
4878
|
/**
|
|
4511
4879
|
* @remarks
|
|
4512
|
-
*
|
|
4880
|
+
* Calculate the center block of a given
|
|
4881
|
+
* {@link BlockBoundingBox} object.
|
|
4882
|
+
*
|
|
4883
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4513
4884
|
*
|
|
4885
|
+
* @returns
|
|
4886
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4887
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4888
|
+
* bounds are not mathematically centered...
|
|
4889
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4890
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4514
4891
|
*/
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4892
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4893
|
+
/**
|
|
4894
|
+
* @remarks
|
|
4895
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4896
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4897
|
+
*
|
|
4898
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4899
|
+
*
|
|
4900
|
+
*/
|
|
4901
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4902
|
+
/**
|
|
4903
|
+
* @remarks
|
|
4904
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4905
|
+
*
|
|
4906
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4907
|
+
*
|
|
4908
|
+
*/
|
|
4909
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4910
|
+
/**
|
|
4911
|
+
* @remarks
|
|
4912
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4913
|
+
*
|
|
4914
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4915
|
+
*
|
|
4916
|
+
*/
|
|
4917
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4918
|
+
/**
|
|
4919
|
+
* @remarks
|
|
4920
|
+
* Check to see if a given coordinate is inside a
|
|
4921
|
+
* BlockBoundingBox
|
|
4922
|
+
*
|
|
4923
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4924
|
+
*
|
|
4925
|
+
*/
|
|
4926
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4927
|
+
/**
|
|
4928
|
+
* @remarks
|
|
4929
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4930
|
+
* max))
|
|
4931
|
+
*
|
|
4932
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4933
|
+
*
|
|
4934
|
+
*/
|
|
4935
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4936
|
+
/**
|
|
4937
|
+
* @remarks
|
|
4938
|
+
* Move a BlockBoundingBox by a given amount
|
|
4939
|
+
*
|
|
4940
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4941
|
+
*
|
|
4942
|
+
* @returns
|
|
4943
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4944
|
+
* change
|
|
4945
|
+
*/
|
|
4946
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4947
|
+
}
|
|
4948
|
+
|
|
4949
|
+
/**
|
|
4950
|
+
* Base type for components associated with blocks.
|
|
4951
|
+
*/
|
|
4952
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4953
|
+
export class BlockComponent extends Component {
|
|
4954
|
+
private constructor();
|
|
4955
|
+
/**
|
|
4956
|
+
* @remarks
|
|
4957
|
+
* Block instance that this component pertains to.
|
|
4958
|
+
*
|
|
4959
|
+
*/
|
|
4960
|
+
readonly block: Block;
|
|
4961
|
+
}
|
|
4962
|
+
|
|
4963
|
+
/**
|
|
4964
|
+
* Contains information regarding a specific block being
|
|
4965
|
+
* broken.
|
|
4966
|
+
*/
|
|
4967
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4968
|
+
export class BlockComponentBlockBreakEvent extends BlockEvent {
|
|
4969
|
+
private constructor();
|
|
4970
|
+
/**
|
|
4971
|
+
* @remarks
|
|
4972
|
+
* The block that caused destruction.
|
|
4973
|
+
*
|
|
4974
|
+
*/
|
|
4975
|
+
readonly blockDestructionSource?: Block;
|
|
4976
|
+
/**
|
|
4977
|
+
* @remarks
|
|
4978
|
+
* Returns permutation information about this block before it
|
|
4979
|
+
* was broken.
|
|
4980
|
+
*
|
|
4981
|
+
*/
|
|
4982
|
+
readonly brokenBlockPermutation: BlockPermutation;
|
|
4983
|
+
/**
|
|
4984
|
+
* @remarks
|
|
4985
|
+
* The Actor that caused destruction.
|
|
4986
|
+
*
|
|
4987
|
+
*/
|
|
4988
|
+
readonly entitySource?: Entity;
|
|
4989
|
+
}
|
|
4990
|
+
|
|
4991
|
+
/**
|
|
4992
|
+
* Contains information regarding a specific block permutation
|
|
4993
|
+
* that was changed from a previous permutation.
|
|
4994
|
+
*/
|
|
4995
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4996
|
+
export class BlockComponentBlockStateChangeEvent extends BlockEvent {
|
|
4997
|
+
private constructor();
|
|
4998
|
+
/**
|
|
4999
|
+
* @remarks
|
|
5000
|
+
* The previous BlockPermutation.
|
|
5001
|
+
*
|
|
5002
|
+
*/
|
|
5003
|
+
readonly previousPermutation: BlockPermutation;
|
|
5004
|
+
}
|
|
5005
|
+
|
|
5006
|
+
/**
|
|
5007
|
+
* Contains information regarding an event sent by an entity to
|
|
5008
|
+
* this block in the world.
|
|
5009
|
+
*/
|
|
5010
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5011
|
+
export class BlockComponentEntityEvent extends BlockEvent {
|
|
5012
|
+
private constructor();
|
|
4525
5013
|
/**
|
|
4526
5014
|
* @remarks
|
|
4527
5015
|
* Returns permutation information about the block receiving
|
|
@@ -4564,6 +5052,54 @@ export class BlockComponentEntityFallOnEvent extends BlockEvent {
|
|
|
4564
5052
|
readonly fallDistance: number;
|
|
4565
5053
|
}
|
|
4566
5054
|
|
|
5055
|
+
/**
|
|
5056
|
+
* @beta
|
|
5057
|
+
* Contains information regarding a named tick event for a
|
|
5058
|
+
* specific block.
|
|
5059
|
+
*/
|
|
5060
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5061
|
+
export class BlockComponentNamedTickEvent extends BlockEvent {
|
|
5062
|
+
private constructor();
|
|
5063
|
+
/**
|
|
5064
|
+
* @remarks
|
|
5065
|
+
* Name of the named tick event.
|
|
5066
|
+
*
|
|
5067
|
+
*/
|
|
5068
|
+
readonly name: string;
|
|
5069
|
+
/**
|
|
5070
|
+
* @remarks
|
|
5071
|
+
* Checks whether this named tick event was scheduled by this
|
|
5072
|
+
* pack.
|
|
5073
|
+
*
|
|
5074
|
+
* @returns
|
|
5075
|
+
* True if this named tick event was scheduled by this pack;
|
|
5076
|
+
* otherwise, false.
|
|
5077
|
+
*/
|
|
5078
|
+
isMine(): boolean;
|
|
5079
|
+
}
|
|
5080
|
+
|
|
5081
|
+
/**
|
|
5082
|
+
* @beta
|
|
5083
|
+
* Contains information regarding neighboring block changes for
|
|
5084
|
+
* a specific block.
|
|
5085
|
+
*/
|
|
5086
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5087
|
+
export class BlockComponentNeighborChangedAfterEvent extends BlockEvent {
|
|
5088
|
+
private constructor();
|
|
5089
|
+
/**
|
|
5090
|
+
* @remarks
|
|
5091
|
+
* Returns the neighboring block changes for this event.
|
|
5092
|
+
*
|
|
5093
|
+
* @returns
|
|
5094
|
+
* One entry for each neighboring direction that changed,
|
|
5095
|
+
* ordered by when each direction first changed. If a direction
|
|
5096
|
+
* changed multiple times during the tick, the entry contains
|
|
5097
|
+
* the permutation before the first change and after the last
|
|
5098
|
+
* change. Intermediate permutations are not included.
|
|
5099
|
+
*/
|
|
5100
|
+
getChanges(): NeighborChange[];
|
|
5101
|
+
}
|
|
5102
|
+
|
|
4567
5103
|
/**
|
|
4568
5104
|
* Contains information regarding a specific block that was
|
|
4569
5105
|
* placed.
|
|
@@ -4680,6 +5216,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
|
|
|
4680
5216
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4681
5217
|
export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
|
|
4682
5218
|
private constructor();
|
|
5219
|
+
/**
|
|
5220
|
+
* @beta
|
|
5221
|
+
* @remarks
|
|
5222
|
+
* The first update event for the redstone component.
|
|
5223
|
+
*
|
|
5224
|
+
*/
|
|
5225
|
+
readonly firstUpdate: boolean;
|
|
4683
5226
|
/**
|
|
4684
5227
|
* @remarks
|
|
4685
5228
|
* The redstone signal strength passing through this block. It
|
|
@@ -4974,6 +5517,181 @@ export class BlockDynamicPropertiesComponent extends BlockComponent {
|
|
|
4974
5517
|
totalByteCount(): number;
|
|
4975
5518
|
}
|
|
4976
5519
|
|
|
5520
|
+
/**
|
|
5521
|
+
* @beta
|
|
5522
|
+
* Represents storage for entities associated with a block
|
|
5523
|
+
* entity. This component is available on blocks whose behavior
|
|
5524
|
+
* pack definition enables entity storage with the
|
|
5525
|
+
* `minecraft:block_entity` component. Stored entities are
|
|
5526
|
+
* serialized and removed from the world until they are
|
|
5527
|
+
* released or transferred. A block can store up to four
|
|
5528
|
+
* entities. Entity storage is scoped to the content pack
|
|
5529
|
+
* accessing it.
|
|
5530
|
+
*/
|
|
5531
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5532
|
+
export class BlockEntityStorageComponent extends BlockComponent {
|
|
5533
|
+
private constructor();
|
|
5534
|
+
static readonly componentId = 'minecraft:entity_storage';
|
|
5535
|
+
/**
|
|
5536
|
+
* @remarks
|
|
5537
|
+
* Returns information about the entities stored in this
|
|
5538
|
+
* block's entity storage. The returned entities are not
|
|
5539
|
+
* present in the world while they are stored. Only entities
|
|
5540
|
+
* stored by the current content pack are included.
|
|
5541
|
+
*
|
|
5542
|
+
* @returns
|
|
5543
|
+
* An array of {@link BlockEntityStorageInfo} values containing
|
|
5544
|
+
* the unique ID and definition ID of each stored entity.
|
|
5545
|
+
* Returns an empty array when no entities are stored by the
|
|
5546
|
+
* current content pack.
|
|
5547
|
+
* @throws
|
|
5548
|
+
* Throws if the block entity is invalid or the block's
|
|
5549
|
+
* location is not loaded or is outside the world boundaries.
|
|
5550
|
+
*
|
|
5551
|
+
* {@link Error}
|
|
5552
|
+
*
|
|
5553
|
+
* {@link InvalidBlockComponentError}
|
|
5554
|
+
*
|
|
5555
|
+
* {@link LocationInUnloadedChunkError}
|
|
5556
|
+
*
|
|
5557
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5558
|
+
*/
|
|
5559
|
+
getEntities(): BlockEntityStorageInfo[];
|
|
5560
|
+
/**
|
|
5561
|
+
* @remarks
|
|
5562
|
+
* Releases a stored entity from this block's entity storage
|
|
5563
|
+
* and spawns it back into the world, at the same location it
|
|
5564
|
+
* was when stored.
|
|
5565
|
+
*
|
|
5566
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
5567
|
+
*
|
|
5568
|
+
* @param entityId
|
|
5569
|
+
* The unique ID of the stored entity. Use the value returned
|
|
5570
|
+
* by {@link BlockEntityStorageComponent.store} or the
|
|
5571
|
+
* `uniqueId` property from {@link BlockEntityStorageInfo}.
|
|
5572
|
+
* @returns
|
|
5573
|
+
* The released {@link Entity}. The released entity receives a
|
|
5574
|
+
* new runtime ID.
|
|
5575
|
+
* @throws
|
|
5576
|
+
* Throws if the entity ID is invalid or does not identify an
|
|
5577
|
+
* entity stored by the current content pack, if the stored
|
|
5578
|
+
* entity cannot be loaded or spawned, or if the block entity
|
|
5579
|
+
* is invalid.
|
|
5580
|
+
*
|
|
5581
|
+
* {@link Error}
|
|
5582
|
+
*
|
|
5583
|
+
* {@link InvalidBlockComponentError}
|
|
5584
|
+
*
|
|
5585
|
+
* {@link LocationInUnloadedChunkError}
|
|
5586
|
+
*
|
|
5587
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5588
|
+
*/
|
|
5589
|
+
release(entityId: string): Entity;
|
|
5590
|
+
/**
|
|
5591
|
+
* @remarks
|
|
5592
|
+
* Returns the number of entities stored in this block's entity
|
|
5593
|
+
* storage by the current content pack.
|
|
5594
|
+
*
|
|
5595
|
+
* @returns
|
|
5596
|
+
* The number of entities stored by the current content pack.
|
|
5597
|
+
* @throws
|
|
5598
|
+
* Throws if the block entity is invalid or the block's
|
|
5599
|
+
* location is not loaded or is outside the world boundaries.
|
|
5600
|
+
*
|
|
5601
|
+
* {@link Error}
|
|
5602
|
+
*
|
|
5603
|
+
* {@link InvalidBlockComponentError}
|
|
5604
|
+
*
|
|
5605
|
+
* {@link LocationInUnloadedChunkError}
|
|
5606
|
+
*
|
|
5607
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5608
|
+
*/
|
|
5609
|
+
size(): number;
|
|
5610
|
+
/**
|
|
5611
|
+
* @remarks
|
|
5612
|
+
* Serializes and stores an entity in this block's entity
|
|
5613
|
+
* storage. The entity is removed from the world after it is
|
|
5614
|
+
* stored. Only non-player mob entities can be stored. Entities
|
|
5615
|
+
* with passengers or that are passengers cannot be stored.
|
|
5616
|
+
*
|
|
5617
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
5618
|
+
*
|
|
5619
|
+
* @param entity
|
|
5620
|
+
* The {@link Entity} to store.
|
|
5621
|
+
* @returns
|
|
5622
|
+
* The unique ID assigned to the stored entity. Keep this ID to
|
|
5623
|
+
* release, transfer, or inspect the stored entity later.
|
|
5624
|
+
* @throws
|
|
5625
|
+
* Throws if the storage is full, the entity is already stored,
|
|
5626
|
+
* the entity cannot be serialized, or the block entity is
|
|
5627
|
+
* invalid.
|
|
5628
|
+
*
|
|
5629
|
+
* {@link Error}
|
|
5630
|
+
*
|
|
5631
|
+
* {@link InvalidBlockComponentError}
|
|
5632
|
+
*
|
|
5633
|
+
* {@link LocationInUnloadedChunkError}
|
|
5634
|
+
*
|
|
5635
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5636
|
+
*/
|
|
5637
|
+
store(entity: Entity): string;
|
|
5638
|
+
/**
|
|
5639
|
+
* @remarks
|
|
5640
|
+
* Moves a stored entity from this block's entity storage to
|
|
5641
|
+
* the target block's entity storage without releasing it into
|
|
5642
|
+
* the world.
|
|
5643
|
+
*
|
|
5644
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
5645
|
+
*
|
|
5646
|
+
* @param entityId
|
|
5647
|
+
* The unique ID of the stored entity. Use the value returned
|
|
5648
|
+
* by {@link BlockEntityStorageComponent.store} or the
|
|
5649
|
+
* `uniqueId` property from {@link BlockEntityStorageInfo}.
|
|
5650
|
+
* @param targetBlock
|
|
5651
|
+
* The target {@link Block} with an entity storage component.
|
|
5652
|
+
* The target block must be in the same dimension as this
|
|
5653
|
+
* block.
|
|
5654
|
+
* @throws
|
|
5655
|
+
* Throws if the entity ID is invalid or not stored by the
|
|
5656
|
+
* current content pack, if the target block is invalid, in
|
|
5657
|
+
* another dimension, lacks entity storage, or is full, or if
|
|
5658
|
+
* the source and target blocks are the same.
|
|
5659
|
+
*
|
|
5660
|
+
* {@link Error}
|
|
5661
|
+
*
|
|
5662
|
+
* {@link InvalidBlockComponentError}
|
|
5663
|
+
*
|
|
5664
|
+
* {@link LocationInUnloadedChunkError}
|
|
5665
|
+
*
|
|
5666
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5667
|
+
*/
|
|
5668
|
+
transfer(entityId: string, targetBlock: Block): void;
|
|
5669
|
+
}
|
|
5670
|
+
|
|
5671
|
+
/**
|
|
5672
|
+
* @beta
|
|
5673
|
+
* Contains identifying information about an entity stored in a
|
|
5674
|
+
* {@link BlockEntityStorageComponent}. Stored entities are not
|
|
5675
|
+
* present in the world until they are released.
|
|
5676
|
+
*/
|
|
5677
|
+
export class BlockEntityStorageInfo {
|
|
5678
|
+
private constructor();
|
|
5679
|
+
/**
|
|
5680
|
+
* @remarks
|
|
5681
|
+
* The entity's definition ID, such as `minecraft:pig`.
|
|
5682
|
+
*
|
|
5683
|
+
*/
|
|
5684
|
+
readonly definitionId: string;
|
|
5685
|
+
/**
|
|
5686
|
+
* @remarks
|
|
5687
|
+
* The unique ID of the stored entity. Use this ID with
|
|
5688
|
+
* {@link BlockEntityStorageComponent.release} or
|
|
5689
|
+
* {@link BlockEntityStorageComponent.transfer}.
|
|
5690
|
+
*
|
|
5691
|
+
*/
|
|
5692
|
+
readonly uniqueId: string;
|
|
5693
|
+
}
|
|
5694
|
+
|
|
4977
5695
|
/**
|
|
4978
5696
|
* Contains information regarding an event that impacts a
|
|
4979
5697
|
* specific block.
|
|
@@ -5234,6 +5952,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
5234
5952
|
*
|
|
5235
5953
|
*/
|
|
5236
5954
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5955
|
+
/**
|
|
5956
|
+
* @beta
|
|
5957
|
+
* @remarks
|
|
5958
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5959
|
+
* Will return false if the block volume was modified between
|
|
5960
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5961
|
+
*
|
|
5962
|
+
* @throws This function can throw errors.
|
|
5963
|
+
*
|
|
5964
|
+
* {@link minecraftcommon.EngineError}
|
|
5965
|
+
*/
|
|
5966
|
+
isValid(): boolean;
|
|
5237
5967
|
/**
|
|
5238
5968
|
* @remarks
|
|
5239
5969
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
@@ -5633,25 +6363,158 @@ export class BlockPrecipitationInteractionsComponent extends BlockComponent {
|
|
|
5633
6363
|
}
|
|
5634
6364
|
|
|
5635
6365
|
/**
|
|
5636
|
-
*
|
|
6366
|
+
* @beta
|
|
6367
|
+
* Represents a block component that provides access to recipe
|
|
6368
|
+
* crafting.
|
|
5637
6369
|
*/
|
|
5638
6370
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5639
|
-
export class
|
|
6371
|
+
export class BlockRecipeCraftingComponent extends BlockComponent {
|
|
5640
6372
|
private constructor();
|
|
5641
|
-
static readonly componentId = 'minecraft:record_player';
|
|
5642
6373
|
/**
|
|
5643
6374
|
* @remarks
|
|
5644
|
-
*
|
|
5645
|
-
* block.
|
|
5646
|
-
*
|
|
5647
|
-
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
6375
|
+
* Returns an array of all players currently interacting with
|
|
6376
|
+
* this block.
|
|
5648
6377
|
*
|
|
5649
|
-
* @throws This function can throw errors.
|
|
5650
6378
|
*/
|
|
5651
|
-
|
|
6379
|
+
readonly players: Player[];
|
|
6380
|
+
static readonly componentId = 'minecraft:recipe_crafting';
|
|
5652
6381
|
/**
|
|
5653
6382
|
* @remarks
|
|
5654
|
-
* Gets the
|
|
6383
|
+
* Gets the recipe crafting context for a player interacting
|
|
6384
|
+
* with this block.
|
|
6385
|
+
*
|
|
6386
|
+
* @param player
|
|
6387
|
+
* The player for whom to retrieve the crafting context.
|
|
6388
|
+
* @returns
|
|
6389
|
+
* The current recipe crafting context for the player, or
|
|
6390
|
+
* undefined if the player isn't crafting.
|
|
6391
|
+
* @throws This function can throw errors.
|
|
6392
|
+
*
|
|
6393
|
+
* {@link minecraftcommon.EngineError}
|
|
6394
|
+
*
|
|
6395
|
+
* {@link InvalidEntityError}
|
|
6396
|
+
*/
|
|
6397
|
+
getCraftingContext(player: Player): RecipeCraftingContext | undefined;
|
|
6398
|
+
}
|
|
6399
|
+
|
|
6400
|
+
/**
|
|
6401
|
+
* @beta
|
|
6402
|
+
* Represents a block component that provides access to recipe
|
|
6403
|
+
* processing inputs and output.
|
|
6404
|
+
*/
|
|
6405
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6406
|
+
export class BlockRecipeProcessingComponent extends BlockComponent {
|
|
6407
|
+
private constructor();
|
|
6408
|
+
/**
|
|
6409
|
+
* @remarks
|
|
6410
|
+
* The number of addressable input slots for getInputItem,
|
|
6411
|
+
* setInputItem, setInputSlotEnabled, and getInputSlotEnabled.
|
|
6412
|
+
*
|
|
6413
|
+
* @throws This property can throw when used.
|
|
6414
|
+
*
|
|
6415
|
+
* {@link InvalidBlockComponentError}
|
|
6416
|
+
*/
|
|
6417
|
+
readonly inputSlotCount: number;
|
|
6418
|
+
static readonly componentId = 'minecraft:recipe_processing';
|
|
6419
|
+
/**
|
|
6420
|
+
* @remarks
|
|
6421
|
+
* Gets the item in the provided input slot.
|
|
6422
|
+
*
|
|
6423
|
+
* @param slot
|
|
6424
|
+
* The zero-based input slot index.
|
|
6425
|
+
* @returns
|
|
6426
|
+
* The item stack in the input slot, or undefined if the slot
|
|
6427
|
+
* is empty.
|
|
6428
|
+
* @throws This function can throw errors.
|
|
6429
|
+
*
|
|
6430
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6431
|
+
*
|
|
6432
|
+
* {@link InvalidBlockComponentError}
|
|
6433
|
+
*/
|
|
6434
|
+
getInputItem(slot: number): ItemStack | undefined;
|
|
6435
|
+
/**
|
|
6436
|
+
* @remarks
|
|
6437
|
+
* Gets whether an input slot is enabled for recipe processing.
|
|
6438
|
+
*
|
|
6439
|
+
* @param slot
|
|
6440
|
+
* The zero-based input slot index.
|
|
6441
|
+
* @returns
|
|
6442
|
+
* Whether the input slot is enabled.
|
|
6443
|
+
* @throws This function can throw errors.
|
|
6444
|
+
*
|
|
6445
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6446
|
+
*
|
|
6447
|
+
* {@link InvalidBlockComponentError}
|
|
6448
|
+
*
|
|
6449
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6450
|
+
*/
|
|
6451
|
+
getInputSlotEnabled(slot: number): boolean;
|
|
6452
|
+
/**
|
|
6453
|
+
* @remarks
|
|
6454
|
+
* Gets the item produced by the current recipe processing
|
|
6455
|
+
* inputs.
|
|
6456
|
+
*
|
|
6457
|
+
* @returns
|
|
6458
|
+
* The output item stack, or undefined if the current inputs do
|
|
6459
|
+
* not produce an item.
|
|
6460
|
+
* @throws This function can throw errors.
|
|
6461
|
+
*
|
|
6462
|
+
* {@link InvalidBlockComponentError}
|
|
6463
|
+
*/
|
|
6464
|
+
getOutputItem(): ItemStack | undefined;
|
|
6465
|
+
/**
|
|
6466
|
+
* @remarks
|
|
6467
|
+
* Sets or clears an item in an input slot.
|
|
6468
|
+
*
|
|
6469
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
6470
|
+
*
|
|
6471
|
+
* @param slot
|
|
6472
|
+
* The zero-based input slot index.
|
|
6473
|
+
* @param item
|
|
6474
|
+
* The item stack to place in the slot, or undefined to clear
|
|
6475
|
+
* the slot.
|
|
6476
|
+
* @throws This function can throw errors.
|
|
6477
|
+
*
|
|
6478
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6479
|
+
*
|
|
6480
|
+
* {@link InvalidBlockComponentError}
|
|
6481
|
+
*/
|
|
6482
|
+
setInputItem(slot: number, item?: ItemStack): void;
|
|
6483
|
+
/**
|
|
6484
|
+
* @remarks
|
|
6485
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
6486
|
+
*
|
|
6487
|
+
* @throws This function can throw errors.
|
|
6488
|
+
*
|
|
6489
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6490
|
+
*
|
|
6491
|
+
* {@link InvalidBlockComponentError}
|
|
6492
|
+
*
|
|
6493
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6494
|
+
*/
|
|
6495
|
+
setInputSlotEnabled(slot: number, enabled: boolean): void;
|
|
6496
|
+
}
|
|
6497
|
+
|
|
6498
|
+
/**
|
|
6499
|
+
* Represents a block that can play a record.
|
|
6500
|
+
*/
|
|
6501
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6502
|
+
export class BlockRecordPlayerComponent extends BlockComponent {
|
|
6503
|
+
private constructor();
|
|
6504
|
+
static readonly componentId = 'minecraft:record_player';
|
|
6505
|
+
/**
|
|
6506
|
+
* @remarks
|
|
6507
|
+
* Ejects the currently set record of this record-playing
|
|
6508
|
+
* block.
|
|
6509
|
+
*
|
|
6510
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
6511
|
+
*
|
|
6512
|
+
* @throws This function can throw errors.
|
|
6513
|
+
*/
|
|
6514
|
+
ejectRecord(): void;
|
|
6515
|
+
/**
|
|
6516
|
+
* @remarks
|
|
6517
|
+
* Gets the currently set record of this record-playing block.
|
|
5655
6518
|
*
|
|
5656
6519
|
* @throws This function can throw errors.
|
|
5657
6520
|
*/
|
|
@@ -6054,6 +6917,49 @@ export class BlockTypes {
|
|
|
6054
6917
|
static getAll(): BlockType[];
|
|
6055
6918
|
}
|
|
6056
6919
|
|
|
6920
|
+
/**
|
|
6921
|
+
* @beta
|
|
6922
|
+
* Represents the vibration properties of a block with a
|
|
6923
|
+
* 'minecraft:vibration_properties' component.
|
|
6924
|
+
*/
|
|
6925
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6926
|
+
export class BlockVibrationPropertiesComponent extends BlockComponent {
|
|
6927
|
+
private constructor();
|
|
6928
|
+
static readonly componentId = 'minecraft:vibration_properties';
|
|
6929
|
+
/**
|
|
6930
|
+
* @remarks
|
|
6931
|
+
* Gets whether this block can dampen vibrations. Vibrations
|
|
6932
|
+
* that occur on this block will be discarded by this block if
|
|
6933
|
+
* it can dampen vibrations. Returns false when the block does
|
|
6934
|
+
* not define a 'minecraft:vibration_properties' component.
|
|
6935
|
+
*
|
|
6936
|
+
* @returns
|
|
6937
|
+
* Whether this block can dampen vibrations.
|
|
6938
|
+
* @throws This function can throw errors.
|
|
6939
|
+
*
|
|
6940
|
+
* {@link LocationInUnloadedChunkError}
|
|
6941
|
+
*
|
|
6942
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
6943
|
+
*/
|
|
6944
|
+
getCanDampenVibrations(): boolean;
|
|
6945
|
+
/**
|
|
6946
|
+
* @remarks
|
|
6947
|
+
* Gets whether this block can occlude vibrations. Vibrations
|
|
6948
|
+
* that pass through this block will be discarded if this block
|
|
6949
|
+
* can occlude vibrations. Returns false when the block does
|
|
6950
|
+
* not define a 'minecraft:vibration_properties' component.
|
|
6951
|
+
*
|
|
6952
|
+
* @returns
|
|
6953
|
+
* Whether this block can occlude vibrations.
|
|
6954
|
+
* @throws This function can throw errors.
|
|
6955
|
+
*
|
|
6956
|
+
* {@link LocationInUnloadedChunkError}
|
|
6957
|
+
*
|
|
6958
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
6959
|
+
*/
|
|
6960
|
+
getCanOccludeVibrations(): boolean;
|
|
6961
|
+
}
|
|
6962
|
+
|
|
6057
6963
|
/**
|
|
6058
6964
|
* A BlockVolume is a simple interface to an object which
|
|
6059
6965
|
* represents a 3D rectangle of a given size (in blocks) at a
|
|
@@ -6149,6 +7055,15 @@ export class BlockVolumeBase {
|
|
|
6149
7055
|
*
|
|
6150
7056
|
*/
|
|
6151
7057
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
7058
|
+
/**
|
|
7059
|
+
* @beta
|
|
7060
|
+
* @remarks
|
|
7061
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
7062
|
+
* the validated min and max coordinates of the volume
|
|
7063
|
+
*
|
|
7064
|
+
* @throws This function can throw errors.
|
|
7065
|
+
*/
|
|
7066
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6152
7067
|
/**
|
|
6153
7068
|
* @remarks
|
|
6154
7069
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -6420,6 +7335,23 @@ export class Camera {
|
|
|
6420
7335
|
| CameraSetRotOptions
|
|
6421
7336
|
| CameraTargetOptions,
|
|
6422
7337
|
): void;
|
|
7338
|
+
/**
|
|
7339
|
+
* @beta
|
|
7340
|
+
* @remarks
|
|
7341
|
+
* Sets the current active camera with easing.
|
|
7342
|
+
*
|
|
7343
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7344
|
+
*
|
|
7345
|
+
* @param cameraPreset
|
|
7346
|
+
* Identifier of a camera preset file defined within JSON.
|
|
7347
|
+
* @param easeOptions
|
|
7348
|
+
* Options to ease the camera from the previous camera to the
|
|
7349
|
+
* current one.
|
|
7350
|
+
* @throws
|
|
7351
|
+
* Throws when easing to minecraft:first_person presets
|
|
7352
|
+
* currently without the experimental cameras toggle enabled.
|
|
7353
|
+
*/
|
|
7354
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
6423
7355
|
/**
|
|
6424
7356
|
* @remarks
|
|
6425
7357
|
* Sets the current active camera for the specified player and
|
|
@@ -6454,6 +7386,37 @@ export class Camera {
|
|
|
6454
7386
|
stopShaking(): void;
|
|
6455
7387
|
}
|
|
6456
7388
|
|
|
7389
|
+
/**
|
|
7390
|
+
* @beta
|
|
7391
|
+
* Loot item function that will try to copy the block entity
|
|
7392
|
+
* data from the destroyed block to the dropped item.
|
|
7393
|
+
*/
|
|
7394
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
7395
|
+
export class CarryOverBlockEntityDataFunction extends LootItemFunction {
|
|
7396
|
+
private constructor();
|
|
7397
|
+
/**
|
|
7398
|
+
* @remarks
|
|
7399
|
+
* If true, and if the block entity had dynamic_properties, the
|
|
7400
|
+
* function will copy the dynamic properties from the block
|
|
7401
|
+
* entity to the dropped item.
|
|
7402
|
+
*
|
|
7403
|
+
*/
|
|
7404
|
+
readonly dynamicProperties: boolean;
|
|
7405
|
+
/**
|
|
7406
|
+
* @remarks
|
|
7407
|
+
* If true, and if the block entity supports entity storage,
|
|
7408
|
+
* the function will copy the stored entities from the block
|
|
7409
|
+
* entity to the dropped item without releasing them. Placing
|
|
7410
|
+
* the item restores the stored entities if the placed block
|
|
7411
|
+
* supports entity storage. In loot table JSON, the optional
|
|
7412
|
+
* entity_storage Boolean field defaults to false and is
|
|
7413
|
+
* independent of dynamic_properties. Requires the Upcoming
|
|
7414
|
+
* Creator Features experiment.
|
|
7415
|
+
*
|
|
7416
|
+
*/
|
|
7417
|
+
readonly entityStorage: boolean;
|
|
7418
|
+
}
|
|
7419
|
+
|
|
6457
7420
|
/**
|
|
6458
7421
|
* CatmullRom spline creation.
|
|
6459
7422
|
*/
|
|
@@ -6468,6 +7431,165 @@ export class CatmullRomSpline {
|
|
|
6468
7431
|
controlPoints: Vector3[];
|
|
6469
7432
|
}
|
|
6470
7433
|
|
|
7434
|
+
/**
|
|
7435
|
+
* @beta
|
|
7436
|
+
* An event that fires as players enter chat messages.
|
|
7437
|
+
*/
|
|
7438
|
+
export class ChatSendAfterEvent {
|
|
7439
|
+
private constructor();
|
|
7440
|
+
/**
|
|
7441
|
+
* @remarks
|
|
7442
|
+
* Message that is being broadcast.
|
|
7443
|
+
*
|
|
7444
|
+
*/
|
|
7445
|
+
readonly message: string;
|
|
7446
|
+
/**
|
|
7447
|
+
* @remarks
|
|
7448
|
+
* Player that sent the chat message.
|
|
7449
|
+
*
|
|
7450
|
+
*/
|
|
7451
|
+
readonly sender: Player;
|
|
7452
|
+
/**
|
|
7453
|
+
* @remarks
|
|
7454
|
+
* Optional list of players that will receive this message. If
|
|
7455
|
+
* defined, this message is directly targeted to one or more
|
|
7456
|
+
* players (i.e., is not broadcast.)
|
|
7457
|
+
*
|
|
7458
|
+
*/
|
|
7459
|
+
readonly targets?: Player[];
|
|
7460
|
+
}
|
|
7461
|
+
|
|
7462
|
+
/**
|
|
7463
|
+
* @beta
|
|
7464
|
+
* Manages callbacks that are connected to chat messages being
|
|
7465
|
+
* sent.
|
|
7466
|
+
*/
|
|
7467
|
+
export class ChatSendAfterEventSignal {
|
|
7468
|
+
private constructor();
|
|
7469
|
+
/**
|
|
7470
|
+
* @remarks
|
|
7471
|
+
* Adds a callback that will be called when new chat messages
|
|
7472
|
+
* are sent.
|
|
7473
|
+
*
|
|
7474
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7475
|
+
*
|
|
7476
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
7477
|
+
*
|
|
7478
|
+
*/
|
|
7479
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
7480
|
+
/**
|
|
7481
|
+
* @remarks
|
|
7482
|
+
* Removes a callback from being called when new chat messages
|
|
7483
|
+
* are sent.
|
|
7484
|
+
*
|
|
7485
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7486
|
+
*
|
|
7487
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
7488
|
+
*
|
|
7489
|
+
*/
|
|
7490
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
7491
|
+
}
|
|
7492
|
+
|
|
7493
|
+
/**
|
|
7494
|
+
* @beta
|
|
7495
|
+
* An event that fires as players enter chat messages.
|
|
7496
|
+
*/
|
|
7497
|
+
export class ChatSendBeforeEvent {
|
|
7498
|
+
private constructor();
|
|
7499
|
+
/**
|
|
7500
|
+
* @remarks
|
|
7501
|
+
* If set to true in a beforeChat event handler, this message
|
|
7502
|
+
* is not broadcast out.
|
|
7503
|
+
*
|
|
7504
|
+
*/
|
|
7505
|
+
cancel: boolean;
|
|
7506
|
+
/**
|
|
7507
|
+
* @remarks
|
|
7508
|
+
* Message that is being broadcast.
|
|
7509
|
+
*
|
|
7510
|
+
*/
|
|
7511
|
+
readonly message: string;
|
|
7512
|
+
/**
|
|
7513
|
+
* @remarks
|
|
7514
|
+
* Player that sent the chat message.
|
|
7515
|
+
*
|
|
7516
|
+
*/
|
|
7517
|
+
readonly sender: Player;
|
|
7518
|
+
/**
|
|
7519
|
+
* @remarks
|
|
7520
|
+
* Optional list of players that will receive this message. If
|
|
7521
|
+
* defined, this message is directly targeted to one or more
|
|
7522
|
+
* players (i.e., is not broadcast). This list can be modified
|
|
7523
|
+
* to change the message recipients.
|
|
7524
|
+
*
|
|
7525
|
+
*/
|
|
7526
|
+
targets?: Player[];
|
|
7527
|
+
}
|
|
7528
|
+
|
|
7529
|
+
/**
|
|
7530
|
+
* @beta
|
|
7531
|
+
* Manages callbacks that are connected to an event that fires
|
|
7532
|
+
* before chat messages are sent.
|
|
7533
|
+
* @example customCommand.ts
|
|
7534
|
+
* ```typescript
|
|
7535
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
7536
|
+
*
|
|
7537
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
7538
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
7539
|
+
* if (eventData.message.includes('cancel')) {
|
|
7540
|
+
* // Cancel event if the message contains "cancel"
|
|
7541
|
+
* eventData.cancel = true;
|
|
7542
|
+
* } else {
|
|
7543
|
+
* const args = eventData.message.split(' ');
|
|
7544
|
+
*
|
|
7545
|
+
* if (args.length > 0) {
|
|
7546
|
+
* switch (args[0].toLowerCase()) {
|
|
7547
|
+
* case 'echo':
|
|
7548
|
+
* // Send a modified version of chat message
|
|
7549
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
7550
|
+
* break;
|
|
7551
|
+
* case 'help':
|
|
7552
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
7553
|
+
* break;
|
|
7554
|
+
* }
|
|
7555
|
+
* }
|
|
7556
|
+
* }
|
|
7557
|
+
* });
|
|
7558
|
+
* }
|
|
7559
|
+
* ```
|
|
7560
|
+
*/
|
|
7561
|
+
export class ChatSendBeforeEventSignal {
|
|
7562
|
+
private constructor();
|
|
7563
|
+
/**
|
|
7564
|
+
* @remarks
|
|
7565
|
+
* Adds a callback that will be called before new chat messages
|
|
7566
|
+
* are sent.
|
|
7567
|
+
*
|
|
7568
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7569
|
+
*
|
|
7570
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
7571
|
+
*
|
|
7572
|
+
* @param callback
|
|
7573
|
+
* This closure is called with restricted-execution privilege.
|
|
7574
|
+
* @returns
|
|
7575
|
+
* Closure that is called with restricted-execution privilege.
|
|
7576
|
+
*/
|
|
7577
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
7578
|
+
/**
|
|
7579
|
+
* @remarks
|
|
7580
|
+
* Removes a callback from being called before new chat
|
|
7581
|
+
* messages are sent.
|
|
7582
|
+
*
|
|
7583
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7584
|
+
*
|
|
7585
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
7586
|
+
*
|
|
7587
|
+
* @param callback
|
|
7588
|
+
* This closure is called with restricted-execution privilege.
|
|
7589
|
+
*/
|
|
7590
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
7591
|
+
}
|
|
7592
|
+
|
|
6471
7593
|
/**
|
|
6472
7594
|
* Contains the device information for a client instance.
|
|
6473
7595
|
*/
|
|
@@ -6676,7 +7798,9 @@ export class Container {
|
|
|
6676
7798
|
*
|
|
6677
7799
|
* @param itemStack
|
|
6678
7800
|
* The stack of items to add.
|
|
6679
|
-
* @throws
|
|
7801
|
+
* @throws
|
|
7802
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7803
|
+
* limit but will instead add items up to the weight limit.
|
|
6680
7804
|
*
|
|
6681
7805
|
* {@link ContainerRulesError}
|
|
6682
7806
|
*
|
|
@@ -6914,6 +8038,8 @@ export class Container {
|
|
|
6914
8038
|
* @throws
|
|
6915
8039
|
* Throws if either this container or `toContainer` are invalid
|
|
6916
8040
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
8041
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
8042
|
+
* limit but will instead add items up to the weight limit.
|
|
6917
8043
|
*
|
|
6918
8044
|
* {@link ContainerRulesError}
|
|
6919
8045
|
*
|
|
@@ -7544,6 +8670,15 @@ export class Dimension {
|
|
|
7544
8670
|
*
|
|
7545
8671
|
*/
|
|
7546
8672
|
readonly localizationKey: string;
|
|
8673
|
+
/**
|
|
8674
|
+
* @rc
|
|
8675
|
+
* @remarks
|
|
8676
|
+
* Provides access to point-of-interest (POI) managers for this
|
|
8677
|
+
* dimension. This property is available only when the POI
|
|
8678
|
+
* experiment is enabled.
|
|
8679
|
+
*
|
|
8680
|
+
*/
|
|
8681
|
+
readonly poiManager: PoiManager;
|
|
7547
8682
|
/**
|
|
7548
8683
|
* @remarks
|
|
7549
8684
|
* Calculates the location of the closest biome of a particular
|
|
@@ -7817,7 +8952,7 @@ export class Dimension {
|
|
|
7817
8952
|
* The options to decide if a block is a valid result.
|
|
7818
8953
|
* @throws This function can throw errors.
|
|
7819
8954
|
*/
|
|
7820
|
-
getBlockAbove(location: Vector3, options?:
|
|
8955
|
+
getBlockAbove(location: Vector3, options?: BlockSearchOptions): Block | undefined;
|
|
7821
8956
|
/**
|
|
7822
8957
|
* @remarks
|
|
7823
8958
|
* Gets the first block found below a given block location
|
|
@@ -7830,7 +8965,7 @@ export class Dimension {
|
|
|
7830
8965
|
* The options to decide if a block is a valid result.
|
|
7831
8966
|
* @throws This function can throw errors.
|
|
7832
8967
|
*/
|
|
7833
|
-
getBlockBelow(location: Vector3, options?:
|
|
8968
|
+
getBlockBelow(location: Vector3, options?: BlockSearchOptions): Block | undefined;
|
|
7834
8969
|
/**
|
|
7835
8970
|
* @remarks
|
|
7836
8971
|
* Gets the first block that intersects with a vector emanating
|
|
@@ -7847,10 +8982,14 @@ export class Dimension {
|
|
|
7847
8982
|
getBlockFromRay(location: Vector3, direction: Vector3, options?: BlockRaycastOptions): BlockRaycastHit | undefined;
|
|
7848
8983
|
/**
|
|
7849
8984
|
* @remarks
|
|
7850
|
-
* Gets all the blocks in a volume that satisfy the
|
|
8985
|
+
* Gets all the blocks in a volume that satisfy the block query
|
|
8986
|
+
* options.
|
|
7851
8987
|
*
|
|
7852
8988
|
* @param volume
|
|
7853
8989
|
* Volume of blocks that will be checked.
|
|
8990
|
+
* @param options
|
|
8991
|
+
* Block query options including filter criteria and optional
|
|
8992
|
+
* closest/farthest distance sorting from a location.
|
|
7854
8993
|
* @param allowUnloadedChunks
|
|
7855
8994
|
* If set to true will suppress the UnloadedChunksError if some
|
|
7856
8995
|
* or all of the block volume is outside of the loaded chunks.
|
|
@@ -7859,7 +8998,7 @@ export class Dimension {
|
|
|
7859
8998
|
* Defaults to: false
|
|
7860
8999
|
* @returns
|
|
7861
9000
|
* Returns the ListBlockVolume that contains all the block
|
|
7862
|
-
* locations that satisfied the block
|
|
9001
|
+
* locations that satisfied the block query options.
|
|
7863
9002
|
* @throws This function can throw errors.
|
|
7864
9003
|
*
|
|
7865
9004
|
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
@@ -7984,6 +9123,26 @@ export class Dimension {
|
|
|
7984
9123
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7985
9124
|
*/
|
|
7986
9125
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
9126
|
+
/**
|
|
9127
|
+
* @beta
|
|
9128
|
+
* @remarks
|
|
9129
|
+
* Returns a vector of generated structures that contain the
|
|
9130
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
9131
|
+
* The vector will be empty if no structures are found.
|
|
9132
|
+
*
|
|
9133
|
+
* @param location
|
|
9134
|
+
* Location at which to check for structures.
|
|
9135
|
+
* @throws
|
|
9136
|
+
* An error will be thrown if the location is out of world
|
|
9137
|
+
* bounds.
|
|
9138
|
+
* An error will be thrown if the location is in an unloaded
|
|
9139
|
+
* chunk.
|
|
9140
|
+
*
|
|
9141
|
+
* {@link LocationInUnloadedChunkError}
|
|
9142
|
+
*
|
|
9143
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
9144
|
+
*/
|
|
9145
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
7987
9146
|
/**
|
|
7988
9147
|
* @remarks
|
|
7989
9148
|
* Returns the total brightness level of light shining on a
|
|
@@ -8045,6 +9204,16 @@ export class Dimension {
|
|
|
8045
9204
|
* @throws This function can throw errors.
|
|
8046
9205
|
*/
|
|
8047
9206
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
9207
|
+
/**
|
|
9208
|
+
* @beta
|
|
9209
|
+
* @remarks
|
|
9210
|
+
* Returns the current weather.
|
|
9211
|
+
*
|
|
9212
|
+
* @returns
|
|
9213
|
+
* Returns a WeatherType that explains the broad category of
|
|
9214
|
+
* weather that is currently going on.
|
|
9215
|
+
*/
|
|
9216
|
+
getWeather(): WeatherType;
|
|
8048
9217
|
/**
|
|
8049
9218
|
* @remarks
|
|
8050
9219
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -8290,7 +9459,11 @@ export class Dimension {
|
|
|
8290
9459
|
* }
|
|
8291
9460
|
* ```
|
|
8292
9461
|
*/
|
|
8293
|
-
spawnEntity
|
|
9462
|
+
spawnEntity<T = never>(
|
|
9463
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
9464
|
+
location: Vector3,
|
|
9465
|
+
options?: SpawnEntityOptions,
|
|
9466
|
+
): Entity;
|
|
8294
9467
|
/**
|
|
8295
9468
|
* @remarks
|
|
8296
9469
|
* Creates a new item stack as an entity at the specified
|
|
@@ -8405,6 +9578,26 @@ export class Dimension {
|
|
|
8405
9578
|
* {@link LocationOutOfWorldBoundariesError}
|
|
8406
9579
|
*/
|
|
8407
9580
|
spawnXp(location: Vector3, amount: number): void;
|
|
9581
|
+
/**
|
|
9582
|
+
* @beta
|
|
9583
|
+
* @remarks
|
|
9584
|
+
* Stops all sounds from playing for all players.
|
|
9585
|
+
*
|
|
9586
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
9587
|
+
*
|
|
9588
|
+
*/
|
|
9589
|
+
stopAllSounds(): void;
|
|
9590
|
+
/**
|
|
9591
|
+
* @beta
|
|
9592
|
+
* @remarks
|
|
9593
|
+
* Stops a sound from playing for all players.
|
|
9594
|
+
*
|
|
9595
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
9596
|
+
*
|
|
9597
|
+
* @param soundId
|
|
9598
|
+
* Identifier of the sound.
|
|
9599
|
+
*/
|
|
9600
|
+
stopSound(soundId: string): void;
|
|
8408
9601
|
}
|
|
8409
9602
|
|
|
8410
9603
|
/**
|
|
@@ -8889,6 +10082,16 @@ export class Entity {
|
|
|
8889
10082
|
* {@link InvalidEntityError}
|
|
8890
10083
|
*/
|
|
8891
10084
|
readonly isOnGround: boolean;
|
|
10085
|
+
/**
|
|
10086
|
+
* @beta
|
|
10087
|
+
* @remarks
|
|
10088
|
+
* Returns true if the entity is a passenger of a block.
|
|
10089
|
+
*
|
|
10090
|
+
* @throws This property can throw when used.
|
|
10091
|
+
*
|
|
10092
|
+
* {@link InvalidEntityError}
|
|
10093
|
+
*/
|
|
10094
|
+
readonly isPassengerOfBlock: boolean;
|
|
8892
10095
|
/**
|
|
8893
10096
|
* @remarks
|
|
8894
10097
|
* If true, the entity is currently sleeping.
|
|
@@ -8988,6 +10191,18 @@ export class Entity {
|
|
|
8988
10191
|
*
|
|
8989
10192
|
*/
|
|
8990
10193
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
10194
|
+
/**
|
|
10195
|
+
* @beta
|
|
10196
|
+
* @remarks
|
|
10197
|
+
* Retrieves or sets an entity that is used as the target of
|
|
10198
|
+
* AI-related behaviors, like attacking. If the entity
|
|
10199
|
+
* currently has no target returns undefined.
|
|
10200
|
+
*
|
|
10201
|
+
* @throws This property can throw when used.
|
|
10202
|
+
*
|
|
10203
|
+
* {@link InvalidEntityError}
|
|
10204
|
+
*/
|
|
10205
|
+
readonly target?: Entity;
|
|
8991
10206
|
/**
|
|
8992
10207
|
* @remarks
|
|
8993
10208
|
* Identifier of the type of the entity - for example,
|
|
@@ -9917,6 +11132,47 @@ export class Entity {
|
|
|
9917
11132
|
* {@link InvalidEntityError}
|
|
9918
11133
|
*/
|
|
9919
11134
|
setRotation(rotation: Vector2): void;
|
|
11135
|
+
/**
|
|
11136
|
+
* @beta
|
|
11137
|
+
* @remarks
|
|
11138
|
+
* Starts the entity as being a passenger of a block with the
|
|
11139
|
+
* specified configuration.
|
|
11140
|
+
*
|
|
11141
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
11142
|
+
*
|
|
11143
|
+
* @param blockPosition
|
|
11144
|
+
* The integer block position to ride.
|
|
11145
|
+
* @param offset
|
|
11146
|
+
* The offset from the block position.
|
|
11147
|
+
* @param rotation
|
|
11148
|
+
* The rotation of the passenger on the block.
|
|
11149
|
+
* @param rotationLimit
|
|
11150
|
+
* The maximum rotation range of the passenger on the block.
|
|
11151
|
+
* @param emote
|
|
11152
|
+
* The pose of the passenger on the block.
|
|
11153
|
+
* @throws This function can throw errors.
|
|
11154
|
+
*
|
|
11155
|
+
* {@link InvalidEntityError}
|
|
11156
|
+
*/
|
|
11157
|
+
startPassengerOfBlock(
|
|
11158
|
+
blockPosition: Vector3,
|
|
11159
|
+
offset: Vector3,
|
|
11160
|
+
rotation: number,
|
|
11161
|
+
rotationLimit: number,
|
|
11162
|
+
emote: PassengerOfBlockEmoteType,
|
|
11163
|
+
): void;
|
|
11164
|
+
/**
|
|
11165
|
+
* @beta
|
|
11166
|
+
* @remarks
|
|
11167
|
+
* Stops the entity from being a passenger of a block.
|
|
11168
|
+
*
|
|
11169
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
11170
|
+
*
|
|
11171
|
+
* @throws This function can throw errors.
|
|
11172
|
+
*
|
|
11173
|
+
* {@link InvalidEntityError}
|
|
11174
|
+
*/
|
|
11175
|
+
stopPassengerOfBlock(): void;
|
|
9920
11176
|
/**
|
|
9921
11177
|
* @remarks
|
|
9922
11178
|
* Teleports the selected entity to a new location
|
|
@@ -10232,6 +11488,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
10232
11488
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10233
11489
|
export class EntityBreathableComponent extends EntityComponent {
|
|
10234
11490
|
private constructor();
|
|
11491
|
+
/**
|
|
11492
|
+
* @beta
|
|
11493
|
+
* @remarks
|
|
11494
|
+
* The current air supply of the entity.
|
|
11495
|
+
*
|
|
11496
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
11497
|
+
*
|
|
11498
|
+
* @throws
|
|
11499
|
+
* Will throw an error if the air supply is out of bounds
|
|
11500
|
+
* [suffocationTime, maxAirSupply].
|
|
11501
|
+
*/
|
|
11502
|
+
airSupply: number;
|
|
10235
11503
|
/**
|
|
10236
11504
|
* @remarks
|
|
10237
11505
|
* If true, this entity can breathe in air.
|
|
@@ -10260,6 +11528,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
10260
11528
|
* @throws This property can throw when used.
|
|
10261
11529
|
*/
|
|
10262
11530
|
readonly breathesWater: boolean;
|
|
11531
|
+
/**
|
|
11532
|
+
* @beta
|
|
11533
|
+
* @remarks
|
|
11534
|
+
* If true, the entity is able to breathe.
|
|
11535
|
+
*
|
|
11536
|
+
* @throws This property can throw when used.
|
|
11537
|
+
*/
|
|
11538
|
+
readonly canBreathe: boolean;
|
|
10263
11539
|
/**
|
|
10264
11540
|
* @remarks
|
|
10265
11541
|
* If true, this entity will have visible bubbles while in
|
|
@@ -12232,6 +13508,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
12232
13508
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
12233
13509
|
}
|
|
12234
13510
|
|
|
13511
|
+
/**
|
|
13512
|
+
* @beta
|
|
13513
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
13514
|
+
* name, and dialogue interactions.
|
|
13515
|
+
*/
|
|
13516
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13517
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
13518
|
+
private constructor();
|
|
13519
|
+
/**
|
|
13520
|
+
* @remarks
|
|
13521
|
+
* The DialogueScene that is opened when players first interact
|
|
13522
|
+
* with the NPC.
|
|
13523
|
+
*
|
|
13524
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
13525
|
+
*
|
|
13526
|
+
*/
|
|
13527
|
+
defaultScene: string;
|
|
13528
|
+
/**
|
|
13529
|
+
* @remarks
|
|
13530
|
+
* The name of the NPC as it is displayed to players.
|
|
13531
|
+
*
|
|
13532
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
13533
|
+
*
|
|
13534
|
+
*/
|
|
13535
|
+
name: string;
|
|
13536
|
+
/**
|
|
13537
|
+
* @remarks
|
|
13538
|
+
* The index of the skin the NPC will use.
|
|
13539
|
+
*
|
|
13540
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
13541
|
+
*
|
|
13542
|
+
*/
|
|
13543
|
+
skinIndex: number;
|
|
13544
|
+
static readonly componentId = 'minecraft:npc';
|
|
13545
|
+
}
|
|
13546
|
+
|
|
12235
13547
|
/**
|
|
12236
13548
|
* When present on an entity, this entity is on fire.
|
|
12237
13549
|
* @example setOnFire.ts
|
|
@@ -13290,7 +14602,7 @@ export class EntityTypes {
|
|
|
13290
14602
|
* Retrieves an entity type using a string-based identifier.
|
|
13291
14603
|
*
|
|
13292
14604
|
*/
|
|
13293
|
-
static get(identifier:
|
|
14605
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
13294
14606
|
/**
|
|
13295
14607
|
* @remarks
|
|
13296
14608
|
* Retrieves a set of all entity types within this world.
|
|
@@ -14015,6 +15327,13 @@ export class GameRules {
|
|
|
14015
15327
|
*
|
|
14016
15328
|
*/
|
|
14017
15329
|
playersSleepingPercentage: number;
|
|
15330
|
+
/**
|
|
15331
|
+
* @beta
|
|
15332
|
+
* @remarks
|
|
15333
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
15334
|
+
*
|
|
15335
|
+
*/
|
|
15336
|
+
playerWaypoints: PlayerWaypointsMode;
|
|
14018
15337
|
/**
|
|
14019
15338
|
* @remarks
|
|
14020
15339
|
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
@@ -14178,7 +15497,7 @@ export class ISerializable {
|
|
|
14178
15497
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14179
15498
|
export class ItemBlockDynamicPropertiesComponent extends ItemComponent {
|
|
14180
15499
|
private constructor();
|
|
14181
|
-
static readonly componentId = 'minecraft:
|
|
15500
|
+
static readonly componentId = 'minecraft:block_dynamic_properties';
|
|
14182
15501
|
/**
|
|
14183
15502
|
* @remarks
|
|
14184
15503
|
* Returns a DynamicProperty that was stored with the provided
|
|
@@ -14224,6 +15543,137 @@ export class ItemBlockDynamicPropertiesComponent extends ItemComponent {
|
|
|
14224
15543
|
totalByteCount(): number;
|
|
14225
15544
|
}
|
|
14226
15545
|
|
|
15546
|
+
/**
|
|
15547
|
+
* @beta
|
|
15548
|
+
* Stores serialized non-player mobs on an item stack. Each
|
|
15549
|
+
* calling behavior pack can only access its manifest UUID
|
|
15550
|
+
* bucket. All buckets share a four-entity limit. Available on
|
|
15551
|
+
* item stacks even when empty. Destroying the item discards
|
|
15552
|
+
* its storage without spawning entities. Data is compatible
|
|
15553
|
+
* with entity-storage block carry-over and placement.
|
|
15554
|
+
*/
|
|
15555
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15556
|
+
export class ItemBlockEntityStorageComponent extends ItemComponent {
|
|
15557
|
+
private constructor();
|
|
15558
|
+
static readonly componentId = 'minecraft:block_entity_storage';
|
|
15559
|
+
/**
|
|
15560
|
+
* @remarks
|
|
15561
|
+
* Inspects the serialized entities in the calling pack's
|
|
15562
|
+
* manifest UUID bucket without loading or spawning them.
|
|
15563
|
+
*
|
|
15564
|
+
* @returns
|
|
15565
|
+
* Stored entity IDs and definition IDs, or an empty array for
|
|
15566
|
+
* an empty bucket.
|
|
15567
|
+
* @throws
|
|
15568
|
+
* Throws if the item is invalid or its entity-storage format
|
|
15569
|
+
* is unsupported.
|
|
15570
|
+
*
|
|
15571
|
+
* {@link Error}
|
|
15572
|
+
*
|
|
15573
|
+
* {@link InvalidItemStackError}
|
|
15574
|
+
*/
|
|
15575
|
+
getEntities(): BlockEntityStorageInfo[];
|
|
15576
|
+
/**
|
|
15577
|
+
* @remarks
|
|
15578
|
+
* Releases a stored mob at the supplied dimension and world
|
|
15579
|
+
* position. Does not require a block target. The serialized
|
|
15580
|
+
* position is replaced before the actor is loaded. Removes the
|
|
15581
|
+
* entry from this item after spawning it.
|
|
15582
|
+
*
|
|
15583
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
15584
|
+
*
|
|
15585
|
+
* @param entityId
|
|
15586
|
+
* A stored entity ID in the calling pack's bucket.
|
|
15587
|
+
* @param location
|
|
15588
|
+
* The target DimensionLocation. Must be finite, within world
|
|
15589
|
+
* bounds, and in a loaded, ticking chunk.
|
|
15590
|
+
* @returns
|
|
15591
|
+
* The spawned entity.
|
|
15592
|
+
* @throws
|
|
15593
|
+
* Throws for an invalid item, ID, dimension, or location, a
|
|
15594
|
+
* missing entity, or a load or spawn failure. Failed releases
|
|
15595
|
+
* preserve serialized storage.
|
|
15596
|
+
*
|
|
15597
|
+
* {@link Error}
|
|
15598
|
+
*
|
|
15599
|
+
* {@link InvalidItemStackError}
|
|
15600
|
+
*
|
|
15601
|
+
* {@link LocationInUnloadedChunkError}
|
|
15602
|
+
*
|
|
15603
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
15604
|
+
*/
|
|
15605
|
+
release(entityId: string, location: DimensionLocation): Entity;
|
|
15606
|
+
/**
|
|
15607
|
+
* @remarks
|
|
15608
|
+
* Returns the number of serialized entities in the calling
|
|
15609
|
+
* pack's manifest UUID bucket.
|
|
15610
|
+
*
|
|
15611
|
+
* @returns
|
|
15612
|
+
* The number of entities in this pack's bucket, or zero if
|
|
15613
|
+
* empty.
|
|
15614
|
+
* @throws
|
|
15615
|
+
* Throws if the item is invalid or its entity-storage format
|
|
15616
|
+
* is unsupported.
|
|
15617
|
+
*
|
|
15618
|
+
* {@link Error}
|
|
15619
|
+
*
|
|
15620
|
+
* {@link InvalidItemStackError}
|
|
15621
|
+
*/
|
|
15622
|
+
size(): number;
|
|
15623
|
+
/**
|
|
15624
|
+
* @remarks
|
|
15625
|
+
* Serializes and despawns a non-player mob into the calling
|
|
15626
|
+
* pack's item storage. Mounted entities and entities with
|
|
15627
|
+
* passengers cannot be stored.
|
|
15628
|
+
*
|
|
15629
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
15630
|
+
*
|
|
15631
|
+
* @param entity
|
|
15632
|
+
* The live mob to store.
|
|
15633
|
+
* @returns
|
|
15634
|
+
* The stored entity ID, used for inspection, release, or
|
|
15635
|
+
* transfer.
|
|
15636
|
+
* @throws
|
|
15637
|
+
* Throws if the item or entity is invalid, storage is full,
|
|
15638
|
+
* the entity is already stored, serialization fails, or the
|
|
15639
|
+
* entity is not allowed. Rejected entities remain in the
|
|
15640
|
+
* world.
|
|
15641
|
+
*
|
|
15642
|
+
* {@link Error}
|
|
15643
|
+
*
|
|
15644
|
+
* {@link InvalidItemStackError}
|
|
15645
|
+
*/
|
|
15646
|
+
store(entity: Entity): string;
|
|
15647
|
+
/**
|
|
15648
|
+
* @remarks
|
|
15649
|
+
* Moves serialized ownership from the calling pack's item
|
|
15650
|
+
* bucket into the same bucket of a block's entity-storage
|
|
15651
|
+
* without loading or spawning the entity. The target can be in
|
|
15652
|
+
* any dimension and must have entity storage.
|
|
15653
|
+
*
|
|
15654
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
15655
|
+
*
|
|
15656
|
+
* @param entityId
|
|
15657
|
+
* A stored entity ID in the calling pack's bucket.
|
|
15658
|
+
* @param targetBlock
|
|
15659
|
+
* A loaded block with an entity-storage component and
|
|
15660
|
+
* available capacity.
|
|
15661
|
+
* @throws
|
|
15662
|
+
* Throws for an invalid item, ID, or target, a missing entity,
|
|
15663
|
+
* full target storage, or an ID already stored at the target.
|
|
15664
|
+
* Failure preserves both owners.
|
|
15665
|
+
*
|
|
15666
|
+
* {@link Error}
|
|
15667
|
+
*
|
|
15668
|
+
* {@link InvalidItemStackError}
|
|
15669
|
+
*
|
|
15670
|
+
* {@link LocationInUnloadedChunkError}
|
|
15671
|
+
*
|
|
15672
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
15673
|
+
*/
|
|
15674
|
+
transfer(entityId: string, targetBlock: Block): void;
|
|
15675
|
+
}
|
|
15676
|
+
|
|
14227
15677
|
/**
|
|
14228
15678
|
* When present on an item, this item is a book item. Can
|
|
14229
15679
|
* access and modify the contents of the book and sign it.
|
|
@@ -16932,6 +18382,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
16932
18382
|
readonly itemTagsNone: string[];
|
|
16933
18383
|
}
|
|
16934
18384
|
|
|
18385
|
+
/**
|
|
18386
|
+
* @beta
|
|
18387
|
+
* A specific currently-internal event used for passing
|
|
18388
|
+
* messages from client to server.
|
|
18389
|
+
*/
|
|
18390
|
+
export class MessageReceiveAfterEvent {
|
|
18391
|
+
private constructor();
|
|
18392
|
+
/**
|
|
18393
|
+
* @remarks
|
|
18394
|
+
* The message identifier.
|
|
18395
|
+
*
|
|
18396
|
+
*/
|
|
18397
|
+
readonly id: string;
|
|
18398
|
+
/**
|
|
18399
|
+
* @remarks
|
|
18400
|
+
* The message.
|
|
18401
|
+
*
|
|
18402
|
+
*/
|
|
18403
|
+
readonly message: string;
|
|
18404
|
+
/**
|
|
18405
|
+
* @remarks
|
|
18406
|
+
* The player who sent the message.
|
|
18407
|
+
*
|
|
18408
|
+
*/
|
|
18409
|
+
readonly player: Player;
|
|
18410
|
+
}
|
|
18411
|
+
|
|
16935
18412
|
/**
|
|
16936
18413
|
* Contains a set of additional variable values for further
|
|
16937
18414
|
* defining how rendering and animations function.
|
|
@@ -17000,6 +18477,49 @@ export class MolangVariableMap {
|
|
|
17000
18477
|
setVector3(variableName: string, vector: Vector3): void;
|
|
17001
18478
|
}
|
|
17002
18479
|
|
|
18480
|
+
/**
|
|
18481
|
+
* @beta
|
|
18482
|
+
* Pack setting name and value that changed.
|
|
18483
|
+
*/
|
|
18484
|
+
export class PackSettingChangeAfterEvent {
|
|
18485
|
+
private constructor();
|
|
18486
|
+
/**
|
|
18487
|
+
* @remarks
|
|
18488
|
+
* The name of the setting.
|
|
18489
|
+
*
|
|
18490
|
+
*/
|
|
18491
|
+
readonly settingName: string;
|
|
18492
|
+
/**
|
|
18493
|
+
* @remarks
|
|
18494
|
+
* The value of the setting.
|
|
18495
|
+
*
|
|
18496
|
+
*/
|
|
18497
|
+
readonly settingValue: string[] | boolean | number | string;
|
|
18498
|
+
}
|
|
18499
|
+
|
|
18500
|
+
/**
|
|
18501
|
+
* @beta
|
|
18502
|
+
*/
|
|
18503
|
+
export class PackSettingChangeAfterEventSignal {
|
|
18504
|
+
private constructor();
|
|
18505
|
+
/**
|
|
18506
|
+
* @remarks
|
|
18507
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
18508
|
+
*
|
|
18509
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
18510
|
+
*
|
|
18511
|
+
*/
|
|
18512
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
18513
|
+
/**
|
|
18514
|
+
* @remarks
|
|
18515
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
18516
|
+
*
|
|
18517
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
18518
|
+
*
|
|
18519
|
+
*/
|
|
18520
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
18521
|
+
}
|
|
18522
|
+
|
|
17003
18523
|
/**
|
|
17004
18524
|
* Loot item condition that checks whether the looting entity
|
|
17005
18525
|
* is currently a passenger of a specific type of entity.
|
|
@@ -17168,42 +18688,99 @@ export class Player extends Entity {
|
|
|
17168
18688
|
*/
|
|
17169
18689
|
readonly camera: Camera;
|
|
17170
18690
|
/**
|
|
18691
|
+
* @beta
|
|
17171
18692
|
* @remarks
|
|
17172
|
-
*
|
|
18693
|
+
* The player's chat display name, composed from
|
|
18694
|
+
* {@link Player.chatNamePrefix} + {@link Player.name} +
|
|
18695
|
+
* {@link Player.chatNameSuffix}. This is the name shown as the
|
|
18696
|
+
* author of chat messages sent by this player. To change the
|
|
18697
|
+
* name shown above the player's head, use
|
|
18698
|
+
* {@link Entity.nameTag}.
|
|
17173
18699
|
*
|
|
17174
18700
|
* @throws This property can throw when used.
|
|
18701
|
+
*
|
|
18702
|
+
* {@link InvalidEntityError}
|
|
17175
18703
|
*/
|
|
17176
|
-
readonly
|
|
18704
|
+
readonly chatDisplayName: string;
|
|
17177
18705
|
/**
|
|
18706
|
+
* @beta
|
|
17178
18707
|
* @remarks
|
|
18708
|
+
* An optional string that, when set, is prepended to the text
|
|
18709
|
+
* of chat messages sent by this player. Useful for applying
|
|
18710
|
+
* formatting or color codes to a player's messages (e.g., '§a'
|
|
18711
|
+
* to make their messages green). Does not affect the player's
|
|
18712
|
+
* name display - use {@link Player.chatNamePrefix} for the
|
|
18713
|
+
* name shown in chat, or {@link Entity.nameTag} for the name
|
|
18714
|
+
* above the player's head. Set to undefined to clear.
|
|
18715
|
+
*
|
|
17179
18716
|
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
17180
18717
|
*
|
|
17181
18718
|
*/
|
|
17182
|
-
|
|
18719
|
+
chatMessagePrefix?: string;
|
|
17183
18720
|
/**
|
|
18721
|
+
* @beta
|
|
17184
18722
|
* @remarks
|
|
17185
|
-
*
|
|
17186
|
-
*
|
|
18723
|
+
* An optional string that, when set, is prepended to the
|
|
18724
|
+
* player's name in chat messages. Does not affect the name tag
|
|
18725
|
+
* above the player's head or the player list - use
|
|
18726
|
+
* {@link Entity.nameTag} for that. To prefix the message text
|
|
18727
|
+
* itself, use {@link Player.chatMessagePrefix}. Set to
|
|
18728
|
+
* undefined to clear.
|
|
18729
|
+
*
|
|
18730
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
17187
18731
|
*
|
|
17188
18732
|
*/
|
|
17189
|
-
|
|
18733
|
+
chatNamePrefix?: string;
|
|
17190
18734
|
/**
|
|
18735
|
+
* @beta
|
|
17191
18736
|
* @remarks
|
|
17192
|
-
*
|
|
17193
|
-
*
|
|
17194
|
-
*
|
|
18737
|
+
* An optional string that, when set, is appended to the
|
|
18738
|
+
* player's name in chat messages. Does not affect the name tag
|
|
18739
|
+
* above the player's head or the player list - use
|
|
18740
|
+
* {@link Entity.nameTag} for that. See also
|
|
18741
|
+
* {@link Player.chatNamePrefix}. Set to undefined to clear.
|
|
17195
18742
|
*
|
|
17196
|
-
* @
|
|
18743
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
17197
18744
|
*
|
|
17198
|
-
* {@link InvalidEntityError}
|
|
17199
18745
|
*/
|
|
17200
|
-
|
|
18746
|
+
chatNameSuffix?: string;
|
|
17201
18747
|
/**
|
|
17202
18748
|
* @remarks
|
|
17203
|
-
* Contains the player's
|
|
18749
|
+
* Contains the player's device information.
|
|
17204
18750
|
*
|
|
18751
|
+
* @throws This property can throw when used.
|
|
17205
18752
|
*/
|
|
17206
|
-
readonly
|
|
18753
|
+
readonly clientSystemInfo: ClientSystemInfo;
|
|
18754
|
+
/**
|
|
18755
|
+
* @remarks
|
|
18756
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
18757
|
+
*
|
|
18758
|
+
*/
|
|
18759
|
+
commandPermissionLevel: CommandPermissionLevel;
|
|
18760
|
+
/**
|
|
18761
|
+
* @remarks
|
|
18762
|
+
* Contains methods for manipulating the render distance fog
|
|
18763
|
+
* settings of a Player.
|
|
18764
|
+
*
|
|
18765
|
+
*/
|
|
18766
|
+
readonly fogSettings: FogSettings;
|
|
18767
|
+
/**
|
|
18768
|
+
* @remarks
|
|
18769
|
+
* Gets the current graphics mode of the player's client. This
|
|
18770
|
+
* can be changed in the Video section of the settings menu
|
|
18771
|
+
* based on what hardware is available.
|
|
18772
|
+
*
|
|
18773
|
+
* @throws This property can throw when used.
|
|
18774
|
+
*
|
|
18775
|
+
* {@link InvalidEntityError}
|
|
18776
|
+
*/
|
|
18777
|
+
readonly graphicsMode: GraphicsMode;
|
|
18778
|
+
/**
|
|
18779
|
+
* @remarks
|
|
18780
|
+
* Contains the player's input information.
|
|
18781
|
+
*
|
|
18782
|
+
*/
|
|
18783
|
+
readonly inputInfo: InputInfo;
|
|
17207
18784
|
/**
|
|
17208
18785
|
* @remarks
|
|
17209
18786
|
* Input permissions of the player.
|
|
@@ -17270,6 +18847,19 @@ export class Player extends Entity {
|
|
|
17270
18847
|
* @throws This property can throw when used.
|
|
17271
18848
|
*/
|
|
17272
18849
|
readonly onScreenDisplay: ScreenDisplay;
|
|
18850
|
+
/**
|
|
18851
|
+
* @beta
|
|
18852
|
+
* @remarks
|
|
18853
|
+
* An identifier that can be used to identify a player across
|
|
18854
|
+
* sessions.
|
|
18855
|
+
*
|
|
18856
|
+
* @throws This property can throw when used.
|
|
18857
|
+
*
|
|
18858
|
+
* {@link minecraftcommon.EngineError}
|
|
18859
|
+
*
|
|
18860
|
+
* {@link InvalidEntityError}
|
|
18861
|
+
*/
|
|
18862
|
+
readonly persistentId: string;
|
|
17273
18863
|
/**
|
|
17274
18864
|
* @throws This property can throw when used.
|
|
17275
18865
|
*
|
|
@@ -17343,6 +18933,20 @@ export class Player extends Entity {
|
|
|
17343
18933
|
* Throws if the Entity or Entity ID is invalid.
|
|
17344
18934
|
*/
|
|
17345
18935
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
18936
|
+
/**
|
|
18937
|
+
* @beta
|
|
18938
|
+
* @remarks
|
|
18939
|
+
* Eats an item, providing the item's hunger and saturation
|
|
18940
|
+
* effects to the player. Can only be used on food items.
|
|
18941
|
+
*
|
|
18942
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
18943
|
+
*
|
|
18944
|
+
* @param itemStack
|
|
18945
|
+
* The item to eat.
|
|
18946
|
+
* @throws
|
|
18947
|
+
* Throws if the item is not a food item.
|
|
18948
|
+
*/
|
|
18949
|
+
eatItem(itemStack: ItemStack): void;
|
|
17346
18950
|
/**
|
|
17347
18951
|
* @remarks
|
|
17348
18952
|
* The player's aim-assist settings.
|
|
@@ -17376,6 +18980,20 @@ export class Player extends Entity {
|
|
|
17376
18980
|
* @throws This function can throw errors.
|
|
17377
18981
|
*/
|
|
17378
18982
|
getItemCooldown(cooldownCategory: string): number;
|
|
18983
|
+
/**
|
|
18984
|
+
* @beta
|
|
18985
|
+
* @remarks
|
|
18986
|
+
* Gets the player's ping in milliseconds.
|
|
18987
|
+
*
|
|
18988
|
+
* @returns
|
|
18989
|
+
* The player's ping in milliseconds.
|
|
18990
|
+
* @throws This function can throw errors.
|
|
18991
|
+
*
|
|
18992
|
+
* {@link minecraftcommon.EngineError}
|
|
18993
|
+
*
|
|
18994
|
+
* {@link InvalidEntityError}
|
|
18995
|
+
*/
|
|
18996
|
+
getPing(): number;
|
|
17379
18997
|
/**
|
|
17380
18998
|
* @remarks
|
|
17381
18999
|
* Gets the current spawn point of the player.
|
|
@@ -17383,6 +19001,21 @@ export class Player extends Entity {
|
|
|
17383
19001
|
* @throws This function can throw errors.
|
|
17384
19002
|
*/
|
|
17385
19003
|
getSpawnPoint(): DimensionLocation | undefined;
|
|
19004
|
+
/**
|
|
19005
|
+
* @beta
|
|
19006
|
+
* @remarks
|
|
19007
|
+
* Returns the split screen slot of the player.
|
|
19008
|
+
*
|
|
19009
|
+
* @returns
|
|
19010
|
+
* The split screen slot of the player or undefined if the
|
|
19011
|
+
* player is not in a split screen session.
|
|
19012
|
+
* @throws This function can throw errors.
|
|
19013
|
+
*
|
|
19014
|
+
* {@link minecraftcommon.EngineError}
|
|
19015
|
+
*
|
|
19016
|
+
* {@link InvalidEntityError}
|
|
19017
|
+
*/
|
|
19018
|
+
getSplitScreenSlot(): PlayerSplitScreenSlot | undefined;
|
|
17386
19019
|
/**
|
|
17387
19020
|
* @remarks
|
|
17388
19021
|
* Gets the total experience of the Player.
|
|
@@ -17402,8 +19035,12 @@ export class Player extends Entity {
|
|
|
17402
19035
|
* @param musicOptions
|
|
17403
19036
|
* Additional options for the music track.
|
|
17404
19037
|
* @throws This function can throw errors.
|
|
19038
|
+
*
|
|
19039
|
+
* {@link minecraftcommon.EngineError}
|
|
19040
|
+
*
|
|
19041
|
+
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
17405
19042
|
*/
|
|
17406
|
-
playMusic(trackId: string, musicOptions?: MusicOptions):
|
|
19043
|
+
playMusic(trackId: SoundDefinition | string, musicOptions?: MusicOptions): SoundInstance | undefined;
|
|
17407
19044
|
/**
|
|
17408
19045
|
* @remarks
|
|
17409
19046
|
* Plays a sound that only this particular player can hear.
|
|
@@ -17447,6 +19084,17 @@ export class Player extends Entity {
|
|
|
17447
19084
|
* ```
|
|
17448
19085
|
*/
|
|
17449
19086
|
playSound(soundId: SoundDefinition | string, soundOptions?: PlayerSoundOptions): SoundInstance;
|
|
19087
|
+
/**
|
|
19088
|
+
* @beta
|
|
19089
|
+
* @remarks
|
|
19090
|
+
* This is an internal-facing method for posting a system
|
|
19091
|
+
* message to downstream clients.
|
|
19092
|
+
*
|
|
19093
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19094
|
+
*
|
|
19095
|
+
* @throws This function can throw errors.
|
|
19096
|
+
*/
|
|
19097
|
+
postClientMessage(id: string, value: string): void;
|
|
17450
19098
|
/**
|
|
17451
19099
|
* @remarks
|
|
17452
19100
|
* Queues an additional music track that only this particular
|
|
@@ -17722,6 +19370,18 @@ export class Player extends Entity {
|
|
|
17722
19370
|
* @throws This function can throw errors.
|
|
17723
19371
|
*/
|
|
17724
19372
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
19373
|
+
/**
|
|
19374
|
+
* @beta
|
|
19375
|
+
* @remarks
|
|
19376
|
+
* Stops all sounds from playing for this particular player.
|
|
19377
|
+
*
|
|
19378
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19379
|
+
*
|
|
19380
|
+
* @throws This function can throw errors.
|
|
19381
|
+
*
|
|
19382
|
+
* {@link InvalidEntityError}
|
|
19383
|
+
*/
|
|
19384
|
+
stopAllSounds(): void;
|
|
17725
19385
|
/**
|
|
17726
19386
|
* @remarks
|
|
17727
19387
|
* Stops any music tracks from playing for this particular
|
|
@@ -17732,6 +19392,20 @@ export class Player extends Entity {
|
|
|
17732
19392
|
* @throws This function can throw errors.
|
|
17733
19393
|
*/
|
|
17734
19394
|
stopMusic(): void;
|
|
19395
|
+
/**
|
|
19396
|
+
* @beta
|
|
19397
|
+
* @remarks
|
|
19398
|
+
* Stops a sound from playing for this particular player.
|
|
19399
|
+
*
|
|
19400
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19401
|
+
*
|
|
19402
|
+
* @param soundId
|
|
19403
|
+
* Identifier of the sound.
|
|
19404
|
+
* @throws This function can throw errors.
|
|
19405
|
+
*
|
|
19406
|
+
* {@link InvalidEntityError}
|
|
19407
|
+
*/
|
|
19408
|
+
stopSound(soundId: string): void;
|
|
17735
19409
|
}
|
|
17736
19410
|
|
|
17737
19411
|
/**
|
|
@@ -18040,6 +19714,72 @@ export class PlayerCancelBreakingBlockAfterEventSignal {
|
|
|
18040
19714
|
unsubscribe(callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void): void;
|
|
18041
19715
|
}
|
|
18042
19716
|
|
|
19717
|
+
/**
|
|
19718
|
+
* @beta
|
|
19719
|
+
* Contains information regarding a player crafting a recipe.
|
|
19720
|
+
*/
|
|
19721
|
+
export class PlayerCraftRecipeAfterEvent {
|
|
19722
|
+
private constructor();
|
|
19723
|
+
/**
|
|
19724
|
+
* @remarks
|
|
19725
|
+
* The block where the recipe was crafted, if applicable.
|
|
19726
|
+
*
|
|
19727
|
+
*/
|
|
19728
|
+
readonly block?: Block;
|
|
19729
|
+
/**
|
|
19730
|
+
* @remarks
|
|
19731
|
+
* The item stack crafted by the player.
|
|
19732
|
+
*
|
|
19733
|
+
*/
|
|
19734
|
+
readonly itemStack?: ItemStack;
|
|
19735
|
+
/**
|
|
19736
|
+
* @remarks
|
|
19737
|
+
* The player who crafted the recipe.
|
|
19738
|
+
*
|
|
19739
|
+
*/
|
|
19740
|
+
readonly player: Player;
|
|
19741
|
+
}
|
|
19742
|
+
|
|
19743
|
+
/**
|
|
19744
|
+
* @beta
|
|
19745
|
+
* Manages callbacks that are connected to when a player crafts
|
|
19746
|
+
* a recipe.
|
|
19747
|
+
*/
|
|
19748
|
+
export class PlayerCraftRecipeAfterEventSignal {
|
|
19749
|
+
private constructor();
|
|
19750
|
+
/**
|
|
19751
|
+
* @remarks
|
|
19752
|
+
* Adds a callback that will be called when a player crafts a
|
|
19753
|
+
* recipe.
|
|
19754
|
+
*
|
|
19755
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19756
|
+
*
|
|
19757
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19758
|
+
*
|
|
19759
|
+
* @param callback
|
|
19760
|
+
* Function callback that is called when this event fires.
|
|
19761
|
+
* @param options
|
|
19762
|
+
* Additional filtering options for the event subscription.
|
|
19763
|
+
*/
|
|
19764
|
+
subscribe(
|
|
19765
|
+
callback: (arg0: PlayerCraftRecipeAfterEvent) => void,
|
|
19766
|
+
options?: PlayerCraftRecipeEventOptions,
|
|
19767
|
+
): (arg0: PlayerCraftRecipeAfterEvent) => void;
|
|
19768
|
+
/**
|
|
19769
|
+
* @remarks
|
|
19770
|
+
* Removes a callback from being called when a player crafts a
|
|
19771
|
+
* recipe.
|
|
19772
|
+
*
|
|
19773
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19774
|
+
*
|
|
19775
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19776
|
+
*
|
|
19777
|
+
* @param callback
|
|
19778
|
+
* The callback to remove from the event subscription.
|
|
19779
|
+
*/
|
|
19780
|
+
unsubscribe(callback: (arg0: PlayerCraftRecipeAfterEvent) => void): void;
|
|
19781
|
+
}
|
|
19782
|
+
|
|
18043
19783
|
/**
|
|
18044
19784
|
* Represents the players cursor inventory. Used when moving
|
|
18045
19785
|
* items between between containers in the inventory UI. Not
|
|
@@ -18067,6 +19807,118 @@ export class PlayerCursorInventoryComponent extends EntityComponent {
|
|
|
18067
19807
|
clear(): void;
|
|
18068
19808
|
}
|
|
18069
19809
|
|
|
19810
|
+
/**
|
|
19811
|
+
* @beta
|
|
19812
|
+
* Contains information about an item moved from a container to
|
|
19813
|
+
* a player's cursor.
|
|
19814
|
+
*/
|
|
19815
|
+
export class PlayerCursorItemGrabAfterEvent {
|
|
19816
|
+
private constructor();
|
|
19817
|
+
/**
|
|
19818
|
+
* @remarks
|
|
19819
|
+
* The item stack moved to the player's cursor.
|
|
19820
|
+
*
|
|
19821
|
+
*/
|
|
19822
|
+
readonly item: ItemStack;
|
|
19823
|
+
/**
|
|
19824
|
+
* @remarks
|
|
19825
|
+
* The player whose cursor item changed.
|
|
19826
|
+
*
|
|
19827
|
+
*/
|
|
19828
|
+
readonly player: Player;
|
|
19829
|
+
}
|
|
19830
|
+
|
|
19831
|
+
/**
|
|
19832
|
+
* @beta
|
|
19833
|
+
* Manages callbacks for items grabbed from a container to a
|
|
19834
|
+
* player's cursor.
|
|
19835
|
+
*/
|
|
19836
|
+
export class PlayerCursorItemGrabAfterEventSignal {
|
|
19837
|
+
private constructor();
|
|
19838
|
+
/**
|
|
19839
|
+
* @remarks
|
|
19840
|
+
* Adds a callback that is called when a player grabs an item
|
|
19841
|
+
* from a container to their cursor.
|
|
19842
|
+
*
|
|
19843
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19844
|
+
*
|
|
19845
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19846
|
+
*
|
|
19847
|
+
* @param callback
|
|
19848
|
+
* The callback function invoked when the event fires.
|
|
19849
|
+
*/
|
|
19850
|
+
subscribe(callback: (arg0: PlayerCursorItemGrabAfterEvent) => void): (arg0: PlayerCursorItemGrabAfterEvent) => void;
|
|
19851
|
+
/**
|
|
19852
|
+
* @remarks
|
|
19853
|
+
* Removes a previously registered event callback.
|
|
19854
|
+
*
|
|
19855
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19856
|
+
*
|
|
19857
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19858
|
+
*
|
|
19859
|
+
* @param callback
|
|
19860
|
+
* The callback function to remove.
|
|
19861
|
+
*/
|
|
19862
|
+
unsubscribe(callback: (arg0: PlayerCursorItemGrabAfterEvent) => void): void;
|
|
19863
|
+
}
|
|
19864
|
+
|
|
19865
|
+
/**
|
|
19866
|
+
* @beta
|
|
19867
|
+
* Contains information about an item moved from a player's
|
|
19868
|
+
* cursor to a container.
|
|
19869
|
+
*/
|
|
19870
|
+
export class PlayerCursorItemReleaseAfterEvent {
|
|
19871
|
+
private constructor();
|
|
19872
|
+
/**
|
|
19873
|
+
* @remarks
|
|
19874
|
+
* The item stack from the player's cursor.
|
|
19875
|
+
*
|
|
19876
|
+
*/
|
|
19877
|
+
readonly item: ItemStack;
|
|
19878
|
+
/**
|
|
19879
|
+
* @remarks
|
|
19880
|
+
* The player whose cursor item changed.
|
|
19881
|
+
*
|
|
19882
|
+
*/
|
|
19883
|
+
readonly player: Player;
|
|
19884
|
+
}
|
|
19885
|
+
|
|
19886
|
+
/**
|
|
19887
|
+
* @beta
|
|
19888
|
+
* Manages callbacks for items released from a player's cursor
|
|
19889
|
+
* to a container.
|
|
19890
|
+
*/
|
|
19891
|
+
export class PlayerCursorItemReleaseAfterEventSignal {
|
|
19892
|
+
private constructor();
|
|
19893
|
+
/**
|
|
19894
|
+
* @remarks
|
|
19895
|
+
* Adds a callback that is called when a player releases an
|
|
19896
|
+
* item from their cursor to a container.
|
|
19897
|
+
*
|
|
19898
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19899
|
+
*
|
|
19900
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19901
|
+
*
|
|
19902
|
+
* @param callback
|
|
19903
|
+
* The callback function invoked when the event fires.
|
|
19904
|
+
*/
|
|
19905
|
+
subscribe(
|
|
19906
|
+
callback: (arg0: PlayerCursorItemReleaseAfterEvent) => void,
|
|
19907
|
+
): (arg0: PlayerCursorItemReleaseAfterEvent) => void;
|
|
19908
|
+
/**
|
|
19909
|
+
* @remarks
|
|
19910
|
+
* Removes a previously registered event callback.
|
|
19911
|
+
*
|
|
19912
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19913
|
+
*
|
|
19914
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19915
|
+
*
|
|
19916
|
+
* @param callback
|
|
19917
|
+
* The callback function to remove.
|
|
19918
|
+
*/
|
|
19919
|
+
unsubscribe(callback: (arg0: PlayerCursorItemReleaseAfterEvent) => void): void;
|
|
19920
|
+
}
|
|
19921
|
+
|
|
18070
19922
|
/**
|
|
18071
19923
|
* Contains information related to changes to a player's
|
|
18072
19924
|
* dimension having been changed.
|
|
@@ -18891,44 +20743,130 @@ export class PlayerInventoryItemChangeAfterEventSignal {
|
|
|
18891
20743
|
}
|
|
18892
20744
|
|
|
18893
20745
|
/**
|
|
18894
|
-
*
|
|
18895
|
-
*
|
|
18896
|
-
*
|
|
18897
|
-
*
|
|
20746
|
+
* @beta
|
|
20747
|
+
* Contains information about an attack initiated through a
|
|
20748
|
+
* player item interaction before it causes effects. Set cancel
|
|
20749
|
+
* to true to prevent the attack.
|
|
18898
20750
|
*/
|
|
18899
|
-
export class
|
|
20751
|
+
export class PlayerItemAttackEntityBeforeEvent {
|
|
18900
20752
|
private constructor();
|
|
18901
20753
|
/**
|
|
18902
20754
|
* @remarks
|
|
18903
|
-
*
|
|
20755
|
+
* The normalized world-space direction used for the attack.
|
|
20756
|
+
* For standard client-initiated transaction attacks, this
|
|
20757
|
+
* direction is derived from the client-provided hit position
|
|
20758
|
+
* and the player's server-side eye position. Other attack
|
|
20759
|
+
* paths can provide a server-derived direction. This property
|
|
20760
|
+
* is undefined when the attack path does not provide an aim
|
|
20761
|
+
* direction.
|
|
18904
20762
|
*
|
|
18905
20763
|
*/
|
|
18906
|
-
readonly
|
|
20764
|
+
readonly aimDirection?: Vector3;
|
|
18907
20765
|
/**
|
|
18908
20766
|
* @remarks
|
|
18909
|
-
*
|
|
20767
|
+
* If set to true, the attack does not cause damage or other
|
|
20768
|
+
* authoritative attack effects.
|
|
18910
20769
|
*
|
|
18911
20770
|
*/
|
|
18912
|
-
|
|
20771
|
+
cancel: boolean;
|
|
20772
|
+
/**
|
|
20773
|
+
* @remarks
|
|
20774
|
+
* A snapshot of the item held by the attacking player. This
|
|
20775
|
+
* property is undefined when the player holds no item.
|
|
20776
|
+
*
|
|
20777
|
+
*/
|
|
20778
|
+
readonly itemStack?: ItemStack;
|
|
20779
|
+
/**
|
|
20780
|
+
* @remarks
|
|
20781
|
+
* The player that initiated the attack.
|
|
20782
|
+
*
|
|
20783
|
+
*/
|
|
20784
|
+
readonly player: Player;
|
|
20785
|
+
/**
|
|
20786
|
+
* @remarks
|
|
20787
|
+
* The entity targeted by the attack.
|
|
20788
|
+
*
|
|
20789
|
+
*/
|
|
20790
|
+
readonly target: Entity;
|
|
18913
20791
|
}
|
|
18914
20792
|
|
|
18915
20793
|
/**
|
|
18916
|
-
*
|
|
18917
|
-
*
|
|
20794
|
+
* @beta
|
|
20795
|
+
* Manages callbacks that run before a player attacks an entity
|
|
20796
|
+
* through an item interaction.
|
|
18918
20797
|
*/
|
|
18919
|
-
export class
|
|
20798
|
+
export class PlayerItemAttackEntityBeforeEventSignal {
|
|
18920
20799
|
private constructor();
|
|
18921
20800
|
/**
|
|
18922
20801
|
* @remarks
|
|
18923
|
-
* Adds a callback that
|
|
18924
|
-
*
|
|
20802
|
+
* Adds a callback that runs before a player attacks an entity
|
|
20803
|
+
* through an item interaction.
|
|
18925
20804
|
*
|
|
18926
20805
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
18927
20806
|
*
|
|
18928
20807
|
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
18929
20808
|
*
|
|
20809
|
+
* @param callback
|
|
20810
|
+
* This closure is called with restricted-execution privilege.
|
|
20811
|
+
* @returns
|
|
20812
|
+
* Closure that is called with restricted-execution privilege.
|
|
18930
20813
|
*/
|
|
18931
|
-
subscribe(
|
|
20814
|
+
subscribe(
|
|
20815
|
+
callback: (arg0: PlayerItemAttackEntityBeforeEvent) => void,
|
|
20816
|
+
): (arg0: PlayerItemAttackEntityBeforeEvent) => void;
|
|
20817
|
+
/**
|
|
20818
|
+
* @remarks
|
|
20819
|
+
* Removes a callback from this event signal.
|
|
20820
|
+
*
|
|
20821
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
20822
|
+
*
|
|
20823
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
20824
|
+
*
|
|
20825
|
+
* @param callback
|
|
20826
|
+
* This closure is called with restricted-execution privilege.
|
|
20827
|
+
*/
|
|
20828
|
+
unsubscribe(callback: (arg0: PlayerItemAttackEntityBeforeEvent) => void): void;
|
|
20829
|
+
}
|
|
20830
|
+
|
|
20831
|
+
/**
|
|
20832
|
+
* Contains information regarding a player that has joined.
|
|
20833
|
+
* See the playerSpawn event for more detailed information that
|
|
20834
|
+
* could be returned after the first time a player has spawned
|
|
20835
|
+
* within the game.
|
|
20836
|
+
*/
|
|
20837
|
+
export class PlayerJoinAfterEvent {
|
|
20838
|
+
private constructor();
|
|
20839
|
+
/**
|
|
20840
|
+
* @remarks
|
|
20841
|
+
* Opaque string identifier of the player that joined the game.
|
|
20842
|
+
*
|
|
20843
|
+
*/
|
|
20844
|
+
readonly playerId: string;
|
|
20845
|
+
/**
|
|
20846
|
+
* @remarks
|
|
20847
|
+
* Name of the player that has joined.
|
|
20848
|
+
*
|
|
20849
|
+
*/
|
|
20850
|
+
readonly playerName: string;
|
|
20851
|
+
}
|
|
20852
|
+
|
|
20853
|
+
/**
|
|
20854
|
+
* Manages callbacks that are connected to a player joining the
|
|
20855
|
+
* world.
|
|
20856
|
+
*/
|
|
20857
|
+
export class PlayerJoinAfterEventSignal {
|
|
20858
|
+
private constructor();
|
|
20859
|
+
/**
|
|
20860
|
+
* @remarks
|
|
20861
|
+
* Adds a callback that will be called when a player joins the
|
|
20862
|
+
* world.
|
|
20863
|
+
*
|
|
20864
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
20865
|
+
*
|
|
20866
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
20867
|
+
*
|
|
20868
|
+
*/
|
|
20869
|
+
subscribe(callback: (arg0: PlayerJoinAfterEvent) => void): (arg0: PlayerJoinAfterEvent) => void;
|
|
18932
20870
|
/**
|
|
18933
20871
|
* @remarks
|
|
18934
20872
|
* Removes a callback from being called when a player joins the
|
|
@@ -19091,6 +21029,88 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
19091
21029
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
19092
21030
|
}
|
|
19093
21031
|
|
|
21032
|
+
/**
|
|
21033
|
+
* @beta
|
|
21034
|
+
* Contains information regarding an event before a player
|
|
21035
|
+
* places a block.
|
|
21036
|
+
*/
|
|
21037
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21038
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
21039
|
+
private constructor();
|
|
21040
|
+
/**
|
|
21041
|
+
* @remarks
|
|
21042
|
+
* If set to true, cancels the block place event.
|
|
21043
|
+
*
|
|
21044
|
+
*/
|
|
21045
|
+
cancel: boolean;
|
|
21046
|
+
/**
|
|
21047
|
+
* @remarks
|
|
21048
|
+
* The face of the block that the new block is being placed on.
|
|
21049
|
+
*
|
|
21050
|
+
*/
|
|
21051
|
+
readonly face: Direction;
|
|
21052
|
+
/**
|
|
21053
|
+
* @remarks
|
|
21054
|
+
* Location relative to the bottom north-west corner of the
|
|
21055
|
+
* block where the new block is being placed onto.
|
|
21056
|
+
*
|
|
21057
|
+
*/
|
|
21058
|
+
readonly faceLocation: Vector3;
|
|
21059
|
+
/**
|
|
21060
|
+
* @remarks
|
|
21061
|
+
* The block permutation that will be placed if the event is
|
|
21062
|
+
* not cancelled.
|
|
21063
|
+
*
|
|
21064
|
+
*/
|
|
21065
|
+
readonly permutationToPlace: BlockPermutation;
|
|
21066
|
+
/**
|
|
21067
|
+
* @remarks
|
|
21068
|
+
* Player that is placing the block for this event.
|
|
21069
|
+
*
|
|
21070
|
+
*/
|
|
21071
|
+
readonly player: Player;
|
|
21072
|
+
}
|
|
21073
|
+
|
|
21074
|
+
/**
|
|
21075
|
+
* @beta
|
|
21076
|
+
* Manages callbacks that are connected to before a block is
|
|
21077
|
+
* placed by a player.
|
|
21078
|
+
*/
|
|
21079
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
21080
|
+
private constructor();
|
|
21081
|
+
/**
|
|
21082
|
+
* @remarks
|
|
21083
|
+
* Adds a callback that will be called before a block is placed
|
|
21084
|
+
* by a player.
|
|
21085
|
+
*
|
|
21086
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21087
|
+
*
|
|
21088
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21089
|
+
*
|
|
21090
|
+
* @param callback
|
|
21091
|
+
* This closure is called with restricted-execution privilege.
|
|
21092
|
+
* @returns
|
|
21093
|
+
* Closure that is called with restricted-execution privilege.
|
|
21094
|
+
*/
|
|
21095
|
+
subscribe(
|
|
21096
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
21097
|
+
options?: BlockEventOptions,
|
|
21098
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
21099
|
+
/**
|
|
21100
|
+
* @remarks
|
|
21101
|
+
* Removes a callback from being called before an block is
|
|
21102
|
+
* placed by a player.
|
|
21103
|
+
*
|
|
21104
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21105
|
+
*
|
|
21106
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21107
|
+
*
|
|
21108
|
+
* @param callback
|
|
21109
|
+
* This closure is called with restricted-execution privilege.
|
|
21110
|
+
*/
|
|
21111
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
21112
|
+
}
|
|
21113
|
+
|
|
19094
21114
|
/**
|
|
19095
21115
|
* An event that contains more information about a player
|
|
19096
21116
|
* spawning.
|
|
@@ -19167,147 +21187,514 @@ export class PlayerStartBreakingBlockAfterEvent extends BlockEvent {
|
|
|
19167
21187
|
readonly face: Direction;
|
|
19168
21188
|
/**
|
|
19169
21189
|
* @remarks
|
|
19170
|
-
* The item stack that the player is using to break the block,
|
|
19171
|
-
* or undefined if empty hand.
|
|
21190
|
+
* The item stack that the player is using to break the block,
|
|
21191
|
+
* or undefined if empty hand.
|
|
21192
|
+
*
|
|
21193
|
+
*/
|
|
21194
|
+
readonly heldItemStack?: ItemStack;
|
|
21195
|
+
/**
|
|
21196
|
+
* @remarks
|
|
21197
|
+
* Player that started breaking the block for this event.
|
|
21198
|
+
*
|
|
21199
|
+
*/
|
|
21200
|
+
readonly player: Player;
|
|
21201
|
+
}
|
|
21202
|
+
|
|
21203
|
+
/**
|
|
21204
|
+
* Manages callbacks that are connected to when a player starts
|
|
21205
|
+
* breaking a block.
|
|
21206
|
+
*/
|
|
21207
|
+
export class PlayerStartBreakingBlockAfterEventSignal {
|
|
21208
|
+
private constructor();
|
|
21209
|
+
/**
|
|
21210
|
+
* @remarks
|
|
21211
|
+
* Adds a callback that will be called when a player starts
|
|
21212
|
+
* breaking a block.
|
|
21213
|
+
*
|
|
21214
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21215
|
+
*
|
|
21216
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21217
|
+
*
|
|
21218
|
+
*/
|
|
21219
|
+
subscribe(
|
|
21220
|
+
callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void,
|
|
21221
|
+
options?: PlayerBreakingBlockEventOptions,
|
|
21222
|
+
): (arg0: PlayerStartBreakingBlockAfterEvent) => void;
|
|
21223
|
+
/**
|
|
21224
|
+
* @remarks
|
|
21225
|
+
* Removes a callback from being called when a player starts
|
|
21226
|
+
* breaking a block.
|
|
21227
|
+
*
|
|
21228
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21229
|
+
*
|
|
21230
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21231
|
+
*
|
|
21232
|
+
*/
|
|
21233
|
+
unsubscribe(callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void): void;
|
|
21234
|
+
}
|
|
21235
|
+
|
|
21236
|
+
/**
|
|
21237
|
+
* Contains information regarding a player starting to swing
|
|
21238
|
+
* their arm.
|
|
21239
|
+
*/
|
|
21240
|
+
export class PlayerSwingStartAfterEvent {
|
|
21241
|
+
private constructor();
|
|
21242
|
+
/**
|
|
21243
|
+
* @remarks
|
|
21244
|
+
* The item stack being held by the player at the start of
|
|
21245
|
+
* their swing.
|
|
21246
|
+
*
|
|
21247
|
+
*/
|
|
21248
|
+
readonly heldItemStack?: ItemStack;
|
|
21249
|
+
/**
|
|
21250
|
+
* @remarks
|
|
21251
|
+
* Source Player for this event.
|
|
21252
|
+
*
|
|
21253
|
+
*/
|
|
21254
|
+
readonly player: Player;
|
|
21255
|
+
/**
|
|
21256
|
+
* @remarks
|
|
21257
|
+
* The source of the Player swing, see
|
|
21258
|
+
* {@link EntitySwingSource}.
|
|
21259
|
+
*
|
|
21260
|
+
*/
|
|
21261
|
+
readonly swingSource: EntitySwingSource;
|
|
21262
|
+
}
|
|
21263
|
+
|
|
21264
|
+
/**
|
|
21265
|
+
* Manages callbacks that are connected to when a player starts
|
|
21266
|
+
* to swing their arm (e.g. attacking, using an item,
|
|
21267
|
+
* interacting).
|
|
21268
|
+
*/
|
|
21269
|
+
export class PlayerSwingStartAfterEventSignal {
|
|
21270
|
+
private constructor();
|
|
21271
|
+
/**
|
|
21272
|
+
* @remarks
|
|
21273
|
+
* Adds a callback that will be called when a player starts to
|
|
21274
|
+
* swing their arm (e.g. attacking, using an item,
|
|
21275
|
+
* interacting).
|
|
21276
|
+
*
|
|
21277
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21278
|
+
*
|
|
21279
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21280
|
+
*
|
|
21281
|
+
*/
|
|
21282
|
+
subscribe(
|
|
21283
|
+
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
21284
|
+
options?: PlayerSwingEventOptions,
|
|
21285
|
+
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
21286
|
+
/**
|
|
21287
|
+
* @remarks
|
|
21288
|
+
* Removes a callback from being called when a player starts to
|
|
21289
|
+
* swing their arm (e.g. attacking, using an item,
|
|
21290
|
+
* interacting).
|
|
21291
|
+
*
|
|
21292
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21293
|
+
*
|
|
21294
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21295
|
+
*
|
|
21296
|
+
*/
|
|
21297
|
+
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
21298
|
+
}
|
|
21299
|
+
|
|
21300
|
+
/**
|
|
21301
|
+
* @beta
|
|
21302
|
+
* Contains information related to when a player successfully
|
|
21303
|
+
* names an Entity with a named Name Tag item.
|
|
21304
|
+
*/
|
|
21305
|
+
export class PlayerUseNameTagAfterEvent {
|
|
21306
|
+
private constructor();
|
|
21307
|
+
/**
|
|
21308
|
+
* @remarks
|
|
21309
|
+
* The entity that was named by the player.
|
|
21310
|
+
*
|
|
21311
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21312
|
+
*
|
|
21313
|
+
*/
|
|
21314
|
+
entityNamed: Entity;
|
|
21315
|
+
/**
|
|
21316
|
+
* @remarks
|
|
21317
|
+
* The new name that the player has given to the entity.
|
|
21318
|
+
*
|
|
21319
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21320
|
+
*
|
|
21321
|
+
*/
|
|
21322
|
+
newName: string;
|
|
21323
|
+
/**
|
|
21324
|
+
* @remarks
|
|
21325
|
+
* Handle to the player that used the name tag.
|
|
21326
|
+
*
|
|
21327
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21328
|
+
*
|
|
21329
|
+
*/
|
|
21330
|
+
player: Player;
|
|
21331
|
+
/**
|
|
21332
|
+
* @remarks
|
|
21333
|
+
* The previous name of the entity before the player used the
|
|
21334
|
+
* name tag. This will be undefined if the entity was not
|
|
21335
|
+
* previously named.
|
|
21336
|
+
*
|
|
21337
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21338
|
+
*
|
|
21339
|
+
*/
|
|
21340
|
+
previousName?: string;
|
|
21341
|
+
}
|
|
21342
|
+
|
|
21343
|
+
/**
|
|
21344
|
+
* @beta
|
|
21345
|
+
* Manages callbacks that are connected to when a player
|
|
21346
|
+
* successfully names an Entity with a named Name Tag item.
|
|
21347
|
+
*/
|
|
21348
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
21349
|
+
private constructor();
|
|
21350
|
+
/**
|
|
21351
|
+
* @remarks
|
|
21352
|
+
* Subscribes the specified callback to a player use name tag
|
|
21353
|
+
* after event.
|
|
21354
|
+
*
|
|
21355
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21356
|
+
*
|
|
21357
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21358
|
+
*
|
|
21359
|
+
*/
|
|
21360
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
21361
|
+
/**
|
|
21362
|
+
* @remarks
|
|
21363
|
+
* Removes the specified callback from a player use name tag
|
|
21364
|
+
* after event.
|
|
21365
|
+
*
|
|
21366
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21367
|
+
*
|
|
21368
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21369
|
+
*
|
|
21370
|
+
*/
|
|
21371
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
21372
|
+
}
|
|
21373
|
+
|
|
21374
|
+
/**
|
|
21375
|
+
* Waypoint that tracks a player's position. Extends
|
|
21376
|
+
* {@link EntityWaypoint} with additional player-specific
|
|
21377
|
+
* visibility rules such as hidden state and spectator mode.
|
|
21378
|
+
*/
|
|
21379
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21380
|
+
export class PlayerWaypoint extends EntityWaypoint {
|
|
21381
|
+
/**
|
|
21382
|
+
* @remarks
|
|
21383
|
+
* The {@link PlayerVisibilityRules} that control when the
|
|
21384
|
+
* waypoint is shown based on the player's state (e.g., hidden,
|
|
21385
|
+
* spectator mode, spectator viewing another spectator).
|
|
21386
|
+
*
|
|
21387
|
+
* @throws This property can throw when used.
|
|
21388
|
+
*
|
|
21389
|
+
* {@link InvalidWaypointError}
|
|
21390
|
+
*
|
|
21391
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
21392
|
+
*/
|
|
21393
|
+
readonly playerRules: PlayerVisibilityRules;
|
|
21394
|
+
/**
|
|
21395
|
+
* @throws This function can throw errors.
|
|
21396
|
+
*
|
|
21397
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
21398
|
+
*/
|
|
21399
|
+
constructor(
|
|
21400
|
+
player: Player,
|
|
21401
|
+
textureSelector: WaypointTextureSelector,
|
|
21402
|
+
playerRules: PlayerVisibilityRules,
|
|
21403
|
+
color?: RGB,
|
|
21404
|
+
);
|
|
21405
|
+
}
|
|
21406
|
+
|
|
21407
|
+
/**
|
|
21408
|
+
* @rc
|
|
21409
|
+
* Describes a block point-of-interest instance returned by a
|
|
21410
|
+
* query.
|
|
21411
|
+
*/
|
|
21412
|
+
export class PoiBlockInstance {
|
|
21413
|
+
private constructor();
|
|
21414
|
+
/**
|
|
21415
|
+
* @remarks
|
|
21416
|
+
* Block position of this POI instance.
|
|
21417
|
+
*
|
|
21418
|
+
*/
|
|
21419
|
+
readonly position: Vector3;
|
|
21420
|
+
/**
|
|
21421
|
+
* @remarks
|
|
21422
|
+
* Number of tickets currently available to be claimed from
|
|
21423
|
+
* this POI instance.
|
|
21424
|
+
*
|
|
21425
|
+
*/
|
|
21426
|
+
readonly tickets: number;
|
|
21427
|
+
/**
|
|
21428
|
+
* @remarks
|
|
21429
|
+
* Type of this POI instance.
|
|
21430
|
+
*
|
|
21431
|
+
*/
|
|
21432
|
+
readonly 'type': PoiBlockType;
|
|
21433
|
+
}
|
|
21434
|
+
|
|
21435
|
+
/**
|
|
21436
|
+
* @rc
|
|
21437
|
+
* Provides methods for querying and managing block-based
|
|
21438
|
+
* points of interest in a dimension.
|
|
21439
|
+
*/
|
|
21440
|
+
export class PoiBlockManager {
|
|
21441
|
+
private constructor();
|
|
21442
|
+
/**
|
|
21443
|
+
* @remarks
|
|
21444
|
+
* Adds a block point of interest at a position. This method is
|
|
21445
|
+
* intended for temporary usage. Will be replaced when chunk is
|
|
21446
|
+
* reloaded
|
|
21447
|
+
*
|
|
21448
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21449
|
+
*
|
|
21450
|
+
* @param position
|
|
21451
|
+
* Block position at which to add the POI.
|
|
21452
|
+
* @param poi
|
|
21453
|
+
* POI type to add, specified by numeric type Id, type name, or
|
|
21454
|
+
* POI type object.
|
|
21455
|
+
*/
|
|
21456
|
+
addTemporary(position: Vector3, poi: PoiBlockType | string | number): void;
|
|
21457
|
+
/**
|
|
21458
|
+
* @remarks
|
|
21459
|
+
* Gets the type of the block point of interest at a position.
|
|
21460
|
+
*
|
|
21461
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21462
|
+
*
|
|
21463
|
+
* @param position
|
|
21464
|
+
* Block position to inspect.
|
|
21465
|
+
* @returns
|
|
21466
|
+
* The POI type at the position, or undefined if no POI exists
|
|
21467
|
+
* there.
|
|
21468
|
+
*/
|
|
21469
|
+
at(position: Vector3): PoiBlockType | undefined;
|
|
21470
|
+
/**
|
|
21471
|
+
* @remarks
|
|
21472
|
+
* Tests whether a block point of interest at a position
|
|
21473
|
+
* matches a type filter.
|
|
21474
|
+
*
|
|
21475
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21476
|
+
*
|
|
21477
|
+
* @param position
|
|
21478
|
+
* Block position to inspect.
|
|
21479
|
+
* @param filter
|
|
21480
|
+
* Filter used to select the POI type. A callback receives the
|
|
21481
|
+
* POI type and returns whether it matches; a name filter
|
|
21482
|
+
* matches a type name; and a tag filter requires all specified
|
|
21483
|
+
* tags.
|
|
21484
|
+
* @returns
|
|
21485
|
+
* True if a POI exists at the position and its type matches
|
|
21486
|
+
* the filter; otherwise false.
|
|
21487
|
+
*/
|
|
21488
|
+
exists(position: Vector3, filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter): boolean;
|
|
21489
|
+
/**
|
|
21490
|
+
* @remarks
|
|
21491
|
+
* Returns block points of interest that match the supplied
|
|
21492
|
+
* type and occupancy filters within the specified distance of
|
|
21493
|
+
* a location.
|
|
21494
|
+
*
|
|
21495
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21496
|
+
*
|
|
21497
|
+
* @param filter
|
|
21498
|
+
* Filter used to select POI types. A callback receives each
|
|
21499
|
+
* POI type and returns whether it should be included; a name
|
|
21500
|
+
* filter matches a type name; and a tag filter requires all
|
|
21501
|
+
* specified tags.
|
|
21502
|
+
* @param center
|
|
21503
|
+
* Center of the search.
|
|
21504
|
+
* @param blockRadius
|
|
21505
|
+
* Maximum three-dimensional distance from the center, in
|
|
21506
|
+
* blocks.
|
|
21507
|
+
* @param occupancyFilter
|
|
21508
|
+
* Optional filter applied to the occupancy state of matching
|
|
21509
|
+
* POIs. If omitted, POIs in any occupancy state are returned.
|
|
21510
|
+
* @returns
|
|
21511
|
+
* The matching POI instances within range. The result order is
|
|
21512
|
+
* not guaranteed.
|
|
21513
|
+
*/
|
|
21514
|
+
getInRange(
|
|
21515
|
+
filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
|
|
21516
|
+
center: Vector3,
|
|
21517
|
+
blockRadius: number,
|
|
21518
|
+
occupancyFilter?: PoiBlockOccupancyFilter,
|
|
21519
|
+
): PoiBlockInstance[];
|
|
21520
|
+
/**
|
|
21521
|
+
* @remarks
|
|
21522
|
+
* Returns block points of interest that match the supplied
|
|
21523
|
+
* type and occupancy filters within an axis-aligned square
|
|
21524
|
+
* centered on the specified location, sorted from nearest to
|
|
21525
|
+
* farthest.
|
|
21526
|
+
*
|
|
21527
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19172
21528
|
*
|
|
21529
|
+
* @param filter
|
|
21530
|
+
* Filter used to select POI types. A callback receives each
|
|
21531
|
+
* POI type and returns whether it should be included; a name
|
|
21532
|
+
* filter matches a type name; and a tag filter requires all
|
|
21533
|
+
* specified tags.
|
|
21534
|
+
* @param center
|
|
21535
|
+
* Center of the search and the location from which distances
|
|
21536
|
+
* are calculated.
|
|
21537
|
+
* @param blockRadius
|
|
21538
|
+
* Maximum three-dimensional distance from the center, in
|
|
21539
|
+
* blocks.
|
|
21540
|
+
* @param occupancyFilter
|
|
21541
|
+
* Optional filter applied to the occupancy state of matching
|
|
21542
|
+
* POIs. If omitted, POIs in any occupancy state are returned.
|
|
21543
|
+
* @returns
|
|
21544
|
+
* The matching POI instances and their squared distances from
|
|
21545
|
+
* the center, sorted in ascending distance order.
|
|
19173
21546
|
*/
|
|
19174
|
-
|
|
21547
|
+
getInRangeSorted(
|
|
21548
|
+
filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
|
|
21549
|
+
center: Vector3,
|
|
21550
|
+
blockRadius: number,
|
|
21551
|
+
occupancyFilter?: PoiBlockOccupancyFilter,
|
|
21552
|
+
): PoiDistancePair[];
|
|
19175
21553
|
/**
|
|
19176
21554
|
* @remarks
|
|
19177
|
-
*
|
|
21555
|
+
* Returns block points of interest that match the supplied
|
|
21556
|
+
* type and occupancy filters within an axis-aligned square
|
|
21557
|
+
* centered on the specified location.
|
|
21558
|
+
*
|
|
21559
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19178
21560
|
*
|
|
21561
|
+
* @param filter
|
|
21562
|
+
* Filter used to select POI types. A callback receives each
|
|
21563
|
+
* POI type and returns whether it should be included; a name
|
|
21564
|
+
* filter matches a type name; and a tag filter requires all
|
|
21565
|
+
* specified tags.
|
|
21566
|
+
* @param center
|
|
21567
|
+
* Center of the search volume.
|
|
21568
|
+
* @param blockRadius
|
|
21569
|
+
* Half-size of the search volume, in blocks, along each axis.
|
|
21570
|
+
* @param occupancyFilter
|
|
21571
|
+
* Optional filter applied to the occupancy state of matching
|
|
21572
|
+
* POIs. If omitted, POIs in any occupancy state are returned.
|
|
21573
|
+
* @returns
|
|
21574
|
+
* The matching POI instances in the search volume.
|
|
19179
21575
|
*/
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19185
|
-
|
|
19186
|
-
*/
|
|
19187
|
-
export class PlayerStartBreakingBlockAfterEventSignal {
|
|
19188
|
-
private constructor();
|
|
21576
|
+
getInSquare(
|
|
21577
|
+
filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
|
|
21578
|
+
center: Vector3,
|
|
21579
|
+
blockRadius: number,
|
|
21580
|
+
occupancyFilter?: PoiBlockOccupancyFilter,
|
|
21581
|
+
): PoiBlockInstance[];
|
|
19189
21582
|
/**
|
|
19190
21583
|
* @remarks
|
|
19191
|
-
*
|
|
19192
|
-
*
|
|
21584
|
+
* Releases one previously claimed ticket at a block point of
|
|
21585
|
+
* interest.
|
|
19193
21586
|
*
|
|
19194
21587
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19195
21588
|
*
|
|
19196
|
-
* @
|
|
19197
|
-
*
|
|
21589
|
+
* @param center
|
|
21590
|
+
* Block position of the POI whose ticket should be released.
|
|
21591
|
+
* @returns
|
|
21592
|
+
* True if a ticket was released; false if no POI exists at the
|
|
21593
|
+
* position or the POI has no claimed tickets.
|
|
19198
21594
|
*/
|
|
19199
|
-
|
|
19200
|
-
callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void,
|
|
19201
|
-
options?: PlayerBreakingBlockEventOptions,
|
|
19202
|
-
): (arg0: PlayerStartBreakingBlockAfterEvent) => void;
|
|
21595
|
+
release(center: Vector3): boolean;
|
|
19203
21596
|
/**
|
|
19204
21597
|
* @remarks
|
|
19205
|
-
*
|
|
19206
|
-
*
|
|
21598
|
+
* Claims one available ticket from a matching block point of
|
|
21599
|
+
* interest within range.
|
|
19207
21600
|
*
|
|
19208
21601
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19209
21602
|
*
|
|
19210
|
-
* @
|
|
19211
|
-
*
|
|
21603
|
+
* @param filter
|
|
21604
|
+
* Filter used to select the POI type to claim. A callback
|
|
21605
|
+
* receives each POI type and returns whether it should be
|
|
21606
|
+
* included; a name filter matches a type name; and a tag
|
|
21607
|
+
* filter requires all specified tags.
|
|
21608
|
+
* @param center
|
|
21609
|
+
* Center of the search.
|
|
21610
|
+
* @param blockRadius
|
|
21611
|
+
* Maximum three-dimensional distance from the center, in
|
|
21612
|
+
* blocks.
|
|
21613
|
+
* @returns
|
|
21614
|
+
* The block position of the claimed POI, or undefined if no
|
|
21615
|
+
* matching POI has an available ticket.
|
|
19212
21616
|
*/
|
|
19213
|
-
|
|
21617
|
+
take(
|
|
21618
|
+
filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
|
|
21619
|
+
center: Vector3,
|
|
21620
|
+
blockRadius: number,
|
|
21621
|
+
): Vector3 | undefined;
|
|
19214
21622
|
}
|
|
19215
21623
|
|
|
19216
21624
|
/**
|
|
19217
|
-
*
|
|
19218
|
-
*
|
|
21625
|
+
* @rc
|
|
21626
|
+
* Describes a block point-of-interest type.
|
|
19219
21627
|
*/
|
|
19220
|
-
export class
|
|
21628
|
+
export class PoiBlockType {
|
|
19221
21629
|
private constructor();
|
|
19222
21630
|
/**
|
|
19223
21631
|
* @remarks
|
|
19224
|
-
*
|
|
19225
|
-
* their swing.
|
|
21632
|
+
* Numeric identifier of this POI type.
|
|
19226
21633
|
*
|
|
19227
21634
|
*/
|
|
19228
|
-
readonly
|
|
21635
|
+
readonly id: number;
|
|
19229
21636
|
/**
|
|
19230
21637
|
* @remarks
|
|
19231
|
-
*
|
|
21638
|
+
* Namespaced identifier of this POI type.
|
|
19232
21639
|
*
|
|
19233
21640
|
*/
|
|
19234
|
-
readonly
|
|
21641
|
+
readonly name: string;
|
|
19235
21642
|
/**
|
|
19236
21643
|
* @remarks
|
|
19237
|
-
*
|
|
19238
|
-
*
|
|
21644
|
+
* Maximum number of tickets that can be claimed from each POI
|
|
21645
|
+
* instance of this type.
|
|
19239
21646
|
*
|
|
19240
21647
|
*/
|
|
19241
|
-
readonly
|
|
19242
|
-
}
|
|
19243
|
-
|
|
19244
|
-
/**
|
|
19245
|
-
* Manages callbacks that are connected to when a player starts
|
|
19246
|
-
* to swing their arm (e.g. attacking, using an item,
|
|
19247
|
-
* interacting).
|
|
19248
|
-
*/
|
|
19249
|
-
export class PlayerSwingStartAfterEventSignal {
|
|
19250
|
-
private constructor();
|
|
21648
|
+
readonly tickets: number;
|
|
19251
21649
|
/**
|
|
19252
21650
|
* @remarks
|
|
19253
|
-
*
|
|
19254
|
-
*
|
|
19255
|
-
* interacting).
|
|
21651
|
+
* Maximum range, in blocks, at which this POI type is
|
|
21652
|
+
* considered usable.
|
|
19256
21653
|
*
|
|
19257
|
-
|
|
21654
|
+
*/
|
|
21655
|
+
readonly usableRange: number;
|
|
21656
|
+
/**
|
|
21657
|
+
* @remarks
|
|
21658
|
+
* Tests whether this object and another object describe the
|
|
21659
|
+
* same POI type.
|
|
19258
21660
|
*
|
|
19259
|
-
* @privilege
|
|
21661
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19260
21662
|
*
|
|
21663
|
+
* @param other
|
|
21664
|
+
* POI type to compare with this type.
|
|
21665
|
+
* @returns
|
|
21666
|
+
* True if both objects describe the same POI type; otherwise
|
|
21667
|
+
* false.
|
|
19261
21668
|
*/
|
|
19262
|
-
|
|
19263
|
-
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
19264
|
-
options?: PlayerSwingEventOptions,
|
|
19265
|
-
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
21669
|
+
equals(other: PoiBlockType): boolean;
|
|
19266
21670
|
/**
|
|
19267
21671
|
* @remarks
|
|
19268
|
-
*
|
|
19269
|
-
* swing their arm (e.g. attacking, using an item,
|
|
19270
|
-
* interacting).
|
|
21672
|
+
* Tests whether the type has the provided tag attribute
|
|
19271
21673
|
*
|
|
19272
21674
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19273
21675
|
*
|
|
19274
|
-
* @
|
|
19275
|
-
*
|
|
21676
|
+
* @param tag
|
|
21677
|
+
* POI tag to check.
|
|
21678
|
+
* @returns
|
|
21679
|
+
* True if the POI conatains the tag; otherwise false.
|
|
19276
21680
|
*/
|
|
19277
|
-
|
|
21681
|
+
hasTag(tag: string): boolean;
|
|
19278
21682
|
}
|
|
19279
21683
|
|
|
19280
21684
|
/**
|
|
19281
|
-
*
|
|
19282
|
-
*
|
|
19283
|
-
*
|
|
21685
|
+
* @rc
|
|
21686
|
+
* Provides access to point-of-interest (POI) data in a
|
|
21687
|
+
* dimension.
|
|
19284
21688
|
*/
|
|
19285
|
-
|
|
19286
|
-
|
|
21689
|
+
export class PoiManager {
|
|
21690
|
+
private constructor();
|
|
19287
21691
|
/**
|
|
19288
21692
|
* @remarks
|
|
19289
|
-
*
|
|
19290
|
-
*
|
|
19291
|
-
* spectator mode, spectator viewing another spectator).
|
|
19292
|
-
*
|
|
19293
|
-
* @throws This property can throw when used.
|
|
19294
|
-
*
|
|
19295
|
-
* {@link InvalidWaypointError}
|
|
19296
|
-
*
|
|
19297
|
-
* {@link InvalidWaypointTextureSelectorError}
|
|
19298
|
-
*/
|
|
19299
|
-
readonly playerRules: PlayerVisibilityRules;
|
|
19300
|
-
/**
|
|
19301
|
-
* @throws This function can throw errors.
|
|
21693
|
+
* Provides access to block-based points of interest in the
|
|
21694
|
+
* dimension.
|
|
19302
21695
|
*
|
|
19303
|
-
* {@link InvalidWaypointTextureSelectorError}
|
|
19304
21696
|
*/
|
|
19305
|
-
|
|
19306
|
-
player: Player,
|
|
19307
|
-
textureSelector: WaypointTextureSelector,
|
|
19308
|
-
playerRules: PlayerVisibilityRules,
|
|
19309
|
-
color?: RGB,
|
|
19310
|
-
);
|
|
21697
|
+
readonly blocks: PoiBlockManager;
|
|
19311
21698
|
}
|
|
19312
21699
|
|
|
19313
21700
|
/**
|
|
@@ -19392,10 +21779,10 @@ export class Potions {
|
|
|
19392
21779
|
*
|
|
19393
21780
|
* {@link InvalidPotionEffectTypeError}
|
|
19394
21781
|
*/
|
|
19395
|
-
static resolve
|
|
19396
|
-
|
|
19397
|
-
|
|
19398
|
-
): ItemStack;
|
|
21782
|
+
static resolve<
|
|
21783
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
21784
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
21785
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
19399
21786
|
}
|
|
19400
21787
|
|
|
19401
21788
|
/**
|
|
@@ -19530,6 +21917,16 @@ export class PrimitiveShape {
|
|
|
19530
21917
|
*
|
|
19531
21918
|
*/
|
|
19532
21919
|
color: RGBA;
|
|
21920
|
+
/**
|
|
21921
|
+
* @rc
|
|
21922
|
+
* @remarks
|
|
21923
|
+
* Defaults to true. If set to true, we default to being
|
|
21924
|
+
* visible to all players if visibleTo is empty - hiddenFrom
|
|
21925
|
+
* still applies afterwards. If set to false, we default to
|
|
21926
|
+
* hiding the shape from all players if visibleTo is empty.
|
|
21927
|
+
*
|
|
21928
|
+
*/
|
|
21929
|
+
defaultVisibleToAll: boolean;
|
|
19533
21930
|
/**
|
|
19534
21931
|
* @remarks
|
|
19535
21932
|
* The dimension the shape is visible within. If the dimension
|
|
@@ -19544,6 +21941,15 @@ export class PrimitiveShape {
|
|
|
19544
21941
|
*
|
|
19545
21942
|
*/
|
|
19546
21943
|
readonly hasDuration: boolean;
|
|
21944
|
+
/**
|
|
21945
|
+
* @rc
|
|
21946
|
+
* @remarks
|
|
21947
|
+
* The list of players that this shape will be hidden from. If
|
|
21948
|
+
* a player is listed in both this and visibleTo, this takes
|
|
21949
|
+
* priority (it will be hidden from the player).
|
|
21950
|
+
*
|
|
21951
|
+
*/
|
|
21952
|
+
hiddenFrom: Player[];
|
|
19547
21953
|
/**
|
|
19548
21954
|
* @remarks
|
|
19549
21955
|
* The location of the shape.
|
|
@@ -19933,6 +22339,104 @@ export class RandomRegionalDifficultyChanceCondition extends LootItemCondition {
|
|
|
19933
22339
|
readonly maxChance: number;
|
|
19934
22340
|
}
|
|
19935
22341
|
|
|
22342
|
+
/**
|
|
22343
|
+
* @beta
|
|
22344
|
+
* Provides access to the slots and recipe of a players active
|
|
22345
|
+
* crafting UI ie. stonecutter.
|
|
22346
|
+
*/
|
|
22347
|
+
export class RecipeCraftingContext {
|
|
22348
|
+
private constructor();
|
|
22349
|
+
/**
|
|
22350
|
+
* @remarks
|
|
22351
|
+
* The amount of addressable input slots for getInputItem and
|
|
22352
|
+
* setInputItem.
|
|
22353
|
+
*
|
|
22354
|
+
* @throws This property can throw when used.
|
|
22355
|
+
*
|
|
22356
|
+
* {@link minecraftcommon.EngineError}
|
|
22357
|
+
*/
|
|
22358
|
+
readonly inputSlotCount: number;
|
|
22359
|
+
/**
|
|
22360
|
+
* @remarks
|
|
22361
|
+
* Whether this recipe crafting context is valid. Invalidates
|
|
22362
|
+
* when the player closes the crafting UI or leaves.
|
|
22363
|
+
*
|
|
22364
|
+
*/
|
|
22365
|
+
readonly isValid: boolean;
|
|
22366
|
+
/**
|
|
22367
|
+
* @remarks
|
|
22368
|
+
* The identifiers of the recipes that are valid for the
|
|
22369
|
+
* current input items.
|
|
22370
|
+
*
|
|
22371
|
+
* @throws This property can throw when used.
|
|
22372
|
+
*
|
|
22373
|
+
* {@link minecraftcommon.EngineError}
|
|
22374
|
+
*/
|
|
22375
|
+
readonly validRecipes: string[];
|
|
22376
|
+
/**
|
|
22377
|
+
* @remarks
|
|
22378
|
+
* Gets the item in the provided input slot.
|
|
22379
|
+
*
|
|
22380
|
+
* @param slot
|
|
22381
|
+
* The zero-based input slot index.
|
|
22382
|
+
* @returns
|
|
22383
|
+
* The item stack in the input slot, or undefined if the slot
|
|
22384
|
+
* is empty.
|
|
22385
|
+
* @throws This function can throw errors.
|
|
22386
|
+
*
|
|
22387
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
22388
|
+
*
|
|
22389
|
+
* {@link minecraftcommon.EngineError}
|
|
22390
|
+
*/
|
|
22391
|
+
getInputItem(slot: number): ItemStack | undefined;
|
|
22392
|
+
/**
|
|
22393
|
+
* @remarks
|
|
22394
|
+
* Gets the item produced by the currently selected recipe.
|
|
22395
|
+
*
|
|
22396
|
+
* @returns
|
|
22397
|
+
* The output item stack, or undefined if there is no output.
|
|
22398
|
+
* @throws This function can throw errors.
|
|
22399
|
+
*
|
|
22400
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
22401
|
+
*
|
|
22402
|
+
* {@link minecraftcommon.EngineError}
|
|
22403
|
+
*/
|
|
22404
|
+
getOutputItem(): ItemStack | undefined;
|
|
22405
|
+
/**
|
|
22406
|
+
* @remarks
|
|
22407
|
+
* Sets or clears an item in an input slot.
|
|
22408
|
+
*
|
|
22409
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
22410
|
+
*
|
|
22411
|
+
* @param slot
|
|
22412
|
+
* The zero-based input slot index.
|
|
22413
|
+
* @param item
|
|
22414
|
+
* The item stack to place in the slot, or undefined to clear
|
|
22415
|
+
* the slot.
|
|
22416
|
+
* @throws This function can throw errors.
|
|
22417
|
+
*
|
|
22418
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
22419
|
+
*
|
|
22420
|
+
* {@link minecraftcommon.EngineError}
|
|
22421
|
+
*/
|
|
22422
|
+
setInputItem(slot: number, item?: ItemStack): void;
|
|
22423
|
+
/**
|
|
22424
|
+
* @remarks
|
|
22425
|
+
* Selects a recipe for the current crafting operation.
|
|
22426
|
+
*
|
|
22427
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
22428
|
+
*
|
|
22429
|
+
* @param recipeId
|
|
22430
|
+
* The identifier of a valid recipe to select.
|
|
22431
|
+
* @throws This function can throw errors.
|
|
22432
|
+
*
|
|
22433
|
+
* {@link minecraftcommon.EngineError}
|
|
22434
|
+
*
|
|
22435
|
+
* {@link InvalidRecipeError}
|
|
22436
|
+
*/
|
|
22437
|
+
setSelectedRecipe(recipeId: string): void;
|
|
22438
|
+
}
|
|
22439
|
+
|
|
19936
22440
|
/**
|
|
19937
22441
|
* Contains objectives and participants for the scoreboard.
|
|
19938
22442
|
* @example updateScoreboard.ts
|
|
@@ -20613,6 +23117,38 @@ export class Seat {
|
|
|
20613
23117
|
readonly seatRotation: number;
|
|
20614
23118
|
}
|
|
20615
23119
|
|
|
23120
|
+
/**
|
|
23121
|
+
* @beta
|
|
23122
|
+
* Manages callbacks that are message passing to a server. This
|
|
23123
|
+
* event is not currently fully implemented, and should not be
|
|
23124
|
+
* used.
|
|
23125
|
+
*/
|
|
23126
|
+
export class ServerMessageAfterEventSignal {
|
|
23127
|
+
private constructor();
|
|
23128
|
+
/**
|
|
23129
|
+
* @remarks
|
|
23130
|
+
* Adds a callback that will be called when an internal message
|
|
23131
|
+
* is passed.
|
|
23132
|
+
*
|
|
23133
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
23134
|
+
*
|
|
23135
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
23136
|
+
*
|
|
23137
|
+
*/
|
|
23138
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
23139
|
+
/**
|
|
23140
|
+
* @remarks
|
|
23141
|
+
* Removes a callback from being called when an internal
|
|
23142
|
+
* message is passed.
|
|
23143
|
+
*
|
|
23144
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
23145
|
+
*
|
|
23146
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
23147
|
+
*
|
|
23148
|
+
*/
|
|
23149
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
23150
|
+
}
|
|
23151
|
+
|
|
20616
23152
|
/**
|
|
20617
23153
|
* Loot item function that modifies the trim on a dropped armor
|
|
20618
23154
|
* item.
|
|
@@ -20641,6 +23177,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
20641
23177
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20642
23178
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
20643
23179
|
private constructor();
|
|
23180
|
+
/**
|
|
23181
|
+
* @beta
|
|
23182
|
+
* @remarks
|
|
23183
|
+
* The base color for the dropped banner.
|
|
23184
|
+
*
|
|
23185
|
+
*/
|
|
23186
|
+
readonly baseColor: string;
|
|
23187
|
+
/**
|
|
23188
|
+
* @beta
|
|
23189
|
+
* @remarks
|
|
23190
|
+
* An array of {@link BannerPattern} objects used to decorate
|
|
23191
|
+
* the banner, including color and pattern type.
|
|
23192
|
+
*
|
|
23193
|
+
*/
|
|
23194
|
+
readonly patterns: BannerPattern[];
|
|
20644
23195
|
/**
|
|
20645
23196
|
* @remarks
|
|
20646
23197
|
* The type of banner to drop.
|
|
@@ -21877,6 +24428,19 @@ export class SystemBeforeEvents {
|
|
|
21877
24428
|
*
|
|
21878
24429
|
*/
|
|
21879
24430
|
readonly startup: StartupBeforeEventSignal;
|
|
24431
|
+
/**
|
|
24432
|
+
* @beta
|
|
24433
|
+
* @remarks
|
|
24434
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
24435
|
+
* can be due to using too much memory, or by causing
|
|
24436
|
+
* significant slowdown or hang.
|
|
24437
|
+
* To prevent shutdown, set the event's cancel property to
|
|
24438
|
+
* true.
|
|
24439
|
+
*
|
|
24440
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
24441
|
+
*
|
|
24442
|
+
*/
|
|
24443
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
21880
24444
|
}
|
|
21881
24445
|
|
|
21882
24446
|
/**
|
|
@@ -22283,30 +24847,95 @@ export class TripWireTripAfterEvent extends BlockEvent {
|
|
|
22283
24847
|
* }
|
|
22284
24848
|
* ```
|
|
22285
24849
|
*/
|
|
22286
|
-
export class TripWireTripAfterEventSignal {
|
|
24850
|
+
export class TripWireTripAfterEventSignal {
|
|
24851
|
+
private constructor();
|
|
24852
|
+
/**
|
|
24853
|
+
* @remarks
|
|
24854
|
+
* Adds a callback that will be called when a trip wire is
|
|
24855
|
+
* tripped.
|
|
24856
|
+
*
|
|
24857
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
24858
|
+
*
|
|
24859
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
24860
|
+
*
|
|
24861
|
+
*/
|
|
24862
|
+
subscribe(callback: (arg0: TripWireTripAfterEvent) => void): (arg0: TripWireTripAfterEvent) => void;
|
|
24863
|
+
/**
|
|
24864
|
+
* @remarks
|
|
24865
|
+
* Removes a callback from being called when a trip wire is
|
|
24866
|
+
* tripped.
|
|
24867
|
+
*
|
|
24868
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
24869
|
+
*
|
|
24870
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
24871
|
+
*
|
|
24872
|
+
*/
|
|
24873
|
+
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
24874
|
+
}
|
|
24875
|
+
|
|
24876
|
+
/**
|
|
24877
|
+
* @beta
|
|
24878
|
+
* Contains information related to a script watchdog
|
|
24879
|
+
* termination.
|
|
24880
|
+
*/
|
|
24881
|
+
export class WatchdogTerminateBeforeEvent {
|
|
22287
24882
|
private constructor();
|
|
22288
24883
|
/**
|
|
22289
24884
|
* @remarks
|
|
22290
|
-
*
|
|
22291
|
-
*
|
|
24885
|
+
* If set to true, cancels the termination of the script
|
|
24886
|
+
* runtime. Note that depending on server configuration
|
|
24887
|
+
* settings, cancellation of the termination may not be
|
|
24888
|
+
* allowed.
|
|
24889
|
+
*
|
|
24890
|
+
*/
|
|
24891
|
+
cancel: boolean;
|
|
24892
|
+
/**
|
|
24893
|
+
* @remarks
|
|
24894
|
+
* Contains the reason why a script runtime is to be
|
|
24895
|
+
* terminated.
|
|
24896
|
+
*
|
|
24897
|
+
*/
|
|
24898
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
24899
|
+
}
|
|
24900
|
+
|
|
24901
|
+
/**
|
|
24902
|
+
* @beta
|
|
24903
|
+
* Manages callbacks that are connected to a callback that will
|
|
24904
|
+
* be called when a script runtime is being terminated due to a
|
|
24905
|
+
* violation of the performance watchdog system.
|
|
24906
|
+
*/
|
|
24907
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
24908
|
+
private constructor();
|
|
24909
|
+
/**
|
|
24910
|
+
* @remarks
|
|
24911
|
+
* Adds a callback that will be called when a script runtime is
|
|
24912
|
+
* being terminated due to a violation of the performance
|
|
24913
|
+
* watchdog system.
|
|
22292
24914
|
*
|
|
22293
24915
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
22294
24916
|
*
|
|
22295
24917
|
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
22296
24918
|
*
|
|
24919
|
+
* @param callback
|
|
24920
|
+
* This closure is called with restricted-execution privilege.
|
|
24921
|
+
* @returns
|
|
24922
|
+
* Closure that is called with restricted-execution privilege.
|
|
22297
24923
|
*/
|
|
22298
|
-
subscribe(callback: (arg0:
|
|
24924
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
22299
24925
|
/**
|
|
22300
24926
|
* @remarks
|
|
22301
|
-
* Removes a callback from being called when a
|
|
22302
|
-
*
|
|
24927
|
+
* Removes a callback from being called when a script runtime
|
|
24928
|
+
* is being terminated due to a violation of the performance
|
|
24929
|
+
* watchdog system.
|
|
22303
24930
|
*
|
|
22304
24931
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
22305
24932
|
*
|
|
22306
24933
|
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
22307
24934
|
*
|
|
24935
|
+
* @param callback
|
|
24936
|
+
* This closure is called with restricted-execution privilege.
|
|
22308
24937
|
*/
|
|
22309
|
-
unsubscribe(callback: (arg0:
|
|
24938
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
22310
24939
|
}
|
|
22311
24940
|
|
|
22312
24941
|
/**
|
|
@@ -22524,6 +25153,15 @@ export class World {
|
|
|
22524
25153
|
*
|
|
22525
25154
|
*/
|
|
22526
25155
|
readonly afterEvents: WorldAfterEvents;
|
|
25156
|
+
/**
|
|
25157
|
+
* @beta
|
|
25158
|
+
* @remarks
|
|
25159
|
+
* Enables or disables cheats.
|
|
25160
|
+
*
|
|
25161
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
25162
|
+
*
|
|
25163
|
+
*/
|
|
25164
|
+
allowCheats: boolean;
|
|
22527
25165
|
/**
|
|
22528
25166
|
* @remarks
|
|
22529
25167
|
* Contains a set of events that are applicable to the entirety
|
|
@@ -22608,6 +25246,20 @@ export class World {
|
|
|
22608
25246
|
*
|
|
22609
25247
|
*/
|
|
22610
25248
|
readonly tickingAreaManager: TickingAreaManager;
|
|
25249
|
+
/**
|
|
25250
|
+
* @beta
|
|
25251
|
+
* @remarks
|
|
25252
|
+
* A method that is internal-only, used for broadcasting
|
|
25253
|
+
* specific messages between client and server.
|
|
25254
|
+
*
|
|
25255
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25256
|
+
*
|
|
25257
|
+
* @param id
|
|
25258
|
+
* The message identifier.
|
|
25259
|
+
* @param value
|
|
25260
|
+
* The message.
|
|
25261
|
+
*/
|
|
25262
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
22611
25263
|
/**
|
|
22612
25264
|
* @remarks
|
|
22613
25265
|
* Clears the set of dynamic properties declared for this
|
|
@@ -22859,6 +25511,8 @@ export class World {
|
|
|
22859
25511
|
*
|
|
22860
25512
|
* @throws This function can throw errors.
|
|
22861
25513
|
*
|
|
25514
|
+
* {@link minecraftcommon.EngineError}
|
|
25515
|
+
*
|
|
22862
25516
|
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
22863
25517
|
* @example playMusicAndSound.ts
|
|
22864
25518
|
* ```typescript
|
|
@@ -22889,7 +25543,7 @@ export class World {
|
|
|
22889
25543
|
* }
|
|
22890
25544
|
* ```
|
|
22891
25545
|
*/
|
|
22892
|
-
playMusic(trackId: string, musicOptions?: MusicOptions):
|
|
25546
|
+
playMusic(trackId: SoundDefinition | string, musicOptions?: MusicOptions): SoundInstance | undefined;
|
|
22893
25547
|
/**
|
|
22894
25548
|
* @remarks
|
|
22895
25549
|
* Queues an additional music track for players. If a track is
|
|
@@ -23113,6 +25767,16 @@ export class WorldAfterEvents {
|
|
|
23113
25767
|
*
|
|
23114
25768
|
*/
|
|
23115
25769
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
25770
|
+
/**
|
|
25771
|
+
* @beta
|
|
25772
|
+
* @remarks
|
|
25773
|
+
* This event is triggered after a chat message has been
|
|
25774
|
+
* broadcast or sent to players.
|
|
25775
|
+
*
|
|
25776
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
25777
|
+
*
|
|
25778
|
+
*/
|
|
25779
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
23116
25780
|
/**
|
|
23117
25781
|
* @remarks
|
|
23118
25782
|
* This event is fired when an entity event has been triggered
|
|
@@ -23356,6 +26020,25 @@ export class WorldAfterEvents {
|
|
|
23356
26020
|
*
|
|
23357
26021
|
*/
|
|
23358
26022
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
26023
|
+
/**
|
|
26024
|
+
* @beta
|
|
26025
|
+
* @remarks
|
|
26026
|
+
* This event is an internal implementation detail, and is
|
|
26027
|
+
* otherwise not currently functional.
|
|
26028
|
+
*
|
|
26029
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26030
|
+
*
|
|
26031
|
+
*/
|
|
26032
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
26033
|
+
/**
|
|
26034
|
+
* @beta
|
|
26035
|
+
* @remarks
|
|
26036
|
+
* This event is triggered when a pack setting is changed.
|
|
26037
|
+
*
|
|
26038
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26039
|
+
*
|
|
26040
|
+
*/
|
|
26041
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
23359
26042
|
/**
|
|
23360
26043
|
* @remarks
|
|
23361
26044
|
* This event fires when a piston expands or retracts.
|
|
@@ -23389,6 +26072,35 @@ export class WorldAfterEvents {
|
|
|
23389
26072
|
*
|
|
23390
26073
|
*/
|
|
23391
26074
|
readonly playerCancelBreakingBlock: PlayerCancelBreakingBlockAfterEventSignal;
|
|
26075
|
+
/**
|
|
26076
|
+
* @beta
|
|
26077
|
+
* @remarks
|
|
26078
|
+
* This event fires when a player crafts a recipe.
|
|
26079
|
+
*
|
|
26080
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26081
|
+
*
|
|
26082
|
+
*/
|
|
26083
|
+
readonly playerCraftRecipe: PlayerCraftRecipeAfterEventSignal;
|
|
26084
|
+
/**
|
|
26085
|
+
* @beta
|
|
26086
|
+
* @remarks
|
|
26087
|
+
* Event signal that fires when a player grabs an item from a
|
|
26088
|
+
* container to their cursor.
|
|
26089
|
+
*
|
|
26090
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26091
|
+
*
|
|
26092
|
+
*/
|
|
26093
|
+
readonly playerCursorItemGrab: PlayerCursorItemGrabAfterEventSignal;
|
|
26094
|
+
/**
|
|
26095
|
+
* @beta
|
|
26096
|
+
* @remarks
|
|
26097
|
+
* Event signal that fires when a player releases an item from
|
|
26098
|
+
* their cursor into a container.
|
|
26099
|
+
*
|
|
26100
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26101
|
+
*
|
|
26102
|
+
*/
|
|
26103
|
+
readonly playerCursorItemRelease: PlayerCursorItemReleaseAfterEventSignal;
|
|
23392
26104
|
/**
|
|
23393
26105
|
* @remarks
|
|
23394
26106
|
* Fires when a player moved to a different dimension.
|
|
@@ -23508,6 +26220,16 @@ export class WorldAfterEvents {
|
|
|
23508
26220
|
*
|
|
23509
26221
|
*/
|
|
23510
26222
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
26223
|
+
/**
|
|
26224
|
+
* @beta
|
|
26225
|
+
* @remarks
|
|
26226
|
+
* An event for when a player uses a named name tag on an
|
|
26227
|
+
* entity.
|
|
26228
|
+
*
|
|
26229
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26230
|
+
*
|
|
26231
|
+
*/
|
|
26232
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
23511
26233
|
/**
|
|
23512
26234
|
* @remarks
|
|
23513
26235
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -23633,6 +26355,43 @@ export class WorldAfterEvents {
|
|
|
23633
26355
|
*/
|
|
23634
26356
|
export class WorldBeforeEvents {
|
|
23635
26357
|
private constructor();
|
|
26358
|
+
/**
|
|
26359
|
+
* @beta
|
|
26360
|
+
* @remarks
|
|
26361
|
+
* This event is triggered after a chat message has been
|
|
26362
|
+
* broadcast or sent to players.
|
|
26363
|
+
*
|
|
26364
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26365
|
+
*
|
|
26366
|
+
* @example customCommand.ts
|
|
26367
|
+
* ```typescript
|
|
26368
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
26369
|
+
*
|
|
26370
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
26371
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
26372
|
+
* if (eventData.message.includes('cancel')) {
|
|
26373
|
+
* // Cancel event if the message contains "cancel"
|
|
26374
|
+
* eventData.cancel = true;
|
|
26375
|
+
* } else {
|
|
26376
|
+
* const args = eventData.message.split(' ');
|
|
26377
|
+
*
|
|
26378
|
+
* if (args.length > 0) {
|
|
26379
|
+
* switch (args[0].toLowerCase()) {
|
|
26380
|
+
* case 'echo':
|
|
26381
|
+
* // Send a modified version of chat message
|
|
26382
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
26383
|
+
* break;
|
|
26384
|
+
* case 'help':
|
|
26385
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
26386
|
+
* break;
|
|
26387
|
+
* }
|
|
26388
|
+
* }
|
|
26389
|
+
* }
|
|
26390
|
+
* });
|
|
26391
|
+
* }
|
|
26392
|
+
* ```
|
|
26393
|
+
*/
|
|
26394
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
23636
26395
|
/**
|
|
23637
26396
|
* @remarks
|
|
23638
26397
|
* This event is triggered after an event has been added to an
|
|
@@ -23726,6 +26485,13 @@ export class WorldBeforeEvents {
|
|
|
23726
26485
|
*
|
|
23727
26486
|
*/
|
|
23728
26487
|
readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
|
|
26488
|
+
/**
|
|
26489
|
+
* @beta
|
|
26490
|
+
* @remarks
|
|
26491
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26492
|
+
*
|
|
26493
|
+
*/
|
|
26494
|
+
readonly playerItemAttackEntity: PlayerItemAttackEntityBeforeEventSignal;
|
|
23729
26495
|
/**
|
|
23730
26496
|
* @remarks
|
|
23731
26497
|
* Fires when a player leaves the game.
|
|
@@ -23734,6 +26500,15 @@ export class WorldBeforeEvents {
|
|
|
23734
26500
|
*
|
|
23735
26501
|
*/
|
|
23736
26502
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
26503
|
+
/**
|
|
26504
|
+
* @beta
|
|
26505
|
+
* @remarks
|
|
26506
|
+
* This event fires before a block is placed by a player.
|
|
26507
|
+
*
|
|
26508
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26509
|
+
*
|
|
26510
|
+
*/
|
|
26511
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
23737
26512
|
/**
|
|
23738
26513
|
* @remarks
|
|
23739
26514
|
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
@@ -24273,7 +27048,9 @@ export interface BiomeSearchOptions {
|
|
|
24273
27048
|
* A BlockBoundingBox is an interface to an object which
|
|
24274
27049
|
* represents an AABB aligned rectangle.
|
|
24275
27050
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
24276
|
-
* state (min <= max) but cannot guarantee it
|
|
27051
|
+
* state (min <= max) but cannot guarantee it (unless it was
|
|
27052
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
27053
|
+
* utility functions.
|
|
24277
27054
|
* The min/max coordinates represent the diametrically opposite
|
|
24278
27055
|
* corners of the rectangle.
|
|
24279
27056
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -24360,6 +27137,14 @@ export interface BlockCustomComponent {
|
|
|
24360
27137
|
*
|
|
24361
27138
|
*/
|
|
24362
27139
|
onEntityFallOn?: (arg0: BlockComponentEntityFallOnEvent, arg1: CustomComponentParameters) => void;
|
|
27140
|
+
/**
|
|
27141
|
+
* @beta
|
|
27142
|
+
*/
|
|
27143
|
+
onNamedTick?: (arg0: BlockComponentNamedTickEvent, arg1: CustomComponentParameters) => void;
|
|
27144
|
+
/**
|
|
27145
|
+
* @beta
|
|
27146
|
+
*/
|
|
27147
|
+
onNeighborChanged?: (arg0: BlockComponentNeighborChangedAfterEvent, arg1: CustomComponentParameters) => void;
|
|
24363
27148
|
/**
|
|
24364
27149
|
* @remarks
|
|
24365
27150
|
* This function will be called when the block that this custom
|
|
@@ -24612,7 +27397,43 @@ export interface BlockRaycastOptions extends BlockFilter {
|
|
|
24612
27397
|
includePassableBlocks?: boolean;
|
|
24613
27398
|
/**
|
|
24614
27399
|
* @remarks
|
|
24615
|
-
* Maximum distance, in blocks
|
|
27400
|
+
* Maximum raycast distance, in blocks.
|
|
27401
|
+
*
|
|
27402
|
+
* Bounds: [-2147483648, 2147483647]
|
|
27403
|
+
*/
|
|
27404
|
+
maxDistance?: number;
|
|
27405
|
+
/**
|
|
27406
|
+
* @beta
|
|
27407
|
+
* @remarks
|
|
27408
|
+
* When true, keeps fractional distances and checks the full
|
|
27409
|
+
* ray. Defaults to false.
|
|
27410
|
+
*
|
|
27411
|
+
*/
|
|
27412
|
+
usePreciseRaycast?: boolean;
|
|
27413
|
+
}
|
|
27414
|
+
|
|
27415
|
+
/**
|
|
27416
|
+
* Options for finding blocks.
|
|
27417
|
+
*/
|
|
27418
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
27419
|
+
export interface BlockSearchOptions extends BlockFilter {
|
|
27420
|
+
/**
|
|
27421
|
+
* @remarks
|
|
27422
|
+
* When true, includes liquid blocks.
|
|
27423
|
+
*
|
|
27424
|
+
*/
|
|
27425
|
+
includeLiquidBlocks?: boolean;
|
|
27426
|
+
/**
|
|
27427
|
+
* @remarks
|
|
27428
|
+
* When true, includes passable blocks, such as vines and
|
|
27429
|
+
* flowers.
|
|
27430
|
+
*
|
|
27431
|
+
*/
|
|
27432
|
+
includePassableBlocks?: boolean;
|
|
27433
|
+
/**
|
|
27434
|
+
* @remarks
|
|
27435
|
+
* Maximum search distance, in blocks. Vertical searches use
|
|
27436
|
+
* whole blocks.
|
|
24616
27437
|
*
|
|
24617
27438
|
*/
|
|
24618
27439
|
maxDistance?: number;
|
|
@@ -24899,6 +27720,15 @@ export interface CustomCommand {
|
|
|
24899
27720
|
* command.
|
|
24900
27721
|
*/
|
|
24901
27722
|
export interface CustomCommandParameter {
|
|
27723
|
+
/**
|
|
27724
|
+
* @beta
|
|
27725
|
+
* @remarks
|
|
27726
|
+
* Can be used to reference the enum name when
|
|
27727
|
+
* {@link CustomCommandParamType} is 'Enum'. Allows the
|
|
27728
|
+
* parameter name to be different from the enum name.
|
|
27729
|
+
*
|
|
27730
|
+
*/
|
|
27731
|
+
enumName?: string;
|
|
24902
27732
|
/**
|
|
24903
27733
|
* @remarks
|
|
24904
27734
|
* The name of parameter as it appears on the command line.
|
|
@@ -24919,10 +27749,11 @@ export interface CustomCommandParameter {
|
|
|
24919
27749
|
export interface CustomCommandResult {
|
|
24920
27750
|
/**
|
|
24921
27751
|
* @remarks
|
|
24922
|
-
* Message displayed to chat after command execution.
|
|
27752
|
+
* Message displayed to chat after command execution. Accepts a
|
|
27753
|
+
* {@link RawMessage} or a plain string.
|
|
24923
27754
|
*
|
|
24924
27755
|
*/
|
|
24925
|
-
message?: string;
|
|
27756
|
+
message?: RawMessage | string;
|
|
24926
27757
|
/**
|
|
24927
27758
|
* @remarks
|
|
24928
27759
|
* Command execution Success or Failure. Determines how the
|
|
@@ -24977,6 +27808,14 @@ export interface DefinitionModifier {
|
|
|
24977
27808
|
*
|
|
24978
27809
|
*/
|
|
24979
27810
|
removedComponentGroups: string[];
|
|
27811
|
+
/**
|
|
27812
|
+
* @beta
|
|
27813
|
+
* @remarks
|
|
27814
|
+
* The list of entity definition events that will be fired via
|
|
27815
|
+
* this update.
|
|
27816
|
+
*
|
|
27817
|
+
*/
|
|
27818
|
+
triggers: Trigger[];
|
|
24980
27819
|
}
|
|
24981
27820
|
|
|
24982
27821
|
/**
|
|
@@ -25773,10 +28612,20 @@ export interface EntityRaycastOptions extends EntityFilter {
|
|
|
25773
28612
|
includePassableBlocks?: boolean;
|
|
25774
28613
|
/**
|
|
25775
28614
|
* @remarks
|
|
25776
|
-
* Maximum distance, in blocks
|
|
28615
|
+
* Maximum raycast distance, in blocks.
|
|
25777
28616
|
*
|
|
28617
|
+
* Bounds: [-2147483648, 2147483647]
|
|
25778
28618
|
*/
|
|
25779
28619
|
maxDistance?: number;
|
|
28620
|
+
/**
|
|
28621
|
+
* @beta
|
|
28622
|
+
* @remarks
|
|
28623
|
+
* When true, keeps fractional distances and checks the full
|
|
28624
|
+
* ray. Defaults to false. When true, negative distances throw
|
|
28625
|
+
* InvalidArgumentError.
|
|
28626
|
+
*
|
|
28627
|
+
*/
|
|
28628
|
+
usePreciseRaycast?: boolean;
|
|
25780
28629
|
}
|
|
25781
28630
|
|
|
25782
28631
|
/**
|
|
@@ -26220,6 +29069,35 @@ export interface MusicOptions {
|
|
|
26220
29069
|
volume?: number;
|
|
26221
29070
|
}
|
|
26222
29071
|
|
|
29072
|
+
/**
|
|
29073
|
+
* @beta
|
|
29074
|
+
* Contains information regarding a block change in one
|
|
29075
|
+
* neighboring direction.
|
|
29076
|
+
*/
|
|
29077
|
+
export interface NeighborChange {
|
|
29078
|
+
/**
|
|
29079
|
+
* @remarks
|
|
29080
|
+
* The permutation of the neighboring block after its last
|
|
29081
|
+
* change during the tick.
|
|
29082
|
+
*
|
|
29083
|
+
*/
|
|
29084
|
+
blockPermutation: BlockPermutation;
|
|
29085
|
+
/**
|
|
29086
|
+
* @remarks
|
|
29087
|
+
* Direction from the block receiving the event to the
|
|
29088
|
+
* neighboring block that changed.
|
|
29089
|
+
*
|
|
29090
|
+
*/
|
|
29091
|
+
direction: Direction;
|
|
29092
|
+
/**
|
|
29093
|
+
* @remarks
|
|
29094
|
+
* The permutation of the neighboring block before its first
|
|
29095
|
+
* change during the tick.
|
|
29096
|
+
*
|
|
29097
|
+
*/
|
|
29098
|
+
previousPermutation: BlockPermutation;
|
|
29099
|
+
}
|
|
29100
|
+
|
|
26223
29101
|
/**
|
|
26224
29102
|
* Not equal to operator.
|
|
26225
29103
|
*/
|
|
@@ -26328,6 +29206,31 @@ export interface PlayerBreakingBlockEventOptions {
|
|
|
26328
29206
|
playerFilter?: EntityFilter;
|
|
26329
29207
|
}
|
|
26330
29208
|
|
|
29209
|
+
/**
|
|
29210
|
+
* @beta
|
|
29211
|
+
* Contains options for filtering player craft recipe events.
|
|
29212
|
+
*/
|
|
29213
|
+
export interface PlayerCraftRecipeEventOptions {
|
|
29214
|
+
/**
|
|
29215
|
+
* @remarks
|
|
29216
|
+
* Filter for the block where the recipe is crafted.
|
|
29217
|
+
*
|
|
29218
|
+
*/
|
|
29219
|
+
blockFilter?: BlockFilter;
|
|
29220
|
+
/**
|
|
29221
|
+
* @remarks
|
|
29222
|
+
* Filter for the item crafted by the player.
|
|
29223
|
+
*
|
|
29224
|
+
*/
|
|
29225
|
+
itemFilter?: ItemFilter;
|
|
29226
|
+
/**
|
|
29227
|
+
* @remarks
|
|
29228
|
+
* Filter for the player crafting the recipe.
|
|
29229
|
+
*
|
|
29230
|
+
*/
|
|
29231
|
+
playerFilter?: EntityFilter;
|
|
29232
|
+
}
|
|
29233
|
+
|
|
26331
29234
|
/**
|
|
26332
29235
|
* Additional options for how a sound plays for a player.
|
|
26333
29236
|
*/
|
|
@@ -26423,6 +29326,56 @@ export interface PlayerVisibilityRules extends EntityVisibilityRules {
|
|
|
26423
29326
|
showSpectatorToSpectator?: boolean;
|
|
26424
29327
|
}
|
|
26425
29328
|
|
|
29329
|
+
/**
|
|
29330
|
+
* @rc
|
|
29331
|
+
* Associates a block point-of-interest instance with its
|
|
29332
|
+
* squared distance from a query center.
|
|
29333
|
+
*/
|
|
29334
|
+
export interface PoiDistancePair {
|
|
29335
|
+
/**
|
|
29336
|
+
* @remarks
|
|
29337
|
+
* Squared three-dimensional distance, in blocks squared, from
|
|
29338
|
+
* the query center to the POI position.
|
|
29339
|
+
*
|
|
29340
|
+
*/
|
|
29341
|
+
distance: number;
|
|
29342
|
+
/**
|
|
29343
|
+
* @remarks
|
|
29344
|
+
* POI instance at this distance.
|
|
29345
|
+
*
|
|
29346
|
+
*/
|
|
29347
|
+
poi: PoiBlockInstance;
|
|
29348
|
+
}
|
|
29349
|
+
|
|
29350
|
+
/**
|
|
29351
|
+
* @rc
|
|
29352
|
+
* Selects block point-of-interest types by their exact
|
|
29353
|
+
* namespaced identifier.
|
|
29354
|
+
*/
|
|
29355
|
+
export interface PoiNameFilter {
|
|
29356
|
+
/**
|
|
29357
|
+
* @remarks
|
|
29358
|
+
* Exact namespaced POI type identifier to match.
|
|
29359
|
+
*
|
|
29360
|
+
*/
|
|
29361
|
+
name: string;
|
|
29362
|
+
}
|
|
29363
|
+
|
|
29364
|
+
/**
|
|
29365
|
+
* @rc
|
|
29366
|
+
* Selects block point-of-interest types that have all
|
|
29367
|
+
* specified tags.
|
|
29368
|
+
*/
|
|
29369
|
+
export interface PoiTagFilter {
|
|
29370
|
+
/**
|
|
29371
|
+
* @remarks
|
|
29372
|
+
* Namespaced POI tags that a matching type must contain. All
|
|
29373
|
+
* tags in the array are required.
|
|
29374
|
+
*
|
|
29375
|
+
*/
|
|
29376
|
+
tags: string[];
|
|
29377
|
+
}
|
|
29378
|
+
|
|
26426
29379
|
/**
|
|
26427
29380
|
* Contains optional filters that control which primitive
|
|
26428
29381
|
* shapes are returned from a primitive shapes query.
|
|
@@ -26747,6 +29700,14 @@ export interface RotationKeyFrame {
|
|
|
26747
29700
|
timeSeconds: number;
|
|
26748
29701
|
}
|
|
26749
29702
|
|
|
29703
|
+
/**
|
|
29704
|
+
* @beta
|
|
29705
|
+
*/
|
|
29706
|
+
export interface ScheduledNamedTick {
|
|
29707
|
+
eventName: string;
|
|
29708
|
+
tickDelay: number;
|
|
29709
|
+
}
|
|
29710
|
+
|
|
26750
29711
|
/**
|
|
26751
29712
|
* Contains additional options for how a scoreboard should be
|
|
26752
29713
|
* displayed within its display slot.
|
|
@@ -27728,6 +30689,23 @@ export class InvalidPotionEffectTypeError extends Error {
|
|
|
27728
30689
|
private constructor();
|
|
27729
30690
|
}
|
|
27730
30691
|
|
|
30692
|
+
/**
|
|
30693
|
+
* @beta
|
|
30694
|
+
* Thrown when an invalid recipe identifier is used.
|
|
30695
|
+
*/
|
|
30696
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
30697
|
+
export class InvalidRecipeError extends Error {
|
|
30698
|
+
private constructor();
|
|
30699
|
+
/**
|
|
30700
|
+
* @remarks
|
|
30701
|
+
* The identifier of the invalid recipe.
|
|
30702
|
+
*
|
|
30703
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
30704
|
+
*
|
|
30705
|
+
*/
|
|
30706
|
+
readonly recipeId: string;
|
|
30707
|
+
}
|
|
30708
|
+
|
|
27731
30709
|
/**
|
|
27732
30710
|
* Thrown when a Structure is invalid. A structure becomes
|
|
27733
30711
|
* invalid when it is deleted.
|