@minecraft/server 2.6.0-rc.1.26.10-preview.22 → 2.7.0-beta.1.26.10-preview.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2977 -211
- 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.7.0-beta"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -24,6 +24,25 @@
|
|
|
24
24
|
import * as minecraftcommon from '@minecraft/common';
|
|
25
25
|
// @ts-ignore Optional types-only package, will decay to any if @minecraft/vanilla-data isn't installed
|
|
26
26
|
import type * as minecraftvanilladata from '@minecraft/vanilla-data';
|
|
27
|
+
/**
|
|
28
|
+
* @beta
|
|
29
|
+
* Specifies different targeting modes for use in aim-assist.
|
|
30
|
+
*/
|
|
31
|
+
export enum AimAssistTargetMode {
|
|
32
|
+
/**
|
|
33
|
+
* @remarks
|
|
34
|
+
* Angle based targeting.
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
Angle = 'Angle',
|
|
38
|
+
/**
|
|
39
|
+
* @remarks
|
|
40
|
+
* Distance based targeting.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
Distance = 'Distance',
|
|
44
|
+
}
|
|
45
|
+
|
|
27
46
|
/**
|
|
28
47
|
* The types of block components that are accessible via
|
|
29
48
|
* function Block.getComponent.
|
|
@@ -215,6 +234,55 @@ export enum CommandPermissionLevel {
|
|
|
215
234
|
Owner = 4,
|
|
216
235
|
}
|
|
217
236
|
|
|
237
|
+
/**
|
|
238
|
+
* @beta
|
|
239
|
+
* The Action enum determines how the CompoundBlockVolume
|
|
240
|
+
* considers the associated CompoundBlockVolumeItem when
|
|
241
|
+
* performing inside/outside calculations.
|
|
242
|
+
*/
|
|
243
|
+
export enum CompoundBlockVolumeAction {
|
|
244
|
+
/**
|
|
245
|
+
* @remarks
|
|
246
|
+
* The associated BlockVolume is considered a positive space,
|
|
247
|
+
* and any intersection tests are considered hits
|
|
248
|
+
*
|
|
249
|
+
*/
|
|
250
|
+
Add = 0,
|
|
251
|
+
/**
|
|
252
|
+
* @remarks
|
|
253
|
+
* The associated BlockVolume is considered a negative or void
|
|
254
|
+
* space, and any intersection tests are considered misses.
|
|
255
|
+
* Using the Subtract action, it is possible to `punch holes`
|
|
256
|
+
* in block volumes so that any intersection tests may pass
|
|
257
|
+
* through such spaces
|
|
258
|
+
*
|
|
259
|
+
*/
|
|
260
|
+
Subtract = 1,
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* @beta
|
|
265
|
+
* An enum describing the relativity of the
|
|
266
|
+
* CompoundBlockVolumeItem, relative to the parent
|
|
267
|
+
* CompoundVolume.
|
|
268
|
+
*/
|
|
269
|
+
export enum CompoundBlockVolumePositionRelativity {
|
|
270
|
+
/**
|
|
271
|
+
* @remarks
|
|
272
|
+
* The locations within the associated BlockVolume are relative
|
|
273
|
+
* to the CompoundBlockVolume to which they were added
|
|
274
|
+
*
|
|
275
|
+
*/
|
|
276
|
+
Relative = 0,
|
|
277
|
+
/**
|
|
278
|
+
* @remarks
|
|
279
|
+
* The locations within the associated BlockVolume are in
|
|
280
|
+
* absolute world space
|
|
281
|
+
*
|
|
282
|
+
*/
|
|
283
|
+
Absolute = 1,
|
|
284
|
+
}
|
|
285
|
+
|
|
218
286
|
/**
|
|
219
287
|
* Reasons that the {@link
|
|
220
288
|
* @minecraft/server.ContainerRulesError} was thrown.
|
|
@@ -317,6 +385,13 @@ export enum CustomCommandErrorReason {
|
|
|
317
385
|
*
|
|
318
386
|
*/
|
|
319
387
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
388
|
+
/**
|
|
389
|
+
* @beta
|
|
390
|
+
* @remarks
|
|
391
|
+
* Non enum type command parameters cannot use enumName.
|
|
392
|
+
*
|
|
393
|
+
*/
|
|
394
|
+
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
320
395
|
}
|
|
321
396
|
|
|
322
397
|
/**
|
|
@@ -684,6 +759,23 @@ export enum EnchantmentSlot {
|
|
|
684
759
|
Sword = 'Sword',
|
|
685
760
|
}
|
|
686
761
|
|
|
762
|
+
/**
|
|
763
|
+
* @beta
|
|
764
|
+
* The entity's attach location point. Contains points such as
|
|
765
|
+
* head, body, leg, etc to attach the camera to.
|
|
766
|
+
*/
|
|
767
|
+
export enum EntityAttachPoint {
|
|
768
|
+
Body = 'Body',
|
|
769
|
+
BreathingPoint = 'BreathingPoint',
|
|
770
|
+
DropAttachPoint = 'DropAttachPoint',
|
|
771
|
+
ExplosionPoint = 'ExplosionPoint',
|
|
772
|
+
Eyes = 'Eyes',
|
|
773
|
+
Feet = 'Feet',
|
|
774
|
+
Head = 'Head',
|
|
775
|
+
Mouth = 'Mouth',
|
|
776
|
+
WeaponAttachPoint = 'WeaponAttachPoint',
|
|
777
|
+
}
|
|
778
|
+
|
|
687
779
|
/**
|
|
688
780
|
* The types of entity components that are accessible via
|
|
689
781
|
* function Entity.getComponent.
|
|
@@ -1031,6 +1123,14 @@ export enum EntityComponentTypes {
|
|
|
1031
1123
|
*
|
|
1032
1124
|
*/
|
|
1033
1125
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1126
|
+
/**
|
|
1127
|
+
* @beta
|
|
1128
|
+
* @remarks
|
|
1129
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
1130
|
+
* name, and dialogue interactions.
|
|
1131
|
+
*
|
|
1132
|
+
*/
|
|
1133
|
+
Npc = 'minecraft:npc',
|
|
1034
1134
|
/**
|
|
1035
1135
|
* @remarks
|
|
1036
1136
|
* When present on an entity, this entity is on fire.
|
|
@@ -1510,6 +1610,14 @@ export enum EntitySwingSource {
|
|
|
1510
1610
|
* and mainhand slots.
|
|
1511
1611
|
*/
|
|
1512
1612
|
export enum EquipmentSlot {
|
|
1613
|
+
/**
|
|
1614
|
+
* @beta
|
|
1615
|
+
* @remarks
|
|
1616
|
+
* The body slot. This slot is used to hold armor for
|
|
1617
|
+
* non-humanoid mobs.
|
|
1618
|
+
*
|
|
1619
|
+
*/
|
|
1620
|
+
Body = 'Body',
|
|
1513
1621
|
/**
|
|
1514
1622
|
* @remarks
|
|
1515
1623
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1752,6 +1860,10 @@ export enum GameRule {
|
|
|
1752
1860
|
*
|
|
1753
1861
|
*/
|
|
1754
1862
|
KeepInventory = 'keepInventory',
|
|
1863
|
+
/**
|
|
1864
|
+
* @beta
|
|
1865
|
+
*/
|
|
1866
|
+
LocatorBar = 'locatorBar',
|
|
1755
1867
|
/**
|
|
1756
1868
|
* @remarks
|
|
1757
1869
|
* The maximum number of chained commands that can execute per
|
|
@@ -2735,6 +2847,41 @@ export enum StructureSaveMode {
|
|
|
2735
2847
|
World = 'World',
|
|
2736
2848
|
}
|
|
2737
2849
|
|
|
2850
|
+
/**
|
|
2851
|
+
* @beta
|
|
2852
|
+
* The reason that the {@link
|
|
2853
|
+
* @minecraft/server.TickingAreaError} was thrown.
|
|
2854
|
+
*/
|
|
2855
|
+
export enum TickingAreaErrorReason {
|
|
2856
|
+
/**
|
|
2857
|
+
* @remarks
|
|
2858
|
+
* Added a ticking area with an identifier that already exists.
|
|
2859
|
+
*
|
|
2860
|
+
*/
|
|
2861
|
+
IdentifierAlreadyExists = 'IdentifierAlreadyExists',
|
|
2862
|
+
/**
|
|
2863
|
+
* @remarks
|
|
2864
|
+
* Adding this ticking area pushed the ticking areas over the
|
|
2865
|
+
* limit specified by {@link TickingAreaManager.maxChunkCount}.
|
|
2866
|
+
*
|
|
2867
|
+
*/
|
|
2868
|
+
OverChunkLimit = 'OverChunkLimit',
|
|
2869
|
+
/**
|
|
2870
|
+
* @remarks
|
|
2871
|
+
* Exceeded the 255 chunk limit for the length or width of the
|
|
2872
|
+
* ticking area.
|
|
2873
|
+
*
|
|
2874
|
+
*/
|
|
2875
|
+
SideLengthExceeded = 'SideLengthExceeded',
|
|
2876
|
+
/**
|
|
2877
|
+
* @remarks
|
|
2878
|
+
* Tried to remove ticking area with identifier not registered
|
|
2879
|
+
* in the {@link TickingAreaManager}.
|
|
2880
|
+
*
|
|
2881
|
+
*/
|
|
2882
|
+
UnknownIdentifier = 'UnknownIdentifier',
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2738
2885
|
/**
|
|
2739
2886
|
* Provides numeric values for common periods in the Minecraft
|
|
2740
2887
|
* day.
|
|
@@ -2834,6 +2981,29 @@ export enum TintMethod {
|
|
|
2834
2981
|
Water = 'Water',
|
|
2835
2982
|
}
|
|
2836
2983
|
|
|
2984
|
+
/**
|
|
2985
|
+
* @beta
|
|
2986
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
2987
|
+
* to terminate execution of a behavior packs' script.
|
|
2988
|
+
*/
|
|
2989
|
+
export enum WatchdogTerminateReason {
|
|
2990
|
+
/**
|
|
2991
|
+
* @remarks
|
|
2992
|
+
* Script runtime for a behavior pack is terminated due to
|
|
2993
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
2994
|
+
*
|
|
2995
|
+
*/
|
|
2996
|
+
Hang = 'Hang',
|
|
2997
|
+
/**
|
|
2998
|
+
* @remarks
|
|
2999
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3000
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3001
|
+
* function calls.
|
|
3002
|
+
*
|
|
3003
|
+
*/
|
|
3004
|
+
StackOverflow = 'StackOverflow',
|
|
3005
|
+
}
|
|
3006
|
+
|
|
2837
3007
|
/**
|
|
2838
3008
|
* Used to specify the type of weather condition within the
|
|
2839
3009
|
* world.
|
|
@@ -2985,6 +3155,7 @@ export type EntityComponentTypeMap = {
|
|
|
2985
3155
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
2986
3156
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
2987
3157
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3158
|
+
'minecraft:npc': EntityNpcComponent;
|
|
2988
3159
|
'minecraft:onfire': EntityOnFireComponent;
|
|
2989
3160
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
2990
3161
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -3018,6 +3189,7 @@ export type EntityComponentTypeMap = {
|
|
|
3018
3189
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3019
3190
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3020
3191
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3192
|
+
npc: EntityNpcComponent;
|
|
3021
3193
|
onfire: EntityOnFireComponent;
|
|
3022
3194
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3023
3195
|
'player.hunger': EntityHungerComponent;
|
|
@@ -3037,6 +3209,15 @@ export type EntityComponentTypeMap = {
|
|
|
3037
3209
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3038
3210
|
};
|
|
3039
3211
|
|
|
3212
|
+
/**
|
|
3213
|
+
* @beta
|
|
3214
|
+
*/
|
|
3215
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3216
|
+
? VanillaEntityIdentifier
|
|
3217
|
+
: T extends string
|
|
3218
|
+
? VanillaEntityIdentifier | T
|
|
3219
|
+
: never;
|
|
3220
|
+
|
|
3040
3221
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3041
3222
|
? ItemComponentTypeMap[T]
|
|
3042
3223
|
: ItemCustomComponentInstance;
|
|
@@ -3063,194 +3244,830 @@ export type ItemComponentTypeMap = {
|
|
|
3063
3244
|
};
|
|
3064
3245
|
|
|
3065
3246
|
/**
|
|
3066
|
-
*
|
|
3247
|
+
* @beta
|
|
3067
3248
|
*/
|
|
3068
|
-
export
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
*
|
|
3074
|
-
*/
|
|
3075
|
-
readonly id: string;
|
|
3076
|
-
}
|
|
3249
|
+
export type VanillaEntityIdentifier =
|
|
3250
|
+
| EntityType
|
|
3251
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3252
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3253
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3077
3254
|
|
|
3078
3255
|
/**
|
|
3079
|
-
*
|
|
3080
|
-
*
|
|
3081
|
-
*
|
|
3082
|
-
* updated in version 1.17.10.21.
|
|
3256
|
+
* @beta
|
|
3257
|
+
* Handle to an aim-assist category that exists in the
|
|
3258
|
+
* world.aimAssist registry.
|
|
3083
3259
|
*/
|
|
3084
|
-
export class
|
|
3260
|
+
export class AimAssistCategory {
|
|
3085
3261
|
private constructor();
|
|
3086
3262
|
/**
|
|
3087
3263
|
* @remarks
|
|
3088
|
-
*
|
|
3264
|
+
* Default targeting priority used for block types not found in
|
|
3265
|
+
* getBlockPriorities.
|
|
3089
3266
|
*
|
|
3267
|
+
* @throws This property can throw when used.
|
|
3090
3268
|
*/
|
|
3091
|
-
readonly
|
|
3269
|
+
readonly defaultBlockPriority: number;
|
|
3092
3270
|
/**
|
|
3093
3271
|
* @remarks
|
|
3094
|
-
*
|
|
3095
|
-
*
|
|
3272
|
+
* Default targeting priority used for entity types not found
|
|
3273
|
+
* in getEntityPriorities.
|
|
3096
3274
|
*
|
|
3097
3275
|
* @throws This property can throw when used.
|
|
3276
|
+
*/
|
|
3277
|
+
readonly defaultEntityPriority: number;
|
|
3278
|
+
/**
|
|
3279
|
+
* @remarks
|
|
3280
|
+
* The unique Id associated with the category.
|
|
3098
3281
|
*
|
|
3099
|
-
* {@link LocationInUnloadedChunkError}
|
|
3100
|
-
*
|
|
3101
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3102
3282
|
*/
|
|
3103
|
-
readonly
|
|
3283
|
+
readonly identifier: string;
|
|
3104
3284
|
/**
|
|
3105
3285
|
* @remarks
|
|
3106
|
-
*
|
|
3107
|
-
* water block and a lava block are liquid, while an air block
|
|
3108
|
-
* and a stone block are not. Water logged blocks are not
|
|
3109
|
-
* liquid blocks).
|
|
3286
|
+
* Gets the priority settings used for block targeting.
|
|
3110
3287
|
*
|
|
3111
|
-
* @
|
|
3288
|
+
* @returns
|
|
3289
|
+
* The record mapping block Ids to their priority settings.
|
|
3290
|
+
* Larger numbers have greater priority.
|
|
3291
|
+
* @throws This function can throw errors.
|
|
3292
|
+
*/
|
|
3293
|
+
getBlockPriorities(): Record<string, number>;
|
|
3294
|
+
/**
|
|
3295
|
+
* @remarks
|
|
3296
|
+
* Gets the priority settings used for block targeting.
|
|
3112
3297
|
*
|
|
3113
|
-
*
|
|
3298
|
+
* @returns
|
|
3299
|
+
* The record mapping block tags to their priority settings.
|
|
3300
|
+
* Larger numbers have greater priority.
|
|
3301
|
+
* @throws This function can throw errors.
|
|
3114
3302
|
*
|
|
3115
|
-
* {@link
|
|
3303
|
+
* {@link minecraftcommon.EngineError}
|
|
3116
3304
|
*/
|
|
3117
|
-
|
|
3305
|
+
getBlockTagPriorities(): Record<string, number>;
|
|
3118
3306
|
/**
|
|
3119
3307
|
* @remarks
|
|
3120
|
-
*
|
|
3121
|
-
* (for example, if the block is unloaded, references to that
|
|
3122
|
-
* block will no longer be valid.)
|
|
3308
|
+
* Gets the priority settings used for entity targeting.
|
|
3123
3309
|
*
|
|
3310
|
+
* @returns
|
|
3311
|
+
* The record mapping entity Ids to their priority settings.
|
|
3312
|
+
* Larger numbers have greater priority.
|
|
3313
|
+
* @throws This function can throw errors.
|
|
3124
3314
|
*/
|
|
3125
|
-
|
|
3315
|
+
getEntityPriorities(): Record<string, number>;
|
|
3126
3316
|
/**
|
|
3127
3317
|
* @remarks
|
|
3128
|
-
*
|
|
3318
|
+
* Gets the priority settings used for entity targeting.
|
|
3129
3319
|
*
|
|
3130
|
-
* @
|
|
3320
|
+
* @returns
|
|
3321
|
+
* Map entity type families to their priority settings in a
|
|
3322
|
+
* Record. Larger numbers have greater priority.
|
|
3323
|
+
* @throws This function can throw errors.
|
|
3131
3324
|
*
|
|
3132
|
-
* {@link
|
|
3325
|
+
* {@link minecraftcommon.EngineError}
|
|
3326
|
+
*/
|
|
3327
|
+
getEntityTypeFamilyPriorities(): Record<string, number>;
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
/**
|
|
3331
|
+
* @beta
|
|
3332
|
+
* Settings used with AimAssistRegistry.addCategory for
|
|
3333
|
+
* creation of the AimAssistCategory.
|
|
3334
|
+
*/
|
|
3335
|
+
export class AimAssistCategorySettings {
|
|
3336
|
+
/**
|
|
3337
|
+
* @remarks
|
|
3338
|
+
* Optional. Default targeting priority used for block types
|
|
3339
|
+
* not provided to setBlockPriorities.
|
|
3340
|
+
*
|
|
3341
|
+
* This property can't be edited in restricted-execution mode.
|
|
3133
3342
|
*
|
|
3134
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3135
3343
|
*/
|
|
3136
|
-
|
|
3344
|
+
defaultBlockPriority: number;
|
|
3137
3345
|
/**
|
|
3138
3346
|
* @remarks
|
|
3139
|
-
*
|
|
3140
|
-
*
|
|
3347
|
+
* Optional. Default targeting priority used for entity types
|
|
3348
|
+
* not provided to setEntityPriorities.
|
|
3141
3349
|
*
|
|
3142
|
-
*
|
|
3350
|
+
* This property can't be edited in restricted-execution mode.
|
|
3143
3351
|
*
|
|
3144
|
-
|
|
3352
|
+
*/
|
|
3353
|
+
defaultEntityPriority: number;
|
|
3354
|
+
/**
|
|
3355
|
+
* @remarks
|
|
3356
|
+
* The unique Id used to register the category with. Must have
|
|
3357
|
+
* a namespace.
|
|
3145
3358
|
*
|
|
3146
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3147
3359
|
*/
|
|
3148
|
-
readonly
|
|
3360
|
+
readonly identifier: string;
|
|
3149
3361
|
/**
|
|
3150
3362
|
* @remarks
|
|
3151
|
-
*
|
|
3363
|
+
* Constructor that takes a unique Id to associate with the
|
|
3364
|
+
* created AimAssistCategory. Must have a namespace.
|
|
3152
3365
|
*
|
|
3153
|
-
* @throws This property can throw when used.
|
|
3154
3366
|
*/
|
|
3155
|
-
|
|
3367
|
+
constructor(identifier: string);
|
|
3156
3368
|
/**
|
|
3157
3369
|
* @remarks
|
|
3158
|
-
*
|
|
3159
|
-
* block.
|
|
3370
|
+
* Gets the priority settings used for block targeting.
|
|
3160
3371
|
*
|
|
3161
|
-
* @
|
|
3372
|
+
* @returns
|
|
3373
|
+
* The record mapping block Ids to their priority settings.
|
|
3374
|
+
* Larger numbers have greater priority.
|
|
3375
|
+
*/
|
|
3376
|
+
getBlockPriorities(): Record<string, number>;
|
|
3377
|
+
/**
|
|
3378
|
+
* @remarks
|
|
3379
|
+
* Gets the priority settings used for block targeting.
|
|
3162
3380
|
*
|
|
3163
|
-
*
|
|
3381
|
+
* @returns
|
|
3382
|
+
* The record mapping block tags to their priority settings.
|
|
3383
|
+
* Larger numbers have greater priority.
|
|
3384
|
+
*/
|
|
3385
|
+
getBlockTagPriorities(): Record<string, number>;
|
|
3386
|
+
/**
|
|
3387
|
+
* @remarks
|
|
3388
|
+
* Gets the priority settings used for entity targeting.
|
|
3164
3389
|
*
|
|
3165
|
-
*
|
|
3390
|
+
* @returns
|
|
3391
|
+
* The record mapping entity Ids to their priority settings.
|
|
3392
|
+
* Larger numbers have greater priority.
|
|
3166
3393
|
*/
|
|
3167
|
-
|
|
3394
|
+
getEntityPriorities(): Record<string, number>;
|
|
3168
3395
|
/**
|
|
3169
3396
|
* @remarks
|
|
3170
|
-
* Gets the
|
|
3397
|
+
* Gets the priority settings used for entity targeting.
|
|
3171
3398
|
*
|
|
3172
|
-
* @
|
|
3399
|
+
* @returns
|
|
3400
|
+
* Map entity type families to their priority settings in a
|
|
3401
|
+
* Record. Larger numbers have greater priority.
|
|
3402
|
+
*/
|
|
3403
|
+
getEntityTypeFamilyPriorities(): Record<string, number>;
|
|
3404
|
+
/**
|
|
3405
|
+
* @remarks
|
|
3406
|
+
* Sets the priority settings used for block targeting.
|
|
3173
3407
|
*
|
|
3174
|
-
*
|
|
3408
|
+
* This function can't be called in restricted-execution mode.
|
|
3175
3409
|
*
|
|
3176
|
-
*
|
|
3410
|
+
* @param blockPriorities
|
|
3411
|
+
* A record mapping block Ids to their priority settings.
|
|
3412
|
+
* Larger numbers have greater priority.
|
|
3177
3413
|
*/
|
|
3178
|
-
|
|
3414
|
+
setBlockPriorities(
|
|
3415
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3416
|
+
): void;
|
|
3179
3417
|
/**
|
|
3180
3418
|
* @remarks
|
|
3181
|
-
*
|
|
3182
|
-
* Vanilla block names can be changed in future releases, try
|
|
3183
|
-
* using 'Block.matches' instead for block comparison.
|
|
3184
|
-
*
|
|
3185
|
-
* @throws This property can throw when used.
|
|
3419
|
+
* Sets the priority settings used for block targeting.
|
|
3186
3420
|
*
|
|
3187
|
-
*
|
|
3421
|
+
* This function can't be called in restricted-execution mode.
|
|
3188
3422
|
*
|
|
3189
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3190
3423
|
*/
|
|
3191
|
-
|
|
3424
|
+
setBlockTagPriorities(blockTagPriorities: Record<string, number>): void;
|
|
3192
3425
|
/**
|
|
3193
3426
|
* @remarks
|
|
3194
|
-
*
|
|
3427
|
+
* Sets the priority settings used for entity targeting.
|
|
3428
|
+
*
|
|
3429
|
+
* This function can't be called in restricted-execution mode.
|
|
3195
3430
|
*
|
|
3431
|
+
* @param entityPriorities
|
|
3432
|
+
* A record mapping entity Ids to their priority settings.
|
|
3433
|
+
* Larger numbers have greater priority.
|
|
3196
3434
|
*/
|
|
3197
|
-
|
|
3435
|
+
setEntityPriorities(
|
|
3436
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3437
|
+
): void;
|
|
3198
3438
|
/**
|
|
3199
3439
|
* @remarks
|
|
3200
|
-
*
|
|
3440
|
+
* Sets the priority settings used for entity targeting.
|
|
3441
|
+
*
|
|
3442
|
+
* This function can't be called in restricted-execution mode.
|
|
3201
3443
|
*
|
|
3202
3444
|
*/
|
|
3203
|
-
|
|
3445
|
+
setEntityTypeFamilyPriorities(entityTypeFamilyPriorities: Record<string, number>): void;
|
|
3446
|
+
}
|
|
3447
|
+
|
|
3448
|
+
/**
|
|
3449
|
+
* @beta
|
|
3450
|
+
* Handle to an aim-assist preset that exists in the
|
|
3451
|
+
* world.aimAssist registry.
|
|
3452
|
+
*/
|
|
3453
|
+
export class AimAssistPreset {
|
|
3454
|
+
private constructor();
|
|
3204
3455
|
/**
|
|
3205
3456
|
* @remarks
|
|
3206
|
-
*
|
|
3457
|
+
* Optional. Default aim-assist category Id used for items not
|
|
3458
|
+
* provided to setItemSettings.
|
|
3207
3459
|
*
|
|
3460
|
+
* @throws This property can throw when used.
|
|
3208
3461
|
*/
|
|
3209
|
-
readonly
|
|
3462
|
+
readonly defaultItemSettings?: string;
|
|
3210
3463
|
/**
|
|
3211
3464
|
* @remarks
|
|
3212
|
-
*
|
|
3213
|
-
* Y direction).
|
|
3465
|
+
* Optional. Aim-assist category Id used for an empty hand.
|
|
3214
3466
|
*
|
|
3215
|
-
* @
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
*
|
|
3220
|
-
*
|
|
3467
|
+
* @throws This property can throw when used.
|
|
3468
|
+
*/
|
|
3469
|
+
readonly handSettings?: string;
|
|
3470
|
+
/**
|
|
3471
|
+
* @remarks
|
|
3472
|
+
* The unique Id associated with the preset.
|
|
3221
3473
|
*
|
|
3222
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3223
3474
|
*/
|
|
3224
|
-
|
|
3475
|
+
readonly identifier: string;
|
|
3225
3476
|
/**
|
|
3226
3477
|
* @remarks
|
|
3227
|
-
*
|
|
3228
|
-
*
|
|
3478
|
+
* Gets the list of block tags to exclude from aim assist
|
|
3479
|
+
* targeting.
|
|
3229
3480
|
*
|
|
3230
|
-
* @
|
|
3231
|
-
*
|
|
3232
|
-
* Defaults to: 1
|
|
3481
|
+
* @returns
|
|
3482
|
+
* The array of block tags.
|
|
3233
3483
|
* @throws This function can throw errors.
|
|
3234
3484
|
*
|
|
3235
|
-
* {@link
|
|
3236
|
-
*
|
|
3237
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3485
|
+
* {@link minecraftcommon.EngineError}
|
|
3238
3486
|
*/
|
|
3239
|
-
|
|
3487
|
+
getExcludedBlockTagTargets(): string[];
|
|
3240
3488
|
/**
|
|
3241
3489
|
* @remarks
|
|
3242
|
-
*
|
|
3243
|
-
*
|
|
3490
|
+
* Gets the list of block Ids to exclude from aim assist
|
|
3491
|
+
* targeting.
|
|
3244
3492
|
*
|
|
3493
|
+
* @returns
|
|
3494
|
+
* The array of block Ids.
|
|
3495
|
+
* @throws This function can throw errors.
|
|
3245
3496
|
*/
|
|
3246
|
-
|
|
3497
|
+
getExcludedBlockTargets(): string[];
|
|
3247
3498
|
/**
|
|
3248
3499
|
* @remarks
|
|
3249
|
-
*
|
|
3250
|
-
*
|
|
3500
|
+
* Gets the list of entity Ids to exclude from aim assist
|
|
3501
|
+
* targeting.
|
|
3251
3502
|
*
|
|
3252
|
-
* @
|
|
3253
|
-
* The
|
|
3503
|
+
* @returns
|
|
3504
|
+
* The array of entity Ids.
|
|
3505
|
+
* @throws This function can throw errors.
|
|
3506
|
+
*/
|
|
3507
|
+
getExcludedEntityTargets(): string[];
|
|
3508
|
+
/**
|
|
3509
|
+
* @remarks
|
|
3510
|
+
* Gets the list of entity type families to exclude from aim
|
|
3511
|
+
* assist targeting.
|
|
3512
|
+
*
|
|
3513
|
+
* @returns
|
|
3514
|
+
* The array of entity type families.
|
|
3515
|
+
* @throws This function can throw errors.
|
|
3516
|
+
*
|
|
3517
|
+
* {@link minecraftcommon.EngineError}
|
|
3518
|
+
*/
|
|
3519
|
+
getExcludedEntityTypeFamilyTargets(): string[];
|
|
3520
|
+
/**
|
|
3521
|
+
* @remarks
|
|
3522
|
+
* Gets the per-item aim-assist category Ids.
|
|
3523
|
+
*
|
|
3524
|
+
* @returns
|
|
3525
|
+
* The record mapping item Ids to aim-assist category Ids.
|
|
3526
|
+
* @throws This function can throw errors.
|
|
3527
|
+
*/
|
|
3528
|
+
getItemSettings(): Record<string, string>;
|
|
3529
|
+
/**
|
|
3530
|
+
* @remarks
|
|
3531
|
+
* Gets the list of item Ids that will target liquid blocks
|
|
3532
|
+
* with aim-assist when being held.
|
|
3533
|
+
*
|
|
3534
|
+
* @returns
|
|
3535
|
+
* The array of item Ids.
|
|
3536
|
+
* @throws This function can throw errors.
|
|
3537
|
+
*/
|
|
3538
|
+
getLiquidTargetingItems(): string[];
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
/**
|
|
3542
|
+
* @beta
|
|
3543
|
+
* Settings used with AimAssistRegistry.addPreset for creation
|
|
3544
|
+
* of the AimAssistPreset.
|
|
3545
|
+
*/
|
|
3546
|
+
export class AimAssistPresetSettings {
|
|
3547
|
+
/**
|
|
3548
|
+
* @remarks
|
|
3549
|
+
* Optional. Default aim-assist category Id used for items not
|
|
3550
|
+
* provided to setItemSettings.
|
|
3551
|
+
*
|
|
3552
|
+
* This property can't be edited in restricted-execution mode.
|
|
3553
|
+
*
|
|
3554
|
+
*/
|
|
3555
|
+
defaultItemSettings?: string;
|
|
3556
|
+
/**
|
|
3557
|
+
* @remarks
|
|
3558
|
+
* Optional. Aim-assist category Id used for an empty hand.
|
|
3559
|
+
*
|
|
3560
|
+
* This property can't be edited in restricted-execution mode.
|
|
3561
|
+
*
|
|
3562
|
+
*/
|
|
3563
|
+
handSettings?: string;
|
|
3564
|
+
/**
|
|
3565
|
+
* @remarks
|
|
3566
|
+
* The unique Id used to register the preset with. Must have a
|
|
3567
|
+
* namespace.
|
|
3568
|
+
*
|
|
3569
|
+
*/
|
|
3570
|
+
readonly identifier: string;
|
|
3571
|
+
/**
|
|
3572
|
+
* @remarks
|
|
3573
|
+
* Constructor that takes a unique Id to associate with the
|
|
3574
|
+
* created AimAssistPreset. Must have a namespace.
|
|
3575
|
+
*
|
|
3576
|
+
*/
|
|
3577
|
+
constructor(identifier: string);
|
|
3578
|
+
/**
|
|
3579
|
+
* @remarks
|
|
3580
|
+
* Gets the list of block tags to exclude from aim assist
|
|
3581
|
+
* targeting.
|
|
3582
|
+
*
|
|
3583
|
+
* @returns
|
|
3584
|
+
* The array of block tags.
|
|
3585
|
+
*/
|
|
3586
|
+
getExcludedBlockTagTargets(): string[] | undefined;
|
|
3587
|
+
/**
|
|
3588
|
+
* @remarks
|
|
3589
|
+
* Gets the list of block Ids to exclude from aim assist
|
|
3590
|
+
* targeting.
|
|
3591
|
+
*
|
|
3592
|
+
* @returns
|
|
3593
|
+
* The array of block Ids.
|
|
3594
|
+
*/
|
|
3595
|
+
getExcludedBlockTargets(): string[] | undefined;
|
|
3596
|
+
/**
|
|
3597
|
+
* @remarks
|
|
3598
|
+
* Gets the list of entity Ids to exclude from aim assist
|
|
3599
|
+
* targeting.
|
|
3600
|
+
*
|
|
3601
|
+
* @returns
|
|
3602
|
+
* The array of entity Ids.
|
|
3603
|
+
*/
|
|
3604
|
+
getExcludedEntityTargets(): string[] | undefined;
|
|
3605
|
+
/**
|
|
3606
|
+
* @remarks
|
|
3607
|
+
* Gets the list of entity type families to exclude from aim
|
|
3608
|
+
* assist targeting.
|
|
3609
|
+
*
|
|
3610
|
+
* @returns
|
|
3611
|
+
* The array of entity type families.
|
|
3612
|
+
*/
|
|
3613
|
+
getExcludedEntityTypeFamilyTargets(): string[] | undefined;
|
|
3614
|
+
/**
|
|
3615
|
+
* @remarks
|
|
3616
|
+
* Gets the per-item aim-assist category Ids.
|
|
3617
|
+
*
|
|
3618
|
+
* @returns
|
|
3619
|
+
* The record mapping item Ids to aim-assist category Ids.
|
|
3620
|
+
*/
|
|
3621
|
+
getItemSettings(): Record<string, string>;
|
|
3622
|
+
/**
|
|
3623
|
+
* @remarks
|
|
3624
|
+
* Gets the list of item Ids that will target liquid blocks
|
|
3625
|
+
* with aim-assist when being held.
|
|
3626
|
+
*
|
|
3627
|
+
* @returns
|
|
3628
|
+
* The array of item Ids.
|
|
3629
|
+
*/
|
|
3630
|
+
getLiquidTargetingItems(): string[] | undefined;
|
|
3631
|
+
/**
|
|
3632
|
+
* @remarks
|
|
3633
|
+
* Sets the list of block tags to exclude from aim assist
|
|
3634
|
+
* targeting.
|
|
3635
|
+
*
|
|
3636
|
+
* This function can't be called in restricted-execution mode.
|
|
3637
|
+
*
|
|
3638
|
+
* @param targets
|
|
3639
|
+
* An array of block tags.
|
|
3640
|
+
*/
|
|
3641
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3642
|
+
/**
|
|
3643
|
+
* @remarks
|
|
3644
|
+
* Sets the list of block Ids to exclude from aim assist
|
|
3645
|
+
* targeting.
|
|
3646
|
+
*
|
|
3647
|
+
* This function can't be called in restricted-execution mode.
|
|
3648
|
+
*
|
|
3649
|
+
* @param targets
|
|
3650
|
+
* An array of block Ids.
|
|
3651
|
+
*/
|
|
3652
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3653
|
+
/**
|
|
3654
|
+
* @remarks
|
|
3655
|
+
* Sets the list of entity Ids to exclude from aim assist
|
|
3656
|
+
* targeting.
|
|
3657
|
+
*
|
|
3658
|
+
* This function can't be called in restricted-execution mode.
|
|
3659
|
+
*
|
|
3660
|
+
* @param targets
|
|
3661
|
+
* An array of entity Ids.
|
|
3662
|
+
*/
|
|
3663
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3664
|
+
/**
|
|
3665
|
+
* @remarks
|
|
3666
|
+
* Sets the list of entity type families to exclude from aim
|
|
3667
|
+
* assist targeting.
|
|
3668
|
+
*
|
|
3669
|
+
* This function can't be called in restricted-execution mode.
|
|
3670
|
+
*
|
|
3671
|
+
* @param targets
|
|
3672
|
+
* An array of entity type families.
|
|
3673
|
+
*/
|
|
3674
|
+
setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
|
|
3675
|
+
/**
|
|
3676
|
+
* @remarks
|
|
3677
|
+
* Sets the per-item aim-assist category Ids.
|
|
3678
|
+
*
|
|
3679
|
+
* This function can't be called in restricted-execution mode.
|
|
3680
|
+
*
|
|
3681
|
+
* @param itemSettings
|
|
3682
|
+
* A record mapping item Ids to aim-assist category Ids.
|
|
3683
|
+
* Category Ids must have a namespace.
|
|
3684
|
+
*/
|
|
3685
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3686
|
+
/**
|
|
3687
|
+
* @remarks
|
|
3688
|
+
* Sets the list of item Ids that will target liquid blocks
|
|
3689
|
+
* with aim-assist when being held.
|
|
3690
|
+
*
|
|
3691
|
+
* This function can't be called in restricted-execution mode.
|
|
3692
|
+
*
|
|
3693
|
+
* @param items
|
|
3694
|
+
* An array of item Ids.
|
|
3695
|
+
*/
|
|
3696
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
/**
|
|
3700
|
+
* @beta
|
|
3701
|
+
* A container for APIs related to the world's aim-assist
|
|
3702
|
+
* settings.
|
|
3703
|
+
*/
|
|
3704
|
+
export class AimAssistRegistry {
|
|
3705
|
+
private constructor();
|
|
3706
|
+
/**
|
|
3707
|
+
* @remarks
|
|
3708
|
+
* The default aim-assist category Id that is used when not
|
|
3709
|
+
* otherwise specified.
|
|
3710
|
+
*
|
|
3711
|
+
*/
|
|
3712
|
+
static readonly DefaultCategoryId = 'minecraft:default';
|
|
3713
|
+
/**
|
|
3714
|
+
* @remarks
|
|
3715
|
+
* The default aim-assist preset Id that is used when not
|
|
3716
|
+
* otherwise specified.
|
|
3717
|
+
*
|
|
3718
|
+
*/
|
|
3719
|
+
static readonly DefaultPresetId = 'minecraft:aim_assist_default';
|
|
3720
|
+
/**
|
|
3721
|
+
* @remarks
|
|
3722
|
+
* Adds an aim-assist category to the registry.
|
|
3723
|
+
*
|
|
3724
|
+
* This function can't be called in restricted-execution mode.
|
|
3725
|
+
*
|
|
3726
|
+
* @param category
|
|
3727
|
+
* The category settings used to create the new category.
|
|
3728
|
+
* @returns
|
|
3729
|
+
* The created category handle.
|
|
3730
|
+
* @throws This function can throw errors.
|
|
3731
|
+
*
|
|
3732
|
+
* {@link minecraftcommon.EngineError}
|
|
3733
|
+
*
|
|
3734
|
+
* {@link Error}
|
|
3735
|
+
*
|
|
3736
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3737
|
+
*
|
|
3738
|
+
* {@link NamespaceNameError}
|
|
3739
|
+
*/
|
|
3740
|
+
addCategory(category: AimAssistCategorySettings): AimAssistCategory;
|
|
3741
|
+
/**
|
|
3742
|
+
* @remarks
|
|
3743
|
+
* Adds an aim-assist preset to the registry.
|
|
3744
|
+
*
|
|
3745
|
+
* This function can't be called in restricted-execution mode.
|
|
3746
|
+
*
|
|
3747
|
+
* @param preset
|
|
3748
|
+
* The preset settings used to create the new preset.
|
|
3749
|
+
* @returns
|
|
3750
|
+
* The created preset handle.
|
|
3751
|
+
* @throws This function can throw errors.
|
|
3752
|
+
*
|
|
3753
|
+
* {@link minecraftcommon.EngineError}
|
|
3754
|
+
*
|
|
3755
|
+
* {@link Error}
|
|
3756
|
+
*
|
|
3757
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3758
|
+
*
|
|
3759
|
+
* {@link NamespaceNameError}
|
|
3760
|
+
*/
|
|
3761
|
+
addPreset(preset: AimAssistPresetSettings): AimAssistPreset;
|
|
3762
|
+
/**
|
|
3763
|
+
* @remarks
|
|
3764
|
+
* Gets all available categories in the registry.
|
|
3765
|
+
*
|
|
3766
|
+
* @returns
|
|
3767
|
+
* An array of all available category objects.
|
|
3768
|
+
*/
|
|
3769
|
+
getCategories(): AimAssistCategory[];
|
|
3770
|
+
/**
|
|
3771
|
+
* @remarks
|
|
3772
|
+
* Gets the category associated with the provided Id.
|
|
3773
|
+
*
|
|
3774
|
+
* This function can't be called in restricted-execution mode.
|
|
3775
|
+
*
|
|
3776
|
+
* @returns
|
|
3777
|
+
* The category object if it exists, otherwise returns
|
|
3778
|
+
* undefined.
|
|
3779
|
+
*/
|
|
3780
|
+
getCategory(categoryId: string): AimAssistCategory | undefined;
|
|
3781
|
+
/**
|
|
3782
|
+
* @remarks
|
|
3783
|
+
* Gets the preset associated with the provided Id.
|
|
3784
|
+
*
|
|
3785
|
+
* This function can't be called in restricted-execution mode.
|
|
3786
|
+
*
|
|
3787
|
+
* @param presetId
|
|
3788
|
+
* The Id of the preset to retrieve. Must have a namespace.
|
|
3789
|
+
* @returns
|
|
3790
|
+
* The preset object if it exists, otherwise returns undefined.
|
|
3791
|
+
*/
|
|
3792
|
+
getPreset(presetId: string): AimAssistPreset | undefined;
|
|
3793
|
+
/**
|
|
3794
|
+
* @remarks
|
|
3795
|
+
* Gets all available presets in the registry.
|
|
3796
|
+
*
|
|
3797
|
+
* @returns
|
|
3798
|
+
* An array of all available preset objects.
|
|
3799
|
+
*/
|
|
3800
|
+
getPresets(): AimAssistPreset[];
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
/**
|
|
3804
|
+
* @beta
|
|
3805
|
+
* Describes a single banner pattern, which includes a colour
|
|
3806
|
+
* and a pattern type.
|
|
3807
|
+
*/
|
|
3808
|
+
export class BannerPattern {
|
|
3809
|
+
private constructor();
|
|
3810
|
+
/**
|
|
3811
|
+
* @remarks
|
|
3812
|
+
* The color to apply to this banner pattern.
|
|
3813
|
+
*
|
|
3814
|
+
*/
|
|
3815
|
+
readonly color: string;
|
|
3816
|
+
/**
|
|
3817
|
+
* @remarks
|
|
3818
|
+
* The pattern type (e.g. gradient, chevron, cross, etc.) to
|
|
3819
|
+
* apply to the banner.
|
|
3820
|
+
*
|
|
3821
|
+
*/
|
|
3822
|
+
readonly pattern: string;
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3825
|
+
/**
|
|
3826
|
+
* Describes a type of biome.
|
|
3827
|
+
*/
|
|
3828
|
+
export class BiomeType {
|
|
3829
|
+
private constructor();
|
|
3830
|
+
/**
|
|
3831
|
+
* @remarks
|
|
3832
|
+
* Identifier of the biome type.
|
|
3833
|
+
*
|
|
3834
|
+
*/
|
|
3835
|
+
readonly id: string;
|
|
3836
|
+
/**
|
|
3837
|
+
* @beta
|
|
3838
|
+
* @remarks
|
|
3839
|
+
* Returns a list of the biome's tags.
|
|
3840
|
+
*
|
|
3841
|
+
*/
|
|
3842
|
+
getTags(): string[];
|
|
3843
|
+
/**
|
|
3844
|
+
* @beta
|
|
3845
|
+
* @remarks
|
|
3846
|
+
* Checks if the biome has all of the provided tags.
|
|
3847
|
+
*
|
|
3848
|
+
* @param tags
|
|
3849
|
+
* The list of tags to check against the biome.
|
|
3850
|
+
*/
|
|
3851
|
+
hasTags(tags: string[]): boolean;
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
/**
|
|
3855
|
+
* @beta
|
|
3856
|
+
* Supports a catalog of available biome types registered
|
|
3857
|
+
* within Minecraft.
|
|
3858
|
+
*/
|
|
3859
|
+
export class BiomeTypes {
|
|
3860
|
+
private constructor();
|
|
3861
|
+
/**
|
|
3862
|
+
* @remarks
|
|
3863
|
+
* Returns a specific biome type.
|
|
3864
|
+
*
|
|
3865
|
+
* @param typeName
|
|
3866
|
+
* Identifier of the biome. Generally, namespaced identifiers
|
|
3867
|
+
* (e.g., minecraft:frozen_peaks) should be used.
|
|
3868
|
+
* @returns
|
|
3869
|
+
* If the biome exists, a BiomeType object is returned. If not,
|
|
3870
|
+
* undefined is returned.
|
|
3871
|
+
*/
|
|
3872
|
+
static get(typeName: string): BiomeType | undefined;
|
|
3873
|
+
/**
|
|
3874
|
+
* @remarks
|
|
3875
|
+
* Returns all registered biome types within Minecraft
|
|
3876
|
+
*
|
|
3877
|
+
*/
|
|
3878
|
+
static getAll(): BiomeType[];
|
|
3879
|
+
}
|
|
3880
|
+
|
|
3881
|
+
/**
|
|
3882
|
+
* Represents a block in a dimension. A block represents a
|
|
3883
|
+
* unique X, Y, and Z within a dimension and get/sets the state
|
|
3884
|
+
* of the block at that location. This type was significantly
|
|
3885
|
+
* updated in version 1.17.10.21.
|
|
3886
|
+
*/
|
|
3887
|
+
export class Block {
|
|
3888
|
+
private constructor();
|
|
3889
|
+
/**
|
|
3890
|
+
* @remarks
|
|
3891
|
+
* Returns the dimension that the block is within.
|
|
3892
|
+
*
|
|
3893
|
+
*/
|
|
3894
|
+
readonly dimension: Dimension;
|
|
3895
|
+
/**
|
|
3896
|
+
* @remarks
|
|
3897
|
+
* Returns true if this block is an air block (i.e., empty
|
|
3898
|
+
* space).
|
|
3899
|
+
*
|
|
3900
|
+
* @throws This property can throw when used.
|
|
3901
|
+
*
|
|
3902
|
+
* {@link LocationInUnloadedChunkError}
|
|
3903
|
+
*
|
|
3904
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3905
|
+
*/
|
|
3906
|
+
readonly isAir: boolean;
|
|
3907
|
+
/**
|
|
3908
|
+
* @remarks
|
|
3909
|
+
* Returns true if this block is a liquid block - (e.g., a
|
|
3910
|
+
* water block and a lava block are liquid, while an air block
|
|
3911
|
+
* and a stone block are not. Water logged blocks are not
|
|
3912
|
+
* liquid blocks).
|
|
3913
|
+
*
|
|
3914
|
+
* @throws This property can throw when used.
|
|
3915
|
+
*
|
|
3916
|
+
* {@link LocationInUnloadedChunkError}
|
|
3917
|
+
*
|
|
3918
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3919
|
+
*/
|
|
3920
|
+
readonly isLiquid: boolean;
|
|
3921
|
+
/**
|
|
3922
|
+
* @beta
|
|
3923
|
+
* @remarks
|
|
3924
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
3925
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
3926
|
+
* ladder block and a fence block are not).
|
|
3927
|
+
*
|
|
3928
|
+
* @throws This property can throw when used.
|
|
3929
|
+
*
|
|
3930
|
+
* {@link LocationInUnloadedChunkError}
|
|
3931
|
+
*
|
|
3932
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3933
|
+
*/
|
|
3934
|
+
readonly isSolid: boolean;
|
|
3935
|
+
/**
|
|
3936
|
+
* @remarks
|
|
3937
|
+
* Returns true if this reference to a block is still valid
|
|
3938
|
+
* (for example, if the block is unloaded, references to that
|
|
3939
|
+
* block will no longer be valid.)
|
|
3940
|
+
*
|
|
3941
|
+
*/
|
|
3942
|
+
readonly isValid: boolean;
|
|
3943
|
+
/**
|
|
3944
|
+
* @remarks
|
|
3945
|
+
* Returns or sets whether this block has water on it.
|
|
3946
|
+
*
|
|
3947
|
+
* @throws This property can throw when used.
|
|
3948
|
+
*
|
|
3949
|
+
* {@link LocationInUnloadedChunkError}
|
|
3950
|
+
*
|
|
3951
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3952
|
+
*/
|
|
3953
|
+
readonly isWaterlogged: boolean;
|
|
3954
|
+
/**
|
|
3955
|
+
* @remarks
|
|
3956
|
+
* Key for the localization of this block's name used in .lang
|
|
3957
|
+
* files.
|
|
3958
|
+
*
|
|
3959
|
+
* @throws This property can throw when used.
|
|
3960
|
+
*
|
|
3961
|
+
* {@link LocationInUnloadedChunkError}
|
|
3962
|
+
*
|
|
3963
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3964
|
+
*/
|
|
3965
|
+
readonly localizationKey: string;
|
|
3966
|
+
/**
|
|
3967
|
+
* @remarks
|
|
3968
|
+
* Coordinates of the specified block.
|
|
3969
|
+
*
|
|
3970
|
+
* @throws This property can throw when used.
|
|
3971
|
+
*/
|
|
3972
|
+
readonly location: Vector3;
|
|
3973
|
+
/**
|
|
3974
|
+
* @remarks
|
|
3975
|
+
* Additional block configuration data that describes the
|
|
3976
|
+
* block.
|
|
3977
|
+
*
|
|
3978
|
+
* @throws This property can throw when used.
|
|
3979
|
+
*
|
|
3980
|
+
* {@link LocationInUnloadedChunkError}
|
|
3981
|
+
*
|
|
3982
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3983
|
+
*/
|
|
3984
|
+
readonly permutation: BlockPermutation;
|
|
3985
|
+
/**
|
|
3986
|
+
* @remarks
|
|
3987
|
+
* Gets the type of block.
|
|
3988
|
+
*
|
|
3989
|
+
* @throws This property can throw when used.
|
|
3990
|
+
*
|
|
3991
|
+
* {@link LocationInUnloadedChunkError}
|
|
3992
|
+
*
|
|
3993
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3994
|
+
*/
|
|
3995
|
+
readonly 'type': BlockType;
|
|
3996
|
+
/**
|
|
3997
|
+
* @remarks
|
|
3998
|
+
* Identifier of the type of block for this block. Warning:
|
|
3999
|
+
* Vanilla block names can be changed in future releases, try
|
|
4000
|
+
* using 'Block.matches' instead for block comparison.
|
|
4001
|
+
*
|
|
4002
|
+
* @throws This property can throw when used.
|
|
4003
|
+
*
|
|
4004
|
+
* {@link LocationInUnloadedChunkError}
|
|
4005
|
+
*
|
|
4006
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4007
|
+
*/
|
|
4008
|
+
readonly typeId: string;
|
|
4009
|
+
/**
|
|
4010
|
+
* @remarks
|
|
4011
|
+
* X coordinate of the block.
|
|
4012
|
+
*
|
|
4013
|
+
*/
|
|
4014
|
+
readonly x: number;
|
|
4015
|
+
/**
|
|
4016
|
+
* @remarks
|
|
4017
|
+
* Y coordinate of the block.
|
|
4018
|
+
*
|
|
4019
|
+
*/
|
|
4020
|
+
readonly y: number;
|
|
4021
|
+
/**
|
|
4022
|
+
* @remarks
|
|
4023
|
+
* Z coordinate of the block.
|
|
4024
|
+
*
|
|
4025
|
+
*/
|
|
4026
|
+
readonly z: number;
|
|
4027
|
+
/**
|
|
4028
|
+
* @remarks
|
|
4029
|
+
* Returns the {@link Block} above this block (positive in the
|
|
4030
|
+
* Y direction).
|
|
4031
|
+
*
|
|
4032
|
+
* @param steps
|
|
4033
|
+
* Number of steps above to step before returning.
|
|
4034
|
+
* Defaults to: 1
|
|
4035
|
+
* @throws This function can throw errors.
|
|
4036
|
+
*
|
|
4037
|
+
* {@link LocationInUnloadedChunkError}
|
|
4038
|
+
*
|
|
4039
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4040
|
+
*/
|
|
4041
|
+
above(steps?: number): Block | undefined;
|
|
4042
|
+
/**
|
|
4043
|
+
* @remarks
|
|
4044
|
+
* Returns the {@link Block} below this block (negative in the
|
|
4045
|
+
* Y direction).
|
|
4046
|
+
*
|
|
4047
|
+
* @param steps
|
|
4048
|
+
* Number of steps below to step before returning.
|
|
4049
|
+
* Defaults to: 1
|
|
4050
|
+
* @throws This function can throw errors.
|
|
4051
|
+
*
|
|
4052
|
+
* {@link LocationInUnloadedChunkError}
|
|
4053
|
+
*
|
|
4054
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4055
|
+
*/
|
|
4056
|
+
below(steps?: number): Block | undefined;
|
|
4057
|
+
/**
|
|
4058
|
+
* @remarks
|
|
4059
|
+
* Returns the {@link Vector3} of the center of this block on
|
|
4060
|
+
* the X and Z axis.
|
|
4061
|
+
*
|
|
4062
|
+
*/
|
|
4063
|
+
bottomCenter(): Vector3;
|
|
4064
|
+
/**
|
|
4065
|
+
* @remarks
|
|
4066
|
+
* Returns whether this block is removed when touched by
|
|
4067
|
+
* liquid.
|
|
4068
|
+
*
|
|
4069
|
+
* @param liquidType
|
|
4070
|
+
* The type of liquid this function should be called for.
|
|
3254
4071
|
* @returns
|
|
3255
4072
|
* Whether this block is removed when touched by liquid.
|
|
3256
4073
|
* @throws This function can throw errors.
|
|
@@ -3280,6 +4097,30 @@ export class Block {
|
|
|
3280
4097
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3281
4098
|
*/
|
|
3282
4099
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4100
|
+
/**
|
|
4101
|
+
* @beta
|
|
4102
|
+
* @remarks
|
|
4103
|
+
* Checks to see whether it is valid to place the specified
|
|
4104
|
+
* block type or block permutation, on a specified face on this
|
|
4105
|
+
* block.
|
|
4106
|
+
*
|
|
4107
|
+
* @param blockToPlace
|
|
4108
|
+
* Block type or block permutation to check placement for.
|
|
4109
|
+
* @param faceToPlaceOn
|
|
4110
|
+
* Optional specific face of this block to check placement
|
|
4111
|
+
* against.
|
|
4112
|
+
* @returns
|
|
4113
|
+
* Returns `true` if the block type or permutation can be
|
|
4114
|
+
* placed on this block, else `false`.
|
|
4115
|
+
* @throws This function can throw errors.
|
|
4116
|
+
*
|
|
4117
|
+
* {@link Error}
|
|
4118
|
+
*
|
|
4119
|
+
* {@link LocationInUnloadedChunkError}
|
|
4120
|
+
*
|
|
4121
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4122
|
+
*/
|
|
4123
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
3283
4124
|
/**
|
|
3284
4125
|
* @remarks
|
|
3285
4126
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -3377,6 +4218,15 @@ export class Block {
|
|
|
3377
4218
|
* {@link LocationInUnloadedChunkError}
|
|
3378
4219
|
*/
|
|
3379
4220
|
getLightLevel(): number;
|
|
4221
|
+
/**
|
|
4222
|
+
* @beta
|
|
4223
|
+
* @throws This function can throw errors.
|
|
4224
|
+
*
|
|
4225
|
+
* {@link LocationInUnloadedChunkError}
|
|
4226
|
+
*
|
|
4227
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4228
|
+
*/
|
|
4229
|
+
getMapColor(): RGBA;
|
|
3380
4230
|
/**
|
|
3381
4231
|
* @remarks
|
|
3382
4232
|
* Returns the net redstone power of this block.
|
|
@@ -3589,77 +4439,229 @@ export class Block {
|
|
|
3589
4439
|
* Block.
|
|
3590
4440
|
* @throws This function can throw errors.
|
|
3591
4441
|
*
|
|
3592
|
-
* {@link LocationInUnloadedChunkError}
|
|
4442
|
+
* {@link LocationInUnloadedChunkError}
|
|
4443
|
+
*
|
|
4444
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4445
|
+
*/
|
|
4446
|
+
setPermutation(permutation: BlockPermutation): void;
|
|
4447
|
+
/**
|
|
4448
|
+
* @remarks
|
|
4449
|
+
* Sets the type of block.
|
|
4450
|
+
*
|
|
4451
|
+
* This function can't be called in restricted-execution mode.
|
|
4452
|
+
*
|
|
4453
|
+
* @param blockType
|
|
4454
|
+
* Identifier of the type of block to apply - for example,
|
|
4455
|
+
* minecraft:powered_repeater.
|
|
4456
|
+
* @throws This function can throw errors.
|
|
4457
|
+
*
|
|
4458
|
+
* {@link Error}
|
|
4459
|
+
*
|
|
4460
|
+
* {@link LocationInUnloadedChunkError}
|
|
4461
|
+
*
|
|
4462
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4463
|
+
*/
|
|
4464
|
+
setType(blockType: BlockType | string): void;
|
|
4465
|
+
/**
|
|
4466
|
+
* @remarks
|
|
4467
|
+
* Sets whether this block has a water logged state - for
|
|
4468
|
+
* example, whether stairs are submerged within water.
|
|
4469
|
+
*
|
|
4470
|
+
* This function can't be called in restricted-execution mode.
|
|
4471
|
+
*
|
|
4472
|
+
* @param isWaterlogged
|
|
4473
|
+
* true if the block should have water within it.
|
|
4474
|
+
* @throws This function can throw errors.
|
|
4475
|
+
*
|
|
4476
|
+
* {@link Error}
|
|
4477
|
+
*
|
|
4478
|
+
* {@link LocationInUnloadedChunkError}
|
|
4479
|
+
*
|
|
4480
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4481
|
+
*/
|
|
4482
|
+
setWaterlogged(isWaterlogged: boolean): void;
|
|
4483
|
+
/**
|
|
4484
|
+
* @remarks
|
|
4485
|
+
* Returns the {@link Block} to the south of this block
|
|
4486
|
+
* (positive in the Z direction).
|
|
4487
|
+
*
|
|
4488
|
+
* @param steps
|
|
4489
|
+
* Number of steps to the south to step before returning.
|
|
4490
|
+
* Defaults to: 1
|
|
4491
|
+
* @throws This function can throw errors.
|
|
4492
|
+
*
|
|
4493
|
+
* {@link LocationInUnloadedChunkError}
|
|
4494
|
+
*
|
|
4495
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4496
|
+
*/
|
|
4497
|
+
south(steps?: number): Block | undefined;
|
|
4498
|
+
/**
|
|
4499
|
+
* @beta
|
|
4500
|
+
* @remarks
|
|
4501
|
+
* Tries to set the block in the dimension to the state of the
|
|
4502
|
+
* permutation by first checking if the placement is valid.
|
|
4503
|
+
*
|
|
4504
|
+
* This function can't be called in restricted-execution mode.
|
|
4505
|
+
*
|
|
4506
|
+
* @param permutation
|
|
4507
|
+
* Permutation that contains a set of property states for the
|
|
4508
|
+
* Block.
|
|
4509
|
+
* @returns
|
|
4510
|
+
* Returns `true` if the block permutation data was
|
|
4511
|
+
* successfully set, else `false`.
|
|
4512
|
+
* @throws This function can throw errors.
|
|
4513
|
+
*
|
|
4514
|
+
* {@link LocationInUnloadedChunkError}
|
|
4515
|
+
*
|
|
4516
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4517
|
+
*/
|
|
4518
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
4519
|
+
/**
|
|
4520
|
+
* @remarks
|
|
4521
|
+
* Returns the {@link Block} to the west of this block
|
|
4522
|
+
* (negative in the X direction).
|
|
4523
|
+
*
|
|
4524
|
+
* @param steps
|
|
4525
|
+
* Number of steps to the west to step before returning.
|
|
4526
|
+
* Defaults to: 1
|
|
4527
|
+
* @throws This function can throw errors.
|
|
4528
|
+
*
|
|
4529
|
+
* {@link LocationInUnloadedChunkError}
|
|
4530
|
+
*
|
|
4531
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4532
|
+
*/
|
|
4533
|
+
west(steps?: number): Block | undefined;
|
|
4534
|
+
}
|
|
4535
|
+
|
|
4536
|
+
/**
|
|
4537
|
+
* @beta
|
|
4538
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4539
|
+
* of useful functions for the creation and utility of {@link
|
|
4540
|
+
* BlockBoundingBox} objects
|
|
4541
|
+
*/
|
|
4542
|
+
export class BlockBoundingBoxUtils {
|
|
4543
|
+
private constructor();
|
|
4544
|
+
/**
|
|
4545
|
+
* @remarks
|
|
4546
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4547
|
+
* where the min and max components are guaranteed to be (min
|
|
4548
|
+
* <= max)
|
|
4549
|
+
*
|
|
4550
|
+
* This function can't be called in restricted-execution mode.
|
|
4551
|
+
*
|
|
4552
|
+
* @param min
|
|
4553
|
+
* A corner world location
|
|
4554
|
+
* @param max
|
|
4555
|
+
* A corner world location diametrically opposite
|
|
4556
|
+
*/
|
|
4557
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4558
|
+
/**
|
|
4559
|
+
* @remarks
|
|
4560
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4561
|
+
* each axis.
|
|
4562
|
+
* Sizes can be negative to perform contraction.
|
|
4563
|
+
* Note: corners can be inverted if the contraction size is
|
|
4564
|
+
* greater than the span, but the min/max relationship will
|
|
4565
|
+
* remain correct
|
|
4566
|
+
*
|
|
4567
|
+
* This function can't be called in restricted-execution mode.
|
|
4568
|
+
*
|
|
4569
|
+
* @returns
|
|
4570
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4571
|
+
* the changes
|
|
4572
|
+
*/
|
|
4573
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4574
|
+
/**
|
|
4575
|
+
* @remarks
|
|
4576
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4577
|
+
*
|
|
4578
|
+
* This function can't be called in restricted-execution mode.
|
|
4579
|
+
*
|
|
4580
|
+
*/
|
|
4581
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4582
|
+
/**
|
|
4583
|
+
* @remarks
|
|
4584
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4585
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4586
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4587
|
+
* boxes.
|
|
4588
|
+
*
|
|
4589
|
+
* This function can't be called in restricted-execution mode.
|
|
4590
|
+
*
|
|
4591
|
+
* @returns
|
|
4592
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4593
|
+
* smallest possible bounding box which can encompass both
|
|
4594
|
+
*/
|
|
4595
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4596
|
+
/**
|
|
4597
|
+
* @remarks
|
|
4598
|
+
* Calculate the center block of a given {@link
|
|
4599
|
+
* BlockBoundingBox} object.
|
|
4600
|
+
*
|
|
4601
|
+
* This function can't be called in restricted-execution mode.
|
|
3593
4602
|
*
|
|
3594
|
-
*
|
|
4603
|
+
* @returns
|
|
4604
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4605
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4606
|
+
* bounds are not mathematically centered...
|
|
4607
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4608
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
3595
4609
|
*/
|
|
3596
|
-
|
|
4610
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
3597
4611
|
/**
|
|
3598
4612
|
* @remarks
|
|
3599
|
-
*
|
|
4613
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4614
|
+
* area of two intersecting BlockBoundingBoxes
|
|
3600
4615
|
*
|
|
3601
4616
|
* This function can't be called in restricted-execution mode.
|
|
3602
4617
|
*
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
* @
|
|
3607
|
-
*
|
|
3608
|
-
* {@link Error}
|
|
4618
|
+
*/
|
|
4619
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4620
|
+
/**
|
|
4621
|
+
* @remarks
|
|
4622
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
3609
4623
|
*
|
|
3610
|
-
*
|
|
4624
|
+
* This function can't be called in restricted-execution mode.
|
|
3611
4625
|
*
|
|
3612
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3613
4626
|
*/
|
|
3614
|
-
|
|
4627
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
3615
4628
|
/**
|
|
3616
4629
|
* @remarks
|
|
3617
|
-
*
|
|
3618
|
-
* example, whether stairs are submerged within water.
|
|
4630
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
3619
4631
|
*
|
|
3620
4632
|
* This function can't be called in restricted-execution mode.
|
|
3621
4633
|
*
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
*
|
|
3626
|
-
*
|
|
4634
|
+
*/
|
|
4635
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4636
|
+
/**
|
|
4637
|
+
* @remarks
|
|
4638
|
+
* Check to see if a given coordinate is inside a
|
|
4639
|
+
* BlockBoundingBox
|
|
3627
4640
|
*
|
|
3628
|
-
*
|
|
4641
|
+
* This function can't be called in restricted-execution mode.
|
|
3629
4642
|
*
|
|
3630
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3631
4643
|
*/
|
|
3632
|
-
|
|
4644
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
3633
4645
|
/**
|
|
3634
4646
|
* @remarks
|
|
3635
|
-
*
|
|
3636
|
-
*
|
|
3637
|
-
*
|
|
3638
|
-
* @param steps
|
|
3639
|
-
* Number of steps to the south to step before returning.
|
|
3640
|
-
* Defaults to: 1
|
|
3641
|
-
* @throws This function can throw errors.
|
|
4647
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4648
|
+
* max))
|
|
3642
4649
|
*
|
|
3643
|
-
*
|
|
4650
|
+
* This function can't be called in restricted-execution mode.
|
|
3644
4651
|
*
|
|
3645
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3646
4652
|
*/
|
|
3647
|
-
|
|
4653
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
3648
4654
|
/**
|
|
3649
4655
|
* @remarks
|
|
3650
|
-
*
|
|
3651
|
-
* (negative in the X direction).
|
|
4656
|
+
* Move a BlockBoundingBox by a given amount
|
|
3652
4657
|
*
|
|
3653
|
-
*
|
|
3654
|
-
* Number of steps to the west to step before returning.
|
|
3655
|
-
* Defaults to: 1
|
|
3656
|
-
* @throws This function can throw errors.
|
|
3657
|
-
*
|
|
3658
|
-
* {@link LocationInUnloadedChunkError}
|
|
4658
|
+
* This function can't be called in restricted-execution mode.
|
|
3659
4659
|
*
|
|
3660
|
-
*
|
|
4660
|
+
* @returns
|
|
4661
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4662
|
+
* change
|
|
3661
4663
|
*/
|
|
3662
|
-
|
|
4664
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
3663
4665
|
}
|
|
3664
4666
|
|
|
3665
4667
|
/**
|
|
@@ -3704,6 +4706,35 @@ export class BlockComponentBlockBreakEvent extends BlockEvent {
|
|
|
3704
4706
|
readonly entitySource?: Entity;
|
|
3705
4707
|
}
|
|
3706
4708
|
|
|
4709
|
+
/**
|
|
4710
|
+
* @beta
|
|
4711
|
+
* Contains information regarding an event sent by an entity to
|
|
4712
|
+
* this block in the world.
|
|
4713
|
+
*/
|
|
4714
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4715
|
+
export class BlockComponentEntityEvent extends BlockEvent {
|
|
4716
|
+
private constructor();
|
|
4717
|
+
/**
|
|
4718
|
+
* @remarks
|
|
4719
|
+
* Returns permutation information about the block receiving
|
|
4720
|
+
* the event.
|
|
4721
|
+
*
|
|
4722
|
+
*/
|
|
4723
|
+
readonly blockPermutation: BlockPermutation;
|
|
4724
|
+
/**
|
|
4725
|
+
* @remarks
|
|
4726
|
+
* The entity that sent the event.
|
|
4727
|
+
*
|
|
4728
|
+
*/
|
|
4729
|
+
readonly entitySource?: Entity;
|
|
4730
|
+
/**
|
|
4731
|
+
* @remarks
|
|
4732
|
+
* Name of the event fired by the entity.
|
|
4733
|
+
*
|
|
4734
|
+
*/
|
|
4735
|
+
readonly name: string;
|
|
4736
|
+
}
|
|
4737
|
+
|
|
3707
4738
|
/**
|
|
3708
4739
|
* Contains information regarding an entity falling onto a
|
|
3709
4740
|
* specific block.
|
|
@@ -4142,6 +5173,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
4142
5173
|
*
|
|
4143
5174
|
*/
|
|
4144
5175
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5176
|
+
/**
|
|
5177
|
+
* @beta
|
|
5178
|
+
* @remarks
|
|
5179
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5180
|
+
* Will return false if the block volume was modified between
|
|
5181
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5182
|
+
*
|
|
5183
|
+
* @throws This function can throw errors.
|
|
5184
|
+
*
|
|
5185
|
+
* {@link minecraftcommon.EngineError}
|
|
5186
|
+
*/
|
|
5187
|
+
isValid(): boolean;
|
|
4145
5188
|
/**
|
|
4146
5189
|
* @remarks
|
|
4147
5190
|
* This function can't be called in restricted-execution mode.
|
|
@@ -5039,6 +6082,15 @@ export class BlockVolumeBase {
|
|
|
5039
6082
|
*
|
|
5040
6083
|
*/
|
|
5041
6084
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
6085
|
+
/**
|
|
6086
|
+
* @beta
|
|
6087
|
+
* @remarks
|
|
6088
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
6089
|
+
* the validated min and max coordinates of the volume
|
|
6090
|
+
*
|
|
6091
|
+
* @throws This function can throw errors.
|
|
6092
|
+
*/
|
|
6093
|
+
getBoundingBox(): BlockBoundingBox;
|
|
5042
6094
|
/**
|
|
5043
6095
|
* @remarks
|
|
5044
6096
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -5204,6 +6256,19 @@ export class Camera {
|
|
|
5204
6256
|
*
|
|
5205
6257
|
*/
|
|
5206
6258
|
readonly isValid: boolean;
|
|
6259
|
+
/**
|
|
6260
|
+
* @beta
|
|
6261
|
+
* @remarks
|
|
6262
|
+
* Attaches the camera to a non-player entity.
|
|
6263
|
+
*
|
|
6264
|
+
* This function can't be called in restricted-execution mode.
|
|
6265
|
+
*
|
|
6266
|
+
* @param attachCameraOptions
|
|
6267
|
+
* Options for the entity the camera is attaching to. Contains
|
|
6268
|
+
* the entity identifier and optional entity location.
|
|
6269
|
+
* @throws This function can throw errors.
|
|
6270
|
+
*/
|
|
6271
|
+
attachToEntity(attachCameraOptions?: CameraAttachOptions): void;
|
|
5207
6272
|
/**
|
|
5208
6273
|
* @remarks
|
|
5209
6274
|
* Clears the active camera for the specified player. Causes
|
|
@@ -5218,61 +6283,259 @@ export class Camera {
|
|
|
5218
6283
|
clear(): void;
|
|
5219
6284
|
/**
|
|
5220
6285
|
* @remarks
|
|
5221
|
-
* Begins a camera fade transition. A fade transition is a
|
|
5222
|
-
* full-screen color that fades-in, holds, and then fades-out.
|
|
6286
|
+
* Begins a camera fade transition. A fade transition is a
|
|
6287
|
+
* full-screen color that fades-in, holds, and then fades-out.
|
|
6288
|
+
*
|
|
6289
|
+
* This function can't be called in restricted-execution mode.
|
|
6290
|
+
*
|
|
6291
|
+
* @param fadeCameraOptions
|
|
6292
|
+
* Additional options around camera fade operations.
|
|
6293
|
+
* @throws This function can throw errors.
|
|
6294
|
+
*/
|
|
6295
|
+
fade(fadeCameraOptions?: CameraFadeOptions): void;
|
|
6296
|
+
/**
|
|
6297
|
+
* @beta
|
|
6298
|
+
* @remarks
|
|
6299
|
+
* This function can't be called in restricted-execution mode.
|
|
6300
|
+
*
|
|
6301
|
+
* @throws This function can throw errors.
|
|
6302
|
+
*/
|
|
6303
|
+
playAnimation(splineType: CatmullRomSpline | LinearSpline, cameraAnimationOptions: AnimationOptions): void;
|
|
6304
|
+
/**
|
|
6305
|
+
* @remarks
|
|
6306
|
+
* Sets the current active camera for the specified player.
|
|
6307
|
+
*
|
|
6308
|
+
* This function can't be called in restricted-execution mode.
|
|
6309
|
+
*
|
|
6310
|
+
* @param cameraPreset
|
|
6311
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6312
|
+
* @param setOptions
|
|
6313
|
+
* Additional options for the camera.
|
|
6314
|
+
* @throws This function can throw errors.
|
|
6315
|
+
*/
|
|
6316
|
+
setCamera(
|
|
6317
|
+
cameraPreset: string,
|
|
6318
|
+
setOptions?:
|
|
6319
|
+
| CameraFixedBoomOptions
|
|
6320
|
+
| CameraSetFacingOptions
|
|
6321
|
+
| CameraSetLocationOptions
|
|
6322
|
+
| CameraSetPosOptions
|
|
6323
|
+
| CameraSetRotOptions
|
|
6324
|
+
| CameraTargetOptions,
|
|
6325
|
+
): void;
|
|
6326
|
+
/**
|
|
6327
|
+
* @beta
|
|
6328
|
+
* @remarks
|
|
6329
|
+
* Sets the current active camera with easing.
|
|
6330
|
+
*
|
|
6331
|
+
* This function can't be called in restricted-execution mode.
|
|
6332
|
+
*
|
|
6333
|
+
* @param cameraPreset
|
|
6334
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6335
|
+
* @param easeOptions
|
|
6336
|
+
* Options to ease the camera from the previous camera to the
|
|
6337
|
+
* current one.
|
|
6338
|
+
* @throws
|
|
6339
|
+
* Throws when easing to minecraft:first_person presets
|
|
6340
|
+
* currently without the experimental cameras toggle enabled.
|
|
6341
|
+
*/
|
|
6342
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
6343
|
+
/**
|
|
6344
|
+
* @remarks
|
|
6345
|
+
* Sets the current active camera for the specified player and
|
|
6346
|
+
* resets the position and rotation to the values defined in
|
|
6347
|
+
* the JSON.
|
|
6348
|
+
*
|
|
6349
|
+
* This function can't be called in restricted-execution mode.
|
|
6350
|
+
*
|
|
6351
|
+
* @param cameraPreset
|
|
6352
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6353
|
+
* @param easeOptions
|
|
6354
|
+
* Options to ease the camera back to its original position and
|
|
6355
|
+
* rotation.
|
|
6356
|
+
* @throws This function can throw errors.
|
|
6357
|
+
*/
|
|
6358
|
+
setDefaultCamera(cameraPreset: string, easeOptions?: EaseOptions): void;
|
|
6359
|
+
/**
|
|
6360
|
+
* @remarks
|
|
6361
|
+
* This function can't be called in restricted-execution mode.
|
|
6362
|
+
*
|
|
6363
|
+
* @throws This function can throw errors.
|
|
6364
|
+
*/
|
|
6365
|
+
setFov(fovCameraOptions?: CameraFovOptions): void;
|
|
6366
|
+
}
|
|
6367
|
+
|
|
6368
|
+
/**
|
|
6369
|
+
* @beta
|
|
6370
|
+
* CatmullRom spline creation.
|
|
6371
|
+
*/
|
|
6372
|
+
export class CatmullRomSpline {
|
|
6373
|
+
/**
|
|
6374
|
+
* @remarks
|
|
6375
|
+
* Control points for the CatmullRom curve.
|
|
6376
|
+
*
|
|
6377
|
+
* This property can't be edited in restricted-execution mode.
|
|
6378
|
+
*
|
|
6379
|
+
*/
|
|
6380
|
+
controlPoints: Vector3[];
|
|
6381
|
+
}
|
|
6382
|
+
|
|
6383
|
+
/**
|
|
6384
|
+
* @beta
|
|
6385
|
+
* An event that fires as players enter chat messages.
|
|
6386
|
+
*/
|
|
6387
|
+
export class ChatSendAfterEvent {
|
|
6388
|
+
private constructor();
|
|
6389
|
+
/**
|
|
6390
|
+
* @remarks
|
|
6391
|
+
* Message that is being broadcast.
|
|
6392
|
+
*
|
|
6393
|
+
*/
|
|
6394
|
+
readonly message: string;
|
|
6395
|
+
/**
|
|
6396
|
+
* @remarks
|
|
6397
|
+
* Player that sent the chat message.
|
|
6398
|
+
*
|
|
6399
|
+
*/
|
|
6400
|
+
readonly sender: Player;
|
|
6401
|
+
/**
|
|
6402
|
+
* @remarks
|
|
6403
|
+
* Optional list of players that will receive this message. If
|
|
6404
|
+
* defined, this message is directly targeted to one or more
|
|
6405
|
+
* players (i.e., is not broadcast.)
|
|
6406
|
+
*
|
|
6407
|
+
*/
|
|
6408
|
+
readonly targets?: Player[];
|
|
6409
|
+
}
|
|
6410
|
+
|
|
6411
|
+
/**
|
|
6412
|
+
* @beta
|
|
6413
|
+
* Manages callbacks that are connected to chat messages being
|
|
6414
|
+
* sent.
|
|
6415
|
+
*/
|
|
6416
|
+
export class ChatSendAfterEventSignal {
|
|
6417
|
+
private constructor();
|
|
6418
|
+
/**
|
|
6419
|
+
* @remarks
|
|
6420
|
+
* Adds a callback that will be called when new chat messages
|
|
6421
|
+
* are sent.
|
|
6422
|
+
*
|
|
6423
|
+
* This function can't be called in restricted-execution mode.
|
|
6424
|
+
*
|
|
6425
|
+
* This function can be called in early-execution mode.
|
|
6426
|
+
*
|
|
6427
|
+
*/
|
|
6428
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
6429
|
+
/**
|
|
6430
|
+
* @remarks
|
|
6431
|
+
* Removes a callback from being called when new chat messages
|
|
6432
|
+
* are sent.
|
|
6433
|
+
*
|
|
6434
|
+
* This function can't be called in restricted-execution mode.
|
|
6435
|
+
*
|
|
6436
|
+
* This function can be called in early-execution mode.
|
|
6437
|
+
*
|
|
6438
|
+
*/
|
|
6439
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
6440
|
+
}
|
|
6441
|
+
|
|
6442
|
+
/**
|
|
6443
|
+
* @beta
|
|
6444
|
+
* An event that fires as players enter chat messages.
|
|
6445
|
+
*/
|
|
6446
|
+
export class ChatSendBeforeEvent {
|
|
6447
|
+
private constructor();
|
|
6448
|
+
/**
|
|
6449
|
+
* @remarks
|
|
6450
|
+
* If set to true in a beforeChat event handler, this message
|
|
6451
|
+
* is not broadcast out.
|
|
6452
|
+
*
|
|
6453
|
+
*/
|
|
6454
|
+
cancel: boolean;
|
|
6455
|
+
/**
|
|
6456
|
+
* @remarks
|
|
6457
|
+
* Message that is being broadcast.
|
|
6458
|
+
*
|
|
6459
|
+
*/
|
|
6460
|
+
readonly message: string;
|
|
6461
|
+
/**
|
|
6462
|
+
* @remarks
|
|
6463
|
+
* Player that sent the chat message.
|
|
6464
|
+
*
|
|
6465
|
+
*/
|
|
6466
|
+
readonly sender: Player;
|
|
6467
|
+
/**
|
|
6468
|
+
* @remarks
|
|
6469
|
+
* Optional list of players that will receive this message. If
|
|
6470
|
+
* defined, this message is directly targeted to one or more
|
|
6471
|
+
* players (i.e., is not broadcast.)
|
|
6472
|
+
*
|
|
6473
|
+
*/
|
|
6474
|
+
readonly targets?: Player[];
|
|
6475
|
+
}
|
|
6476
|
+
|
|
6477
|
+
/**
|
|
6478
|
+
* @beta
|
|
6479
|
+
* Manages callbacks that are connected to an event that fires
|
|
6480
|
+
* before chat messages are sent.
|
|
6481
|
+
* @example customCommand.ts
|
|
6482
|
+
* ```typescript
|
|
6483
|
+
* import { world, DimensionLocation } from "@minecraft/server";
|
|
6484
|
+
*
|
|
6485
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
6486
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
|
|
6487
|
+
* if (eventData.message.includes("cancel")) {
|
|
6488
|
+
* // Cancel event if the message contains "cancel"
|
|
6489
|
+
* eventData.cancel = true;
|
|
6490
|
+
* } else {
|
|
6491
|
+
* const args = eventData.message.split(" ");
|
|
6492
|
+
*
|
|
6493
|
+
* if (args.length > 0) {
|
|
6494
|
+
* switch (args[0].toLowerCase()) {
|
|
6495
|
+
* case "echo":
|
|
6496
|
+
* // Send a modified version of chat message
|
|
6497
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
6498
|
+
* break;
|
|
6499
|
+
* case "help":
|
|
6500
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
6501
|
+
* break;
|
|
6502
|
+
* }
|
|
6503
|
+
* }
|
|
6504
|
+
* }
|
|
6505
|
+
* });
|
|
6506
|
+
* }
|
|
6507
|
+
* ```
|
|
6508
|
+
*/
|
|
6509
|
+
export class ChatSendBeforeEventSignal {
|
|
6510
|
+
private constructor();
|
|
6511
|
+
/**
|
|
6512
|
+
* @remarks
|
|
6513
|
+
* Adds a callback that will be called before new chat messages
|
|
6514
|
+
* are sent.
|
|
5223
6515
|
*
|
|
5224
6516
|
* This function can't be called in restricted-execution mode.
|
|
5225
6517
|
*
|
|
5226
|
-
*
|
|
5227
|
-
* Additional options around camera fade operations.
|
|
5228
|
-
* @throws This function can throw errors.
|
|
5229
|
-
*/
|
|
5230
|
-
fade(fadeCameraOptions?: CameraFadeOptions): void;
|
|
5231
|
-
/**
|
|
5232
|
-
* @remarks
|
|
5233
|
-
* Sets the current active camera for the specified player.
|
|
5234
|
-
*
|
|
5235
|
-
* This function can't be called in restricted-execution mode.
|
|
6518
|
+
* This function can be called in early-execution mode.
|
|
5236
6519
|
*
|
|
5237
|
-
* @param
|
|
5238
|
-
*
|
|
5239
|
-
* @
|
|
5240
|
-
*
|
|
5241
|
-
* @throws This function can throw errors.
|
|
6520
|
+
* @param callback
|
|
6521
|
+
* This closure is called with restricted-execution privilege.
|
|
6522
|
+
* @returns
|
|
6523
|
+
* Closure that is called with restricted-execution privilege.
|
|
5242
6524
|
*/
|
|
5243
|
-
|
|
5244
|
-
cameraPreset: string,
|
|
5245
|
-
setOptions?:
|
|
5246
|
-
| CameraFixedBoomOptions
|
|
5247
|
-
| CameraSetFacingOptions
|
|
5248
|
-
| CameraSetLocationOptions
|
|
5249
|
-
| CameraSetPosOptions
|
|
5250
|
-
| CameraSetRotOptions
|
|
5251
|
-
| CameraTargetOptions,
|
|
5252
|
-
): void;
|
|
6525
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
5253
6526
|
/**
|
|
5254
6527
|
* @remarks
|
|
5255
|
-
*
|
|
5256
|
-
*
|
|
5257
|
-
* the JSON.
|
|
6528
|
+
* Removes a callback from being called before new chat
|
|
6529
|
+
* messages are sent.
|
|
5258
6530
|
*
|
|
5259
6531
|
* This function can't be called in restricted-execution mode.
|
|
5260
6532
|
*
|
|
5261
|
-
*
|
|
5262
|
-
* Identifier of a camera preset file defined within JSON.
|
|
5263
|
-
* @param easeOptions
|
|
5264
|
-
* Options to ease the camera back to its original position and
|
|
5265
|
-
* rotation.
|
|
5266
|
-
* @throws This function can throw errors.
|
|
5267
|
-
*/
|
|
5268
|
-
setDefaultCamera(cameraPreset: string, easeOptions?: EaseOptions): void;
|
|
5269
|
-
/**
|
|
5270
|
-
* @remarks
|
|
5271
|
-
* This function can't be called in restricted-execution mode.
|
|
6533
|
+
* This function can be called in early-execution mode.
|
|
5272
6534
|
*
|
|
5273
|
-
* @
|
|
6535
|
+
* @param callback
|
|
6536
|
+
* This closure is called with restricted-execution privilege.
|
|
5274
6537
|
*/
|
|
5275
|
-
|
|
6538
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
5276
6539
|
}
|
|
5277
6540
|
|
|
5278
6541
|
/**
|
|
@@ -5332,6 +6595,258 @@ export class Component {
|
|
|
5332
6595
|
readonly typeId: string;
|
|
5333
6596
|
}
|
|
5334
6597
|
|
|
6598
|
+
/**
|
|
6599
|
+
* @beta
|
|
6600
|
+
* The Compound Block Volume is a collection of individual
|
|
6601
|
+
* block volume definitions which, as a collection, define a
|
|
6602
|
+
* larger volume of (sometimes non-contiguous) irregular
|
|
6603
|
+
* shapes.
|
|
6604
|
+
* This class is loosely based on the concept of CSG
|
|
6605
|
+
* (Computational Solid Geometry) and allows a user to create
|
|
6606
|
+
* complex volumes by building a stack of volumes and voids to
|
|
6607
|
+
* make a larger single volume.
|
|
6608
|
+
* For example - normally a creator would create a hollow cube
|
|
6609
|
+
* by creating 6 "wall" surfaces for each face.
|
|
6610
|
+
* With a Compound Block Volume, a creator can define a hollow
|
|
6611
|
+
* cube by creating a single outer solid cube, and then
|
|
6612
|
+
* defining a further single 'void' cube inside the larger one.
|
|
6613
|
+
* Similarly, the Compound Block Volume can represent irregular
|
|
6614
|
+
* shaped volumes (e.g. a tree consists of a trunk and lots of
|
|
6615
|
+
* leaf cubes which are not necessarily contiguously placed).
|
|
6616
|
+
* Each of the volumes added to the CompoundBlockVolume are (by
|
|
6617
|
+
* default) relative to the origin set (either at construction
|
|
6618
|
+
* or via one of the set functions).
|
|
6619
|
+
* However, it is also possible to push volumes to the compound
|
|
6620
|
+
* collection which are absolute in nature and are not affected
|
|
6621
|
+
* by origin changes.
|
|
6622
|
+
*/
|
|
6623
|
+
export class CompoundBlockVolume {
|
|
6624
|
+
/**
|
|
6625
|
+
* @remarks
|
|
6626
|
+
* Return the 'capacity' of the bounding rectangle which
|
|
6627
|
+
* represents the collection of volumes in the stack
|
|
6628
|
+
*
|
|
6629
|
+
*/
|
|
6630
|
+
readonly capacity: number;
|
|
6631
|
+
readonly items: CompoundBlockVolumeItem[];
|
|
6632
|
+
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
6633
|
+
/**
|
|
6634
|
+
* @remarks
|
|
6635
|
+
* Return the number of volumes (positive and negative) in the
|
|
6636
|
+
* volume stack
|
|
6637
|
+
*
|
|
6638
|
+
*/
|
|
6639
|
+
readonly volumeCount: number;
|
|
6640
|
+
/**
|
|
6641
|
+
* @remarks
|
|
6642
|
+
* Create a CompoundBlockVolume object
|
|
6643
|
+
*
|
|
6644
|
+
* @param origin
|
|
6645
|
+
* An optional world space origin on which to center the
|
|
6646
|
+
* compound volume.
|
|
6647
|
+
* If not specified, the origin is set to (0,0,0)
|
|
6648
|
+
*/
|
|
6649
|
+
constructor(origin?: Vector3);
|
|
6650
|
+
/**
|
|
6651
|
+
* @remarks
|
|
6652
|
+
* Clear the contents of the volume stack
|
|
6653
|
+
*
|
|
6654
|
+
* This function can't be called in restricted-execution mode.
|
|
6655
|
+
*
|
|
6656
|
+
*/
|
|
6657
|
+
clear(): void;
|
|
6658
|
+
/**
|
|
6659
|
+
* @remarks
|
|
6660
|
+
* Fetch a Block Location Iterator for the Compound Block
|
|
6661
|
+
* Volume. This iterator will allow a creator to iterate
|
|
6662
|
+
* across all of the selected volumes within the larger
|
|
6663
|
+
* bounding area.
|
|
6664
|
+
* Areas of a volume which have been overridden by a
|
|
6665
|
+
* subtractive volume will not be included in the iterator
|
|
6666
|
+
* step.
|
|
6667
|
+
* (i.e. if you push a cube to the stack, and then push a
|
|
6668
|
+
* subtractive volume to the same location, then the iterator
|
|
6669
|
+
* will step over the initial volume because it is considered
|
|
6670
|
+
* negative space)
|
|
6671
|
+
* Note that the Block Locations returned by this iterator are
|
|
6672
|
+
* in absolute world space (irrespective of whether the
|
|
6673
|
+
* compound volume items pushed are absolute or relative)
|
|
6674
|
+
*
|
|
6675
|
+
* This function can't be called in restricted-execution mode.
|
|
6676
|
+
*
|
|
6677
|
+
*/
|
|
6678
|
+
getBlockLocationIterator(): BlockLocationIterator;
|
|
6679
|
+
/**
|
|
6680
|
+
* @remarks
|
|
6681
|
+
* Get the largest bounding box that represents a container for
|
|
6682
|
+
* all of the volumes on the stack
|
|
6683
|
+
* Note that the bounding box returned is represented in
|
|
6684
|
+
* absolute world space (irrespective of whether the compound
|
|
6685
|
+
* volume items pushed are absolute or relative)
|
|
6686
|
+
*
|
|
6687
|
+
* This function can't be called in restricted-execution mode.
|
|
6688
|
+
*
|
|
6689
|
+
*/
|
|
6690
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6691
|
+
/**
|
|
6692
|
+
* @remarks
|
|
6693
|
+
* Get the max block location of the outermost bounding
|
|
6694
|
+
* rectangle which represents the volumes on the stack.
|
|
6695
|
+
* Note that the max location returned is in absolute world
|
|
6696
|
+
* space (irrespective of whether the compound volume items
|
|
6697
|
+
* pushed are absolute or relative)
|
|
6698
|
+
*
|
|
6699
|
+
* This function can't be called in restricted-execution mode.
|
|
6700
|
+
*
|
|
6701
|
+
*/
|
|
6702
|
+
getMax(): Vector3;
|
|
6703
|
+
/**
|
|
6704
|
+
* @remarks
|
|
6705
|
+
* Get the min block location of the outermost bounding
|
|
6706
|
+
* rectangle which represents the volumes on the stack.
|
|
6707
|
+
* Note that the min location returned is in absolute world
|
|
6708
|
+
* space (irrespective of whether the compound volume items
|
|
6709
|
+
* pushed are absolute or relative)
|
|
6710
|
+
*
|
|
6711
|
+
* This function can't be called in restricted-execution mode.
|
|
6712
|
+
*
|
|
6713
|
+
*/
|
|
6714
|
+
getMin(): Vector3;
|
|
6715
|
+
/**
|
|
6716
|
+
* @remarks
|
|
6717
|
+
* Fetch the origin in world space of the compound volume
|
|
6718
|
+
*
|
|
6719
|
+
* This function can't be called in restricted-execution mode.
|
|
6720
|
+
*
|
|
6721
|
+
*/
|
|
6722
|
+
getOrigin(): Vector3;
|
|
6723
|
+
/**
|
|
6724
|
+
* @remarks
|
|
6725
|
+
* Return a boolean which signals if there are any volume items
|
|
6726
|
+
* pushed to the volume
|
|
6727
|
+
*
|
|
6728
|
+
* This function can't be called in restricted-execution mode.
|
|
6729
|
+
*
|
|
6730
|
+
*/
|
|
6731
|
+
isEmpty(): boolean;
|
|
6732
|
+
/**
|
|
6733
|
+
* @remarks
|
|
6734
|
+
* Return a boolean representing whether or not a given
|
|
6735
|
+
* absolute world space block location is inside a positive
|
|
6736
|
+
* block volume.
|
|
6737
|
+
* E.g. if the stack contains a large cube followed by a
|
|
6738
|
+
* slightly smaller negative cube, and the test location is
|
|
6739
|
+
* within the negative cube - the function will return false
|
|
6740
|
+
* because it's not 'inside' a volume (it IS inside the
|
|
6741
|
+
* bounding rectangle, but it is not inside a positively
|
|
6742
|
+
* defined location)
|
|
6743
|
+
*
|
|
6744
|
+
* This function can't be called in restricted-execution mode.
|
|
6745
|
+
*
|
|
6746
|
+
*/
|
|
6747
|
+
isInside(worldLocation: Vector3): boolean;
|
|
6748
|
+
/**
|
|
6749
|
+
* @remarks
|
|
6750
|
+
* Inspect the last entry pushed to the volume stack without
|
|
6751
|
+
* affecting the stack contents.
|
|
6752
|
+
*
|
|
6753
|
+
* This function can't be called in restricted-execution mode.
|
|
6754
|
+
*
|
|
6755
|
+
* @param forceRelativity
|
|
6756
|
+
* Determine whether the function returns a
|
|
6757
|
+
* CompoundBlockVolumeItem which is forced into either relative
|
|
6758
|
+
* or absolute coordinate system.
|
|
6759
|
+
* `true` = force returned item to be relative to volume origin
|
|
6760
|
+
* `false` = force returned item to be absolute world space
|
|
6761
|
+
* location
|
|
6762
|
+
*
|
|
6763
|
+
* If no flag is specified, the item returned retains whatever
|
|
6764
|
+
* relativity it had when it was pushed
|
|
6765
|
+
* @returns
|
|
6766
|
+
* Returns undefined if the stack is empty
|
|
6767
|
+
*/
|
|
6768
|
+
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
6769
|
+
/**
|
|
6770
|
+
* @remarks
|
|
6771
|
+
* Remove the last entry from the volume stack. This will
|
|
6772
|
+
* reduce the stack size by one
|
|
6773
|
+
*
|
|
6774
|
+
* This function can't be called in restricted-execution mode.
|
|
6775
|
+
*
|
|
6776
|
+
*/
|
|
6777
|
+
popVolume(): boolean;
|
|
6778
|
+
/**
|
|
6779
|
+
* @remarks
|
|
6780
|
+
* Push a volume item to the stack. The volume item contains
|
|
6781
|
+
* an 'action' parameter which determines whether this volume
|
|
6782
|
+
* is a positive or negative space.
|
|
6783
|
+
* The item also contains a `locationRelativity` which
|
|
6784
|
+
* determines whether it is relative or absolute to the
|
|
6785
|
+
* compound volume origin
|
|
6786
|
+
*
|
|
6787
|
+
* This function can't be called in restricted-execution mode.
|
|
6788
|
+
*
|
|
6789
|
+
* @param item
|
|
6790
|
+
* Item to push to the end of the stack
|
|
6791
|
+
*/
|
|
6792
|
+
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
6793
|
+
/**
|
|
6794
|
+
* @remarks
|
|
6795
|
+
* If the volume stack is empty, this function will push the
|
|
6796
|
+
* specified item to the stack.
|
|
6797
|
+
* If the volume stack is NOT empty, this function will replace
|
|
6798
|
+
* the last item on the stack with the new item.
|
|
6799
|
+
*
|
|
6800
|
+
* This function can't be called in restricted-execution mode.
|
|
6801
|
+
*
|
|
6802
|
+
* @param item
|
|
6803
|
+
* Item to add or replace
|
|
6804
|
+
*/
|
|
6805
|
+
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
6806
|
+
/**
|
|
6807
|
+
* @remarks
|
|
6808
|
+
* Set the origin of the compound volume to an absolute world
|
|
6809
|
+
* space location
|
|
6810
|
+
*
|
|
6811
|
+
* This function can't be called in restricted-execution mode.
|
|
6812
|
+
*
|
|
6813
|
+
* @param preserveExistingVolumes
|
|
6814
|
+
* This optional boolean flag determines whether the relative
|
|
6815
|
+
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
6816
|
+
* affected by the new origin.
|
|
6817
|
+
* Imagine a scenario where you have a series of relative
|
|
6818
|
+
* locations around an origin which make up a sphere; all of
|
|
6819
|
+
* these locations are in the range of -2 to 2.
|
|
6820
|
+
* Push each of these locations to the compound volume as
|
|
6821
|
+
* relative items.
|
|
6822
|
+
* Now, move the origin and all of the locations representing
|
|
6823
|
+
* the sphere move accordingly.
|
|
6824
|
+
* However, let's say you want to add a 2nd sphere next to the
|
|
6825
|
+
* 1st.
|
|
6826
|
+
* In this case, set the new origin a few locations over, but
|
|
6827
|
+
* 'preserveExistingVolumes' = true.
|
|
6828
|
+
* This will set a new origin, but the existing sphere
|
|
6829
|
+
* locations will remain relative to the original origin.
|
|
6830
|
+
* Now, you can push the relative sphere locations again (this
|
|
6831
|
+
* time they will be relative to the new origin) - resulting in
|
|
6832
|
+
* 2 spheres next to each other.
|
|
6833
|
+
*/
|
|
6834
|
+
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6835
|
+
/**
|
|
6836
|
+
* @remarks
|
|
6837
|
+
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
6838
|
+
* function will translate the origin by a given delta to a new
|
|
6839
|
+
* position
|
|
6840
|
+
*
|
|
6841
|
+
* This function can't be called in restricted-execution mode.
|
|
6842
|
+
*
|
|
6843
|
+
* @param preserveExistingVolumes
|
|
6844
|
+
* See the description for the arguments to {@link
|
|
6845
|
+
* CompoundBlockVolume.setOrigin}
|
|
6846
|
+
*/
|
|
6847
|
+
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6848
|
+
}
|
|
6849
|
+
|
|
5335
6850
|
/**
|
|
5336
6851
|
* Represents a container that can hold sets of items. Used
|
|
5337
6852
|
* with entities such as Players, Chest Minecarts, Llamas, and
|
|
@@ -5469,7 +6984,9 @@ export class Container {
|
|
|
5469
6984
|
*
|
|
5470
6985
|
* @param itemStack
|
|
5471
6986
|
* The stack of items to add.
|
|
5472
|
-
* @throws
|
|
6987
|
+
* @throws
|
|
6988
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
6989
|
+
* limit but will instead add items up to the weight limit.
|
|
5473
6990
|
*
|
|
5474
6991
|
* {@link ContainerRulesError}
|
|
5475
6992
|
*
|
|
@@ -5709,6 +7226,8 @@ export class Container {
|
|
|
5709
7226
|
* @throws
|
|
5710
7227
|
* Throws if either this container or `toContainer` are invalid
|
|
5711
7228
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
7229
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7230
|
+
* limit but will instead add items up to the weight limit.
|
|
5712
7231
|
*
|
|
5713
7232
|
* {@link ContainerRulesError}
|
|
5714
7233
|
*
|
|
@@ -6497,6 +8016,30 @@ export class Dimension {
|
|
|
6497
8016
|
block: BlockPermutation | BlockType | string,
|
|
6498
8017
|
options?: BlockFillOptions,
|
|
6499
8018
|
): ListBlockVolume;
|
|
8019
|
+
/**
|
|
8020
|
+
* @beta
|
|
8021
|
+
* @remarks
|
|
8022
|
+
* Finds the location of the closest biome of a particular
|
|
8023
|
+
* type. Note that the findClosestBiome operation can take some
|
|
8024
|
+
* time to complete, so avoid using many of these calls within
|
|
8025
|
+
* a particular tick.
|
|
8026
|
+
*
|
|
8027
|
+
* @param pos
|
|
8028
|
+
* Starting location to look for a biome to find.
|
|
8029
|
+
* @param biomeToFind
|
|
8030
|
+
* Identifier of the biome to look for.
|
|
8031
|
+
* @param options
|
|
8032
|
+
* Additional selection criteria for a biome search.
|
|
8033
|
+
* @returns
|
|
8034
|
+
* Returns a location of the biome, or undefined if a biome
|
|
8035
|
+
* could not be found.
|
|
8036
|
+
* @throws This function can throw errors.
|
|
8037
|
+
*
|
|
8038
|
+
* {@link minecraftcommon.EngineError}
|
|
8039
|
+
*
|
|
8040
|
+
* {@link Error}
|
|
8041
|
+
*/
|
|
8042
|
+
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
6500
8043
|
/**
|
|
6501
8044
|
* @remarks
|
|
6502
8045
|
* Returns the biome type at the specified location.
|
|
@@ -6716,6 +8259,26 @@ export class Dimension {
|
|
|
6716
8259
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6717
8260
|
*/
|
|
6718
8261
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8262
|
+
/**
|
|
8263
|
+
* @beta
|
|
8264
|
+
* @remarks
|
|
8265
|
+
* Returns a vector of generated structures that contain the
|
|
8266
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
8267
|
+
* The vector will be empty if no structures are found.
|
|
8268
|
+
*
|
|
8269
|
+
* @param location
|
|
8270
|
+
* Location at which to check for structures.
|
|
8271
|
+
* @throws
|
|
8272
|
+
* An error will be thrown if the location is out of world
|
|
8273
|
+
* bounds.
|
|
8274
|
+
* An error will be thrown if the location is in an unloaded
|
|
8275
|
+
* chunk.
|
|
8276
|
+
*
|
|
8277
|
+
* {@link LocationInUnloadedChunkError}
|
|
8278
|
+
*
|
|
8279
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8280
|
+
*/
|
|
8281
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
6719
8282
|
/**
|
|
6720
8283
|
* @remarks
|
|
6721
8284
|
* Returns the total brightness level of light shining on a
|
|
@@ -6777,6 +8340,16 @@ export class Dimension {
|
|
|
6777
8340
|
* @throws This function can throw errors.
|
|
6778
8341
|
*/
|
|
6779
8342
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
8343
|
+
/**
|
|
8344
|
+
* @beta
|
|
8345
|
+
* @remarks
|
|
8346
|
+
* Returns the current weather.
|
|
8347
|
+
*
|
|
8348
|
+
* @returns
|
|
8349
|
+
* Returns a WeatherType that explains the broad category of
|
|
8350
|
+
* weather that is currently going on.
|
|
8351
|
+
*/
|
|
8352
|
+
getWeather(): WeatherType;
|
|
6780
8353
|
/**
|
|
6781
8354
|
* @remarks
|
|
6782
8355
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -7020,7 +8593,11 @@ export class Dimension {
|
|
|
7020
8593
|
* }
|
|
7021
8594
|
* ```
|
|
7022
8595
|
*/
|
|
7023
|
-
spawnEntity
|
|
8596
|
+
spawnEntity<T = never>(
|
|
8597
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
8598
|
+
location: Vector3,
|
|
8599
|
+
options?: SpawnEntityOptions,
|
|
8600
|
+
): Entity;
|
|
7024
8601
|
/**
|
|
7025
8602
|
* @remarks
|
|
7026
8603
|
* Creates a new item stack as an entity at the specified
|
|
@@ -7115,6 +8692,26 @@ export class Dimension {
|
|
|
7115
8692
|
* ```
|
|
7116
8693
|
*/
|
|
7117
8694
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
8695
|
+
/**
|
|
8696
|
+
* @beta
|
|
8697
|
+
* @remarks
|
|
8698
|
+
* Stops all sounds from playing for all players.
|
|
8699
|
+
*
|
|
8700
|
+
* This function can't be called in restricted-execution mode.
|
|
8701
|
+
*
|
|
8702
|
+
*/
|
|
8703
|
+
stopAllSounds(): void;
|
|
8704
|
+
/**
|
|
8705
|
+
* @beta
|
|
8706
|
+
* @remarks
|
|
8707
|
+
* Stops a sound from playing for all players.
|
|
8708
|
+
*
|
|
8709
|
+
* This function can't be called in restricted-execution mode.
|
|
8710
|
+
*
|
|
8711
|
+
* @param soundId
|
|
8712
|
+
* Identifier of the sound.
|
|
8713
|
+
*/
|
|
8714
|
+
stopSound(soundId: string): void;
|
|
7118
8715
|
}
|
|
7119
8716
|
|
|
7120
8717
|
/**
|
|
@@ -7639,6 +9236,18 @@ export class Entity {
|
|
|
7639
9236
|
*
|
|
7640
9237
|
*/
|
|
7641
9238
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
9239
|
+
/**
|
|
9240
|
+
* @beta
|
|
9241
|
+
* @remarks
|
|
9242
|
+
* Retrieves or sets an entity that is used as the target of
|
|
9243
|
+
* AI-related behaviors, like attacking. If the entity
|
|
9244
|
+
* currently has no target returns undefined.
|
|
9245
|
+
*
|
|
9246
|
+
* @throws This property can throw when used.
|
|
9247
|
+
*
|
|
9248
|
+
* {@link InvalidEntityError}
|
|
9249
|
+
*/
|
|
9250
|
+
readonly target?: Entity;
|
|
7642
9251
|
/**
|
|
7643
9252
|
* @remarks
|
|
7644
9253
|
* Identifier of the type of the entity - for example,
|
|
@@ -8867,6 +10476,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
8867
10476
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
8868
10477
|
export class EntityBreathableComponent extends EntityComponent {
|
|
8869
10478
|
private constructor();
|
|
10479
|
+
/**
|
|
10480
|
+
* @beta
|
|
10481
|
+
* @remarks
|
|
10482
|
+
* The current air supply of the entity.
|
|
10483
|
+
*
|
|
10484
|
+
* This property can't be edited in restricted-execution mode.
|
|
10485
|
+
*
|
|
10486
|
+
* @throws
|
|
10487
|
+
* Will throw an error if the air supply is out of bounds
|
|
10488
|
+
* [suffocationTime, maxAirSupply].
|
|
10489
|
+
*/
|
|
10490
|
+
airSupply: number;
|
|
8870
10491
|
/**
|
|
8871
10492
|
* @remarks
|
|
8872
10493
|
* If true, this entity can breathe in air.
|
|
@@ -8895,6 +10516,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
8895
10516
|
* @throws This property can throw when used.
|
|
8896
10517
|
*/
|
|
8897
10518
|
readonly breathesWater: boolean;
|
|
10519
|
+
/**
|
|
10520
|
+
* @beta
|
|
10521
|
+
* @remarks
|
|
10522
|
+
* If true, the entity is able to breathe.
|
|
10523
|
+
*
|
|
10524
|
+
* @throws This property can throw when used.
|
|
10525
|
+
*/
|
|
10526
|
+
readonly canBreathe: boolean;
|
|
8898
10527
|
/**
|
|
8899
10528
|
* @remarks
|
|
8900
10529
|
* If true, this entity will have visible bubbles while in
|
|
@@ -9050,6 +10679,10 @@ export class EntityDefinitionFeedItem {
|
|
|
9050
10679
|
*
|
|
9051
10680
|
*/
|
|
9052
10681
|
readonly item: string;
|
|
10682
|
+
/**
|
|
10683
|
+
* @beta
|
|
10684
|
+
*/
|
|
10685
|
+
readonly resultItem: string;
|
|
9053
10686
|
}
|
|
9054
10687
|
|
|
9055
10688
|
/**
|
|
@@ -10024,17 +11657,72 @@ export class EntityIsTamedComponent extends EntityComponent {
|
|
|
10024
11657
|
* }
|
|
10025
11658
|
* ```
|
|
10026
11659
|
*/
|
|
10027
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10028
|
-
export class EntityItemComponent extends EntityComponent {
|
|
11660
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11661
|
+
export class EntityItemComponent extends EntityComponent {
|
|
11662
|
+
private constructor();
|
|
11663
|
+
/**
|
|
11664
|
+
* @remarks
|
|
11665
|
+
* Item stack represented by this entity in the world.
|
|
11666
|
+
*
|
|
11667
|
+
* @throws This property can throw when used.
|
|
11668
|
+
*/
|
|
11669
|
+
readonly itemStack: ItemStack;
|
|
11670
|
+
static readonly componentId = 'minecraft:item';
|
|
11671
|
+
}
|
|
11672
|
+
|
|
11673
|
+
/**
|
|
11674
|
+
* @beta
|
|
11675
|
+
* Contains information related to an entity having dropped
|
|
11676
|
+
* items.
|
|
11677
|
+
*/
|
|
11678
|
+
export class EntityItemDropAfterEvent {
|
|
11679
|
+
private constructor();
|
|
11680
|
+
/**
|
|
11681
|
+
* @remarks
|
|
11682
|
+
* The entity that has dropped the items.
|
|
11683
|
+
*
|
|
11684
|
+
*/
|
|
11685
|
+
readonly entity: Entity;
|
|
11686
|
+
/**
|
|
11687
|
+
* @remarks
|
|
11688
|
+
* The list of items the entity has dropped.
|
|
11689
|
+
*
|
|
11690
|
+
*/
|
|
11691
|
+
readonly items: Entity[];
|
|
11692
|
+
}
|
|
11693
|
+
|
|
11694
|
+
/**
|
|
11695
|
+
* @beta
|
|
11696
|
+
* Manages callbacks that are connected to when an entity has
|
|
11697
|
+
* dropped items.
|
|
11698
|
+
*/
|
|
11699
|
+
export class EntityItemDropAfterEventSignal {
|
|
10029
11700
|
private constructor();
|
|
10030
11701
|
/**
|
|
10031
11702
|
* @remarks
|
|
10032
|
-
*
|
|
11703
|
+
* Adds a callback that will be called when an entity has
|
|
11704
|
+
* dropped items.
|
|
11705
|
+
*
|
|
11706
|
+
* This function can't be called in restricted-execution mode.
|
|
11707
|
+
*
|
|
11708
|
+
* This function can be called in early-execution mode.
|
|
10033
11709
|
*
|
|
10034
|
-
* @throws This property can throw when used.
|
|
10035
11710
|
*/
|
|
10036
|
-
|
|
10037
|
-
|
|
11711
|
+
subscribe(
|
|
11712
|
+
callback: (arg0: EntityItemDropAfterEvent) => void,
|
|
11713
|
+
options?: EntityItemDropEventOptions,
|
|
11714
|
+
): (arg0: EntityItemDropAfterEvent) => void;
|
|
11715
|
+
/**
|
|
11716
|
+
* @remarks
|
|
11717
|
+
* Removes a callback from being called when an entity has
|
|
11718
|
+
* dropped items.
|
|
11719
|
+
*
|
|
11720
|
+
* This function can't be called in restricted-execution mode.
|
|
11721
|
+
*
|
|
11722
|
+
* This function can be called in early-execution mode.
|
|
11723
|
+
*
|
|
11724
|
+
*/
|
|
11725
|
+
unsubscribe(callback: (arg0: EntityItemDropAfterEvent) => void): void;
|
|
10038
11726
|
}
|
|
10039
11727
|
|
|
10040
11728
|
/**
|
|
@@ -10680,6 +12368,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
10680
12368
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
10681
12369
|
}
|
|
10682
12370
|
|
|
12371
|
+
/**
|
|
12372
|
+
* @beta
|
|
12373
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
12374
|
+
* name, and dialogue interactions.
|
|
12375
|
+
*/
|
|
12376
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12377
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
12378
|
+
private constructor();
|
|
12379
|
+
/**
|
|
12380
|
+
* @remarks
|
|
12381
|
+
* The DialogueScene that is opened when players first interact
|
|
12382
|
+
* with the NPC.
|
|
12383
|
+
*
|
|
12384
|
+
* This property can't be edited in restricted-execution mode.
|
|
12385
|
+
*
|
|
12386
|
+
*/
|
|
12387
|
+
defaultScene: string;
|
|
12388
|
+
/**
|
|
12389
|
+
* @remarks
|
|
12390
|
+
* The name of the NPC as it is displayed to players.
|
|
12391
|
+
*
|
|
12392
|
+
* This property can't be edited in restricted-execution mode.
|
|
12393
|
+
*
|
|
12394
|
+
*/
|
|
12395
|
+
name: string;
|
|
12396
|
+
/**
|
|
12397
|
+
* @remarks
|
|
12398
|
+
* The index of the skin the NPC will use.
|
|
12399
|
+
*
|
|
12400
|
+
* This property can't be edited in restricted-execution mode.
|
|
12401
|
+
*
|
|
12402
|
+
*/
|
|
12403
|
+
skinIndex: number;
|
|
12404
|
+
static readonly componentId = 'minecraft:npc';
|
|
12405
|
+
}
|
|
12406
|
+
|
|
10683
12407
|
/**
|
|
10684
12408
|
* When present on an entity, this entity is on fire.
|
|
10685
12409
|
* @example setOnFire.ts
|
|
@@ -11558,7 +13282,7 @@ export class EntityTypes {
|
|
|
11558
13282
|
* Retrieves an entity type using a string-based identifier.
|
|
11559
13283
|
*
|
|
11560
13284
|
*/
|
|
11561
|
-
static get(identifier:
|
|
13285
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
11562
13286
|
/**
|
|
11563
13287
|
* @remarks
|
|
11564
13288
|
* Retrieves a set of all entity types within this world.
|
|
@@ -11768,6 +13492,10 @@ export class FeedItem {
|
|
|
11768
13492
|
*
|
|
11769
13493
|
*/
|
|
11770
13494
|
readonly item: string;
|
|
13495
|
+
/**
|
|
13496
|
+
* @beta
|
|
13497
|
+
*/
|
|
13498
|
+
readonly resultItem: string;
|
|
11771
13499
|
/**
|
|
11772
13500
|
* @remarks
|
|
11773
13501
|
* As part of the Healable component, an optional collection of
|
|
@@ -12015,6 +13743,13 @@ export class GameRules {
|
|
|
12015
13743
|
*
|
|
12016
13744
|
*/
|
|
12017
13745
|
keepInventory: boolean;
|
|
13746
|
+
/**
|
|
13747
|
+
* @beta
|
|
13748
|
+
* @remarks
|
|
13749
|
+
* This property can't be edited in restricted-execution mode.
|
|
13750
|
+
*
|
|
13751
|
+
*/
|
|
13752
|
+
locatorBar: boolean;
|
|
12018
13753
|
/**
|
|
12019
13754
|
* @remarks
|
|
12020
13755
|
* This property can't be edited in restricted-execution mode.
|
|
@@ -14291,6 +16026,21 @@ export class LeverActionAfterEventSignal {
|
|
|
14291
16026
|
unsubscribe(callback: (arg0: LeverActionAfterEvent) => void): void;
|
|
14292
16027
|
}
|
|
14293
16028
|
|
|
16029
|
+
/**
|
|
16030
|
+
* @beta
|
|
16031
|
+
* A spline that linearly interpolates between points.
|
|
16032
|
+
*/
|
|
16033
|
+
export class LinearSpline {
|
|
16034
|
+
/**
|
|
16035
|
+
* @remarks
|
|
16036
|
+
* Control points for the Linear spline.
|
|
16037
|
+
*
|
|
16038
|
+
* This property can't be edited in restricted-execution mode.
|
|
16039
|
+
*
|
|
16040
|
+
*/
|
|
16041
|
+
controlPoints: Vector3[];
|
|
16042
|
+
}
|
|
16043
|
+
|
|
14294
16044
|
/**
|
|
14295
16045
|
* Volume composed of an unordered container of unique block
|
|
14296
16046
|
* locations.
|
|
@@ -14702,6 +16452,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
14702
16452
|
readonly itemTagsNone: string[];
|
|
14703
16453
|
}
|
|
14704
16454
|
|
|
16455
|
+
/**
|
|
16456
|
+
* @beta
|
|
16457
|
+
* A specific currently-internal event used for passing
|
|
16458
|
+
* messages from client to server.
|
|
16459
|
+
*/
|
|
16460
|
+
export class MessageReceiveAfterEvent {
|
|
16461
|
+
private constructor();
|
|
16462
|
+
/**
|
|
16463
|
+
* @remarks
|
|
16464
|
+
* The message identifier.
|
|
16465
|
+
*
|
|
16466
|
+
*/
|
|
16467
|
+
readonly id: string;
|
|
16468
|
+
/**
|
|
16469
|
+
* @remarks
|
|
16470
|
+
* The message.
|
|
16471
|
+
*
|
|
16472
|
+
*/
|
|
16473
|
+
readonly message: string;
|
|
16474
|
+
/**
|
|
16475
|
+
* @remarks
|
|
16476
|
+
* The player who sent the message.
|
|
16477
|
+
*
|
|
16478
|
+
*/
|
|
16479
|
+
readonly player: Player;
|
|
16480
|
+
}
|
|
16481
|
+
|
|
14705
16482
|
/**
|
|
14706
16483
|
* Contains a set of additional variable values for further
|
|
14707
16484
|
* defining how rendering and animations function.
|
|
@@ -14770,6 +16547,49 @@ export class MolangVariableMap {
|
|
|
14770
16547
|
setVector3(variableName: string, vector: Vector3): void;
|
|
14771
16548
|
}
|
|
14772
16549
|
|
|
16550
|
+
/**
|
|
16551
|
+
* @beta
|
|
16552
|
+
* Pack setting name and value that changed.
|
|
16553
|
+
*/
|
|
16554
|
+
export class PackSettingChangeAfterEvent {
|
|
16555
|
+
private constructor();
|
|
16556
|
+
/**
|
|
16557
|
+
* @remarks
|
|
16558
|
+
* The name of the setting.
|
|
16559
|
+
*
|
|
16560
|
+
*/
|
|
16561
|
+
readonly settingName: string;
|
|
16562
|
+
/**
|
|
16563
|
+
* @remarks
|
|
16564
|
+
* The value of the setting.
|
|
16565
|
+
*
|
|
16566
|
+
*/
|
|
16567
|
+
readonly settingValue: boolean | number | string;
|
|
16568
|
+
}
|
|
16569
|
+
|
|
16570
|
+
/**
|
|
16571
|
+
* @beta
|
|
16572
|
+
*/
|
|
16573
|
+
export class PackSettingChangeAfterEventSignal {
|
|
16574
|
+
private constructor();
|
|
16575
|
+
/**
|
|
16576
|
+
* @remarks
|
|
16577
|
+
* This function can't be called in restricted-execution mode.
|
|
16578
|
+
*
|
|
16579
|
+
* This function can be called in early-execution mode.
|
|
16580
|
+
*
|
|
16581
|
+
*/
|
|
16582
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
16583
|
+
/**
|
|
16584
|
+
* @remarks
|
|
16585
|
+
* This function can't be called in restricted-execution mode.
|
|
16586
|
+
*
|
|
16587
|
+
* This function can be called in early-execution mode.
|
|
16588
|
+
*
|
|
16589
|
+
*/
|
|
16590
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
16591
|
+
}
|
|
16592
|
+
|
|
14773
16593
|
/**
|
|
14774
16594
|
* Loot item condition that checks whether the looting entity
|
|
14775
16595
|
* is currently a passenger of a specific type of entity.
|
|
@@ -15012,6 +16832,13 @@ export class Player extends Entity {
|
|
|
15012
16832
|
* @throws This property can throw when used.
|
|
15013
16833
|
*/
|
|
15014
16834
|
readonly onScreenDisplay: ScreenDisplay;
|
|
16835
|
+
/**
|
|
16836
|
+
* @beta
|
|
16837
|
+
* @throws This property can throw when used.
|
|
16838
|
+
*
|
|
16839
|
+
* {@link InvalidEntityError}
|
|
16840
|
+
*/
|
|
16841
|
+
readonly partyId?: string;
|
|
15015
16842
|
/**
|
|
15016
16843
|
* @throws This property can throw when used.
|
|
15017
16844
|
*
|
|
@@ -15085,6 +16912,27 @@ export class Player extends Entity {
|
|
|
15085
16912
|
* Throws if the Entity or Entity ID is invalid.
|
|
15086
16913
|
*/
|
|
15087
16914
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
16915
|
+
/**
|
|
16916
|
+
* @beta
|
|
16917
|
+
* @remarks
|
|
16918
|
+
* Eats an item, providing the item's hunger and saturation
|
|
16919
|
+
* effects to the player. Can only be used on food items.
|
|
16920
|
+
*
|
|
16921
|
+
* This function can't be called in restricted-execution mode.
|
|
16922
|
+
*
|
|
16923
|
+
* @param itemStack
|
|
16924
|
+
* The item to eat.
|
|
16925
|
+
* @throws
|
|
16926
|
+
* Throws if the item is not a food item.
|
|
16927
|
+
*/
|
|
16928
|
+
eatItem(itemStack: ItemStack): void;
|
|
16929
|
+
/**
|
|
16930
|
+
* @beta
|
|
16931
|
+
* @remarks
|
|
16932
|
+
* The player's aim-assist settings.
|
|
16933
|
+
*
|
|
16934
|
+
*/
|
|
16935
|
+
getAimAssist(): PlayerAimAssist;
|
|
15088
16936
|
/**
|
|
15089
16937
|
* @remarks
|
|
15090
16938
|
* Returns the player's current control scheme.
|
|
@@ -15179,6 +17027,17 @@ export class Player extends Entity {
|
|
|
15179
17027
|
* ```
|
|
15180
17028
|
*/
|
|
15181
17029
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
|
|
17030
|
+
/**
|
|
17031
|
+
* @beta
|
|
17032
|
+
* @remarks
|
|
17033
|
+
* This is an internal-facing method for posting a system
|
|
17034
|
+
* message to downstream clients.
|
|
17035
|
+
*
|
|
17036
|
+
* This function can't be called in restricted-execution mode.
|
|
17037
|
+
*
|
|
17038
|
+
* @throws This function can throw errors.
|
|
17039
|
+
*/
|
|
17040
|
+
postClientMessage(id: string, value: string): void;
|
|
15182
17041
|
/**
|
|
15183
17042
|
* @remarks
|
|
15184
17043
|
* Queues an additional music track that only this particular
|
|
@@ -15456,6 +17315,18 @@ export class Player extends Entity {
|
|
|
15456
17315
|
* @throws This function can throw errors.
|
|
15457
17316
|
*/
|
|
15458
17317
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
17318
|
+
/**
|
|
17319
|
+
* @beta
|
|
17320
|
+
* @remarks
|
|
17321
|
+
* Stops all sounds from playing for this particular player.
|
|
17322
|
+
*
|
|
17323
|
+
* This function can't be called in restricted-execution mode.
|
|
17324
|
+
*
|
|
17325
|
+
* @throws This function can throw errors.
|
|
17326
|
+
*
|
|
17327
|
+
* {@link InvalidEntityError}
|
|
17328
|
+
*/
|
|
17329
|
+
stopAllSounds(): void;
|
|
15459
17330
|
/**
|
|
15460
17331
|
* @remarks
|
|
15461
17332
|
* Stops any music tracks from playing for this particular
|
|
@@ -15466,6 +17337,59 @@ export class Player extends Entity {
|
|
|
15466
17337
|
* @throws This function can throw errors.
|
|
15467
17338
|
*/
|
|
15468
17339
|
stopMusic(): void;
|
|
17340
|
+
/**
|
|
17341
|
+
* @beta
|
|
17342
|
+
* @remarks
|
|
17343
|
+
* Stops a sound from playing for this particular player.
|
|
17344
|
+
*
|
|
17345
|
+
* This function can't be called in restricted-execution mode.
|
|
17346
|
+
*
|
|
17347
|
+
* @param soundId
|
|
17348
|
+
* Identifier of the sound.
|
|
17349
|
+
* @throws This function can throw errors.
|
|
17350
|
+
*
|
|
17351
|
+
* {@link InvalidEntityError}
|
|
17352
|
+
*/
|
|
17353
|
+
stopSound(soundId: string): void;
|
|
17354
|
+
}
|
|
17355
|
+
|
|
17356
|
+
/**
|
|
17357
|
+
* @beta
|
|
17358
|
+
* A container for APIs related to player aim-assist.
|
|
17359
|
+
*/
|
|
17360
|
+
export class PlayerAimAssist {
|
|
17361
|
+
private constructor();
|
|
17362
|
+
/**
|
|
17363
|
+
* @remarks
|
|
17364
|
+
* The player's currently active aim-assist settings, or
|
|
17365
|
+
* undefined if not active.
|
|
17366
|
+
*
|
|
17367
|
+
*/
|
|
17368
|
+
readonly settings?: PlayerAimAssistSettings;
|
|
17369
|
+
/**
|
|
17370
|
+
* @remarks
|
|
17371
|
+
* Sets the player's aim-assist settings.
|
|
17372
|
+
*
|
|
17373
|
+
* This function can't be called in restricted-execution mode.
|
|
17374
|
+
*
|
|
17375
|
+
* @param settings
|
|
17376
|
+
* Aim-assist settings to activate for the player, if undefined
|
|
17377
|
+
* aim-assist will be disabled.
|
|
17378
|
+
* @throws This function can throw errors.
|
|
17379
|
+
*
|
|
17380
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
17381
|
+
*
|
|
17382
|
+
* {@link minecraftcommon.EngineError}
|
|
17383
|
+
*
|
|
17384
|
+
* {@link Error}
|
|
17385
|
+
*
|
|
17386
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
17387
|
+
*
|
|
17388
|
+
* {@link InvalidEntityError}
|
|
17389
|
+
*
|
|
17390
|
+
* {@link NamespaceNameError}
|
|
17391
|
+
*/
|
|
17392
|
+
set(settings?: PlayerAimAssistSettings): void;
|
|
15469
17393
|
}
|
|
15470
17394
|
|
|
15471
17395
|
/**
|
|
@@ -16701,15 +18625,97 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
16701
18625
|
): (arg0: PlayerPlaceBlockAfterEvent) => void;
|
|
16702
18626
|
/**
|
|
16703
18627
|
* @remarks
|
|
16704
|
-
* Removes a callback from being called when an block is placed
|
|
16705
|
-
* by a player.
|
|
18628
|
+
* Removes a callback from being called when an block is placed
|
|
18629
|
+
* by a player.
|
|
18630
|
+
*
|
|
18631
|
+
* This function can't be called in restricted-execution mode.
|
|
18632
|
+
*
|
|
18633
|
+
* This function can be called in early-execution mode.
|
|
18634
|
+
*
|
|
18635
|
+
*/
|
|
18636
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
18637
|
+
}
|
|
18638
|
+
|
|
18639
|
+
/**
|
|
18640
|
+
* @beta
|
|
18641
|
+
* Contains information regarding an event before a player
|
|
18642
|
+
* places a block.
|
|
18643
|
+
*/
|
|
18644
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18645
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
18646
|
+
private constructor();
|
|
18647
|
+
/**
|
|
18648
|
+
* @remarks
|
|
18649
|
+
* If set to true, cancels the block place event.
|
|
18650
|
+
*
|
|
18651
|
+
*/
|
|
18652
|
+
cancel: boolean;
|
|
18653
|
+
/**
|
|
18654
|
+
* @remarks
|
|
18655
|
+
* The face of the block that the new block is being placed on.
|
|
18656
|
+
*
|
|
18657
|
+
*/
|
|
18658
|
+
readonly face: Direction;
|
|
18659
|
+
/**
|
|
18660
|
+
* @remarks
|
|
18661
|
+
* Location relative to the bottom north-west corner of the
|
|
18662
|
+
* block where the new block is being placed onto.
|
|
18663
|
+
*
|
|
18664
|
+
*/
|
|
18665
|
+
readonly faceLocation: Vector3;
|
|
18666
|
+
/**
|
|
18667
|
+
* @remarks
|
|
18668
|
+
* The block permutation that will be placed if the event is
|
|
18669
|
+
* not cancelled.
|
|
18670
|
+
*
|
|
18671
|
+
*/
|
|
18672
|
+
readonly permutationToPlace: BlockPermutation;
|
|
18673
|
+
/**
|
|
18674
|
+
* @remarks
|
|
18675
|
+
* Player that is placing the block for this event.
|
|
18676
|
+
*
|
|
18677
|
+
*/
|
|
18678
|
+
readonly player: Player;
|
|
18679
|
+
}
|
|
18680
|
+
|
|
18681
|
+
/**
|
|
18682
|
+
* @beta
|
|
18683
|
+
* Manages callbacks that are connected to before a block is
|
|
18684
|
+
* placed by a player.
|
|
18685
|
+
*/
|
|
18686
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
18687
|
+
private constructor();
|
|
18688
|
+
/**
|
|
18689
|
+
* @remarks
|
|
18690
|
+
* Adds a callback that will be called before a block is placed
|
|
18691
|
+
* by a player.
|
|
18692
|
+
*
|
|
18693
|
+
* This function can't be called in restricted-execution mode.
|
|
18694
|
+
*
|
|
18695
|
+
* This function can be called in early-execution mode.
|
|
18696
|
+
*
|
|
18697
|
+
* @param callback
|
|
18698
|
+
* This closure is called with restricted-execution privilege.
|
|
18699
|
+
* @returns
|
|
18700
|
+
* Closure that is called with restricted-execution privilege.
|
|
18701
|
+
*/
|
|
18702
|
+
subscribe(
|
|
18703
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
18704
|
+
options?: BlockEventOptions,
|
|
18705
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
18706
|
+
/**
|
|
18707
|
+
* @remarks
|
|
18708
|
+
* Removes a callback from being called before an block is
|
|
18709
|
+
* placed by a player.
|
|
16706
18710
|
*
|
|
16707
18711
|
* This function can't be called in restricted-execution mode.
|
|
16708
18712
|
*
|
|
16709
18713
|
* This function can be called in early-execution mode.
|
|
16710
18714
|
*
|
|
18715
|
+
* @param callback
|
|
18716
|
+
* This closure is called with restricted-execution privilege.
|
|
16711
18717
|
*/
|
|
16712
|
-
unsubscribe(callback: (arg0:
|
|
18718
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
16713
18719
|
}
|
|
16714
18720
|
|
|
16715
18721
|
/**
|
|
@@ -16832,6 +18838,80 @@ export class PlayerSwingStartAfterEventSignal {
|
|
|
16832
18838
|
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
16833
18839
|
}
|
|
16834
18840
|
|
|
18841
|
+
/**
|
|
18842
|
+
* @beta
|
|
18843
|
+
* Contains information related to when a player successfully
|
|
18844
|
+
* names an Entity with a named Name Tag item.
|
|
18845
|
+
*/
|
|
18846
|
+
export class PlayerUseNameTagAfterEvent {
|
|
18847
|
+
private constructor();
|
|
18848
|
+
/**
|
|
18849
|
+
* @remarks
|
|
18850
|
+
* The entity that was named by the player.
|
|
18851
|
+
*
|
|
18852
|
+
* This property can't be edited in restricted-execution mode.
|
|
18853
|
+
*
|
|
18854
|
+
*/
|
|
18855
|
+
entityNamed: Entity;
|
|
18856
|
+
/**
|
|
18857
|
+
* @remarks
|
|
18858
|
+
* The new name that the player has given to the entity.
|
|
18859
|
+
*
|
|
18860
|
+
* This property can't be edited in restricted-execution mode.
|
|
18861
|
+
*
|
|
18862
|
+
*/
|
|
18863
|
+
newName: string;
|
|
18864
|
+
/**
|
|
18865
|
+
* @remarks
|
|
18866
|
+
* Handle to the player that used the name tag.
|
|
18867
|
+
*
|
|
18868
|
+
* This property can't be edited in restricted-execution mode.
|
|
18869
|
+
*
|
|
18870
|
+
*/
|
|
18871
|
+
player: Player;
|
|
18872
|
+
/**
|
|
18873
|
+
* @remarks
|
|
18874
|
+
* The previous name of the entity before the player used the
|
|
18875
|
+
* name tag. This will be undefined if the entity was not
|
|
18876
|
+
* previously named.
|
|
18877
|
+
*
|
|
18878
|
+
* This property can't be edited in restricted-execution mode.
|
|
18879
|
+
*
|
|
18880
|
+
*/
|
|
18881
|
+
previousName?: string;
|
|
18882
|
+
}
|
|
18883
|
+
|
|
18884
|
+
/**
|
|
18885
|
+
* @beta
|
|
18886
|
+
* Manages callbacks that are connected to when a player
|
|
18887
|
+
* successfully names an Entity with a named Name Tag item.
|
|
18888
|
+
*/
|
|
18889
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
18890
|
+
private constructor();
|
|
18891
|
+
/**
|
|
18892
|
+
* @remarks
|
|
18893
|
+
* Subscribes the specified callback to a player use name tag
|
|
18894
|
+
* after event.
|
|
18895
|
+
*
|
|
18896
|
+
* This function can't be called in restricted-execution mode.
|
|
18897
|
+
*
|
|
18898
|
+
* This function can be called in early-execution mode.
|
|
18899
|
+
*
|
|
18900
|
+
*/
|
|
18901
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
18902
|
+
/**
|
|
18903
|
+
* @remarks
|
|
18904
|
+
* Removes the specified callback from a player use name tag
|
|
18905
|
+
* after event.
|
|
18906
|
+
*
|
|
18907
|
+
* This function can't be called in restricted-execution mode.
|
|
18908
|
+
*
|
|
18909
|
+
* This function can be called in early-execution mode.
|
|
18910
|
+
*
|
|
18911
|
+
*/
|
|
18912
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
18913
|
+
}
|
|
18914
|
+
|
|
16835
18915
|
/**
|
|
16836
18916
|
* Represents how the potion effect is delivered.
|
|
16837
18917
|
*/
|
|
@@ -16914,10 +18994,10 @@ export class Potions {
|
|
|
16914
18994
|
*
|
|
16915
18995
|
* {@link InvalidPotionEffectTypeError}
|
|
16916
18996
|
*/
|
|
16917
|
-
static resolve
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
): ItemStack;
|
|
18997
|
+
static resolve<
|
|
18998
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
18999
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
19000
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
16921
19001
|
}
|
|
16922
19002
|
|
|
16923
19003
|
/**
|
|
@@ -17985,6 +20065,38 @@ export class Seat {
|
|
|
17985
20065
|
readonly seatRotation: number;
|
|
17986
20066
|
}
|
|
17987
20067
|
|
|
20068
|
+
/**
|
|
20069
|
+
* @beta
|
|
20070
|
+
* Manages callbacks that are message passing to a server. This
|
|
20071
|
+
* event is not currently fully implemented, and should not be
|
|
20072
|
+
* used.
|
|
20073
|
+
*/
|
|
20074
|
+
export class ServerMessageAfterEventSignal {
|
|
20075
|
+
private constructor();
|
|
20076
|
+
/**
|
|
20077
|
+
* @remarks
|
|
20078
|
+
* Adds a callback that will be called when an internal message
|
|
20079
|
+
* is passed.
|
|
20080
|
+
*
|
|
20081
|
+
* This function can't be called in restricted-execution mode.
|
|
20082
|
+
*
|
|
20083
|
+
* This function can be called in early-execution mode.
|
|
20084
|
+
*
|
|
20085
|
+
*/
|
|
20086
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
20087
|
+
/**
|
|
20088
|
+
* @remarks
|
|
20089
|
+
* Removes a callback from being called when an internal
|
|
20090
|
+
* message is passed.
|
|
20091
|
+
*
|
|
20092
|
+
* This function can't be called in restricted-execution mode.
|
|
20093
|
+
*
|
|
20094
|
+
* This function can be called in early-execution mode.
|
|
20095
|
+
*
|
|
20096
|
+
*/
|
|
20097
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
20098
|
+
}
|
|
20099
|
+
|
|
17988
20100
|
/**
|
|
17989
20101
|
* Loot item function that modifies the trim on a dropped armor
|
|
17990
20102
|
* item.
|
|
@@ -18013,6 +20125,21 @@ export class SetArmorTrimFunction extends LootItemFunction {
|
|
|
18013
20125
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18014
20126
|
export class SetBannerDetailsFunction extends LootItemFunction {
|
|
18015
20127
|
private constructor();
|
|
20128
|
+
/**
|
|
20129
|
+
* @beta
|
|
20130
|
+
* @remarks
|
|
20131
|
+
* The base color for the dropped banner.
|
|
20132
|
+
*
|
|
20133
|
+
*/
|
|
20134
|
+
readonly baseColor: string;
|
|
20135
|
+
/**
|
|
20136
|
+
* @beta
|
|
20137
|
+
* @remarks
|
|
20138
|
+
* An array of {@link BannerPattern} objects used to decorate
|
|
20139
|
+
* the banner, including color and pattern type.
|
|
20140
|
+
*
|
|
20141
|
+
*/
|
|
20142
|
+
readonly patterns: BannerPattern[];
|
|
18016
20143
|
/**
|
|
18017
20144
|
* @remarks
|
|
18018
20145
|
* The type of banner to drop.
|
|
@@ -18945,6 +21072,19 @@ export class SystemBeforeEvents {
|
|
|
18945
21072
|
*
|
|
18946
21073
|
*/
|
|
18947
21074
|
readonly startup: StartupBeforeEventSignal;
|
|
21075
|
+
/**
|
|
21076
|
+
* @beta
|
|
21077
|
+
* @remarks
|
|
21078
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
21079
|
+
* can be due to using too much memory, or by causing
|
|
21080
|
+
* significant slowdown or hang.
|
|
21081
|
+
* To prevent shutdown, set the event's cancel property to
|
|
21082
|
+
* true.
|
|
21083
|
+
*
|
|
21084
|
+
* This property can be read in early-execution mode.
|
|
21085
|
+
*
|
|
21086
|
+
*/
|
|
21087
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
18948
21088
|
}
|
|
18949
21089
|
|
|
18950
21090
|
/**
|
|
@@ -19023,6 +21163,110 @@ export class TargetBlockHitAfterEventSignal {
|
|
|
19023
21163
|
unsubscribe(callback: (arg0: TargetBlockHitAfterEvent) => void): void;
|
|
19024
21164
|
}
|
|
19025
21165
|
|
|
21166
|
+
/**
|
|
21167
|
+
* @beta
|
|
21168
|
+
* This manager is used to add, remove or query temporary
|
|
21169
|
+
* ticking areas to a dimension. These ticking areas are
|
|
21170
|
+
* limited by a fixed amount of ticking chunks per pack
|
|
21171
|
+
* independent of the command limits. Cannot modify or query
|
|
21172
|
+
* ticking areas added by other packs or commands.
|
|
21173
|
+
*/
|
|
21174
|
+
export class TickingAreaManager {
|
|
21175
|
+
private constructor();
|
|
21176
|
+
/**
|
|
21177
|
+
* @remarks
|
|
21178
|
+
* The number of currently ticking chunks in this manager.
|
|
21179
|
+
*
|
|
21180
|
+
*/
|
|
21181
|
+
readonly chunkCount: number;
|
|
21182
|
+
/**
|
|
21183
|
+
* @remarks
|
|
21184
|
+
* The maximum number of allowed ticking chunks. Overlapping
|
|
21185
|
+
* ticking area chunks do count towards total.
|
|
21186
|
+
*
|
|
21187
|
+
*/
|
|
21188
|
+
readonly maxChunkCount: number;
|
|
21189
|
+
/**
|
|
21190
|
+
* @remarks
|
|
21191
|
+
* Creates a ticking area. Promise will return when all the
|
|
21192
|
+
* chunks in the area are loaded and ticking.
|
|
21193
|
+
*
|
|
21194
|
+
* This function can't be called in restricted-execution mode.
|
|
21195
|
+
*
|
|
21196
|
+
* @throws This function can throw errors.
|
|
21197
|
+
*
|
|
21198
|
+
* {@link minecraftcommon.EngineError}
|
|
21199
|
+
*
|
|
21200
|
+
* {@link TickingAreaError}
|
|
21201
|
+
*/
|
|
21202
|
+
createTickingArea(identifier: string, options: TickingAreaOptions): Promise<TickingArea>;
|
|
21203
|
+
/**
|
|
21204
|
+
* @remarks
|
|
21205
|
+
* Gets all ticking areas added by this manager.
|
|
21206
|
+
*
|
|
21207
|
+
* This function can't be called in restricted-execution mode.
|
|
21208
|
+
*
|
|
21209
|
+
* @throws This function can throw errors.
|
|
21210
|
+
*
|
|
21211
|
+
* {@link minecraftcommon.EngineError}
|
|
21212
|
+
*/
|
|
21213
|
+
getAllTickingAreas(): TickingArea[];
|
|
21214
|
+
/**
|
|
21215
|
+
* @remarks
|
|
21216
|
+
* Tries to get specific ticking area by identifier.
|
|
21217
|
+
*
|
|
21218
|
+
* This function can't be called in restricted-execution mode.
|
|
21219
|
+
*
|
|
21220
|
+
* @throws This function can throw errors.
|
|
21221
|
+
*
|
|
21222
|
+
* {@link minecraftcommon.EngineError}
|
|
21223
|
+
*/
|
|
21224
|
+
getTickingArea(identifier: string | TickingArea): TickingArea | undefined;
|
|
21225
|
+
/**
|
|
21226
|
+
* @remarks
|
|
21227
|
+
* Returns true if the manager has enough chunk capacity for
|
|
21228
|
+
* the ticking area and false otherwise. Will also return false
|
|
21229
|
+
* if the length or width exceeds the 255 chunk limit.
|
|
21230
|
+
*
|
|
21231
|
+
* This function can't be called in restricted-execution mode.
|
|
21232
|
+
*
|
|
21233
|
+
*/
|
|
21234
|
+
hasCapacity(options: TickingAreaOptions): boolean;
|
|
21235
|
+
/**
|
|
21236
|
+
* @remarks
|
|
21237
|
+
* Returns true if the identifier is already in the manager and
|
|
21238
|
+
* false otherwise.
|
|
21239
|
+
*
|
|
21240
|
+
* This function can't be called in restricted-execution mode.
|
|
21241
|
+
*
|
|
21242
|
+
*/
|
|
21243
|
+
hasTickingArea(identifier: string): boolean;
|
|
21244
|
+
/**
|
|
21245
|
+
* @remarks
|
|
21246
|
+
* Removes all ticking areas added by this manager.
|
|
21247
|
+
*
|
|
21248
|
+
* This function can't be called in restricted-execution mode.
|
|
21249
|
+
*
|
|
21250
|
+
* @throws This function can throw errors.
|
|
21251
|
+
*
|
|
21252
|
+
* {@link minecraftcommon.EngineError}
|
|
21253
|
+
*/
|
|
21254
|
+
removeAllTickingAreas(): void;
|
|
21255
|
+
/**
|
|
21256
|
+
* @remarks
|
|
21257
|
+
* Removes specific ticking area by unique identifier.
|
|
21258
|
+
*
|
|
21259
|
+
* This function can't be called in restricted-execution mode.
|
|
21260
|
+
*
|
|
21261
|
+
* @throws This function can throw errors.
|
|
21262
|
+
*
|
|
21263
|
+
* {@link minecraftcommon.EngineError}
|
|
21264
|
+
*
|
|
21265
|
+
* {@link TickingAreaError}
|
|
21266
|
+
*/
|
|
21267
|
+
removeTickingArea(identifier: string | TickingArea): void;
|
|
21268
|
+
}
|
|
21269
|
+
|
|
19026
21270
|
/**
|
|
19027
21271
|
* Represents a trigger for firing an event.
|
|
19028
21272
|
*/
|
|
@@ -19161,6 +21405,71 @@ export class TripWireTripAfterEventSignal {
|
|
|
19161
21405
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
19162
21406
|
}
|
|
19163
21407
|
|
|
21408
|
+
/**
|
|
21409
|
+
* @beta
|
|
21410
|
+
* Contains information related to a script watchdog
|
|
21411
|
+
* termination.
|
|
21412
|
+
*/
|
|
21413
|
+
export class WatchdogTerminateBeforeEvent {
|
|
21414
|
+
private constructor();
|
|
21415
|
+
/**
|
|
21416
|
+
* @remarks
|
|
21417
|
+
* If set to true, cancels the termination of the script
|
|
21418
|
+
* runtime. Note that depending on server configuration
|
|
21419
|
+
* settings, cancellation of the termination may not be
|
|
21420
|
+
* allowed.
|
|
21421
|
+
*
|
|
21422
|
+
*/
|
|
21423
|
+
cancel: boolean;
|
|
21424
|
+
/**
|
|
21425
|
+
* @remarks
|
|
21426
|
+
* Contains the reason why a script runtime is to be
|
|
21427
|
+
* terminated.
|
|
21428
|
+
*
|
|
21429
|
+
*/
|
|
21430
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
21431
|
+
}
|
|
21432
|
+
|
|
21433
|
+
/**
|
|
21434
|
+
* @beta
|
|
21435
|
+
* Manages callbacks that are connected to a callback that will
|
|
21436
|
+
* be called when a script runtime is being terminated due to a
|
|
21437
|
+
* violation of the performance watchdog system.
|
|
21438
|
+
*/
|
|
21439
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
21440
|
+
private constructor();
|
|
21441
|
+
/**
|
|
21442
|
+
* @remarks
|
|
21443
|
+
* Adds a callback that will be called when a script runtime is
|
|
21444
|
+
* being terminated due to a violation of the performance
|
|
21445
|
+
* watchdog system.
|
|
21446
|
+
*
|
|
21447
|
+
* This function can't be called in restricted-execution mode.
|
|
21448
|
+
*
|
|
21449
|
+
* This function can be called in early-execution mode.
|
|
21450
|
+
*
|
|
21451
|
+
* @param callback
|
|
21452
|
+
* This closure is called with restricted-execution privilege.
|
|
21453
|
+
* @returns
|
|
21454
|
+
* Closure that is called with restricted-execution privilege.
|
|
21455
|
+
*/
|
|
21456
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
21457
|
+
/**
|
|
21458
|
+
* @remarks
|
|
21459
|
+
* Removes a callback from being called when a script runtime
|
|
21460
|
+
* is being terminated due to a violation of the performance
|
|
21461
|
+
* watchdog system.
|
|
21462
|
+
*
|
|
21463
|
+
* This function can't be called in restricted-execution mode.
|
|
21464
|
+
*
|
|
21465
|
+
* This function can be called in early-execution mode.
|
|
21466
|
+
*
|
|
21467
|
+
* @param callback
|
|
21468
|
+
* This closure is called with restricted-execution privilege.
|
|
21469
|
+
*/
|
|
21470
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
21471
|
+
}
|
|
21472
|
+
|
|
19164
21473
|
/**
|
|
19165
21474
|
* Contains information related to changes in weather in the
|
|
19166
21475
|
* environment.
|
|
@@ -19361,6 +21670,28 @@ export class World {
|
|
|
19361
21670
|
*
|
|
19362
21671
|
*/
|
|
19363
21672
|
readonly structureManager: StructureManager;
|
|
21673
|
+
/**
|
|
21674
|
+
* @beta
|
|
21675
|
+
* @remarks
|
|
21676
|
+
* Manager for adding, removing and querying pack specific
|
|
21677
|
+
* ticking areas.
|
|
21678
|
+
*
|
|
21679
|
+
*/
|
|
21680
|
+
readonly tickingAreaManager: TickingAreaManager;
|
|
21681
|
+
/**
|
|
21682
|
+
* @beta
|
|
21683
|
+
* @remarks
|
|
21684
|
+
* A method that is internal-only, used for broadcasting
|
|
21685
|
+
* specific messages between client and server.
|
|
21686
|
+
*
|
|
21687
|
+
* This function can't be called in restricted-execution mode.
|
|
21688
|
+
*
|
|
21689
|
+
* @param id
|
|
21690
|
+
* The message identifier.
|
|
21691
|
+
* @param value
|
|
21692
|
+
* The message.
|
|
21693
|
+
*/
|
|
21694
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
19364
21695
|
/**
|
|
19365
21696
|
* @remarks
|
|
19366
21697
|
* Clears the set of dynamic properties declared for this
|
|
@@ -19374,6 +21705,14 @@ export class World {
|
|
|
19374
21705
|
*
|
|
19375
21706
|
*/
|
|
19376
21707
|
getAbsoluteTime(): number;
|
|
21708
|
+
/**
|
|
21709
|
+
* @beta
|
|
21710
|
+
* @remarks
|
|
21711
|
+
* The aim-assist presets and categories that can be used in
|
|
21712
|
+
* the world.
|
|
21713
|
+
*
|
|
21714
|
+
*/
|
|
21715
|
+
getAimAssist(): AimAssistRegistry;
|
|
19377
21716
|
/**
|
|
19378
21717
|
* @remarks
|
|
19379
21718
|
* Returns an array of all active players within the world.
|
|
@@ -19550,6 +21889,15 @@ export class World {
|
|
|
19550
21889
|
*
|
|
19551
21890
|
*/
|
|
19552
21891
|
getMoonPhase(): MoonPhase;
|
|
21892
|
+
/**
|
|
21893
|
+
* @beta
|
|
21894
|
+
* @remarks
|
|
21895
|
+
* Returns a map of pack setting name and value pairs.
|
|
21896
|
+
*
|
|
21897
|
+
* This function can be called in early-execution mode.
|
|
21898
|
+
*
|
|
21899
|
+
*/
|
|
21900
|
+
getPackSettings(): Record<string, boolean | number | string>;
|
|
19553
21901
|
/**
|
|
19554
21902
|
* @remarks
|
|
19555
21903
|
* Returns a set of players based on a set of conditions
|
|
@@ -19825,6 +22173,16 @@ export class WorldAfterEvents {
|
|
|
19825
22173
|
*
|
|
19826
22174
|
*/
|
|
19827
22175
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
22176
|
+
/**
|
|
22177
|
+
* @beta
|
|
22178
|
+
* @remarks
|
|
22179
|
+
* This event is triggered after a chat message has been
|
|
22180
|
+
* broadcast or sent to players.
|
|
22181
|
+
*
|
|
22182
|
+
* This property can be read in early-execution mode.
|
|
22183
|
+
*
|
|
22184
|
+
*/
|
|
22185
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
19828
22186
|
/**
|
|
19829
22187
|
* @remarks
|
|
19830
22188
|
* This event is fired when an entity event has been triggered
|
|
@@ -19894,6 +22252,15 @@ export class WorldAfterEvents {
|
|
|
19894
22252
|
*
|
|
19895
22253
|
*/
|
|
19896
22254
|
readonly entityHurt: EntityHurtAfterEventSignal;
|
|
22255
|
+
/**
|
|
22256
|
+
* @beta
|
|
22257
|
+
* @remarks
|
|
22258
|
+
* This event fires when an entity drops items.
|
|
22259
|
+
*
|
|
22260
|
+
* This property can be read in early-execution mode.
|
|
22261
|
+
*
|
|
22262
|
+
*/
|
|
22263
|
+
readonly entityItemDrop: EntityItemDropAfterEventSignal;
|
|
19897
22264
|
/**
|
|
19898
22265
|
* @rc
|
|
19899
22266
|
* @remarks
|
|
@@ -20002,21 +22369,40 @@ export class WorldAfterEvents {
|
|
|
20002
22369
|
readonly itemStopUseOn: ItemStopUseOnAfterEventSignal;
|
|
20003
22370
|
/**
|
|
20004
22371
|
* @remarks
|
|
20005
|
-
* This event fires when an item is successfully used by a
|
|
20006
|
-
* player.
|
|
22372
|
+
* This event fires when an item is successfully used by a
|
|
22373
|
+
* player.
|
|
22374
|
+
*
|
|
22375
|
+
* This property can be read in early-execution mode.
|
|
22376
|
+
*
|
|
22377
|
+
*/
|
|
22378
|
+
readonly itemUse: ItemUseAfterEventSignal;
|
|
22379
|
+
/**
|
|
22380
|
+
* @remarks
|
|
22381
|
+
* A lever has been pulled.
|
|
22382
|
+
*
|
|
22383
|
+
* This property can be read in early-execution mode.
|
|
22384
|
+
*
|
|
22385
|
+
*/
|
|
22386
|
+
readonly leverAction: LeverActionAfterEventSignal;
|
|
22387
|
+
/**
|
|
22388
|
+
* @beta
|
|
22389
|
+
* @remarks
|
|
22390
|
+
* This event is an internal implementation detail, and is
|
|
22391
|
+
* otherwise not currently functional.
|
|
20007
22392
|
*
|
|
20008
22393
|
* This property can be read in early-execution mode.
|
|
20009
22394
|
*
|
|
20010
22395
|
*/
|
|
20011
|
-
readonly
|
|
22396
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
20012
22397
|
/**
|
|
22398
|
+
* @beta
|
|
20013
22399
|
* @remarks
|
|
20014
|
-
*
|
|
22400
|
+
* This event is triggered when a pack setting is changed.
|
|
20015
22401
|
*
|
|
20016
22402
|
* This property can be read in early-execution mode.
|
|
20017
22403
|
*
|
|
20018
22404
|
*/
|
|
20019
|
-
readonly
|
|
22405
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
20020
22406
|
/**
|
|
20021
22407
|
* @remarks
|
|
20022
22408
|
* This event fires when a piston expands or retracts.
|
|
@@ -20154,6 +22540,16 @@ export class WorldAfterEvents {
|
|
|
20154
22540
|
*
|
|
20155
22541
|
*/
|
|
20156
22542
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
22543
|
+
/**
|
|
22544
|
+
* @beta
|
|
22545
|
+
* @remarks
|
|
22546
|
+
* An event for when a player uses a named name tag on an
|
|
22547
|
+
* entity.
|
|
22548
|
+
*
|
|
22549
|
+
* This property can be read in early-execution mode.
|
|
22550
|
+
*
|
|
22551
|
+
*/
|
|
22552
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
20157
22553
|
/**
|
|
20158
22554
|
* @remarks
|
|
20159
22555
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -20230,6 +22626,43 @@ export class WorldAfterEvents {
|
|
|
20230
22626
|
*/
|
|
20231
22627
|
export class WorldBeforeEvents {
|
|
20232
22628
|
private constructor();
|
|
22629
|
+
/**
|
|
22630
|
+
* @beta
|
|
22631
|
+
* @remarks
|
|
22632
|
+
* This event is triggered after a chat message has been
|
|
22633
|
+
* broadcast or sent to players.
|
|
22634
|
+
*
|
|
22635
|
+
* This property can be read in early-execution mode.
|
|
22636
|
+
*
|
|
22637
|
+
* @example customCommand.ts
|
|
22638
|
+
* ```typescript
|
|
22639
|
+
* import { world, DimensionLocation } from "@minecraft/server";
|
|
22640
|
+
*
|
|
22641
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
22642
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
|
|
22643
|
+
* if (eventData.message.includes("cancel")) {
|
|
22644
|
+
* // Cancel event if the message contains "cancel"
|
|
22645
|
+
* eventData.cancel = true;
|
|
22646
|
+
* } else {
|
|
22647
|
+
* const args = eventData.message.split(" ");
|
|
22648
|
+
*
|
|
22649
|
+
* if (args.length > 0) {
|
|
22650
|
+
* switch (args[0].toLowerCase()) {
|
|
22651
|
+
* case "echo":
|
|
22652
|
+
* // Send a modified version of chat message
|
|
22653
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
22654
|
+
* break;
|
|
22655
|
+
* case "help":
|
|
22656
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
22657
|
+
* break;
|
|
22658
|
+
* }
|
|
22659
|
+
* }
|
|
22660
|
+
* }
|
|
22661
|
+
* });
|
|
22662
|
+
* }
|
|
22663
|
+
* ```
|
|
22664
|
+
*/
|
|
22665
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
20233
22666
|
/**
|
|
20234
22667
|
* @remarks
|
|
20235
22668
|
* This event is triggered after an event has been added to an
|
|
@@ -20326,6 +22759,15 @@ export class WorldBeforeEvents {
|
|
|
20326
22759
|
*
|
|
20327
22760
|
*/
|
|
20328
22761
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
22762
|
+
/**
|
|
22763
|
+
* @beta
|
|
22764
|
+
* @remarks
|
|
22765
|
+
* This event fires before a block is placed by a player.
|
|
22766
|
+
*
|
|
22767
|
+
* This property can be read in early-execution mode.
|
|
22768
|
+
*
|
|
22769
|
+
*/
|
|
22770
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
20329
22771
|
/**
|
|
20330
22772
|
* @remarks
|
|
20331
22773
|
* This property can be read in early-execution mode.
|
|
@@ -20378,6 +22820,25 @@ export interface AABB {
|
|
|
20378
22820
|
extent: Vector3;
|
|
20379
22821
|
}
|
|
20380
22822
|
|
|
22823
|
+
/**
|
|
22824
|
+
* @beta
|
|
22825
|
+
* Used to create camera animations.
|
|
22826
|
+
*/
|
|
22827
|
+
export interface AnimationOptions {
|
|
22828
|
+
/**
|
|
22829
|
+
* @remarks
|
|
22830
|
+
* Key frames for the camera animation.
|
|
22831
|
+
*
|
|
22832
|
+
*/
|
|
22833
|
+
animation: SplineAnimation;
|
|
22834
|
+
/**
|
|
22835
|
+
* @remarks
|
|
22836
|
+
* Total time of the camera animation in seconds.
|
|
22837
|
+
*
|
|
22838
|
+
*/
|
|
22839
|
+
totalTimeSeconds: number;
|
|
22840
|
+
}
|
|
22841
|
+
|
|
20381
22842
|
/**
|
|
20382
22843
|
* @rc
|
|
20383
22844
|
*/
|
|
@@ -20388,13 +22849,27 @@ export interface BiomeFilter {
|
|
|
20388
22849
|
includeTags?: string[];
|
|
20389
22850
|
}
|
|
20390
22851
|
|
|
22852
|
+
/**
|
|
22853
|
+
* @beta
|
|
22854
|
+
* Contains additional options for searches for the
|
|
22855
|
+
* dimension.findNearestBiome API.
|
|
22856
|
+
*/
|
|
22857
|
+
export interface BiomeSearchOptions {
|
|
22858
|
+
/**
|
|
22859
|
+
* @remarks
|
|
22860
|
+
* Bounding volume size to look within.
|
|
22861
|
+
*
|
|
22862
|
+
*/
|
|
22863
|
+
boundingSize?: Vector3;
|
|
22864
|
+
}
|
|
22865
|
+
|
|
20391
22866
|
/**
|
|
20392
22867
|
* A BlockBoundingBox is an interface to an object which
|
|
20393
22868
|
* represents an AABB aligned rectangle.
|
|
20394
22869
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
20395
22870
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
20396
|
-
* created using the associated {@link
|
|
20397
|
-
*
|
|
22871
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
22872
|
+
* utility functions.
|
|
20398
22873
|
* The min/max coordinates represent the diametrically opposite
|
|
20399
22874
|
* corners of the rectangle.
|
|
20400
22875
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -20446,6 +22921,14 @@ export interface BlockCustomComponent {
|
|
|
20446
22921
|
*
|
|
20447
22922
|
*/
|
|
20448
22923
|
onBreak?: (arg0: BlockComponentBlockBreakEvent, arg1: CustomComponentParameters) => void;
|
|
22924
|
+
/**
|
|
22925
|
+
* @beta
|
|
22926
|
+
* @remarks
|
|
22927
|
+
* This function will be called when an entity fires an event
|
|
22928
|
+
* to this block in the world.
|
|
22929
|
+
*
|
|
22930
|
+
*/
|
|
22931
|
+
onEntity?: (arg0: BlockComponentEntityEvent, arg1: CustomComponentParameters) => void;
|
|
20449
22932
|
/**
|
|
20450
22933
|
* @remarks
|
|
20451
22934
|
* This function will be called when an entity falls onto the
|
|
@@ -20678,6 +23161,26 @@ export interface BlockRaycastOptions extends BlockFilter {
|
|
|
20678
23161
|
maxDistance?: number;
|
|
20679
23162
|
}
|
|
20680
23163
|
|
|
23164
|
+
/**
|
|
23165
|
+
* @beta
|
|
23166
|
+
* Used to attach the camera to a non player entity.
|
|
23167
|
+
*/
|
|
23168
|
+
export interface CameraAttachOptions {
|
|
23169
|
+
/**
|
|
23170
|
+
* @remarks
|
|
23171
|
+
* Set a non player entity for the camera to target.
|
|
23172
|
+
*
|
|
23173
|
+
*/
|
|
23174
|
+
entity: Entity;
|
|
23175
|
+
/**
|
|
23176
|
+
* @remarks
|
|
23177
|
+
* The location of the entity that you want to target (eg.
|
|
23178
|
+
* head, feet, eyes).
|
|
23179
|
+
*
|
|
23180
|
+
*/
|
|
23181
|
+
locator: EntityAttachPoint;
|
|
23182
|
+
}
|
|
23183
|
+
|
|
20681
23184
|
/**
|
|
20682
23185
|
* Used to initiate a full-screen color fade.
|
|
20683
23186
|
*/
|
|
@@ -20794,6 +23297,40 @@ export interface CameraTargetOptions {
|
|
|
20794
23297
|
targetEntity: Entity;
|
|
20795
23298
|
}
|
|
20796
23299
|
|
|
23300
|
+
/**
|
|
23301
|
+
* @beta
|
|
23302
|
+
* This interface defines an entry into the {@link
|
|
23303
|
+
* CompoundBlockVolume} which represents a volume of positive
|
|
23304
|
+
* or negative space.
|
|
23305
|
+
*
|
|
23306
|
+
*/
|
|
23307
|
+
export interface CompoundBlockVolumeItem {
|
|
23308
|
+
/**
|
|
23309
|
+
* @remarks
|
|
23310
|
+
* The 'action' defines how the block volume is represented in
|
|
23311
|
+
* the compound block volume stack.
|
|
23312
|
+
* 'Add' creates a block volume which is positively selected
|
|
23313
|
+
* 'Subtract' creates a block volume which represents a hole or
|
|
23314
|
+
* negative space in the overall compound block volume.
|
|
23315
|
+
*
|
|
23316
|
+
*/
|
|
23317
|
+
action?: CompoundBlockVolumeAction;
|
|
23318
|
+
/**
|
|
23319
|
+
* @remarks
|
|
23320
|
+
* The relativity enumeration determines whether the
|
|
23321
|
+
* BlockVolume specified is positioned relative to the parent
|
|
23322
|
+
* compound block volume origin, or in absolute world space.
|
|
23323
|
+
*
|
|
23324
|
+
*/
|
|
23325
|
+
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
23326
|
+
/**
|
|
23327
|
+
* @remarks
|
|
23328
|
+
* The volume of space
|
|
23329
|
+
*
|
|
23330
|
+
*/
|
|
23331
|
+
volume: BlockVolume;
|
|
23332
|
+
}
|
|
23333
|
+
|
|
20797
23334
|
/**
|
|
20798
23335
|
* Rules that if broken on container operations will throw an
|
|
20799
23336
|
* error.
|
|
@@ -20878,6 +23415,15 @@ export interface CustomCommand {
|
|
|
20878
23415
|
* command.
|
|
20879
23416
|
*/
|
|
20880
23417
|
export interface CustomCommandParameter {
|
|
23418
|
+
/**
|
|
23419
|
+
* @beta
|
|
23420
|
+
* @remarks
|
|
23421
|
+
* Can be used to reference the enum name when {@link
|
|
23422
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
23423
|
+
* to be different from the enum name.
|
|
23424
|
+
*
|
|
23425
|
+
*/
|
|
23426
|
+
enumName?: string;
|
|
20881
23427
|
/**
|
|
20882
23428
|
* @remarks
|
|
20883
23429
|
* The name of parameter as it appears on the command line.
|
|
@@ -20930,6 +23476,14 @@ export interface DefinitionModifier {
|
|
|
20930
23476
|
*
|
|
20931
23477
|
*/
|
|
20932
23478
|
removedComponentGroups: string[];
|
|
23479
|
+
/**
|
|
23480
|
+
* @beta
|
|
23481
|
+
* @remarks
|
|
23482
|
+
* The list of entity definition events that will be fired via
|
|
23483
|
+
* this update.
|
|
23484
|
+
*
|
|
23485
|
+
*/
|
|
23486
|
+
triggers: Trigger[];
|
|
20933
23487
|
}
|
|
20934
23488
|
|
|
20935
23489
|
/**
|
|
@@ -21346,6 +23900,30 @@ export interface EntityHurtBeforeEventOptions {
|
|
|
21346
23900
|
entityFilter?: EntityFilter;
|
|
21347
23901
|
}
|
|
21348
23902
|
|
|
23903
|
+
/**
|
|
23904
|
+
* @beta
|
|
23905
|
+
* An interface that is passed into {@link
|
|
23906
|
+
* @minecraft/Server.EntityItemDropAfterEventSignal.subscribe}
|
|
23907
|
+
* that filters out which events are passed to the provided
|
|
23908
|
+
* callback.
|
|
23909
|
+
*/
|
|
23910
|
+
export interface EntityItemDropEventOptions {
|
|
23911
|
+
/**
|
|
23912
|
+
* @remarks
|
|
23913
|
+
* If this value is set, this event will only fire for entities
|
|
23914
|
+
* that match.
|
|
23915
|
+
*
|
|
23916
|
+
*/
|
|
23917
|
+
entityFilter?: EntityFilter;
|
|
23918
|
+
/**
|
|
23919
|
+
* @remarks
|
|
23920
|
+
* If this value is set, this event will only fire if an item
|
|
23921
|
+
* in the event matches.
|
|
23922
|
+
*
|
|
23923
|
+
*/
|
|
23924
|
+
itemFilter?: ItemFilter;
|
|
23925
|
+
}
|
|
23926
|
+
|
|
21349
23927
|
/**
|
|
21350
23928
|
* @rc
|
|
21351
23929
|
* An interface that is passed into {@link
|
|
@@ -22147,6 +24725,38 @@ export interface PlayAnimationOptions {
|
|
|
22147
24725
|
stopExpression?: string;
|
|
22148
24726
|
}
|
|
22149
24727
|
|
|
24728
|
+
/**
|
|
24729
|
+
* @beta
|
|
24730
|
+
* Settings relating to a player's aim-assist targeting.
|
|
24731
|
+
*/
|
|
24732
|
+
export interface PlayerAimAssistSettings {
|
|
24733
|
+
/**
|
|
24734
|
+
* @remarks
|
|
24735
|
+
* The view distance limit to use for aim-assist targeting.
|
|
24736
|
+
*
|
|
24737
|
+
*/
|
|
24738
|
+
distance?: number;
|
|
24739
|
+
/**
|
|
24740
|
+
* @remarks
|
|
24741
|
+
* The Id of the aim-assist preset to activate. Must have a
|
|
24742
|
+
* namespace.
|
|
24743
|
+
*
|
|
24744
|
+
*/
|
|
24745
|
+
presetId: string;
|
|
24746
|
+
/**
|
|
24747
|
+
* @remarks
|
|
24748
|
+
* The mode to use for aim-assist targeting.
|
|
24749
|
+
*
|
|
24750
|
+
*/
|
|
24751
|
+
targetMode?: AimAssistTargetMode;
|
|
24752
|
+
/**
|
|
24753
|
+
* @remarks
|
|
24754
|
+
* The view angle limit to use for aim-assist targeting.
|
|
24755
|
+
*
|
|
24756
|
+
*/
|
|
24757
|
+
viewAngle?: Vector2;
|
|
24758
|
+
}
|
|
24759
|
+
|
|
22150
24760
|
/**
|
|
22151
24761
|
* Additional options for how a sound plays for a player.
|
|
22152
24762
|
*/
|
|
@@ -22198,6 +24808,33 @@ export interface PlayerSwingEventOptions {
|
|
|
22198
24808
|
swingSource?: EntitySwingSource;
|
|
22199
24809
|
}
|
|
22200
24810
|
|
|
24811
|
+
/**
|
|
24812
|
+
* @beta
|
|
24813
|
+
* Key frame that holds the progress of the camera animation.
|
|
24814
|
+
*/
|
|
24815
|
+
export interface ProgressKeyFrame {
|
|
24816
|
+
/**
|
|
24817
|
+
* @remarks
|
|
24818
|
+
* Value to denote how far along the curve the camera will be.
|
|
24819
|
+
* Values are [0.0, 1.0] inclusive.
|
|
24820
|
+
*
|
|
24821
|
+
*/
|
|
24822
|
+
alpha: number;
|
|
24823
|
+
/**
|
|
24824
|
+
* @remarks
|
|
24825
|
+
* The optional easing type that the frame will use for
|
|
24826
|
+
* position.
|
|
24827
|
+
*
|
|
24828
|
+
*/
|
|
24829
|
+
easingFunc?: EasingType;
|
|
24830
|
+
/**
|
|
24831
|
+
* @remarks
|
|
24832
|
+
* Time value that the camera will be at the given alpha.
|
|
24833
|
+
*
|
|
24834
|
+
*/
|
|
24835
|
+
timeSeconds: number;
|
|
24836
|
+
}
|
|
24837
|
+
|
|
22201
24838
|
/**
|
|
22202
24839
|
* Optional arguments for
|
|
22203
24840
|
* @minecraft/server.EntityProjectileComponent.shoot.
|
|
@@ -22438,6 +25075,32 @@ export interface RGBA extends RGB {
|
|
|
22438
25075
|
alpha: number;
|
|
22439
25076
|
}
|
|
22440
25077
|
|
|
25078
|
+
/**
|
|
25079
|
+
* @beta
|
|
25080
|
+
* Key frame that holds the rotation of the camera animation.
|
|
25081
|
+
*/
|
|
25082
|
+
export interface RotationKeyFrame {
|
|
25083
|
+
/**
|
|
25084
|
+
* @remarks
|
|
25085
|
+
* The optional easing type that the frame will use for
|
|
25086
|
+
* rotation.
|
|
25087
|
+
*
|
|
25088
|
+
*/
|
|
25089
|
+
easingFunc?: EasingType;
|
|
25090
|
+
/**
|
|
25091
|
+
* @remarks
|
|
25092
|
+
* Value of the rotation of the camera.
|
|
25093
|
+
*
|
|
25094
|
+
*/
|
|
25095
|
+
rotation: Vector3;
|
|
25096
|
+
/**
|
|
25097
|
+
* @remarks
|
|
25098
|
+
* Time value that the camera will be at the given rotation.
|
|
25099
|
+
*
|
|
25100
|
+
*/
|
|
25101
|
+
timeSeconds: number;
|
|
25102
|
+
}
|
|
25103
|
+
|
|
22441
25104
|
/**
|
|
22442
25105
|
* Contains additional options for how a scoreboard should be
|
|
22443
25106
|
* displayed within its display slot.
|
|
@@ -22499,6 +25162,25 @@ export interface SpawnEntityOptions {
|
|
|
22499
25162
|
spawnEvent?: string;
|
|
22500
25163
|
}
|
|
22501
25164
|
|
|
25165
|
+
/**
|
|
25166
|
+
* @beta
|
|
25167
|
+
* Collection of key frames for camera animation.
|
|
25168
|
+
*/
|
|
25169
|
+
export interface SplineAnimation {
|
|
25170
|
+
/**
|
|
25171
|
+
* @remarks
|
|
25172
|
+
* Key frames for camera progress along a given curve.
|
|
25173
|
+
*
|
|
25174
|
+
*/
|
|
25175
|
+
progressKeyFrames: ProgressKeyFrame[];
|
|
25176
|
+
/**
|
|
25177
|
+
* @remarks
|
|
25178
|
+
* Key frames for camera rotation.
|
|
25179
|
+
*
|
|
25180
|
+
*/
|
|
25181
|
+
rotationKeyFrames: RotationKeyFrame[];
|
|
25182
|
+
}
|
|
25183
|
+
|
|
22502
25184
|
/**
|
|
22503
25185
|
* Provides additional options for {@link
|
|
22504
25186
|
* StructureManager.createFromWorld}
|
|
@@ -22679,6 +25361,72 @@ export interface TeleportOptions {
|
|
|
22679
25361
|
rotation?: Vector2;
|
|
22680
25362
|
}
|
|
22681
25363
|
|
|
25364
|
+
/**
|
|
25365
|
+
* @beta
|
|
25366
|
+
* A context which provides information about a specific
|
|
25367
|
+
* ticking area.
|
|
25368
|
+
*/
|
|
25369
|
+
export interface TickingArea {
|
|
25370
|
+
/**
|
|
25371
|
+
* @remarks
|
|
25372
|
+
* The box which contains all the ticking blocks in the ticking
|
|
25373
|
+
* area.
|
|
25374
|
+
*
|
|
25375
|
+
*/
|
|
25376
|
+
boundingBox: BlockBoundingBox;
|
|
25377
|
+
/**
|
|
25378
|
+
* @remarks
|
|
25379
|
+
* The number of chunks that the ticking area contains.
|
|
25380
|
+
*
|
|
25381
|
+
*/
|
|
25382
|
+
chunkCount: number;
|
|
25383
|
+
/**
|
|
25384
|
+
* @remarks
|
|
25385
|
+
* The dimension the ticking area is located.
|
|
25386
|
+
*
|
|
25387
|
+
*/
|
|
25388
|
+
dimension: Dimension;
|
|
25389
|
+
/**
|
|
25390
|
+
* @remarks
|
|
25391
|
+
* The unique identifier of the ticking area.
|
|
25392
|
+
*
|
|
25393
|
+
*/
|
|
25394
|
+
identifier: string;
|
|
25395
|
+
/**
|
|
25396
|
+
* @remarks
|
|
25397
|
+
* Will be true if all the ticking areas chunks are loaded in
|
|
25398
|
+
* ticking and false otherwise.
|
|
25399
|
+
*
|
|
25400
|
+
*/
|
|
25401
|
+
isFullyLoaded: boolean;
|
|
25402
|
+
}
|
|
25403
|
+
|
|
25404
|
+
/**
|
|
25405
|
+
* @beta
|
|
25406
|
+
* Options to create a ticking area using the {@link
|
|
25407
|
+
* TickingAreaManager}.
|
|
25408
|
+
*/
|
|
25409
|
+
export interface TickingAreaOptions {
|
|
25410
|
+
/**
|
|
25411
|
+
* @remarks
|
|
25412
|
+
* The dimension the ticking area will be in.
|
|
25413
|
+
*
|
|
25414
|
+
*/
|
|
25415
|
+
dimension: Dimension;
|
|
25416
|
+
/**
|
|
25417
|
+
* @remarks
|
|
25418
|
+
* Corner block location of the bounding box.
|
|
25419
|
+
*
|
|
25420
|
+
*/
|
|
25421
|
+
from: Vector3;
|
|
25422
|
+
/**
|
|
25423
|
+
* @remarks
|
|
25424
|
+
* Opposite corner block location of the bounding box.
|
|
25425
|
+
*
|
|
25426
|
+
*/
|
|
25427
|
+
to: Vector3;
|
|
25428
|
+
}
|
|
25429
|
+
|
|
22682
25430
|
/**
|
|
22683
25431
|
* Contains additional options for displaying a title and
|
|
22684
25432
|
* optional subtitle.
|
|
@@ -23094,6 +25842,24 @@ export class RawMessageError extends Error {
|
|
|
23094
25842
|
private constructor();
|
|
23095
25843
|
}
|
|
23096
25844
|
|
|
25845
|
+
/**
|
|
25846
|
+
* @beta
|
|
25847
|
+
* The error returned from invalid {@link TickingAreaManager}
|
|
25848
|
+
* method calls.
|
|
25849
|
+
*/
|
|
25850
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
25851
|
+
export class TickingAreaError extends Error {
|
|
25852
|
+
private constructor();
|
|
25853
|
+
/**
|
|
25854
|
+
* @remarks
|
|
25855
|
+
* The specific reason that the error was thrown.
|
|
25856
|
+
*
|
|
25857
|
+
* This property can be read in early-execution mode.
|
|
25858
|
+
*
|
|
25859
|
+
*/
|
|
25860
|
+
readonly reason: TickingAreaErrorReason;
|
|
25861
|
+
}
|
|
25862
|
+
|
|
23097
25863
|
/**
|
|
23098
25864
|
* Error thrown when the specified area contains one or more
|
|
23099
25865
|
* unloaded chunks.
|