@minecraft/server 2.12.0-rc.1.26.70-preview.20 → 2.13.0-beta.1.26.70-preview.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +3144 -230
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
Copyright (c) Microsoft Corporation.
|
|
8
8
|
***************************************************************************** */
|
|
9
9
|
/**
|
|
10
|
-
* @
|
|
10
|
+
* @beta
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
* Contains many types related to manipulating a Minecraft
|
|
13
13
|
* world, including entities, blocks, dimensions, and more.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* ```json
|
|
17
17
|
* {
|
|
18
18
|
* "module_name": "@minecraft/server",
|
|
19
|
-
* "version": "2.
|
|
19
|
+
* "version": "2.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
|
|
@@ -2215,6 +2262,10 @@ export enum InputPermissionCategory {
|
|
|
2215
2262
|
*/
|
|
2216
2263
|
export enum ItemComponentTypes {
|
|
2217
2264
|
BlockDynamicProperties = 'minecraft:block_actor_dynamic_properties',
|
|
2265
|
+
/**
|
|
2266
|
+
* @beta
|
|
2267
|
+
*/
|
|
2268
|
+
BlockEntityStorage = 'minecraft:block_entity_storage',
|
|
2218
2269
|
/**
|
|
2219
2270
|
* @remarks
|
|
2220
2271
|
* The minecraft:book component.
|
|
@@ -2586,6 +2637,31 @@ export enum PaletteColor {
|
|
|
2586
2637
|
Black = 15,
|
|
2587
2638
|
}
|
|
2588
2639
|
|
|
2640
|
+
/**
|
|
2641
|
+
* @beta
|
|
2642
|
+
* Specifies the pose of an entity passenger of a block.
|
|
2643
|
+
*/
|
|
2644
|
+
export enum PassengerOfBlockEmoteType {
|
|
2645
|
+
/**
|
|
2646
|
+
* @remarks
|
|
2647
|
+
* The entity will be laying on the block.
|
|
2648
|
+
*
|
|
2649
|
+
*/
|
|
2650
|
+
Laying = 'Laying',
|
|
2651
|
+
/**
|
|
2652
|
+
* @remarks
|
|
2653
|
+
* The entity will be sitting on the block.
|
|
2654
|
+
*
|
|
2655
|
+
*/
|
|
2656
|
+
Riding = 'Riding',
|
|
2657
|
+
/**
|
|
2658
|
+
* @remarks
|
|
2659
|
+
* The entity will be standing on the block.
|
|
2660
|
+
*
|
|
2661
|
+
*/
|
|
2662
|
+
Standing = 'Standing',
|
|
2663
|
+
}
|
|
2664
|
+
|
|
2589
2665
|
/**
|
|
2590
2666
|
* Describes what kind of platform is a device.
|
|
2591
2667
|
*/
|
|
@@ -2686,6 +2762,42 @@ export enum PlayerSplitScreenSlot {
|
|
|
2686
2762
|
Third = 'Third',
|
|
2687
2763
|
}
|
|
2688
2764
|
|
|
2765
|
+
/**
|
|
2766
|
+
* @beta
|
|
2767
|
+
*/
|
|
2768
|
+
export enum PlayerWaypointsMode {
|
|
2769
|
+
Everyone = 'Everyone',
|
|
2770
|
+
Off = 'Off',
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
/**
|
|
2774
|
+
* @beta
|
|
2775
|
+
* Specifies how a block point-of-interest query filters
|
|
2776
|
+
* instances by ticket occupancy.
|
|
2777
|
+
*/
|
|
2778
|
+
export enum PoiBlockOccupancyFilter {
|
|
2779
|
+
/**
|
|
2780
|
+
* @remarks
|
|
2781
|
+
* Includes POI instances regardless of their occupancy or
|
|
2782
|
+
* available ticket count.
|
|
2783
|
+
*
|
|
2784
|
+
*/
|
|
2785
|
+
Any = 'Any',
|
|
2786
|
+
/**
|
|
2787
|
+
* @remarks
|
|
2788
|
+
* Includes POI instances with no available tickets.
|
|
2789
|
+
*
|
|
2790
|
+
*/
|
|
2791
|
+
Full = 'Full',
|
|
2792
|
+
/**
|
|
2793
|
+
* @remarks
|
|
2794
|
+
* Includes POI instances with at least one ticket available to
|
|
2795
|
+
* be claimed.
|
|
2796
|
+
*
|
|
2797
|
+
*/
|
|
2798
|
+
HasVacancy = 'HasVacancy',
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2689
2801
|
/**
|
|
2690
2802
|
* Contains objectives and participants for the scoreboard.
|
|
2691
2803
|
*/
|
|
@@ -3011,6 +3123,29 @@ export enum TintMethod {
|
|
|
3011
3123
|
Water = 'Water',
|
|
3012
3124
|
}
|
|
3013
3125
|
|
|
3126
|
+
/**
|
|
3127
|
+
* @beta
|
|
3128
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
3129
|
+
* to terminate execution of a behavior packs' script.
|
|
3130
|
+
*/
|
|
3131
|
+
export enum WatchdogTerminateReason {
|
|
3132
|
+
/**
|
|
3133
|
+
* @remarks
|
|
3134
|
+
* Script runtime for a behavior pack is terminated due to
|
|
3135
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
3136
|
+
*
|
|
3137
|
+
*/
|
|
3138
|
+
Hang = 'Hang',
|
|
3139
|
+
/**
|
|
3140
|
+
* @remarks
|
|
3141
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3142
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3143
|
+
* function calls.
|
|
3144
|
+
*
|
|
3145
|
+
*/
|
|
3146
|
+
StackOverflow = 'StackOverflow',
|
|
3147
|
+
}
|
|
3148
|
+
|
|
3014
3149
|
/**
|
|
3015
3150
|
* Enum representing different texture icons that can be
|
|
3016
3151
|
* displayed for waypoints on the locator bar.
|
|
@@ -3073,11 +3208,13 @@ export type BlockComponentReturnType<T extends string> = T extends keyof BlockCo
|
|
|
3073
3208
|
|
|
3074
3209
|
export type BlockComponentTypeMap = {
|
|
3075
3210
|
dynamic_properties: BlockDynamicPropertiesComponent;
|
|
3211
|
+
entity_storage: BlockEntityStorageComponent;
|
|
3076
3212
|
fluid_container: BlockFluidContainerComponent;
|
|
3077
3213
|
instrument_sound: BlockInstrumentComponent;
|
|
3078
3214
|
inventory: BlockInventoryComponent;
|
|
3079
3215
|
map_color: BlockMapColorComponent;
|
|
3080
3216
|
'minecraft:dynamic_properties': BlockDynamicPropertiesComponent;
|
|
3217
|
+
'minecraft:entity_storage': BlockEntityStorageComponent;
|
|
3081
3218
|
'minecraft:fluid_container': BlockFluidContainerComponent;
|
|
3082
3219
|
'minecraft:instrument_sound': BlockInstrumentComponent;
|
|
3083
3220
|
'minecraft:inventory': BlockInventoryComponent;
|
|
@@ -3085,15 +3222,21 @@ export type BlockComponentTypeMap = {
|
|
|
3085
3222
|
'minecraft:movable': BlockMovableComponent;
|
|
3086
3223
|
'minecraft:piston': BlockPistonComponent;
|
|
3087
3224
|
'minecraft:precipitation_interactions': BlockPrecipitationInteractionsComponent;
|
|
3225
|
+
'minecraft:recipe_crafting': BlockRecipeCraftingComponent;
|
|
3226
|
+
'minecraft:recipe_processing': BlockRecipeProcessingComponent;
|
|
3088
3227
|
'minecraft:record_player': BlockRecordPlayerComponent;
|
|
3089
3228
|
'minecraft:redstone_producer': BlockRedstoneProducerComponent;
|
|
3090
3229
|
'minecraft:sign': BlockSignComponent;
|
|
3230
|
+
'minecraft:vibration_properties': BlockVibrationPropertiesComponent;
|
|
3091
3231
|
movable: BlockMovableComponent;
|
|
3092
3232
|
piston: BlockPistonComponent;
|
|
3093
3233
|
precipitation_interactions: BlockPrecipitationInteractionsComponent;
|
|
3234
|
+
recipe_crafting: BlockRecipeCraftingComponent;
|
|
3235
|
+
recipe_processing: BlockRecipeProcessingComponent;
|
|
3094
3236
|
record_player: BlockRecordPlayerComponent;
|
|
3095
3237
|
redstone_producer: BlockRedstoneProducerComponent;
|
|
3096
3238
|
sign: BlockSignComponent;
|
|
3239
|
+
vibration_properties: BlockVibrationPropertiesComponent;
|
|
3097
3240
|
};
|
|
3098
3241
|
|
|
3099
3242
|
/**
|
|
@@ -3197,6 +3340,7 @@ export type EntityComponentTypeMap = {
|
|
|
3197
3340
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
3198
3341
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
3199
3342
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3343
|
+
'minecraft:npc': EntityNpcComponent;
|
|
3200
3344
|
'minecraft:onfire': EntityOnFireComponent;
|
|
3201
3345
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
3202
3346
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -3230,6 +3374,7 @@ export type EntityComponentTypeMap = {
|
|
|
3230
3374
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3231
3375
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3232
3376
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3377
|
+
npc: EntityNpcComponent;
|
|
3233
3378
|
onfire: EntityOnFireComponent;
|
|
3234
3379
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3235
3380
|
'player.hunger': EntityHungerComponent;
|
|
@@ -3249,12 +3394,22 @@ export type EntityComponentTypeMap = {
|
|
|
3249
3394
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3250
3395
|
};
|
|
3251
3396
|
|
|
3397
|
+
/**
|
|
3398
|
+
* @beta
|
|
3399
|
+
*/
|
|
3400
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3401
|
+
? VanillaEntityIdentifier
|
|
3402
|
+
: T extends string
|
|
3403
|
+
? VanillaEntityIdentifier | T
|
|
3404
|
+
: never;
|
|
3405
|
+
|
|
3252
3406
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3253
3407
|
? ItemComponentTypeMap[T]
|
|
3254
3408
|
: ItemCustomComponentInstance;
|
|
3255
3409
|
|
|
3256
3410
|
export type ItemComponentTypeMap = {
|
|
3257
3411
|
block_actor_dynamic_properties: ItemBlockDynamicPropertiesComponent;
|
|
3412
|
+
block_entity_storage: ItemBlockEntityStorageComponent;
|
|
3258
3413
|
book: ItemBookComponent;
|
|
3259
3414
|
compostable: ItemCompostableComponent;
|
|
3260
3415
|
cooldown: ItemCooldownComponent;
|
|
@@ -3264,6 +3419,7 @@ export type ItemComponentTypeMap = {
|
|
|
3264
3419
|
food: ItemFoodComponent;
|
|
3265
3420
|
inventory: ItemInventoryComponent;
|
|
3266
3421
|
'minecraft:block_actor_dynamic_properties': ItemBlockDynamicPropertiesComponent;
|
|
3422
|
+
'minecraft:block_entity_storage': ItemBlockEntityStorageComponent;
|
|
3267
3423
|
'minecraft:book': ItemBookComponent;
|
|
3268
3424
|
'minecraft:compostable': ItemCompostableComponent;
|
|
3269
3425
|
'minecraft:cooldown': ItemCooldownComponent;
|
|
@@ -3276,6 +3432,15 @@ export type ItemComponentTypeMap = {
|
|
|
3276
3432
|
potion: ItemPotionComponent;
|
|
3277
3433
|
};
|
|
3278
3434
|
|
|
3435
|
+
/**
|
|
3436
|
+
* @beta
|
|
3437
|
+
*/
|
|
3438
|
+
export type VanillaEntityIdentifier =
|
|
3439
|
+
| EntityType
|
|
3440
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3441
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3442
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3443
|
+
|
|
3279
3444
|
/**
|
|
3280
3445
|
* Handle to an aim-assist category that exists in the
|
|
3281
3446
|
* world.aimAssist registry.
|
|
@@ -3433,7 +3598,9 @@ export class AimAssistCategorySettings {
|
|
|
3433
3598
|
* A record mapping block Ids to their priority settings.
|
|
3434
3599
|
* Larger numbers have greater priority.
|
|
3435
3600
|
*/
|
|
3436
|
-
setBlockPriorities(
|
|
3601
|
+
setBlockPriorities(
|
|
3602
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3603
|
+
): void;
|
|
3437
3604
|
/**
|
|
3438
3605
|
* @remarks
|
|
3439
3606
|
* Sets the priority settings used for block targeting.
|
|
@@ -3452,7 +3619,9 @@ export class AimAssistCategorySettings {
|
|
|
3452
3619
|
* A record mapping entity Ids to their priority settings.
|
|
3453
3620
|
* Larger numbers have greater priority.
|
|
3454
3621
|
*/
|
|
3455
|
-
setEntityPriorities(
|
|
3622
|
+
setEntityPriorities(
|
|
3623
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3624
|
+
): void;
|
|
3456
3625
|
/**
|
|
3457
3626
|
* @remarks
|
|
3458
3627
|
* Sets the priority settings used for entity targeting.
|
|
@@ -3651,8 +3820,10 @@ export class AimAssistPresetSettings {
|
|
|
3651
3820
|
*
|
|
3652
3821
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
3653
3822
|
*
|
|
3823
|
+
* @param targets
|
|
3824
|
+
* An array of block tags.
|
|
3654
3825
|
*/
|
|
3655
|
-
setExcludedBlockTagTargets(
|
|
3826
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3656
3827
|
/**
|
|
3657
3828
|
* @remarks
|
|
3658
3829
|
* Sets the list of block Ids to exclude from aim assist
|
|
@@ -3660,8 +3831,10 @@ export class AimAssistPresetSettings {
|
|
|
3660
3831
|
*
|
|
3661
3832
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
3662
3833
|
*
|
|
3834
|
+
* @param targets
|
|
3835
|
+
* An array of block Ids.
|
|
3663
3836
|
*/
|
|
3664
|
-
setExcludedBlockTargets(
|
|
3837
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3665
3838
|
/**
|
|
3666
3839
|
* @remarks
|
|
3667
3840
|
* Sets the list of entity Ids to exclude from aim assist
|
|
@@ -3669,8 +3842,10 @@ export class AimAssistPresetSettings {
|
|
|
3669
3842
|
*
|
|
3670
3843
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
3671
3844
|
*
|
|
3845
|
+
* @param targets
|
|
3846
|
+
* An array of entity Ids.
|
|
3672
3847
|
*/
|
|
3673
|
-
setExcludedEntityTargets(
|
|
3848
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3674
3849
|
/**
|
|
3675
3850
|
* @remarks
|
|
3676
3851
|
* Sets the list of entity type families to exclude from aim
|
|
@@ -3678,8 +3853,10 @@ export class AimAssistPresetSettings {
|
|
|
3678
3853
|
*
|
|
3679
3854
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
3680
3855
|
*
|
|
3856
|
+
* @param targets
|
|
3857
|
+
* An array of entity type families.
|
|
3681
3858
|
*/
|
|
3682
|
-
setExcludedEntityTypeFamilyTargets(
|
|
3859
|
+
setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
|
|
3683
3860
|
/**
|
|
3684
3861
|
* @remarks
|
|
3685
3862
|
* Sets the per-item aim-assist category Ids.
|
|
@@ -3690,7 +3867,7 @@ export class AimAssistPresetSettings {
|
|
|
3690
3867
|
* A record mapping item Ids to aim-assist category Ids.
|
|
3691
3868
|
* Category Ids must have a namespace.
|
|
3692
3869
|
*/
|
|
3693
|
-
setItemSettings(itemSettings: Record<string, string>): void;
|
|
3870
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3694
3871
|
/**
|
|
3695
3872
|
* @remarks
|
|
3696
3873
|
* Sets the list of item Ids that will target liquid blocks
|
|
@@ -3701,7 +3878,7 @@ export class AimAssistPresetSettings {
|
|
|
3701
3878
|
* @param items
|
|
3702
3879
|
* An array of item Ids.
|
|
3703
3880
|
*/
|
|
3704
|
-
setLiquidTargetingItems(items?: string[]): void;
|
|
3881
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3705
3882
|
}
|
|
3706
3883
|
|
|
3707
3884
|
/**
|
|
@@ -3807,6 +3984,28 @@ export class AimAssistRegistry {
|
|
|
3807
3984
|
getPresets(): AimAssistPreset[];
|
|
3808
3985
|
}
|
|
3809
3986
|
|
|
3987
|
+
/**
|
|
3988
|
+
* @beta
|
|
3989
|
+
* Describes a single banner pattern, which includes a colour
|
|
3990
|
+
* and a pattern type.
|
|
3991
|
+
*/
|
|
3992
|
+
export class BannerPattern {
|
|
3993
|
+
private constructor();
|
|
3994
|
+
/**
|
|
3995
|
+
* @remarks
|
|
3996
|
+
* The color to apply to this banner pattern.
|
|
3997
|
+
*
|
|
3998
|
+
*/
|
|
3999
|
+
readonly color: string;
|
|
4000
|
+
/**
|
|
4001
|
+
* @remarks
|
|
4002
|
+
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
4003
|
+
* apply to the banner.
|
|
4004
|
+
*
|
|
4005
|
+
*/
|
|
4006
|
+
readonly pattern: string;
|
|
4007
|
+
}
|
|
4008
|
+
|
|
3810
4009
|
/**
|
|
3811
4010
|
* Describes a type of biome.
|
|
3812
4011
|
*/
|
|
@@ -3900,6 +4099,20 @@ export class Block {
|
|
|
3900
4099
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3901
4100
|
*/
|
|
3902
4101
|
readonly isLiquid: boolean;
|
|
4102
|
+
/**
|
|
4103
|
+
* @beta
|
|
4104
|
+
* @remarks
|
|
4105
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
4106
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
4107
|
+
* ladder block and a fence block are not).
|
|
4108
|
+
*
|
|
4109
|
+
* @throws This property can throw when used.
|
|
4110
|
+
*
|
|
4111
|
+
* {@link LocationInUnloadedChunkError}
|
|
4112
|
+
*
|
|
4113
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4114
|
+
*/
|
|
4115
|
+
readonly isSolid: boolean;
|
|
3903
4116
|
/**
|
|
3904
4117
|
* @remarks
|
|
3905
4118
|
* Returns true if this reference to a block is still valid
|
|
@@ -4065,6 +4278,30 @@ export class Block {
|
|
|
4065
4278
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4066
4279
|
*/
|
|
4067
4280
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4281
|
+
/**
|
|
4282
|
+
* @beta
|
|
4283
|
+
* @remarks
|
|
4284
|
+
* Checks to see whether it is valid to place the specified
|
|
4285
|
+
* block type or block permutation, on a specified face on this
|
|
4286
|
+
* block.
|
|
4287
|
+
*
|
|
4288
|
+
* @param blockToPlace
|
|
4289
|
+
* Block type or block permutation to check placement for.
|
|
4290
|
+
* @param faceToPlaceOn
|
|
4291
|
+
* Optional specific face of this block to check placement
|
|
4292
|
+
* against.
|
|
4293
|
+
* @returns
|
|
4294
|
+
* Returns `true` if the block type or permutation can be
|
|
4295
|
+
* placed on this block, else `false`.
|
|
4296
|
+
* @throws This function can throw errors.
|
|
4297
|
+
*
|
|
4298
|
+
* {@link Error}
|
|
4299
|
+
*
|
|
4300
|
+
* {@link LocationInUnloadedChunkError}
|
|
4301
|
+
*
|
|
4302
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4303
|
+
*/
|
|
4304
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
4068
4305
|
/**
|
|
4069
4306
|
* @remarks
|
|
4070
4307
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -4087,6 +4324,23 @@ export class Block {
|
|
|
4087
4324
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4088
4325
|
*/
|
|
4089
4326
|
east(steps?: number): Block | undefined;
|
|
4327
|
+
/**
|
|
4328
|
+
* @beta
|
|
4329
|
+
* @remarks
|
|
4330
|
+
* Returns the named tick events scheduled at this block by the
|
|
4331
|
+
* calling script pack.
|
|
4332
|
+
*
|
|
4333
|
+
* @returns
|
|
4334
|
+
* The scheduled named tick events. Each event contains its
|
|
4335
|
+
* eventName and the number of ticks until it is raised as
|
|
4336
|
+
* tickDelay.
|
|
4337
|
+
* @throws This function can throw errors.
|
|
4338
|
+
*
|
|
4339
|
+
* {@link LocationInUnloadedChunkError}
|
|
4340
|
+
*
|
|
4341
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4342
|
+
*/
|
|
4343
|
+
getAllScheduledNamedTicks(): ScheduledNamedTick[];
|
|
4090
4344
|
/**
|
|
4091
4345
|
* @remarks
|
|
4092
4346
|
* Gets a component (that represents additional capabilities)
|
|
@@ -4161,6 +4415,15 @@ export class Block {
|
|
|
4161
4415
|
* {@link LocationInUnloadedChunkError}
|
|
4162
4416
|
*/
|
|
4163
4417
|
getLightLevel(): number;
|
|
4418
|
+
/**
|
|
4419
|
+
* @beta
|
|
4420
|
+
* @throws This function can throw errors.
|
|
4421
|
+
*
|
|
4422
|
+
* {@link LocationInUnloadedChunkError}
|
|
4423
|
+
*
|
|
4424
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4425
|
+
*/
|
|
4426
|
+
getMapColor(): RGBA;
|
|
4164
4427
|
/**
|
|
4165
4428
|
* @remarks
|
|
4166
4429
|
* Returns array of all loaded block parts if this block has
|
|
@@ -4188,6 +4451,22 @@ export class Block {
|
|
|
4188
4451
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4189
4452
|
*/
|
|
4190
4453
|
getRedstonePower(): number | undefined;
|
|
4454
|
+
/**
|
|
4455
|
+
* @beta
|
|
4456
|
+
* @remarks
|
|
4457
|
+
* Returns the number of named tick events scheduled at this
|
|
4458
|
+
* block, regardless of which script pack scheduled them.
|
|
4459
|
+
*
|
|
4460
|
+
* @returns
|
|
4461
|
+
* The number of named tick events currently scheduled at this
|
|
4462
|
+
* block.
|
|
4463
|
+
* @throws This function can throw errors.
|
|
4464
|
+
*
|
|
4465
|
+
* {@link LocationInUnloadedChunkError}
|
|
4466
|
+
*
|
|
4467
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4468
|
+
*/
|
|
4469
|
+
getScheduledNamedTickCount(): number;
|
|
4191
4470
|
/**
|
|
4192
4471
|
* @remarks
|
|
4193
4472
|
* Returns the brightness level of light shining from the sky
|
|
@@ -4233,6 +4512,15 @@ export class Block {
|
|
|
4233
4512
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4234
4513
|
*/
|
|
4235
4514
|
hasComponent(componentId: string): boolean;
|
|
4515
|
+
/**
|
|
4516
|
+
* @beta
|
|
4517
|
+
* @throws This function can throw errors.
|
|
4518
|
+
*
|
|
4519
|
+
* {@link LocationInUnloadedChunkError}
|
|
4520
|
+
*
|
|
4521
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4522
|
+
*/
|
|
4523
|
+
hasScheduledNamedTick(eventName: string): boolean;
|
|
4236
4524
|
/**
|
|
4237
4525
|
* @remarks
|
|
4238
4526
|
* Checks to see if the permutation of this block has a
|
|
@@ -4373,6 +4661,47 @@ export class Block {
|
|
|
4373
4661
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4374
4662
|
*/
|
|
4375
4663
|
offset(offset: Vector3): Block | undefined;
|
|
4664
|
+
/**
|
|
4665
|
+
* @beta
|
|
4666
|
+
* @remarks
|
|
4667
|
+
* Removes all scheduled named tick events from this block with
|
|
4668
|
+
* the specified event name.
|
|
4669
|
+
*
|
|
4670
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4671
|
+
*
|
|
4672
|
+
* @param eventName
|
|
4673
|
+
* Name of the scheduled event to remove.
|
|
4674
|
+
* @throws This function can throw errors.
|
|
4675
|
+
*
|
|
4676
|
+
* {@link LocationInUnloadedChunkError}
|
|
4677
|
+
*
|
|
4678
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4679
|
+
*/
|
|
4680
|
+
removeScheduledNamedTicks(eventName: string): void;
|
|
4681
|
+
/**
|
|
4682
|
+
* @beta
|
|
4683
|
+
* @remarks
|
|
4684
|
+
* Schedules a named tick event for this block. The event will
|
|
4685
|
+
* be delivered to block custom components registered with the
|
|
4686
|
+
* `onNamedTick` callback after the specified delay.
|
|
4687
|
+
*
|
|
4688
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4689
|
+
*
|
|
4690
|
+
* @param eventName
|
|
4691
|
+
* Name of the event to schedule. Up to 31 characters.
|
|
4692
|
+
* @param tickDelay
|
|
4693
|
+
* Number of ticks to wait before the event is raised. Must be
|
|
4694
|
+
* at least 1.
|
|
4695
|
+
* Minimum value: 1
|
|
4696
|
+
* @throws This function can throw errors.
|
|
4697
|
+
*
|
|
4698
|
+
* {@link Error}
|
|
4699
|
+
*
|
|
4700
|
+
* {@link LocationInUnloadedChunkError}
|
|
4701
|
+
*
|
|
4702
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4703
|
+
*/
|
|
4704
|
+
scheduleNamedTick(eventName: string, tickDelay: number): void;
|
|
4376
4705
|
/**
|
|
4377
4706
|
* @remarks
|
|
4378
4707
|
* Sets the block in the dimension to the state of the
|
|
@@ -4441,6 +4770,27 @@ export class Block {
|
|
|
4441
4770
|
* {@link LocationOutOfWorldBoundariesError}
|
|
4442
4771
|
*/
|
|
4443
4772
|
south(steps?: number): Block | undefined;
|
|
4773
|
+
/**
|
|
4774
|
+
* @beta
|
|
4775
|
+
* @remarks
|
|
4776
|
+
* Tries to set the block in the dimension to the state of the
|
|
4777
|
+
* permutation by first checking if the placement is valid.
|
|
4778
|
+
*
|
|
4779
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4780
|
+
*
|
|
4781
|
+
* @param permutation
|
|
4782
|
+
* Permutation that contains a set of property states for the
|
|
4783
|
+
* Block.
|
|
4784
|
+
* @returns
|
|
4785
|
+
* Returns `true` if the block permutation data was
|
|
4786
|
+
* successfully set, else `false`.
|
|
4787
|
+
* @throws This function can throw errors.
|
|
4788
|
+
*
|
|
4789
|
+
* {@link LocationInUnloadedChunkError}
|
|
4790
|
+
*
|
|
4791
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4792
|
+
*/
|
|
4793
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4444
4794
|
/**
|
|
4445
4795
|
* @remarks
|
|
4446
4796
|
* Returns the {@link Block} to the west of this block
|
|
@@ -4459,79 +4809,210 @@ export class Block {
|
|
|
4459
4809
|
}
|
|
4460
4810
|
|
|
4461
4811
|
/**
|
|
4462
|
-
*
|
|
4812
|
+
* @beta
|
|
4813
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4814
|
+
* of useful functions for the creation and utility of
|
|
4815
|
+
* {@link BlockBoundingBox} objects
|
|
4463
4816
|
*/
|
|
4464
|
-
|
|
4465
|
-
export class BlockComponent extends Component {
|
|
4817
|
+
export class BlockBoundingBoxUtils {
|
|
4466
4818
|
private constructor();
|
|
4467
4819
|
/**
|
|
4468
4820
|
* @remarks
|
|
4469
|
-
*
|
|
4821
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4822
|
+
* where the min and max components are guaranteed to be (min
|
|
4823
|
+
* <= max)
|
|
4470
4824
|
*
|
|
4825
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4826
|
+
*
|
|
4827
|
+
* @param min
|
|
4828
|
+
* A corner world location
|
|
4829
|
+
* @param max
|
|
4830
|
+
* A corner world location diametrically opposite
|
|
4471
4831
|
*/
|
|
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();
|
|
4832
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4482
4833
|
/**
|
|
4483
4834
|
* @remarks
|
|
4484
|
-
*
|
|
4835
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4836
|
+
* each axis.
|
|
4837
|
+
* Sizes can be negative to perform contraction.
|
|
4838
|
+
* Note: corners can be inverted if the contraction size is
|
|
4839
|
+
* greater than the span, but the min/max relationship will
|
|
4840
|
+
* remain correct
|
|
4841
|
+
*
|
|
4842
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4485
4843
|
*
|
|
4844
|
+
* @returns
|
|
4845
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4846
|
+
* the changes
|
|
4486
4847
|
*/
|
|
4487
|
-
|
|
4848
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4488
4849
|
/**
|
|
4489
4850
|
* @remarks
|
|
4490
|
-
*
|
|
4491
|
-
*
|
|
4851
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4852
|
+
*
|
|
4853
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4492
4854
|
*
|
|
4493
4855
|
*/
|
|
4494
|
-
|
|
4856
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4495
4857
|
/**
|
|
4496
4858
|
* @remarks
|
|
4497
|
-
*
|
|
4859
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4860
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4861
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4862
|
+
* boxes.
|
|
4863
|
+
*
|
|
4864
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4498
4865
|
*
|
|
4866
|
+
* @returns
|
|
4867
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4868
|
+
* smallest possible bounding box which can encompass both
|
|
4499
4869
|
*/
|
|
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();
|
|
4870
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4510
4871
|
/**
|
|
4511
4872
|
* @remarks
|
|
4512
|
-
*
|
|
4873
|
+
* Calculate the center block of a given
|
|
4874
|
+
* {@link BlockBoundingBox} object.
|
|
4875
|
+
*
|
|
4876
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4513
4877
|
*
|
|
4878
|
+
* @returns
|
|
4879
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4880
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4881
|
+
* bounds are not mathematically centered...
|
|
4882
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4883
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4514
4884
|
*/
|
|
4515
|
-
|
|
4516
|
-
}
|
|
4517
|
-
|
|
4518
|
-
/**
|
|
4519
|
-
* Contains information regarding an event sent by an entity to
|
|
4520
|
-
* this block in the world.
|
|
4521
|
-
*/
|
|
4522
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4523
|
-
export class BlockComponentEntityEvent extends BlockEvent {
|
|
4524
|
-
private constructor();
|
|
4885
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4525
4886
|
/**
|
|
4526
4887
|
* @remarks
|
|
4527
|
-
*
|
|
4528
|
-
*
|
|
4888
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4889
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4890
|
+
*
|
|
4891
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4529
4892
|
*
|
|
4530
4893
|
*/
|
|
4531
|
-
|
|
4894
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4532
4895
|
/**
|
|
4533
4896
|
* @remarks
|
|
4534
|
-
*
|
|
4897
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4898
|
+
*
|
|
4899
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4900
|
+
*
|
|
4901
|
+
*/
|
|
4902
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4903
|
+
/**
|
|
4904
|
+
* @remarks
|
|
4905
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4906
|
+
*
|
|
4907
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4908
|
+
*
|
|
4909
|
+
*/
|
|
4910
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4911
|
+
/**
|
|
4912
|
+
* @remarks
|
|
4913
|
+
* Check to see if a given coordinate is inside a
|
|
4914
|
+
* BlockBoundingBox
|
|
4915
|
+
*
|
|
4916
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4917
|
+
*
|
|
4918
|
+
*/
|
|
4919
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4920
|
+
/**
|
|
4921
|
+
* @remarks
|
|
4922
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4923
|
+
* max))
|
|
4924
|
+
*
|
|
4925
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4926
|
+
*
|
|
4927
|
+
*/
|
|
4928
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4929
|
+
/**
|
|
4930
|
+
* @remarks
|
|
4931
|
+
* Move a BlockBoundingBox by a given amount
|
|
4932
|
+
*
|
|
4933
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
4934
|
+
*
|
|
4935
|
+
* @returns
|
|
4936
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4937
|
+
* change
|
|
4938
|
+
*/
|
|
4939
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4940
|
+
}
|
|
4941
|
+
|
|
4942
|
+
/**
|
|
4943
|
+
* Base type for components associated with blocks.
|
|
4944
|
+
*/
|
|
4945
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4946
|
+
export class BlockComponent extends Component {
|
|
4947
|
+
private constructor();
|
|
4948
|
+
/**
|
|
4949
|
+
* @remarks
|
|
4950
|
+
* Block instance that this component pertains to.
|
|
4951
|
+
*
|
|
4952
|
+
*/
|
|
4953
|
+
readonly block: Block;
|
|
4954
|
+
}
|
|
4955
|
+
|
|
4956
|
+
/**
|
|
4957
|
+
* Contains information regarding a specific block being
|
|
4958
|
+
* broken.
|
|
4959
|
+
*/
|
|
4960
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4961
|
+
export class BlockComponentBlockBreakEvent extends BlockEvent {
|
|
4962
|
+
private constructor();
|
|
4963
|
+
/**
|
|
4964
|
+
* @remarks
|
|
4965
|
+
* The block that caused destruction.
|
|
4966
|
+
*
|
|
4967
|
+
*/
|
|
4968
|
+
readonly blockDestructionSource?: Block;
|
|
4969
|
+
/**
|
|
4970
|
+
* @remarks
|
|
4971
|
+
* Returns permutation information about this block before it
|
|
4972
|
+
* was broken.
|
|
4973
|
+
*
|
|
4974
|
+
*/
|
|
4975
|
+
readonly brokenBlockPermutation: BlockPermutation;
|
|
4976
|
+
/**
|
|
4977
|
+
* @remarks
|
|
4978
|
+
* The Actor that caused destruction.
|
|
4979
|
+
*
|
|
4980
|
+
*/
|
|
4981
|
+
readonly entitySource?: Entity;
|
|
4982
|
+
}
|
|
4983
|
+
|
|
4984
|
+
/**
|
|
4985
|
+
* Contains information regarding a specific block permutation
|
|
4986
|
+
* that was changed from a previous permutation.
|
|
4987
|
+
*/
|
|
4988
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4989
|
+
export class BlockComponentBlockStateChangeEvent extends BlockEvent {
|
|
4990
|
+
private constructor();
|
|
4991
|
+
/**
|
|
4992
|
+
* @remarks
|
|
4993
|
+
* The previous BlockPermutation.
|
|
4994
|
+
*
|
|
4995
|
+
*/
|
|
4996
|
+
readonly previousPermutation: BlockPermutation;
|
|
4997
|
+
}
|
|
4998
|
+
|
|
4999
|
+
/**
|
|
5000
|
+
* Contains information regarding an event sent by an entity to
|
|
5001
|
+
* this block in the world.
|
|
5002
|
+
*/
|
|
5003
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5004
|
+
export class BlockComponentEntityEvent extends BlockEvent {
|
|
5005
|
+
private constructor();
|
|
5006
|
+
/**
|
|
5007
|
+
* @remarks
|
|
5008
|
+
* Returns permutation information about the block receiving
|
|
5009
|
+
* the event.
|
|
5010
|
+
*
|
|
5011
|
+
*/
|
|
5012
|
+
readonly blockPermutation: BlockPermutation;
|
|
5013
|
+
/**
|
|
5014
|
+
* @remarks
|
|
5015
|
+
* The entity that sent the event.
|
|
4535
5016
|
*
|
|
4536
5017
|
*/
|
|
4537
5018
|
readonly entitySource: Entity;
|
|
@@ -4564,6 +5045,54 @@ export class BlockComponentEntityFallOnEvent extends BlockEvent {
|
|
|
4564
5045
|
readonly fallDistance: number;
|
|
4565
5046
|
}
|
|
4566
5047
|
|
|
5048
|
+
/**
|
|
5049
|
+
* @beta
|
|
5050
|
+
* Contains information regarding a named tick event for a
|
|
5051
|
+
* specific block.
|
|
5052
|
+
*/
|
|
5053
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5054
|
+
export class BlockComponentNamedTickEvent extends BlockEvent {
|
|
5055
|
+
private constructor();
|
|
5056
|
+
/**
|
|
5057
|
+
* @remarks
|
|
5058
|
+
* Name of the named tick event.
|
|
5059
|
+
*
|
|
5060
|
+
*/
|
|
5061
|
+
readonly name: string;
|
|
5062
|
+
/**
|
|
5063
|
+
* @remarks
|
|
5064
|
+
* Checks whether this named tick event was scheduled by this
|
|
5065
|
+
* pack.
|
|
5066
|
+
*
|
|
5067
|
+
* @returns
|
|
5068
|
+
* True if this named tick event was scheduled by this pack;
|
|
5069
|
+
* otherwise, false.
|
|
5070
|
+
*/
|
|
5071
|
+
isMine(): boolean;
|
|
5072
|
+
}
|
|
5073
|
+
|
|
5074
|
+
/**
|
|
5075
|
+
* @beta
|
|
5076
|
+
* Contains information regarding neighboring block changes for
|
|
5077
|
+
* a specific block.
|
|
5078
|
+
*/
|
|
5079
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5080
|
+
export class BlockComponentNeighborChangedAfterEvent extends BlockEvent {
|
|
5081
|
+
private constructor();
|
|
5082
|
+
/**
|
|
5083
|
+
* @remarks
|
|
5084
|
+
* Returns the neighboring block changes for this event.
|
|
5085
|
+
*
|
|
5086
|
+
* @returns
|
|
5087
|
+
* One entry for each neighboring direction that changed,
|
|
5088
|
+
* ordered by when each direction first changed. If a direction
|
|
5089
|
+
* changed multiple times during the tick, the entry contains
|
|
5090
|
+
* the permutation before the first change and after the last
|
|
5091
|
+
* change. Intermediate permutations are not included.
|
|
5092
|
+
*/
|
|
5093
|
+
getChanges(): NeighborChange[];
|
|
5094
|
+
}
|
|
5095
|
+
|
|
4567
5096
|
/**
|
|
4568
5097
|
* Contains information regarding a specific block that was
|
|
4569
5098
|
* placed.
|
|
@@ -4680,6 +5209,13 @@ export class BlockComponentRandomTickEvent extends BlockEvent {
|
|
|
4680
5209
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4681
5210
|
export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
|
|
4682
5211
|
private constructor();
|
|
5212
|
+
/**
|
|
5213
|
+
* @beta
|
|
5214
|
+
* @remarks
|
|
5215
|
+
* The first update event for the redstone component.
|
|
5216
|
+
*
|
|
5217
|
+
*/
|
|
5218
|
+
readonly firstUpdate: boolean;
|
|
4683
5219
|
/**
|
|
4684
5220
|
* @remarks
|
|
4685
5221
|
* The redstone signal strength passing through this block. It
|
|
@@ -4974,6 +5510,181 @@ export class BlockDynamicPropertiesComponent extends BlockComponent {
|
|
|
4974
5510
|
totalByteCount(): number;
|
|
4975
5511
|
}
|
|
4976
5512
|
|
|
5513
|
+
/**
|
|
5514
|
+
* @beta
|
|
5515
|
+
* Represents storage for entities associated with a block
|
|
5516
|
+
* entity. This component is available on blocks whose behavior
|
|
5517
|
+
* pack definition enables entity storage with the
|
|
5518
|
+
* `minecraft:block_entity` component. Stored entities are
|
|
5519
|
+
* serialized and removed from the world until they are
|
|
5520
|
+
* released or transferred. A block can store up to four
|
|
5521
|
+
* entities. Entity storage is scoped to the content pack
|
|
5522
|
+
* accessing it.
|
|
5523
|
+
*/
|
|
5524
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5525
|
+
export class BlockEntityStorageComponent extends BlockComponent {
|
|
5526
|
+
private constructor();
|
|
5527
|
+
static readonly componentId = 'minecraft:entity_storage';
|
|
5528
|
+
/**
|
|
5529
|
+
* @remarks
|
|
5530
|
+
* Returns information about the entities stored in this
|
|
5531
|
+
* block's entity storage. The returned entities are not
|
|
5532
|
+
* present in the world while they are stored. Only entities
|
|
5533
|
+
* stored by the current content pack are included.
|
|
5534
|
+
*
|
|
5535
|
+
* @returns
|
|
5536
|
+
* An array of {@link BlockEntityStorageInfo} values containing
|
|
5537
|
+
* the unique ID and definition ID of each stored entity.
|
|
5538
|
+
* Returns an empty array when no entities are stored by the
|
|
5539
|
+
* current content pack.
|
|
5540
|
+
* @throws
|
|
5541
|
+
* Throws if the block entity is invalid or the block's
|
|
5542
|
+
* location is not loaded or is outside the world boundaries.
|
|
5543
|
+
*
|
|
5544
|
+
* {@link Error}
|
|
5545
|
+
*
|
|
5546
|
+
* {@link InvalidBlockComponentError}
|
|
5547
|
+
*
|
|
5548
|
+
* {@link LocationInUnloadedChunkError}
|
|
5549
|
+
*
|
|
5550
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5551
|
+
*/
|
|
5552
|
+
getEntities(): BlockEntityStorageInfo[];
|
|
5553
|
+
/**
|
|
5554
|
+
* @remarks
|
|
5555
|
+
* Releases a stored entity from this block's entity storage
|
|
5556
|
+
* and spawns it back into the world, at the same location it
|
|
5557
|
+
* was when stored.
|
|
5558
|
+
*
|
|
5559
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
5560
|
+
*
|
|
5561
|
+
* @param entityId
|
|
5562
|
+
* The unique ID of the stored entity. Use the value returned
|
|
5563
|
+
* by {@link BlockEntityStorageComponent.store} or the
|
|
5564
|
+
* `uniqueId` property from {@link BlockEntityStorageInfo}.
|
|
5565
|
+
* @returns
|
|
5566
|
+
* The released {@link Entity}. The released entity receives a
|
|
5567
|
+
* new runtime ID.
|
|
5568
|
+
* @throws
|
|
5569
|
+
* Throws if the entity ID is invalid or does not identify an
|
|
5570
|
+
* entity stored by the current content pack, if the stored
|
|
5571
|
+
* entity cannot be loaded or spawned, or if the block entity
|
|
5572
|
+
* is invalid.
|
|
5573
|
+
*
|
|
5574
|
+
* {@link Error}
|
|
5575
|
+
*
|
|
5576
|
+
* {@link InvalidBlockComponentError}
|
|
5577
|
+
*
|
|
5578
|
+
* {@link LocationInUnloadedChunkError}
|
|
5579
|
+
*
|
|
5580
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5581
|
+
*/
|
|
5582
|
+
release(entityId: string): Entity;
|
|
5583
|
+
/**
|
|
5584
|
+
* @remarks
|
|
5585
|
+
* Returns the number of entities stored in this block's entity
|
|
5586
|
+
* storage by the current content pack.
|
|
5587
|
+
*
|
|
5588
|
+
* @returns
|
|
5589
|
+
* The number of entities stored by the current content pack.
|
|
5590
|
+
* @throws
|
|
5591
|
+
* Throws if the block entity is invalid or the block's
|
|
5592
|
+
* location is not loaded or is outside the world boundaries.
|
|
5593
|
+
*
|
|
5594
|
+
* {@link Error}
|
|
5595
|
+
*
|
|
5596
|
+
* {@link InvalidBlockComponentError}
|
|
5597
|
+
*
|
|
5598
|
+
* {@link LocationInUnloadedChunkError}
|
|
5599
|
+
*
|
|
5600
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5601
|
+
*/
|
|
5602
|
+
size(): number;
|
|
5603
|
+
/**
|
|
5604
|
+
* @remarks
|
|
5605
|
+
* Serializes and stores an entity in this block's entity
|
|
5606
|
+
* storage. The entity is removed from the world after it is
|
|
5607
|
+
* stored. Only non-player mob entities can be stored. Entities
|
|
5608
|
+
* with passengers or that are passengers cannot be stored.
|
|
5609
|
+
*
|
|
5610
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
5611
|
+
*
|
|
5612
|
+
* @param entity
|
|
5613
|
+
* The {@link Entity} to store.
|
|
5614
|
+
* @returns
|
|
5615
|
+
* The unique ID assigned to the stored entity. Keep this ID to
|
|
5616
|
+
* release, transfer, or inspect the stored entity later.
|
|
5617
|
+
* @throws
|
|
5618
|
+
* Throws if the storage is full, the entity is already stored,
|
|
5619
|
+
* the entity cannot be serialized, or the block entity is
|
|
5620
|
+
* invalid.
|
|
5621
|
+
*
|
|
5622
|
+
* {@link Error}
|
|
5623
|
+
*
|
|
5624
|
+
* {@link InvalidBlockComponentError}
|
|
5625
|
+
*
|
|
5626
|
+
* {@link LocationInUnloadedChunkError}
|
|
5627
|
+
*
|
|
5628
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5629
|
+
*/
|
|
5630
|
+
store(entity: Entity): string;
|
|
5631
|
+
/**
|
|
5632
|
+
* @remarks
|
|
5633
|
+
* Moves a stored entity from this block's entity storage to
|
|
5634
|
+
* the target block's entity storage without releasing it into
|
|
5635
|
+
* the world.
|
|
5636
|
+
*
|
|
5637
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
5638
|
+
*
|
|
5639
|
+
* @param entityId
|
|
5640
|
+
* The unique ID of the stored entity. Use the value returned
|
|
5641
|
+
* by {@link BlockEntityStorageComponent.store} or the
|
|
5642
|
+
* `uniqueId` property from {@link BlockEntityStorageInfo}.
|
|
5643
|
+
* @param targetBlock
|
|
5644
|
+
* The target {@link Block} with an entity storage component.
|
|
5645
|
+
* The target block must be in the same dimension as this
|
|
5646
|
+
* block.
|
|
5647
|
+
* @throws
|
|
5648
|
+
* Throws if the entity ID is invalid or not stored by the
|
|
5649
|
+
* current content pack, if the target block is invalid, in
|
|
5650
|
+
* another dimension, lacks entity storage, or is full, or if
|
|
5651
|
+
* the source and target blocks are the same.
|
|
5652
|
+
*
|
|
5653
|
+
* {@link Error}
|
|
5654
|
+
*
|
|
5655
|
+
* {@link InvalidBlockComponentError}
|
|
5656
|
+
*
|
|
5657
|
+
* {@link LocationInUnloadedChunkError}
|
|
5658
|
+
*
|
|
5659
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5660
|
+
*/
|
|
5661
|
+
transfer(entityId: string, targetBlock: Block): void;
|
|
5662
|
+
}
|
|
5663
|
+
|
|
5664
|
+
/**
|
|
5665
|
+
* @beta
|
|
5666
|
+
* Contains identifying information about an entity stored in a
|
|
5667
|
+
* {@link BlockEntityStorageComponent}. Stored entities are not
|
|
5668
|
+
* present in the world until they are released.
|
|
5669
|
+
*/
|
|
5670
|
+
export class BlockEntityStorageInfo {
|
|
5671
|
+
private constructor();
|
|
5672
|
+
/**
|
|
5673
|
+
* @remarks
|
|
5674
|
+
* The entity's definition ID, such as `minecraft:pig`.
|
|
5675
|
+
*
|
|
5676
|
+
*/
|
|
5677
|
+
readonly definitionId: string;
|
|
5678
|
+
/**
|
|
5679
|
+
* @remarks
|
|
5680
|
+
* The unique ID of the stored entity. Use this ID with
|
|
5681
|
+
* {@link BlockEntityStorageComponent.release} or
|
|
5682
|
+
* {@link BlockEntityStorageComponent.transfer}.
|
|
5683
|
+
*
|
|
5684
|
+
*/
|
|
5685
|
+
readonly uniqueId: string;
|
|
5686
|
+
}
|
|
5687
|
+
|
|
4977
5688
|
/**
|
|
4978
5689
|
* Contains information regarding an event that impacts a
|
|
4979
5690
|
* specific block.
|
|
@@ -5234,6 +5945,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
5234
5945
|
*
|
|
5235
5946
|
*/
|
|
5236
5947
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5948
|
+
/**
|
|
5949
|
+
* @beta
|
|
5950
|
+
* @remarks
|
|
5951
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5952
|
+
* Will return false if the block volume was modified between
|
|
5953
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5954
|
+
*
|
|
5955
|
+
* @throws This function can throw errors.
|
|
5956
|
+
*
|
|
5957
|
+
* {@link minecraftcommon.EngineError}
|
|
5958
|
+
*/
|
|
5959
|
+
isValid(): boolean;
|
|
5237
5960
|
/**
|
|
5238
5961
|
* @remarks
|
|
5239
5962
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
@@ -5633,29 +6356,162 @@ export class BlockPrecipitationInteractionsComponent extends BlockComponent {
|
|
|
5633
6356
|
}
|
|
5634
6357
|
|
|
5635
6358
|
/**
|
|
5636
|
-
*
|
|
6359
|
+
* @beta
|
|
6360
|
+
* Represents a block component that provides access to recipe
|
|
6361
|
+
* crafting.
|
|
5637
6362
|
*/
|
|
5638
6363
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5639
|
-
export class
|
|
6364
|
+
export class BlockRecipeCraftingComponent extends BlockComponent {
|
|
5640
6365
|
private constructor();
|
|
5641
|
-
static readonly componentId = 'minecraft:record_player';
|
|
5642
6366
|
/**
|
|
5643
6367
|
* @remarks
|
|
5644
|
-
*
|
|
5645
|
-
* block.
|
|
5646
|
-
*
|
|
5647
|
-
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
6368
|
+
* Returns an array of all players currently interacting with
|
|
6369
|
+
* this block.
|
|
5648
6370
|
*
|
|
5649
|
-
* @throws This function can throw errors.
|
|
5650
6371
|
*/
|
|
5651
|
-
|
|
6372
|
+
readonly players: Player[];
|
|
6373
|
+
static readonly componentId = 'minecraft:recipe_crafting';
|
|
5652
6374
|
/**
|
|
5653
6375
|
* @remarks
|
|
5654
|
-
* Gets the
|
|
6376
|
+
* Gets the recipe crafting context for a player interacting
|
|
6377
|
+
* with this block.
|
|
5655
6378
|
*
|
|
6379
|
+
* @param player
|
|
6380
|
+
* The player for whom to retrieve the crafting context.
|
|
6381
|
+
* @returns
|
|
6382
|
+
* The current recipe crafting context for the player, or
|
|
6383
|
+
* undefined if the player isn't crafting.
|
|
5656
6384
|
* @throws This function can throw errors.
|
|
5657
|
-
|
|
5658
|
-
|
|
6385
|
+
*
|
|
6386
|
+
* {@link minecraftcommon.EngineError}
|
|
6387
|
+
*
|
|
6388
|
+
* {@link InvalidEntityError}
|
|
6389
|
+
*/
|
|
6390
|
+
getCraftingContext(player: Player): RecipeCraftingContext | undefined;
|
|
6391
|
+
}
|
|
6392
|
+
|
|
6393
|
+
/**
|
|
6394
|
+
* @beta
|
|
6395
|
+
* Represents a block component that provides access to recipe
|
|
6396
|
+
* processing inputs and output.
|
|
6397
|
+
*/
|
|
6398
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6399
|
+
export class BlockRecipeProcessingComponent extends BlockComponent {
|
|
6400
|
+
private constructor();
|
|
6401
|
+
/**
|
|
6402
|
+
* @remarks
|
|
6403
|
+
* The number of addressable input slots for getInputItem,
|
|
6404
|
+
* setInputItem, setInputSlotEnabled, and getInputSlotEnabled.
|
|
6405
|
+
*
|
|
6406
|
+
* @throws This property can throw when used.
|
|
6407
|
+
*
|
|
6408
|
+
* {@link InvalidBlockComponentError}
|
|
6409
|
+
*/
|
|
6410
|
+
readonly inputSlotCount: number;
|
|
6411
|
+
static readonly componentId = 'minecraft:recipe_processing';
|
|
6412
|
+
/**
|
|
6413
|
+
* @remarks
|
|
6414
|
+
* Gets the item in the provided input slot.
|
|
6415
|
+
*
|
|
6416
|
+
* @param slot
|
|
6417
|
+
* The zero-based input slot index.
|
|
6418
|
+
* @returns
|
|
6419
|
+
* The item stack in the input slot, or undefined if the slot
|
|
6420
|
+
* is empty.
|
|
6421
|
+
* @throws This function can throw errors.
|
|
6422
|
+
*
|
|
6423
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6424
|
+
*
|
|
6425
|
+
* {@link InvalidBlockComponentError}
|
|
6426
|
+
*/
|
|
6427
|
+
getInputItem(slot: number): ItemStack | undefined;
|
|
6428
|
+
/**
|
|
6429
|
+
* @remarks
|
|
6430
|
+
* Gets whether an input slot is enabled for recipe processing.
|
|
6431
|
+
*
|
|
6432
|
+
* @param slot
|
|
6433
|
+
* The zero-based input slot index.
|
|
6434
|
+
* @returns
|
|
6435
|
+
* Whether the input slot is enabled.
|
|
6436
|
+
* @throws This function can throw errors.
|
|
6437
|
+
*
|
|
6438
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6439
|
+
*
|
|
6440
|
+
* {@link InvalidBlockComponentError}
|
|
6441
|
+
*
|
|
6442
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6443
|
+
*/
|
|
6444
|
+
getInputSlotEnabled(slot: number): boolean;
|
|
6445
|
+
/**
|
|
6446
|
+
* @remarks
|
|
6447
|
+
* Gets the item produced by the current recipe processing
|
|
6448
|
+
* inputs.
|
|
6449
|
+
*
|
|
6450
|
+
* @returns
|
|
6451
|
+
* The output item stack, or undefined if the current inputs do
|
|
6452
|
+
* not produce an item.
|
|
6453
|
+
* @throws This function can throw errors.
|
|
6454
|
+
*
|
|
6455
|
+
* {@link InvalidBlockComponentError}
|
|
6456
|
+
*/
|
|
6457
|
+
getOutputItem(): ItemStack | undefined;
|
|
6458
|
+
/**
|
|
6459
|
+
* @remarks
|
|
6460
|
+
* Sets or clears an item in an input slot.
|
|
6461
|
+
*
|
|
6462
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
6463
|
+
*
|
|
6464
|
+
* @param slot
|
|
6465
|
+
* The zero-based input slot index.
|
|
6466
|
+
* @param item
|
|
6467
|
+
* The item stack to place in the slot, or undefined to clear
|
|
6468
|
+
* the slot.
|
|
6469
|
+
* @throws This function can throw errors.
|
|
6470
|
+
*
|
|
6471
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6472
|
+
*
|
|
6473
|
+
* {@link InvalidBlockComponentError}
|
|
6474
|
+
*/
|
|
6475
|
+
setInputItem(slot: number, item?: ItemStack): void;
|
|
6476
|
+
/**
|
|
6477
|
+
* @remarks
|
|
6478
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
6479
|
+
*
|
|
6480
|
+
* @throws This function can throw errors.
|
|
6481
|
+
*
|
|
6482
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6483
|
+
*
|
|
6484
|
+
* {@link InvalidBlockComponentError}
|
|
6485
|
+
*
|
|
6486
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6487
|
+
*/
|
|
6488
|
+
setInputSlotEnabled(slot: number, enabled: boolean): void;
|
|
6489
|
+
}
|
|
6490
|
+
|
|
6491
|
+
/**
|
|
6492
|
+
* Represents a block that can play a record.
|
|
6493
|
+
*/
|
|
6494
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6495
|
+
export class BlockRecordPlayerComponent extends BlockComponent {
|
|
6496
|
+
private constructor();
|
|
6497
|
+
static readonly componentId = 'minecraft:record_player';
|
|
6498
|
+
/**
|
|
6499
|
+
* @remarks
|
|
6500
|
+
* Ejects the currently set record of this record-playing
|
|
6501
|
+
* block.
|
|
6502
|
+
*
|
|
6503
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
6504
|
+
*
|
|
6505
|
+
* @throws This function can throw errors.
|
|
6506
|
+
*/
|
|
6507
|
+
ejectRecord(): void;
|
|
6508
|
+
/**
|
|
6509
|
+
* @remarks
|
|
6510
|
+
* Gets the currently set record of this record-playing block.
|
|
6511
|
+
*
|
|
6512
|
+
* @throws This function can throw errors.
|
|
6513
|
+
*/
|
|
6514
|
+
getRecord(): ItemStack | undefined;
|
|
5659
6515
|
/**
|
|
5660
6516
|
* @remarks
|
|
5661
6517
|
* Returns true if the record-playing block is currently
|
|
@@ -6054,6 +6910,49 @@ export class BlockTypes {
|
|
|
6054
6910
|
static getAll(): BlockType[];
|
|
6055
6911
|
}
|
|
6056
6912
|
|
|
6913
|
+
/**
|
|
6914
|
+
* @beta
|
|
6915
|
+
* Represents the vibration properties of a block with a
|
|
6916
|
+
* 'minecraft:vibration_properties' component.
|
|
6917
|
+
*/
|
|
6918
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6919
|
+
export class BlockVibrationPropertiesComponent extends BlockComponent {
|
|
6920
|
+
private constructor();
|
|
6921
|
+
static readonly componentId = 'minecraft:vibration_properties';
|
|
6922
|
+
/**
|
|
6923
|
+
* @remarks
|
|
6924
|
+
* Gets whether this block can dampen vibrations. Vibrations
|
|
6925
|
+
* that occur on this block will be discarded by this block if
|
|
6926
|
+
* it can dampen vibrations. Returns false when the block does
|
|
6927
|
+
* not define a 'minecraft:vibration_properties' component.
|
|
6928
|
+
*
|
|
6929
|
+
* @returns
|
|
6930
|
+
* Whether this block can dampen vibrations.
|
|
6931
|
+
* @throws This function can throw errors.
|
|
6932
|
+
*
|
|
6933
|
+
* {@link LocationInUnloadedChunkError}
|
|
6934
|
+
*
|
|
6935
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
6936
|
+
*/
|
|
6937
|
+
getCanDampenVibrations(): boolean;
|
|
6938
|
+
/**
|
|
6939
|
+
* @remarks
|
|
6940
|
+
* Gets whether this block can occlude vibrations. Vibrations
|
|
6941
|
+
* that pass through this block will be discarded if this block
|
|
6942
|
+
* can occlude vibrations. Returns false when the block does
|
|
6943
|
+
* not define a 'minecraft:vibration_properties' component.
|
|
6944
|
+
*
|
|
6945
|
+
* @returns
|
|
6946
|
+
* Whether this block can occlude vibrations.
|
|
6947
|
+
* @throws This function can throw errors.
|
|
6948
|
+
*
|
|
6949
|
+
* {@link LocationInUnloadedChunkError}
|
|
6950
|
+
*
|
|
6951
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
6952
|
+
*/
|
|
6953
|
+
getCanOccludeVibrations(): boolean;
|
|
6954
|
+
}
|
|
6955
|
+
|
|
6057
6956
|
/**
|
|
6058
6957
|
* A BlockVolume is a simple interface to an object which
|
|
6059
6958
|
* represents a 3D rectangle of a given size (in blocks) at a
|
|
@@ -6149,6 +7048,15 @@ export class BlockVolumeBase {
|
|
|
6149
7048
|
*
|
|
6150
7049
|
*/
|
|
6151
7050
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
7051
|
+
/**
|
|
7052
|
+
* @beta
|
|
7053
|
+
* @remarks
|
|
7054
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
7055
|
+
* the validated min and max coordinates of the volume
|
|
7056
|
+
*
|
|
7057
|
+
* @throws This function can throw errors.
|
|
7058
|
+
*/
|
|
7059
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6152
7060
|
/**
|
|
6153
7061
|
* @remarks
|
|
6154
7062
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -6420,6 +7328,23 @@ export class Camera {
|
|
|
6420
7328
|
| CameraSetRotOptions
|
|
6421
7329
|
| CameraTargetOptions,
|
|
6422
7330
|
): void;
|
|
7331
|
+
/**
|
|
7332
|
+
* @beta
|
|
7333
|
+
* @remarks
|
|
7334
|
+
* Sets the current active camera with easing.
|
|
7335
|
+
*
|
|
7336
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7337
|
+
*
|
|
7338
|
+
* @param cameraPreset
|
|
7339
|
+
* Identifier of a camera preset file defined within JSON.
|
|
7340
|
+
* @param easeOptions
|
|
7341
|
+
* Options to ease the camera from the previous camera to the
|
|
7342
|
+
* current one.
|
|
7343
|
+
* @throws
|
|
7344
|
+
* Throws when easing to minecraft:first_person presets
|
|
7345
|
+
* currently without the experimental cameras toggle enabled.
|
|
7346
|
+
*/
|
|
7347
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
6423
7348
|
/**
|
|
6424
7349
|
* @remarks
|
|
6425
7350
|
* Sets the current active camera for the specified player and
|
|
@@ -6454,6 +7379,37 @@ export class Camera {
|
|
|
6454
7379
|
stopShaking(): void;
|
|
6455
7380
|
}
|
|
6456
7381
|
|
|
7382
|
+
/**
|
|
7383
|
+
* @beta
|
|
7384
|
+
* Loot item function that will try to copy the block entity
|
|
7385
|
+
* data from the destroyed block to the dropped item.
|
|
7386
|
+
*/
|
|
7387
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
7388
|
+
export class CarryOverBlockEntityDataFunction extends LootItemFunction {
|
|
7389
|
+
private constructor();
|
|
7390
|
+
/**
|
|
7391
|
+
* @remarks
|
|
7392
|
+
* If true, and if the block entity had dynamic_properties, the
|
|
7393
|
+
* function will copy the dynamic properties from the block
|
|
7394
|
+
* entity to the dropped item.
|
|
7395
|
+
*
|
|
7396
|
+
*/
|
|
7397
|
+
readonly dynamicProperties: boolean;
|
|
7398
|
+
/**
|
|
7399
|
+
* @remarks
|
|
7400
|
+
* If true, and if the block entity supports entity storage,
|
|
7401
|
+
* the function will copy the stored entities from the block
|
|
7402
|
+
* entity to the dropped item without releasing them. Placing
|
|
7403
|
+
* the item restores the stored entities if the placed block
|
|
7404
|
+
* supports entity storage. In loot table JSON, the optional
|
|
7405
|
+
* entity_storage Boolean field defaults to false and is
|
|
7406
|
+
* independent of dynamic_properties. Requires the Upcoming
|
|
7407
|
+
* Creator Features experiment.
|
|
7408
|
+
*
|
|
7409
|
+
*/
|
|
7410
|
+
readonly entityStorage: boolean;
|
|
7411
|
+
}
|
|
7412
|
+
|
|
6457
7413
|
/**
|
|
6458
7414
|
* CatmullRom spline creation.
|
|
6459
7415
|
*/
|
|
@@ -6468,6 +7424,165 @@ export class CatmullRomSpline {
|
|
|
6468
7424
|
controlPoints: Vector3[];
|
|
6469
7425
|
}
|
|
6470
7426
|
|
|
7427
|
+
/**
|
|
7428
|
+
* @beta
|
|
7429
|
+
* An event that fires as players enter chat messages.
|
|
7430
|
+
*/
|
|
7431
|
+
export class ChatSendAfterEvent {
|
|
7432
|
+
private constructor();
|
|
7433
|
+
/**
|
|
7434
|
+
* @remarks
|
|
7435
|
+
* Message that is being broadcast.
|
|
7436
|
+
*
|
|
7437
|
+
*/
|
|
7438
|
+
readonly message: string;
|
|
7439
|
+
/**
|
|
7440
|
+
* @remarks
|
|
7441
|
+
* Player that sent the chat message.
|
|
7442
|
+
*
|
|
7443
|
+
*/
|
|
7444
|
+
readonly sender: Player;
|
|
7445
|
+
/**
|
|
7446
|
+
* @remarks
|
|
7447
|
+
* Optional list of players that will receive this message. If
|
|
7448
|
+
* defined, this message is directly targeted to one or more
|
|
7449
|
+
* players (i.e., is not broadcast.)
|
|
7450
|
+
*
|
|
7451
|
+
*/
|
|
7452
|
+
readonly targets?: Player[];
|
|
7453
|
+
}
|
|
7454
|
+
|
|
7455
|
+
/**
|
|
7456
|
+
* @beta
|
|
7457
|
+
* Manages callbacks that are connected to chat messages being
|
|
7458
|
+
* sent.
|
|
7459
|
+
*/
|
|
7460
|
+
export class ChatSendAfterEventSignal {
|
|
7461
|
+
private constructor();
|
|
7462
|
+
/**
|
|
7463
|
+
* @remarks
|
|
7464
|
+
* Adds a callback that will be called when new chat messages
|
|
7465
|
+
* are sent.
|
|
7466
|
+
*
|
|
7467
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7468
|
+
*
|
|
7469
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
7470
|
+
*
|
|
7471
|
+
*/
|
|
7472
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
7473
|
+
/**
|
|
7474
|
+
* @remarks
|
|
7475
|
+
* Removes a callback from being called when new chat messages
|
|
7476
|
+
* are sent.
|
|
7477
|
+
*
|
|
7478
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7479
|
+
*
|
|
7480
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
7481
|
+
*
|
|
7482
|
+
*/
|
|
7483
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
7484
|
+
}
|
|
7485
|
+
|
|
7486
|
+
/**
|
|
7487
|
+
* @beta
|
|
7488
|
+
* An event that fires as players enter chat messages.
|
|
7489
|
+
*/
|
|
7490
|
+
export class ChatSendBeforeEvent {
|
|
7491
|
+
private constructor();
|
|
7492
|
+
/**
|
|
7493
|
+
* @remarks
|
|
7494
|
+
* If set to true in a beforeChat event handler, this message
|
|
7495
|
+
* is not broadcast out.
|
|
7496
|
+
*
|
|
7497
|
+
*/
|
|
7498
|
+
cancel: boolean;
|
|
7499
|
+
/**
|
|
7500
|
+
* @remarks
|
|
7501
|
+
* Message that is being broadcast.
|
|
7502
|
+
*
|
|
7503
|
+
*/
|
|
7504
|
+
readonly message: string;
|
|
7505
|
+
/**
|
|
7506
|
+
* @remarks
|
|
7507
|
+
* Player that sent the chat message.
|
|
7508
|
+
*
|
|
7509
|
+
*/
|
|
7510
|
+
readonly sender: Player;
|
|
7511
|
+
/**
|
|
7512
|
+
* @remarks
|
|
7513
|
+
* Optional list of players that will receive this message. If
|
|
7514
|
+
* defined, this message is directly targeted to one or more
|
|
7515
|
+
* players (i.e., is not broadcast). This list can be modified
|
|
7516
|
+
* to change the message recipients.
|
|
7517
|
+
*
|
|
7518
|
+
*/
|
|
7519
|
+
targets?: Player[];
|
|
7520
|
+
}
|
|
7521
|
+
|
|
7522
|
+
/**
|
|
7523
|
+
* @beta
|
|
7524
|
+
* Manages callbacks that are connected to an event that fires
|
|
7525
|
+
* before chat messages are sent.
|
|
7526
|
+
* @example customCommand.ts
|
|
7527
|
+
* ```typescript
|
|
7528
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
7529
|
+
*
|
|
7530
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
7531
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
7532
|
+
* if (eventData.message.includes('cancel')) {
|
|
7533
|
+
* // Cancel event if the message contains "cancel"
|
|
7534
|
+
* eventData.cancel = true;
|
|
7535
|
+
* } else {
|
|
7536
|
+
* const args = eventData.message.split(' ');
|
|
7537
|
+
*
|
|
7538
|
+
* if (args.length > 0) {
|
|
7539
|
+
* switch (args[0].toLowerCase()) {
|
|
7540
|
+
* case 'echo':
|
|
7541
|
+
* // Send a modified version of chat message
|
|
7542
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
7543
|
+
* break;
|
|
7544
|
+
* case 'help':
|
|
7545
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
7546
|
+
* break;
|
|
7547
|
+
* }
|
|
7548
|
+
* }
|
|
7549
|
+
* }
|
|
7550
|
+
* });
|
|
7551
|
+
* }
|
|
7552
|
+
* ```
|
|
7553
|
+
*/
|
|
7554
|
+
export class ChatSendBeforeEventSignal {
|
|
7555
|
+
private constructor();
|
|
7556
|
+
/**
|
|
7557
|
+
* @remarks
|
|
7558
|
+
* Adds a callback that will be called before new chat messages
|
|
7559
|
+
* are sent.
|
|
7560
|
+
*
|
|
7561
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7562
|
+
*
|
|
7563
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
7564
|
+
*
|
|
7565
|
+
* @param callback
|
|
7566
|
+
* This closure is called with restricted-execution privilege.
|
|
7567
|
+
* @returns
|
|
7568
|
+
* Closure that is called with restricted-execution privilege.
|
|
7569
|
+
*/
|
|
7570
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
7571
|
+
/**
|
|
7572
|
+
* @remarks
|
|
7573
|
+
* Removes a callback from being called before new chat
|
|
7574
|
+
* messages are sent.
|
|
7575
|
+
*
|
|
7576
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
7577
|
+
*
|
|
7578
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
7579
|
+
*
|
|
7580
|
+
* @param callback
|
|
7581
|
+
* This closure is called with restricted-execution privilege.
|
|
7582
|
+
*/
|
|
7583
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
7584
|
+
}
|
|
7585
|
+
|
|
6471
7586
|
/**
|
|
6472
7587
|
* Contains the device information for a client instance.
|
|
6473
7588
|
*/
|
|
@@ -6676,7 +7791,9 @@ export class Container {
|
|
|
6676
7791
|
*
|
|
6677
7792
|
* @param itemStack
|
|
6678
7793
|
* The stack of items to add.
|
|
6679
|
-
* @throws
|
|
7794
|
+
* @throws
|
|
7795
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7796
|
+
* limit but will instead add items up to the weight limit.
|
|
6680
7797
|
*
|
|
6681
7798
|
* {@link ContainerRulesError}
|
|
6682
7799
|
*
|
|
@@ -6914,6 +8031,8 @@ export class Container {
|
|
|
6914
8031
|
* @throws
|
|
6915
8032
|
* Throws if either this container or `toContainer` are invalid
|
|
6916
8033
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
8034
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
8035
|
+
* limit but will instead add items up to the weight limit.
|
|
6917
8036
|
*
|
|
6918
8037
|
* {@link ContainerRulesError}
|
|
6919
8038
|
*
|
|
@@ -7544,6 +8663,15 @@ export class Dimension {
|
|
|
7544
8663
|
*
|
|
7545
8664
|
*/
|
|
7546
8665
|
readonly localizationKey: string;
|
|
8666
|
+
/**
|
|
8667
|
+
* @beta
|
|
8668
|
+
* @remarks
|
|
8669
|
+
* Provides access to point-of-interest (POI) managers for this
|
|
8670
|
+
* dimension. This property is available only when the POI
|
|
8671
|
+
* experiment is enabled.
|
|
8672
|
+
*
|
|
8673
|
+
*/
|
|
8674
|
+
readonly poiManager: PoiManager;
|
|
7547
8675
|
/**
|
|
7548
8676
|
* @remarks
|
|
7549
8677
|
* Calculates the location of the closest biome of a particular
|
|
@@ -7847,10 +8975,14 @@ export class Dimension {
|
|
|
7847
8975
|
getBlockFromRay(location: Vector3, direction: Vector3, options?: BlockRaycastOptions): BlockRaycastHit | undefined;
|
|
7848
8976
|
/**
|
|
7849
8977
|
* @remarks
|
|
7850
|
-
* Gets all the blocks in a volume that satisfy the
|
|
8978
|
+
* Gets all the blocks in a volume that satisfy the block query
|
|
8979
|
+
* options.
|
|
7851
8980
|
*
|
|
7852
8981
|
* @param volume
|
|
7853
8982
|
* Volume of blocks that will be checked.
|
|
8983
|
+
* @param options
|
|
8984
|
+
* Block query options including filter criteria and optional
|
|
8985
|
+
* closest/farthest distance sorting from a location.
|
|
7854
8986
|
* @param allowUnloadedChunks
|
|
7855
8987
|
* If set to true will suppress the UnloadedChunksError if some
|
|
7856
8988
|
* or all of the block volume is outside of the loaded chunks.
|
|
@@ -7859,7 +8991,7 @@ export class Dimension {
|
|
|
7859
8991
|
* Defaults to: false
|
|
7860
8992
|
* @returns
|
|
7861
8993
|
* Returns the ListBlockVolume that contains all the block
|
|
7862
|
-
* locations that satisfied the block
|
|
8994
|
+
* locations that satisfied the block query options.
|
|
7863
8995
|
* @throws This function can throw errors.
|
|
7864
8996
|
*
|
|
7865
8997
|
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
@@ -7984,6 +9116,26 @@ export class Dimension {
|
|
|
7984
9116
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7985
9117
|
*/
|
|
7986
9118
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
9119
|
+
/**
|
|
9120
|
+
* @beta
|
|
9121
|
+
* @remarks
|
|
9122
|
+
* Returns a vector of generated structures that contain the
|
|
9123
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
9124
|
+
* The vector will be empty if no structures are found.
|
|
9125
|
+
*
|
|
9126
|
+
* @param location
|
|
9127
|
+
* Location at which to check for structures.
|
|
9128
|
+
* @throws
|
|
9129
|
+
* An error will be thrown if the location is out of world
|
|
9130
|
+
* bounds.
|
|
9131
|
+
* An error will be thrown if the location is in an unloaded
|
|
9132
|
+
* chunk.
|
|
9133
|
+
*
|
|
9134
|
+
* {@link LocationInUnloadedChunkError}
|
|
9135
|
+
*
|
|
9136
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
9137
|
+
*/
|
|
9138
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
7987
9139
|
/**
|
|
7988
9140
|
* @remarks
|
|
7989
9141
|
* Returns the total brightness level of light shining on a
|
|
@@ -8045,6 +9197,16 @@ export class Dimension {
|
|
|
8045
9197
|
* @throws This function can throw errors.
|
|
8046
9198
|
*/
|
|
8047
9199
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
9200
|
+
/**
|
|
9201
|
+
* @beta
|
|
9202
|
+
* @remarks
|
|
9203
|
+
* Returns the current weather.
|
|
9204
|
+
*
|
|
9205
|
+
* @returns
|
|
9206
|
+
* Returns a WeatherType that explains the broad category of
|
|
9207
|
+
* weather that is currently going on.
|
|
9208
|
+
*/
|
|
9209
|
+
getWeather(): WeatherType;
|
|
8048
9210
|
/**
|
|
8049
9211
|
* @remarks
|
|
8050
9212
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -8290,7 +9452,11 @@ export class Dimension {
|
|
|
8290
9452
|
* }
|
|
8291
9453
|
* ```
|
|
8292
9454
|
*/
|
|
8293
|
-
spawnEntity
|
|
9455
|
+
spawnEntity<T = never>(
|
|
9456
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
9457
|
+
location: Vector3,
|
|
9458
|
+
options?: SpawnEntityOptions,
|
|
9459
|
+
): Entity;
|
|
8294
9460
|
/**
|
|
8295
9461
|
* @remarks
|
|
8296
9462
|
* Creates a new item stack as an entity at the specified
|
|
@@ -8405,6 +9571,26 @@ export class Dimension {
|
|
|
8405
9571
|
* {@link LocationOutOfWorldBoundariesError}
|
|
8406
9572
|
*/
|
|
8407
9573
|
spawnXp(location: Vector3, amount: number): void;
|
|
9574
|
+
/**
|
|
9575
|
+
* @beta
|
|
9576
|
+
* @remarks
|
|
9577
|
+
* Stops all sounds from playing for all players.
|
|
9578
|
+
*
|
|
9579
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
9580
|
+
*
|
|
9581
|
+
*/
|
|
9582
|
+
stopAllSounds(): void;
|
|
9583
|
+
/**
|
|
9584
|
+
* @beta
|
|
9585
|
+
* @remarks
|
|
9586
|
+
* Stops a sound from playing for all players.
|
|
9587
|
+
*
|
|
9588
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
9589
|
+
*
|
|
9590
|
+
* @param soundId
|
|
9591
|
+
* Identifier of the sound.
|
|
9592
|
+
*/
|
|
9593
|
+
stopSound(soundId: string): void;
|
|
8408
9594
|
}
|
|
8409
9595
|
|
|
8410
9596
|
/**
|
|
@@ -8889,6 +10075,16 @@ export class Entity {
|
|
|
8889
10075
|
* {@link InvalidEntityError}
|
|
8890
10076
|
*/
|
|
8891
10077
|
readonly isOnGround: boolean;
|
|
10078
|
+
/**
|
|
10079
|
+
* @beta
|
|
10080
|
+
* @remarks
|
|
10081
|
+
* Returns true if the entity is a passenger of a block.
|
|
10082
|
+
*
|
|
10083
|
+
* @throws This property can throw when used.
|
|
10084
|
+
*
|
|
10085
|
+
* {@link InvalidEntityError}
|
|
10086
|
+
*/
|
|
10087
|
+
readonly isPassengerOfBlock: boolean;
|
|
8892
10088
|
/**
|
|
8893
10089
|
* @remarks
|
|
8894
10090
|
* If true, the entity is currently sleeping.
|
|
@@ -8988,6 +10184,18 @@ export class Entity {
|
|
|
8988
10184
|
*
|
|
8989
10185
|
*/
|
|
8990
10186
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
10187
|
+
/**
|
|
10188
|
+
* @beta
|
|
10189
|
+
* @remarks
|
|
10190
|
+
* Retrieves or sets an entity that is used as the target of
|
|
10191
|
+
* AI-related behaviors, like attacking. If the entity
|
|
10192
|
+
* currently has no target returns undefined.
|
|
10193
|
+
*
|
|
10194
|
+
* @throws This property can throw when used.
|
|
10195
|
+
*
|
|
10196
|
+
* {@link InvalidEntityError}
|
|
10197
|
+
*/
|
|
10198
|
+
readonly target?: Entity;
|
|
8991
10199
|
/**
|
|
8992
10200
|
* @remarks
|
|
8993
10201
|
* Identifier of the type of the entity - for example,
|
|
@@ -9917,6 +11125,47 @@ export class Entity {
|
|
|
9917
11125
|
* {@link InvalidEntityError}
|
|
9918
11126
|
*/
|
|
9919
11127
|
setRotation(rotation: Vector2): void;
|
|
11128
|
+
/**
|
|
11129
|
+
* @beta
|
|
11130
|
+
* @remarks
|
|
11131
|
+
* Starts the entity as being a passenger of a block with the
|
|
11132
|
+
* specified configuration.
|
|
11133
|
+
*
|
|
11134
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
11135
|
+
*
|
|
11136
|
+
* @param blockPosition
|
|
11137
|
+
* The integer block position to ride.
|
|
11138
|
+
* @param offset
|
|
11139
|
+
* The offset from the block position.
|
|
11140
|
+
* @param rotation
|
|
11141
|
+
* The rotation of the passenger on the block.
|
|
11142
|
+
* @param rotationLimit
|
|
11143
|
+
* The maximum rotation range of the passenger on the block.
|
|
11144
|
+
* @param emote
|
|
11145
|
+
* The pose of the passenger on the block.
|
|
11146
|
+
* @throws This function can throw errors.
|
|
11147
|
+
*
|
|
11148
|
+
* {@link InvalidEntityError}
|
|
11149
|
+
*/
|
|
11150
|
+
startPassengerOfBlock(
|
|
11151
|
+
blockPosition: Vector3,
|
|
11152
|
+
offset: Vector3,
|
|
11153
|
+
rotation: number,
|
|
11154
|
+
rotationLimit: number,
|
|
11155
|
+
emote: PassengerOfBlockEmoteType,
|
|
11156
|
+
): void;
|
|
11157
|
+
/**
|
|
11158
|
+
* @beta
|
|
11159
|
+
* @remarks
|
|
11160
|
+
* Stops the entity from being a passenger of a block.
|
|
11161
|
+
*
|
|
11162
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
11163
|
+
*
|
|
11164
|
+
* @throws This function can throw errors.
|
|
11165
|
+
*
|
|
11166
|
+
* {@link InvalidEntityError}
|
|
11167
|
+
*/
|
|
11168
|
+
stopPassengerOfBlock(): void;
|
|
9920
11169
|
/**
|
|
9921
11170
|
* @remarks
|
|
9922
11171
|
* Teleports the selected entity to a new location
|
|
@@ -10232,6 +11481,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
10232
11481
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10233
11482
|
export class EntityBreathableComponent extends EntityComponent {
|
|
10234
11483
|
private constructor();
|
|
11484
|
+
/**
|
|
11485
|
+
* @beta
|
|
11486
|
+
* @remarks
|
|
11487
|
+
* The current air supply of the entity.
|
|
11488
|
+
*
|
|
11489
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
11490
|
+
*
|
|
11491
|
+
* @throws
|
|
11492
|
+
* Will throw an error if the air supply is out of bounds
|
|
11493
|
+
* [suffocationTime, maxAirSupply].
|
|
11494
|
+
*/
|
|
11495
|
+
airSupply: number;
|
|
10235
11496
|
/**
|
|
10236
11497
|
* @remarks
|
|
10237
11498
|
* If true, this entity can breathe in air.
|
|
@@ -10260,6 +11521,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
10260
11521
|
* @throws This property can throw when used.
|
|
10261
11522
|
*/
|
|
10262
11523
|
readonly breathesWater: boolean;
|
|
11524
|
+
/**
|
|
11525
|
+
* @beta
|
|
11526
|
+
* @remarks
|
|
11527
|
+
* If true, the entity is able to breathe.
|
|
11528
|
+
*
|
|
11529
|
+
* @throws This property can throw when used.
|
|
11530
|
+
*/
|
|
11531
|
+
readonly canBreathe: boolean;
|
|
10263
11532
|
/**
|
|
10264
11533
|
* @remarks
|
|
10265
11534
|
* If true, this entity will have visible bubbles while in
|
|
@@ -12232,6 +13501,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
12232
13501
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
12233
13502
|
}
|
|
12234
13503
|
|
|
13504
|
+
/**
|
|
13505
|
+
* @beta
|
|
13506
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
13507
|
+
* name, and dialogue interactions.
|
|
13508
|
+
*/
|
|
13509
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13510
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
13511
|
+
private constructor();
|
|
13512
|
+
/**
|
|
13513
|
+
* @remarks
|
|
13514
|
+
* The DialogueScene that is opened when players first interact
|
|
13515
|
+
* with the NPC.
|
|
13516
|
+
*
|
|
13517
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
13518
|
+
*
|
|
13519
|
+
*/
|
|
13520
|
+
defaultScene: string;
|
|
13521
|
+
/**
|
|
13522
|
+
* @remarks
|
|
13523
|
+
* The name of the NPC as it is displayed to players.
|
|
13524
|
+
*
|
|
13525
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
13526
|
+
*
|
|
13527
|
+
*/
|
|
13528
|
+
name: string;
|
|
13529
|
+
/**
|
|
13530
|
+
* @remarks
|
|
13531
|
+
* The index of the skin the NPC will use.
|
|
13532
|
+
*
|
|
13533
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
13534
|
+
*
|
|
13535
|
+
*/
|
|
13536
|
+
skinIndex: number;
|
|
13537
|
+
static readonly componentId = 'minecraft:npc';
|
|
13538
|
+
}
|
|
13539
|
+
|
|
12235
13540
|
/**
|
|
12236
13541
|
* When present on an entity, this entity is on fire.
|
|
12237
13542
|
* @example setOnFire.ts
|
|
@@ -13290,7 +14595,7 @@ export class EntityTypes {
|
|
|
13290
14595
|
* Retrieves an entity type using a string-based identifier.
|
|
13291
14596
|
*
|
|
13292
14597
|
*/
|
|
13293
|
-
static get(identifier:
|
|
14598
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
13294
14599
|
/**
|
|
13295
14600
|
* @remarks
|
|
13296
14601
|
* Retrieves a set of all entity types within this world.
|
|
@@ -14015,6 +15320,13 @@ export class GameRules {
|
|
|
14015
15320
|
*
|
|
14016
15321
|
*/
|
|
14017
15322
|
playersSleepingPercentage: number;
|
|
15323
|
+
/**
|
|
15324
|
+
* @beta
|
|
15325
|
+
* @remarks
|
|
15326
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
15327
|
+
*
|
|
15328
|
+
*/
|
|
15329
|
+
playerWaypoints: PlayerWaypointsMode;
|
|
14018
15330
|
/**
|
|
14019
15331
|
* @remarks
|
|
14020
15332
|
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
@@ -14224,6 +15536,137 @@ export class ItemBlockDynamicPropertiesComponent extends ItemComponent {
|
|
|
14224
15536
|
totalByteCount(): number;
|
|
14225
15537
|
}
|
|
14226
15538
|
|
|
15539
|
+
/**
|
|
15540
|
+
* @beta
|
|
15541
|
+
* Stores serialized non-player mobs on an item stack. Each
|
|
15542
|
+
* calling behavior pack can only access its manifest UUID
|
|
15543
|
+
* bucket. All buckets share a four-entity limit. Available on
|
|
15544
|
+
* item stacks even when empty. Destroying the item discards
|
|
15545
|
+
* its storage without spawning entities. Data is compatible
|
|
15546
|
+
* with entity-storage block carry-over and placement.
|
|
15547
|
+
*/
|
|
15548
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15549
|
+
export class ItemBlockEntityStorageComponent extends ItemComponent {
|
|
15550
|
+
private constructor();
|
|
15551
|
+
static readonly componentId = 'minecraft:block_entity_storage';
|
|
15552
|
+
/**
|
|
15553
|
+
* @remarks
|
|
15554
|
+
* Inspects the serialized entities in the calling pack's
|
|
15555
|
+
* manifest UUID bucket without loading or spawning them.
|
|
15556
|
+
*
|
|
15557
|
+
* @returns
|
|
15558
|
+
* Stored entity IDs and definition IDs, or an empty array for
|
|
15559
|
+
* an empty bucket.
|
|
15560
|
+
* @throws
|
|
15561
|
+
* Throws if the item is invalid or its entity-storage format
|
|
15562
|
+
* is unsupported.
|
|
15563
|
+
*
|
|
15564
|
+
* {@link Error}
|
|
15565
|
+
*
|
|
15566
|
+
* {@link InvalidItemStackError}
|
|
15567
|
+
*/
|
|
15568
|
+
getEntities(): BlockEntityStorageInfo[];
|
|
15569
|
+
/**
|
|
15570
|
+
* @remarks
|
|
15571
|
+
* Releases a stored mob at the supplied dimension and world
|
|
15572
|
+
* position. Does not require a block target. The serialized
|
|
15573
|
+
* position is replaced before the actor is loaded. Removes the
|
|
15574
|
+
* entry from this item after spawning it.
|
|
15575
|
+
*
|
|
15576
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
15577
|
+
*
|
|
15578
|
+
* @param entityId
|
|
15579
|
+
* A stored entity ID in the calling pack's bucket.
|
|
15580
|
+
* @param location
|
|
15581
|
+
* The target DimensionLocation. Must be finite, within world
|
|
15582
|
+
* bounds, and in a loaded, ticking chunk.
|
|
15583
|
+
* @returns
|
|
15584
|
+
* The spawned entity.
|
|
15585
|
+
* @throws
|
|
15586
|
+
* Throws for an invalid item, ID, dimension, or location, a
|
|
15587
|
+
* missing entity, or a load or spawn failure. Failed releases
|
|
15588
|
+
* preserve serialized storage.
|
|
15589
|
+
*
|
|
15590
|
+
* {@link Error}
|
|
15591
|
+
*
|
|
15592
|
+
* {@link InvalidItemStackError}
|
|
15593
|
+
*
|
|
15594
|
+
* {@link LocationInUnloadedChunkError}
|
|
15595
|
+
*
|
|
15596
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
15597
|
+
*/
|
|
15598
|
+
release(entityId: string, location: DimensionLocation): Entity;
|
|
15599
|
+
/**
|
|
15600
|
+
* @remarks
|
|
15601
|
+
* Returns the number of serialized entities in the calling
|
|
15602
|
+
* pack's manifest UUID bucket.
|
|
15603
|
+
*
|
|
15604
|
+
* @returns
|
|
15605
|
+
* The number of entities in this pack's bucket, or zero if
|
|
15606
|
+
* empty.
|
|
15607
|
+
* @throws
|
|
15608
|
+
* Throws if the item is invalid or its entity-storage format
|
|
15609
|
+
* is unsupported.
|
|
15610
|
+
*
|
|
15611
|
+
* {@link Error}
|
|
15612
|
+
*
|
|
15613
|
+
* {@link InvalidItemStackError}
|
|
15614
|
+
*/
|
|
15615
|
+
size(): number;
|
|
15616
|
+
/**
|
|
15617
|
+
* @remarks
|
|
15618
|
+
* Serializes and despawns a non-player mob into the calling
|
|
15619
|
+
* pack's item storage. Mounted entities and entities with
|
|
15620
|
+
* passengers cannot be stored.
|
|
15621
|
+
*
|
|
15622
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
15623
|
+
*
|
|
15624
|
+
* @param entity
|
|
15625
|
+
* The live mob to store.
|
|
15626
|
+
* @returns
|
|
15627
|
+
* The stored entity ID, used for inspection, release, or
|
|
15628
|
+
* transfer.
|
|
15629
|
+
* @throws
|
|
15630
|
+
* Throws if the item or entity is invalid, storage is full,
|
|
15631
|
+
* the entity is already stored, serialization fails, or the
|
|
15632
|
+
* entity is not allowed. Rejected entities remain in the
|
|
15633
|
+
* world.
|
|
15634
|
+
*
|
|
15635
|
+
* {@link Error}
|
|
15636
|
+
*
|
|
15637
|
+
* {@link InvalidItemStackError}
|
|
15638
|
+
*/
|
|
15639
|
+
store(entity: Entity): string;
|
|
15640
|
+
/**
|
|
15641
|
+
* @remarks
|
|
15642
|
+
* Moves serialized ownership from the calling pack's item
|
|
15643
|
+
* bucket into the same bucket of a block's entity-storage
|
|
15644
|
+
* without loading or spawning the entity. The target can be in
|
|
15645
|
+
* any dimension and must have entity storage.
|
|
15646
|
+
*
|
|
15647
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
15648
|
+
*
|
|
15649
|
+
* @param entityId
|
|
15650
|
+
* A stored entity ID in the calling pack's bucket.
|
|
15651
|
+
* @param targetBlock
|
|
15652
|
+
* A loaded block with an entity-storage component and
|
|
15653
|
+
* available capacity.
|
|
15654
|
+
* @throws
|
|
15655
|
+
* Throws for an invalid item, ID, or target, a missing entity,
|
|
15656
|
+
* full target storage, or an ID already stored at the target.
|
|
15657
|
+
* Failure preserves both owners.
|
|
15658
|
+
*
|
|
15659
|
+
* {@link Error}
|
|
15660
|
+
*
|
|
15661
|
+
* {@link InvalidItemStackError}
|
|
15662
|
+
*
|
|
15663
|
+
* {@link LocationInUnloadedChunkError}
|
|
15664
|
+
*
|
|
15665
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
15666
|
+
*/
|
|
15667
|
+
transfer(entityId: string, targetBlock: Block): void;
|
|
15668
|
+
}
|
|
15669
|
+
|
|
14227
15670
|
/**
|
|
14228
15671
|
* When present on an item, this item is a book item. Can
|
|
14229
15672
|
* access and modify the contents of the book and sign it.
|
|
@@ -16932,6 +18375,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
16932
18375
|
readonly itemTagsNone: string[];
|
|
16933
18376
|
}
|
|
16934
18377
|
|
|
18378
|
+
/**
|
|
18379
|
+
* @beta
|
|
18380
|
+
* A specific currently-internal event used for passing
|
|
18381
|
+
* messages from client to server.
|
|
18382
|
+
*/
|
|
18383
|
+
export class MessageReceiveAfterEvent {
|
|
18384
|
+
private constructor();
|
|
18385
|
+
/**
|
|
18386
|
+
* @remarks
|
|
18387
|
+
* The message identifier.
|
|
18388
|
+
*
|
|
18389
|
+
*/
|
|
18390
|
+
readonly id: string;
|
|
18391
|
+
/**
|
|
18392
|
+
* @remarks
|
|
18393
|
+
* The message.
|
|
18394
|
+
*
|
|
18395
|
+
*/
|
|
18396
|
+
readonly message: string;
|
|
18397
|
+
/**
|
|
18398
|
+
* @remarks
|
|
18399
|
+
* The player who sent the message.
|
|
18400
|
+
*
|
|
18401
|
+
*/
|
|
18402
|
+
readonly player: Player;
|
|
18403
|
+
}
|
|
18404
|
+
|
|
16935
18405
|
/**
|
|
16936
18406
|
* Contains a set of additional variable values for further
|
|
16937
18407
|
* defining how rendering and animations function.
|
|
@@ -17000,6 +18470,49 @@ export class MolangVariableMap {
|
|
|
17000
18470
|
setVector3(variableName: string, vector: Vector3): void;
|
|
17001
18471
|
}
|
|
17002
18472
|
|
|
18473
|
+
/**
|
|
18474
|
+
* @beta
|
|
18475
|
+
* Pack setting name and value that changed.
|
|
18476
|
+
*/
|
|
18477
|
+
export class PackSettingChangeAfterEvent {
|
|
18478
|
+
private constructor();
|
|
18479
|
+
/**
|
|
18480
|
+
* @remarks
|
|
18481
|
+
* The name of the setting.
|
|
18482
|
+
*
|
|
18483
|
+
*/
|
|
18484
|
+
readonly settingName: string;
|
|
18485
|
+
/**
|
|
18486
|
+
* @remarks
|
|
18487
|
+
* The value of the setting.
|
|
18488
|
+
*
|
|
18489
|
+
*/
|
|
18490
|
+
readonly settingValue: string[] | boolean | number | string;
|
|
18491
|
+
}
|
|
18492
|
+
|
|
18493
|
+
/**
|
|
18494
|
+
* @beta
|
|
18495
|
+
*/
|
|
18496
|
+
export class PackSettingChangeAfterEventSignal {
|
|
18497
|
+
private constructor();
|
|
18498
|
+
/**
|
|
18499
|
+
* @remarks
|
|
18500
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
18501
|
+
*
|
|
18502
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
18503
|
+
*
|
|
18504
|
+
*/
|
|
18505
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
18506
|
+
/**
|
|
18507
|
+
* @remarks
|
|
18508
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
18509
|
+
*
|
|
18510
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
18511
|
+
*
|
|
18512
|
+
*/
|
|
18513
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
18514
|
+
}
|
|
18515
|
+
|
|
17003
18516
|
/**
|
|
17004
18517
|
* Loot item condition that checks whether the looting entity
|
|
17005
18518
|
* is currently a passenger of a specific type of entity.
|
|
@@ -17168,34 +18681,91 @@ export class Player extends Entity {
|
|
|
17168
18681
|
*/
|
|
17169
18682
|
readonly camera: Camera;
|
|
17170
18683
|
/**
|
|
18684
|
+
* @beta
|
|
17171
18685
|
* @remarks
|
|
17172
|
-
*
|
|
18686
|
+
* The player's chat display name, composed from
|
|
18687
|
+
* {@link Player.chatNamePrefix} + {@link Player.name} +
|
|
18688
|
+
* {@link Player.chatNameSuffix}. This is the name shown as the
|
|
18689
|
+
* author of chat messages sent by this player. To change the
|
|
18690
|
+
* name shown above the player's head, use
|
|
18691
|
+
* {@link Entity.nameTag}.
|
|
17173
18692
|
*
|
|
17174
18693
|
* @throws This property can throw when used.
|
|
18694
|
+
*
|
|
18695
|
+
* {@link InvalidEntityError}
|
|
17175
18696
|
*/
|
|
17176
|
-
readonly
|
|
18697
|
+
readonly chatDisplayName: string;
|
|
17177
18698
|
/**
|
|
18699
|
+
* @beta
|
|
17178
18700
|
* @remarks
|
|
18701
|
+
* An optional string that, when set, is prepended to the text
|
|
18702
|
+
* of chat messages sent by this player. Useful for applying
|
|
18703
|
+
* formatting or color codes to a player's messages (e.g., '§a'
|
|
18704
|
+
* to make their messages green). Does not affect the player's
|
|
18705
|
+
* name display - use {@link Player.chatNamePrefix} for the
|
|
18706
|
+
* name shown in chat, or {@link Entity.nameTag} for the name
|
|
18707
|
+
* above the player's head. Set to undefined to clear.
|
|
18708
|
+
*
|
|
17179
18709
|
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
17180
18710
|
*
|
|
17181
18711
|
*/
|
|
17182
|
-
|
|
18712
|
+
chatMessagePrefix?: string;
|
|
17183
18713
|
/**
|
|
18714
|
+
* @beta
|
|
17184
18715
|
* @remarks
|
|
17185
|
-
*
|
|
17186
|
-
*
|
|
18716
|
+
* An optional string that, when set, is prepended to the
|
|
18717
|
+
* player's name in chat messages. Does not affect the name tag
|
|
18718
|
+
* above the player's head or the player list - use
|
|
18719
|
+
* {@link Entity.nameTag} for that. To prefix the message text
|
|
18720
|
+
* itself, use {@link Player.chatMessagePrefix}. Set to
|
|
18721
|
+
* undefined to clear.
|
|
18722
|
+
*
|
|
18723
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
17187
18724
|
*
|
|
17188
18725
|
*/
|
|
17189
|
-
|
|
18726
|
+
chatNamePrefix?: string;
|
|
17190
18727
|
/**
|
|
18728
|
+
* @beta
|
|
17191
18729
|
* @remarks
|
|
17192
|
-
*
|
|
17193
|
-
*
|
|
17194
|
-
*
|
|
18730
|
+
* An optional string that, when set, is appended to the
|
|
18731
|
+
* player's name in chat messages. Does not affect the name tag
|
|
18732
|
+
* above the player's head or the player list - use
|
|
18733
|
+
* {@link Entity.nameTag} for that. See also
|
|
18734
|
+
* {@link Player.chatNamePrefix}. Set to undefined to clear.
|
|
17195
18735
|
*
|
|
17196
|
-
* @
|
|
18736
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
17197
18737
|
*
|
|
17198
|
-
|
|
18738
|
+
*/
|
|
18739
|
+
chatNameSuffix?: string;
|
|
18740
|
+
/**
|
|
18741
|
+
* @remarks
|
|
18742
|
+
* Contains the player's device information.
|
|
18743
|
+
*
|
|
18744
|
+
* @throws This property can throw when used.
|
|
18745
|
+
*/
|
|
18746
|
+
readonly clientSystemInfo: ClientSystemInfo;
|
|
18747
|
+
/**
|
|
18748
|
+
* @remarks
|
|
18749
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
18750
|
+
*
|
|
18751
|
+
*/
|
|
18752
|
+
commandPermissionLevel: CommandPermissionLevel;
|
|
18753
|
+
/**
|
|
18754
|
+
* @remarks
|
|
18755
|
+
* Contains methods for manipulating the render distance fog
|
|
18756
|
+
* settings of a Player.
|
|
18757
|
+
*
|
|
18758
|
+
*/
|
|
18759
|
+
readonly fogSettings: FogSettings;
|
|
18760
|
+
/**
|
|
18761
|
+
* @remarks
|
|
18762
|
+
* Gets the current graphics mode of the player's client. This
|
|
18763
|
+
* can be changed in the Video section of the settings menu
|
|
18764
|
+
* based on what hardware is available.
|
|
18765
|
+
*
|
|
18766
|
+
* @throws This property can throw when used.
|
|
18767
|
+
*
|
|
18768
|
+
* {@link InvalidEntityError}
|
|
17199
18769
|
*/
|
|
17200
18770
|
readonly graphicsMode: GraphicsMode;
|
|
17201
18771
|
/**
|
|
@@ -17270,6 +18840,19 @@ export class Player extends Entity {
|
|
|
17270
18840
|
* @throws This property can throw when used.
|
|
17271
18841
|
*/
|
|
17272
18842
|
readonly onScreenDisplay: ScreenDisplay;
|
|
18843
|
+
/**
|
|
18844
|
+
* @beta
|
|
18845
|
+
* @remarks
|
|
18846
|
+
* An identifier that can be used to identify a player across
|
|
18847
|
+
* sessions.
|
|
18848
|
+
*
|
|
18849
|
+
* @throws This property can throw when used.
|
|
18850
|
+
*
|
|
18851
|
+
* {@link minecraftcommon.EngineError}
|
|
18852
|
+
*
|
|
18853
|
+
* {@link InvalidEntityError}
|
|
18854
|
+
*/
|
|
18855
|
+
readonly persistentId: string;
|
|
17273
18856
|
/**
|
|
17274
18857
|
* @throws This property can throw when used.
|
|
17275
18858
|
*
|
|
@@ -17343,6 +18926,20 @@ export class Player extends Entity {
|
|
|
17343
18926
|
* Throws if the Entity or Entity ID is invalid.
|
|
17344
18927
|
*/
|
|
17345
18928
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
18929
|
+
/**
|
|
18930
|
+
* @beta
|
|
18931
|
+
* @remarks
|
|
18932
|
+
* Eats an item, providing the item's hunger and saturation
|
|
18933
|
+
* effects to the player. Can only be used on food items.
|
|
18934
|
+
*
|
|
18935
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
18936
|
+
*
|
|
18937
|
+
* @param itemStack
|
|
18938
|
+
* The item to eat.
|
|
18939
|
+
* @throws
|
|
18940
|
+
* Throws if the item is not a food item.
|
|
18941
|
+
*/
|
|
18942
|
+
eatItem(itemStack: ItemStack): void;
|
|
17346
18943
|
/**
|
|
17347
18944
|
* @remarks
|
|
17348
18945
|
* The player's aim-assist settings.
|
|
@@ -17376,6 +18973,20 @@ export class Player extends Entity {
|
|
|
17376
18973
|
* @throws This function can throw errors.
|
|
17377
18974
|
*/
|
|
17378
18975
|
getItemCooldown(cooldownCategory: string): number;
|
|
18976
|
+
/**
|
|
18977
|
+
* @beta
|
|
18978
|
+
* @remarks
|
|
18979
|
+
* Gets the player's ping in milliseconds.
|
|
18980
|
+
*
|
|
18981
|
+
* @returns
|
|
18982
|
+
* The player's ping in milliseconds.
|
|
18983
|
+
* @throws This function can throw errors.
|
|
18984
|
+
*
|
|
18985
|
+
* {@link minecraftcommon.EngineError}
|
|
18986
|
+
*
|
|
18987
|
+
* {@link InvalidEntityError}
|
|
18988
|
+
*/
|
|
18989
|
+
getPing(): number;
|
|
17379
18990
|
/**
|
|
17380
18991
|
* @remarks
|
|
17381
18992
|
* Gets the current spawn point of the player.
|
|
@@ -17383,6 +18994,21 @@ export class Player extends Entity {
|
|
|
17383
18994
|
* @throws This function can throw errors.
|
|
17384
18995
|
*/
|
|
17385
18996
|
getSpawnPoint(): DimensionLocation | undefined;
|
|
18997
|
+
/**
|
|
18998
|
+
* @beta
|
|
18999
|
+
* @remarks
|
|
19000
|
+
* Returns the split screen slot of the player.
|
|
19001
|
+
*
|
|
19002
|
+
* @returns
|
|
19003
|
+
* The split screen slot of the player or undefined if the
|
|
19004
|
+
* player is not in a split screen session.
|
|
19005
|
+
* @throws This function can throw errors.
|
|
19006
|
+
*
|
|
19007
|
+
* {@link minecraftcommon.EngineError}
|
|
19008
|
+
*
|
|
19009
|
+
* {@link InvalidEntityError}
|
|
19010
|
+
*/
|
|
19011
|
+
getSplitScreenSlot(): PlayerSplitScreenSlot | undefined;
|
|
17386
19012
|
/**
|
|
17387
19013
|
* @remarks
|
|
17388
19014
|
* Gets the total experience of the Player.
|
|
@@ -17402,8 +19028,12 @@ export class Player extends Entity {
|
|
|
17402
19028
|
* @param musicOptions
|
|
17403
19029
|
* Additional options for the music track.
|
|
17404
19030
|
* @throws This function can throw errors.
|
|
19031
|
+
*
|
|
19032
|
+
* {@link minecraftcommon.EngineError}
|
|
19033
|
+
*
|
|
19034
|
+
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
17405
19035
|
*/
|
|
17406
|
-
playMusic(trackId: string, musicOptions?: MusicOptions):
|
|
19036
|
+
playMusic(trackId: SoundDefinition | string, musicOptions?: MusicOptions): SoundInstance | undefined;
|
|
17407
19037
|
/**
|
|
17408
19038
|
* @remarks
|
|
17409
19039
|
* Plays a sound that only this particular player can hear.
|
|
@@ -17447,6 +19077,17 @@ export class Player extends Entity {
|
|
|
17447
19077
|
* ```
|
|
17448
19078
|
*/
|
|
17449
19079
|
playSound(soundId: SoundDefinition | string, soundOptions?: PlayerSoundOptions): SoundInstance;
|
|
19080
|
+
/**
|
|
19081
|
+
* @beta
|
|
19082
|
+
* @remarks
|
|
19083
|
+
* This is an internal-facing method for posting a system
|
|
19084
|
+
* message to downstream clients.
|
|
19085
|
+
*
|
|
19086
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19087
|
+
*
|
|
19088
|
+
* @throws This function can throw errors.
|
|
19089
|
+
*/
|
|
19090
|
+
postClientMessage(id: string, value: string): void;
|
|
17450
19091
|
/**
|
|
17451
19092
|
* @remarks
|
|
17452
19093
|
* Queues an additional music track that only this particular
|
|
@@ -17722,6 +19363,18 @@ export class Player extends Entity {
|
|
|
17722
19363
|
* @throws This function can throw errors.
|
|
17723
19364
|
*/
|
|
17724
19365
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
19366
|
+
/**
|
|
19367
|
+
* @beta
|
|
19368
|
+
* @remarks
|
|
19369
|
+
* Stops all sounds from playing for this particular player.
|
|
19370
|
+
*
|
|
19371
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19372
|
+
*
|
|
19373
|
+
* @throws This function can throw errors.
|
|
19374
|
+
*
|
|
19375
|
+
* {@link InvalidEntityError}
|
|
19376
|
+
*/
|
|
19377
|
+
stopAllSounds(): void;
|
|
17725
19378
|
/**
|
|
17726
19379
|
* @remarks
|
|
17727
19380
|
* Stops any music tracks from playing for this particular
|
|
@@ -17732,6 +19385,20 @@ export class Player extends Entity {
|
|
|
17732
19385
|
* @throws This function can throw errors.
|
|
17733
19386
|
*/
|
|
17734
19387
|
stopMusic(): void;
|
|
19388
|
+
/**
|
|
19389
|
+
* @beta
|
|
19390
|
+
* @remarks
|
|
19391
|
+
* Stops a sound from playing for this particular player.
|
|
19392
|
+
*
|
|
19393
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19394
|
+
*
|
|
19395
|
+
* @param soundId
|
|
19396
|
+
* Identifier of the sound.
|
|
19397
|
+
* @throws This function can throw errors.
|
|
19398
|
+
*
|
|
19399
|
+
* {@link InvalidEntityError}
|
|
19400
|
+
*/
|
|
19401
|
+
stopSound(soundId: string): void;
|
|
17735
19402
|
}
|
|
17736
19403
|
|
|
17737
19404
|
/**
|
|
@@ -18040,6 +19707,72 @@ export class PlayerCancelBreakingBlockAfterEventSignal {
|
|
|
18040
19707
|
unsubscribe(callback: (arg0: PlayerCancelBreakingBlockAfterEvent) => void): void;
|
|
18041
19708
|
}
|
|
18042
19709
|
|
|
19710
|
+
/**
|
|
19711
|
+
* @beta
|
|
19712
|
+
* Contains information regarding a player crafting a recipe.
|
|
19713
|
+
*/
|
|
19714
|
+
export class PlayerCraftRecipeAfterEvent {
|
|
19715
|
+
private constructor();
|
|
19716
|
+
/**
|
|
19717
|
+
* @remarks
|
|
19718
|
+
* The block where the recipe was crafted, if applicable.
|
|
19719
|
+
*
|
|
19720
|
+
*/
|
|
19721
|
+
readonly block?: Block;
|
|
19722
|
+
/**
|
|
19723
|
+
* @remarks
|
|
19724
|
+
* The item stack crafted by the player.
|
|
19725
|
+
*
|
|
19726
|
+
*/
|
|
19727
|
+
readonly itemStack?: ItemStack;
|
|
19728
|
+
/**
|
|
19729
|
+
* @remarks
|
|
19730
|
+
* The player who crafted the recipe.
|
|
19731
|
+
*
|
|
19732
|
+
*/
|
|
19733
|
+
readonly player: Player;
|
|
19734
|
+
}
|
|
19735
|
+
|
|
19736
|
+
/**
|
|
19737
|
+
* @beta
|
|
19738
|
+
* Manages callbacks that are connected to when a player crafts
|
|
19739
|
+
* a recipe.
|
|
19740
|
+
*/
|
|
19741
|
+
export class PlayerCraftRecipeAfterEventSignal {
|
|
19742
|
+
private constructor();
|
|
19743
|
+
/**
|
|
19744
|
+
* @remarks
|
|
19745
|
+
* Adds a callback that will be called when a player crafts a
|
|
19746
|
+
* recipe.
|
|
19747
|
+
*
|
|
19748
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19749
|
+
*
|
|
19750
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19751
|
+
*
|
|
19752
|
+
* @param callback
|
|
19753
|
+
* Function callback that is called when this event fires.
|
|
19754
|
+
* @param options
|
|
19755
|
+
* Additional filtering options for the event subscription.
|
|
19756
|
+
*/
|
|
19757
|
+
subscribe(
|
|
19758
|
+
callback: (arg0: PlayerCraftRecipeAfterEvent) => void,
|
|
19759
|
+
options?: PlayerCraftRecipeEventOptions,
|
|
19760
|
+
): (arg0: PlayerCraftRecipeAfterEvent) => void;
|
|
19761
|
+
/**
|
|
19762
|
+
* @remarks
|
|
19763
|
+
* Removes a callback from being called when a player crafts a
|
|
19764
|
+
* recipe.
|
|
19765
|
+
*
|
|
19766
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19767
|
+
*
|
|
19768
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19769
|
+
*
|
|
19770
|
+
* @param callback
|
|
19771
|
+
* The callback to remove from the event subscription.
|
|
19772
|
+
*/
|
|
19773
|
+
unsubscribe(callback: (arg0: PlayerCraftRecipeAfterEvent) => void): void;
|
|
19774
|
+
}
|
|
19775
|
+
|
|
18043
19776
|
/**
|
|
18044
19777
|
* Represents the players cursor inventory. Used when moving
|
|
18045
19778
|
* items between between containers in the inventory UI. Not
|
|
@@ -18067,6 +19800,118 @@ export class PlayerCursorInventoryComponent extends EntityComponent {
|
|
|
18067
19800
|
clear(): void;
|
|
18068
19801
|
}
|
|
18069
19802
|
|
|
19803
|
+
/**
|
|
19804
|
+
* @beta
|
|
19805
|
+
* Contains information about an item moved from a container to
|
|
19806
|
+
* a player's cursor.
|
|
19807
|
+
*/
|
|
19808
|
+
export class PlayerCursorItemGrabAfterEvent {
|
|
19809
|
+
private constructor();
|
|
19810
|
+
/**
|
|
19811
|
+
* @remarks
|
|
19812
|
+
* The item stack moved to the player's cursor.
|
|
19813
|
+
*
|
|
19814
|
+
*/
|
|
19815
|
+
readonly item: ItemStack;
|
|
19816
|
+
/**
|
|
19817
|
+
* @remarks
|
|
19818
|
+
* The player whose cursor item changed.
|
|
19819
|
+
*
|
|
19820
|
+
*/
|
|
19821
|
+
readonly player: Player;
|
|
19822
|
+
}
|
|
19823
|
+
|
|
19824
|
+
/**
|
|
19825
|
+
* @beta
|
|
19826
|
+
* Manages callbacks for items grabbed from a container to a
|
|
19827
|
+
* player's cursor.
|
|
19828
|
+
*/
|
|
19829
|
+
export class PlayerCursorItemGrabAfterEventSignal {
|
|
19830
|
+
private constructor();
|
|
19831
|
+
/**
|
|
19832
|
+
* @remarks
|
|
19833
|
+
* Adds a callback that is called when a player grabs an item
|
|
19834
|
+
* from a container to their cursor.
|
|
19835
|
+
*
|
|
19836
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19837
|
+
*
|
|
19838
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19839
|
+
*
|
|
19840
|
+
* @param callback
|
|
19841
|
+
* The callback function invoked when the event fires.
|
|
19842
|
+
*/
|
|
19843
|
+
subscribe(callback: (arg0: PlayerCursorItemGrabAfterEvent) => void): (arg0: PlayerCursorItemGrabAfterEvent) => void;
|
|
19844
|
+
/**
|
|
19845
|
+
* @remarks
|
|
19846
|
+
* Removes a previously registered event callback.
|
|
19847
|
+
*
|
|
19848
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19849
|
+
*
|
|
19850
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19851
|
+
*
|
|
19852
|
+
* @param callback
|
|
19853
|
+
* The callback function to remove.
|
|
19854
|
+
*/
|
|
19855
|
+
unsubscribe(callback: (arg0: PlayerCursorItemGrabAfterEvent) => void): void;
|
|
19856
|
+
}
|
|
19857
|
+
|
|
19858
|
+
/**
|
|
19859
|
+
* @beta
|
|
19860
|
+
* Contains information about an item moved from a player's
|
|
19861
|
+
* cursor to a container.
|
|
19862
|
+
*/
|
|
19863
|
+
export class PlayerCursorItemReleaseAfterEvent {
|
|
19864
|
+
private constructor();
|
|
19865
|
+
/**
|
|
19866
|
+
* @remarks
|
|
19867
|
+
* The item stack from the player's cursor.
|
|
19868
|
+
*
|
|
19869
|
+
*/
|
|
19870
|
+
readonly item: ItemStack;
|
|
19871
|
+
/**
|
|
19872
|
+
* @remarks
|
|
19873
|
+
* The player whose cursor item changed.
|
|
19874
|
+
*
|
|
19875
|
+
*/
|
|
19876
|
+
readonly player: Player;
|
|
19877
|
+
}
|
|
19878
|
+
|
|
19879
|
+
/**
|
|
19880
|
+
* @beta
|
|
19881
|
+
* Manages callbacks for items released from a player's cursor
|
|
19882
|
+
* to a container.
|
|
19883
|
+
*/
|
|
19884
|
+
export class PlayerCursorItemReleaseAfterEventSignal {
|
|
19885
|
+
private constructor();
|
|
19886
|
+
/**
|
|
19887
|
+
* @remarks
|
|
19888
|
+
* Adds a callback that is called when a player releases an
|
|
19889
|
+
* item from their cursor to a container.
|
|
19890
|
+
*
|
|
19891
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19892
|
+
*
|
|
19893
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19894
|
+
*
|
|
19895
|
+
* @param callback
|
|
19896
|
+
* The callback function invoked when the event fires.
|
|
19897
|
+
*/
|
|
19898
|
+
subscribe(
|
|
19899
|
+
callback: (arg0: PlayerCursorItemReleaseAfterEvent) => void,
|
|
19900
|
+
): (arg0: PlayerCursorItemReleaseAfterEvent) => void;
|
|
19901
|
+
/**
|
|
19902
|
+
* @remarks
|
|
19903
|
+
* Removes a previously registered event callback.
|
|
19904
|
+
*
|
|
19905
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19906
|
+
*
|
|
19907
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
19908
|
+
*
|
|
19909
|
+
* @param callback
|
|
19910
|
+
* The callback function to remove.
|
|
19911
|
+
*/
|
|
19912
|
+
unsubscribe(callback: (arg0: PlayerCursorItemReleaseAfterEvent) => void): void;
|
|
19913
|
+
}
|
|
19914
|
+
|
|
18070
19915
|
/**
|
|
18071
19916
|
* Contains information related to changes to a player's
|
|
18072
19917
|
* dimension having been changed.
|
|
@@ -18891,47 +20736,133 @@ export class PlayerInventoryItemChangeAfterEventSignal {
|
|
|
18891
20736
|
}
|
|
18892
20737
|
|
|
18893
20738
|
/**
|
|
18894
|
-
*
|
|
18895
|
-
*
|
|
18896
|
-
*
|
|
18897
|
-
*
|
|
20739
|
+
* @beta
|
|
20740
|
+
* Contains information about an attack initiated through a
|
|
20741
|
+
* player item interaction before it causes effects. Set cancel
|
|
20742
|
+
* to true to prevent the attack.
|
|
18898
20743
|
*/
|
|
18899
|
-
export class
|
|
20744
|
+
export class PlayerItemAttackEntityBeforeEvent {
|
|
18900
20745
|
private constructor();
|
|
18901
20746
|
/**
|
|
18902
20747
|
* @remarks
|
|
18903
|
-
*
|
|
20748
|
+
* The normalized world-space direction used for the attack.
|
|
20749
|
+
* For standard client-initiated transaction attacks, this
|
|
20750
|
+
* direction is derived from the client-provided hit position
|
|
20751
|
+
* and the player's server-side eye position. Other attack
|
|
20752
|
+
* paths can provide a server-derived direction. This property
|
|
20753
|
+
* is undefined when the attack path does not provide an aim
|
|
20754
|
+
* direction.
|
|
18904
20755
|
*
|
|
18905
20756
|
*/
|
|
18906
|
-
readonly
|
|
20757
|
+
readonly aimDirection?: Vector3;
|
|
18907
20758
|
/**
|
|
18908
20759
|
* @remarks
|
|
18909
|
-
*
|
|
20760
|
+
* If set to true, the attack does not cause damage or other
|
|
20761
|
+
* authoritative attack effects.
|
|
18910
20762
|
*
|
|
18911
20763
|
*/
|
|
18912
|
-
|
|
20764
|
+
cancel: boolean;
|
|
20765
|
+
/**
|
|
20766
|
+
* @remarks
|
|
20767
|
+
* A snapshot of the item held by the attacking player. This
|
|
20768
|
+
* property is undefined when the player holds no item.
|
|
20769
|
+
*
|
|
20770
|
+
*/
|
|
20771
|
+
readonly itemStack?: ItemStack;
|
|
20772
|
+
/**
|
|
20773
|
+
* @remarks
|
|
20774
|
+
* The player that initiated the attack.
|
|
20775
|
+
*
|
|
20776
|
+
*/
|
|
20777
|
+
readonly player: Player;
|
|
20778
|
+
/**
|
|
20779
|
+
* @remarks
|
|
20780
|
+
* The entity targeted by the attack.
|
|
20781
|
+
*
|
|
20782
|
+
*/
|
|
20783
|
+
readonly target: Entity;
|
|
18913
20784
|
}
|
|
18914
20785
|
|
|
18915
20786
|
/**
|
|
18916
|
-
*
|
|
18917
|
-
*
|
|
20787
|
+
* @beta
|
|
20788
|
+
* Manages callbacks that run before a player attacks an entity
|
|
20789
|
+
* through an item interaction.
|
|
18918
20790
|
*/
|
|
18919
|
-
export class
|
|
20791
|
+
export class PlayerItemAttackEntityBeforeEventSignal {
|
|
18920
20792
|
private constructor();
|
|
18921
20793
|
/**
|
|
18922
20794
|
* @remarks
|
|
18923
|
-
* Adds a callback that
|
|
18924
|
-
*
|
|
20795
|
+
* Adds a callback that runs before a player attacks an entity
|
|
20796
|
+
* through an item interaction.
|
|
18925
20797
|
*
|
|
18926
20798
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
18927
20799
|
*
|
|
18928
20800
|
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
18929
20801
|
*
|
|
20802
|
+
* @param callback
|
|
20803
|
+
* This closure is called with restricted-execution privilege.
|
|
20804
|
+
* @returns
|
|
20805
|
+
* Closure that is called with restricted-execution privilege.
|
|
18930
20806
|
*/
|
|
18931
|
-
subscribe(
|
|
20807
|
+
subscribe(
|
|
20808
|
+
callback: (arg0: PlayerItemAttackEntityBeforeEvent) => void,
|
|
20809
|
+
): (arg0: PlayerItemAttackEntityBeforeEvent) => void;
|
|
18932
20810
|
/**
|
|
18933
20811
|
* @remarks
|
|
18934
|
-
* Removes a callback from
|
|
20812
|
+
* Removes a callback from this event signal.
|
|
20813
|
+
*
|
|
20814
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
20815
|
+
*
|
|
20816
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
20817
|
+
*
|
|
20818
|
+
* @param callback
|
|
20819
|
+
* This closure is called with restricted-execution privilege.
|
|
20820
|
+
*/
|
|
20821
|
+
unsubscribe(callback: (arg0: PlayerItemAttackEntityBeforeEvent) => void): void;
|
|
20822
|
+
}
|
|
20823
|
+
|
|
20824
|
+
/**
|
|
20825
|
+
* Contains information regarding a player that has joined.
|
|
20826
|
+
* See the playerSpawn event for more detailed information that
|
|
20827
|
+
* could be returned after the first time a player has spawned
|
|
20828
|
+
* within the game.
|
|
20829
|
+
*/
|
|
20830
|
+
export class PlayerJoinAfterEvent {
|
|
20831
|
+
private constructor();
|
|
20832
|
+
/**
|
|
20833
|
+
* @remarks
|
|
20834
|
+
* Opaque string identifier of the player that joined the game.
|
|
20835
|
+
*
|
|
20836
|
+
*/
|
|
20837
|
+
readonly playerId: string;
|
|
20838
|
+
/**
|
|
20839
|
+
* @remarks
|
|
20840
|
+
* Name of the player that has joined.
|
|
20841
|
+
*
|
|
20842
|
+
*/
|
|
20843
|
+
readonly playerName: string;
|
|
20844
|
+
}
|
|
20845
|
+
|
|
20846
|
+
/**
|
|
20847
|
+
* Manages callbacks that are connected to a player joining the
|
|
20848
|
+
* world.
|
|
20849
|
+
*/
|
|
20850
|
+
export class PlayerJoinAfterEventSignal {
|
|
20851
|
+
private constructor();
|
|
20852
|
+
/**
|
|
20853
|
+
* @remarks
|
|
20854
|
+
* Adds a callback that will be called when a player joins the
|
|
20855
|
+
* world.
|
|
20856
|
+
*
|
|
20857
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
20858
|
+
*
|
|
20859
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
20860
|
+
*
|
|
20861
|
+
*/
|
|
20862
|
+
subscribe(callback: (arg0: PlayerJoinAfterEvent) => void): (arg0: PlayerJoinAfterEvent) => void;
|
|
20863
|
+
/**
|
|
20864
|
+
* @remarks
|
|
20865
|
+
* Removes a callback from being called when a player joins the
|
|
18935
20866
|
* world.
|
|
18936
20867
|
*
|
|
18937
20868
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
@@ -19091,223 +21022,672 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
19091
21022
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
19092
21023
|
}
|
|
19093
21024
|
|
|
21025
|
+
/**
|
|
21026
|
+
* @beta
|
|
21027
|
+
* Contains information regarding an event before a player
|
|
21028
|
+
* places a block.
|
|
21029
|
+
*/
|
|
21030
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21031
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
21032
|
+
private constructor();
|
|
21033
|
+
/**
|
|
21034
|
+
* @remarks
|
|
21035
|
+
* If set to true, cancels the block place event.
|
|
21036
|
+
*
|
|
21037
|
+
*/
|
|
21038
|
+
cancel: boolean;
|
|
21039
|
+
/**
|
|
21040
|
+
* @remarks
|
|
21041
|
+
* The face of the block that the new block is being placed on.
|
|
21042
|
+
*
|
|
21043
|
+
*/
|
|
21044
|
+
readonly face: Direction;
|
|
21045
|
+
/**
|
|
21046
|
+
* @remarks
|
|
21047
|
+
* Location relative to the bottom north-west corner of the
|
|
21048
|
+
* block where the new block is being placed onto.
|
|
21049
|
+
*
|
|
21050
|
+
*/
|
|
21051
|
+
readonly faceLocation: Vector3;
|
|
21052
|
+
/**
|
|
21053
|
+
* @remarks
|
|
21054
|
+
* The block permutation that will be placed if the event is
|
|
21055
|
+
* not cancelled.
|
|
21056
|
+
*
|
|
21057
|
+
*/
|
|
21058
|
+
readonly permutationToPlace: BlockPermutation;
|
|
21059
|
+
/**
|
|
21060
|
+
* @remarks
|
|
21061
|
+
* Player that is placing the block for this event.
|
|
21062
|
+
*
|
|
21063
|
+
*/
|
|
21064
|
+
readonly player: Player;
|
|
21065
|
+
}
|
|
21066
|
+
|
|
21067
|
+
/**
|
|
21068
|
+
* @beta
|
|
21069
|
+
* Manages callbacks that are connected to before a block is
|
|
21070
|
+
* placed by a player.
|
|
21071
|
+
*/
|
|
21072
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
21073
|
+
private constructor();
|
|
21074
|
+
/**
|
|
21075
|
+
* @remarks
|
|
21076
|
+
* Adds a callback that will be called before a block is placed
|
|
21077
|
+
* by a player.
|
|
21078
|
+
*
|
|
21079
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21080
|
+
*
|
|
21081
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21082
|
+
*
|
|
21083
|
+
* @param callback
|
|
21084
|
+
* This closure is called with restricted-execution privilege.
|
|
21085
|
+
* @returns
|
|
21086
|
+
* Closure that is called with restricted-execution privilege.
|
|
21087
|
+
*/
|
|
21088
|
+
subscribe(
|
|
21089
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
21090
|
+
options?: BlockEventOptions,
|
|
21091
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
21092
|
+
/**
|
|
21093
|
+
* @remarks
|
|
21094
|
+
* Removes a callback from being called before an block is
|
|
21095
|
+
* placed by a player.
|
|
21096
|
+
*
|
|
21097
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21098
|
+
*
|
|
21099
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21100
|
+
*
|
|
21101
|
+
* @param callback
|
|
21102
|
+
* This closure is called with restricted-execution privilege.
|
|
21103
|
+
*/
|
|
21104
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
21105
|
+
}
|
|
21106
|
+
|
|
19094
21107
|
/**
|
|
19095
21108
|
* An event that contains more information about a player
|
|
19096
21109
|
* spawning.
|
|
19097
21110
|
*/
|
|
19098
|
-
export class PlayerSpawnAfterEvent {
|
|
21111
|
+
export class PlayerSpawnAfterEvent {
|
|
21112
|
+
private constructor();
|
|
21113
|
+
/**
|
|
21114
|
+
* @remarks
|
|
21115
|
+
* If true, this is the initial spawn of a player after joining
|
|
21116
|
+
* the game.
|
|
21117
|
+
*
|
|
21118
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21119
|
+
*
|
|
21120
|
+
*/
|
|
21121
|
+
initialSpawn: boolean;
|
|
21122
|
+
/**
|
|
21123
|
+
* @remarks
|
|
21124
|
+
* Object that represents the player that joined the game.
|
|
21125
|
+
*
|
|
21126
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21127
|
+
*
|
|
21128
|
+
*/
|
|
21129
|
+
player: Player;
|
|
21130
|
+
}
|
|
21131
|
+
|
|
21132
|
+
/**
|
|
21133
|
+
* Registers an event when a player is spawned (or re-spawned
|
|
21134
|
+
* after death) and fully ready within the world.
|
|
21135
|
+
*/
|
|
21136
|
+
export class PlayerSpawnAfterEventSignal {
|
|
21137
|
+
private constructor();
|
|
21138
|
+
/**
|
|
21139
|
+
* @remarks
|
|
21140
|
+
* Registers a new event receiver for this particular type of
|
|
21141
|
+
* event.
|
|
21142
|
+
*
|
|
21143
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21144
|
+
*
|
|
21145
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21146
|
+
*
|
|
21147
|
+
*/
|
|
21148
|
+
subscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): (arg0: PlayerSpawnAfterEvent) => void;
|
|
21149
|
+
/**
|
|
21150
|
+
* @remarks
|
|
21151
|
+
* De-registers an event receiver for the player spawn event.
|
|
21152
|
+
*
|
|
21153
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21154
|
+
*
|
|
21155
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21156
|
+
*
|
|
21157
|
+
*/
|
|
21158
|
+
unsubscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): void;
|
|
21159
|
+
}
|
|
21160
|
+
|
|
21161
|
+
/**
|
|
21162
|
+
* Contains information regarding an event after a player
|
|
21163
|
+
* starts breaking a block.
|
|
21164
|
+
*/
|
|
21165
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21166
|
+
export class PlayerStartBreakingBlockAfterEvent extends BlockEvent {
|
|
21167
|
+
private constructor();
|
|
21168
|
+
/**
|
|
21169
|
+
* @remarks
|
|
21170
|
+
* The permutation of the block that the player is starting to
|
|
21171
|
+
* break.
|
|
21172
|
+
*
|
|
21173
|
+
*/
|
|
21174
|
+
readonly blockPermutation: BlockPermutation;
|
|
21175
|
+
/**
|
|
21176
|
+
* @remarks
|
|
21177
|
+
* The face of the block being broken.
|
|
21178
|
+
*
|
|
21179
|
+
*/
|
|
21180
|
+
readonly face: Direction;
|
|
21181
|
+
/**
|
|
21182
|
+
* @remarks
|
|
21183
|
+
* The item stack that the player is using to break the block,
|
|
21184
|
+
* or undefined if empty hand.
|
|
21185
|
+
*
|
|
21186
|
+
*/
|
|
21187
|
+
readonly heldItemStack?: ItemStack;
|
|
21188
|
+
/**
|
|
21189
|
+
* @remarks
|
|
21190
|
+
* Player that started breaking the block for this event.
|
|
21191
|
+
*
|
|
21192
|
+
*/
|
|
21193
|
+
readonly player: Player;
|
|
21194
|
+
}
|
|
21195
|
+
|
|
21196
|
+
/**
|
|
21197
|
+
* Manages callbacks that are connected to when a player starts
|
|
21198
|
+
* breaking a block.
|
|
21199
|
+
*/
|
|
21200
|
+
export class PlayerStartBreakingBlockAfterEventSignal {
|
|
21201
|
+
private constructor();
|
|
21202
|
+
/**
|
|
21203
|
+
* @remarks
|
|
21204
|
+
* Adds a callback that will be called when a player starts
|
|
21205
|
+
* breaking a block.
|
|
21206
|
+
*
|
|
21207
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21208
|
+
*
|
|
21209
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21210
|
+
*
|
|
21211
|
+
*/
|
|
21212
|
+
subscribe(
|
|
21213
|
+
callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void,
|
|
21214
|
+
options?: PlayerBreakingBlockEventOptions,
|
|
21215
|
+
): (arg0: PlayerStartBreakingBlockAfterEvent) => void;
|
|
21216
|
+
/**
|
|
21217
|
+
* @remarks
|
|
21218
|
+
* Removes a callback from being called when a player starts
|
|
21219
|
+
* breaking a block.
|
|
21220
|
+
*
|
|
21221
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21222
|
+
*
|
|
21223
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21224
|
+
*
|
|
21225
|
+
*/
|
|
21226
|
+
unsubscribe(callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void): void;
|
|
21227
|
+
}
|
|
21228
|
+
|
|
21229
|
+
/**
|
|
21230
|
+
* Contains information regarding a player starting to swing
|
|
21231
|
+
* their arm.
|
|
21232
|
+
*/
|
|
21233
|
+
export class PlayerSwingStartAfterEvent {
|
|
21234
|
+
private constructor();
|
|
21235
|
+
/**
|
|
21236
|
+
* @remarks
|
|
21237
|
+
* The item stack being held by the player at the start of
|
|
21238
|
+
* their swing.
|
|
21239
|
+
*
|
|
21240
|
+
*/
|
|
21241
|
+
readonly heldItemStack?: ItemStack;
|
|
21242
|
+
/**
|
|
21243
|
+
* @remarks
|
|
21244
|
+
* Source Player for this event.
|
|
21245
|
+
*
|
|
21246
|
+
*/
|
|
21247
|
+
readonly player: Player;
|
|
21248
|
+
/**
|
|
21249
|
+
* @remarks
|
|
21250
|
+
* The source of the Player swing, see
|
|
21251
|
+
* {@link EntitySwingSource}.
|
|
21252
|
+
*
|
|
21253
|
+
*/
|
|
21254
|
+
readonly swingSource: EntitySwingSource;
|
|
21255
|
+
}
|
|
21256
|
+
|
|
21257
|
+
/**
|
|
21258
|
+
* Manages callbacks that are connected to when a player starts
|
|
21259
|
+
* to swing their arm (e.g. attacking, using an item,
|
|
21260
|
+
* interacting).
|
|
21261
|
+
*/
|
|
21262
|
+
export class PlayerSwingStartAfterEventSignal {
|
|
21263
|
+
private constructor();
|
|
21264
|
+
/**
|
|
21265
|
+
* @remarks
|
|
21266
|
+
* Adds a callback that will be called when a player starts to
|
|
21267
|
+
* swing their arm (e.g. attacking, using an item,
|
|
21268
|
+
* interacting).
|
|
21269
|
+
*
|
|
21270
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21271
|
+
*
|
|
21272
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21273
|
+
*
|
|
21274
|
+
*/
|
|
21275
|
+
subscribe(
|
|
21276
|
+
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
21277
|
+
options?: PlayerSwingEventOptions,
|
|
21278
|
+
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
21279
|
+
/**
|
|
21280
|
+
* @remarks
|
|
21281
|
+
* Removes a callback from being called when a player starts to
|
|
21282
|
+
* swing their arm (e.g. attacking, using an item,
|
|
21283
|
+
* interacting).
|
|
21284
|
+
*
|
|
21285
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21286
|
+
*
|
|
21287
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21288
|
+
*
|
|
21289
|
+
*/
|
|
21290
|
+
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
21291
|
+
}
|
|
21292
|
+
|
|
21293
|
+
/**
|
|
21294
|
+
* @beta
|
|
21295
|
+
* Contains information related to when a player successfully
|
|
21296
|
+
* names an Entity with a named Name Tag item.
|
|
21297
|
+
*/
|
|
21298
|
+
export class PlayerUseNameTagAfterEvent {
|
|
21299
|
+
private constructor();
|
|
21300
|
+
/**
|
|
21301
|
+
* @remarks
|
|
21302
|
+
* The entity that was named by the player.
|
|
21303
|
+
*
|
|
21304
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21305
|
+
*
|
|
21306
|
+
*/
|
|
21307
|
+
entityNamed: Entity;
|
|
21308
|
+
/**
|
|
21309
|
+
* @remarks
|
|
21310
|
+
* The new name that the player has given to the entity.
|
|
21311
|
+
*
|
|
21312
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21313
|
+
*
|
|
21314
|
+
*/
|
|
21315
|
+
newName: string;
|
|
21316
|
+
/**
|
|
21317
|
+
* @remarks
|
|
21318
|
+
* Handle to the player that used the name tag.
|
|
21319
|
+
*
|
|
21320
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21321
|
+
*
|
|
21322
|
+
*/
|
|
21323
|
+
player: Player;
|
|
21324
|
+
/**
|
|
21325
|
+
* @remarks
|
|
21326
|
+
* The previous name of the entity before the player used the
|
|
21327
|
+
* name tag. This will be undefined if the entity was not
|
|
21328
|
+
* previously named.
|
|
21329
|
+
*
|
|
21330
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21331
|
+
*
|
|
21332
|
+
*/
|
|
21333
|
+
previousName?: string;
|
|
21334
|
+
}
|
|
21335
|
+
|
|
21336
|
+
/**
|
|
21337
|
+
* @beta
|
|
21338
|
+
* Manages callbacks that are connected to when a player
|
|
21339
|
+
* successfully names an Entity with a named Name Tag item.
|
|
21340
|
+
*/
|
|
21341
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
21342
|
+
private constructor();
|
|
21343
|
+
/**
|
|
21344
|
+
* @remarks
|
|
21345
|
+
* Subscribes the specified callback to a player use name tag
|
|
21346
|
+
* after event.
|
|
21347
|
+
*
|
|
21348
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21349
|
+
*
|
|
21350
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21351
|
+
*
|
|
21352
|
+
*/
|
|
21353
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
21354
|
+
/**
|
|
21355
|
+
* @remarks
|
|
21356
|
+
* Removes the specified callback from a player use name tag
|
|
21357
|
+
* after event.
|
|
21358
|
+
*
|
|
21359
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21360
|
+
*
|
|
21361
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21362
|
+
*
|
|
21363
|
+
*/
|
|
21364
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
21365
|
+
}
|
|
21366
|
+
|
|
21367
|
+
/**
|
|
21368
|
+
* Waypoint that tracks a player's position. Extends
|
|
21369
|
+
* {@link EntityWaypoint} with additional player-specific
|
|
21370
|
+
* visibility rules such as hidden state and spectator mode.
|
|
21371
|
+
*/
|
|
21372
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21373
|
+
export class PlayerWaypoint extends EntityWaypoint {
|
|
21374
|
+
/**
|
|
21375
|
+
* @remarks
|
|
21376
|
+
* The {@link PlayerVisibilityRules} that control when the
|
|
21377
|
+
* waypoint is shown based on the player's state (e.g., hidden,
|
|
21378
|
+
* spectator mode, spectator viewing another spectator).
|
|
21379
|
+
*
|
|
21380
|
+
* @throws This property can throw when used.
|
|
21381
|
+
*
|
|
21382
|
+
* {@link InvalidWaypointError}
|
|
21383
|
+
*
|
|
21384
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
21385
|
+
*/
|
|
21386
|
+
readonly playerRules: PlayerVisibilityRules;
|
|
21387
|
+
/**
|
|
21388
|
+
* @throws This function can throw errors.
|
|
21389
|
+
*
|
|
21390
|
+
* {@link InvalidWaypointTextureSelectorError}
|
|
21391
|
+
*/
|
|
21392
|
+
constructor(
|
|
21393
|
+
player: Player,
|
|
21394
|
+
textureSelector: WaypointTextureSelector,
|
|
21395
|
+
playerRules: PlayerVisibilityRules,
|
|
21396
|
+
color?: RGB,
|
|
21397
|
+
);
|
|
21398
|
+
}
|
|
21399
|
+
|
|
21400
|
+
/**
|
|
21401
|
+
* @beta
|
|
21402
|
+
* Describes a block point-of-interest instance returned by a
|
|
21403
|
+
* query.
|
|
21404
|
+
*/
|
|
21405
|
+
export class PoiBlockInstance {
|
|
19099
21406
|
private constructor();
|
|
19100
21407
|
/**
|
|
19101
21408
|
* @remarks
|
|
19102
|
-
*
|
|
19103
|
-
* the game.
|
|
19104
|
-
*
|
|
19105
|
-
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
21409
|
+
* Block position of this POI instance.
|
|
19106
21410
|
*
|
|
19107
21411
|
*/
|
|
19108
|
-
|
|
21412
|
+
readonly position: Vector3;
|
|
19109
21413
|
/**
|
|
19110
21414
|
* @remarks
|
|
19111
|
-
*
|
|
21415
|
+
* Number of tickets currently available to be claimed from
|
|
21416
|
+
* this POI instance.
|
|
19112
21417
|
*
|
|
19113
|
-
|
|
21418
|
+
*/
|
|
21419
|
+
readonly tickets: number;
|
|
21420
|
+
/**
|
|
21421
|
+
* @remarks
|
|
21422
|
+
* Type of this POI instance.
|
|
19114
21423
|
*
|
|
19115
21424
|
*/
|
|
19116
|
-
|
|
21425
|
+
readonly 'type': PoiBlockType;
|
|
19117
21426
|
}
|
|
19118
21427
|
|
|
19119
21428
|
/**
|
|
19120
|
-
*
|
|
19121
|
-
*
|
|
21429
|
+
* @beta
|
|
21430
|
+
* Provides methods for querying and managing block-based
|
|
21431
|
+
* points of interest in a dimension.
|
|
19122
21432
|
*/
|
|
19123
|
-
export class
|
|
21433
|
+
export class PoiBlockManager {
|
|
19124
21434
|
private constructor();
|
|
19125
21435
|
/**
|
|
19126
21436
|
* @remarks
|
|
19127
|
-
*
|
|
19128
|
-
*
|
|
21437
|
+
* Adds a block point of interest at a position. This method is
|
|
21438
|
+
* intended for temporary usage. Will be replaced when chunk is
|
|
21439
|
+
* reloaded
|
|
19129
21440
|
*
|
|
19130
21441
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19131
21442
|
*
|
|
19132
|
-
* @
|
|
19133
|
-
*
|
|
21443
|
+
* @param position
|
|
21444
|
+
* Block position at which to add the POI.
|
|
21445
|
+
* @param poi
|
|
21446
|
+
* POI type to add, specified by numeric type Id, type name, or
|
|
21447
|
+
* POI type object.
|
|
19134
21448
|
*/
|
|
19135
|
-
|
|
21449
|
+
addTemporary(position: Vector3, poi: PoiBlockType | string | number): void;
|
|
19136
21450
|
/**
|
|
19137
21451
|
* @remarks
|
|
19138
|
-
*
|
|
21452
|
+
* Gets the type of the block point of interest at a position.
|
|
19139
21453
|
*
|
|
19140
21454
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19141
21455
|
*
|
|
19142
|
-
* @
|
|
19143
|
-
*
|
|
21456
|
+
* @param position
|
|
21457
|
+
* Block position to inspect.
|
|
21458
|
+
* @returns
|
|
21459
|
+
* The POI type at the position, or undefined if no POI exists
|
|
21460
|
+
* there.
|
|
19144
21461
|
*/
|
|
19145
|
-
|
|
19146
|
-
}
|
|
19147
|
-
|
|
19148
|
-
/**
|
|
19149
|
-
* Contains information regarding an event after a player
|
|
19150
|
-
* starts breaking a block.
|
|
19151
|
-
*/
|
|
19152
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
19153
|
-
export class PlayerStartBreakingBlockAfterEvent extends BlockEvent {
|
|
19154
|
-
private constructor();
|
|
21462
|
+
at(position: Vector3): PoiBlockType | undefined;
|
|
19155
21463
|
/**
|
|
19156
21464
|
* @remarks
|
|
19157
|
-
*
|
|
19158
|
-
*
|
|
21465
|
+
* Tests whether a block point of interest at a position
|
|
21466
|
+
* matches a type filter.
|
|
21467
|
+
*
|
|
21468
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19159
21469
|
*
|
|
21470
|
+
* @param position
|
|
21471
|
+
* Block position to inspect.
|
|
21472
|
+
* @param filter
|
|
21473
|
+
* Filter used to select the POI type. A callback receives the
|
|
21474
|
+
* POI type and returns whether it matches; a name filter
|
|
21475
|
+
* matches a type name; and a tag filter requires all specified
|
|
21476
|
+
* tags.
|
|
21477
|
+
* @returns
|
|
21478
|
+
* True if a POI exists at the position and its type matches
|
|
21479
|
+
* the filter; otherwise false.
|
|
19160
21480
|
*/
|
|
19161
|
-
|
|
21481
|
+
exists(position: Vector3, filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter): boolean;
|
|
19162
21482
|
/**
|
|
19163
21483
|
* @remarks
|
|
19164
|
-
*
|
|
21484
|
+
* Returns block points of interest that match the supplied
|
|
21485
|
+
* type and occupancy filters within the specified distance of
|
|
21486
|
+
* a location.
|
|
21487
|
+
*
|
|
21488
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19165
21489
|
*
|
|
21490
|
+
* @param filter
|
|
21491
|
+
* Filter used to select POI types. A callback receives each
|
|
21492
|
+
* POI type and returns whether it should be included; a name
|
|
21493
|
+
* filter matches a type name; and a tag filter requires all
|
|
21494
|
+
* specified tags.
|
|
21495
|
+
* @param center
|
|
21496
|
+
* Center of the search.
|
|
21497
|
+
* @param blockRadius
|
|
21498
|
+
* Maximum three-dimensional distance from the center, in
|
|
21499
|
+
* blocks.
|
|
21500
|
+
* @param occupancyFilter
|
|
21501
|
+
* Optional filter applied to the occupancy state of matching
|
|
21502
|
+
* POIs. If omitted, POIs in any occupancy state are returned.
|
|
21503
|
+
* @returns
|
|
21504
|
+
* The matching POI instances within range. The result order is
|
|
21505
|
+
* not guaranteed.
|
|
19166
21506
|
*/
|
|
19167
|
-
|
|
21507
|
+
getInRange(
|
|
21508
|
+
filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
|
|
21509
|
+
center: Vector3,
|
|
21510
|
+
blockRadius: number,
|
|
21511
|
+
occupancyFilter?: PoiBlockOccupancyFilter,
|
|
21512
|
+
): PoiBlockInstance[];
|
|
19168
21513
|
/**
|
|
19169
21514
|
* @remarks
|
|
19170
|
-
*
|
|
19171
|
-
*
|
|
21515
|
+
* Returns block points of interest that match the supplied
|
|
21516
|
+
* type and occupancy filters within an axis-aligned square
|
|
21517
|
+
* centered on the specified location, sorted from nearest to
|
|
21518
|
+
* farthest.
|
|
21519
|
+
*
|
|
21520
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19172
21521
|
*
|
|
21522
|
+
* @param filter
|
|
21523
|
+
* Filter used to select POI types. A callback receives each
|
|
21524
|
+
* POI type and returns whether it should be included; a name
|
|
21525
|
+
* filter matches a type name; and a tag filter requires all
|
|
21526
|
+
* specified tags.
|
|
21527
|
+
* @param center
|
|
21528
|
+
* Center of the search and the location from which distances
|
|
21529
|
+
* are calculated.
|
|
21530
|
+
* @param blockRadius
|
|
21531
|
+
* Maximum three-dimensional distance from the center, in
|
|
21532
|
+
* blocks.
|
|
21533
|
+
* @param occupancyFilter
|
|
21534
|
+
* Optional filter applied to the occupancy state of matching
|
|
21535
|
+
* POIs. If omitted, POIs in any occupancy state are returned.
|
|
21536
|
+
* @returns
|
|
21537
|
+
* The matching POI instances and their squared distances from
|
|
21538
|
+
* the center, sorted in ascending distance order.
|
|
19173
21539
|
*/
|
|
19174
|
-
|
|
21540
|
+
getInRangeSorted(
|
|
21541
|
+
filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
|
|
21542
|
+
center: Vector3,
|
|
21543
|
+
blockRadius: number,
|
|
21544
|
+
occupancyFilter?: PoiBlockOccupancyFilter,
|
|
21545
|
+
): PoiDistancePair[];
|
|
19175
21546
|
/**
|
|
19176
21547
|
* @remarks
|
|
19177
|
-
*
|
|
21548
|
+
* Returns block points of interest that match the supplied
|
|
21549
|
+
* type and occupancy filters within an axis-aligned square
|
|
21550
|
+
* centered on the specified location.
|
|
19178
21551
|
*
|
|
21552
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21553
|
+
*
|
|
21554
|
+
* @param filter
|
|
21555
|
+
* Filter used to select POI types. A callback receives each
|
|
21556
|
+
* POI type and returns whether it should be included; a name
|
|
21557
|
+
* filter matches a type name; and a tag filter requires all
|
|
21558
|
+
* specified tags.
|
|
21559
|
+
* @param center
|
|
21560
|
+
* Center of the search volume.
|
|
21561
|
+
* @param blockRadius
|
|
21562
|
+
* Half-size of the search volume, in blocks, along each axis.
|
|
21563
|
+
* @param occupancyFilter
|
|
21564
|
+
* Optional filter applied to the occupancy state of matching
|
|
21565
|
+
* POIs. If omitted, POIs in any occupancy state are returned.
|
|
21566
|
+
* @returns
|
|
21567
|
+
* The matching POI instances in the search volume.
|
|
19179
21568
|
*/
|
|
19180
|
-
|
|
19181
|
-
|
|
19182
|
-
|
|
19183
|
-
|
|
19184
|
-
|
|
19185
|
-
|
|
19186
|
-
*/
|
|
19187
|
-
export class PlayerStartBreakingBlockAfterEventSignal {
|
|
19188
|
-
private constructor();
|
|
21569
|
+
getInSquare(
|
|
21570
|
+
filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
|
|
21571
|
+
center: Vector3,
|
|
21572
|
+
blockRadius: number,
|
|
21573
|
+
occupancyFilter?: PoiBlockOccupancyFilter,
|
|
21574
|
+
): PoiBlockInstance[];
|
|
19189
21575
|
/**
|
|
19190
21576
|
* @remarks
|
|
19191
|
-
*
|
|
19192
|
-
*
|
|
21577
|
+
* Releases one previously claimed ticket at a block point of
|
|
21578
|
+
* interest.
|
|
19193
21579
|
*
|
|
19194
21580
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19195
21581
|
*
|
|
19196
|
-
* @
|
|
19197
|
-
*
|
|
21582
|
+
* @param center
|
|
21583
|
+
* Block position of the POI whose ticket should be released.
|
|
21584
|
+
* @returns
|
|
21585
|
+
* True if a ticket was released; false if no POI exists at the
|
|
21586
|
+
* position or the POI has no claimed tickets.
|
|
19198
21587
|
*/
|
|
19199
|
-
|
|
19200
|
-
callback: (arg0: PlayerStartBreakingBlockAfterEvent) => void,
|
|
19201
|
-
options?: PlayerBreakingBlockEventOptions,
|
|
19202
|
-
): (arg0: PlayerStartBreakingBlockAfterEvent) => void;
|
|
21588
|
+
release(center: Vector3): boolean;
|
|
19203
21589
|
/**
|
|
19204
21590
|
* @remarks
|
|
19205
|
-
*
|
|
19206
|
-
*
|
|
21591
|
+
* Claims one available ticket from a matching block point of
|
|
21592
|
+
* interest within range.
|
|
19207
21593
|
*
|
|
19208
21594
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19209
21595
|
*
|
|
19210
|
-
* @
|
|
19211
|
-
*
|
|
21596
|
+
* @param filter
|
|
21597
|
+
* Filter used to select the POI type to claim. A callback
|
|
21598
|
+
* receives each POI type and returns whether it should be
|
|
21599
|
+
* included; a name filter matches a type name; and a tag
|
|
21600
|
+
* filter requires all specified tags.
|
|
21601
|
+
* @param center
|
|
21602
|
+
* Center of the search.
|
|
21603
|
+
* @param blockRadius
|
|
21604
|
+
* Maximum three-dimensional distance from the center, in
|
|
21605
|
+
* blocks.
|
|
21606
|
+
* @returns
|
|
21607
|
+
* The block position of the claimed POI, or undefined if no
|
|
21608
|
+
* matching POI has an available ticket.
|
|
19212
21609
|
*/
|
|
19213
|
-
|
|
21610
|
+
take(
|
|
21611
|
+
filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
|
|
21612
|
+
center: Vector3,
|
|
21613
|
+
blockRadius: number,
|
|
21614
|
+
): Vector3 | undefined;
|
|
19214
21615
|
}
|
|
19215
21616
|
|
|
19216
21617
|
/**
|
|
19217
|
-
*
|
|
19218
|
-
*
|
|
21618
|
+
* @beta
|
|
21619
|
+
* Describes a block point-of-interest type.
|
|
19219
21620
|
*/
|
|
19220
|
-
export class
|
|
21621
|
+
export class PoiBlockType {
|
|
19221
21622
|
private constructor();
|
|
19222
21623
|
/**
|
|
19223
21624
|
* @remarks
|
|
19224
|
-
*
|
|
19225
|
-
* their swing.
|
|
21625
|
+
* Numeric identifier of this POI type.
|
|
19226
21626
|
*
|
|
19227
21627
|
*/
|
|
19228
|
-
readonly
|
|
21628
|
+
readonly id: number;
|
|
19229
21629
|
/**
|
|
19230
21630
|
* @remarks
|
|
19231
|
-
*
|
|
21631
|
+
* Namespaced identifier of this POI type.
|
|
19232
21632
|
*
|
|
19233
21633
|
*/
|
|
19234
|
-
readonly
|
|
21634
|
+
readonly name: string;
|
|
19235
21635
|
/**
|
|
19236
21636
|
* @remarks
|
|
19237
|
-
*
|
|
19238
|
-
*
|
|
21637
|
+
* Maximum number of tickets that can be claimed from each POI
|
|
21638
|
+
* instance of this type.
|
|
19239
21639
|
*
|
|
19240
21640
|
*/
|
|
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();
|
|
21641
|
+
readonly tickets: number;
|
|
19251
21642
|
/**
|
|
19252
21643
|
* @remarks
|
|
19253
|
-
*
|
|
19254
|
-
*
|
|
19255
|
-
* interacting).
|
|
21644
|
+
* Maximum range, in blocks, at which this POI type is
|
|
21645
|
+
* considered usable.
|
|
19256
21646
|
*
|
|
19257
|
-
|
|
21647
|
+
*/
|
|
21648
|
+
readonly usableRange: number;
|
|
21649
|
+
/**
|
|
21650
|
+
* @remarks
|
|
21651
|
+
* Tests whether this object and another object describe the
|
|
21652
|
+
* same POI type.
|
|
19258
21653
|
*
|
|
19259
|
-
* @privilege
|
|
21654
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19260
21655
|
*
|
|
21656
|
+
* @param other
|
|
21657
|
+
* POI type to compare with this type.
|
|
21658
|
+
* @returns
|
|
21659
|
+
* True if both objects describe the same POI type; otherwise
|
|
21660
|
+
* false.
|
|
19261
21661
|
*/
|
|
19262
|
-
|
|
19263
|
-
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
19264
|
-
options?: PlayerSwingEventOptions,
|
|
19265
|
-
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
21662
|
+
equals(other: PoiBlockType): boolean;
|
|
19266
21663
|
/**
|
|
19267
21664
|
* @remarks
|
|
19268
|
-
*
|
|
19269
|
-
* swing their arm (e.g. attacking, using an item,
|
|
19270
|
-
* interacting).
|
|
21665
|
+
* Tests whether the type has the provided tag attribute
|
|
19271
21666
|
*
|
|
19272
21667
|
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
19273
21668
|
*
|
|
19274
|
-
* @
|
|
19275
|
-
*
|
|
21669
|
+
* @param tag
|
|
21670
|
+
* POI tag to check.
|
|
21671
|
+
* @returns
|
|
21672
|
+
* True if the POI conatains the tag; otherwise false.
|
|
19276
21673
|
*/
|
|
19277
|
-
|
|
21674
|
+
hasTag(tag: string): boolean;
|
|
19278
21675
|
}
|
|
19279
21676
|
|
|
19280
21677
|
/**
|
|
19281
|
-
*
|
|
19282
|
-
*
|
|
19283
|
-
*
|
|
21678
|
+
* @beta
|
|
21679
|
+
* Provides access to point-of-interest (POI) data in a
|
|
21680
|
+
* dimension.
|
|
19284
21681
|
*/
|
|
19285
|
-
|
|
19286
|
-
|
|
21682
|
+
export class PoiManager {
|
|
21683
|
+
private constructor();
|
|
19287
21684
|
/**
|
|
19288
21685
|
* @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.
|
|
21686
|
+
* Provides access to block-based points of interest in the
|
|
21687
|
+
* dimension.
|
|
19302
21688
|
*
|
|
19303
|
-
* {@link InvalidWaypointTextureSelectorError}
|
|
19304
21689
|
*/
|
|
19305
|
-
|
|
19306
|
-
player: Player,
|
|
19307
|
-
textureSelector: WaypointTextureSelector,
|
|
19308
|
-
playerRules: PlayerVisibilityRules,
|
|
19309
|
-
color?: RGB,
|
|
19310
|
-
);
|
|
21690
|
+
readonly blocks: PoiBlockManager;
|
|
19311
21691
|
}
|
|
19312
21692
|
|
|
19313
21693
|
/**
|
|
@@ -19392,10 +21772,10 @@ export class Potions {
|
|
|
19392
21772
|
*
|
|
19393
21773
|
* {@link InvalidPotionEffectTypeError}
|
|
19394
21774
|
*/
|
|
19395
|
-
static resolve
|
|
19396
|
-
|
|
19397
|
-
|
|
19398
|
-
): ItemStack;
|
|
21775
|
+
static resolve<
|
|
21776
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
21777
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
21778
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
19399
21779
|
}
|
|
19400
21780
|
|
|
19401
21781
|
/**
|
|
@@ -19530,6 +21910,10 @@ export class PrimitiveShape {
|
|
|
19530
21910
|
*
|
|
19531
21911
|
*/
|
|
19532
21912
|
color: RGBA;
|
|
21913
|
+
/**
|
|
21914
|
+
* @beta
|
|
21915
|
+
*/
|
|
21916
|
+
defaultVisibleToAll: boolean;
|
|
19533
21917
|
/**
|
|
19534
21918
|
* @remarks
|
|
19535
21919
|
* The dimension the shape is visible within. If the dimension
|
|
@@ -19544,6 +21928,10 @@ export class PrimitiveShape {
|
|
|
19544
21928
|
*
|
|
19545
21929
|
*/
|
|
19546
21930
|
readonly hasDuration: boolean;
|
|
21931
|
+
/**
|
|
21932
|
+
* @beta
|
|
21933
|
+
*/
|
|
21934
|
+
hiddenFrom: Player[];
|
|
19547
21935
|
/**
|
|
19548
21936
|
* @remarks
|
|
19549
21937
|
* The location of the shape.
|
|
@@ -19933,6 +22321,104 @@ export class RandomRegionalDifficultyChanceCondition extends LootItemCondition {
|
|
|
19933
22321
|
readonly maxChance: number;
|
|
19934
22322
|
}
|
|
19935
22323
|
|
|
22324
|
+
/**
|
|
22325
|
+
* @beta
|
|
22326
|
+
* Provides access to the slots and recipe of a players active
|
|
22327
|
+
* crafting UI ie. stonecutter.
|
|
22328
|
+
*/
|
|
22329
|
+
export class RecipeCraftingContext {
|
|
22330
|
+
private constructor();
|
|
22331
|
+
/**
|
|
22332
|
+
* @remarks
|
|
22333
|
+
* The amount of addressable input slots for getInputItem and
|
|
22334
|
+
* setInputItem.
|
|
22335
|
+
*
|
|
22336
|
+
* @throws This property can throw when used.
|
|
22337
|
+
*
|
|
22338
|
+
* {@link minecraftcommon.EngineError}
|
|
22339
|
+
*/
|
|
22340
|
+
readonly inputSlotCount: number;
|
|
22341
|
+
/**
|
|
22342
|
+
* @remarks
|
|
22343
|
+
* Whether this recipe crafting context is valid. Invalidates
|
|
22344
|
+
* when the player closes the crafting UI or leaves.
|
|
22345
|
+
*
|
|
22346
|
+
*/
|
|
22347
|
+
readonly isValid: boolean;
|
|
22348
|
+
/**
|
|
22349
|
+
* @remarks
|
|
22350
|
+
* The identifiers of the recipes that are valid for the
|
|
22351
|
+
* current input items.
|
|
22352
|
+
*
|
|
22353
|
+
* @throws This property can throw when used.
|
|
22354
|
+
*
|
|
22355
|
+
* {@link minecraftcommon.EngineError}
|
|
22356
|
+
*/
|
|
22357
|
+
readonly validRecipes: string[];
|
|
22358
|
+
/**
|
|
22359
|
+
* @remarks
|
|
22360
|
+
* Gets the item in the provided input slot.
|
|
22361
|
+
*
|
|
22362
|
+
* @param slot
|
|
22363
|
+
* The zero-based input slot index.
|
|
22364
|
+
* @returns
|
|
22365
|
+
* The item stack in the input slot, or undefined if the slot
|
|
22366
|
+
* is empty.
|
|
22367
|
+
* @throws This function can throw errors.
|
|
22368
|
+
*
|
|
22369
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
22370
|
+
*
|
|
22371
|
+
* {@link minecraftcommon.EngineError}
|
|
22372
|
+
*/
|
|
22373
|
+
getInputItem(slot: number): ItemStack | undefined;
|
|
22374
|
+
/**
|
|
22375
|
+
* @remarks
|
|
22376
|
+
* Gets the item produced by the currently selected recipe.
|
|
22377
|
+
*
|
|
22378
|
+
* @returns
|
|
22379
|
+
* The output item stack, or undefined if there is no output.
|
|
22380
|
+
* @throws This function can throw errors.
|
|
22381
|
+
*
|
|
22382
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
22383
|
+
*
|
|
22384
|
+
* {@link minecraftcommon.EngineError}
|
|
22385
|
+
*/
|
|
22386
|
+
getOutputItem(): ItemStack | undefined;
|
|
22387
|
+
/**
|
|
22388
|
+
* @remarks
|
|
22389
|
+
* Sets or clears an item in an input slot.
|
|
22390
|
+
*
|
|
22391
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
22392
|
+
*
|
|
22393
|
+
* @param slot
|
|
22394
|
+
* The zero-based input slot index.
|
|
22395
|
+
* @param item
|
|
22396
|
+
* The item stack to place in the slot, or undefined to clear
|
|
22397
|
+
* the slot.
|
|
22398
|
+
* @throws This function can throw errors.
|
|
22399
|
+
*
|
|
22400
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
22401
|
+
*
|
|
22402
|
+
* {@link minecraftcommon.EngineError}
|
|
22403
|
+
*/
|
|
22404
|
+
setInputItem(slot: number, item?: ItemStack): void;
|
|
22405
|
+
/**
|
|
22406
|
+
* @remarks
|
|
22407
|
+
* Selects a recipe for the current crafting operation.
|
|
22408
|
+
*
|
|
22409
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
22410
|
+
*
|
|
22411
|
+
* @param recipeId
|
|
22412
|
+
* The identifier of a valid recipe to select.
|
|
22413
|
+
* @throws This function can throw errors.
|
|
22414
|
+
*
|
|
22415
|
+
* {@link minecraftcommon.EngineError}
|
|
22416
|
+
*
|
|
22417
|
+
* {@link InvalidRecipeError}
|
|
22418
|
+
*/
|
|
22419
|
+
setSelectedRecipe(recipeId: string): void;
|
|
22420
|
+
}
|
|
22421
|
+
|
|
19936
22422
|
/**
|
|
19937
22423
|
* Contains objectives and participants for the scoreboard.
|
|
19938
22424
|
* @example updateScoreboard.ts
|
|
@@ -20610,7 +23096,39 @@ export class Seat {
|
|
|
20610
23096
|
* Angle in degrees to rotate riders by.
|
|
20611
23097
|
*
|
|
20612
23098
|
*/
|
|
20613
|
-
readonly seatRotation: number;
|
|
23099
|
+
readonly seatRotation: number;
|
|
23100
|
+
}
|
|
23101
|
+
|
|
23102
|
+
/**
|
|
23103
|
+
* @beta
|
|
23104
|
+
* Manages callbacks that are message passing to a server. This
|
|
23105
|
+
* event is not currently fully implemented, and should not be
|
|
23106
|
+
* used.
|
|
23107
|
+
*/
|
|
23108
|
+
export class ServerMessageAfterEventSignal {
|
|
23109
|
+
private constructor();
|
|
23110
|
+
/**
|
|
23111
|
+
* @remarks
|
|
23112
|
+
* Adds a callback that will be called when an internal message
|
|
23113
|
+
* is passed.
|
|
23114
|
+
*
|
|
23115
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
23116
|
+
*
|
|
23117
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
23118
|
+
*
|
|
23119
|
+
*/
|
|
23120
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
23121
|
+
/**
|
|
23122
|
+
* @remarks
|
|
23123
|
+
* Removes a callback from being called when an internal
|
|
23124
|
+
* message is passed.
|
|
23125
|
+
*
|
|
23126
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
23127
|
+
*
|
|
23128
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
23129
|
+
*
|
|
23130
|
+
*/
|
|
23131
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
20614
23132
|
}
|
|
20615
23133
|
|
|
20616
23134
|
/**
|
|
@@ -20641,6 +23159,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
20641
23159
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20642
23160
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
20643
23161
|
private constructor();
|
|
23162
|
+
/**
|
|
23163
|
+
* @beta
|
|
23164
|
+
* @remarks
|
|
23165
|
+
* The base color for the dropped banner.
|
|
23166
|
+
*
|
|
23167
|
+
*/
|
|
23168
|
+
readonly baseColor: string;
|
|
23169
|
+
/**
|
|
23170
|
+
* @beta
|
|
23171
|
+
* @remarks
|
|
23172
|
+
* An array of {@link BannerPattern} objects used to decorate
|
|
23173
|
+
* the banner, including color and pattern type.
|
|
23174
|
+
*
|
|
23175
|
+
*/
|
|
23176
|
+
readonly patterns: BannerPattern[];
|
|
20644
23177
|
/**
|
|
20645
23178
|
* @remarks
|
|
20646
23179
|
* The type of banner to drop.
|
|
@@ -21877,6 +24410,19 @@ export class SystemBeforeEvents {
|
|
|
21877
24410
|
*
|
|
21878
24411
|
*/
|
|
21879
24412
|
readonly startup: StartupBeforeEventSignal;
|
|
24413
|
+
/**
|
|
24414
|
+
* @beta
|
|
24415
|
+
* @remarks
|
|
24416
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
24417
|
+
* can be due to using too much memory, or by causing
|
|
24418
|
+
* significant slowdown or hang.
|
|
24419
|
+
* To prevent shutdown, set the event's cancel property to
|
|
24420
|
+
* true.
|
|
24421
|
+
*
|
|
24422
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
24423
|
+
*
|
|
24424
|
+
*/
|
|
24425
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
21880
24426
|
}
|
|
21881
24427
|
|
|
21882
24428
|
/**
|
|
@@ -22309,6 +24855,71 @@ export class TripWireTripAfterEventSignal {
|
|
|
22309
24855
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
22310
24856
|
}
|
|
22311
24857
|
|
|
24858
|
+
/**
|
|
24859
|
+
* @beta
|
|
24860
|
+
* Contains information related to a script watchdog
|
|
24861
|
+
* termination.
|
|
24862
|
+
*/
|
|
24863
|
+
export class WatchdogTerminateBeforeEvent {
|
|
24864
|
+
private constructor();
|
|
24865
|
+
/**
|
|
24866
|
+
* @remarks
|
|
24867
|
+
* If set to true, cancels the termination of the script
|
|
24868
|
+
* runtime. Note that depending on server configuration
|
|
24869
|
+
* settings, cancellation of the termination may not be
|
|
24870
|
+
* allowed.
|
|
24871
|
+
*
|
|
24872
|
+
*/
|
|
24873
|
+
cancel: boolean;
|
|
24874
|
+
/**
|
|
24875
|
+
* @remarks
|
|
24876
|
+
* Contains the reason why a script runtime is to be
|
|
24877
|
+
* terminated.
|
|
24878
|
+
*
|
|
24879
|
+
*/
|
|
24880
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
24881
|
+
}
|
|
24882
|
+
|
|
24883
|
+
/**
|
|
24884
|
+
* @beta
|
|
24885
|
+
* Manages callbacks that are connected to a callback that will
|
|
24886
|
+
* be called when a script runtime is being terminated due to a
|
|
24887
|
+
* violation of the performance watchdog system.
|
|
24888
|
+
*/
|
|
24889
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
24890
|
+
private constructor();
|
|
24891
|
+
/**
|
|
24892
|
+
* @remarks
|
|
24893
|
+
* Adds a callback that will be called when a script runtime is
|
|
24894
|
+
* being terminated due to a violation of the performance
|
|
24895
|
+
* watchdog system.
|
|
24896
|
+
*
|
|
24897
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
24898
|
+
*
|
|
24899
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
24900
|
+
*
|
|
24901
|
+
* @param callback
|
|
24902
|
+
* This closure is called with restricted-execution privilege.
|
|
24903
|
+
* @returns
|
|
24904
|
+
* Closure that is called with restricted-execution privilege.
|
|
24905
|
+
*/
|
|
24906
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
24907
|
+
/**
|
|
24908
|
+
* @remarks
|
|
24909
|
+
* Removes a callback from being called when a script runtime
|
|
24910
|
+
* is being terminated due to a violation of the performance
|
|
24911
|
+
* watchdog system.
|
|
24912
|
+
*
|
|
24913
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
24914
|
+
*
|
|
24915
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
24916
|
+
*
|
|
24917
|
+
* @param callback
|
|
24918
|
+
* This closure is called with restricted-execution privilege.
|
|
24919
|
+
*/
|
|
24920
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
24921
|
+
}
|
|
24922
|
+
|
|
22312
24923
|
/**
|
|
22313
24924
|
* Base class for waypoints displayed on the player's locator
|
|
22314
24925
|
* bar. Waypoints can track locations or entities and are
|
|
@@ -22524,6 +25135,15 @@ export class World {
|
|
|
22524
25135
|
*
|
|
22525
25136
|
*/
|
|
22526
25137
|
readonly afterEvents: WorldAfterEvents;
|
|
25138
|
+
/**
|
|
25139
|
+
* @beta
|
|
25140
|
+
* @remarks
|
|
25141
|
+
* Enables or disables cheats.
|
|
25142
|
+
*
|
|
25143
|
+
* @privilege restricted-execution-read-only - This property can't be edited in restricted-execution mode.
|
|
25144
|
+
*
|
|
25145
|
+
*/
|
|
25146
|
+
allowCheats: boolean;
|
|
22527
25147
|
/**
|
|
22528
25148
|
* @remarks
|
|
22529
25149
|
* Contains a set of events that are applicable to the entirety
|
|
@@ -22608,6 +25228,20 @@ export class World {
|
|
|
22608
25228
|
*
|
|
22609
25229
|
*/
|
|
22610
25230
|
readonly tickingAreaManager: TickingAreaManager;
|
|
25231
|
+
/**
|
|
25232
|
+
* @beta
|
|
25233
|
+
* @remarks
|
|
25234
|
+
* A method that is internal-only, used for broadcasting
|
|
25235
|
+
* specific messages between client and server.
|
|
25236
|
+
*
|
|
25237
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25238
|
+
*
|
|
25239
|
+
* @param id
|
|
25240
|
+
* The message identifier.
|
|
25241
|
+
* @param value
|
|
25242
|
+
* The message.
|
|
25243
|
+
*/
|
|
25244
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
22611
25245
|
/**
|
|
22612
25246
|
* @remarks
|
|
22613
25247
|
* Clears the set of dynamic properties declared for this
|
|
@@ -22859,6 +25493,8 @@ export class World {
|
|
|
22859
25493
|
*
|
|
22860
25494
|
* @throws This function can throw errors.
|
|
22861
25495
|
*
|
|
25496
|
+
* {@link minecraftcommon.EngineError}
|
|
25497
|
+
*
|
|
22862
25498
|
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
22863
25499
|
* @example playMusicAndSound.ts
|
|
22864
25500
|
* ```typescript
|
|
@@ -22889,7 +25525,7 @@ export class World {
|
|
|
22889
25525
|
* }
|
|
22890
25526
|
* ```
|
|
22891
25527
|
*/
|
|
22892
|
-
playMusic(trackId: string, musicOptions?: MusicOptions):
|
|
25528
|
+
playMusic(trackId: SoundDefinition | string, musicOptions?: MusicOptions): SoundInstance | undefined;
|
|
22893
25529
|
/**
|
|
22894
25530
|
* @remarks
|
|
22895
25531
|
* Queues an additional music track for players. If a track is
|
|
@@ -23113,6 +25749,16 @@ export class WorldAfterEvents {
|
|
|
23113
25749
|
*
|
|
23114
25750
|
*/
|
|
23115
25751
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
25752
|
+
/**
|
|
25753
|
+
* @beta
|
|
25754
|
+
* @remarks
|
|
25755
|
+
* This event is triggered after a chat message has been
|
|
25756
|
+
* broadcast or sent to players.
|
|
25757
|
+
*
|
|
25758
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
25759
|
+
*
|
|
25760
|
+
*/
|
|
25761
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
23116
25762
|
/**
|
|
23117
25763
|
* @remarks
|
|
23118
25764
|
* This event is fired when an entity event has been triggered
|
|
@@ -23356,6 +26002,25 @@ export class WorldAfterEvents {
|
|
|
23356
26002
|
*
|
|
23357
26003
|
*/
|
|
23358
26004
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
26005
|
+
/**
|
|
26006
|
+
* @beta
|
|
26007
|
+
* @remarks
|
|
26008
|
+
* This event is an internal implementation detail, and is
|
|
26009
|
+
* otherwise not currently functional.
|
|
26010
|
+
*
|
|
26011
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26012
|
+
*
|
|
26013
|
+
*/
|
|
26014
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
26015
|
+
/**
|
|
26016
|
+
* @beta
|
|
26017
|
+
* @remarks
|
|
26018
|
+
* This event is triggered when a pack setting is changed.
|
|
26019
|
+
*
|
|
26020
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26021
|
+
*
|
|
26022
|
+
*/
|
|
26023
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
23359
26024
|
/**
|
|
23360
26025
|
* @remarks
|
|
23361
26026
|
* This event fires when a piston expands or retracts.
|
|
@@ -23389,6 +26054,35 @@ export class WorldAfterEvents {
|
|
|
23389
26054
|
*
|
|
23390
26055
|
*/
|
|
23391
26056
|
readonly playerCancelBreakingBlock: PlayerCancelBreakingBlockAfterEventSignal;
|
|
26057
|
+
/**
|
|
26058
|
+
* @beta
|
|
26059
|
+
* @remarks
|
|
26060
|
+
* This event fires when a player crafts a recipe.
|
|
26061
|
+
*
|
|
26062
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26063
|
+
*
|
|
26064
|
+
*/
|
|
26065
|
+
readonly playerCraftRecipe: PlayerCraftRecipeAfterEventSignal;
|
|
26066
|
+
/**
|
|
26067
|
+
* @beta
|
|
26068
|
+
* @remarks
|
|
26069
|
+
* Event signal that fires when a player grabs an item from a
|
|
26070
|
+
* container to their cursor.
|
|
26071
|
+
*
|
|
26072
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26073
|
+
*
|
|
26074
|
+
*/
|
|
26075
|
+
readonly playerCursorItemGrab: PlayerCursorItemGrabAfterEventSignal;
|
|
26076
|
+
/**
|
|
26077
|
+
* @beta
|
|
26078
|
+
* @remarks
|
|
26079
|
+
* Event signal that fires when a player releases an item from
|
|
26080
|
+
* their cursor into a container.
|
|
26081
|
+
*
|
|
26082
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26083
|
+
*
|
|
26084
|
+
*/
|
|
26085
|
+
readonly playerCursorItemRelease: PlayerCursorItemReleaseAfterEventSignal;
|
|
23392
26086
|
/**
|
|
23393
26087
|
* @remarks
|
|
23394
26088
|
* Fires when a player moved to a different dimension.
|
|
@@ -23508,6 +26202,16 @@ export class WorldAfterEvents {
|
|
|
23508
26202
|
*
|
|
23509
26203
|
*/
|
|
23510
26204
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
26205
|
+
/**
|
|
26206
|
+
* @beta
|
|
26207
|
+
* @remarks
|
|
26208
|
+
* An event for when a player uses a named name tag on an
|
|
26209
|
+
* entity.
|
|
26210
|
+
*
|
|
26211
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26212
|
+
*
|
|
26213
|
+
*/
|
|
26214
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
23511
26215
|
/**
|
|
23512
26216
|
* @remarks
|
|
23513
26217
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -23633,6 +26337,43 @@ export class WorldAfterEvents {
|
|
|
23633
26337
|
*/
|
|
23634
26338
|
export class WorldBeforeEvents {
|
|
23635
26339
|
private constructor();
|
|
26340
|
+
/**
|
|
26341
|
+
* @beta
|
|
26342
|
+
* @remarks
|
|
26343
|
+
* This event is triggered after a chat message has been
|
|
26344
|
+
* broadcast or sent to players.
|
|
26345
|
+
*
|
|
26346
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26347
|
+
*
|
|
26348
|
+
* @example customCommand.ts
|
|
26349
|
+
* ```typescript
|
|
26350
|
+
* import { world, DimensionLocation } from '@minecraft/server';
|
|
26351
|
+
*
|
|
26352
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
26353
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe(eventData => {
|
|
26354
|
+
* if (eventData.message.includes('cancel')) {
|
|
26355
|
+
* // Cancel event if the message contains "cancel"
|
|
26356
|
+
* eventData.cancel = true;
|
|
26357
|
+
* } else {
|
|
26358
|
+
* const args = eventData.message.split(' ');
|
|
26359
|
+
*
|
|
26360
|
+
* if (args.length > 0) {
|
|
26361
|
+
* switch (args[0].toLowerCase()) {
|
|
26362
|
+
* case 'echo':
|
|
26363
|
+
* // Send a modified version of chat message
|
|
26364
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
26365
|
+
* break;
|
|
26366
|
+
* case 'help':
|
|
26367
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
26368
|
+
* break;
|
|
26369
|
+
* }
|
|
26370
|
+
* }
|
|
26371
|
+
* }
|
|
26372
|
+
* });
|
|
26373
|
+
* }
|
|
26374
|
+
* ```
|
|
26375
|
+
*/
|
|
26376
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
23636
26377
|
/**
|
|
23637
26378
|
* @remarks
|
|
23638
26379
|
* This event is triggered after an event has been added to an
|
|
@@ -23726,6 +26467,13 @@ export class WorldBeforeEvents {
|
|
|
23726
26467
|
*
|
|
23727
26468
|
*/
|
|
23728
26469
|
readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
|
|
26470
|
+
/**
|
|
26471
|
+
* @beta
|
|
26472
|
+
* @remarks
|
|
26473
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26474
|
+
*
|
|
26475
|
+
*/
|
|
26476
|
+
readonly playerItemAttackEntity: PlayerItemAttackEntityBeforeEventSignal;
|
|
23729
26477
|
/**
|
|
23730
26478
|
* @remarks
|
|
23731
26479
|
* Fires when a player leaves the game.
|
|
@@ -23734,6 +26482,15 @@ export class WorldBeforeEvents {
|
|
|
23734
26482
|
*
|
|
23735
26483
|
*/
|
|
23736
26484
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
26485
|
+
/**
|
|
26486
|
+
* @beta
|
|
26487
|
+
* @remarks
|
|
26488
|
+
* This event fires before a block is placed by a player.
|
|
26489
|
+
*
|
|
26490
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26491
|
+
*
|
|
26492
|
+
*/
|
|
26493
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
23737
26494
|
/**
|
|
23738
26495
|
* @remarks
|
|
23739
26496
|
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
@@ -24273,7 +27030,9 @@ export interface BiomeSearchOptions {
|
|
|
24273
27030
|
* A BlockBoundingBox is an interface to an object which
|
|
24274
27031
|
* represents an AABB aligned rectangle.
|
|
24275
27032
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
24276
|
-
* state (min <= max) but cannot guarantee it
|
|
27033
|
+
* state (min <= max) but cannot guarantee it (unless it was
|
|
27034
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
27035
|
+
* utility functions.
|
|
24277
27036
|
* The min/max coordinates represent the diametrically opposite
|
|
24278
27037
|
* corners of the rectangle.
|
|
24279
27038
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -24360,6 +27119,14 @@ export interface BlockCustomComponent {
|
|
|
24360
27119
|
*
|
|
24361
27120
|
*/
|
|
24362
27121
|
onEntityFallOn?: (arg0: BlockComponentEntityFallOnEvent, arg1: CustomComponentParameters) => void;
|
|
27122
|
+
/**
|
|
27123
|
+
* @beta
|
|
27124
|
+
*/
|
|
27125
|
+
onNamedTick?: (arg0: BlockComponentNamedTickEvent, arg1: CustomComponentParameters) => void;
|
|
27126
|
+
/**
|
|
27127
|
+
* @beta
|
|
27128
|
+
*/
|
|
27129
|
+
onNeighborChanged?: (arg0: BlockComponentNeighborChangedAfterEvent, arg1: CustomComponentParameters) => void;
|
|
24363
27130
|
/**
|
|
24364
27131
|
* @remarks
|
|
24365
27132
|
* This function will be called when the block that this custom
|
|
@@ -24899,6 +27666,15 @@ export interface CustomCommand {
|
|
|
24899
27666
|
* command.
|
|
24900
27667
|
*/
|
|
24901
27668
|
export interface CustomCommandParameter {
|
|
27669
|
+
/**
|
|
27670
|
+
* @beta
|
|
27671
|
+
* @remarks
|
|
27672
|
+
* Can be used to reference the enum name when
|
|
27673
|
+
* {@link CustomCommandParamType} is 'Enum'. Allows the
|
|
27674
|
+
* parameter name to be different from the enum name.
|
|
27675
|
+
*
|
|
27676
|
+
*/
|
|
27677
|
+
enumName?: string;
|
|
24902
27678
|
/**
|
|
24903
27679
|
* @remarks
|
|
24904
27680
|
* The name of parameter as it appears on the command line.
|
|
@@ -24919,10 +27695,11 @@ export interface CustomCommandParameter {
|
|
|
24919
27695
|
export interface CustomCommandResult {
|
|
24920
27696
|
/**
|
|
24921
27697
|
* @remarks
|
|
24922
|
-
* Message displayed to chat after command execution.
|
|
27698
|
+
* Message displayed to chat after command execution. Accepts a
|
|
27699
|
+
* {@link RawMessage} or a plain string.
|
|
24923
27700
|
*
|
|
24924
27701
|
*/
|
|
24925
|
-
message?: string;
|
|
27702
|
+
message?: RawMessage | string;
|
|
24926
27703
|
/**
|
|
24927
27704
|
* @remarks
|
|
24928
27705
|
* Command execution Success or Failure. Determines how the
|
|
@@ -24977,6 +27754,14 @@ export interface DefinitionModifier {
|
|
|
24977
27754
|
*
|
|
24978
27755
|
*/
|
|
24979
27756
|
removedComponentGroups: string[];
|
|
27757
|
+
/**
|
|
27758
|
+
* @beta
|
|
27759
|
+
* @remarks
|
|
27760
|
+
* The list of entity definition events that will be fired via
|
|
27761
|
+
* this update.
|
|
27762
|
+
*
|
|
27763
|
+
*/
|
|
27764
|
+
triggers: Trigger[];
|
|
24980
27765
|
}
|
|
24981
27766
|
|
|
24982
27767
|
/**
|
|
@@ -26220,6 +29005,35 @@ export interface MusicOptions {
|
|
|
26220
29005
|
volume?: number;
|
|
26221
29006
|
}
|
|
26222
29007
|
|
|
29008
|
+
/**
|
|
29009
|
+
* @beta
|
|
29010
|
+
* Contains information regarding a block change in one
|
|
29011
|
+
* neighboring direction.
|
|
29012
|
+
*/
|
|
29013
|
+
export interface NeighborChange {
|
|
29014
|
+
/**
|
|
29015
|
+
* @remarks
|
|
29016
|
+
* The permutation of the neighboring block after its last
|
|
29017
|
+
* change during the tick.
|
|
29018
|
+
*
|
|
29019
|
+
*/
|
|
29020
|
+
blockPermutation: BlockPermutation;
|
|
29021
|
+
/**
|
|
29022
|
+
* @remarks
|
|
29023
|
+
* Direction from the block receiving the event to the
|
|
29024
|
+
* neighboring block that changed.
|
|
29025
|
+
*
|
|
29026
|
+
*/
|
|
29027
|
+
direction: Direction;
|
|
29028
|
+
/**
|
|
29029
|
+
* @remarks
|
|
29030
|
+
* The permutation of the neighboring block before its first
|
|
29031
|
+
* change during the tick.
|
|
29032
|
+
*
|
|
29033
|
+
*/
|
|
29034
|
+
previousPermutation: BlockPermutation;
|
|
29035
|
+
}
|
|
29036
|
+
|
|
26223
29037
|
/**
|
|
26224
29038
|
* Not equal to operator.
|
|
26225
29039
|
*/
|
|
@@ -26328,6 +29142,31 @@ export interface PlayerBreakingBlockEventOptions {
|
|
|
26328
29142
|
playerFilter?: EntityFilter;
|
|
26329
29143
|
}
|
|
26330
29144
|
|
|
29145
|
+
/**
|
|
29146
|
+
* @beta
|
|
29147
|
+
* Contains options for filtering player craft recipe events.
|
|
29148
|
+
*/
|
|
29149
|
+
export interface PlayerCraftRecipeEventOptions {
|
|
29150
|
+
/**
|
|
29151
|
+
* @remarks
|
|
29152
|
+
* Filter for the block where the recipe is crafted.
|
|
29153
|
+
*
|
|
29154
|
+
*/
|
|
29155
|
+
blockFilter?: BlockFilter;
|
|
29156
|
+
/**
|
|
29157
|
+
* @remarks
|
|
29158
|
+
* Filter for the item crafted by the player.
|
|
29159
|
+
*
|
|
29160
|
+
*/
|
|
29161
|
+
itemFilter?: ItemFilter;
|
|
29162
|
+
/**
|
|
29163
|
+
* @remarks
|
|
29164
|
+
* Filter for the player crafting the recipe.
|
|
29165
|
+
*
|
|
29166
|
+
*/
|
|
29167
|
+
playerFilter?: EntityFilter;
|
|
29168
|
+
}
|
|
29169
|
+
|
|
26331
29170
|
/**
|
|
26332
29171
|
* Additional options for how a sound plays for a player.
|
|
26333
29172
|
*/
|
|
@@ -26423,6 +29262,56 @@ export interface PlayerVisibilityRules extends EntityVisibilityRules {
|
|
|
26423
29262
|
showSpectatorToSpectator?: boolean;
|
|
26424
29263
|
}
|
|
26425
29264
|
|
|
29265
|
+
/**
|
|
29266
|
+
* @beta
|
|
29267
|
+
* Associates a block point-of-interest instance with its
|
|
29268
|
+
* squared distance from a query center.
|
|
29269
|
+
*/
|
|
29270
|
+
export interface PoiDistancePair {
|
|
29271
|
+
/**
|
|
29272
|
+
* @remarks
|
|
29273
|
+
* Squared three-dimensional distance, in blocks squared, from
|
|
29274
|
+
* the query center to the POI position.
|
|
29275
|
+
*
|
|
29276
|
+
*/
|
|
29277
|
+
distance: number;
|
|
29278
|
+
/**
|
|
29279
|
+
* @remarks
|
|
29280
|
+
* POI instance at this distance.
|
|
29281
|
+
*
|
|
29282
|
+
*/
|
|
29283
|
+
poi: PoiBlockInstance;
|
|
29284
|
+
}
|
|
29285
|
+
|
|
29286
|
+
/**
|
|
29287
|
+
* @beta
|
|
29288
|
+
* Selects block point-of-interest types by their exact
|
|
29289
|
+
* namespaced identifier.
|
|
29290
|
+
*/
|
|
29291
|
+
export interface PoiNameFilter {
|
|
29292
|
+
/**
|
|
29293
|
+
* @remarks
|
|
29294
|
+
* Exact namespaced POI type identifier to match.
|
|
29295
|
+
*
|
|
29296
|
+
*/
|
|
29297
|
+
name: string;
|
|
29298
|
+
}
|
|
29299
|
+
|
|
29300
|
+
/**
|
|
29301
|
+
* @beta
|
|
29302
|
+
* Selects block point-of-interest types that have all
|
|
29303
|
+
* specified tags.
|
|
29304
|
+
*/
|
|
29305
|
+
export interface PoiTagFilter {
|
|
29306
|
+
/**
|
|
29307
|
+
* @remarks
|
|
29308
|
+
* Namespaced POI tags that a matching type must contain. All
|
|
29309
|
+
* tags in the array are required.
|
|
29310
|
+
*
|
|
29311
|
+
*/
|
|
29312
|
+
tags: string[];
|
|
29313
|
+
}
|
|
29314
|
+
|
|
26426
29315
|
/**
|
|
26427
29316
|
* Contains optional filters that control which primitive
|
|
26428
29317
|
* shapes are returned from a primitive shapes query.
|
|
@@ -26747,6 +29636,14 @@ export interface RotationKeyFrame {
|
|
|
26747
29636
|
timeSeconds: number;
|
|
26748
29637
|
}
|
|
26749
29638
|
|
|
29639
|
+
/**
|
|
29640
|
+
* @beta
|
|
29641
|
+
*/
|
|
29642
|
+
export interface ScheduledNamedTick {
|
|
29643
|
+
eventName: string;
|
|
29644
|
+
tickDelay: number;
|
|
29645
|
+
}
|
|
29646
|
+
|
|
26750
29647
|
/**
|
|
26751
29648
|
* Contains additional options for how a scoreboard should be
|
|
26752
29649
|
* displayed within its display slot.
|
|
@@ -27728,6 +30625,23 @@ export class InvalidPotionEffectTypeError extends Error {
|
|
|
27728
30625
|
private constructor();
|
|
27729
30626
|
}
|
|
27730
30627
|
|
|
30628
|
+
/**
|
|
30629
|
+
* @beta
|
|
30630
|
+
* Thrown when an invalid recipe identifier is used.
|
|
30631
|
+
*/
|
|
30632
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
30633
|
+
export class InvalidRecipeError extends Error {
|
|
30634
|
+
private constructor();
|
|
30635
|
+
/**
|
|
30636
|
+
* @remarks
|
|
30637
|
+
* The identifier of the invalid recipe.
|
|
30638
|
+
*
|
|
30639
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
30640
|
+
*
|
|
30641
|
+
*/
|
|
30642
|
+
readonly recipeId: string;
|
|
30643
|
+
}
|
|
30644
|
+
|
|
27731
30645
|
/**
|
|
27732
30646
|
* Thrown when a Structure is invalid. A structure becomes
|
|
27733
30647
|
* invalid when it is deleted.
|