@minecraft/server 2.5.0-rc.1.26.0-preview.24 → 2.6.0-beta.1.26.0-preview.24
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 +3110 -139
- 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.6.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.
|
|
@@ -318,6 +386,13 @@ export enum CustomCommandErrorReason {
|
|
|
318
386
|
*
|
|
319
387
|
*/
|
|
320
388
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
389
|
+
/**
|
|
390
|
+
* @beta
|
|
391
|
+
* @remarks
|
|
392
|
+
* Non enum type command parameters cannot use enumName.
|
|
393
|
+
*
|
|
394
|
+
*/
|
|
395
|
+
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
321
396
|
}
|
|
322
397
|
|
|
323
398
|
/**
|
|
@@ -685,6 +760,23 @@ export enum EnchantmentSlot {
|
|
|
685
760
|
Sword = 'Sword',
|
|
686
761
|
}
|
|
687
762
|
|
|
763
|
+
/**
|
|
764
|
+
* @beta
|
|
765
|
+
* The entity's attach location point. Contains points such as
|
|
766
|
+
* head, body, leg, etc to attach the camera to.
|
|
767
|
+
*/
|
|
768
|
+
export enum EntityAttachPoint {
|
|
769
|
+
Body = 'Body',
|
|
770
|
+
BreathingPoint = 'BreathingPoint',
|
|
771
|
+
DropAttachPoint = 'DropAttachPoint',
|
|
772
|
+
ExplosionPoint = 'ExplosionPoint',
|
|
773
|
+
Eyes = 'Eyes',
|
|
774
|
+
Feet = 'Feet',
|
|
775
|
+
Head = 'Head',
|
|
776
|
+
Mouth = 'Mouth',
|
|
777
|
+
WeaponAttachPoint = 'WeaponAttachPoint',
|
|
778
|
+
}
|
|
779
|
+
|
|
688
780
|
/**
|
|
689
781
|
* The types of entity components that are accessible via
|
|
690
782
|
* function Entity.getComponent.
|
|
@@ -1032,6 +1124,14 @@ export enum EntityComponentTypes {
|
|
|
1032
1124
|
*
|
|
1033
1125
|
*/
|
|
1034
1126
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1127
|
+
/**
|
|
1128
|
+
* @beta
|
|
1129
|
+
* @remarks
|
|
1130
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
1131
|
+
* name, and dialogue interactions.
|
|
1132
|
+
*
|
|
1133
|
+
*/
|
|
1134
|
+
Npc = 'minecraft:npc',
|
|
1035
1135
|
/**
|
|
1036
1136
|
* @remarks
|
|
1037
1137
|
* When present on an entity, this entity is on fire.
|
|
@@ -1381,6 +1481,31 @@ export enum EntityDamageCause {
|
|
|
1381
1481
|
wither = 'wither',
|
|
1382
1482
|
}
|
|
1383
1483
|
|
|
1484
|
+
/**
|
|
1485
|
+
* @beta
|
|
1486
|
+
* Describes the source of healing of an Entity.
|
|
1487
|
+
*/
|
|
1488
|
+
export enum EntityHealCause {
|
|
1489
|
+
/**
|
|
1490
|
+
* @remarks
|
|
1491
|
+
* Healing caused by items such as potions.
|
|
1492
|
+
*
|
|
1493
|
+
*/
|
|
1494
|
+
Heal = 'Heal',
|
|
1495
|
+
/**
|
|
1496
|
+
* @remarks
|
|
1497
|
+
* Healing caused by regeneration effects.
|
|
1498
|
+
*
|
|
1499
|
+
*/
|
|
1500
|
+
Regeneration = 'Regeneration',
|
|
1501
|
+
/**
|
|
1502
|
+
* @remarks
|
|
1503
|
+
* Healing caused when hunger is full.
|
|
1504
|
+
*
|
|
1505
|
+
*/
|
|
1506
|
+
SelfHeal = 'SelfHeal',
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1384
1509
|
/**
|
|
1385
1510
|
* An enumeration describing initialization cause of an entity.
|
|
1386
1511
|
*/
|
|
@@ -1487,6 +1612,14 @@ export enum EntitySwingSource {
|
|
|
1487
1612
|
* and mainhand slots.
|
|
1488
1613
|
*/
|
|
1489
1614
|
export enum EquipmentSlot {
|
|
1615
|
+
/**
|
|
1616
|
+
* @beta
|
|
1617
|
+
* @remarks
|
|
1618
|
+
* The body slot. This slot is used to hold armor for
|
|
1619
|
+
* non-humanoid mobs.
|
|
1620
|
+
*
|
|
1621
|
+
*/
|
|
1622
|
+
Body = 'Body',
|
|
1490
1623
|
/**
|
|
1491
1624
|
* @remarks
|
|
1492
1625
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1729,6 +1862,10 @@ export enum GameRule {
|
|
|
1729
1862
|
*
|
|
1730
1863
|
*/
|
|
1731
1864
|
KeepInventory = 'keepInventory',
|
|
1865
|
+
/**
|
|
1866
|
+
* @beta
|
|
1867
|
+
*/
|
|
1868
|
+
LocatorBar = 'locatorBar',
|
|
1732
1869
|
/**
|
|
1733
1870
|
* @remarks
|
|
1734
1871
|
* The maximum number of chained commands that can execute per
|
|
@@ -2716,6 +2853,41 @@ export enum StructureSaveMode {
|
|
|
2716
2853
|
World = 'World',
|
|
2717
2854
|
}
|
|
2718
2855
|
|
|
2856
|
+
/**
|
|
2857
|
+
* @beta
|
|
2858
|
+
* The reason that the {@link
|
|
2859
|
+
* @minecraft/server.TickingAreaError} was thrown.
|
|
2860
|
+
*/
|
|
2861
|
+
export enum TickingAreaErrorReason {
|
|
2862
|
+
/**
|
|
2863
|
+
* @remarks
|
|
2864
|
+
* Added a ticking area with an identifier that already exists.
|
|
2865
|
+
*
|
|
2866
|
+
*/
|
|
2867
|
+
IdentifierAlreadyExists = 'IdentifierAlreadyExists',
|
|
2868
|
+
/**
|
|
2869
|
+
* @remarks
|
|
2870
|
+
* Adding this ticking area pushed the ticking areas over the
|
|
2871
|
+
* limit specified by {@link TickingAreaManager.maxChunkCount}.
|
|
2872
|
+
*
|
|
2873
|
+
*/
|
|
2874
|
+
OverChunkLimit = 'OverChunkLimit',
|
|
2875
|
+
/**
|
|
2876
|
+
* @remarks
|
|
2877
|
+
* Exceeded the 255 chunk limit for the length or width of the
|
|
2878
|
+
* ticking area.
|
|
2879
|
+
*
|
|
2880
|
+
*/
|
|
2881
|
+
SideLengthExceeded = 'SideLengthExceeded',
|
|
2882
|
+
/**
|
|
2883
|
+
* @remarks
|
|
2884
|
+
* Tried to remove ticking area with identifier not registered
|
|
2885
|
+
* in the {@link TickingAreaManager}.
|
|
2886
|
+
*
|
|
2887
|
+
*/
|
|
2888
|
+
UnknownIdentifier = 'UnknownIdentifier',
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2719
2891
|
/**
|
|
2720
2892
|
* Provides numeric values for common periods in the Minecraft
|
|
2721
2893
|
* day.
|
|
@@ -2815,6 +2987,29 @@ export enum TintMethod {
|
|
|
2815
2987
|
Water = 'Water',
|
|
2816
2988
|
}
|
|
2817
2989
|
|
|
2990
|
+
/**
|
|
2991
|
+
* @beta
|
|
2992
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
2993
|
+
* to terminate execution of a behavior packs' script.
|
|
2994
|
+
*/
|
|
2995
|
+
export enum WatchdogTerminateReason {
|
|
2996
|
+
/**
|
|
2997
|
+
* @remarks
|
|
2998
|
+
* Script runtime for a behavior pack is terminated due to
|
|
2999
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
3000
|
+
*
|
|
3001
|
+
*/
|
|
3002
|
+
Hang = 'Hang',
|
|
3003
|
+
/**
|
|
3004
|
+
* @remarks
|
|
3005
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
3006
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
3007
|
+
* function calls.
|
|
3008
|
+
*
|
|
3009
|
+
*/
|
|
3010
|
+
StackOverflow = 'StackOverflow',
|
|
3011
|
+
}
|
|
3012
|
+
|
|
2818
3013
|
/**
|
|
2819
3014
|
* Used to specify the type of weather condition within the
|
|
2820
3015
|
* world.
|
|
@@ -2966,6 +3161,7 @@ export type EntityComponentTypeMap = {
|
|
|
2966
3161
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
2967
3162
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
2968
3163
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
3164
|
+
'minecraft:npc': EntityNpcComponent;
|
|
2969
3165
|
'minecraft:onfire': EntityOnFireComponent;
|
|
2970
3166
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
2971
3167
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -2999,6 +3195,7 @@ export type EntityComponentTypeMap = {
|
|
|
2999
3195
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
3000
3196
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
3001
3197
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3198
|
+
npc: EntityNpcComponent;
|
|
3002
3199
|
onfire: EntityOnFireComponent;
|
|
3003
3200
|
'player.exhaustion': EntityExhaustionComponent;
|
|
3004
3201
|
'player.hunger': EntityHungerComponent;
|
|
@@ -3018,6 +3215,15 @@ export type EntityComponentTypeMap = {
|
|
|
3018
3215
|
wants_jockey: EntityWantsJockeyComponent;
|
|
3019
3216
|
};
|
|
3020
3217
|
|
|
3218
|
+
/**
|
|
3219
|
+
* @beta
|
|
3220
|
+
*/
|
|
3221
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3222
|
+
? VanillaEntityIdentifier
|
|
3223
|
+
: T extends string
|
|
3224
|
+
? VanillaEntityIdentifier | T
|
|
3225
|
+
: never;
|
|
3226
|
+
|
|
3021
3227
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
3022
3228
|
? ItemComponentTypeMap[T]
|
|
3023
3229
|
: ItemCustomComponentInstance;
|
|
@@ -3044,190 +3250,739 @@ export type ItemComponentTypeMap = {
|
|
|
3044
3250
|
};
|
|
3045
3251
|
|
|
3046
3252
|
/**
|
|
3047
|
-
*
|
|
3253
|
+
* @beta
|
|
3048
3254
|
*/
|
|
3049
|
-
export
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
*
|
|
3055
|
-
*/
|
|
3056
|
-
readonly id: string;
|
|
3057
|
-
}
|
|
3255
|
+
export type VanillaEntityIdentifier =
|
|
3256
|
+
| EntityType
|
|
3257
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3258
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3259
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3058
3260
|
|
|
3059
3261
|
/**
|
|
3060
|
-
*
|
|
3061
|
-
*
|
|
3062
|
-
*
|
|
3063
|
-
* updated in version 1.17.10.21.
|
|
3262
|
+
* @beta
|
|
3263
|
+
* Handle to an aim-assist category that exists in the
|
|
3264
|
+
* world.aimAssist registry.
|
|
3064
3265
|
*/
|
|
3065
|
-
export class
|
|
3266
|
+
export class AimAssistCategory {
|
|
3066
3267
|
private constructor();
|
|
3067
3268
|
/**
|
|
3068
3269
|
* @remarks
|
|
3069
|
-
*
|
|
3270
|
+
* Default targeting priority used for block types not found in
|
|
3271
|
+
* getBlockPriorities.
|
|
3070
3272
|
*
|
|
3273
|
+
* @throws This property can throw when used.
|
|
3071
3274
|
*/
|
|
3072
|
-
readonly
|
|
3275
|
+
readonly defaultBlockPriority: number;
|
|
3073
3276
|
/**
|
|
3074
3277
|
* @remarks
|
|
3075
|
-
*
|
|
3076
|
-
*
|
|
3278
|
+
* Default targeting priority used for entity types not found
|
|
3279
|
+
* in getEntityPriorities.
|
|
3077
3280
|
*
|
|
3078
3281
|
* @throws This property can throw when used.
|
|
3079
|
-
*
|
|
3080
|
-
* {@link LocationInUnloadedChunkError}
|
|
3081
|
-
*
|
|
3082
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3083
3282
|
*/
|
|
3084
|
-
readonly
|
|
3283
|
+
readonly defaultEntityPriority: number;
|
|
3085
3284
|
/**
|
|
3086
3285
|
* @remarks
|
|
3087
|
-
*
|
|
3088
|
-
* water block and a lava block are liquid, while an air block
|
|
3089
|
-
* and a stone block are not. Water logged blocks are not
|
|
3090
|
-
* liquid blocks).
|
|
3286
|
+
* The unique Id associated with the category.
|
|
3091
3287
|
*
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3288
|
+
*/
|
|
3289
|
+
readonly identifier: string;
|
|
3290
|
+
/**
|
|
3291
|
+
* @remarks
|
|
3292
|
+
* Gets the priority settings used for block targeting.
|
|
3095
3293
|
*
|
|
3096
|
-
*
|
|
3294
|
+
* @returns
|
|
3295
|
+
* The record mapping block Ids to their priority settings.
|
|
3296
|
+
* Larger numbers have greater priority.
|
|
3297
|
+
* @throws This function can throw errors.
|
|
3097
3298
|
*/
|
|
3098
|
-
|
|
3299
|
+
getBlockPriorities(): Record<string, number>;
|
|
3099
3300
|
/**
|
|
3100
3301
|
* @remarks
|
|
3101
|
-
*
|
|
3102
|
-
* (for example, if the block is unloaded, references to that
|
|
3103
|
-
* block will no longer be valid.)
|
|
3302
|
+
* Gets the priority settings used for block targeting.
|
|
3104
3303
|
*
|
|
3304
|
+
* @returns
|
|
3305
|
+
* The record mapping block tags to their priority settings.
|
|
3306
|
+
* Larger numbers have greater priority.
|
|
3307
|
+
* @throws This function can throw errors.
|
|
3105
3308
|
*/
|
|
3106
|
-
|
|
3309
|
+
getBlockTagPriorities(): Record<string, number>;
|
|
3107
3310
|
/**
|
|
3108
3311
|
* @remarks
|
|
3109
|
-
*
|
|
3312
|
+
* Gets the priority settings used for entity targeting.
|
|
3110
3313
|
*
|
|
3111
|
-
* @
|
|
3314
|
+
* @returns
|
|
3315
|
+
* The record mapping entity Ids to their priority settings.
|
|
3316
|
+
* Larger numbers have greater priority.
|
|
3317
|
+
* @throws This function can throw errors.
|
|
3318
|
+
*/
|
|
3319
|
+
getEntityPriorities(): Record<string, number>;
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
/**
|
|
3323
|
+
* @beta
|
|
3324
|
+
* Settings used with AimAssistRegistry.addCategory for
|
|
3325
|
+
* creation of the AimAssistCategory.
|
|
3326
|
+
*/
|
|
3327
|
+
export class AimAssistCategorySettings {
|
|
3328
|
+
/**
|
|
3329
|
+
* @remarks
|
|
3330
|
+
* Optional. Default targeting priority used for block types
|
|
3331
|
+
* not provided to setBlockPriorities.
|
|
3112
3332
|
*
|
|
3113
|
-
*
|
|
3333
|
+
* This property can't be edited in read-only mode.
|
|
3114
3334
|
*
|
|
3115
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3116
3335
|
*/
|
|
3117
|
-
|
|
3336
|
+
defaultBlockPriority: number;
|
|
3118
3337
|
/**
|
|
3119
3338
|
* @remarks
|
|
3120
|
-
*
|
|
3121
|
-
*
|
|
3122
|
-
*
|
|
3123
|
-
* @throws This property can throw when used.
|
|
3339
|
+
* Optional. Default targeting priority used for entity types
|
|
3340
|
+
* not provided to setEntityPriorities.
|
|
3124
3341
|
*
|
|
3125
|
-
*
|
|
3342
|
+
* This property can't be edited in read-only mode.
|
|
3126
3343
|
*
|
|
3127
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3128
3344
|
*/
|
|
3129
|
-
|
|
3345
|
+
defaultEntityPriority: number;
|
|
3130
3346
|
/**
|
|
3131
3347
|
* @remarks
|
|
3132
|
-
*
|
|
3348
|
+
* The unique Id used to register the category with. Must have
|
|
3349
|
+
* a namespace.
|
|
3133
3350
|
*
|
|
3134
|
-
* @throws This property can throw when used.
|
|
3135
3351
|
*/
|
|
3136
|
-
readonly
|
|
3352
|
+
readonly identifier: string;
|
|
3137
3353
|
/**
|
|
3138
3354
|
* @remarks
|
|
3139
|
-
*
|
|
3140
|
-
*
|
|
3355
|
+
* Constructor that takes a unique Id to associate with the
|
|
3356
|
+
* created AimAssistCategory. Must have a namespace.
|
|
3141
3357
|
*
|
|
3142
|
-
|
|
3358
|
+
*/
|
|
3359
|
+
constructor(identifier: string);
|
|
3360
|
+
/**
|
|
3361
|
+
* @remarks
|
|
3362
|
+
* Gets the priority settings used for block targeting.
|
|
3143
3363
|
*
|
|
3144
|
-
*
|
|
3364
|
+
* @returns
|
|
3365
|
+
* The record mapping block Ids to their priority settings.
|
|
3366
|
+
* Larger numbers have greater priority.
|
|
3367
|
+
*/
|
|
3368
|
+
getBlockPriorities(): Record<string, number>;
|
|
3369
|
+
/**
|
|
3370
|
+
* @remarks
|
|
3371
|
+
* Gets the priority settings used for block targeting.
|
|
3145
3372
|
*
|
|
3146
|
-
*
|
|
3373
|
+
* @returns
|
|
3374
|
+
* The record mapping block tags to their priority settings.
|
|
3375
|
+
* Larger numbers have greater priority.
|
|
3147
3376
|
*/
|
|
3148
|
-
|
|
3377
|
+
getBlockTagPriorities(): Record<string, number>;
|
|
3149
3378
|
/**
|
|
3150
3379
|
* @remarks
|
|
3151
|
-
* Gets the
|
|
3380
|
+
* Gets the priority settings used for entity targeting.
|
|
3152
3381
|
*
|
|
3153
|
-
* @
|
|
3382
|
+
* @returns
|
|
3383
|
+
* The record mapping entity Ids to their priority settings.
|
|
3384
|
+
* Larger numbers have greater priority.
|
|
3385
|
+
*/
|
|
3386
|
+
getEntityPriorities(): Record<string, number>;
|
|
3387
|
+
/**
|
|
3388
|
+
* @remarks
|
|
3389
|
+
* Sets the priority settings used for block targeting.
|
|
3154
3390
|
*
|
|
3155
|
-
*
|
|
3391
|
+
* This function can't be called in read-only mode.
|
|
3156
3392
|
*
|
|
3157
|
-
*
|
|
3393
|
+
* @param blockPriorities
|
|
3394
|
+
* A record mapping block Ids to their priority settings.
|
|
3395
|
+
* Larger numbers have greater priority.
|
|
3158
3396
|
*/
|
|
3159
|
-
|
|
3397
|
+
setBlockPriorities(
|
|
3398
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3399
|
+
): void;
|
|
3160
3400
|
/**
|
|
3161
3401
|
* @remarks
|
|
3162
|
-
*
|
|
3163
|
-
* Vanilla block names can be changed in future releases, try
|
|
3164
|
-
* using 'Block.matches' instead for block comparison.
|
|
3165
|
-
*
|
|
3166
|
-
* @throws This property can throw when used.
|
|
3402
|
+
* Sets the priority settings used for block targeting.
|
|
3167
3403
|
*
|
|
3168
|
-
*
|
|
3404
|
+
* This function can't be called in read-only mode.
|
|
3169
3405
|
*
|
|
3170
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3171
3406
|
*/
|
|
3172
|
-
|
|
3407
|
+
setBlockTagPriorities(blockTagPriorities: Record<string, number>): void;
|
|
3173
3408
|
/**
|
|
3174
3409
|
* @remarks
|
|
3175
|
-
*
|
|
3410
|
+
* Sets the priority settings used for entity targeting.
|
|
3411
|
+
*
|
|
3412
|
+
* This function can't be called in read-only mode.
|
|
3176
3413
|
*
|
|
3414
|
+
* @param entityPriorities
|
|
3415
|
+
* A record mapping entity Ids to their priority settings.
|
|
3416
|
+
* Larger numbers have greater priority.
|
|
3177
3417
|
*/
|
|
3178
|
-
|
|
3418
|
+
setEntityPriorities(
|
|
3419
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3420
|
+
): void;
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
/**
|
|
3424
|
+
* @beta
|
|
3425
|
+
* Handle to an aim-assist preset that exists in the
|
|
3426
|
+
* world.aimAssist registry.
|
|
3427
|
+
*/
|
|
3428
|
+
export class AimAssistPreset {
|
|
3429
|
+
private constructor();
|
|
3179
3430
|
/**
|
|
3180
3431
|
* @remarks
|
|
3181
|
-
*
|
|
3432
|
+
* Optional. Default aim-assist category Id used for items not
|
|
3433
|
+
* provided to setItemSettings.
|
|
3182
3434
|
*
|
|
3435
|
+
* @throws This property can throw when used.
|
|
3183
3436
|
*/
|
|
3184
|
-
readonly
|
|
3437
|
+
readonly defaultItemSettings?: string;
|
|
3185
3438
|
/**
|
|
3186
3439
|
* @remarks
|
|
3187
|
-
*
|
|
3440
|
+
* Optional. Aim-assist category Id used for an empty hand.
|
|
3188
3441
|
*
|
|
3442
|
+
* @throws This property can throw when used.
|
|
3189
3443
|
*/
|
|
3190
|
-
readonly
|
|
3444
|
+
readonly handSettings?: string;
|
|
3191
3445
|
/**
|
|
3192
3446
|
* @remarks
|
|
3193
|
-
*
|
|
3194
|
-
* Y direction).
|
|
3195
|
-
*
|
|
3196
|
-
* @param steps
|
|
3197
|
-
* Number of steps above to step before returning.
|
|
3198
|
-
* Defaults to: 1
|
|
3199
|
-
* @throws This function can throw errors.
|
|
3200
|
-
*
|
|
3201
|
-
* {@link LocationInUnloadedChunkError}
|
|
3447
|
+
* The unique Id associated with the preset.
|
|
3202
3448
|
*
|
|
3203
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3204
3449
|
*/
|
|
3205
|
-
|
|
3450
|
+
readonly identifier: string;
|
|
3206
3451
|
/**
|
|
3207
3452
|
* @remarks
|
|
3208
|
-
*
|
|
3209
|
-
*
|
|
3453
|
+
* Gets the list of block tags to exclude from aim assist
|
|
3454
|
+
* targeting.
|
|
3210
3455
|
*
|
|
3211
|
-
* @
|
|
3212
|
-
*
|
|
3213
|
-
* Defaults to: 1
|
|
3456
|
+
* @returns
|
|
3457
|
+
* The array of block tags.
|
|
3214
3458
|
* @throws This function can throw errors.
|
|
3215
|
-
*
|
|
3216
|
-
* {@link LocationInUnloadedChunkError}
|
|
3217
|
-
*
|
|
3218
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3219
3459
|
*/
|
|
3220
|
-
|
|
3460
|
+
getExcludedBlockTagTargets(): string[];
|
|
3221
3461
|
/**
|
|
3222
3462
|
* @remarks
|
|
3223
|
-
*
|
|
3224
|
-
*
|
|
3463
|
+
* Gets the list of block Ids to exclude from aim assist
|
|
3464
|
+
* targeting.
|
|
3225
3465
|
*
|
|
3466
|
+
* @returns
|
|
3467
|
+
* The array of block Ids.
|
|
3468
|
+
* @throws This function can throw errors.
|
|
3226
3469
|
*/
|
|
3227
|
-
|
|
3470
|
+
getExcludedBlockTargets(): string[];
|
|
3228
3471
|
/**
|
|
3229
3472
|
* @remarks
|
|
3230
|
-
*
|
|
3473
|
+
* Gets the list of entity Ids to exclude from aim assist
|
|
3474
|
+
* targeting.
|
|
3475
|
+
*
|
|
3476
|
+
* @returns
|
|
3477
|
+
* The array of entity Ids.
|
|
3478
|
+
* @throws This function can throw errors.
|
|
3479
|
+
*/
|
|
3480
|
+
getExcludedEntityTargets(): string[];
|
|
3481
|
+
/**
|
|
3482
|
+
* @remarks
|
|
3483
|
+
* Gets the per-item aim-assist category Ids.
|
|
3484
|
+
*
|
|
3485
|
+
* @returns
|
|
3486
|
+
* The record mapping item Ids to aim-assist category Ids.
|
|
3487
|
+
* @throws This function can throw errors.
|
|
3488
|
+
*/
|
|
3489
|
+
getItemSettings(): Record<string, string>;
|
|
3490
|
+
/**
|
|
3491
|
+
* @remarks
|
|
3492
|
+
* Gets the list of item Ids that will target liquid blocks
|
|
3493
|
+
* with aim-assist when being held.
|
|
3494
|
+
*
|
|
3495
|
+
* @returns
|
|
3496
|
+
* The array of item Ids.
|
|
3497
|
+
* @throws This function can throw errors.
|
|
3498
|
+
*/
|
|
3499
|
+
getLiquidTargetingItems(): string[];
|
|
3500
|
+
}
|
|
3501
|
+
|
|
3502
|
+
/**
|
|
3503
|
+
* @beta
|
|
3504
|
+
* Settings used with AimAssistRegistry.addPreset for creation
|
|
3505
|
+
* of the AimAssistPreset.
|
|
3506
|
+
*/
|
|
3507
|
+
export class AimAssistPresetSettings {
|
|
3508
|
+
/**
|
|
3509
|
+
* @remarks
|
|
3510
|
+
* Optional. Default aim-assist category Id used for items not
|
|
3511
|
+
* provided to setItemSettings.
|
|
3512
|
+
*
|
|
3513
|
+
* This property can't be edited in read-only mode.
|
|
3514
|
+
*
|
|
3515
|
+
*/
|
|
3516
|
+
defaultItemSettings?: string;
|
|
3517
|
+
/**
|
|
3518
|
+
* @remarks
|
|
3519
|
+
* Optional. Aim-assist category Id used for an empty hand.
|
|
3520
|
+
*
|
|
3521
|
+
* This property can't be edited in read-only mode.
|
|
3522
|
+
*
|
|
3523
|
+
*/
|
|
3524
|
+
handSettings?: string;
|
|
3525
|
+
/**
|
|
3526
|
+
* @remarks
|
|
3527
|
+
* The unique Id used to register the preset with. Must have a
|
|
3528
|
+
* namespace.
|
|
3529
|
+
*
|
|
3530
|
+
*/
|
|
3531
|
+
readonly identifier: string;
|
|
3532
|
+
/**
|
|
3533
|
+
* @remarks
|
|
3534
|
+
* Constructor that takes a unique Id to associate with the
|
|
3535
|
+
* created AimAssistPreset. Must have a namespace.
|
|
3536
|
+
*
|
|
3537
|
+
*/
|
|
3538
|
+
constructor(identifier: string);
|
|
3539
|
+
/**
|
|
3540
|
+
* @remarks
|
|
3541
|
+
* Gets the list of block tags to exclude from aim assist
|
|
3542
|
+
* targeting.
|
|
3543
|
+
*
|
|
3544
|
+
* @returns
|
|
3545
|
+
* The array of block tags.
|
|
3546
|
+
*/
|
|
3547
|
+
getExcludedBlockTagTargets(): string[] | undefined;
|
|
3548
|
+
/**
|
|
3549
|
+
* @remarks
|
|
3550
|
+
* Gets the list of block Ids to exclude from aim assist
|
|
3551
|
+
* targeting.
|
|
3552
|
+
*
|
|
3553
|
+
* @returns
|
|
3554
|
+
* The array of block Ids.
|
|
3555
|
+
*/
|
|
3556
|
+
getExcludedBlockTargets(): string[] | undefined;
|
|
3557
|
+
/**
|
|
3558
|
+
* @remarks
|
|
3559
|
+
* Gets the list of entity Ids to exclude from aim assist
|
|
3560
|
+
* targeting.
|
|
3561
|
+
*
|
|
3562
|
+
* @returns
|
|
3563
|
+
* The array of entity Ids.
|
|
3564
|
+
*/
|
|
3565
|
+
getExcludedEntityTargets(): string[] | undefined;
|
|
3566
|
+
/**
|
|
3567
|
+
* @remarks
|
|
3568
|
+
* Gets the per-item aim-assist category Ids.
|
|
3569
|
+
*
|
|
3570
|
+
* @returns
|
|
3571
|
+
* The record mapping item Ids to aim-assist category Ids.
|
|
3572
|
+
*/
|
|
3573
|
+
getItemSettings(): Record<string, string>;
|
|
3574
|
+
/**
|
|
3575
|
+
* @remarks
|
|
3576
|
+
* Gets the list of item Ids that will target liquid blocks
|
|
3577
|
+
* with aim-assist when being held.
|
|
3578
|
+
*
|
|
3579
|
+
* @returns
|
|
3580
|
+
* The array of item Ids.
|
|
3581
|
+
*/
|
|
3582
|
+
getLiquidTargetingItems(): string[] | undefined;
|
|
3583
|
+
/**
|
|
3584
|
+
* @remarks
|
|
3585
|
+
* Sets the list of block tags to exclude from aim assist
|
|
3586
|
+
* targeting.
|
|
3587
|
+
*
|
|
3588
|
+
* This function can't be called in read-only mode.
|
|
3589
|
+
*
|
|
3590
|
+
* @param targets
|
|
3591
|
+
* An array of block tags.
|
|
3592
|
+
*/
|
|
3593
|
+
setExcludedBlockTagTargets(targets?: string[]): void;
|
|
3594
|
+
/**
|
|
3595
|
+
* @remarks
|
|
3596
|
+
* Sets the list of block Ids to exclude from aim assist
|
|
3597
|
+
* targeting.
|
|
3598
|
+
*
|
|
3599
|
+
* This function can't be called in read-only mode.
|
|
3600
|
+
*
|
|
3601
|
+
* @param targets
|
|
3602
|
+
* An array of block Ids.
|
|
3603
|
+
*/
|
|
3604
|
+
setExcludedBlockTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftBlockTypes | string)[]): void;
|
|
3605
|
+
/**
|
|
3606
|
+
* @remarks
|
|
3607
|
+
* Sets the list of entity Ids to exclude from aim assist
|
|
3608
|
+
* targeting.
|
|
3609
|
+
*
|
|
3610
|
+
* This function can't be called in read-only mode.
|
|
3611
|
+
*
|
|
3612
|
+
* @param targets
|
|
3613
|
+
* An array of entity Ids.
|
|
3614
|
+
*/
|
|
3615
|
+
setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
|
|
3616
|
+
/**
|
|
3617
|
+
* @remarks
|
|
3618
|
+
* Sets the per-item aim-assist category Ids.
|
|
3619
|
+
*
|
|
3620
|
+
* This function can't be called in read-only mode.
|
|
3621
|
+
*
|
|
3622
|
+
* @param itemSettings
|
|
3623
|
+
* A record mapping item Ids to aim-assist category Ids.
|
|
3624
|
+
* Category Ids must have a namespace.
|
|
3625
|
+
*/
|
|
3626
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3627
|
+
/**
|
|
3628
|
+
* @remarks
|
|
3629
|
+
* Sets the list of item Ids that will target liquid blocks
|
|
3630
|
+
* with aim-assist when being held.
|
|
3631
|
+
*
|
|
3632
|
+
* This function can't be called in read-only mode.
|
|
3633
|
+
*
|
|
3634
|
+
* @param items
|
|
3635
|
+
* An array of item Ids.
|
|
3636
|
+
*/
|
|
3637
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* @beta
|
|
3642
|
+
* A container for APIs related to the world's aim-assist
|
|
3643
|
+
* settings.
|
|
3644
|
+
*/
|
|
3645
|
+
export class AimAssistRegistry {
|
|
3646
|
+
private constructor();
|
|
3647
|
+
/**
|
|
3648
|
+
* @remarks
|
|
3649
|
+
* The default aim-assist category Id that is used when not
|
|
3650
|
+
* otherwise specified.
|
|
3651
|
+
*
|
|
3652
|
+
*/
|
|
3653
|
+
static readonly DefaultCategoryId = 'minecraft:default';
|
|
3654
|
+
/**
|
|
3655
|
+
* @remarks
|
|
3656
|
+
* The default aim-assist preset Id that is used when not
|
|
3657
|
+
* otherwise specified.
|
|
3658
|
+
*
|
|
3659
|
+
*/
|
|
3660
|
+
static readonly DefaultPresetId = 'minecraft:aim_assist_default';
|
|
3661
|
+
/**
|
|
3662
|
+
* @remarks
|
|
3663
|
+
* Adds an aim-assist category to the registry.
|
|
3664
|
+
*
|
|
3665
|
+
* This function can't be called in read-only mode.
|
|
3666
|
+
*
|
|
3667
|
+
* @param category
|
|
3668
|
+
* The category settings used to create the new category.
|
|
3669
|
+
* @returns
|
|
3670
|
+
* The created category handle.
|
|
3671
|
+
* @throws This function can throw errors.
|
|
3672
|
+
*
|
|
3673
|
+
* {@link minecraftcommon.EngineError}
|
|
3674
|
+
*
|
|
3675
|
+
* {@link Error}
|
|
3676
|
+
*
|
|
3677
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3678
|
+
*
|
|
3679
|
+
* {@link NamespaceNameError}
|
|
3680
|
+
*/
|
|
3681
|
+
addCategory(category: AimAssistCategorySettings): AimAssistCategory;
|
|
3682
|
+
/**
|
|
3683
|
+
* @remarks
|
|
3684
|
+
* Adds an aim-assist preset to the registry.
|
|
3685
|
+
*
|
|
3686
|
+
* This function can't be called in read-only mode.
|
|
3687
|
+
*
|
|
3688
|
+
* @param preset
|
|
3689
|
+
* The preset settings used to create the new preset.
|
|
3690
|
+
* @returns
|
|
3691
|
+
* The created preset handle.
|
|
3692
|
+
* @throws This function can throw errors.
|
|
3693
|
+
*
|
|
3694
|
+
* {@link minecraftcommon.EngineError}
|
|
3695
|
+
*
|
|
3696
|
+
* {@link Error}
|
|
3697
|
+
*
|
|
3698
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3699
|
+
*
|
|
3700
|
+
* {@link NamespaceNameError}
|
|
3701
|
+
*/
|
|
3702
|
+
addPreset(preset: AimAssistPresetSettings): AimAssistPreset;
|
|
3703
|
+
/**
|
|
3704
|
+
* @remarks
|
|
3705
|
+
* Gets all available categories in the registry.
|
|
3706
|
+
*
|
|
3707
|
+
* @returns
|
|
3708
|
+
* An array of all available category objects.
|
|
3709
|
+
*/
|
|
3710
|
+
getCategories(): AimAssistCategory[];
|
|
3711
|
+
/**
|
|
3712
|
+
* @remarks
|
|
3713
|
+
* Gets the category associated with the provided Id.
|
|
3714
|
+
*
|
|
3715
|
+
* This function can't be called in read-only mode.
|
|
3716
|
+
*
|
|
3717
|
+
* @returns
|
|
3718
|
+
* The category object if it exists, otherwise returns
|
|
3719
|
+
* undefined.
|
|
3720
|
+
*/
|
|
3721
|
+
getCategory(categoryId: string): AimAssistCategory | undefined;
|
|
3722
|
+
/**
|
|
3723
|
+
* @remarks
|
|
3724
|
+
* Gets the preset associated with the provided Id.
|
|
3725
|
+
*
|
|
3726
|
+
* This function can't be called in read-only mode.
|
|
3727
|
+
*
|
|
3728
|
+
* @param presetId
|
|
3729
|
+
* The Id of the preset to retrieve. Must have a namespace.
|
|
3730
|
+
* @returns
|
|
3731
|
+
* The preset object if it exists, otherwise returns undefined.
|
|
3732
|
+
*/
|
|
3733
|
+
getPreset(presetId: string): AimAssistPreset | undefined;
|
|
3734
|
+
/**
|
|
3735
|
+
* @remarks
|
|
3736
|
+
* Gets all available presets in the registry.
|
|
3737
|
+
*
|
|
3738
|
+
* @returns
|
|
3739
|
+
* An array of all available preset objects.
|
|
3740
|
+
*/
|
|
3741
|
+
getPresets(): AimAssistPreset[];
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3744
|
+
/**
|
|
3745
|
+
* Describes a type of biome.
|
|
3746
|
+
*/
|
|
3747
|
+
export class BiomeType {
|
|
3748
|
+
private constructor();
|
|
3749
|
+
/**
|
|
3750
|
+
* @remarks
|
|
3751
|
+
* Identifier of the biome type.
|
|
3752
|
+
*
|
|
3753
|
+
*/
|
|
3754
|
+
readonly id: string;
|
|
3755
|
+
/**
|
|
3756
|
+
* @beta
|
|
3757
|
+
* @remarks
|
|
3758
|
+
* Returns a list of the biome's tags.
|
|
3759
|
+
*
|
|
3760
|
+
*/
|
|
3761
|
+
getTags(): string[];
|
|
3762
|
+
/**
|
|
3763
|
+
* @beta
|
|
3764
|
+
* @remarks
|
|
3765
|
+
* Checks if the biome has all of the provided tags.
|
|
3766
|
+
*
|
|
3767
|
+
* @param tags
|
|
3768
|
+
* The list of tags to check against the biome.
|
|
3769
|
+
*/
|
|
3770
|
+
hasTags(tags: string[]): boolean;
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
/**
|
|
3774
|
+
* @beta
|
|
3775
|
+
* Supports a catalog of available biome types registered
|
|
3776
|
+
* within Minecraft.
|
|
3777
|
+
*/
|
|
3778
|
+
export class BiomeTypes {
|
|
3779
|
+
private constructor();
|
|
3780
|
+
/**
|
|
3781
|
+
* @remarks
|
|
3782
|
+
* Returns a specific biome type.
|
|
3783
|
+
*
|
|
3784
|
+
* @param typeName
|
|
3785
|
+
* Identifier of the biome. Generally, namespaced identifiers
|
|
3786
|
+
* (e.g., minecraft:frozen_peaks) should be used.
|
|
3787
|
+
* @returns
|
|
3788
|
+
* If the biome exists, a BiomeType object is returned. If not,
|
|
3789
|
+
* undefined is returned.
|
|
3790
|
+
*/
|
|
3791
|
+
static get(typeName: string): BiomeType | undefined;
|
|
3792
|
+
/**
|
|
3793
|
+
* @remarks
|
|
3794
|
+
* Returns all registered biome types within Minecraft
|
|
3795
|
+
*
|
|
3796
|
+
*/
|
|
3797
|
+
static getAll(): BiomeType[];
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
/**
|
|
3801
|
+
* Represents a block in a dimension. A block represents a
|
|
3802
|
+
* unique X, Y, and Z within a dimension and get/sets the state
|
|
3803
|
+
* of the block at that location. This type was significantly
|
|
3804
|
+
* updated in version 1.17.10.21.
|
|
3805
|
+
*/
|
|
3806
|
+
export class Block {
|
|
3807
|
+
private constructor();
|
|
3808
|
+
/**
|
|
3809
|
+
* @remarks
|
|
3810
|
+
* Returns the dimension that the block is within.
|
|
3811
|
+
*
|
|
3812
|
+
*/
|
|
3813
|
+
readonly dimension: Dimension;
|
|
3814
|
+
/**
|
|
3815
|
+
* @remarks
|
|
3816
|
+
* Returns true if this block is an air block (i.e., empty
|
|
3817
|
+
* space).
|
|
3818
|
+
*
|
|
3819
|
+
* @throws This property can throw when used.
|
|
3820
|
+
*
|
|
3821
|
+
* {@link LocationInUnloadedChunkError}
|
|
3822
|
+
*
|
|
3823
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3824
|
+
*/
|
|
3825
|
+
readonly isAir: boolean;
|
|
3826
|
+
/**
|
|
3827
|
+
* @remarks
|
|
3828
|
+
* Returns true if this block is a liquid block - (e.g., a
|
|
3829
|
+
* water block and a lava block are liquid, while an air block
|
|
3830
|
+
* and a stone block are not. Water logged blocks are not
|
|
3831
|
+
* liquid blocks).
|
|
3832
|
+
*
|
|
3833
|
+
* @throws This property can throw when used.
|
|
3834
|
+
*
|
|
3835
|
+
* {@link LocationInUnloadedChunkError}
|
|
3836
|
+
*
|
|
3837
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3838
|
+
*/
|
|
3839
|
+
readonly isLiquid: boolean;
|
|
3840
|
+
/**
|
|
3841
|
+
* @beta
|
|
3842
|
+
* @remarks
|
|
3843
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
3844
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
3845
|
+
* ladder block and a fence block are not).
|
|
3846
|
+
*
|
|
3847
|
+
* @throws This property can throw when used.
|
|
3848
|
+
*
|
|
3849
|
+
* {@link LocationInUnloadedChunkError}
|
|
3850
|
+
*
|
|
3851
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3852
|
+
*/
|
|
3853
|
+
readonly isSolid: boolean;
|
|
3854
|
+
/**
|
|
3855
|
+
* @remarks
|
|
3856
|
+
* Returns true if this reference to a block is still valid
|
|
3857
|
+
* (for example, if the block is unloaded, references to that
|
|
3858
|
+
* block will no longer be valid.)
|
|
3859
|
+
*
|
|
3860
|
+
*/
|
|
3861
|
+
readonly isValid: boolean;
|
|
3862
|
+
/**
|
|
3863
|
+
* @remarks
|
|
3864
|
+
* Returns or sets whether this block has water on it.
|
|
3865
|
+
*
|
|
3866
|
+
* @throws This property can throw when used.
|
|
3867
|
+
*
|
|
3868
|
+
* {@link LocationInUnloadedChunkError}
|
|
3869
|
+
*
|
|
3870
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3871
|
+
*/
|
|
3872
|
+
readonly isWaterlogged: boolean;
|
|
3873
|
+
/**
|
|
3874
|
+
* @remarks
|
|
3875
|
+
* Key for the localization of this block's name used in .lang
|
|
3876
|
+
* files.
|
|
3877
|
+
*
|
|
3878
|
+
* @throws This property can throw when used.
|
|
3879
|
+
*
|
|
3880
|
+
* {@link LocationInUnloadedChunkError}
|
|
3881
|
+
*
|
|
3882
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3883
|
+
*/
|
|
3884
|
+
readonly localizationKey: string;
|
|
3885
|
+
/**
|
|
3886
|
+
* @remarks
|
|
3887
|
+
* Coordinates of the specified block.
|
|
3888
|
+
*
|
|
3889
|
+
* @throws This property can throw when used.
|
|
3890
|
+
*/
|
|
3891
|
+
readonly location: Vector3;
|
|
3892
|
+
/**
|
|
3893
|
+
* @remarks
|
|
3894
|
+
* Additional block configuration data that describes the
|
|
3895
|
+
* block.
|
|
3896
|
+
*
|
|
3897
|
+
* @throws This property can throw when used.
|
|
3898
|
+
*
|
|
3899
|
+
* {@link LocationInUnloadedChunkError}
|
|
3900
|
+
*
|
|
3901
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3902
|
+
*/
|
|
3903
|
+
readonly permutation: BlockPermutation;
|
|
3904
|
+
/**
|
|
3905
|
+
* @remarks
|
|
3906
|
+
* Gets the type of block.
|
|
3907
|
+
*
|
|
3908
|
+
* @throws This property can throw when used.
|
|
3909
|
+
*
|
|
3910
|
+
* {@link LocationInUnloadedChunkError}
|
|
3911
|
+
*
|
|
3912
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3913
|
+
*/
|
|
3914
|
+
readonly 'type': BlockType;
|
|
3915
|
+
/**
|
|
3916
|
+
* @remarks
|
|
3917
|
+
* Identifier of the type of block for this block. Warning:
|
|
3918
|
+
* Vanilla block names can be changed in future releases, try
|
|
3919
|
+
* using 'Block.matches' instead for block comparison.
|
|
3920
|
+
*
|
|
3921
|
+
* @throws This property can throw when used.
|
|
3922
|
+
*
|
|
3923
|
+
* {@link LocationInUnloadedChunkError}
|
|
3924
|
+
*
|
|
3925
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3926
|
+
*/
|
|
3927
|
+
readonly typeId: string;
|
|
3928
|
+
/**
|
|
3929
|
+
* @remarks
|
|
3930
|
+
* X coordinate of the block.
|
|
3931
|
+
*
|
|
3932
|
+
*/
|
|
3933
|
+
readonly x: number;
|
|
3934
|
+
/**
|
|
3935
|
+
* @remarks
|
|
3936
|
+
* Y coordinate of the block.
|
|
3937
|
+
*
|
|
3938
|
+
*/
|
|
3939
|
+
readonly y: number;
|
|
3940
|
+
/**
|
|
3941
|
+
* @remarks
|
|
3942
|
+
* Z coordinate of the block.
|
|
3943
|
+
*
|
|
3944
|
+
*/
|
|
3945
|
+
readonly z: number;
|
|
3946
|
+
/**
|
|
3947
|
+
* @remarks
|
|
3948
|
+
* Returns the {@link Block} above this block (positive in the
|
|
3949
|
+
* Y direction).
|
|
3950
|
+
*
|
|
3951
|
+
* @param steps
|
|
3952
|
+
* Number of steps above to step before returning.
|
|
3953
|
+
* Defaults to: 1
|
|
3954
|
+
* @throws This function can throw errors.
|
|
3955
|
+
*
|
|
3956
|
+
* {@link LocationInUnloadedChunkError}
|
|
3957
|
+
*
|
|
3958
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3959
|
+
*/
|
|
3960
|
+
above(steps?: number): Block | undefined;
|
|
3961
|
+
/**
|
|
3962
|
+
* @remarks
|
|
3963
|
+
* Returns the {@link Block} below this block (negative in the
|
|
3964
|
+
* Y direction).
|
|
3965
|
+
*
|
|
3966
|
+
* @param steps
|
|
3967
|
+
* Number of steps below to step before returning.
|
|
3968
|
+
* Defaults to: 1
|
|
3969
|
+
* @throws This function can throw errors.
|
|
3970
|
+
*
|
|
3971
|
+
* {@link LocationInUnloadedChunkError}
|
|
3972
|
+
*
|
|
3973
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3974
|
+
*/
|
|
3975
|
+
below(steps?: number): Block | undefined;
|
|
3976
|
+
/**
|
|
3977
|
+
* @remarks
|
|
3978
|
+
* Returns the {@link Vector3} of the center of this block on
|
|
3979
|
+
* the X and Z axis.
|
|
3980
|
+
*
|
|
3981
|
+
*/
|
|
3982
|
+
bottomCenter(): Vector3;
|
|
3983
|
+
/**
|
|
3984
|
+
* @remarks
|
|
3985
|
+
* Returns whether this block is removed when touched by
|
|
3231
3986
|
* liquid.
|
|
3232
3987
|
*
|
|
3233
3988
|
* @param liquidType
|
|
@@ -3261,6 +4016,30 @@ export class Block {
|
|
|
3261
4016
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3262
4017
|
*/
|
|
3263
4018
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4019
|
+
/**
|
|
4020
|
+
* @beta
|
|
4021
|
+
* @remarks
|
|
4022
|
+
* Checks to see whether it is valid to place the specified
|
|
4023
|
+
* block type or block permutation, on a specified face on this
|
|
4024
|
+
* block.
|
|
4025
|
+
*
|
|
4026
|
+
* @param blockToPlace
|
|
4027
|
+
* Block type or block permutation to check placement for.
|
|
4028
|
+
* @param faceToPlaceOn
|
|
4029
|
+
* Optional specific face of this block to check placement
|
|
4030
|
+
* against.
|
|
4031
|
+
* @returns
|
|
4032
|
+
* Returns `true` if the block type or permutation can be
|
|
4033
|
+
* placed on this block, else `false`.
|
|
4034
|
+
* @throws This function can throw errors.
|
|
4035
|
+
*
|
|
4036
|
+
* {@link Error}
|
|
4037
|
+
*
|
|
4038
|
+
* {@link LocationInUnloadedChunkError}
|
|
4039
|
+
*
|
|
4040
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4041
|
+
*/
|
|
4042
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
3264
4043
|
/**
|
|
3265
4044
|
* @remarks
|
|
3266
4045
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -3344,6 +4123,15 @@ export class Block {
|
|
|
3344
4123
|
* {@link LocationInUnloadedChunkError}
|
|
3345
4124
|
*/
|
|
3346
4125
|
getLightLevel(): number;
|
|
4126
|
+
/**
|
|
4127
|
+
* @beta
|
|
4128
|
+
* @throws This function can throw errors.
|
|
4129
|
+
*
|
|
4130
|
+
* {@link LocationInUnloadedChunkError}
|
|
4131
|
+
*
|
|
4132
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4133
|
+
*/
|
|
4134
|
+
getMapColor(): RGBA;
|
|
3347
4135
|
/**
|
|
3348
4136
|
* @remarks
|
|
3349
4137
|
* Returns the net redstone power of this block.
|
|
@@ -3595,6 +4383,27 @@ export class Block {
|
|
|
3595
4383
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3596
4384
|
*/
|
|
3597
4385
|
south(steps?: number): Block | undefined;
|
|
4386
|
+
/**
|
|
4387
|
+
* @beta
|
|
4388
|
+
* @remarks
|
|
4389
|
+
* Tries to set the block in the dimension to the state of the
|
|
4390
|
+
* permutation by first checking if the placement is valid.
|
|
4391
|
+
*
|
|
4392
|
+
* This function can't be called in read-only mode.
|
|
4393
|
+
*
|
|
4394
|
+
* @param permutation
|
|
4395
|
+
* Permutation that contains a set of property states for the
|
|
4396
|
+
* Block.
|
|
4397
|
+
* @returns
|
|
4398
|
+
* Returns `true` if the block permutation data was
|
|
4399
|
+
* successfully set, else `false`.
|
|
4400
|
+
* @throws This function can throw errors.
|
|
4401
|
+
*
|
|
4402
|
+
* {@link LocationInUnloadedChunkError}
|
|
4403
|
+
*
|
|
4404
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4405
|
+
*/
|
|
4406
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
3598
4407
|
/**
|
|
3599
4408
|
* @remarks
|
|
3600
4409
|
* Returns the {@link Block} to the west of this block
|
|
@@ -3612,6 +4421,137 @@ export class Block {
|
|
|
3612
4421
|
west(steps?: number): Block | undefined;
|
|
3613
4422
|
}
|
|
3614
4423
|
|
|
4424
|
+
/**
|
|
4425
|
+
* @beta
|
|
4426
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4427
|
+
* of useful functions for the creation and utility of {@link
|
|
4428
|
+
* BlockBoundingBox} objects
|
|
4429
|
+
*/
|
|
4430
|
+
export class BlockBoundingBoxUtils {
|
|
4431
|
+
private constructor();
|
|
4432
|
+
/**
|
|
4433
|
+
* @remarks
|
|
4434
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4435
|
+
* where the min and max components are guaranteed to be (min
|
|
4436
|
+
* <= max)
|
|
4437
|
+
*
|
|
4438
|
+
* This function can't be called in read-only mode.
|
|
4439
|
+
*
|
|
4440
|
+
* @param min
|
|
4441
|
+
* A corner world location
|
|
4442
|
+
* @param max
|
|
4443
|
+
* A corner world location diametrically opposite
|
|
4444
|
+
*/
|
|
4445
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4446
|
+
/**
|
|
4447
|
+
* @remarks
|
|
4448
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4449
|
+
* each axis.
|
|
4450
|
+
* Sizes can be negative to perform contraction.
|
|
4451
|
+
* Note: corners can be inverted if the contraction size is
|
|
4452
|
+
* greater than the span, but the min/max relationship will
|
|
4453
|
+
* remain correct
|
|
4454
|
+
*
|
|
4455
|
+
* This function can't be called in read-only mode.
|
|
4456
|
+
*
|
|
4457
|
+
* @returns
|
|
4458
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4459
|
+
* the changes
|
|
4460
|
+
*/
|
|
4461
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4462
|
+
/**
|
|
4463
|
+
* @remarks
|
|
4464
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4465
|
+
*
|
|
4466
|
+
* This function can't be called in read-only mode.
|
|
4467
|
+
*
|
|
4468
|
+
*/
|
|
4469
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4470
|
+
/**
|
|
4471
|
+
* @remarks
|
|
4472
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4473
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4474
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4475
|
+
* boxes.
|
|
4476
|
+
*
|
|
4477
|
+
* This function can't be called in read-only mode.
|
|
4478
|
+
*
|
|
4479
|
+
* @returns
|
|
4480
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4481
|
+
* smallest possible bounding box which can encompass both
|
|
4482
|
+
*/
|
|
4483
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4484
|
+
/**
|
|
4485
|
+
* @remarks
|
|
4486
|
+
* Calculate the center block of a given {@link
|
|
4487
|
+
* BlockBoundingBox} object.
|
|
4488
|
+
*
|
|
4489
|
+
* This function can't be called in read-only mode.
|
|
4490
|
+
*
|
|
4491
|
+
* @returns
|
|
4492
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4493
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4494
|
+
* bounds are not mathematically centered...
|
|
4495
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4496
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4497
|
+
*/
|
|
4498
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4499
|
+
/**
|
|
4500
|
+
* @remarks
|
|
4501
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4502
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4503
|
+
*
|
|
4504
|
+
* This function can't be called in read-only mode.
|
|
4505
|
+
*
|
|
4506
|
+
*/
|
|
4507
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4508
|
+
/**
|
|
4509
|
+
* @remarks
|
|
4510
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4511
|
+
*
|
|
4512
|
+
* This function can't be called in read-only mode.
|
|
4513
|
+
*
|
|
4514
|
+
*/
|
|
4515
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4516
|
+
/**
|
|
4517
|
+
* @remarks
|
|
4518
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4519
|
+
*
|
|
4520
|
+
* This function can't be called in read-only mode.
|
|
4521
|
+
*
|
|
4522
|
+
*/
|
|
4523
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4524
|
+
/**
|
|
4525
|
+
* @remarks
|
|
4526
|
+
* Check to see if a given coordinate is inside a
|
|
4527
|
+
* BlockBoundingBox
|
|
4528
|
+
*
|
|
4529
|
+
* This function can't be called in read-only mode.
|
|
4530
|
+
*
|
|
4531
|
+
*/
|
|
4532
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4533
|
+
/**
|
|
4534
|
+
* @remarks
|
|
4535
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4536
|
+
* max))
|
|
4537
|
+
*
|
|
4538
|
+
* This function can't be called in read-only mode.
|
|
4539
|
+
*
|
|
4540
|
+
*/
|
|
4541
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4542
|
+
/**
|
|
4543
|
+
* @remarks
|
|
4544
|
+
* Move a BlockBoundingBox by a given amount
|
|
4545
|
+
*
|
|
4546
|
+
* This function can't be called in read-only mode.
|
|
4547
|
+
*
|
|
4548
|
+
* @returns
|
|
4549
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4550
|
+
* change
|
|
4551
|
+
*/
|
|
4552
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4553
|
+
}
|
|
4554
|
+
|
|
3615
4555
|
/**
|
|
3616
4556
|
* Base type for components associated with blocks.
|
|
3617
4557
|
*/
|
|
@@ -3655,6 +4595,35 @@ export class BlockComponentBlockBreakEvent extends BlockEvent {
|
|
|
3655
4595
|
readonly entitySource?: Entity;
|
|
3656
4596
|
}
|
|
3657
4597
|
|
|
4598
|
+
/**
|
|
4599
|
+
* @beta
|
|
4600
|
+
* Contains information regarding an event sent by an entity to
|
|
4601
|
+
* this block in the world.
|
|
4602
|
+
*/
|
|
4603
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4604
|
+
export class BlockComponentEntityEvent extends BlockEvent {
|
|
4605
|
+
private constructor();
|
|
4606
|
+
/**
|
|
4607
|
+
* @remarks
|
|
4608
|
+
* Returns permutation information about the block receiving
|
|
4609
|
+
* the event.
|
|
4610
|
+
*
|
|
4611
|
+
*/
|
|
4612
|
+
readonly blockPermutation: BlockPermutation;
|
|
4613
|
+
/**
|
|
4614
|
+
* @remarks
|
|
4615
|
+
* The entity that sent the event.
|
|
4616
|
+
*
|
|
4617
|
+
*/
|
|
4618
|
+
readonly entitySource?: Entity;
|
|
4619
|
+
/**
|
|
4620
|
+
* @remarks
|
|
4621
|
+
* Name of the event fired by the entity.
|
|
4622
|
+
*
|
|
4623
|
+
*/
|
|
4624
|
+
readonly name: string;
|
|
4625
|
+
}
|
|
4626
|
+
|
|
3658
4627
|
/**
|
|
3659
4628
|
* Contains information regarding an entity falling onto a
|
|
3660
4629
|
* specific block.
|
|
@@ -4083,6 +5052,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
4083
5052
|
*
|
|
4084
5053
|
*/
|
|
4085
5054
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
5055
|
+
/**
|
|
5056
|
+
* @beta
|
|
5057
|
+
* @remarks
|
|
5058
|
+
* Checks if the underlining block volume has been invalidated.
|
|
5059
|
+
* Will return false if the block volume was modified between
|
|
5060
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
5061
|
+
*
|
|
5062
|
+
* @throws This function can throw errors.
|
|
5063
|
+
*
|
|
5064
|
+
* {@link minecraftcommon.EngineError}
|
|
5065
|
+
*/
|
|
5066
|
+
isValid(): boolean;
|
|
4086
5067
|
/**
|
|
4087
5068
|
* @remarks
|
|
4088
5069
|
* This function can't be called in read-only mode.
|
|
@@ -4179,6 +5160,14 @@ export class BlockMovableComponent extends BlockComponent {
|
|
|
4179
5160
|
*/
|
|
4180
5161
|
export class BlockPermutation {
|
|
4181
5162
|
private constructor();
|
|
5163
|
+
/**
|
|
5164
|
+
* @beta
|
|
5165
|
+
* @remarks
|
|
5166
|
+
* Key for the localization of this BlockPermutation's name
|
|
5167
|
+
* used in .lang files.
|
|
5168
|
+
*
|
|
5169
|
+
*/
|
|
5170
|
+
readonly localizationKey: string;
|
|
4182
5171
|
/**
|
|
4183
5172
|
* @remarks
|
|
4184
5173
|
* The {@link BlockType} that the permutation has.
|
|
@@ -4842,6 +5831,14 @@ export class BlockType {
|
|
|
4842
5831
|
*
|
|
4843
5832
|
*/
|
|
4844
5833
|
readonly id: string;
|
|
5834
|
+
/**
|
|
5835
|
+
* @beta
|
|
5836
|
+
* @remarks
|
|
5837
|
+
* Key for the localization of this BlockType's name used in
|
|
5838
|
+
* .lang files.
|
|
5839
|
+
*
|
|
5840
|
+
*/
|
|
5841
|
+
readonly localizationKey: string;
|
|
4845
5842
|
}
|
|
4846
5843
|
|
|
4847
5844
|
/**
|
|
@@ -4965,6 +5962,15 @@ export class BlockVolumeBase {
|
|
|
4965
5962
|
*
|
|
4966
5963
|
*/
|
|
4967
5964
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
5965
|
+
/**
|
|
5966
|
+
* @beta
|
|
5967
|
+
* @remarks
|
|
5968
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
5969
|
+
* the validated min and max coordinates of the volume
|
|
5970
|
+
*
|
|
5971
|
+
* @throws This function can throw errors.
|
|
5972
|
+
*/
|
|
5973
|
+
getBoundingBox(): BlockBoundingBox;
|
|
4968
5974
|
/**
|
|
4969
5975
|
* @remarks
|
|
4970
5976
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -5130,6 +6136,19 @@ export class Camera {
|
|
|
5130
6136
|
*
|
|
5131
6137
|
*/
|
|
5132
6138
|
readonly isValid: boolean;
|
|
6139
|
+
/**
|
|
6140
|
+
* @beta
|
|
6141
|
+
* @remarks
|
|
6142
|
+
* Attaches the camera to a non-player entity.
|
|
6143
|
+
*
|
|
6144
|
+
* This function can't be called in read-only mode.
|
|
6145
|
+
*
|
|
6146
|
+
* @param attachCameraOptions
|
|
6147
|
+
* Options for the entity the camera is attaching to. Contains
|
|
6148
|
+
* the entity identifier and optional entity location.
|
|
6149
|
+
* @throws This function can throw errors.
|
|
6150
|
+
*/
|
|
6151
|
+
attachToEntity(attachCameraOptions?: CameraAttachOptions): void;
|
|
5133
6152
|
/**
|
|
5134
6153
|
* @remarks
|
|
5135
6154
|
* Clears the active camera for the specified player. Causes
|
|
@@ -5154,6 +6173,14 @@ export class Camera {
|
|
|
5154
6173
|
* @throws This function can throw errors.
|
|
5155
6174
|
*/
|
|
5156
6175
|
fade(fadeCameraOptions?: CameraFadeOptions): void;
|
|
6176
|
+
/**
|
|
6177
|
+
* @beta
|
|
6178
|
+
* @remarks
|
|
6179
|
+
* This function can't be called in read-only mode.
|
|
6180
|
+
*
|
|
6181
|
+
* @throws This function can throw errors.
|
|
6182
|
+
*/
|
|
6183
|
+
playAnimation(splineType: CatmullRomSpline | LinearSpline, cameraAnimationOptions: AnimationOptions): void;
|
|
5157
6184
|
/**
|
|
5158
6185
|
* @remarks
|
|
5159
6186
|
* Sets the current active camera for the specified player.
|
|
@@ -5176,6 +6203,23 @@ export class Camera {
|
|
|
5176
6203
|
| CameraSetRotOptions
|
|
5177
6204
|
| CameraTargetOptions,
|
|
5178
6205
|
): void;
|
|
6206
|
+
/**
|
|
6207
|
+
* @beta
|
|
6208
|
+
* @remarks
|
|
6209
|
+
* Sets the current active camera with easing.
|
|
6210
|
+
*
|
|
6211
|
+
* This function can't be called in read-only mode.
|
|
6212
|
+
*
|
|
6213
|
+
* @param cameraPreset
|
|
6214
|
+
* Identifier of a camera preset file defined within JSON.
|
|
6215
|
+
* @param easeOptions
|
|
6216
|
+
* Options to ease the camera from the previous camera to the
|
|
6217
|
+
* current one.
|
|
6218
|
+
* @throws
|
|
6219
|
+
* Throws when easing to minecraft:first_person presets
|
|
6220
|
+
* currently without the experimental cameras toggle enabled.
|
|
6221
|
+
*/
|
|
6222
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
5179
6223
|
/**
|
|
5180
6224
|
* @remarks
|
|
5181
6225
|
* Sets the current active camera for the specified player and
|
|
@@ -5201,6 +6245,173 @@ export class Camera {
|
|
|
5201
6245
|
setFov(fovCameraOptions?: CameraFovOptions): void;
|
|
5202
6246
|
}
|
|
5203
6247
|
|
|
6248
|
+
/**
|
|
6249
|
+
* @beta
|
|
6250
|
+
* CatmullRom spline creation.
|
|
6251
|
+
*/
|
|
6252
|
+
export class CatmullRomSpline {
|
|
6253
|
+
/**
|
|
6254
|
+
* @remarks
|
|
6255
|
+
* Control points for the CatmullRom curve.
|
|
6256
|
+
*
|
|
6257
|
+
* This property can't be edited in read-only mode.
|
|
6258
|
+
*
|
|
6259
|
+
*/
|
|
6260
|
+
controlPoints: Vector3[];
|
|
6261
|
+
}
|
|
6262
|
+
|
|
6263
|
+
/**
|
|
6264
|
+
* @beta
|
|
6265
|
+
* An event that fires as players enter chat messages.
|
|
6266
|
+
*/
|
|
6267
|
+
export class ChatSendAfterEvent {
|
|
6268
|
+
private constructor();
|
|
6269
|
+
/**
|
|
6270
|
+
* @remarks
|
|
6271
|
+
* Message that is being broadcast.
|
|
6272
|
+
*
|
|
6273
|
+
*/
|
|
6274
|
+
readonly message: string;
|
|
6275
|
+
/**
|
|
6276
|
+
* @remarks
|
|
6277
|
+
* Player that sent the chat message.
|
|
6278
|
+
*
|
|
6279
|
+
*/
|
|
6280
|
+
readonly sender: Player;
|
|
6281
|
+
/**
|
|
6282
|
+
* @remarks
|
|
6283
|
+
* Optional list of players that will receive this message. If
|
|
6284
|
+
* defined, this message is directly targeted to one or more
|
|
6285
|
+
* players (i.e., is not broadcast.)
|
|
6286
|
+
*
|
|
6287
|
+
*/
|
|
6288
|
+
readonly targets?: Player[];
|
|
6289
|
+
}
|
|
6290
|
+
|
|
6291
|
+
/**
|
|
6292
|
+
* @beta
|
|
6293
|
+
* Manages callbacks that are connected to chat messages being
|
|
6294
|
+
* sent.
|
|
6295
|
+
*/
|
|
6296
|
+
export class ChatSendAfterEventSignal {
|
|
6297
|
+
private constructor();
|
|
6298
|
+
/**
|
|
6299
|
+
* @remarks
|
|
6300
|
+
* Adds a callback that will be called when new chat messages
|
|
6301
|
+
* are sent.
|
|
6302
|
+
*
|
|
6303
|
+
* This function can't be called in read-only mode.
|
|
6304
|
+
*
|
|
6305
|
+
* This function can be called in early-execution mode.
|
|
6306
|
+
*
|
|
6307
|
+
*/
|
|
6308
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
6309
|
+
/**
|
|
6310
|
+
* @remarks
|
|
6311
|
+
* Removes a callback from being called when new chat messages
|
|
6312
|
+
* are sent.
|
|
6313
|
+
*
|
|
6314
|
+
* This function can't be called in read-only mode.
|
|
6315
|
+
*
|
|
6316
|
+
* This function can be called in early-execution mode.
|
|
6317
|
+
*
|
|
6318
|
+
*/
|
|
6319
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
6320
|
+
}
|
|
6321
|
+
|
|
6322
|
+
/**
|
|
6323
|
+
* @beta
|
|
6324
|
+
* An event that fires as players enter chat messages.
|
|
6325
|
+
*/
|
|
6326
|
+
export class ChatSendBeforeEvent {
|
|
6327
|
+
private constructor();
|
|
6328
|
+
/**
|
|
6329
|
+
* @remarks
|
|
6330
|
+
* If set to true in a beforeChat event handler, this message
|
|
6331
|
+
* is not broadcast out.
|
|
6332
|
+
*
|
|
6333
|
+
*/
|
|
6334
|
+
cancel: boolean;
|
|
6335
|
+
/**
|
|
6336
|
+
* @remarks
|
|
6337
|
+
* Message that is being broadcast.
|
|
6338
|
+
*
|
|
6339
|
+
*/
|
|
6340
|
+
readonly message: string;
|
|
6341
|
+
/**
|
|
6342
|
+
* @remarks
|
|
6343
|
+
* Player that sent the chat message.
|
|
6344
|
+
*
|
|
6345
|
+
*/
|
|
6346
|
+
readonly sender: Player;
|
|
6347
|
+
/**
|
|
6348
|
+
* @remarks
|
|
6349
|
+
* Optional list of players that will receive this message. If
|
|
6350
|
+
* defined, this message is directly targeted to one or more
|
|
6351
|
+
* players (i.e., is not broadcast.)
|
|
6352
|
+
*
|
|
6353
|
+
*/
|
|
6354
|
+
readonly targets?: Player[];
|
|
6355
|
+
}
|
|
6356
|
+
|
|
6357
|
+
/**
|
|
6358
|
+
* @beta
|
|
6359
|
+
* Manages callbacks that are connected to an event that fires
|
|
6360
|
+
* before chat messages are sent.
|
|
6361
|
+
* @example customCommand.ts
|
|
6362
|
+
* ```typescript
|
|
6363
|
+
* import { world, DimensionLocation } from "@minecraft/server";
|
|
6364
|
+
*
|
|
6365
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
6366
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
|
|
6367
|
+
* if (eventData.message.includes("cancel")) {
|
|
6368
|
+
* // Cancel event if the message contains "cancel"
|
|
6369
|
+
* eventData.cancel = true;
|
|
6370
|
+
* } else {
|
|
6371
|
+
* const args = eventData.message.split(" ");
|
|
6372
|
+
*
|
|
6373
|
+
* if (args.length > 0) {
|
|
6374
|
+
* switch (args[0].toLowerCase()) {
|
|
6375
|
+
* case "echo":
|
|
6376
|
+
* // Send a modified version of chat message
|
|
6377
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
6378
|
+
* break;
|
|
6379
|
+
* case "help":
|
|
6380
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
6381
|
+
* break;
|
|
6382
|
+
* }
|
|
6383
|
+
* }
|
|
6384
|
+
* }
|
|
6385
|
+
* });
|
|
6386
|
+
* }
|
|
6387
|
+
* ```
|
|
6388
|
+
*/
|
|
6389
|
+
export class ChatSendBeforeEventSignal {
|
|
6390
|
+
private constructor();
|
|
6391
|
+
/**
|
|
6392
|
+
* @remarks
|
|
6393
|
+
* Adds a callback that will be called before new chat messages
|
|
6394
|
+
* are sent.
|
|
6395
|
+
*
|
|
6396
|
+
* This function can't be called in read-only mode.
|
|
6397
|
+
*
|
|
6398
|
+
* This function can be called in early-execution mode.
|
|
6399
|
+
*
|
|
6400
|
+
*/
|
|
6401
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
6402
|
+
/**
|
|
6403
|
+
* @remarks
|
|
6404
|
+
* Removes a callback from being called before new chat
|
|
6405
|
+
* messages are sent.
|
|
6406
|
+
*
|
|
6407
|
+
* This function can't be called in read-only mode.
|
|
6408
|
+
*
|
|
6409
|
+
* This function can be called in early-execution mode.
|
|
6410
|
+
*
|
|
6411
|
+
*/
|
|
6412
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
6413
|
+
}
|
|
6414
|
+
|
|
5204
6415
|
/**
|
|
5205
6416
|
* Contains the device information for a client instance.
|
|
5206
6417
|
*/
|
|
@@ -5258,6 +6469,258 @@ export class Component {
|
|
|
5258
6469
|
readonly typeId: string;
|
|
5259
6470
|
}
|
|
5260
6471
|
|
|
6472
|
+
/**
|
|
6473
|
+
* @beta
|
|
6474
|
+
* The Compound Block Volume is a collection of individual
|
|
6475
|
+
* block volume definitions which, as a collection, define a
|
|
6476
|
+
* larger volume of (sometimes non-contiguous) irregular
|
|
6477
|
+
* shapes.
|
|
6478
|
+
* This class is loosely based on the concept of CSG
|
|
6479
|
+
* (Computational Solid Geometry) and allows a user to create
|
|
6480
|
+
* complex volumes by building a stack of volumes and voids to
|
|
6481
|
+
* make a larger single volume.
|
|
6482
|
+
* For example - normally a creator would create a hollow cube
|
|
6483
|
+
* by creating 6 "wall" surfaces for each face.
|
|
6484
|
+
* With a Compound Block Volume, a creator can define a hollow
|
|
6485
|
+
* cube by creating a single outer solid cube, and then
|
|
6486
|
+
* defining a further single 'void' cube inside the larger one.
|
|
6487
|
+
* Similarly, the Compound Block Volume can represent irregular
|
|
6488
|
+
* shaped volumes (e.g. a tree consists of a trunk and lots of
|
|
6489
|
+
* leaf cubes which are not necessarily contiguously placed).
|
|
6490
|
+
* Each of the volumes added to the CompoundBlockVolume are (by
|
|
6491
|
+
* default) relative to the origin set (either at construction
|
|
6492
|
+
* or via one of the set functions).
|
|
6493
|
+
* However, it is also possible to push volumes to the compound
|
|
6494
|
+
* collection which are absolute in nature and are not affected
|
|
6495
|
+
* by origin changes.
|
|
6496
|
+
*/
|
|
6497
|
+
export class CompoundBlockVolume {
|
|
6498
|
+
/**
|
|
6499
|
+
* @remarks
|
|
6500
|
+
* Return the 'capacity' of the bounding rectangle which
|
|
6501
|
+
* represents the collection of volumes in the stack
|
|
6502
|
+
*
|
|
6503
|
+
*/
|
|
6504
|
+
readonly capacity: number;
|
|
6505
|
+
readonly items: CompoundBlockVolumeItem[];
|
|
6506
|
+
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
6507
|
+
/**
|
|
6508
|
+
* @remarks
|
|
6509
|
+
* Return the number of volumes (positive and negative) in the
|
|
6510
|
+
* volume stack
|
|
6511
|
+
*
|
|
6512
|
+
*/
|
|
6513
|
+
readonly volumeCount: number;
|
|
6514
|
+
/**
|
|
6515
|
+
* @remarks
|
|
6516
|
+
* Create a CompoundBlockVolume object
|
|
6517
|
+
*
|
|
6518
|
+
* @param origin
|
|
6519
|
+
* An optional world space origin on which to center the
|
|
6520
|
+
* compound volume.
|
|
6521
|
+
* If not specified, the origin is set to (0,0,0)
|
|
6522
|
+
*/
|
|
6523
|
+
constructor(origin?: Vector3);
|
|
6524
|
+
/**
|
|
6525
|
+
* @remarks
|
|
6526
|
+
* Clear the contents of the volume stack
|
|
6527
|
+
*
|
|
6528
|
+
* This function can't be called in read-only mode.
|
|
6529
|
+
*
|
|
6530
|
+
*/
|
|
6531
|
+
clear(): void;
|
|
6532
|
+
/**
|
|
6533
|
+
* @remarks
|
|
6534
|
+
* Fetch a Block Location Iterator for the Compound Block
|
|
6535
|
+
* Volume. This iterator will allow a creator to iterate
|
|
6536
|
+
* across all of the selected volumes within the larger
|
|
6537
|
+
* bounding area.
|
|
6538
|
+
* Areas of a volume which have been overridden by a
|
|
6539
|
+
* subtractive volume will not be included in the iterator
|
|
6540
|
+
* step.
|
|
6541
|
+
* (i.e. if you push a cube to the stack, and then push a
|
|
6542
|
+
* subtractive volume to the same location, then the iterator
|
|
6543
|
+
* will step over the initial volume because it is considered
|
|
6544
|
+
* negative space)
|
|
6545
|
+
* Note that the Block Locations returned by this iterator are
|
|
6546
|
+
* in absolute world space (irrespective of whether the
|
|
6547
|
+
* compound volume items pushed are absolute or relative)
|
|
6548
|
+
*
|
|
6549
|
+
* This function can't be called in read-only mode.
|
|
6550
|
+
*
|
|
6551
|
+
*/
|
|
6552
|
+
getBlockLocationIterator(): BlockLocationIterator;
|
|
6553
|
+
/**
|
|
6554
|
+
* @remarks
|
|
6555
|
+
* Get the largest bounding box that represents a container for
|
|
6556
|
+
* all of the volumes on the stack
|
|
6557
|
+
* Note that the bounding box returned is represented in
|
|
6558
|
+
* absolute world space (irrespective of whether the compound
|
|
6559
|
+
* volume items pushed are absolute or relative)
|
|
6560
|
+
*
|
|
6561
|
+
* This function can't be called in read-only mode.
|
|
6562
|
+
*
|
|
6563
|
+
*/
|
|
6564
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6565
|
+
/**
|
|
6566
|
+
* @remarks
|
|
6567
|
+
* Get the max block location of the outermost bounding
|
|
6568
|
+
* rectangle which represents the volumes on the stack.
|
|
6569
|
+
* Note that the max location returned is in absolute world
|
|
6570
|
+
* space (irrespective of whether the compound volume items
|
|
6571
|
+
* pushed are absolute or relative)
|
|
6572
|
+
*
|
|
6573
|
+
* This function can't be called in read-only mode.
|
|
6574
|
+
*
|
|
6575
|
+
*/
|
|
6576
|
+
getMax(): Vector3;
|
|
6577
|
+
/**
|
|
6578
|
+
* @remarks
|
|
6579
|
+
* Get the min block location of the outermost bounding
|
|
6580
|
+
* rectangle which represents the volumes on the stack.
|
|
6581
|
+
* Note that the min location returned is in absolute world
|
|
6582
|
+
* space (irrespective of whether the compound volume items
|
|
6583
|
+
* pushed are absolute or relative)
|
|
6584
|
+
*
|
|
6585
|
+
* This function can't be called in read-only mode.
|
|
6586
|
+
*
|
|
6587
|
+
*/
|
|
6588
|
+
getMin(): Vector3;
|
|
6589
|
+
/**
|
|
6590
|
+
* @remarks
|
|
6591
|
+
* Fetch the origin in world space of the compound volume
|
|
6592
|
+
*
|
|
6593
|
+
* This function can't be called in read-only mode.
|
|
6594
|
+
*
|
|
6595
|
+
*/
|
|
6596
|
+
getOrigin(): Vector3;
|
|
6597
|
+
/**
|
|
6598
|
+
* @remarks
|
|
6599
|
+
* Return a boolean which signals if there are any volume items
|
|
6600
|
+
* pushed to the volume
|
|
6601
|
+
*
|
|
6602
|
+
* This function can't be called in read-only mode.
|
|
6603
|
+
*
|
|
6604
|
+
*/
|
|
6605
|
+
isEmpty(): boolean;
|
|
6606
|
+
/**
|
|
6607
|
+
* @remarks
|
|
6608
|
+
* Return a boolean representing whether or not a given
|
|
6609
|
+
* absolute world space block location is inside a positive
|
|
6610
|
+
* block volume.
|
|
6611
|
+
* E.g. if the stack contains a large cube followed by a
|
|
6612
|
+
* slightly smaller negative cube, and the test location is
|
|
6613
|
+
* within the negative cube - the function will return false
|
|
6614
|
+
* because it's not 'inside' a volume (it IS inside the
|
|
6615
|
+
* bounding rectangle, but it is not inside a positively
|
|
6616
|
+
* defined location)
|
|
6617
|
+
*
|
|
6618
|
+
* This function can't be called in read-only mode.
|
|
6619
|
+
*
|
|
6620
|
+
*/
|
|
6621
|
+
isInside(worldLocation: Vector3): boolean;
|
|
6622
|
+
/**
|
|
6623
|
+
* @remarks
|
|
6624
|
+
* Inspect the last entry pushed to the volume stack without
|
|
6625
|
+
* affecting the stack contents.
|
|
6626
|
+
*
|
|
6627
|
+
* This function can't be called in read-only mode.
|
|
6628
|
+
*
|
|
6629
|
+
* @param forceRelativity
|
|
6630
|
+
* Determine whether the function returns a
|
|
6631
|
+
* CompoundBlockVolumeItem which is forced into either relative
|
|
6632
|
+
* or absolute coordinate system.
|
|
6633
|
+
* `true` = force returned item to be relative to volume origin
|
|
6634
|
+
* `false` = force returned item to be absolute world space
|
|
6635
|
+
* location
|
|
6636
|
+
*
|
|
6637
|
+
* If no flag is specified, the item returned retains whatever
|
|
6638
|
+
* relativity it had when it was pushed
|
|
6639
|
+
* @returns
|
|
6640
|
+
* Returns undefined if the stack is empty
|
|
6641
|
+
*/
|
|
6642
|
+
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
6643
|
+
/**
|
|
6644
|
+
* @remarks
|
|
6645
|
+
* Remove the last entry from the volume stack. This will
|
|
6646
|
+
* reduce the stack size by one
|
|
6647
|
+
*
|
|
6648
|
+
* This function can't be called in read-only mode.
|
|
6649
|
+
*
|
|
6650
|
+
*/
|
|
6651
|
+
popVolume(): boolean;
|
|
6652
|
+
/**
|
|
6653
|
+
* @remarks
|
|
6654
|
+
* Push a volume item to the stack. The volume item contains
|
|
6655
|
+
* an 'action' parameter which determines whether this volume
|
|
6656
|
+
* is a positive or negative space.
|
|
6657
|
+
* The item also contains a `locationRelativity` which
|
|
6658
|
+
* determines whether it is relative or absolute to the
|
|
6659
|
+
* compound volume origin
|
|
6660
|
+
*
|
|
6661
|
+
* This function can't be called in read-only mode.
|
|
6662
|
+
*
|
|
6663
|
+
* @param item
|
|
6664
|
+
* Item to push to the end of the stack
|
|
6665
|
+
*/
|
|
6666
|
+
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
6667
|
+
/**
|
|
6668
|
+
* @remarks
|
|
6669
|
+
* If the volume stack is empty, this function will push the
|
|
6670
|
+
* specified item to the stack.
|
|
6671
|
+
* If the volume stack is NOT empty, this function will replace
|
|
6672
|
+
* the last item on the stack with the new item.
|
|
6673
|
+
*
|
|
6674
|
+
* This function can't be called in read-only mode.
|
|
6675
|
+
*
|
|
6676
|
+
* @param item
|
|
6677
|
+
* Item to add or replace
|
|
6678
|
+
*/
|
|
6679
|
+
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
6680
|
+
/**
|
|
6681
|
+
* @remarks
|
|
6682
|
+
* Set the origin of the compound volume to an absolute world
|
|
6683
|
+
* space location
|
|
6684
|
+
*
|
|
6685
|
+
* This function can't be called in read-only mode.
|
|
6686
|
+
*
|
|
6687
|
+
* @param preserveExistingVolumes
|
|
6688
|
+
* This optional boolean flag determines whether the relative
|
|
6689
|
+
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
6690
|
+
* affected by the new origin.
|
|
6691
|
+
* Imagine a scenario where you have a series of relative
|
|
6692
|
+
* locations around an origin which make up a sphere; all of
|
|
6693
|
+
* these locations are in the range of -2 to 2.
|
|
6694
|
+
* Push each of these locations to the compound volume as
|
|
6695
|
+
* relative items.
|
|
6696
|
+
* Now, move the origin and all of the locations representing
|
|
6697
|
+
* the sphere move accordingly.
|
|
6698
|
+
* However, let's say you want to add a 2nd sphere next to the
|
|
6699
|
+
* 1st.
|
|
6700
|
+
* In this case, set the new origin a few locations over, but
|
|
6701
|
+
* 'preserveExistingVolumes' = true.
|
|
6702
|
+
* This will set a new origin, but the existing sphere
|
|
6703
|
+
* locations will remain relative to the original origin.
|
|
6704
|
+
* Now, you can push the relative sphere locations again (this
|
|
6705
|
+
* time they will be relative to the new origin) - resulting in
|
|
6706
|
+
* 2 spheres next to each other.
|
|
6707
|
+
*/
|
|
6708
|
+
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6709
|
+
/**
|
|
6710
|
+
* @remarks
|
|
6711
|
+
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
6712
|
+
* function will translate the origin by a given delta to a new
|
|
6713
|
+
* position
|
|
6714
|
+
*
|
|
6715
|
+
* This function can't be called in read-only mode.
|
|
6716
|
+
*
|
|
6717
|
+
* @param preserveExistingVolumes
|
|
6718
|
+
* See the description for the arguments to {@link
|
|
6719
|
+
* CompoundBlockVolume.setOrigin}
|
|
6720
|
+
*/
|
|
6721
|
+
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6722
|
+
}
|
|
6723
|
+
|
|
5261
6724
|
/**
|
|
5262
6725
|
* Represents a container that can hold sets of items. Used
|
|
5263
6726
|
* with entities such as Players, Chest Minecarts, Llamas, and
|
|
@@ -5395,7 +6858,9 @@ export class Container {
|
|
|
5395
6858
|
*
|
|
5396
6859
|
* @param itemStack
|
|
5397
6860
|
* The stack of items to add.
|
|
5398
|
-
* @throws
|
|
6861
|
+
* @throws
|
|
6862
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
6863
|
+
* limit but will instead add items up to the weight limit.
|
|
5399
6864
|
*
|
|
5400
6865
|
* {@link ContainerRulesError}
|
|
5401
6866
|
*
|
|
@@ -5627,6 +7092,8 @@ export class Container {
|
|
|
5627
7092
|
* @throws
|
|
5628
7093
|
* Throws if either this container or `toContainer` are invalid
|
|
5629
7094
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
7095
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
7096
|
+
* limit but will instead add items up to the weight limit.
|
|
5630
7097
|
*
|
|
5631
7098
|
* {@link ContainerRulesError}
|
|
5632
7099
|
*
|
|
@@ -6254,7 +7721,47 @@ export class Dimension {
|
|
|
6254
7721
|
* language files.
|
|
6255
7722
|
*
|
|
6256
7723
|
*/
|
|
6257
|
-
readonly localizationKey: string;
|
|
7724
|
+
readonly localizationKey: string;
|
|
7725
|
+
/**
|
|
7726
|
+
* @beta
|
|
7727
|
+
* @remarks
|
|
7728
|
+
* Checks if an area contains the specified biomes. If the area
|
|
7729
|
+
* is partially inside world boundaries, only the area that is
|
|
7730
|
+
* in bounds will be searched. This operation takes longer
|
|
7731
|
+
* proportional to both the area of the volume and the number
|
|
7732
|
+
* of biomes to check.
|
|
7733
|
+
*
|
|
7734
|
+
* @param volume
|
|
7735
|
+
* Area to check biomes in.
|
|
7736
|
+
* @param biomeFilter
|
|
7737
|
+
* A list of biomes to include and exclude. A list of tags to
|
|
7738
|
+
* include and exclude. Will return false if a biome is found
|
|
7739
|
+
* in the area that is in the excluded list or contains any of
|
|
7740
|
+
* the excluded tags. If superset is set to true then the area
|
|
7741
|
+
* must contain at least one biome in the included list or that
|
|
7742
|
+
* contains all of the included tags. If superset is set to
|
|
7743
|
+
* false then the area must contain only biomes in the included
|
|
7744
|
+
* list and that contain all of the included tags
|
|
7745
|
+
* @returns
|
|
7746
|
+
* Returns true if the biomes in the area match the filter
|
|
7747
|
+
* settings passed in. Otherwise, returns false.
|
|
7748
|
+
* @throws
|
|
7749
|
+
* An error will be thrown if the area provided includes
|
|
7750
|
+
* unloaded chunks.
|
|
7751
|
+
* An error will be thrown if the area provided is completely
|
|
7752
|
+
* outside the world boundaries.
|
|
7753
|
+
* An error will be thrown if an unknown biome name is
|
|
7754
|
+
* provided.
|
|
7755
|
+
*
|
|
7756
|
+
* {@link minecraftcommon.EngineError}
|
|
7757
|
+
*
|
|
7758
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7759
|
+
*
|
|
7760
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
7761
|
+
*
|
|
7762
|
+
* {@link UnloadedChunksError}
|
|
7763
|
+
*/
|
|
7764
|
+
containsBiomes(volume: BlockVolumeBase, biomeFilter: BiomeFilter): boolean;
|
|
6258
7765
|
/**
|
|
6259
7766
|
* @remarks
|
|
6260
7767
|
* Searches the block volume for a block that satisfies the
|
|
@@ -6371,6 +7878,30 @@ export class Dimension {
|
|
|
6371
7878
|
block: BlockPermutation | BlockType | string,
|
|
6372
7879
|
options?: BlockFillOptions,
|
|
6373
7880
|
): ListBlockVolume;
|
|
7881
|
+
/**
|
|
7882
|
+
* @beta
|
|
7883
|
+
* @remarks
|
|
7884
|
+
* Finds the location of the closest biome of a particular
|
|
7885
|
+
* type. Note that the findClosestBiome operation can take some
|
|
7886
|
+
* time to complete, so avoid using many of these calls within
|
|
7887
|
+
* a particular tick.
|
|
7888
|
+
*
|
|
7889
|
+
* @param pos
|
|
7890
|
+
* Starting location to look for a biome to find.
|
|
7891
|
+
* @param biomeToFind
|
|
7892
|
+
* Identifier of the biome to look for.
|
|
7893
|
+
* @param options
|
|
7894
|
+
* Additional selection criteria for a biome search.
|
|
7895
|
+
* @returns
|
|
7896
|
+
* Returns a location of the biome, or undefined if a biome
|
|
7897
|
+
* could not be found.
|
|
7898
|
+
* @throws This function can throw errors.
|
|
7899
|
+
*
|
|
7900
|
+
* {@link minecraftcommon.EngineError}
|
|
7901
|
+
*
|
|
7902
|
+
* {@link Error}
|
|
7903
|
+
*/
|
|
7904
|
+
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
6374
7905
|
/**
|
|
6375
7906
|
* @remarks
|
|
6376
7907
|
* Returns the biome type at the specified location.
|
|
@@ -6590,6 +8121,26 @@ export class Dimension {
|
|
|
6590
8121
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6591
8122
|
*/
|
|
6592
8123
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
8124
|
+
/**
|
|
8125
|
+
* @beta
|
|
8126
|
+
* @remarks
|
|
8127
|
+
* Returns a vector of generated structures that contain the
|
|
8128
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
8129
|
+
* The vector will be empty if no structures are found.
|
|
8130
|
+
*
|
|
8131
|
+
* @param location
|
|
8132
|
+
* Location at which to check for structures.
|
|
8133
|
+
* @throws
|
|
8134
|
+
* An error will be thrown if the location is out of world
|
|
8135
|
+
* bounds.
|
|
8136
|
+
* An error will be thrown if the location is in an unloaded
|
|
8137
|
+
* chunk.
|
|
8138
|
+
*
|
|
8139
|
+
* {@link LocationInUnloadedChunkError}
|
|
8140
|
+
*
|
|
8141
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
8142
|
+
*/
|
|
8143
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
6593
8144
|
/**
|
|
6594
8145
|
* @remarks
|
|
6595
8146
|
* Returns the total brightness level of light shining on a
|
|
@@ -6651,6 +8202,16 @@ export class Dimension {
|
|
|
6651
8202
|
* @throws This function can throw errors.
|
|
6652
8203
|
*/
|
|
6653
8204
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
8205
|
+
/**
|
|
8206
|
+
* @beta
|
|
8207
|
+
* @remarks
|
|
8208
|
+
* Returns the current weather.
|
|
8209
|
+
*
|
|
8210
|
+
* @returns
|
|
8211
|
+
* Returns a WeatherType that explains the broad category of
|
|
8212
|
+
* weather that is currently going on.
|
|
8213
|
+
*/
|
|
8214
|
+
getWeather(): WeatherType;
|
|
6654
8215
|
/**
|
|
6655
8216
|
* @remarks
|
|
6656
8217
|
* Returns true if the chunk at the given location is loaded
|
|
@@ -6893,7 +8454,11 @@ export class Dimension {
|
|
|
6893
8454
|
* }
|
|
6894
8455
|
* ```
|
|
6895
8456
|
*/
|
|
6896
|
-
spawnEntity
|
|
8457
|
+
spawnEntity<T = never>(
|
|
8458
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
8459
|
+
location: Vector3,
|
|
8460
|
+
options?: SpawnEntityOptions,
|
|
8461
|
+
): Entity;
|
|
6897
8462
|
/**
|
|
6898
8463
|
* @remarks
|
|
6899
8464
|
* Creates a new item stack as an entity at the specified
|
|
@@ -6988,6 +8553,26 @@ export class Dimension {
|
|
|
6988
8553
|
* ```
|
|
6989
8554
|
*/
|
|
6990
8555
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
8556
|
+
/**
|
|
8557
|
+
* @beta
|
|
8558
|
+
* @remarks
|
|
8559
|
+
* Stops all sounds from playing for all players.
|
|
8560
|
+
*
|
|
8561
|
+
* This function can't be called in read-only mode.
|
|
8562
|
+
*
|
|
8563
|
+
*/
|
|
8564
|
+
stopAllSounds(): void;
|
|
8565
|
+
/**
|
|
8566
|
+
* @beta
|
|
8567
|
+
* @remarks
|
|
8568
|
+
* Stops a sound from playing for all players.
|
|
8569
|
+
*
|
|
8570
|
+
* This function can't be called in read-only mode.
|
|
8571
|
+
*
|
|
8572
|
+
* @param soundId
|
|
8573
|
+
* Identifier of the sound.
|
|
8574
|
+
*/
|
|
8575
|
+
stopSound(soundId: string): void;
|
|
6991
8576
|
}
|
|
6992
8577
|
|
|
6993
8578
|
/**
|
|
@@ -7513,6 +9098,18 @@ export class Entity {
|
|
|
7513
9098
|
*
|
|
7514
9099
|
*/
|
|
7515
9100
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
9101
|
+
/**
|
|
9102
|
+
* @beta
|
|
9103
|
+
* @remarks
|
|
9104
|
+
* Retrieves or sets an entity that is used as the target of
|
|
9105
|
+
* AI-related behaviors, like attacking. If the entity
|
|
9106
|
+
* currently has no target returns undefined.
|
|
9107
|
+
*
|
|
9108
|
+
* @throws This property can throw when used.
|
|
9109
|
+
*
|
|
9110
|
+
* {@link InvalidEntityError}
|
|
9111
|
+
*/
|
|
9112
|
+
readonly target?: Entity;
|
|
7516
9113
|
/**
|
|
7517
9114
|
* @remarks
|
|
7518
9115
|
* Identifier of the type of the entity - for example,
|
|
@@ -8746,6 +10343,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
8746
10343
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
8747
10344
|
export class EntityBreathableComponent extends EntityComponent {
|
|
8748
10345
|
private constructor();
|
|
10346
|
+
/**
|
|
10347
|
+
* @beta
|
|
10348
|
+
* @remarks
|
|
10349
|
+
* The current air supply of the entity.
|
|
10350
|
+
*
|
|
10351
|
+
* This property can't be edited in read-only mode.
|
|
10352
|
+
*
|
|
10353
|
+
* @throws
|
|
10354
|
+
* Will throw an error if the air supply is out of bounds
|
|
10355
|
+
* [suffocationTime, maxAirSupply].
|
|
10356
|
+
*/
|
|
10357
|
+
airSupply: number;
|
|
8749
10358
|
/**
|
|
8750
10359
|
* @remarks
|
|
8751
10360
|
* If true, this entity can breathe in air.
|
|
@@ -8774,6 +10383,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
8774
10383
|
* @throws This property can throw when used.
|
|
8775
10384
|
*/
|
|
8776
10385
|
readonly breathesWater: boolean;
|
|
10386
|
+
/**
|
|
10387
|
+
* @beta
|
|
10388
|
+
* @remarks
|
|
10389
|
+
* If true, the entity is able to breathe.
|
|
10390
|
+
*
|
|
10391
|
+
* @throws This property can throw when used.
|
|
10392
|
+
*/
|
|
10393
|
+
readonly canBreathe: boolean;
|
|
8777
10394
|
/**
|
|
8778
10395
|
* @remarks
|
|
8779
10396
|
* If true, this entity will have visible bubbles while in
|
|
@@ -8929,6 +10546,10 @@ export class EntityDefinitionFeedItem {
|
|
|
8929
10546
|
*
|
|
8930
10547
|
*/
|
|
8931
10548
|
readonly item: string;
|
|
10549
|
+
/**
|
|
10550
|
+
* @beta
|
|
10551
|
+
*/
|
|
10552
|
+
readonly resultItem: string;
|
|
8932
10553
|
}
|
|
8933
10554
|
|
|
8934
10555
|
/**
|
|
@@ -9194,6 +10815,144 @@ export class EntityHealableComponent extends EntityComponent {
|
|
|
9194
10815
|
getFeedItems(): FeedItem[];
|
|
9195
10816
|
}
|
|
9196
10817
|
|
|
10818
|
+
/**
|
|
10819
|
+
* @beta
|
|
10820
|
+
* Contains information related to an entity having been
|
|
10821
|
+
* healed.
|
|
10822
|
+
*/
|
|
10823
|
+
export class EntityHealAfterEvent {
|
|
10824
|
+
private constructor();
|
|
10825
|
+
/**
|
|
10826
|
+
* @remarks
|
|
10827
|
+
* Entity that was healed.
|
|
10828
|
+
*
|
|
10829
|
+
*/
|
|
10830
|
+
readonly healedEntity: Entity;
|
|
10831
|
+
/**
|
|
10832
|
+
* @remarks
|
|
10833
|
+
* Describes the amount of healing.
|
|
10834
|
+
*
|
|
10835
|
+
*/
|
|
10836
|
+
readonly healing: number;
|
|
10837
|
+
/**
|
|
10838
|
+
* @remarks
|
|
10839
|
+
* Information on the source of healing.
|
|
10840
|
+
*
|
|
10841
|
+
*/
|
|
10842
|
+
readonly healSource: EntityHealSource;
|
|
10843
|
+
}
|
|
10844
|
+
|
|
10845
|
+
/**
|
|
10846
|
+
* @beta
|
|
10847
|
+
* Manages callbacks that are connected to when an entity is
|
|
10848
|
+
* healed.
|
|
10849
|
+
*/
|
|
10850
|
+
export class EntityHealAfterEventSignal {
|
|
10851
|
+
private constructor();
|
|
10852
|
+
/**
|
|
10853
|
+
* @remarks
|
|
10854
|
+
* Adds a callback that will be called when an entity is
|
|
10855
|
+
* healed.
|
|
10856
|
+
*
|
|
10857
|
+
* This function can't be called in read-only mode.
|
|
10858
|
+
*
|
|
10859
|
+
* This function can be called in early-execution mode.
|
|
10860
|
+
*
|
|
10861
|
+
*/
|
|
10862
|
+
subscribe(
|
|
10863
|
+
callback: (arg0: EntityHealAfterEvent) => void,
|
|
10864
|
+
options?: EntityHealEventOptions,
|
|
10865
|
+
): (arg0: EntityHealAfterEvent) => void;
|
|
10866
|
+
/**
|
|
10867
|
+
* @remarks
|
|
10868
|
+
* Removes a callback from being called when an entity is
|
|
10869
|
+
* healed.
|
|
10870
|
+
*
|
|
10871
|
+
* This function can't be called in read-only mode.
|
|
10872
|
+
*
|
|
10873
|
+
* This function can be called in early-execution mode.
|
|
10874
|
+
*
|
|
10875
|
+
*/
|
|
10876
|
+
unsubscribe(callback: (arg0: EntityHealAfterEvent) => void): void;
|
|
10877
|
+
}
|
|
10878
|
+
|
|
10879
|
+
/**
|
|
10880
|
+
* @beta
|
|
10881
|
+
* Contains information related to an entity that will be
|
|
10882
|
+
* healed.
|
|
10883
|
+
*/
|
|
10884
|
+
export class EntityHealBeforeEvent {
|
|
10885
|
+
private constructor();
|
|
10886
|
+
cancel: boolean;
|
|
10887
|
+
/**
|
|
10888
|
+
* @remarks
|
|
10889
|
+
* Entity that will be healed.
|
|
10890
|
+
*
|
|
10891
|
+
*/
|
|
10892
|
+
readonly healedEntity: Entity;
|
|
10893
|
+
/**
|
|
10894
|
+
* @remarks
|
|
10895
|
+
* Describes the amount of healing.
|
|
10896
|
+
*
|
|
10897
|
+
*/
|
|
10898
|
+
healing: number;
|
|
10899
|
+
/**
|
|
10900
|
+
* @remarks
|
|
10901
|
+
* Information on the source of healing.
|
|
10902
|
+
*
|
|
10903
|
+
*/
|
|
10904
|
+
readonly healSource: EntityHealSource;
|
|
10905
|
+
}
|
|
10906
|
+
|
|
10907
|
+
/**
|
|
10908
|
+
* @beta
|
|
10909
|
+
* Manages callbacks that are connected to when an entity will
|
|
10910
|
+
* be healed.
|
|
10911
|
+
*/
|
|
10912
|
+
export class EntityHealBeforeEventSignal {
|
|
10913
|
+
private constructor();
|
|
10914
|
+
/**
|
|
10915
|
+
* @remarks
|
|
10916
|
+
* Adds a callback that will be called when an entity will be
|
|
10917
|
+
* healed.
|
|
10918
|
+
*
|
|
10919
|
+
* This function can't be called in read-only mode.
|
|
10920
|
+
*
|
|
10921
|
+
* This function can be called in early-execution mode.
|
|
10922
|
+
*
|
|
10923
|
+
*/
|
|
10924
|
+
subscribe(
|
|
10925
|
+
callback: (arg0: EntityHealBeforeEvent) => void,
|
|
10926
|
+
options?: EntityHealEventOptions,
|
|
10927
|
+
): (arg0: EntityHealBeforeEvent) => void;
|
|
10928
|
+
/**
|
|
10929
|
+
* @remarks
|
|
10930
|
+
* Removes a callback from being called when an entity will be
|
|
10931
|
+
* healed.
|
|
10932
|
+
*
|
|
10933
|
+
* This function can't be called in read-only mode.
|
|
10934
|
+
*
|
|
10935
|
+
* This function can be called in early-execution mode.
|
|
10936
|
+
*
|
|
10937
|
+
*/
|
|
10938
|
+
unsubscribe(callback: (arg0: EntityHealBeforeEvent) => void): void;
|
|
10939
|
+
}
|
|
10940
|
+
|
|
10941
|
+
/**
|
|
10942
|
+
* @beta
|
|
10943
|
+
* Provides information about how healing has been applied to
|
|
10944
|
+
* an entity.
|
|
10945
|
+
*/
|
|
10946
|
+
export class EntityHealSource {
|
|
10947
|
+
private constructor();
|
|
10948
|
+
/**
|
|
10949
|
+
* @remarks
|
|
10950
|
+
* Cause enumerator of the source of healing.
|
|
10951
|
+
*
|
|
10952
|
+
*/
|
|
10953
|
+
readonly cause: EntityHealCause;
|
|
10954
|
+
}
|
|
10955
|
+
|
|
9197
10956
|
/**
|
|
9198
10957
|
* Contains information related to an entity when its health
|
|
9199
10958
|
* changes. Warning: don't change the health of an entity in
|
|
@@ -9454,7 +11213,7 @@ export class EntityHurtAfterEventSignal {
|
|
|
9454
11213
|
*/
|
|
9455
11214
|
subscribe(
|
|
9456
11215
|
callback: (arg0: EntityHurtAfterEvent) => void,
|
|
9457
|
-
options?:
|
|
11216
|
+
options?: EntityHurtAfterEventOptions,
|
|
9458
11217
|
): (arg0: EntityHurtAfterEvent) => void;
|
|
9459
11218
|
/**
|
|
9460
11219
|
* @remarks
|
|
@@ -9468,6 +11227,68 @@ export class EntityHurtAfterEventSignal {
|
|
|
9468
11227
|
unsubscribe(callback: (arg0: EntityHurtAfterEvent) => void): void;
|
|
9469
11228
|
}
|
|
9470
11229
|
|
|
11230
|
+
/**
|
|
11231
|
+
* @beta
|
|
11232
|
+
* Contains information related to an entity that will be hurt.
|
|
11233
|
+
*/
|
|
11234
|
+
export class EntityHurtBeforeEvent {
|
|
11235
|
+
private constructor();
|
|
11236
|
+
cancel: boolean;
|
|
11237
|
+
/**
|
|
11238
|
+
* @remarks
|
|
11239
|
+
* Describes the amount of damage that will be caused.
|
|
11240
|
+
*
|
|
11241
|
+
*/
|
|
11242
|
+
damage: number;
|
|
11243
|
+
/**
|
|
11244
|
+
* @remarks
|
|
11245
|
+
* Source information on the entity that may have applied this
|
|
11246
|
+
* damage.
|
|
11247
|
+
*
|
|
11248
|
+
*/
|
|
11249
|
+
readonly damageSource: EntityDamageSource;
|
|
11250
|
+
/**
|
|
11251
|
+
* @remarks
|
|
11252
|
+
* Entity that will be hurt.
|
|
11253
|
+
*
|
|
11254
|
+
*/
|
|
11255
|
+
readonly hurtEntity: Entity;
|
|
11256
|
+
}
|
|
11257
|
+
|
|
11258
|
+
/**
|
|
11259
|
+
* @beta
|
|
11260
|
+
* Manages callbacks that are connected to when an entity will
|
|
11261
|
+
* be hurt.
|
|
11262
|
+
*/
|
|
11263
|
+
export class EntityHurtBeforeEventSignal {
|
|
11264
|
+
private constructor();
|
|
11265
|
+
/**
|
|
11266
|
+
* @remarks
|
|
11267
|
+
* Adds a callback that will be called when an entity will be
|
|
11268
|
+
* hurt.
|
|
11269
|
+
*
|
|
11270
|
+
* This function can't be called in read-only mode.
|
|
11271
|
+
*
|
|
11272
|
+
* This function can be called in early-execution mode.
|
|
11273
|
+
*
|
|
11274
|
+
*/
|
|
11275
|
+
subscribe(
|
|
11276
|
+
callback: (arg0: EntityHurtBeforeEvent) => void,
|
|
11277
|
+
options?: EntityHurtBeforeEventOptions,
|
|
11278
|
+
): (arg0: EntityHurtBeforeEvent) => void;
|
|
11279
|
+
/**
|
|
11280
|
+
* @remarks
|
|
11281
|
+
* Removes a callback from being called when an entity will be
|
|
11282
|
+
* hurt.
|
|
11283
|
+
*
|
|
11284
|
+
* This function can't be called in read-only mode.
|
|
11285
|
+
*
|
|
11286
|
+
* This function can be called in early-execution mode.
|
|
11287
|
+
*
|
|
11288
|
+
*/
|
|
11289
|
+
unsubscribe(callback: (arg0: EntityHurtBeforeEvent) => void): void;
|
|
11290
|
+
}
|
|
11291
|
+
|
|
9471
11292
|
/**
|
|
9472
11293
|
* Defines this entity's inventory properties.
|
|
9473
11294
|
*/
|
|
@@ -10227,6 +12048,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
10227
12048
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
10228
12049
|
}
|
|
10229
12050
|
|
|
12051
|
+
/**
|
|
12052
|
+
* @beta
|
|
12053
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
12054
|
+
* name, and dialogue interactions.
|
|
12055
|
+
*/
|
|
12056
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12057
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
12058
|
+
private constructor();
|
|
12059
|
+
/**
|
|
12060
|
+
* @remarks
|
|
12061
|
+
* The DialogueScene that is opened when players first interact
|
|
12062
|
+
* with the NPC.
|
|
12063
|
+
*
|
|
12064
|
+
* This property can't be edited in read-only mode.
|
|
12065
|
+
*
|
|
12066
|
+
*/
|
|
12067
|
+
defaultScene: string;
|
|
12068
|
+
/**
|
|
12069
|
+
* @remarks
|
|
12070
|
+
* The name of the NPC as it is displayed to players.
|
|
12071
|
+
*
|
|
12072
|
+
* This property can't be edited in read-only mode.
|
|
12073
|
+
*
|
|
12074
|
+
*/
|
|
12075
|
+
name: string;
|
|
12076
|
+
/**
|
|
12077
|
+
* @remarks
|
|
12078
|
+
* The index of the skin the NPC will use.
|
|
12079
|
+
*
|
|
12080
|
+
* This property can't be edited in read-only mode.
|
|
12081
|
+
*
|
|
12082
|
+
*/
|
|
12083
|
+
skinIndex: number;
|
|
12084
|
+
static readonly componentId = 'minecraft:npc';
|
|
12085
|
+
}
|
|
12086
|
+
|
|
10230
12087
|
/**
|
|
10231
12088
|
* When present on an entity, this entity is on fire.
|
|
10232
12089
|
* @example setOnFire.ts
|
|
@@ -11066,6 +12923,14 @@ export class EntityType {
|
|
|
11066
12923
|
*
|
|
11067
12924
|
*/
|
|
11068
12925
|
readonly id: string;
|
|
12926
|
+
/**
|
|
12927
|
+
* @beta
|
|
12928
|
+
* @remarks
|
|
12929
|
+
* Key for the localization of this EntityType's name used in
|
|
12930
|
+
* .lang files.
|
|
12931
|
+
*
|
|
12932
|
+
*/
|
|
12933
|
+
readonly localizationKey: string;
|
|
11069
12934
|
}
|
|
11070
12935
|
|
|
11071
12936
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
@@ -11093,7 +12958,7 @@ export class EntityTypes {
|
|
|
11093
12958
|
* Retrieves an entity type using a string-based identifier.
|
|
11094
12959
|
*
|
|
11095
12960
|
*/
|
|
11096
|
-
static get(identifier:
|
|
12961
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
11097
12962
|
/**
|
|
11098
12963
|
* @remarks
|
|
11099
12964
|
* Retrieves a set of all entity types within this world.
|
|
@@ -11299,6 +13164,10 @@ export class FeedItem {
|
|
|
11299
13164
|
*
|
|
11300
13165
|
*/
|
|
11301
13166
|
readonly item: string;
|
|
13167
|
+
/**
|
|
13168
|
+
* @beta
|
|
13169
|
+
*/
|
|
13170
|
+
readonly resultItem: string;
|
|
11302
13171
|
/**
|
|
11303
13172
|
* @remarks
|
|
11304
13173
|
* As part of the Healable component, an optional collection of
|
|
@@ -11547,6 +13416,13 @@ export class GameRules {
|
|
|
11547
13416
|
*
|
|
11548
13417
|
*/
|
|
11549
13418
|
keepInventory: boolean;
|
|
13419
|
+
/**
|
|
13420
|
+
* @beta
|
|
13421
|
+
* @remarks
|
|
13422
|
+
* This property can't be edited in read-only mode.
|
|
13423
|
+
*
|
|
13424
|
+
*/
|
|
13425
|
+
locatorBar: boolean;
|
|
11550
13426
|
/**
|
|
11551
13427
|
* @remarks
|
|
11552
13428
|
* This property can't be edited in read-only mode.
|
|
@@ -12348,6 +14224,17 @@ export class ItemDurabilityComponent extends ItemComponent {
|
|
|
12348
14224
|
* @throws This property can throw when used.
|
|
12349
14225
|
*/
|
|
12350
14226
|
readonly maxDurability: number;
|
|
14227
|
+
/**
|
|
14228
|
+
* @beta
|
|
14229
|
+
* @remarks
|
|
14230
|
+
* Whether an item breaks or loses durability. Setting to true
|
|
14231
|
+
* temporarily removes item's durabilty HUD, and freezes
|
|
14232
|
+
* durability loss on item.
|
|
14233
|
+
*
|
|
14234
|
+
* This property can't be edited in read-only mode.
|
|
14235
|
+
*
|
|
14236
|
+
*/
|
|
14237
|
+
unbreakable: boolean;
|
|
12351
14238
|
static readonly componentId = 'minecraft:durability';
|
|
12352
14239
|
/**
|
|
12353
14240
|
* @remarks
|
|
@@ -13500,6 +15387,14 @@ export class ItemType {
|
|
|
13500
15387
|
*
|
|
13501
15388
|
*/
|
|
13502
15389
|
readonly id: string;
|
|
15390
|
+
/**
|
|
15391
|
+
* @beta
|
|
15392
|
+
* @remarks
|
|
15393
|
+
* Key for the localization of this ItemType's name used in
|
|
15394
|
+
* .lang files.
|
|
15395
|
+
*
|
|
15396
|
+
*/
|
|
15397
|
+
readonly localizationKey: string;
|
|
13503
15398
|
}
|
|
13504
15399
|
|
|
13505
15400
|
/**
|
|
@@ -13800,6 +15695,21 @@ export class LeverActionAfterEventSignal {
|
|
|
13800
15695
|
unsubscribe(callback: (arg0: LeverActionAfterEvent) => void): void;
|
|
13801
15696
|
}
|
|
13802
15697
|
|
|
15698
|
+
/**
|
|
15699
|
+
* @beta
|
|
15700
|
+
* A spline that linearly interpolates between points.
|
|
15701
|
+
*/
|
|
15702
|
+
export class LinearSpline {
|
|
15703
|
+
/**
|
|
15704
|
+
* @remarks
|
|
15705
|
+
* Control points for the Linear spline.
|
|
15706
|
+
*
|
|
15707
|
+
* This property can't be edited in read-only mode.
|
|
15708
|
+
*
|
|
15709
|
+
*/
|
|
15710
|
+
controlPoints: Vector3[];
|
|
15711
|
+
}
|
|
15712
|
+
|
|
13803
15713
|
/**
|
|
13804
15714
|
* Volume composed of an unordered container of unique block
|
|
13805
15715
|
* locations.
|
|
@@ -14224,6 +16134,33 @@ export class MatchToolCondition extends LootItemCondition {
|
|
|
14224
16134
|
readonly itemTagsNone: string[];
|
|
14225
16135
|
}
|
|
14226
16136
|
|
|
16137
|
+
/**
|
|
16138
|
+
* @beta
|
|
16139
|
+
* A specific currently-internal event used for passing
|
|
16140
|
+
* messages from client to server.
|
|
16141
|
+
*/
|
|
16142
|
+
export class MessageReceiveAfterEvent {
|
|
16143
|
+
private constructor();
|
|
16144
|
+
/**
|
|
16145
|
+
* @remarks
|
|
16146
|
+
* The message identifier.
|
|
16147
|
+
*
|
|
16148
|
+
*/
|
|
16149
|
+
readonly id: string;
|
|
16150
|
+
/**
|
|
16151
|
+
* @remarks
|
|
16152
|
+
* The message.
|
|
16153
|
+
*
|
|
16154
|
+
*/
|
|
16155
|
+
readonly message: string;
|
|
16156
|
+
/**
|
|
16157
|
+
* @remarks
|
|
16158
|
+
* The player who sent the message.
|
|
16159
|
+
*
|
|
16160
|
+
*/
|
|
16161
|
+
readonly player: Player;
|
|
16162
|
+
}
|
|
16163
|
+
|
|
14227
16164
|
/**
|
|
14228
16165
|
* Contains a set of additional variable values for further
|
|
14229
16166
|
* defining how rendering and animations function.
|
|
@@ -14292,6 +16229,49 @@ export class MolangVariableMap {
|
|
|
14292
16229
|
setVector3(variableName: string, vector: Vector3): void;
|
|
14293
16230
|
}
|
|
14294
16231
|
|
|
16232
|
+
/**
|
|
16233
|
+
* @beta
|
|
16234
|
+
* Pack setting name and value that changed.
|
|
16235
|
+
*/
|
|
16236
|
+
export class PackSettingChangeAfterEvent {
|
|
16237
|
+
private constructor();
|
|
16238
|
+
/**
|
|
16239
|
+
* @remarks
|
|
16240
|
+
* The name of the setting.
|
|
16241
|
+
*
|
|
16242
|
+
*/
|
|
16243
|
+
readonly settingName: string;
|
|
16244
|
+
/**
|
|
16245
|
+
* @remarks
|
|
16246
|
+
* The value of the setting.
|
|
16247
|
+
*
|
|
16248
|
+
*/
|
|
16249
|
+
readonly settingValue: boolean | number | string;
|
|
16250
|
+
}
|
|
16251
|
+
|
|
16252
|
+
/**
|
|
16253
|
+
* @beta
|
|
16254
|
+
*/
|
|
16255
|
+
export class PackSettingChangeAfterEventSignal {
|
|
16256
|
+
private constructor();
|
|
16257
|
+
/**
|
|
16258
|
+
* @remarks
|
|
16259
|
+
* This function can't be called in read-only mode.
|
|
16260
|
+
*
|
|
16261
|
+
* This function can be called in early-execution mode.
|
|
16262
|
+
*
|
|
16263
|
+
*/
|
|
16264
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
16265
|
+
/**
|
|
16266
|
+
* @remarks
|
|
16267
|
+
* This function can't be called in read-only mode.
|
|
16268
|
+
*
|
|
16269
|
+
* This function can be called in early-execution mode.
|
|
16270
|
+
*
|
|
16271
|
+
*/
|
|
16272
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
16273
|
+
}
|
|
16274
|
+
|
|
14295
16275
|
/**
|
|
14296
16276
|
* @rc
|
|
14297
16277
|
* Loot item condition that checks whether the looting entity
|
|
@@ -14606,6 +16586,27 @@ export class Player extends Entity {
|
|
|
14606
16586
|
* Throws if the Entity or Entity ID is invalid.
|
|
14607
16587
|
*/
|
|
14608
16588
|
clearPropertyOverridesForEntity(targetEntity: Entity | string): void;
|
|
16589
|
+
/**
|
|
16590
|
+
* @beta
|
|
16591
|
+
* @remarks
|
|
16592
|
+
* Eats an item, providing the item's hunger and saturation
|
|
16593
|
+
* effects to the player. Can only be used on food items.
|
|
16594
|
+
*
|
|
16595
|
+
* This function can't be called in read-only mode.
|
|
16596
|
+
*
|
|
16597
|
+
* @param itemStack
|
|
16598
|
+
* The item to eat.
|
|
16599
|
+
* @throws
|
|
16600
|
+
* Throws if the item is not a food item.
|
|
16601
|
+
*/
|
|
16602
|
+
eatItem(itemStack: ItemStack): void;
|
|
16603
|
+
/**
|
|
16604
|
+
* @beta
|
|
16605
|
+
* @remarks
|
|
16606
|
+
* The player's aim-assist settings.
|
|
16607
|
+
*
|
|
16608
|
+
*/
|
|
16609
|
+
getAimAssist(): PlayerAimAssist;
|
|
14609
16610
|
/**
|
|
14610
16611
|
* @rc
|
|
14611
16612
|
* @remarks
|
|
@@ -14701,6 +16702,17 @@ export class Player extends Entity {
|
|
|
14701
16702
|
* ```
|
|
14702
16703
|
*/
|
|
14703
16704
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
|
|
16705
|
+
/**
|
|
16706
|
+
* @beta
|
|
16707
|
+
* @remarks
|
|
16708
|
+
* This is an internal-facing method for posting a system
|
|
16709
|
+
* message to downstream clients.
|
|
16710
|
+
*
|
|
16711
|
+
* This function can't be called in read-only mode.
|
|
16712
|
+
*
|
|
16713
|
+
* @throws This function can throw errors.
|
|
16714
|
+
*/
|
|
16715
|
+
postClientMessage(id: string, value: string): void;
|
|
14704
16716
|
/**
|
|
14705
16717
|
* @remarks
|
|
14706
16718
|
* Queues an additional music track that only this particular
|
|
@@ -14978,6 +16990,18 @@ export class Player extends Entity {
|
|
|
14978
16990
|
* @throws This function can throw errors.
|
|
14979
16991
|
*/
|
|
14980
16992
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
16993
|
+
/**
|
|
16994
|
+
* @beta
|
|
16995
|
+
* @remarks
|
|
16996
|
+
* Stops all sounds from playing for this particular player.
|
|
16997
|
+
*
|
|
16998
|
+
* This function can't be called in read-only mode.
|
|
16999
|
+
*
|
|
17000
|
+
* @throws This function can throw errors.
|
|
17001
|
+
*
|
|
17002
|
+
* {@link InvalidEntityError}
|
|
17003
|
+
*/
|
|
17004
|
+
stopAllSounds(): void;
|
|
14981
17005
|
/**
|
|
14982
17006
|
* @remarks
|
|
14983
17007
|
* Stops any music tracks from playing for this particular
|
|
@@ -14988,6 +17012,59 @@ export class Player extends Entity {
|
|
|
14988
17012
|
* @throws This function can throw errors.
|
|
14989
17013
|
*/
|
|
14990
17014
|
stopMusic(): void;
|
|
17015
|
+
/**
|
|
17016
|
+
* @beta
|
|
17017
|
+
* @remarks
|
|
17018
|
+
* Stops a sound from playing for this particular player.
|
|
17019
|
+
*
|
|
17020
|
+
* This function can't be called in read-only mode.
|
|
17021
|
+
*
|
|
17022
|
+
* @param soundId
|
|
17023
|
+
* Identifier of the sound.
|
|
17024
|
+
* @throws This function can throw errors.
|
|
17025
|
+
*
|
|
17026
|
+
* {@link InvalidEntityError}
|
|
17027
|
+
*/
|
|
17028
|
+
stopSound(soundId: string): void;
|
|
17029
|
+
}
|
|
17030
|
+
|
|
17031
|
+
/**
|
|
17032
|
+
* @beta
|
|
17033
|
+
* A container for APIs related to player aim-assist.
|
|
17034
|
+
*/
|
|
17035
|
+
export class PlayerAimAssist {
|
|
17036
|
+
private constructor();
|
|
17037
|
+
/**
|
|
17038
|
+
* @remarks
|
|
17039
|
+
* The player's currently active aim-assist settings, or
|
|
17040
|
+
* undefined if not active.
|
|
17041
|
+
*
|
|
17042
|
+
*/
|
|
17043
|
+
readonly settings?: PlayerAimAssistSettings;
|
|
17044
|
+
/**
|
|
17045
|
+
* @remarks
|
|
17046
|
+
* Sets the player's aim-assist settings.
|
|
17047
|
+
*
|
|
17048
|
+
* This function can't be called in read-only mode.
|
|
17049
|
+
*
|
|
17050
|
+
* @param settings
|
|
17051
|
+
* Aim-assist settings to activate for the player, if undefined
|
|
17052
|
+
* aim-assist will be disabled.
|
|
17053
|
+
* @throws This function can throw errors.
|
|
17054
|
+
*
|
|
17055
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
17056
|
+
*
|
|
17057
|
+
* {@link minecraftcommon.EngineError}
|
|
17058
|
+
*
|
|
17059
|
+
* {@link Error}
|
|
17060
|
+
*
|
|
17061
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
17062
|
+
*
|
|
17063
|
+
* {@link InvalidEntityError}
|
|
17064
|
+
*
|
|
17065
|
+
* {@link NamespaceNameError}
|
|
17066
|
+
*/
|
|
17067
|
+
set(settings?: PlayerAimAssistSettings): void;
|
|
14991
17068
|
}
|
|
14992
17069
|
|
|
14993
17070
|
/**
|
|
@@ -16204,6 +18281,82 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
16204
18281
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
16205
18282
|
}
|
|
16206
18283
|
|
|
18284
|
+
/**
|
|
18285
|
+
* @beta
|
|
18286
|
+
* Contains information regarding an event before a player
|
|
18287
|
+
* places a block.
|
|
18288
|
+
*/
|
|
18289
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18290
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
18291
|
+
private constructor();
|
|
18292
|
+
/**
|
|
18293
|
+
* @remarks
|
|
18294
|
+
* If set to true, cancels the block place event.
|
|
18295
|
+
*
|
|
18296
|
+
*/
|
|
18297
|
+
cancel: boolean;
|
|
18298
|
+
/**
|
|
18299
|
+
* @remarks
|
|
18300
|
+
* The face of the block that the new block is being placed on.
|
|
18301
|
+
*
|
|
18302
|
+
*/
|
|
18303
|
+
readonly face: Direction;
|
|
18304
|
+
/**
|
|
18305
|
+
* @remarks
|
|
18306
|
+
* Location relative to the bottom north-west corner of the
|
|
18307
|
+
* block where the new block is being placed onto.
|
|
18308
|
+
*
|
|
18309
|
+
*/
|
|
18310
|
+
readonly faceLocation: Vector3;
|
|
18311
|
+
/**
|
|
18312
|
+
* @remarks
|
|
18313
|
+
* The block permutation that will be placed if the event is
|
|
18314
|
+
* not cancelled.
|
|
18315
|
+
*
|
|
18316
|
+
*/
|
|
18317
|
+
readonly permutationToPlace: BlockPermutation;
|
|
18318
|
+
/**
|
|
18319
|
+
* @remarks
|
|
18320
|
+
* Player that is placing the block for this event.
|
|
18321
|
+
*
|
|
18322
|
+
*/
|
|
18323
|
+
readonly player: Player;
|
|
18324
|
+
}
|
|
18325
|
+
|
|
18326
|
+
/**
|
|
18327
|
+
* @beta
|
|
18328
|
+
* Manages callbacks that are connected to before a block is
|
|
18329
|
+
* placed by a player.
|
|
18330
|
+
*/
|
|
18331
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
18332
|
+
private constructor();
|
|
18333
|
+
/**
|
|
18334
|
+
* @remarks
|
|
18335
|
+
* Adds a callback that will be called before a block is placed
|
|
18336
|
+
* by a player.
|
|
18337
|
+
*
|
|
18338
|
+
* This function can't be called in read-only mode.
|
|
18339
|
+
*
|
|
18340
|
+
* This function can be called in early-execution mode.
|
|
18341
|
+
*
|
|
18342
|
+
*/
|
|
18343
|
+
subscribe(
|
|
18344
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
18345
|
+
options?: BlockEventOptions,
|
|
18346
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
18347
|
+
/**
|
|
18348
|
+
* @remarks
|
|
18349
|
+
* Removes a callback from being called before an block is
|
|
18350
|
+
* placed by a player.
|
|
18351
|
+
*
|
|
18352
|
+
* This function can't be called in read-only mode.
|
|
18353
|
+
*
|
|
18354
|
+
* This function can be called in early-execution mode.
|
|
18355
|
+
*
|
|
18356
|
+
*/
|
|
18357
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
18358
|
+
}
|
|
18359
|
+
|
|
16207
18360
|
/**
|
|
16208
18361
|
* An event that contains more information about a player
|
|
16209
18362
|
* spawning.
|
|
@@ -16274,54 +18427,128 @@ export class PlayerSwingStartAfterEvent {
|
|
|
16274
18427
|
readonly heldItemStack?: ItemStack;
|
|
16275
18428
|
/**
|
|
16276
18429
|
* @remarks
|
|
16277
|
-
* Source Player for this event.
|
|
18430
|
+
* Source Player for this event.
|
|
18431
|
+
*
|
|
18432
|
+
*/
|
|
18433
|
+
readonly player: Player;
|
|
18434
|
+
/**
|
|
18435
|
+
* @remarks
|
|
18436
|
+
* The source of the Player swing, see {@link
|
|
18437
|
+
* EntitySwingSource}.
|
|
18438
|
+
*
|
|
18439
|
+
*/
|
|
18440
|
+
readonly swingSource: EntitySwingSource;
|
|
18441
|
+
}
|
|
18442
|
+
|
|
18443
|
+
/**
|
|
18444
|
+
* @rc
|
|
18445
|
+
* Manages callbacks that are connected to when a player starts
|
|
18446
|
+
* to swing their arm (e.g. attacking, using an item,
|
|
18447
|
+
* interacting).
|
|
18448
|
+
*/
|
|
18449
|
+
export class PlayerSwingStartAfterEventSignal {
|
|
18450
|
+
private constructor();
|
|
18451
|
+
/**
|
|
18452
|
+
* @remarks
|
|
18453
|
+
* Adds a callback that will be called when a player starts to
|
|
18454
|
+
* swing their arm (e.g. attacking, using an item,
|
|
18455
|
+
* interacting).
|
|
18456
|
+
*
|
|
18457
|
+
* This function can't be called in read-only mode.
|
|
18458
|
+
*
|
|
18459
|
+
* This function can be called in early-execution mode.
|
|
18460
|
+
*
|
|
18461
|
+
*/
|
|
18462
|
+
subscribe(
|
|
18463
|
+
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
18464
|
+
options?: PlayerSwingEventOptions,
|
|
18465
|
+
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
18466
|
+
/**
|
|
18467
|
+
* @remarks
|
|
18468
|
+
* Removes a callback from being called when a player starts to
|
|
18469
|
+
* swing their arm (e.g. attacking, using an item,
|
|
18470
|
+
* interacting).
|
|
18471
|
+
*
|
|
18472
|
+
* This function can't be called in read-only mode.
|
|
18473
|
+
*
|
|
18474
|
+
* This function can be called in early-execution mode.
|
|
18475
|
+
*
|
|
18476
|
+
*/
|
|
18477
|
+
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
18478
|
+
}
|
|
18479
|
+
|
|
18480
|
+
/**
|
|
18481
|
+
* @beta
|
|
18482
|
+
* Contains information related to when a player successfully
|
|
18483
|
+
* names an Entity with a named Name Tag item.
|
|
18484
|
+
*/
|
|
18485
|
+
export class PlayerUseNameTagAfterEvent {
|
|
18486
|
+
private constructor();
|
|
18487
|
+
/**
|
|
18488
|
+
* @remarks
|
|
18489
|
+
* The entity that was named by the player.
|
|
18490
|
+
*
|
|
18491
|
+
* This property can't be edited in read-only mode.
|
|
18492
|
+
*
|
|
18493
|
+
*/
|
|
18494
|
+
entityNamed: Entity;
|
|
18495
|
+
/**
|
|
18496
|
+
* @remarks
|
|
18497
|
+
* The new name that the player has given to the entity.
|
|
18498
|
+
*
|
|
18499
|
+
* This property can't be edited in read-only mode.
|
|
18500
|
+
*
|
|
18501
|
+
*/
|
|
18502
|
+
newName: string;
|
|
18503
|
+
/**
|
|
18504
|
+
* @remarks
|
|
18505
|
+
* Handle to the player that used the name tag.
|
|
18506
|
+
*
|
|
18507
|
+
* This property can't be edited in read-only mode.
|
|
16278
18508
|
*
|
|
16279
18509
|
*/
|
|
16280
|
-
|
|
18510
|
+
player: Player;
|
|
16281
18511
|
/**
|
|
16282
18512
|
* @remarks
|
|
16283
|
-
* The
|
|
16284
|
-
*
|
|
18513
|
+
* The previous name of the entity before the player used the
|
|
18514
|
+
* name tag. This will be undefined if the entity was not
|
|
18515
|
+
* previously named.
|
|
18516
|
+
*
|
|
18517
|
+
* This property can't be edited in read-only mode.
|
|
16285
18518
|
*
|
|
16286
18519
|
*/
|
|
16287
|
-
|
|
18520
|
+
previousName?: string;
|
|
16288
18521
|
}
|
|
16289
18522
|
|
|
16290
18523
|
/**
|
|
16291
|
-
* @
|
|
16292
|
-
* Manages callbacks that are connected to when a player
|
|
16293
|
-
*
|
|
16294
|
-
* interacting).
|
|
18524
|
+
* @beta
|
|
18525
|
+
* Manages callbacks that are connected to when a player
|
|
18526
|
+
* successfully names an Entity with a named Name Tag item.
|
|
16295
18527
|
*/
|
|
16296
|
-
export class
|
|
18528
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
16297
18529
|
private constructor();
|
|
16298
18530
|
/**
|
|
16299
18531
|
* @remarks
|
|
16300
|
-
*
|
|
16301
|
-
*
|
|
16302
|
-
* interacting).
|
|
18532
|
+
* Subscribes the specified callback to a player use name tag
|
|
18533
|
+
* after event.
|
|
16303
18534
|
*
|
|
16304
18535
|
* This function can't be called in read-only mode.
|
|
16305
18536
|
*
|
|
16306
18537
|
* This function can be called in early-execution mode.
|
|
16307
18538
|
*
|
|
16308
18539
|
*/
|
|
16309
|
-
subscribe(
|
|
16310
|
-
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
16311
|
-
options?: PlayerSwingEventOptions,
|
|
16312
|
-
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
18540
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
16313
18541
|
/**
|
|
16314
18542
|
* @remarks
|
|
16315
|
-
* Removes
|
|
16316
|
-
*
|
|
16317
|
-
* interacting).
|
|
18543
|
+
* Removes the specified callback from a player use name tag
|
|
18544
|
+
* after event.
|
|
16318
18545
|
*
|
|
16319
18546
|
* This function can't be called in read-only mode.
|
|
16320
18547
|
*
|
|
16321
18548
|
* This function can be called in early-execution mode.
|
|
16322
18549
|
*
|
|
16323
18550
|
*/
|
|
16324
|
-
unsubscribe(callback: (arg0:
|
|
18551
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
16325
18552
|
}
|
|
16326
18553
|
|
|
16327
18554
|
/**
|
|
@@ -16409,10 +18636,10 @@ export class Potions {
|
|
|
16409
18636
|
*
|
|
16410
18637
|
* {@link InvalidPotionEffectTypeError}
|
|
16411
18638
|
*/
|
|
16412
|
-
static resolve
|
|
16413
|
-
|
|
16414
|
-
|
|
16415
|
-
): ItemStack;
|
|
18639
|
+
static resolve<
|
|
18640
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
18641
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
18642
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
16416
18643
|
}
|
|
16417
18644
|
|
|
16418
18645
|
/**
|
|
@@ -17487,6 +19714,38 @@ export class Seat {
|
|
|
17487
19714
|
readonly seatRotation: number;
|
|
17488
19715
|
}
|
|
17489
19716
|
|
|
19717
|
+
/**
|
|
19718
|
+
* @beta
|
|
19719
|
+
* Manages callbacks that are message passing to a server. This
|
|
19720
|
+
* event is not currently fully implemented, and should not be
|
|
19721
|
+
* used.
|
|
19722
|
+
*/
|
|
19723
|
+
export class ServerMessageAfterEventSignal {
|
|
19724
|
+
private constructor();
|
|
19725
|
+
/**
|
|
19726
|
+
* @remarks
|
|
19727
|
+
* Adds a callback that will be called when an internal message
|
|
19728
|
+
* is passed.
|
|
19729
|
+
*
|
|
19730
|
+
* This function can't be called in read-only mode.
|
|
19731
|
+
*
|
|
19732
|
+
* This function can be called in early-execution mode.
|
|
19733
|
+
*
|
|
19734
|
+
*/
|
|
19735
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
19736
|
+
/**
|
|
19737
|
+
* @remarks
|
|
19738
|
+
* Removes a callback from being called when an internal
|
|
19739
|
+
* message is passed.
|
|
19740
|
+
*
|
|
19741
|
+
* This function can't be called in read-only mode.
|
|
19742
|
+
*
|
|
19743
|
+
* This function can be called in early-execution mode.
|
|
19744
|
+
*
|
|
19745
|
+
*/
|
|
19746
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
19747
|
+
}
|
|
19748
|
+
|
|
17490
19749
|
/**
|
|
17491
19750
|
* @rc
|
|
17492
19751
|
* Loot item function that modifies the trim on a dropped armor
|
|
@@ -18451,6 +20710,19 @@ export class SystemBeforeEvents {
|
|
|
18451
20710
|
*
|
|
18452
20711
|
*/
|
|
18453
20712
|
readonly startup: StartupBeforeEventSignal;
|
|
20713
|
+
/**
|
|
20714
|
+
* @beta
|
|
20715
|
+
* @remarks
|
|
20716
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
20717
|
+
* can be due to using too much memory, or by causing
|
|
20718
|
+
* significant slowdown or hang.
|
|
20719
|
+
* To prevent shutdown, set the event's cancel property to
|
|
20720
|
+
* true.
|
|
20721
|
+
*
|
|
20722
|
+
* This property can be read in early-execution mode.
|
|
20723
|
+
*
|
|
20724
|
+
*/
|
|
20725
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
18454
20726
|
}
|
|
18455
20727
|
|
|
18456
20728
|
/**
|
|
@@ -18529,6 +20801,110 @@ export class TargetBlockHitAfterEventSignal {
|
|
|
18529
20801
|
unsubscribe(callback: (arg0: TargetBlockHitAfterEvent) => void): void;
|
|
18530
20802
|
}
|
|
18531
20803
|
|
|
20804
|
+
/**
|
|
20805
|
+
* @beta
|
|
20806
|
+
* This manager is used to add, remove or query temporary
|
|
20807
|
+
* ticking areas to a dimension. These ticking areas are
|
|
20808
|
+
* limited by a fixed amount of ticking chunks per pack
|
|
20809
|
+
* independent of the command limits. Cannot modify or query
|
|
20810
|
+
* ticking areas added by other packs or commands.
|
|
20811
|
+
*/
|
|
20812
|
+
export class TickingAreaManager {
|
|
20813
|
+
private constructor();
|
|
20814
|
+
/**
|
|
20815
|
+
* @remarks
|
|
20816
|
+
* The number of currently ticking chunks in this manager.
|
|
20817
|
+
*
|
|
20818
|
+
*/
|
|
20819
|
+
readonly chunkCount: number;
|
|
20820
|
+
/**
|
|
20821
|
+
* @remarks
|
|
20822
|
+
* The maximum number of allowed ticking chunks. Overlapping
|
|
20823
|
+
* ticking area chunks do count towards total.
|
|
20824
|
+
*
|
|
20825
|
+
*/
|
|
20826
|
+
readonly maxChunkCount: number;
|
|
20827
|
+
/**
|
|
20828
|
+
* @remarks
|
|
20829
|
+
* Creates a ticking area. Promise will return when all the
|
|
20830
|
+
* chunks in the area are loaded and ticking.
|
|
20831
|
+
*
|
|
20832
|
+
* This function can't be called in read-only mode.
|
|
20833
|
+
*
|
|
20834
|
+
* @throws This function can throw errors.
|
|
20835
|
+
*
|
|
20836
|
+
* {@link minecraftcommon.EngineError}
|
|
20837
|
+
*
|
|
20838
|
+
* {@link TickingAreaError}
|
|
20839
|
+
*/
|
|
20840
|
+
createTickingArea(identifier: string, options: TickingAreaOptions): Promise<TickingArea>;
|
|
20841
|
+
/**
|
|
20842
|
+
* @remarks
|
|
20843
|
+
* Gets all ticking areas added by this manager.
|
|
20844
|
+
*
|
|
20845
|
+
* This function can't be called in read-only mode.
|
|
20846
|
+
*
|
|
20847
|
+
* @throws This function can throw errors.
|
|
20848
|
+
*
|
|
20849
|
+
* {@link minecraftcommon.EngineError}
|
|
20850
|
+
*/
|
|
20851
|
+
getAllTickingAreas(): TickingArea[];
|
|
20852
|
+
/**
|
|
20853
|
+
* @remarks
|
|
20854
|
+
* Tries to get specific ticking area by identifier.
|
|
20855
|
+
*
|
|
20856
|
+
* This function can't be called in read-only mode.
|
|
20857
|
+
*
|
|
20858
|
+
* @throws This function can throw errors.
|
|
20859
|
+
*
|
|
20860
|
+
* {@link minecraftcommon.EngineError}
|
|
20861
|
+
*/
|
|
20862
|
+
getTickingArea(identifier: string | TickingArea): TickingArea | undefined;
|
|
20863
|
+
/**
|
|
20864
|
+
* @remarks
|
|
20865
|
+
* Returns true if the manager has enough chunk capacity for
|
|
20866
|
+
* the ticking area and false otherwise. Will also return false
|
|
20867
|
+
* if the length or width exceeds the 255 chunk limit.
|
|
20868
|
+
*
|
|
20869
|
+
* This function can't be called in read-only mode.
|
|
20870
|
+
*
|
|
20871
|
+
*/
|
|
20872
|
+
hasCapacity(options: TickingAreaOptions): boolean;
|
|
20873
|
+
/**
|
|
20874
|
+
* @remarks
|
|
20875
|
+
* Returns true if the identifier is already in the manager and
|
|
20876
|
+
* false otherwise.
|
|
20877
|
+
*
|
|
20878
|
+
* This function can't be called in read-only mode.
|
|
20879
|
+
*
|
|
20880
|
+
*/
|
|
20881
|
+
hasTickingArea(identifier: string): boolean;
|
|
20882
|
+
/**
|
|
20883
|
+
* @remarks
|
|
20884
|
+
* Removes all ticking areas added by this manager.
|
|
20885
|
+
*
|
|
20886
|
+
* This function can't be called in read-only mode.
|
|
20887
|
+
*
|
|
20888
|
+
* @throws This function can throw errors.
|
|
20889
|
+
*
|
|
20890
|
+
* {@link minecraftcommon.EngineError}
|
|
20891
|
+
*/
|
|
20892
|
+
removeAllTickingAreas(): void;
|
|
20893
|
+
/**
|
|
20894
|
+
* @remarks
|
|
20895
|
+
* Removes specific ticking area by unique identifier.
|
|
20896
|
+
*
|
|
20897
|
+
* This function can't be called in read-only mode.
|
|
20898
|
+
*
|
|
20899
|
+
* @throws This function can throw errors.
|
|
20900
|
+
*
|
|
20901
|
+
* {@link minecraftcommon.EngineError}
|
|
20902
|
+
*
|
|
20903
|
+
* {@link TickingAreaError}
|
|
20904
|
+
*/
|
|
20905
|
+
removeTickingArea(identifier: string | TickingArea): void;
|
|
20906
|
+
}
|
|
20907
|
+
|
|
18532
20908
|
/**
|
|
18533
20909
|
* Represents a trigger for firing an event.
|
|
18534
20910
|
*/
|
|
@@ -18667,6 +21043,65 @@ export class TripWireTripAfterEventSignal {
|
|
|
18667
21043
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
18668
21044
|
}
|
|
18669
21045
|
|
|
21046
|
+
/**
|
|
21047
|
+
* @beta
|
|
21048
|
+
* Contains information related to a script watchdog
|
|
21049
|
+
* termination.
|
|
21050
|
+
*/
|
|
21051
|
+
export class WatchdogTerminateBeforeEvent {
|
|
21052
|
+
private constructor();
|
|
21053
|
+
/**
|
|
21054
|
+
* @remarks
|
|
21055
|
+
* If set to true, cancels the termination of the script
|
|
21056
|
+
* runtime. Note that depending on server configuration
|
|
21057
|
+
* settings, cancellation of the termination may not be
|
|
21058
|
+
* allowed.
|
|
21059
|
+
*
|
|
21060
|
+
*/
|
|
21061
|
+
cancel: boolean;
|
|
21062
|
+
/**
|
|
21063
|
+
* @remarks
|
|
21064
|
+
* Contains the reason why a script runtime is to be
|
|
21065
|
+
* terminated.
|
|
21066
|
+
*
|
|
21067
|
+
*/
|
|
21068
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
21069
|
+
}
|
|
21070
|
+
|
|
21071
|
+
/**
|
|
21072
|
+
* @beta
|
|
21073
|
+
* Manages callbacks that are connected to a callback that will
|
|
21074
|
+
* be called when a script runtime is being terminated due to a
|
|
21075
|
+
* violation of the performance watchdog system.
|
|
21076
|
+
*/
|
|
21077
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
21078
|
+
private constructor();
|
|
21079
|
+
/**
|
|
21080
|
+
* @remarks
|
|
21081
|
+
* Adds a callback that will be called when a script runtime is
|
|
21082
|
+
* being terminated due to a violation of the performance
|
|
21083
|
+
* watchdog system.
|
|
21084
|
+
*
|
|
21085
|
+
* This function can't be called in read-only mode.
|
|
21086
|
+
*
|
|
21087
|
+
* This function can be called in early-execution mode.
|
|
21088
|
+
*
|
|
21089
|
+
*/
|
|
21090
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
21091
|
+
/**
|
|
21092
|
+
* @remarks
|
|
21093
|
+
* Removes a callback from being called when a script runtime
|
|
21094
|
+
* is being terminated due to a violation of the performance
|
|
21095
|
+
* watchdog system.
|
|
21096
|
+
*
|
|
21097
|
+
* This function can't be called in read-only mode.
|
|
21098
|
+
*
|
|
21099
|
+
* This function can be called in early-execution mode.
|
|
21100
|
+
*
|
|
21101
|
+
*/
|
|
21102
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
21103
|
+
}
|
|
21104
|
+
|
|
18670
21105
|
/**
|
|
18671
21106
|
* Contains information related to changes in weather in the
|
|
18672
21107
|
* environment.
|
|
@@ -18854,6 +21289,28 @@ export class World {
|
|
|
18854
21289
|
*
|
|
18855
21290
|
*/
|
|
18856
21291
|
readonly structureManager: StructureManager;
|
|
21292
|
+
/**
|
|
21293
|
+
* @beta
|
|
21294
|
+
* @remarks
|
|
21295
|
+
* Manager for adding, removing and querying pack specific
|
|
21296
|
+
* ticking areas.
|
|
21297
|
+
*
|
|
21298
|
+
*/
|
|
21299
|
+
readonly tickingAreaManager: TickingAreaManager;
|
|
21300
|
+
/**
|
|
21301
|
+
* @beta
|
|
21302
|
+
* @remarks
|
|
21303
|
+
* A method that is internal-only, used for broadcasting
|
|
21304
|
+
* specific messages between client and server.
|
|
21305
|
+
*
|
|
21306
|
+
* This function can't be called in read-only mode.
|
|
21307
|
+
*
|
|
21308
|
+
* @param id
|
|
21309
|
+
* The message identifier.
|
|
21310
|
+
* @param value
|
|
21311
|
+
* The message.
|
|
21312
|
+
*/
|
|
21313
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
18857
21314
|
/**
|
|
18858
21315
|
* @remarks
|
|
18859
21316
|
* Clears the set of dynamic properties declared for this
|
|
@@ -18867,6 +21324,14 @@ export class World {
|
|
|
18867
21324
|
*
|
|
18868
21325
|
*/
|
|
18869
21326
|
getAbsoluteTime(): number;
|
|
21327
|
+
/**
|
|
21328
|
+
* @beta
|
|
21329
|
+
* @remarks
|
|
21330
|
+
* The aim-assist presets and categories that can be used in
|
|
21331
|
+
* the world.
|
|
21332
|
+
*
|
|
21333
|
+
*/
|
|
21334
|
+
getAimAssist(): AimAssistRegistry;
|
|
18870
21335
|
/**
|
|
18871
21336
|
* @remarks
|
|
18872
21337
|
* Returns an array of all active players within the world.
|
|
@@ -19043,6 +21508,15 @@ export class World {
|
|
|
19043
21508
|
*
|
|
19044
21509
|
*/
|
|
19045
21510
|
getMoonPhase(): MoonPhase;
|
|
21511
|
+
/**
|
|
21512
|
+
* @beta
|
|
21513
|
+
* @remarks
|
|
21514
|
+
* Returns a map of pack setting name and value pairs.
|
|
21515
|
+
*
|
|
21516
|
+
* This function can be called in early-execution mode.
|
|
21517
|
+
*
|
|
21518
|
+
*/
|
|
21519
|
+
getPackSettings(): Record<string, boolean | number | string>;
|
|
19046
21520
|
/**
|
|
19047
21521
|
* @remarks
|
|
19048
21522
|
* Returns a set of players based on a set of conditions
|
|
@@ -19318,6 +21792,16 @@ export class WorldAfterEvents {
|
|
|
19318
21792
|
*
|
|
19319
21793
|
*/
|
|
19320
21794
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
21795
|
+
/**
|
|
21796
|
+
* @beta
|
|
21797
|
+
* @remarks
|
|
21798
|
+
* This event is triggered after a chat message has been
|
|
21799
|
+
* broadcast or sent to players.
|
|
21800
|
+
*
|
|
21801
|
+
* This property can be read in early-execution mode.
|
|
21802
|
+
*
|
|
21803
|
+
*/
|
|
21804
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
19321
21805
|
/**
|
|
19322
21806
|
* @remarks
|
|
19323
21807
|
* This event is fired when an entity event has been triggered
|
|
@@ -19345,6 +21829,13 @@ export class WorldAfterEvents {
|
|
|
19345
21829
|
*
|
|
19346
21830
|
*/
|
|
19347
21831
|
readonly entityDie: EntityDieAfterEventSignal;
|
|
21832
|
+
/**
|
|
21833
|
+
* @beta
|
|
21834
|
+
* @remarks
|
|
21835
|
+
* This property can be read in early-execution mode.
|
|
21836
|
+
*
|
|
21837
|
+
*/
|
|
21838
|
+
readonly entityHeal: EntityHealAfterEventSignal;
|
|
19348
21839
|
/**
|
|
19349
21840
|
* @remarks
|
|
19350
21841
|
* This event fires when entity health changes in any degree.
|
|
@@ -19493,6 +21984,25 @@ export class WorldAfterEvents {
|
|
|
19493
21984
|
*
|
|
19494
21985
|
*/
|
|
19495
21986
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
21987
|
+
/**
|
|
21988
|
+
* @beta
|
|
21989
|
+
* @remarks
|
|
21990
|
+
* This event is an internal implementation detail, and is
|
|
21991
|
+
* otherwise not currently functional.
|
|
21992
|
+
*
|
|
21993
|
+
* This property can be read in early-execution mode.
|
|
21994
|
+
*
|
|
21995
|
+
*/
|
|
21996
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
21997
|
+
/**
|
|
21998
|
+
* @beta
|
|
21999
|
+
* @remarks
|
|
22000
|
+
* This event is triggered when a pack setting is changed.
|
|
22001
|
+
*
|
|
22002
|
+
* This property can be read in early-execution mode.
|
|
22003
|
+
*
|
|
22004
|
+
*/
|
|
22005
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
19496
22006
|
/**
|
|
19497
22007
|
* @remarks
|
|
19498
22008
|
* This event fires when a piston expands or retracts.
|
|
@@ -19630,6 +22140,16 @@ export class WorldAfterEvents {
|
|
|
19630
22140
|
*
|
|
19631
22141
|
*/
|
|
19632
22142
|
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
22143
|
+
/**
|
|
22144
|
+
* @beta
|
|
22145
|
+
* @remarks
|
|
22146
|
+
* An event for when a player uses a named name tag on an
|
|
22147
|
+
* entity.
|
|
22148
|
+
*
|
|
22149
|
+
* This property can be read in early-execution mode.
|
|
22150
|
+
*
|
|
22151
|
+
*/
|
|
22152
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
19633
22153
|
/**
|
|
19634
22154
|
* @remarks
|
|
19635
22155
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -19707,14 +22227,65 @@ export class WorldAfterEvents {
|
|
|
19707
22227
|
export class WorldBeforeEvents {
|
|
19708
22228
|
private constructor();
|
|
19709
22229
|
/**
|
|
22230
|
+
* @beta
|
|
22231
|
+
* @remarks
|
|
22232
|
+
* This event is triggered after a chat message has been
|
|
22233
|
+
* broadcast or sent to players.
|
|
22234
|
+
*
|
|
22235
|
+
* This property can be read in early-execution mode.
|
|
22236
|
+
*
|
|
22237
|
+
* @example customCommand.ts
|
|
22238
|
+
* ```typescript
|
|
22239
|
+
* import { world, DimensionLocation } from "@minecraft/server";
|
|
22240
|
+
*
|
|
22241
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
22242
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
|
|
22243
|
+
* if (eventData.message.includes("cancel")) {
|
|
22244
|
+
* // Cancel event if the message contains "cancel"
|
|
22245
|
+
* eventData.cancel = true;
|
|
22246
|
+
* } else {
|
|
22247
|
+
* const args = eventData.message.split(" ");
|
|
22248
|
+
*
|
|
22249
|
+
* if (args.length > 0) {
|
|
22250
|
+
* switch (args[0].toLowerCase()) {
|
|
22251
|
+
* case "echo":
|
|
22252
|
+
* // Send a modified version of chat message
|
|
22253
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
22254
|
+
* break;
|
|
22255
|
+
* case "help":
|
|
22256
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
22257
|
+
* break;
|
|
22258
|
+
* }
|
|
22259
|
+
* }
|
|
22260
|
+
* }
|
|
22261
|
+
* });
|
|
22262
|
+
* }
|
|
22263
|
+
* ```
|
|
22264
|
+
*/
|
|
22265
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
22266
|
+
/**
|
|
22267
|
+
* @remarks
|
|
22268
|
+
* This event is triggered after an event has been added to an
|
|
22269
|
+
* entity.
|
|
22270
|
+
*
|
|
22271
|
+
* This property can be read in early-execution mode.
|
|
22272
|
+
*
|
|
22273
|
+
*/
|
|
22274
|
+
readonly effectAdd: EffectAddBeforeEventSignal;
|
|
22275
|
+
/**
|
|
22276
|
+
* @beta
|
|
19710
22277
|
* @remarks
|
|
19711
|
-
* This
|
|
19712
|
-
* entity.
|
|
22278
|
+
* This property can be read in early-execution mode.
|
|
19713
22279
|
*
|
|
22280
|
+
*/
|
|
22281
|
+
readonly entityHeal: EntityHealBeforeEventSignal;
|
|
22282
|
+
/**
|
|
22283
|
+
* @beta
|
|
22284
|
+
* @remarks
|
|
19714
22285
|
* This property can be read in early-execution mode.
|
|
19715
22286
|
*
|
|
19716
22287
|
*/
|
|
19717
|
-
readonly
|
|
22288
|
+
readonly entityHurt: EntityHurtBeforeEventSignal;
|
|
19718
22289
|
/**
|
|
19719
22290
|
* @remarks
|
|
19720
22291
|
* Fires before an entity is removed from the world (for
|
|
@@ -19779,6 +22350,15 @@ export class WorldBeforeEvents {
|
|
|
19779
22350
|
*
|
|
19780
22351
|
*/
|
|
19781
22352
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
22353
|
+
/**
|
|
22354
|
+
* @beta
|
|
22355
|
+
* @remarks
|
|
22356
|
+
* This event fires before a block is placed by a player.
|
|
22357
|
+
*
|
|
22358
|
+
* This property can be read in early-execution mode.
|
|
22359
|
+
*
|
|
22360
|
+
*/
|
|
22361
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
19782
22362
|
/**
|
|
19783
22363
|
* @remarks
|
|
19784
22364
|
* This property can be read in early-execution mode.
|
|
@@ -19832,13 +22412,57 @@ export interface AABB {
|
|
|
19832
22412
|
extent: Vector3;
|
|
19833
22413
|
}
|
|
19834
22414
|
|
|
22415
|
+
/**
|
|
22416
|
+
* @beta
|
|
22417
|
+
* Used to create camera animations.
|
|
22418
|
+
*/
|
|
22419
|
+
export interface AnimationOptions {
|
|
22420
|
+
/**
|
|
22421
|
+
* @remarks
|
|
22422
|
+
* Key frames for the camera animation.
|
|
22423
|
+
*
|
|
22424
|
+
*/
|
|
22425
|
+
animation: SplineAnimation;
|
|
22426
|
+
/**
|
|
22427
|
+
* @remarks
|
|
22428
|
+
* Total time of the camera animation in seconds.
|
|
22429
|
+
*
|
|
22430
|
+
*/
|
|
22431
|
+
totalTimeSeconds: number;
|
|
22432
|
+
}
|
|
22433
|
+
|
|
22434
|
+
/**
|
|
22435
|
+
* @beta
|
|
22436
|
+
*/
|
|
22437
|
+
export interface BiomeFilter {
|
|
22438
|
+
excludeBiomes?: string[];
|
|
22439
|
+
excludeTags?: string[];
|
|
22440
|
+
includeBiomes?: string[];
|
|
22441
|
+
includeTags?: string[];
|
|
22442
|
+
superset: boolean;
|
|
22443
|
+
}
|
|
22444
|
+
|
|
22445
|
+
/**
|
|
22446
|
+
* @beta
|
|
22447
|
+
* Contains additional options for searches for the
|
|
22448
|
+
* dimension.findNearestBiome API.
|
|
22449
|
+
*/
|
|
22450
|
+
export interface BiomeSearchOptions {
|
|
22451
|
+
/**
|
|
22452
|
+
* @remarks
|
|
22453
|
+
* Bounding volume size to look within.
|
|
22454
|
+
*
|
|
22455
|
+
*/
|
|
22456
|
+
boundingSize?: Vector3;
|
|
22457
|
+
}
|
|
22458
|
+
|
|
19835
22459
|
/**
|
|
19836
22460
|
* A BlockBoundingBox is an interface to an object which
|
|
19837
22461
|
* represents an AABB aligned rectangle.
|
|
19838
22462
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
19839
22463
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
19840
|
-
* created using the associated {@link
|
|
19841
|
-
*
|
|
22464
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
22465
|
+
* utility functions.
|
|
19842
22466
|
* The min/max coordinates represent the diametrically opposite
|
|
19843
22467
|
* corners of the rectangle.
|
|
19844
22468
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -19891,6 +22515,14 @@ export interface BlockCustomComponent {
|
|
|
19891
22515
|
*
|
|
19892
22516
|
*/
|
|
19893
22517
|
onBreak?: (arg0: BlockComponentBlockBreakEvent, arg1: CustomComponentParameters) => void;
|
|
22518
|
+
/**
|
|
22519
|
+
* @beta
|
|
22520
|
+
* @remarks
|
|
22521
|
+
* This function will be called when an entity fires an event
|
|
22522
|
+
* to this block in the world.
|
|
22523
|
+
*
|
|
22524
|
+
*/
|
|
22525
|
+
onEntity?: (arg0: BlockComponentEntityEvent, arg1: CustomComponentParameters) => void;
|
|
19894
22526
|
/**
|
|
19895
22527
|
* @remarks
|
|
19896
22528
|
* This function will be called when an entity falls onto the
|
|
@@ -20123,6 +22755,26 @@ export interface BlockRaycastOptions extends BlockFilter {
|
|
|
20123
22755
|
maxDistance?: number;
|
|
20124
22756
|
}
|
|
20125
22757
|
|
|
22758
|
+
/**
|
|
22759
|
+
* @beta
|
|
22760
|
+
* Used to attach the camera to a non player entity.
|
|
22761
|
+
*/
|
|
22762
|
+
export interface CameraAttachOptions {
|
|
22763
|
+
/**
|
|
22764
|
+
* @remarks
|
|
22765
|
+
* Set a non player entity for the camera to target.
|
|
22766
|
+
*
|
|
22767
|
+
*/
|
|
22768
|
+
entity: Entity;
|
|
22769
|
+
/**
|
|
22770
|
+
* @remarks
|
|
22771
|
+
* The location of the entity that you want to target (eg.
|
|
22772
|
+
* head, feet, eyes).
|
|
22773
|
+
*
|
|
22774
|
+
*/
|
|
22775
|
+
locator: EntityAttachPoint;
|
|
22776
|
+
}
|
|
22777
|
+
|
|
20126
22778
|
/**
|
|
20127
22779
|
* Used to initiate a full-screen color fade.
|
|
20128
22780
|
*/
|
|
@@ -20239,6 +22891,40 @@ export interface CameraTargetOptions {
|
|
|
20239
22891
|
targetEntity: Entity;
|
|
20240
22892
|
}
|
|
20241
22893
|
|
|
22894
|
+
/**
|
|
22895
|
+
* @beta
|
|
22896
|
+
* This interface defines an entry into the {@link
|
|
22897
|
+
* CompoundBlockVolume} which represents a volume of positive
|
|
22898
|
+
* or negative space.
|
|
22899
|
+
*
|
|
22900
|
+
*/
|
|
22901
|
+
export interface CompoundBlockVolumeItem {
|
|
22902
|
+
/**
|
|
22903
|
+
* @remarks
|
|
22904
|
+
* The 'action' defines how the block volume is represented in
|
|
22905
|
+
* the compound block volume stack.
|
|
22906
|
+
* 'Add' creates a block volume which is positively selected
|
|
22907
|
+
* 'Subtract' creates a block volume which represents a hole or
|
|
22908
|
+
* negative space in the overall compound block volume.
|
|
22909
|
+
*
|
|
22910
|
+
*/
|
|
22911
|
+
action?: CompoundBlockVolumeAction;
|
|
22912
|
+
/**
|
|
22913
|
+
* @remarks
|
|
22914
|
+
* The relativity enumeration determines whether the
|
|
22915
|
+
* BlockVolume specified is positioned relative to the parent
|
|
22916
|
+
* compound block volume origin, or in absolute world space.
|
|
22917
|
+
*
|
|
22918
|
+
*/
|
|
22919
|
+
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
22920
|
+
/**
|
|
22921
|
+
* @remarks
|
|
22922
|
+
* The volume of space
|
|
22923
|
+
*
|
|
22924
|
+
*/
|
|
22925
|
+
volume: BlockVolume;
|
|
22926
|
+
}
|
|
22927
|
+
|
|
20242
22928
|
/**
|
|
20243
22929
|
* Rules that if broken on container operations will throw an
|
|
20244
22930
|
* error.
|
|
@@ -20323,6 +23009,15 @@ export interface CustomCommand {
|
|
|
20323
23009
|
* command.
|
|
20324
23010
|
*/
|
|
20325
23011
|
export interface CustomCommandParameter {
|
|
23012
|
+
/**
|
|
23013
|
+
* @beta
|
|
23014
|
+
* @remarks
|
|
23015
|
+
* Can be used to reference the enum name when {@link
|
|
23016
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
23017
|
+
* to be different from the enum name.
|
|
23018
|
+
*
|
|
23019
|
+
*/
|
|
23020
|
+
enumName?: string;
|
|
20326
23021
|
/**
|
|
20327
23022
|
* @remarks
|
|
20328
23023
|
* The name of parameter as it appears on the command line.
|
|
@@ -20375,6 +23070,14 @@ export interface DefinitionModifier {
|
|
|
20375
23070
|
*
|
|
20376
23071
|
*/
|
|
20377
23072
|
removedComponentGroups: string[];
|
|
23073
|
+
/**
|
|
23074
|
+
* @beta
|
|
23075
|
+
* @remarks
|
|
23076
|
+
* The list of entity definition events that will be fired via
|
|
23077
|
+
* this update.
|
|
23078
|
+
*
|
|
23079
|
+
*/
|
|
23080
|
+
triggers: Trigger[];
|
|
20378
23081
|
}
|
|
20379
23082
|
|
|
20380
23083
|
/**
|
|
@@ -20698,6 +23401,28 @@ export interface EntityFilter {
|
|
|
20698
23401
|
type?: string;
|
|
20699
23402
|
}
|
|
20700
23403
|
|
|
23404
|
+
/**
|
|
23405
|
+
* @beta
|
|
23406
|
+
* Contains optional parameters for registering an entity heal
|
|
23407
|
+
* event.
|
|
23408
|
+
*/
|
|
23409
|
+
export interface EntityHealEventOptions {
|
|
23410
|
+
/**
|
|
23411
|
+
* @remarks
|
|
23412
|
+
* If this value is set, this event will only fire for healing
|
|
23413
|
+
* causes that match.
|
|
23414
|
+
*
|
|
23415
|
+
*/
|
|
23416
|
+
allowedHealCauses?: EntityHealCause[];
|
|
23417
|
+
/**
|
|
23418
|
+
* @remarks
|
|
23419
|
+
* If this value is set, this event will only fire for entities
|
|
23420
|
+
* that match.
|
|
23421
|
+
*
|
|
23422
|
+
*/
|
|
23423
|
+
entityFilter?: EntityFilter;
|
|
23424
|
+
}
|
|
23425
|
+
|
|
20701
23426
|
/**
|
|
20702
23427
|
* Contains additional information about an entity that was
|
|
20703
23428
|
* hit.
|
|
@@ -20711,6 +23436,64 @@ export interface EntityHitInformation {
|
|
|
20711
23436
|
entity?: Entity;
|
|
20712
23437
|
}
|
|
20713
23438
|
|
|
23439
|
+
/**
|
|
23440
|
+
* @beta
|
|
23441
|
+
* Contains optional parameters for registering an entity hurt
|
|
23442
|
+
* after event.
|
|
23443
|
+
*/
|
|
23444
|
+
export interface EntityHurtAfterEventOptions {
|
|
23445
|
+
/**
|
|
23446
|
+
* @remarks
|
|
23447
|
+
* If this value is set, this event will only fire for damage
|
|
23448
|
+
* causes that match.
|
|
23449
|
+
*
|
|
23450
|
+
*/
|
|
23451
|
+
allowedDamageCauses?: EntityDamageCause[];
|
|
23452
|
+
/**
|
|
23453
|
+
* @remarks
|
|
23454
|
+
* If this value is set, this event will only fire for entities
|
|
23455
|
+
* that match the entities within this collection.
|
|
23456
|
+
*
|
|
23457
|
+
*/
|
|
23458
|
+
entities?: Entity[];
|
|
23459
|
+
/**
|
|
23460
|
+
* @remarks
|
|
23461
|
+
* If this value is set, this event will only fire for entities
|
|
23462
|
+
* that match.
|
|
23463
|
+
*
|
|
23464
|
+
*/
|
|
23465
|
+
entityFilter?: EntityFilter;
|
|
23466
|
+
/**
|
|
23467
|
+
* @remarks
|
|
23468
|
+
* If this value is set, this event will only fire if the
|
|
23469
|
+
* impacted entities' type matches this parameter.
|
|
23470
|
+
*
|
|
23471
|
+
*/
|
|
23472
|
+
entityTypes?: string[];
|
|
23473
|
+
}
|
|
23474
|
+
|
|
23475
|
+
/**
|
|
23476
|
+
* @beta
|
|
23477
|
+
* Contains optional parameters for registering an entity hurt
|
|
23478
|
+
* before event.
|
|
23479
|
+
*/
|
|
23480
|
+
export interface EntityHurtBeforeEventOptions {
|
|
23481
|
+
/**
|
|
23482
|
+
* @remarks
|
|
23483
|
+
* If this value is set, this event will only fire for damage
|
|
23484
|
+
* causes that match.
|
|
23485
|
+
*
|
|
23486
|
+
*/
|
|
23487
|
+
allowedDamageCauses?: EntityDamageCause[];
|
|
23488
|
+
/**
|
|
23489
|
+
* @remarks
|
|
23490
|
+
* If this value is set, this event will only fire for entities
|
|
23491
|
+
* that match.
|
|
23492
|
+
*
|
|
23493
|
+
*/
|
|
23494
|
+
entityFilter?: EntityFilter;
|
|
23495
|
+
}
|
|
23496
|
+
|
|
20714
23497
|
/**
|
|
20715
23498
|
* Contains options for selecting entities within an area.
|
|
20716
23499
|
* @example blockConditional.ts
|
|
@@ -21474,6 +24257,38 @@ export interface PlayAnimationOptions {
|
|
|
21474
24257
|
stopExpression?: string;
|
|
21475
24258
|
}
|
|
21476
24259
|
|
|
24260
|
+
/**
|
|
24261
|
+
* @beta
|
|
24262
|
+
* Settings relating to a player's aim-assist targeting.
|
|
24263
|
+
*/
|
|
24264
|
+
export interface PlayerAimAssistSettings {
|
|
24265
|
+
/**
|
|
24266
|
+
* @remarks
|
|
24267
|
+
* The view distance limit to use for aim-assist targeting.
|
|
24268
|
+
*
|
|
24269
|
+
*/
|
|
24270
|
+
distance?: number;
|
|
24271
|
+
/**
|
|
24272
|
+
* @remarks
|
|
24273
|
+
* The Id of the aim-assist preset to activate. Must have a
|
|
24274
|
+
* namespace.
|
|
24275
|
+
*
|
|
24276
|
+
*/
|
|
24277
|
+
presetId: string;
|
|
24278
|
+
/**
|
|
24279
|
+
* @remarks
|
|
24280
|
+
* The mode to use for aim-assist targeting.
|
|
24281
|
+
*
|
|
24282
|
+
*/
|
|
24283
|
+
targetMode?: AimAssistTargetMode;
|
|
24284
|
+
/**
|
|
24285
|
+
* @remarks
|
|
24286
|
+
* The view angle limit to use for aim-assist targeting.
|
|
24287
|
+
*
|
|
24288
|
+
*/
|
|
24289
|
+
viewAngle?: Vector2;
|
|
24290
|
+
}
|
|
24291
|
+
|
|
21477
24292
|
/**
|
|
21478
24293
|
* Additional options for how a sound plays for a player.
|
|
21479
24294
|
*/
|
|
@@ -21525,6 +24340,33 @@ export interface PlayerSwingEventOptions {
|
|
|
21525
24340
|
swingSource?: EntitySwingSource;
|
|
21526
24341
|
}
|
|
21527
24342
|
|
|
24343
|
+
/**
|
|
24344
|
+
* @beta
|
|
24345
|
+
* Key frame that holds the progress of the camera animation.
|
|
24346
|
+
*/
|
|
24347
|
+
export interface ProgressKeyFrame {
|
|
24348
|
+
/**
|
|
24349
|
+
* @remarks
|
|
24350
|
+
* Value to denote how far along the curve the camera will be.
|
|
24351
|
+
* Values are [0.0, 1.0] inclusive.
|
|
24352
|
+
*
|
|
24353
|
+
*/
|
|
24354
|
+
alpha: number;
|
|
24355
|
+
/**
|
|
24356
|
+
* @remarks
|
|
24357
|
+
* The optional easing type that the frame will use for
|
|
24358
|
+
* position.
|
|
24359
|
+
*
|
|
24360
|
+
*/
|
|
24361
|
+
easingFunc?: EasingType;
|
|
24362
|
+
/**
|
|
24363
|
+
* @remarks
|
|
24364
|
+
* Time value that the camera will be at the given alpha.
|
|
24365
|
+
*
|
|
24366
|
+
*/
|
|
24367
|
+
timeSeconds: number;
|
|
24368
|
+
}
|
|
24369
|
+
|
|
21528
24370
|
/**
|
|
21529
24371
|
* Optional arguments for
|
|
21530
24372
|
* @minecraft/server.EntityProjectileComponent.shoot.
|
|
@@ -21765,6 +24607,32 @@ export interface RGBA extends RGB {
|
|
|
21765
24607
|
alpha: number;
|
|
21766
24608
|
}
|
|
21767
24609
|
|
|
24610
|
+
/**
|
|
24611
|
+
* @beta
|
|
24612
|
+
* Key frame that holds the rotation of the camera animation.
|
|
24613
|
+
*/
|
|
24614
|
+
export interface RotationKeyFrame {
|
|
24615
|
+
/**
|
|
24616
|
+
* @remarks
|
|
24617
|
+
* The optional easing type that the frame will use for
|
|
24618
|
+
* rotation.
|
|
24619
|
+
*
|
|
24620
|
+
*/
|
|
24621
|
+
easingFunc?: EasingType;
|
|
24622
|
+
/**
|
|
24623
|
+
* @remarks
|
|
24624
|
+
* Value of the rotation of the camera.
|
|
24625
|
+
*
|
|
24626
|
+
*/
|
|
24627
|
+
rotation: Vector3;
|
|
24628
|
+
/**
|
|
24629
|
+
* @remarks
|
|
24630
|
+
* Time value that the camera will be at the given rotation.
|
|
24631
|
+
*
|
|
24632
|
+
*/
|
|
24633
|
+
timeSeconds: number;
|
|
24634
|
+
}
|
|
24635
|
+
|
|
21768
24636
|
/**
|
|
21769
24637
|
* Contains additional options for how a scoreboard should be
|
|
21770
24638
|
* displayed within its display slot.
|
|
@@ -21826,6 +24694,25 @@ export interface SpawnEntityOptions {
|
|
|
21826
24694
|
spawnEvent?: string;
|
|
21827
24695
|
}
|
|
21828
24696
|
|
|
24697
|
+
/**
|
|
24698
|
+
* @beta
|
|
24699
|
+
* Collection of key frames for camera animation.
|
|
24700
|
+
*/
|
|
24701
|
+
export interface SplineAnimation {
|
|
24702
|
+
/**
|
|
24703
|
+
* @remarks
|
|
24704
|
+
* Key frames for camera progress along a given curve.
|
|
24705
|
+
*
|
|
24706
|
+
*/
|
|
24707
|
+
progressKeyFrames: ProgressKeyFrame[];
|
|
24708
|
+
/**
|
|
24709
|
+
* @remarks
|
|
24710
|
+
* Key frames for camera rotation.
|
|
24711
|
+
*
|
|
24712
|
+
*/
|
|
24713
|
+
rotationKeyFrames: RotationKeyFrame[];
|
|
24714
|
+
}
|
|
24715
|
+
|
|
21829
24716
|
/**
|
|
21830
24717
|
* Provides additional options for {@link
|
|
21831
24718
|
* StructureManager.createFromWorld}
|
|
@@ -22006,6 +24893,72 @@ export interface TeleportOptions {
|
|
|
22006
24893
|
rotation?: Vector2;
|
|
22007
24894
|
}
|
|
22008
24895
|
|
|
24896
|
+
/**
|
|
24897
|
+
* @beta
|
|
24898
|
+
* A context which provides information about a specific
|
|
24899
|
+
* ticking area.
|
|
24900
|
+
*/
|
|
24901
|
+
export interface TickingArea {
|
|
24902
|
+
/**
|
|
24903
|
+
* @remarks
|
|
24904
|
+
* The box which contains all the ticking blocks in the ticking
|
|
24905
|
+
* area.
|
|
24906
|
+
*
|
|
24907
|
+
*/
|
|
24908
|
+
boundingBox: BlockBoundingBox;
|
|
24909
|
+
/**
|
|
24910
|
+
* @remarks
|
|
24911
|
+
* The number of chunks that the ticking area contains.
|
|
24912
|
+
*
|
|
24913
|
+
*/
|
|
24914
|
+
chunkCount: number;
|
|
24915
|
+
/**
|
|
24916
|
+
* @remarks
|
|
24917
|
+
* The dimension the ticking area is located.
|
|
24918
|
+
*
|
|
24919
|
+
*/
|
|
24920
|
+
dimension: Dimension;
|
|
24921
|
+
/**
|
|
24922
|
+
* @remarks
|
|
24923
|
+
* The unique identifier of the ticking area.
|
|
24924
|
+
*
|
|
24925
|
+
*/
|
|
24926
|
+
identifier: string;
|
|
24927
|
+
/**
|
|
24928
|
+
* @remarks
|
|
24929
|
+
* Will be true if all the ticking areas chunks are loaded in
|
|
24930
|
+
* ticking and false otherwise.
|
|
24931
|
+
*
|
|
24932
|
+
*/
|
|
24933
|
+
isFullyLoaded: boolean;
|
|
24934
|
+
}
|
|
24935
|
+
|
|
24936
|
+
/**
|
|
24937
|
+
* @beta
|
|
24938
|
+
* Options to create a ticking area using the {@link
|
|
24939
|
+
* TickingAreaManager}.
|
|
24940
|
+
*/
|
|
24941
|
+
export interface TickingAreaOptions {
|
|
24942
|
+
/**
|
|
24943
|
+
* @remarks
|
|
24944
|
+
* The dimension the ticking area will be in.
|
|
24945
|
+
*
|
|
24946
|
+
*/
|
|
24947
|
+
dimension: Dimension;
|
|
24948
|
+
/**
|
|
24949
|
+
* @remarks
|
|
24950
|
+
* Corner block location of the bounding box.
|
|
24951
|
+
*
|
|
24952
|
+
*/
|
|
24953
|
+
from: Vector3;
|
|
24954
|
+
/**
|
|
24955
|
+
* @remarks
|
|
24956
|
+
* Opposite corner block location of the bounding box.
|
|
24957
|
+
*
|
|
24958
|
+
*/
|
|
24959
|
+
to: Vector3;
|
|
24960
|
+
}
|
|
24961
|
+
|
|
22009
24962
|
/**
|
|
22010
24963
|
* Contains additional options for displaying a title and
|
|
22011
24964
|
* optional subtitle.
|
|
@@ -22428,6 +25381,24 @@ export class RawMessageError extends Error {
|
|
|
22428
25381
|
private constructor();
|
|
22429
25382
|
}
|
|
22430
25383
|
|
|
25384
|
+
/**
|
|
25385
|
+
* @beta
|
|
25386
|
+
* The error returned from invalid {@link TickingAreaManager}
|
|
25387
|
+
* method calls.
|
|
25388
|
+
*/
|
|
25389
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
25390
|
+
export class TickingAreaError extends Error {
|
|
25391
|
+
private constructor();
|
|
25392
|
+
/**
|
|
25393
|
+
* @remarks
|
|
25394
|
+
* The specific reason that the error was thrown.
|
|
25395
|
+
*
|
|
25396
|
+
* This property can be read in early-execution mode.
|
|
25397
|
+
*
|
|
25398
|
+
*/
|
|
25399
|
+
reason: TickingAreaErrorReason;
|
|
25400
|
+
}
|
|
25401
|
+
|
|
22431
25402
|
/**
|
|
22432
25403
|
* Error thrown when the specified area contains one or more
|
|
22433
25404
|
* unloaded chunks.
|