@minecraft/server 2.3.0-rc.1.21.120-preview.21 → 2.4.0-beta.1.21.120-preview.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +3543 -306
- 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.4.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.
|
|
@@ -187,6 +206,113 @@ export enum CommandPermissionLevel {
|
|
|
187
206
|
Owner = 4,
|
|
188
207
|
}
|
|
189
208
|
|
|
209
|
+
/**
|
|
210
|
+
* @beta
|
|
211
|
+
* The Action enum determines how the CompoundBlockVolume
|
|
212
|
+
* considers the associated CompoundBlockVolumeItem when
|
|
213
|
+
* performing inside/outside calculations.
|
|
214
|
+
*/
|
|
215
|
+
export enum CompoundBlockVolumeAction {
|
|
216
|
+
/**
|
|
217
|
+
* @remarks
|
|
218
|
+
* The associated BlockVolume is considered a positive space,
|
|
219
|
+
* and any intersection tests are considered hits
|
|
220
|
+
*
|
|
221
|
+
*/
|
|
222
|
+
Add = 0,
|
|
223
|
+
/**
|
|
224
|
+
* @remarks
|
|
225
|
+
* The associated BlockVolume is considered a negative or void
|
|
226
|
+
* space, and any intersection tests are considered misses.
|
|
227
|
+
* Using the Subtract action, it is possible to `punch holes`
|
|
228
|
+
* in block volumes so that any intersection tests may pass
|
|
229
|
+
* through such spaces
|
|
230
|
+
*
|
|
231
|
+
*/
|
|
232
|
+
Subtract = 1,
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @beta
|
|
237
|
+
* An enum describing the relativity of the
|
|
238
|
+
* CompoundBlockVolumeItem, relative to the parent
|
|
239
|
+
* CompoundVolume.
|
|
240
|
+
*/
|
|
241
|
+
export enum CompoundBlockVolumePositionRelativity {
|
|
242
|
+
/**
|
|
243
|
+
* @remarks
|
|
244
|
+
* The locations within the associated BlockVolume are relative
|
|
245
|
+
* to the CompoundBlockVolume to which they were added
|
|
246
|
+
*
|
|
247
|
+
*/
|
|
248
|
+
Relative = 0,
|
|
249
|
+
/**
|
|
250
|
+
* @remarks
|
|
251
|
+
* The locations within the associated BlockVolume are in
|
|
252
|
+
* absolute world space
|
|
253
|
+
*
|
|
254
|
+
*/
|
|
255
|
+
Absolute = 1,
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @beta
|
|
260
|
+
* Reasons that the {@link
|
|
261
|
+
* @minecraft/server.ContainerRulesError} was thrown.
|
|
262
|
+
*/
|
|
263
|
+
export enum ContainerRulesErrorReason {
|
|
264
|
+
/**
|
|
265
|
+
* @remarks
|
|
266
|
+
* Thrown when trying to add item that was defined in {@link
|
|
267
|
+
* ContainerRules.bannedItems}.
|
|
268
|
+
*
|
|
269
|
+
*/
|
|
270
|
+
BannedItem = 'BannedItem',
|
|
271
|
+
/**
|
|
272
|
+
* @remarks
|
|
273
|
+
* Thrown when trying to add item with `Storage Item` component
|
|
274
|
+
* to container with {@link
|
|
275
|
+
* ContainerRules.allowNestedStorageItems} set to false.
|
|
276
|
+
*
|
|
277
|
+
*/
|
|
278
|
+
NestedStorageItem = 'NestedStorageItem',
|
|
279
|
+
/**
|
|
280
|
+
* @remarks
|
|
281
|
+
* Thrown when trying to add item not defined in non-empty
|
|
282
|
+
* {@link ContainerRules.allowedItems}.
|
|
283
|
+
*
|
|
284
|
+
*/
|
|
285
|
+
NotAllowedItem = 'NotAllowedItem',
|
|
286
|
+
/**
|
|
287
|
+
* @remarks
|
|
288
|
+
* Thrown when trying to add item that pushed the containers
|
|
289
|
+
* weight over the {@link ContainerRules.weightLimit}.
|
|
290
|
+
*
|
|
291
|
+
*/
|
|
292
|
+
OverWeightLimit = 'OverWeightLimit',
|
|
293
|
+
/**
|
|
294
|
+
* @remarks
|
|
295
|
+
* Thrown when trying to add item with zero weight defined by
|
|
296
|
+
* the `Storage Weight Modifier` component to container with a
|
|
297
|
+
* defined {@link ContainerRules.weightLimit}
|
|
298
|
+
*
|
|
299
|
+
*/
|
|
300
|
+
ZeroWeightItem = 'ZeroWeightItem',
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* @beta
|
|
305
|
+
* Control Scheme types which define how the player moves in
|
|
306
|
+
* response to player inputs.
|
|
307
|
+
*/
|
|
308
|
+
export enum ControlScheme {
|
|
309
|
+
CameraRelative = 'CameraRelative',
|
|
310
|
+
CameraRelativeStrafe = 'CameraRelativeStrafe',
|
|
311
|
+
LockedPlayerRelativeStrafe = 'LockedPlayerRelativeStrafe',
|
|
312
|
+
PlayerRelative = 'PlayerRelative',
|
|
313
|
+
PlayerRelativeStrafe = 'PlayerRelativeStrafe',
|
|
314
|
+
}
|
|
315
|
+
|
|
190
316
|
/**
|
|
191
317
|
* Reason why custom command registration failed.
|
|
192
318
|
*/
|
|
@@ -231,6 +357,13 @@ export enum CustomCommandErrorReason {
|
|
|
231
357
|
*
|
|
232
358
|
*/
|
|
233
359
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
360
|
+
/**
|
|
361
|
+
* @beta
|
|
362
|
+
* @remarks
|
|
363
|
+
* Non enum type command parameters cannot use enumName.
|
|
364
|
+
*
|
|
365
|
+
*/
|
|
366
|
+
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
234
367
|
}
|
|
235
368
|
|
|
236
369
|
/**
|
|
@@ -944,6 +1077,14 @@ export enum EntityComponentTypes {
|
|
|
944
1077
|
*
|
|
945
1078
|
*/
|
|
946
1079
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1080
|
+
/**
|
|
1081
|
+
* @beta
|
|
1082
|
+
* @remarks
|
|
1083
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
1084
|
+
* name, and dialogue interactions.
|
|
1085
|
+
*
|
|
1086
|
+
*/
|
|
1087
|
+
Npc = 'minecraft:npc',
|
|
947
1088
|
/**
|
|
948
1089
|
* @remarks
|
|
949
1090
|
* When present on an entity, this entity is on fire.
|
|
@@ -1336,6 +1477,14 @@ export enum EntityInitializationCause {
|
|
|
1336
1477
|
* and mainhand slots.
|
|
1337
1478
|
*/
|
|
1338
1479
|
export enum EquipmentSlot {
|
|
1480
|
+
/**
|
|
1481
|
+
* @beta
|
|
1482
|
+
* @remarks
|
|
1483
|
+
* The body slot. This slot is used to hold armor for
|
|
1484
|
+
* non-humanoid mobs.
|
|
1485
|
+
*
|
|
1486
|
+
*/
|
|
1487
|
+
Body = 'Body',
|
|
1339
1488
|
/**
|
|
1340
1489
|
* @remarks
|
|
1341
1490
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1578,6 +1727,10 @@ export enum GameRule {
|
|
|
1578
1727
|
*
|
|
1579
1728
|
*/
|
|
1580
1729
|
KeepInventory = 'keepInventory',
|
|
1730
|
+
/**
|
|
1731
|
+
* @beta
|
|
1732
|
+
*/
|
|
1733
|
+
LocatorBar = 'locatorBar',
|
|
1581
1734
|
/**
|
|
1582
1735
|
* @remarks
|
|
1583
1736
|
* The maximum number of chained commands that can execute per
|
|
@@ -1751,6 +1904,26 @@ export enum GraphicsMode {
|
|
|
1751
1904
|
Simple = 'Simple',
|
|
1752
1905
|
}
|
|
1753
1906
|
|
|
1907
|
+
/**
|
|
1908
|
+
* @beta
|
|
1909
|
+
* Specifies options related to the item currently being held
|
|
1910
|
+
* by an entity.
|
|
1911
|
+
*/
|
|
1912
|
+
export enum HeldItemOption {
|
|
1913
|
+
/**
|
|
1914
|
+
* @remarks
|
|
1915
|
+
* Any item is being held.
|
|
1916
|
+
*
|
|
1917
|
+
*/
|
|
1918
|
+
AnyItem = 'AnyItem',
|
|
1919
|
+
/**
|
|
1920
|
+
* @remarks
|
|
1921
|
+
* No item is being held.
|
|
1922
|
+
*
|
|
1923
|
+
*/
|
|
1924
|
+
NoItem = 'NoItem',
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1754
1927
|
export enum HudElement {
|
|
1755
1928
|
PaperDoll = 0,
|
|
1756
1929
|
Armor = 1,
|
|
@@ -1968,6 +2141,14 @@ export enum ItemComponentTypes {
|
|
|
1968
2141
|
*
|
|
1969
2142
|
*/
|
|
1970
2143
|
Food = 'minecraft:food',
|
|
2144
|
+
/**
|
|
2145
|
+
* @beta
|
|
2146
|
+
*/
|
|
2147
|
+
Inventory = 'minecraft:inventory',
|
|
2148
|
+
/**
|
|
2149
|
+
* @beta
|
|
2150
|
+
*/
|
|
2151
|
+
Potion = 'minecraft:potion',
|
|
1971
2152
|
}
|
|
1972
2153
|
|
|
1973
2154
|
/**
|
|
@@ -1995,6 +2176,28 @@ export enum ItemLockMode {
|
|
|
1995
2176
|
slot = 'slot',
|
|
1996
2177
|
}
|
|
1997
2178
|
|
|
2179
|
+
/**
|
|
2180
|
+
* @beta
|
|
2181
|
+
* Specifies how to handle waterloggable blocks overlapping
|
|
2182
|
+
* with existing liquid.
|
|
2183
|
+
*/
|
|
2184
|
+
export enum LiquidSettings {
|
|
2185
|
+
/**
|
|
2186
|
+
* @remarks
|
|
2187
|
+
* Causes a waterloggable block to become waterlogged, if it
|
|
2188
|
+
* overlaps with existing liquid.
|
|
2189
|
+
*
|
|
2190
|
+
*/
|
|
2191
|
+
ApplyWaterlogging = 'ApplyWaterlogging',
|
|
2192
|
+
/**
|
|
2193
|
+
* @remarks
|
|
2194
|
+
* Do not waterlog any waterloggable blocks that overlap
|
|
2195
|
+
* existing liquid.
|
|
2196
|
+
*
|
|
2197
|
+
*/
|
|
2198
|
+
IgnoreWaterlogging = 'IgnoreWaterlogging',
|
|
2199
|
+
}
|
|
2200
|
+
|
|
1998
2201
|
/**
|
|
1999
2202
|
* Represents the type of liquid that can be placed on a block
|
|
2000
2203
|
* or flow dynamically in the world.
|
|
@@ -2618,6 +2821,29 @@ export enum TintMethod {
|
|
|
2618
2821
|
Water = 'Water',
|
|
2619
2822
|
}
|
|
2620
2823
|
|
|
2824
|
+
/**
|
|
2825
|
+
* @beta
|
|
2826
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
2827
|
+
* to terminate execution of a behavior packs' script.
|
|
2828
|
+
*/
|
|
2829
|
+
export enum WatchdogTerminateReason {
|
|
2830
|
+
/**
|
|
2831
|
+
* @remarks
|
|
2832
|
+
* Script runtime for a behavior pack is terminated due to
|
|
2833
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
2834
|
+
*
|
|
2835
|
+
*/
|
|
2836
|
+
Hang = 'Hang',
|
|
2837
|
+
/**
|
|
2838
|
+
* @remarks
|
|
2839
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
2840
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
2841
|
+
* function calls.
|
|
2842
|
+
*
|
|
2843
|
+
*/
|
|
2844
|
+
StackOverflow = 'StackOverflow',
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2621
2847
|
/**
|
|
2622
2848
|
* Used to specify the type of weather condition within the
|
|
2623
2849
|
* world.
|
|
@@ -2657,10 +2883,12 @@ export type BlockComponentTypeMap = {
|
|
|
2657
2883
|
'minecraft:movable': BlockMovableComponent;
|
|
2658
2884
|
'minecraft:piston': BlockPistonComponent;
|
|
2659
2885
|
'minecraft:record_player': BlockRecordPlayerComponent;
|
|
2886
|
+
'minecraft:redstone_producer': BlockRedstoneProducerComponent;
|
|
2660
2887
|
'minecraft:sign': BlockSignComponent;
|
|
2661
2888
|
movable: BlockMovableComponent;
|
|
2662
2889
|
piston: BlockPistonComponent;
|
|
2663
2890
|
record_player: BlockRecordPlayerComponent;
|
|
2891
|
+
redstone_producer: BlockRedstoneProducerComponent;
|
|
2664
2892
|
sign: BlockSignComponent;
|
|
2665
2893
|
};
|
|
2666
2894
|
|
|
@@ -2765,6 +2993,7 @@ export type EntityComponentTypeMap = {
|
|
|
2765
2993
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
2766
2994
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
2767
2995
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
2996
|
+
'minecraft:npc': EntityNpcComponent;
|
|
2768
2997
|
'minecraft:onfire': EntityOnFireComponent;
|
|
2769
2998
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
2770
2999
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -2798,6 +3027,7 @@ export type EntityComponentTypeMap = {
|
|
|
2798
3027
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
2799
3028
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
2800
3029
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3030
|
+
npc: EntityNpcComponent;
|
|
2801
3031
|
onfire: EntityOnFireComponent;
|
|
2802
3032
|
'player.exhaustion': EntityExhaustionComponent;
|
|
2803
3033
|
'player.hunger': EntityHungerComponent;
|
|
@@ -2817,6 +3047,15 @@ export type EntityComponentTypeMap = {
|
|
|
2817
3047
|
wants_jockey: EntityWantsJockeyComponent;
|
|
2818
3048
|
};
|
|
2819
3049
|
|
|
3050
|
+
/**
|
|
3051
|
+
* @beta
|
|
3052
|
+
*/
|
|
3053
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3054
|
+
? VanillaEntityIdentifier
|
|
3055
|
+
: T extends string
|
|
3056
|
+
? VanillaEntityIdentifier | T
|
|
3057
|
+
: never;
|
|
3058
|
+
|
|
2820
3059
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
2821
3060
|
? ItemComponentTypeMap[T]
|
|
2822
3061
|
: ItemCustomComponentInstance;
|
|
@@ -2829,6 +3068,7 @@ export type ItemComponentTypeMap = {
|
|
|
2829
3068
|
dyeable: ItemDyeableComponent;
|
|
2830
3069
|
enchantable: ItemEnchantableComponent;
|
|
2831
3070
|
food: ItemFoodComponent;
|
|
3071
|
+
inventory: ItemInventoryComponent;
|
|
2832
3072
|
'minecraft:book': ItemBookComponent;
|
|
2833
3073
|
'minecraft:compostable': ItemCompostableComponent;
|
|
2834
3074
|
'minecraft:cooldown': ItemCooldownComponent;
|
|
@@ -2836,182 +3076,637 @@ export type ItemComponentTypeMap = {
|
|
|
2836
3076
|
'minecraft:dyeable': ItemDyeableComponent;
|
|
2837
3077
|
'minecraft:enchantable': ItemEnchantableComponent;
|
|
2838
3078
|
'minecraft:food': ItemFoodComponent;
|
|
3079
|
+
'minecraft:inventory': ItemInventoryComponent;
|
|
3080
|
+
'minecraft:potion': ItemPotionComponent;
|
|
3081
|
+
potion: ItemPotionComponent;
|
|
2839
3082
|
};
|
|
2840
3083
|
|
|
2841
3084
|
/**
|
|
2842
|
-
* @
|
|
2843
|
-
* Describes a type of biome.
|
|
3085
|
+
* @beta
|
|
2844
3086
|
*/
|
|
2845
|
-
export
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
*
|
|
2851
|
-
*/
|
|
2852
|
-
readonly id: string;
|
|
2853
|
-
}
|
|
3087
|
+
export type VanillaEntityIdentifier =
|
|
3088
|
+
| EntityType
|
|
3089
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3090
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3091
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
2854
3092
|
|
|
2855
3093
|
/**
|
|
2856
|
-
*
|
|
2857
|
-
*
|
|
2858
|
-
*
|
|
2859
|
-
* updated in version 1.17.10.21.
|
|
3094
|
+
* @beta
|
|
3095
|
+
* Handle to an aim-assist category that exists in the
|
|
3096
|
+
* world.aimAssist registry.
|
|
2860
3097
|
*/
|
|
2861
|
-
export class
|
|
3098
|
+
export class AimAssistCategory {
|
|
2862
3099
|
private constructor();
|
|
2863
3100
|
/**
|
|
2864
3101
|
* @remarks
|
|
2865
|
-
*
|
|
3102
|
+
* Default targeting priority used for block types not found in
|
|
3103
|
+
* getBlockPriorities.
|
|
2866
3104
|
*
|
|
3105
|
+
* @throws This property can throw when used.
|
|
2867
3106
|
*/
|
|
2868
|
-
readonly
|
|
3107
|
+
readonly defaultBlockPriority: number;
|
|
2869
3108
|
/**
|
|
2870
3109
|
* @remarks
|
|
2871
|
-
*
|
|
2872
|
-
*
|
|
3110
|
+
* Default targeting priority used for entity types not found
|
|
3111
|
+
* in getEntityPriorities.
|
|
2873
3112
|
*
|
|
2874
3113
|
* @throws This property can throw when used.
|
|
2875
|
-
*
|
|
2876
|
-
* {@link LocationInUnloadedChunkError}
|
|
2877
|
-
*
|
|
2878
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2879
3114
|
*/
|
|
2880
|
-
readonly
|
|
3115
|
+
readonly defaultEntityPriority: number;
|
|
2881
3116
|
/**
|
|
2882
3117
|
* @remarks
|
|
2883
|
-
*
|
|
2884
|
-
* water block and a lava block are liquid, while an air block
|
|
2885
|
-
* and a stone block are not. Water logged blocks are not
|
|
2886
|
-
* liquid blocks).
|
|
3118
|
+
* The unique Id associated with the category.
|
|
2887
3119
|
*
|
|
2888
|
-
* @throws This property can throw when used.
|
|
2889
|
-
*
|
|
2890
|
-
* {@link LocationInUnloadedChunkError}
|
|
2891
|
-
*
|
|
2892
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2893
3120
|
*/
|
|
2894
|
-
readonly
|
|
3121
|
+
readonly identifier: string;
|
|
2895
3122
|
/**
|
|
2896
3123
|
* @remarks
|
|
2897
|
-
*
|
|
2898
|
-
* (for example, if the block is unloaded, references to that
|
|
2899
|
-
* block will no longer be valid.)
|
|
3124
|
+
* Gets the priority settings used for block targeting.
|
|
2900
3125
|
*
|
|
3126
|
+
* @returns
|
|
3127
|
+
* The record mapping block Ids to their priority settings.
|
|
3128
|
+
* Larger numbers have greater priority.
|
|
3129
|
+
* @throws This function can throw errors.
|
|
2901
3130
|
*/
|
|
2902
|
-
|
|
3131
|
+
getBlockPriorities(): Record<string, number>;
|
|
2903
3132
|
/**
|
|
2904
3133
|
* @remarks
|
|
2905
|
-
*
|
|
3134
|
+
* Gets the priority settings used for entity targeting.
|
|
2906
3135
|
*
|
|
2907
|
-
* @
|
|
3136
|
+
* @returns
|
|
3137
|
+
* The record mapping entity Ids to their priority settings.
|
|
3138
|
+
* Larger numbers have greater priority.
|
|
3139
|
+
* @throws This function can throw errors.
|
|
3140
|
+
*/
|
|
3141
|
+
getEntityPriorities(): Record<string, number>;
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
/**
|
|
3145
|
+
* @beta
|
|
3146
|
+
* Settings used with AimAssistRegistry.addCategory for
|
|
3147
|
+
* creation of the AimAssistCategory.
|
|
3148
|
+
*/
|
|
3149
|
+
export class AimAssistCategorySettings {
|
|
3150
|
+
/**
|
|
3151
|
+
* @remarks
|
|
3152
|
+
* Optional. Default targeting priority used for block types
|
|
3153
|
+
* not provided to setBlockPriorities.
|
|
2908
3154
|
*
|
|
2909
|
-
*
|
|
3155
|
+
* This property can't be edited in read-only mode.
|
|
2910
3156
|
*
|
|
2911
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2912
3157
|
*/
|
|
2913
|
-
|
|
3158
|
+
defaultBlockPriority: number;
|
|
2914
3159
|
/**
|
|
2915
3160
|
* @remarks
|
|
2916
|
-
*
|
|
2917
|
-
*
|
|
2918
|
-
*
|
|
2919
|
-
* @throws This property can throw when used.
|
|
3161
|
+
* Optional. Default targeting priority used for entity types
|
|
3162
|
+
* not provided to setEntityPriorities.
|
|
2920
3163
|
*
|
|
2921
|
-
*
|
|
3164
|
+
* This property can't be edited in read-only mode.
|
|
2922
3165
|
*
|
|
2923
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2924
3166
|
*/
|
|
2925
|
-
|
|
3167
|
+
defaultEntityPriority: number;
|
|
2926
3168
|
/**
|
|
2927
3169
|
* @remarks
|
|
2928
|
-
*
|
|
3170
|
+
* The unique Id used to register the category with. Must have
|
|
3171
|
+
* a namespace.
|
|
2929
3172
|
*
|
|
2930
|
-
* @throws This property can throw when used.
|
|
2931
3173
|
*/
|
|
2932
|
-
readonly
|
|
3174
|
+
readonly identifier: string;
|
|
2933
3175
|
/**
|
|
2934
3176
|
* @remarks
|
|
2935
|
-
*
|
|
2936
|
-
*
|
|
3177
|
+
* Constructor that takes a unique Id to associate with the
|
|
3178
|
+
* created AimAssistCategory. Must have a namespace.
|
|
2937
3179
|
*
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
3180
|
+
*/
|
|
3181
|
+
constructor(identifier: string);
|
|
3182
|
+
/**
|
|
3183
|
+
* @remarks
|
|
3184
|
+
* Gets the priority settings used for block targeting.
|
|
2941
3185
|
*
|
|
2942
|
-
*
|
|
3186
|
+
* @returns
|
|
3187
|
+
* The record mapping block Ids to their priority settings.
|
|
3188
|
+
* Larger numbers have greater priority.
|
|
2943
3189
|
*/
|
|
2944
|
-
|
|
3190
|
+
getBlockPriorities(): Record<string, number>;
|
|
2945
3191
|
/**
|
|
2946
3192
|
* @remarks
|
|
2947
|
-
* Gets the
|
|
3193
|
+
* Gets the priority settings used for entity targeting.
|
|
2948
3194
|
*
|
|
2949
|
-
* @
|
|
3195
|
+
* @returns
|
|
3196
|
+
* The record mapping entity Ids to their priority settings.
|
|
3197
|
+
* Larger numbers have greater priority.
|
|
3198
|
+
*/
|
|
3199
|
+
getEntityPriorities(): Record<string, number>;
|
|
3200
|
+
/**
|
|
3201
|
+
* @remarks
|
|
3202
|
+
* Sets the priority settings used for block targeting.
|
|
2950
3203
|
*
|
|
2951
|
-
*
|
|
3204
|
+
* This function can't be called in read-only mode.
|
|
2952
3205
|
*
|
|
2953
|
-
*
|
|
3206
|
+
* @param blockPriorities
|
|
3207
|
+
* A record mapping block Ids to their priority settings.
|
|
3208
|
+
* Larger numbers have greater priority.
|
|
2954
3209
|
*/
|
|
2955
|
-
|
|
3210
|
+
setBlockPriorities(
|
|
3211
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3212
|
+
): void;
|
|
2956
3213
|
/**
|
|
2957
3214
|
* @remarks
|
|
2958
|
-
*
|
|
2959
|
-
* Vanilla block names can be changed in future releases, try
|
|
2960
|
-
* using 'Block.matches' instead for block comparison.
|
|
2961
|
-
*
|
|
2962
|
-
* @throws This property can throw when used.
|
|
3215
|
+
* Sets the priority settings used for entity targeting.
|
|
2963
3216
|
*
|
|
2964
|
-
*
|
|
3217
|
+
* This function can't be called in read-only mode.
|
|
2965
3218
|
*
|
|
2966
|
-
*
|
|
3219
|
+
* @param entityPriorities
|
|
3220
|
+
* A record mapping entity Ids to their priority settings.
|
|
3221
|
+
* Larger numbers have greater priority.
|
|
2967
3222
|
*/
|
|
2968
|
-
|
|
3223
|
+
setEntityPriorities(
|
|
3224
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3225
|
+
): void;
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
/**
|
|
3229
|
+
* @beta
|
|
3230
|
+
* Handle to an aim-assist preset that exists in the
|
|
3231
|
+
* world.aimAssist registry.
|
|
3232
|
+
*/
|
|
3233
|
+
export class AimAssistPreset {
|
|
3234
|
+
private constructor();
|
|
2969
3235
|
/**
|
|
2970
3236
|
* @remarks
|
|
2971
|
-
*
|
|
3237
|
+
* Optional. Default aim-assist category Id used for items not
|
|
3238
|
+
* provided to setItemSettings.
|
|
2972
3239
|
*
|
|
3240
|
+
* @throws This property can throw when used.
|
|
2973
3241
|
*/
|
|
2974
|
-
readonly
|
|
3242
|
+
readonly defaultItemSettings?: string;
|
|
2975
3243
|
/**
|
|
2976
3244
|
* @remarks
|
|
2977
|
-
*
|
|
3245
|
+
* Optional. Aim-assist category Id used for an empty hand.
|
|
2978
3246
|
*
|
|
3247
|
+
* @throws This property can throw when used.
|
|
2979
3248
|
*/
|
|
2980
|
-
readonly
|
|
3249
|
+
readonly handSettings?: string;
|
|
2981
3250
|
/**
|
|
2982
3251
|
* @remarks
|
|
2983
|
-
*
|
|
3252
|
+
* The unique Id associated with the preset.
|
|
2984
3253
|
*
|
|
2985
3254
|
*/
|
|
2986
|
-
readonly
|
|
3255
|
+
readonly identifier: string;
|
|
2987
3256
|
/**
|
|
2988
3257
|
* @remarks
|
|
2989
|
-
*
|
|
2990
|
-
*
|
|
3258
|
+
* Gets the list of block/entity Ids to exclude from aim assist
|
|
3259
|
+
* targeting.
|
|
2991
3260
|
*
|
|
2992
|
-
* @
|
|
2993
|
-
*
|
|
2994
|
-
* Defaults to: 1
|
|
3261
|
+
* @returns
|
|
3262
|
+
* The array of block/entity Ids.
|
|
2995
3263
|
* @throws This function can throw errors.
|
|
2996
|
-
*
|
|
2997
|
-
* {@link LocationInUnloadedChunkError}
|
|
2998
|
-
*
|
|
2999
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
3000
3264
|
*/
|
|
3001
|
-
|
|
3265
|
+
getExcludedTargets(): string[];
|
|
3002
3266
|
/**
|
|
3003
3267
|
* @remarks
|
|
3004
|
-
*
|
|
3005
|
-
* Y direction).
|
|
3268
|
+
* Gets the per-item aim-assist category Ids.
|
|
3006
3269
|
*
|
|
3007
|
-
* @
|
|
3008
|
-
*
|
|
3009
|
-
* Defaults to: 1
|
|
3270
|
+
* @returns
|
|
3271
|
+
* The record mapping item Ids to aim-assist category Ids.
|
|
3010
3272
|
* @throws This function can throw errors.
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
*
|
|
3273
|
+
*/
|
|
3274
|
+
getItemSettings(): Record<string, string>;
|
|
3275
|
+
/**
|
|
3276
|
+
* @remarks
|
|
3277
|
+
* Gets the list of item Ids that will target liquid blocks
|
|
3278
|
+
* with aim-assist when being held.
|
|
3279
|
+
*
|
|
3280
|
+
* @returns
|
|
3281
|
+
* The array of item Ids.
|
|
3282
|
+
* @throws This function can throw errors.
|
|
3283
|
+
*/
|
|
3284
|
+
getLiquidTargetingItems(): string[];
|
|
3285
|
+
}
|
|
3286
|
+
|
|
3287
|
+
/**
|
|
3288
|
+
* @beta
|
|
3289
|
+
* Settings used with AimAssistRegistry.addPreset for creation
|
|
3290
|
+
* of the AimAssistPreset.
|
|
3291
|
+
*/
|
|
3292
|
+
export class AimAssistPresetSettings {
|
|
3293
|
+
/**
|
|
3294
|
+
* @remarks
|
|
3295
|
+
* Optional. Default aim-assist category Id used for items not
|
|
3296
|
+
* provided to setItemSettings.
|
|
3297
|
+
*
|
|
3298
|
+
* This property can't be edited in read-only mode.
|
|
3299
|
+
*
|
|
3300
|
+
*/
|
|
3301
|
+
defaultItemSettings?: string;
|
|
3302
|
+
/**
|
|
3303
|
+
* @remarks
|
|
3304
|
+
* Optional. Aim-assist category Id used for an empty hand.
|
|
3305
|
+
*
|
|
3306
|
+
* This property can't be edited in read-only mode.
|
|
3307
|
+
*
|
|
3308
|
+
*/
|
|
3309
|
+
handSettings?: string;
|
|
3310
|
+
/**
|
|
3311
|
+
* @remarks
|
|
3312
|
+
* The unique Id used to register the preset with. Must have a
|
|
3313
|
+
* namespace.
|
|
3314
|
+
*
|
|
3315
|
+
*/
|
|
3316
|
+
readonly identifier: string;
|
|
3317
|
+
/**
|
|
3318
|
+
* @remarks
|
|
3319
|
+
* Constructor that takes a unique Id to associate with the
|
|
3320
|
+
* created AimAssistPreset. Must have a namespace.
|
|
3321
|
+
*
|
|
3322
|
+
*/
|
|
3323
|
+
constructor(identifier: string);
|
|
3324
|
+
/**
|
|
3325
|
+
* @remarks
|
|
3326
|
+
* Gets the list of block/entity Ids to exclude from aim assist
|
|
3327
|
+
* targeting.
|
|
3328
|
+
*
|
|
3329
|
+
* @returns
|
|
3330
|
+
* The array of block/entity Ids.
|
|
3331
|
+
*/
|
|
3332
|
+
getExcludedTargets(): string[] | undefined;
|
|
3333
|
+
/**
|
|
3334
|
+
* @remarks
|
|
3335
|
+
* Gets the per-item aim-assist category Ids.
|
|
3336
|
+
*
|
|
3337
|
+
* @returns
|
|
3338
|
+
* The record mapping item Ids to aim-assist category Ids.
|
|
3339
|
+
*/
|
|
3340
|
+
getItemSettings(): Record<string, string>;
|
|
3341
|
+
/**
|
|
3342
|
+
* @remarks
|
|
3343
|
+
* Gets the list of item Ids that will target liquid blocks
|
|
3344
|
+
* with aim-assist when being held.
|
|
3345
|
+
*
|
|
3346
|
+
* @returns
|
|
3347
|
+
* The array of item Ids.
|
|
3348
|
+
*/
|
|
3349
|
+
getLiquidTargetingItems(): string[] | undefined;
|
|
3350
|
+
/**
|
|
3351
|
+
* @remarks
|
|
3352
|
+
* Sets the list of block/entity Ids to exclude from aim assist
|
|
3353
|
+
* targeting.
|
|
3354
|
+
*
|
|
3355
|
+
* This function can't be called in read-only mode.
|
|
3356
|
+
*
|
|
3357
|
+
* @param targets
|
|
3358
|
+
* An array of block/entity Ids.
|
|
3359
|
+
*/
|
|
3360
|
+
setExcludedTargets(
|
|
3361
|
+
targets?: (
|
|
3362
|
+
| keyof typeof minecraftvanilladata.MinecraftBlockTypes
|
|
3363
|
+
| keyof typeof minecraftvanilladata.MinecraftEntityTypes
|
|
3364
|
+
| string
|
|
3365
|
+
)[],
|
|
3366
|
+
): void;
|
|
3367
|
+
/**
|
|
3368
|
+
* @remarks
|
|
3369
|
+
* Sets the per-item aim-assist category Ids.
|
|
3370
|
+
*
|
|
3371
|
+
* This function can't be called in read-only mode.
|
|
3372
|
+
*
|
|
3373
|
+
* @param itemSettings
|
|
3374
|
+
* A record mapping item Ids to aim-assist category Ids.
|
|
3375
|
+
* Category Ids must have a namespace.
|
|
3376
|
+
*/
|
|
3377
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3378
|
+
/**
|
|
3379
|
+
* @remarks
|
|
3380
|
+
* Sets the list of item Ids that will target liquid blocks
|
|
3381
|
+
* with aim-assist when being held.
|
|
3382
|
+
*
|
|
3383
|
+
* This function can't be called in read-only mode.
|
|
3384
|
+
*
|
|
3385
|
+
* @param items
|
|
3386
|
+
* An array of item Ids.
|
|
3387
|
+
*/
|
|
3388
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3389
|
+
}
|
|
3390
|
+
|
|
3391
|
+
/**
|
|
3392
|
+
* @beta
|
|
3393
|
+
* A container for APIs related to the world's aim-assist
|
|
3394
|
+
* settings.
|
|
3395
|
+
*/
|
|
3396
|
+
export class AimAssistRegistry {
|
|
3397
|
+
private constructor();
|
|
3398
|
+
/**
|
|
3399
|
+
* @remarks
|
|
3400
|
+
* The default aim-assist category Id that is used when not
|
|
3401
|
+
* otherwise specified.
|
|
3402
|
+
*
|
|
3403
|
+
*/
|
|
3404
|
+
static readonly DefaultCategoryId = 'minecraft:default';
|
|
3405
|
+
/**
|
|
3406
|
+
* @remarks
|
|
3407
|
+
* The default aim-assist preset Id that is used when not
|
|
3408
|
+
* otherwise specified.
|
|
3409
|
+
*
|
|
3410
|
+
*/
|
|
3411
|
+
static readonly DefaultPresetId = 'minecraft:aim_assist_default';
|
|
3412
|
+
/**
|
|
3413
|
+
* @remarks
|
|
3414
|
+
* Adds an aim-assist category to the registry.
|
|
3415
|
+
*
|
|
3416
|
+
* This function can't be called in read-only mode.
|
|
3417
|
+
*
|
|
3418
|
+
* @param category
|
|
3419
|
+
* The category settings used to create the new category.
|
|
3420
|
+
* @returns
|
|
3421
|
+
* The created category handle.
|
|
3422
|
+
* @throws This function can throw errors.
|
|
3423
|
+
*
|
|
3424
|
+
* {@link minecraftcommon.EngineError}
|
|
3425
|
+
*
|
|
3426
|
+
* {@link Error}
|
|
3427
|
+
*
|
|
3428
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3429
|
+
*
|
|
3430
|
+
* {@link NamespaceNameError}
|
|
3431
|
+
*/
|
|
3432
|
+
addCategory(category: AimAssistCategorySettings): AimAssistCategory;
|
|
3433
|
+
/**
|
|
3434
|
+
* @remarks
|
|
3435
|
+
* Adds an aim-assist preset to the registry.
|
|
3436
|
+
*
|
|
3437
|
+
* This function can't be called in read-only mode.
|
|
3438
|
+
*
|
|
3439
|
+
* @param preset
|
|
3440
|
+
* The preset settings used to create the new preset.
|
|
3441
|
+
* @returns
|
|
3442
|
+
* The created preset handle.
|
|
3443
|
+
* @throws This function can throw errors.
|
|
3444
|
+
*
|
|
3445
|
+
* {@link minecraftcommon.EngineError}
|
|
3446
|
+
*
|
|
3447
|
+
* {@link Error}
|
|
3448
|
+
*
|
|
3449
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3450
|
+
*
|
|
3451
|
+
* {@link NamespaceNameError}
|
|
3452
|
+
*/
|
|
3453
|
+
addPreset(preset: AimAssistPresetSettings): AimAssistPreset;
|
|
3454
|
+
/**
|
|
3455
|
+
* @remarks
|
|
3456
|
+
* Gets all available categories in the registry.
|
|
3457
|
+
*
|
|
3458
|
+
* @returns
|
|
3459
|
+
* An array of all available category objects.
|
|
3460
|
+
*/
|
|
3461
|
+
getCategories(): AimAssistCategory[];
|
|
3462
|
+
/**
|
|
3463
|
+
* @remarks
|
|
3464
|
+
* Gets the category associated with the provided Id.
|
|
3465
|
+
*
|
|
3466
|
+
* This function can't be called in read-only mode.
|
|
3467
|
+
*
|
|
3468
|
+
* @returns
|
|
3469
|
+
* The category object if it exists, otherwise returns
|
|
3470
|
+
* undefined.
|
|
3471
|
+
*/
|
|
3472
|
+
getCategory(categoryId: string): AimAssistCategory | undefined;
|
|
3473
|
+
/**
|
|
3474
|
+
* @remarks
|
|
3475
|
+
* Gets the preset associated with the provided Id.
|
|
3476
|
+
*
|
|
3477
|
+
* This function can't be called in read-only mode.
|
|
3478
|
+
*
|
|
3479
|
+
* @param presetId
|
|
3480
|
+
* The Id of the preset to retrieve. Must have a namespace.
|
|
3481
|
+
* @returns
|
|
3482
|
+
* The preset object if it exists, otherwise returns undefined.
|
|
3483
|
+
*/
|
|
3484
|
+
getPreset(presetId: string): AimAssistPreset | undefined;
|
|
3485
|
+
/**
|
|
3486
|
+
* @remarks
|
|
3487
|
+
* Gets all available presets in the registry.
|
|
3488
|
+
*
|
|
3489
|
+
* @returns
|
|
3490
|
+
* An array of all available preset objects.
|
|
3491
|
+
*/
|
|
3492
|
+
getPresets(): AimAssistPreset[];
|
|
3493
|
+
}
|
|
3494
|
+
|
|
3495
|
+
/**
|
|
3496
|
+
* @rc
|
|
3497
|
+
* Describes a type of biome.
|
|
3498
|
+
*/
|
|
3499
|
+
export class BiomeType {
|
|
3500
|
+
private constructor();
|
|
3501
|
+
/**
|
|
3502
|
+
* @remarks
|
|
3503
|
+
* Identifier of the biome type.
|
|
3504
|
+
*
|
|
3505
|
+
*/
|
|
3506
|
+
readonly id: string;
|
|
3507
|
+
}
|
|
3508
|
+
|
|
3509
|
+
/**
|
|
3510
|
+
* @beta
|
|
3511
|
+
* Supports a catalog of available biome types registered
|
|
3512
|
+
* within Minecraft.
|
|
3513
|
+
*/
|
|
3514
|
+
export class BiomeTypes {
|
|
3515
|
+
private constructor();
|
|
3516
|
+
/**
|
|
3517
|
+
* @remarks
|
|
3518
|
+
* Returns a specific biome type.
|
|
3519
|
+
*
|
|
3520
|
+
* @param typeName
|
|
3521
|
+
* Identifier of the biome. Generally, namespaced identifiers
|
|
3522
|
+
* (e.g., minecraft:frozen_peaks) should be used.
|
|
3523
|
+
* @returns
|
|
3524
|
+
* If the biome exists, a BiomeType object is returned. If not,
|
|
3525
|
+
* undefined is returned.
|
|
3526
|
+
*/
|
|
3527
|
+
static get(typeName: string): BiomeType | undefined;
|
|
3528
|
+
/**
|
|
3529
|
+
* @remarks
|
|
3530
|
+
* Returns all registered biome types within Minecraft
|
|
3531
|
+
*
|
|
3532
|
+
*/
|
|
3533
|
+
static getAll(): BiomeType[];
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
/**
|
|
3537
|
+
* Represents a block in a dimension. A block represents a
|
|
3538
|
+
* unique X, Y, and Z within a dimension and get/sets the state
|
|
3539
|
+
* of the block at that location. This type was significantly
|
|
3540
|
+
* updated in version 1.17.10.21.
|
|
3541
|
+
*/
|
|
3542
|
+
export class Block {
|
|
3543
|
+
private constructor();
|
|
3544
|
+
/**
|
|
3545
|
+
* @remarks
|
|
3546
|
+
* Returns the dimension that the block is within.
|
|
3547
|
+
*
|
|
3548
|
+
*/
|
|
3549
|
+
readonly dimension: Dimension;
|
|
3550
|
+
/**
|
|
3551
|
+
* @remarks
|
|
3552
|
+
* Returns true if this block is an air block (i.e., empty
|
|
3553
|
+
* space).
|
|
3554
|
+
*
|
|
3555
|
+
* @throws This property can throw when used.
|
|
3556
|
+
*
|
|
3557
|
+
* {@link LocationInUnloadedChunkError}
|
|
3558
|
+
*
|
|
3559
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3560
|
+
*/
|
|
3561
|
+
readonly isAir: boolean;
|
|
3562
|
+
/**
|
|
3563
|
+
* @remarks
|
|
3564
|
+
* Returns true if this block is a liquid block - (e.g., a
|
|
3565
|
+
* water block and a lava block are liquid, while an air block
|
|
3566
|
+
* and a stone block are not. Water logged blocks are not
|
|
3567
|
+
* liquid blocks).
|
|
3568
|
+
*
|
|
3569
|
+
* @throws This property can throw when used.
|
|
3570
|
+
*
|
|
3571
|
+
* {@link LocationInUnloadedChunkError}
|
|
3572
|
+
*
|
|
3573
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3574
|
+
*/
|
|
3575
|
+
readonly isLiquid: boolean;
|
|
3576
|
+
/**
|
|
3577
|
+
* @beta
|
|
3578
|
+
* @remarks
|
|
3579
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
3580
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
3581
|
+
* ladder block and a fence block are not).
|
|
3582
|
+
*
|
|
3583
|
+
* @throws This property can throw when used.
|
|
3584
|
+
*
|
|
3585
|
+
* {@link LocationInUnloadedChunkError}
|
|
3586
|
+
*
|
|
3587
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3588
|
+
*/
|
|
3589
|
+
readonly isSolid: boolean;
|
|
3590
|
+
/**
|
|
3591
|
+
* @remarks
|
|
3592
|
+
* Returns true if this reference to a block is still valid
|
|
3593
|
+
* (for example, if the block is unloaded, references to that
|
|
3594
|
+
* block will no longer be valid.)
|
|
3595
|
+
*
|
|
3596
|
+
*/
|
|
3597
|
+
readonly isValid: boolean;
|
|
3598
|
+
/**
|
|
3599
|
+
* @remarks
|
|
3600
|
+
* Returns or sets whether this block has water on it.
|
|
3601
|
+
*
|
|
3602
|
+
* @throws This property can throw when used.
|
|
3603
|
+
*
|
|
3604
|
+
* {@link LocationInUnloadedChunkError}
|
|
3605
|
+
*
|
|
3606
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3607
|
+
*/
|
|
3608
|
+
readonly isWaterlogged: boolean;
|
|
3609
|
+
/**
|
|
3610
|
+
* @remarks
|
|
3611
|
+
* Key for the localization of this block's name used in .lang
|
|
3612
|
+
* files.
|
|
3613
|
+
*
|
|
3614
|
+
* @throws This property can throw when used.
|
|
3615
|
+
*
|
|
3616
|
+
* {@link LocationInUnloadedChunkError}
|
|
3617
|
+
*
|
|
3618
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3619
|
+
*/
|
|
3620
|
+
readonly localizationKey: string;
|
|
3621
|
+
/**
|
|
3622
|
+
* @remarks
|
|
3623
|
+
* Coordinates of the specified block.
|
|
3624
|
+
*
|
|
3625
|
+
* @throws This property can throw when used.
|
|
3626
|
+
*/
|
|
3627
|
+
readonly location: Vector3;
|
|
3628
|
+
/**
|
|
3629
|
+
* @remarks
|
|
3630
|
+
* Additional block configuration data that describes the
|
|
3631
|
+
* block.
|
|
3632
|
+
*
|
|
3633
|
+
* @throws This property can throw when used.
|
|
3634
|
+
*
|
|
3635
|
+
* {@link LocationInUnloadedChunkError}
|
|
3636
|
+
*
|
|
3637
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3638
|
+
*/
|
|
3639
|
+
readonly permutation: BlockPermutation;
|
|
3640
|
+
/**
|
|
3641
|
+
* @remarks
|
|
3642
|
+
* Gets the type of block.
|
|
3643
|
+
*
|
|
3644
|
+
* @throws This property can throw when used.
|
|
3645
|
+
*
|
|
3646
|
+
* {@link LocationInUnloadedChunkError}
|
|
3647
|
+
*
|
|
3648
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3649
|
+
*/
|
|
3650
|
+
readonly 'type': BlockType;
|
|
3651
|
+
/**
|
|
3652
|
+
* @remarks
|
|
3653
|
+
* Identifier of the type of block for this block. Warning:
|
|
3654
|
+
* Vanilla block names can be changed in future releases, try
|
|
3655
|
+
* using 'Block.matches' instead for block comparison.
|
|
3656
|
+
*
|
|
3657
|
+
* @throws This property can throw when used.
|
|
3658
|
+
*
|
|
3659
|
+
* {@link LocationInUnloadedChunkError}
|
|
3660
|
+
*
|
|
3661
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3662
|
+
*/
|
|
3663
|
+
readonly typeId: string;
|
|
3664
|
+
/**
|
|
3665
|
+
* @remarks
|
|
3666
|
+
* X coordinate of the block.
|
|
3667
|
+
*
|
|
3668
|
+
*/
|
|
3669
|
+
readonly x: number;
|
|
3670
|
+
/**
|
|
3671
|
+
* @remarks
|
|
3672
|
+
* Y coordinate of the block.
|
|
3673
|
+
*
|
|
3674
|
+
*/
|
|
3675
|
+
readonly y: number;
|
|
3676
|
+
/**
|
|
3677
|
+
* @remarks
|
|
3678
|
+
* Z coordinate of the block.
|
|
3679
|
+
*
|
|
3680
|
+
*/
|
|
3681
|
+
readonly z: number;
|
|
3682
|
+
/**
|
|
3683
|
+
* @remarks
|
|
3684
|
+
* Returns the {@link Block} above this block (positive in the
|
|
3685
|
+
* Y direction).
|
|
3686
|
+
*
|
|
3687
|
+
* @param steps
|
|
3688
|
+
* Number of steps above to step before returning.
|
|
3689
|
+
* Defaults to: 1
|
|
3690
|
+
* @throws This function can throw errors.
|
|
3691
|
+
*
|
|
3692
|
+
* {@link LocationInUnloadedChunkError}
|
|
3693
|
+
*
|
|
3694
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3695
|
+
*/
|
|
3696
|
+
above(steps?: number): Block | undefined;
|
|
3697
|
+
/**
|
|
3698
|
+
* @remarks
|
|
3699
|
+
* Returns the {@link Block} below this block (negative in the
|
|
3700
|
+
* Y direction).
|
|
3701
|
+
*
|
|
3702
|
+
* @param steps
|
|
3703
|
+
* Number of steps below to step before returning.
|
|
3704
|
+
* Defaults to: 1
|
|
3705
|
+
* @throws This function can throw errors.
|
|
3706
|
+
*
|
|
3707
|
+
* {@link LocationInUnloadedChunkError}
|
|
3708
|
+
*
|
|
3709
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3015
3710
|
*/
|
|
3016
3711
|
below(steps?: number): Block | undefined;
|
|
3017
3712
|
/**
|
|
@@ -3057,6 +3752,30 @@ export class Block {
|
|
|
3057
3752
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3058
3753
|
*/
|
|
3059
3754
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
3755
|
+
/**
|
|
3756
|
+
* @beta
|
|
3757
|
+
* @remarks
|
|
3758
|
+
* Checks to see whether it is valid to place the specified
|
|
3759
|
+
* block type or block permutation, on a specified face on this
|
|
3760
|
+
* block.
|
|
3761
|
+
*
|
|
3762
|
+
* @param blockToPlace
|
|
3763
|
+
* Block type or block permutation to check placement for.
|
|
3764
|
+
* @param faceToPlaceOn
|
|
3765
|
+
* Optional specific face of this block to check placement
|
|
3766
|
+
* against.
|
|
3767
|
+
* @returns
|
|
3768
|
+
* Returns `true` if the block type or permutation can be
|
|
3769
|
+
* placed on this block, else `false`.
|
|
3770
|
+
* @throws This function can throw errors.
|
|
3771
|
+
*
|
|
3772
|
+
* {@link Error}
|
|
3773
|
+
*
|
|
3774
|
+
* {@link LocationInUnloadedChunkError}
|
|
3775
|
+
*
|
|
3776
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3777
|
+
*/
|
|
3778
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
3060
3779
|
/**
|
|
3061
3780
|
* @remarks
|
|
3062
3781
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -3124,6 +3843,32 @@ export class Block {
|
|
|
3124
3843
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3125
3844
|
*/
|
|
3126
3845
|
getItemStack(amount?: number, withData?: boolean): ItemStack | undefined;
|
|
3846
|
+
/**
|
|
3847
|
+
* @beta
|
|
3848
|
+
* @remarks
|
|
3849
|
+
* Returns the total brightness level of light shining on a
|
|
3850
|
+
* certain block.
|
|
3851
|
+
*
|
|
3852
|
+
* This function can't be called in read-only mode.
|
|
3853
|
+
*
|
|
3854
|
+
* @returns
|
|
3855
|
+
* The brightness level on the block.
|
|
3856
|
+
* @throws This function can throw errors.
|
|
3857
|
+
*
|
|
3858
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3859
|
+
*
|
|
3860
|
+
* {@link LocationInUnloadedChunkError}
|
|
3861
|
+
*/
|
|
3862
|
+
getLightLevel(): number;
|
|
3863
|
+
/**
|
|
3864
|
+
* @beta
|
|
3865
|
+
* @throws This function can throw errors.
|
|
3866
|
+
*
|
|
3867
|
+
* {@link LocationInUnloadedChunkError}
|
|
3868
|
+
*
|
|
3869
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3870
|
+
*/
|
|
3871
|
+
getMapColor(): RGBA;
|
|
3127
3872
|
/**
|
|
3128
3873
|
* @remarks
|
|
3129
3874
|
* Returns the net redstone power of this block.
|
|
@@ -3138,6 +3883,23 @@ export class Block {
|
|
|
3138
3883
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3139
3884
|
*/
|
|
3140
3885
|
getRedstonePower(): number | undefined;
|
|
3886
|
+
/**
|
|
3887
|
+
* @beta
|
|
3888
|
+
* @remarks
|
|
3889
|
+
* Returns the brightness level of light shining from the sky
|
|
3890
|
+
* on a certain block.
|
|
3891
|
+
*
|
|
3892
|
+
* This function can't be called in read-only mode.
|
|
3893
|
+
*
|
|
3894
|
+
* @returns
|
|
3895
|
+
* The brightness level on the block.
|
|
3896
|
+
* @throws This function can throw errors.
|
|
3897
|
+
*
|
|
3898
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3899
|
+
*
|
|
3900
|
+
* {@link LocationInUnloadedChunkError}
|
|
3901
|
+
*/
|
|
3902
|
+
getSkyLightLevel(): number;
|
|
3141
3903
|
/**
|
|
3142
3904
|
* @remarks
|
|
3143
3905
|
* Returns a set of tags for a block.
|
|
@@ -3359,6 +4121,27 @@ export class Block {
|
|
|
3359
4121
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3360
4122
|
*/
|
|
3361
4123
|
south(steps?: number): Block | undefined;
|
|
4124
|
+
/**
|
|
4125
|
+
* @beta
|
|
4126
|
+
* @remarks
|
|
4127
|
+
* Tries to set the block in the dimension to the state of the
|
|
4128
|
+
* permutation by first checking if the placement is valid.
|
|
4129
|
+
*
|
|
4130
|
+
* This function can't be called in read-only mode.
|
|
4131
|
+
*
|
|
4132
|
+
* @param permutation
|
|
4133
|
+
* Permutation that contains a set of property states for the
|
|
4134
|
+
* Block.
|
|
4135
|
+
* @returns
|
|
4136
|
+
* Returns `true` if the block permutation data was
|
|
4137
|
+
* successfully set, else `false`.
|
|
4138
|
+
* @throws This function can throw errors.
|
|
4139
|
+
*
|
|
4140
|
+
* {@link LocationInUnloadedChunkError}
|
|
4141
|
+
*
|
|
4142
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4143
|
+
*/
|
|
4144
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
3362
4145
|
/**
|
|
3363
4146
|
* @remarks
|
|
3364
4147
|
* Returns the {@link Block} to the west of this block
|
|
@@ -3376,6 +4159,137 @@ export class Block {
|
|
|
3376
4159
|
west(steps?: number): Block | undefined;
|
|
3377
4160
|
}
|
|
3378
4161
|
|
|
4162
|
+
/**
|
|
4163
|
+
* @beta
|
|
4164
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4165
|
+
* of useful functions for the creation and utility of {@link
|
|
4166
|
+
* BlockBoundingBox} objects
|
|
4167
|
+
*/
|
|
4168
|
+
export class BlockBoundingBoxUtils {
|
|
4169
|
+
private constructor();
|
|
4170
|
+
/**
|
|
4171
|
+
* @remarks
|
|
4172
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4173
|
+
* where the min and max components are guaranteed to be (min
|
|
4174
|
+
* <= max)
|
|
4175
|
+
*
|
|
4176
|
+
* This function can't be called in read-only mode.
|
|
4177
|
+
*
|
|
4178
|
+
* @param min
|
|
4179
|
+
* A corner world location
|
|
4180
|
+
* @param max
|
|
4181
|
+
* A corner world location diametrically opposite
|
|
4182
|
+
*/
|
|
4183
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4184
|
+
/**
|
|
4185
|
+
* @remarks
|
|
4186
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4187
|
+
* each axis.
|
|
4188
|
+
* Sizes can be negative to perform contraction.
|
|
4189
|
+
* Note: corners can be inverted if the contraction size is
|
|
4190
|
+
* greater than the span, but the min/max relationship will
|
|
4191
|
+
* remain correct
|
|
4192
|
+
*
|
|
4193
|
+
* This function can't be called in read-only mode.
|
|
4194
|
+
*
|
|
4195
|
+
* @returns
|
|
4196
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4197
|
+
* the changes
|
|
4198
|
+
*/
|
|
4199
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4200
|
+
/**
|
|
4201
|
+
* @remarks
|
|
4202
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4203
|
+
*
|
|
4204
|
+
* This function can't be called in read-only mode.
|
|
4205
|
+
*
|
|
4206
|
+
*/
|
|
4207
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4208
|
+
/**
|
|
4209
|
+
* @remarks
|
|
4210
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4211
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4212
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4213
|
+
* boxes.
|
|
4214
|
+
*
|
|
4215
|
+
* This function can't be called in read-only mode.
|
|
4216
|
+
*
|
|
4217
|
+
* @returns
|
|
4218
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4219
|
+
* smallest possible bounding box which can encompass both
|
|
4220
|
+
*/
|
|
4221
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4222
|
+
/**
|
|
4223
|
+
* @remarks
|
|
4224
|
+
* Calculate the center block of a given {@link
|
|
4225
|
+
* BlockBoundingBox} object.
|
|
4226
|
+
*
|
|
4227
|
+
* This function can't be called in read-only mode.
|
|
4228
|
+
*
|
|
4229
|
+
* @returns
|
|
4230
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4231
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4232
|
+
* bounds are not mathematically centered...
|
|
4233
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4234
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4235
|
+
*/
|
|
4236
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4237
|
+
/**
|
|
4238
|
+
* @remarks
|
|
4239
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4240
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4241
|
+
*
|
|
4242
|
+
* This function can't be called in read-only mode.
|
|
4243
|
+
*
|
|
4244
|
+
*/
|
|
4245
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4246
|
+
/**
|
|
4247
|
+
* @remarks
|
|
4248
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4249
|
+
*
|
|
4250
|
+
* This function can't be called in read-only mode.
|
|
4251
|
+
*
|
|
4252
|
+
*/
|
|
4253
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4254
|
+
/**
|
|
4255
|
+
* @remarks
|
|
4256
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4257
|
+
*
|
|
4258
|
+
* This function can't be called in read-only mode.
|
|
4259
|
+
*
|
|
4260
|
+
*/
|
|
4261
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4262
|
+
/**
|
|
4263
|
+
* @remarks
|
|
4264
|
+
* Check to see if a given coordinate is inside a
|
|
4265
|
+
* BlockBoundingBox
|
|
4266
|
+
*
|
|
4267
|
+
* This function can't be called in read-only mode.
|
|
4268
|
+
*
|
|
4269
|
+
*/
|
|
4270
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4271
|
+
/**
|
|
4272
|
+
* @remarks
|
|
4273
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4274
|
+
* max))
|
|
4275
|
+
*
|
|
4276
|
+
* This function can't be called in read-only mode.
|
|
4277
|
+
*
|
|
4278
|
+
*/
|
|
4279
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4280
|
+
/**
|
|
4281
|
+
* @remarks
|
|
4282
|
+
* Move a BlockBoundingBox by a given amount
|
|
4283
|
+
*
|
|
4284
|
+
* This function can't be called in read-only mode.
|
|
4285
|
+
*
|
|
4286
|
+
* @returns
|
|
4287
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4288
|
+
* change
|
|
4289
|
+
*/
|
|
4290
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4291
|
+
}
|
|
4292
|
+
|
|
3379
4293
|
/**
|
|
3380
4294
|
* Base type for components associated with blocks.
|
|
3381
4295
|
*/
|
|
@@ -3797,10 +4711,22 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
3797
4711
|
private constructor();
|
|
3798
4712
|
/**
|
|
3799
4713
|
* @remarks
|
|
3800
|
-
* This function can't be called in read-only mode.
|
|
4714
|
+
* This function can't be called in read-only mode.
|
|
4715
|
+
*
|
|
4716
|
+
*/
|
|
4717
|
+
[Symbol.iterator](): Iterator<Vector3>;
|
|
4718
|
+
/**
|
|
4719
|
+
* @beta
|
|
4720
|
+
* @remarks
|
|
4721
|
+
* Checks if the underlining block volume has been invalidated.
|
|
4722
|
+
* Will return false if the block volume was modified between
|
|
4723
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
4724
|
+
*
|
|
4725
|
+
* @throws This function can throw errors.
|
|
3801
4726
|
*
|
|
4727
|
+
* {@link minecraftcommon.EngineError}
|
|
3802
4728
|
*/
|
|
3803
|
-
|
|
4729
|
+
isValid(): boolean;
|
|
3804
4730
|
/**
|
|
3805
4731
|
* @remarks
|
|
3806
4732
|
* This function can't be called in read-only mode.
|
|
@@ -4204,6 +5130,45 @@ export class BlockRecordPlayerComponent extends BlockComponent {
|
|
|
4204
5130
|
setRecord(recordItemType?: ItemType | string, startPlaying?: boolean): void;
|
|
4205
5131
|
}
|
|
4206
5132
|
|
|
5133
|
+
/**
|
|
5134
|
+
* @beta
|
|
5135
|
+
* Represents a block that can output a redstone signal.
|
|
5136
|
+
*/
|
|
5137
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5138
|
+
export class BlockRedstoneProducerComponent extends BlockComponent {
|
|
5139
|
+
private constructor();
|
|
5140
|
+
/**
|
|
5141
|
+
* @remarks
|
|
5142
|
+
* Gets the power that this block outputs to circuit system.
|
|
5143
|
+
*
|
|
5144
|
+
* @throws This property can throw when used.
|
|
5145
|
+
*
|
|
5146
|
+
* {@link InvalidBlockComponentError}
|
|
5147
|
+
*/
|
|
5148
|
+
readonly power: number;
|
|
5149
|
+
static readonly componentId = 'minecraft:redstone_producer';
|
|
5150
|
+
/**
|
|
5151
|
+
* @remarks
|
|
5152
|
+
* Gets the faces of this block that can connect to the circuit
|
|
5153
|
+
* and output power.
|
|
5154
|
+
*
|
|
5155
|
+
* @throws This function can throw errors.
|
|
5156
|
+
*
|
|
5157
|
+
* {@link InvalidBlockComponentError}
|
|
5158
|
+
*/
|
|
5159
|
+
getConnectedFaces(): Direction[];
|
|
5160
|
+
/**
|
|
5161
|
+
* @remarks
|
|
5162
|
+
* Gets the block face that strongly powers the block touching
|
|
5163
|
+
* it.
|
|
5164
|
+
*
|
|
5165
|
+
* @throws This function can throw errors.
|
|
5166
|
+
*
|
|
5167
|
+
* {@link InvalidBlockComponentError}
|
|
5168
|
+
*/
|
|
5169
|
+
getStronglyPoweredFace(): Direction | undefined;
|
|
5170
|
+
}
|
|
5171
|
+
|
|
4207
5172
|
/**
|
|
4208
5173
|
* Represents a block that can display text on it.
|
|
4209
5174
|
* @example addSign.ts
|
|
@@ -4597,6 +5562,15 @@ export class BlockVolumeBase {
|
|
|
4597
5562
|
*
|
|
4598
5563
|
*/
|
|
4599
5564
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
5565
|
+
/**
|
|
5566
|
+
* @beta
|
|
5567
|
+
* @remarks
|
|
5568
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
5569
|
+
* the validated min and max coordinates of the volume
|
|
5570
|
+
*
|
|
5571
|
+
* @throws This function can throw errors.
|
|
5572
|
+
*/
|
|
5573
|
+
getBoundingBox(): BlockBoundingBox;
|
|
4600
5574
|
/**
|
|
4601
5575
|
* @remarks
|
|
4602
5576
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -4808,6 +5782,23 @@ export class Camera {
|
|
|
4808
5782
|
| CameraSetRotOptions
|
|
4809
5783
|
| CameraTargetOptions,
|
|
4810
5784
|
): void;
|
|
5785
|
+
/**
|
|
5786
|
+
* @beta
|
|
5787
|
+
* @remarks
|
|
5788
|
+
* Sets the current active camera with easing.
|
|
5789
|
+
*
|
|
5790
|
+
* This function can't be called in read-only mode.
|
|
5791
|
+
*
|
|
5792
|
+
* @param cameraPreset
|
|
5793
|
+
* Identifier of a camera preset file defined within JSON.
|
|
5794
|
+
* @param easeOptions
|
|
5795
|
+
* Options to ease the camera from the previous camera to the
|
|
5796
|
+
* current one.
|
|
5797
|
+
* @throws
|
|
5798
|
+
* Throws when easing to minecraft:first_person presets
|
|
5799
|
+
* currently without the experimental cameras toggle enabled.
|
|
5800
|
+
*/
|
|
5801
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
4811
5802
|
/**
|
|
4812
5803
|
* @remarks
|
|
4813
5804
|
* Sets the current active camera for the specified player and
|
|
@@ -4834,6 +5825,158 @@ export class Camera {
|
|
|
4834
5825
|
setFov(fovCameraOptions?: CameraFovOptions): void;
|
|
4835
5826
|
}
|
|
4836
5827
|
|
|
5828
|
+
/**
|
|
5829
|
+
* @beta
|
|
5830
|
+
* An event that fires as players enter chat messages.
|
|
5831
|
+
*/
|
|
5832
|
+
export class ChatSendAfterEvent {
|
|
5833
|
+
private constructor();
|
|
5834
|
+
/**
|
|
5835
|
+
* @remarks
|
|
5836
|
+
* Message that is being broadcast.
|
|
5837
|
+
*
|
|
5838
|
+
*/
|
|
5839
|
+
readonly message: string;
|
|
5840
|
+
/**
|
|
5841
|
+
* @remarks
|
|
5842
|
+
* Player that sent the chat message.
|
|
5843
|
+
*
|
|
5844
|
+
*/
|
|
5845
|
+
readonly sender: Player;
|
|
5846
|
+
/**
|
|
5847
|
+
* @remarks
|
|
5848
|
+
* Optional list of players that will receive this message. If
|
|
5849
|
+
* defined, this message is directly targeted to one or more
|
|
5850
|
+
* players (i.e., is not broadcast.)
|
|
5851
|
+
*
|
|
5852
|
+
*/
|
|
5853
|
+
readonly targets?: Player[];
|
|
5854
|
+
}
|
|
5855
|
+
|
|
5856
|
+
/**
|
|
5857
|
+
* @beta
|
|
5858
|
+
* Manages callbacks that are connected to chat messages being
|
|
5859
|
+
* sent.
|
|
5860
|
+
*/
|
|
5861
|
+
export class ChatSendAfterEventSignal {
|
|
5862
|
+
private constructor();
|
|
5863
|
+
/**
|
|
5864
|
+
* @remarks
|
|
5865
|
+
* Adds a callback that will be called when new chat messages
|
|
5866
|
+
* are sent.
|
|
5867
|
+
*
|
|
5868
|
+
* This function can't be called in read-only mode.
|
|
5869
|
+
*
|
|
5870
|
+
* This function can be called in early-execution mode.
|
|
5871
|
+
*
|
|
5872
|
+
*/
|
|
5873
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
5874
|
+
/**
|
|
5875
|
+
* @remarks
|
|
5876
|
+
* Removes a callback from being called when new chat messages
|
|
5877
|
+
* are sent.
|
|
5878
|
+
*
|
|
5879
|
+
* This function can't be called in read-only mode.
|
|
5880
|
+
*
|
|
5881
|
+
* This function can be called in early-execution mode.
|
|
5882
|
+
*
|
|
5883
|
+
*/
|
|
5884
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
5885
|
+
}
|
|
5886
|
+
|
|
5887
|
+
/**
|
|
5888
|
+
* @beta
|
|
5889
|
+
* An event that fires as players enter chat messages.
|
|
5890
|
+
*/
|
|
5891
|
+
export class ChatSendBeforeEvent {
|
|
5892
|
+
private constructor();
|
|
5893
|
+
/**
|
|
5894
|
+
* @remarks
|
|
5895
|
+
* If set to true in a beforeChat event handler, this message
|
|
5896
|
+
* is not broadcast out.
|
|
5897
|
+
*
|
|
5898
|
+
*/
|
|
5899
|
+
cancel: boolean;
|
|
5900
|
+
/**
|
|
5901
|
+
* @remarks
|
|
5902
|
+
* Message that is being broadcast.
|
|
5903
|
+
*
|
|
5904
|
+
*/
|
|
5905
|
+
readonly message: string;
|
|
5906
|
+
/**
|
|
5907
|
+
* @remarks
|
|
5908
|
+
* Player that sent the chat message.
|
|
5909
|
+
*
|
|
5910
|
+
*/
|
|
5911
|
+
readonly sender: Player;
|
|
5912
|
+
/**
|
|
5913
|
+
* @remarks
|
|
5914
|
+
* Optional list of players that will receive this message. If
|
|
5915
|
+
* defined, this message is directly targeted to one or more
|
|
5916
|
+
* players (i.e., is not broadcast.)
|
|
5917
|
+
*
|
|
5918
|
+
*/
|
|
5919
|
+
readonly targets?: Player[];
|
|
5920
|
+
}
|
|
5921
|
+
|
|
5922
|
+
/**
|
|
5923
|
+
* @beta
|
|
5924
|
+
* Manages callbacks that are connected to an event that fires
|
|
5925
|
+
* before chat messages are sent.
|
|
5926
|
+
* @example customCommand.ts
|
|
5927
|
+
* ```typescript
|
|
5928
|
+
* import { world, DimensionLocation } from "@minecraft/server";
|
|
5929
|
+
*
|
|
5930
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
5931
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
|
|
5932
|
+
* if (eventData.message.includes("cancel")) {
|
|
5933
|
+
* // Cancel event if the message contains "cancel"
|
|
5934
|
+
* eventData.cancel = true;
|
|
5935
|
+
* } else {
|
|
5936
|
+
* const args = eventData.message.split(" ");
|
|
5937
|
+
*
|
|
5938
|
+
* if (args.length > 0) {
|
|
5939
|
+
* switch (args[0].toLowerCase()) {
|
|
5940
|
+
* case "echo":
|
|
5941
|
+
* // Send a modified version of chat message
|
|
5942
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
5943
|
+
* break;
|
|
5944
|
+
* case "help":
|
|
5945
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
5946
|
+
* break;
|
|
5947
|
+
* }
|
|
5948
|
+
* }
|
|
5949
|
+
* }
|
|
5950
|
+
* });
|
|
5951
|
+
* }
|
|
5952
|
+
* ```
|
|
5953
|
+
*/
|
|
5954
|
+
export class ChatSendBeforeEventSignal {
|
|
5955
|
+
private constructor();
|
|
5956
|
+
/**
|
|
5957
|
+
* @remarks
|
|
5958
|
+
* Adds a callback that will be called before new chat messages
|
|
5959
|
+
* are sent.
|
|
5960
|
+
*
|
|
5961
|
+
* This function can't be called in read-only mode.
|
|
5962
|
+
*
|
|
5963
|
+
* This function can be called in early-execution mode.
|
|
5964
|
+
*
|
|
5965
|
+
*/
|
|
5966
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
5967
|
+
/**
|
|
5968
|
+
* @remarks
|
|
5969
|
+
* Removes a callback from being called before new chat
|
|
5970
|
+
* messages are sent.
|
|
5971
|
+
*
|
|
5972
|
+
* This function can't be called in read-only mode.
|
|
5973
|
+
*
|
|
5974
|
+
* This function can be called in early-execution mode.
|
|
5975
|
+
*
|
|
5976
|
+
*/
|
|
5977
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
5978
|
+
}
|
|
5979
|
+
|
|
4837
5980
|
/**
|
|
4838
5981
|
* Contains the device information for a client instance.
|
|
4839
5982
|
*/
|
|
@@ -4842,53 +5985,305 @@ export class ClientSystemInfo extends SystemInfo {
|
|
|
4842
5985
|
private constructor();
|
|
4843
5986
|
/**
|
|
4844
5987
|
* @remarks
|
|
4845
|
-
* The max render distance for the device in chunks.
|
|
5988
|
+
* The max render distance for the device in chunks.
|
|
5989
|
+
*
|
|
5990
|
+
*/
|
|
5991
|
+
readonly maxRenderDistance: number;
|
|
5992
|
+
/**
|
|
5993
|
+
* @remarks
|
|
5994
|
+
* The platform type of the device.
|
|
5995
|
+
*
|
|
5996
|
+
*/
|
|
5997
|
+
readonly platformType: PlatformType;
|
|
5998
|
+
}
|
|
5999
|
+
|
|
6000
|
+
/**
|
|
6001
|
+
* Contains return data on the result of a command execution.
|
|
6002
|
+
*/
|
|
6003
|
+
export class CommandResult {
|
|
6004
|
+
private constructor();
|
|
6005
|
+
/**
|
|
6006
|
+
* @remarks
|
|
6007
|
+
* If the command operates against a number of entities,
|
|
6008
|
+
* blocks, or items, this returns the number of successful
|
|
6009
|
+
* applications of this command.
|
|
6010
|
+
*
|
|
6011
|
+
*/
|
|
6012
|
+
readonly successCount: number;
|
|
6013
|
+
}
|
|
6014
|
+
|
|
6015
|
+
/**
|
|
6016
|
+
* Base class for downstream Component implementations.
|
|
6017
|
+
*/
|
|
6018
|
+
export class Component {
|
|
6019
|
+
private constructor();
|
|
6020
|
+
/**
|
|
6021
|
+
* @remarks
|
|
6022
|
+
* Returns whether the component is valid. A component is
|
|
6023
|
+
* considered valid if its owner is valid, in addition to any
|
|
6024
|
+
* addition to any additional validation required by the
|
|
6025
|
+
* component.
|
|
6026
|
+
*
|
|
6027
|
+
*/
|
|
6028
|
+
readonly isValid: boolean;
|
|
6029
|
+
/**
|
|
6030
|
+
* @remarks
|
|
6031
|
+
* Identifier of the component.
|
|
6032
|
+
*
|
|
6033
|
+
*/
|
|
6034
|
+
readonly typeId: string;
|
|
6035
|
+
}
|
|
6036
|
+
|
|
6037
|
+
/**
|
|
6038
|
+
* @beta
|
|
6039
|
+
* The Compound Block Volume is a collection of individual
|
|
6040
|
+
* block volume definitions which, as a collection, define a
|
|
6041
|
+
* larger volume of (sometimes non-contiguous) irregular
|
|
6042
|
+
* shapes.
|
|
6043
|
+
* This class is loosely based on the concept of CSG
|
|
6044
|
+
* (Computational Solid Geometry) and allows a user to create
|
|
6045
|
+
* complex volumes by building a stack of volumes and voids to
|
|
6046
|
+
* make a larger single volume.
|
|
6047
|
+
* For example - normally a creator would create a hollow cube
|
|
6048
|
+
* by creating 6 "wall" surfaces for each face.
|
|
6049
|
+
* With a Compound Block Volume, a creator can define a hollow
|
|
6050
|
+
* cube by creating a single outer solid cube, and then
|
|
6051
|
+
* defining a further single 'void' cube inside the larger one.
|
|
6052
|
+
* Similarly, the Compound Block Volume can represent irregular
|
|
6053
|
+
* shaped volumes (e.g. a tree consists of a trunk and lots of
|
|
6054
|
+
* leaf cubes which are not necessarily contiguously placed).
|
|
6055
|
+
* Each of the volumes added to the CompoundBlockVolume are (by
|
|
6056
|
+
* default) relative to the origin set (either at construction
|
|
6057
|
+
* or via one of the set functions).
|
|
6058
|
+
* However, it is also possible to push volumes to the compound
|
|
6059
|
+
* collection which are absolute in nature and are not affected
|
|
6060
|
+
* by origin changes.
|
|
6061
|
+
*/
|
|
6062
|
+
export class CompoundBlockVolume {
|
|
6063
|
+
/**
|
|
6064
|
+
* @remarks
|
|
6065
|
+
* Return the 'capacity' of the bounding rectangle which
|
|
6066
|
+
* represents the collection of volumes in the stack
|
|
6067
|
+
*
|
|
6068
|
+
*/
|
|
6069
|
+
readonly capacity: number;
|
|
6070
|
+
readonly items: CompoundBlockVolumeItem[];
|
|
6071
|
+
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
6072
|
+
/**
|
|
6073
|
+
* @remarks
|
|
6074
|
+
* Return the number of volumes (positive and negative) in the
|
|
6075
|
+
* volume stack
|
|
6076
|
+
*
|
|
6077
|
+
*/
|
|
6078
|
+
readonly volumeCount: number;
|
|
6079
|
+
/**
|
|
6080
|
+
* @remarks
|
|
6081
|
+
* Create a CompoundBlockVolume object
|
|
6082
|
+
*
|
|
6083
|
+
* @param origin
|
|
6084
|
+
* An optional world space origin on which to center the
|
|
6085
|
+
* compound volume.
|
|
6086
|
+
* If not specified, the origin is set to (0,0,0)
|
|
6087
|
+
*/
|
|
6088
|
+
constructor(origin?: Vector3);
|
|
6089
|
+
/**
|
|
6090
|
+
* @remarks
|
|
6091
|
+
* Clear the contents of the volume stack
|
|
6092
|
+
*
|
|
6093
|
+
* This function can't be called in read-only mode.
|
|
6094
|
+
*
|
|
6095
|
+
*/
|
|
6096
|
+
clear(): void;
|
|
6097
|
+
/**
|
|
6098
|
+
* @remarks
|
|
6099
|
+
* Fetch a Block Location Iterator for the Compound Block
|
|
6100
|
+
* Volume. This iterator will allow a creator to iterate
|
|
6101
|
+
* across all of the selected volumes within the larger
|
|
6102
|
+
* bounding area.
|
|
6103
|
+
* Areas of a volume which have been overridden by a
|
|
6104
|
+
* subtractive volume will not be included in the iterator
|
|
6105
|
+
* step.
|
|
6106
|
+
* (i.e. if you push a cube to the stack, and then push a
|
|
6107
|
+
* subtractive volume to the same location, then the iterator
|
|
6108
|
+
* will step over the initial volume because it is considered
|
|
6109
|
+
* negative space)
|
|
6110
|
+
* Note that the Block Locations returned by this iterator are
|
|
6111
|
+
* in absolute world space (irrespective of whether the
|
|
6112
|
+
* compound volume items pushed are absolute or relative)
|
|
6113
|
+
*
|
|
6114
|
+
* This function can't be called in read-only mode.
|
|
6115
|
+
*
|
|
6116
|
+
*/
|
|
6117
|
+
getBlockLocationIterator(): BlockLocationIterator;
|
|
6118
|
+
/**
|
|
6119
|
+
* @remarks
|
|
6120
|
+
* Get the largest bounding box that represents a container for
|
|
6121
|
+
* all of the volumes on the stack
|
|
6122
|
+
* Note that the bounding box returned is represented in
|
|
6123
|
+
* absolute world space (irrespective of whether the compound
|
|
6124
|
+
* volume items pushed are absolute or relative)
|
|
6125
|
+
*
|
|
6126
|
+
* This function can't be called in read-only mode.
|
|
6127
|
+
*
|
|
6128
|
+
*/
|
|
6129
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6130
|
+
/**
|
|
6131
|
+
* @remarks
|
|
6132
|
+
* Get the max block location of the outermost bounding
|
|
6133
|
+
* rectangle which represents the volumes on the stack.
|
|
6134
|
+
* Note that the max location returned is in absolute world
|
|
6135
|
+
* space (irrespective of whether the compound volume items
|
|
6136
|
+
* pushed are absolute or relative)
|
|
6137
|
+
*
|
|
6138
|
+
* This function can't be called in read-only mode.
|
|
6139
|
+
*
|
|
6140
|
+
*/
|
|
6141
|
+
getMax(): Vector3;
|
|
6142
|
+
/**
|
|
6143
|
+
* @remarks
|
|
6144
|
+
* Get the min block location of the outermost bounding
|
|
6145
|
+
* rectangle which represents the volumes on the stack.
|
|
6146
|
+
* Note that the min location returned is in absolute world
|
|
6147
|
+
* space (irrespective of whether the compound volume items
|
|
6148
|
+
* pushed are absolute or relative)
|
|
6149
|
+
*
|
|
6150
|
+
* This function can't be called in read-only mode.
|
|
6151
|
+
*
|
|
6152
|
+
*/
|
|
6153
|
+
getMin(): Vector3;
|
|
6154
|
+
/**
|
|
6155
|
+
* @remarks
|
|
6156
|
+
* Fetch the origin in world space of the compound volume
|
|
6157
|
+
*
|
|
6158
|
+
* This function can't be called in read-only mode.
|
|
6159
|
+
*
|
|
6160
|
+
*/
|
|
6161
|
+
getOrigin(): Vector3;
|
|
6162
|
+
/**
|
|
6163
|
+
* @remarks
|
|
6164
|
+
* Return a boolean which signals if there are any volume items
|
|
6165
|
+
* pushed to the volume
|
|
6166
|
+
*
|
|
6167
|
+
* This function can't be called in read-only mode.
|
|
6168
|
+
*
|
|
6169
|
+
*/
|
|
6170
|
+
isEmpty(): boolean;
|
|
6171
|
+
/**
|
|
6172
|
+
* @remarks
|
|
6173
|
+
* Return a boolean representing whether or not a given
|
|
6174
|
+
* absolute world space block location is inside a positive
|
|
6175
|
+
* block volume.
|
|
6176
|
+
* E.g. if the stack contains a large cube followed by a
|
|
6177
|
+
* slightly smaller negative cube, and the test location is
|
|
6178
|
+
* within the negative cube - the function will return false
|
|
6179
|
+
* because it's not 'inside' a volume (it IS inside the
|
|
6180
|
+
* bounding rectangle, but it is not inside a positively
|
|
6181
|
+
* defined location)
|
|
6182
|
+
*
|
|
6183
|
+
* This function can't be called in read-only mode.
|
|
6184
|
+
*
|
|
6185
|
+
*/
|
|
6186
|
+
isInside(worldLocation: Vector3): boolean;
|
|
6187
|
+
/**
|
|
6188
|
+
* @remarks
|
|
6189
|
+
* Inspect the last entry pushed to the volume stack without
|
|
6190
|
+
* affecting the stack contents.
|
|
6191
|
+
*
|
|
6192
|
+
* This function can't be called in read-only mode.
|
|
6193
|
+
*
|
|
6194
|
+
* @param forceRelativity
|
|
6195
|
+
* Determine whether the function returns a
|
|
6196
|
+
* CompoundBlockVolumeItem which is forced into either relative
|
|
6197
|
+
* or absolute coordinate system.
|
|
6198
|
+
* `true` = force returned item to be relative to volume origin
|
|
6199
|
+
* `false` = force returned item to be absolute world space
|
|
6200
|
+
* location
|
|
4846
6201
|
*
|
|
6202
|
+
* If no flag is specified, the item returned retains whatever
|
|
6203
|
+
* relativity it had when it was pushed
|
|
6204
|
+
* @returns
|
|
6205
|
+
* Returns undefined if the stack is empty
|
|
4847
6206
|
*/
|
|
4848
|
-
|
|
6207
|
+
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
4849
6208
|
/**
|
|
4850
6209
|
* @remarks
|
|
4851
|
-
*
|
|
6210
|
+
* Remove the last entry from the volume stack. This will
|
|
6211
|
+
* reduce the stack size by one
|
|
6212
|
+
*
|
|
6213
|
+
* This function can't be called in read-only mode.
|
|
4852
6214
|
*
|
|
4853
6215
|
*/
|
|
4854
|
-
|
|
4855
|
-
}
|
|
4856
|
-
|
|
4857
|
-
/**
|
|
4858
|
-
* Contains return data on the result of a command execution.
|
|
4859
|
-
*/
|
|
4860
|
-
export class CommandResult {
|
|
4861
|
-
private constructor();
|
|
6216
|
+
popVolume(): boolean;
|
|
4862
6217
|
/**
|
|
4863
6218
|
* @remarks
|
|
4864
|
-
*
|
|
4865
|
-
*
|
|
4866
|
-
*
|
|
6219
|
+
* Push a volume item to the stack. The volume item contains
|
|
6220
|
+
* an 'action' parameter which determines whether this volume
|
|
6221
|
+
* is a positive or negative space.
|
|
6222
|
+
* The item also contains a `locationRelativity` which
|
|
6223
|
+
* determines whether it is relative or absolute to the
|
|
6224
|
+
* compound volume origin
|
|
4867
6225
|
*
|
|
6226
|
+
* This function can't be called in read-only mode.
|
|
6227
|
+
*
|
|
6228
|
+
* @param item
|
|
6229
|
+
* Item to push to the end of the stack
|
|
4868
6230
|
*/
|
|
4869
|
-
|
|
4870
|
-
}
|
|
4871
|
-
|
|
4872
|
-
/**
|
|
4873
|
-
* Base class for downstream Component implementations.
|
|
4874
|
-
*/
|
|
4875
|
-
export class Component {
|
|
4876
|
-
private constructor();
|
|
6231
|
+
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
4877
6232
|
/**
|
|
4878
6233
|
* @remarks
|
|
4879
|
-
*
|
|
4880
|
-
*
|
|
4881
|
-
*
|
|
4882
|
-
*
|
|
6234
|
+
* If the volume stack is empty, this function will push the
|
|
6235
|
+
* specified item to the stack.
|
|
6236
|
+
* If the volume stack is NOT empty, this function will replace
|
|
6237
|
+
* the last item on the stack with the new item.
|
|
6238
|
+
*
|
|
6239
|
+
* This function can't be called in read-only mode.
|
|
4883
6240
|
*
|
|
6241
|
+
* @param item
|
|
6242
|
+
* Item to add or replace
|
|
4884
6243
|
*/
|
|
4885
|
-
|
|
6244
|
+
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
4886
6245
|
/**
|
|
4887
6246
|
* @remarks
|
|
4888
|
-
*
|
|
6247
|
+
* Set the origin of the compound volume to an absolute world
|
|
6248
|
+
* space location
|
|
6249
|
+
*
|
|
6250
|
+
* This function can't be called in read-only mode.
|
|
4889
6251
|
*
|
|
6252
|
+
* @param preserveExistingVolumes
|
|
6253
|
+
* This optional boolean flag determines whether the relative
|
|
6254
|
+
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
6255
|
+
* affected by the new origin.
|
|
6256
|
+
* Imagine a scenario where you have a series of relative
|
|
6257
|
+
* locations around an origin which make up a sphere; all of
|
|
6258
|
+
* these locations are in the range of -2 to 2.
|
|
6259
|
+
* Push each of these locations to the compound volume as
|
|
6260
|
+
* relative items.
|
|
6261
|
+
* Now, move the origin and all of the locations representing
|
|
6262
|
+
* the sphere move accordingly.
|
|
6263
|
+
* However, let's say you want to add a 2nd sphere next to the
|
|
6264
|
+
* 1st.
|
|
6265
|
+
* In this case, set the new origin a few locations over, but
|
|
6266
|
+
* 'preserveExistingVolumes' = true.
|
|
6267
|
+
* This will set a new origin, but the existing sphere
|
|
6268
|
+
* locations will remain relative to the original origin.
|
|
6269
|
+
* Now, you can push the relative sphere locations again (this
|
|
6270
|
+
* time they will be relative to the new origin) - resulting in
|
|
6271
|
+
* 2 spheres next to each other.
|
|
4890
6272
|
*/
|
|
4891
|
-
|
|
6273
|
+
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6274
|
+
/**
|
|
6275
|
+
* @remarks
|
|
6276
|
+
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
6277
|
+
* function will translate the origin by a given delta to a new
|
|
6278
|
+
* position
|
|
6279
|
+
*
|
|
6280
|
+
* This function can't be called in read-only mode.
|
|
6281
|
+
*
|
|
6282
|
+
* @param preserveExistingVolumes
|
|
6283
|
+
* See the description for the arguments to {@link
|
|
6284
|
+
* CompoundBlockVolume.setOrigin}
|
|
6285
|
+
*/
|
|
6286
|
+
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
4892
6287
|
}
|
|
4893
6288
|
|
|
4894
6289
|
/**
|
|
@@ -4973,6 +6368,10 @@ export class Component {
|
|
|
4973
6368
|
*/
|
|
4974
6369
|
export class Container {
|
|
4975
6370
|
private constructor();
|
|
6371
|
+
/**
|
|
6372
|
+
* @beta
|
|
6373
|
+
*/
|
|
6374
|
+
readonly containerRules?: ContainerRules;
|
|
4976
6375
|
/**
|
|
4977
6376
|
* @remarks
|
|
4978
6377
|
* Count of the slots in the container that are empty.
|
|
@@ -5000,6 +6399,16 @@ export class Container {
|
|
|
5000
6399
|
* Throws if the container is invalid.
|
|
5001
6400
|
*/
|
|
5002
6401
|
readonly size: number;
|
|
6402
|
+
/**
|
|
6403
|
+
* @beta
|
|
6404
|
+
* @remarks
|
|
6405
|
+
* The combined weight of all items in the container.
|
|
6406
|
+
*
|
|
6407
|
+
* @throws This property can throw when used.
|
|
6408
|
+
*
|
|
6409
|
+
* {@link InvalidContainerError}
|
|
6410
|
+
*/
|
|
6411
|
+
readonly weight: number;
|
|
5003
6412
|
/**
|
|
5004
6413
|
* @remarks
|
|
5005
6414
|
* Adds an item to the container. The item is placed in the
|
|
@@ -5011,7 +6420,9 @@ export class Container {
|
|
|
5011
6420
|
*
|
|
5012
6421
|
* @param itemStack
|
|
5013
6422
|
* The stack of items to add.
|
|
5014
|
-
* @throws
|
|
6423
|
+
* @throws
|
|
6424
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
6425
|
+
* limit but will instead add items up to the weight limit.
|
|
5015
6426
|
*
|
|
5016
6427
|
* {@link ContainerRulesError}
|
|
5017
6428
|
*
|
|
@@ -5243,6 +6654,8 @@ export class Container {
|
|
|
5243
6654
|
* @throws
|
|
5244
6655
|
* Throws if either this container or `toContainer` are invalid
|
|
5245
6656
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
6657
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
6658
|
+
* limit but will instead add items up to the weight limit.
|
|
5246
6659
|
*
|
|
5247
6660
|
* {@link ContainerRulesError}
|
|
5248
6661
|
*
|
|
@@ -5598,6 +7011,23 @@ export class ContainerSlot {
|
|
|
5598
7011
|
* {@link InvalidContainerSlotError}
|
|
5599
7012
|
*/
|
|
5600
7013
|
setCanPlaceOn(blockIdentifiers?: string[]): void;
|
|
7014
|
+
/**
|
|
7015
|
+
* @beta
|
|
7016
|
+
* @remarks
|
|
7017
|
+
* Sets multiple dynamic properties with specific values.
|
|
7018
|
+
*
|
|
7019
|
+
* @param values
|
|
7020
|
+
* A Record of key value pairs of the dynamic properties to
|
|
7021
|
+
* set.
|
|
7022
|
+
* @throws This function can throw errors.
|
|
7023
|
+
*
|
|
7024
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
7025
|
+
*
|
|
7026
|
+
* {@link InvalidContainerSlotError}
|
|
7027
|
+
*
|
|
7028
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
7029
|
+
*/
|
|
7030
|
+
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
5601
7031
|
/**
|
|
5602
7032
|
* @remarks
|
|
5603
7033
|
* Sets a specified property to a value.
|
|
@@ -5750,6 +7180,22 @@ export class CustomComponentParameters {
|
|
|
5750
7180
|
readonly params: unknown;
|
|
5751
7181
|
}
|
|
5752
7182
|
|
|
7183
|
+
/**
|
|
7184
|
+
* @beta
|
|
7185
|
+
* Loot item condition that checks whether the loot source was
|
|
7186
|
+
* damaged by a specific type of entity.
|
|
7187
|
+
*/
|
|
7188
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
7189
|
+
export class DamagedByEntityCondition extends LootItemCondition {
|
|
7190
|
+
private constructor();
|
|
7191
|
+
/**
|
|
7192
|
+
* @remarks
|
|
7193
|
+
* The entity type required for this condition to pass.
|
|
7194
|
+
*
|
|
7195
|
+
*/
|
|
7196
|
+
readonly entityType: string;
|
|
7197
|
+
}
|
|
7198
|
+
|
|
5753
7199
|
/**
|
|
5754
7200
|
* Contains information related to firing of a data driven
|
|
5755
7201
|
* entity event - for example, the minecraft:ageable_grow_up
|
|
@@ -5954,6 +7400,30 @@ export class Dimension {
|
|
|
5954
7400
|
block: BlockPermutation | BlockType | string,
|
|
5955
7401
|
options?: BlockFillOptions,
|
|
5956
7402
|
): ListBlockVolume;
|
|
7403
|
+
/**
|
|
7404
|
+
* @beta
|
|
7405
|
+
* @remarks
|
|
7406
|
+
* Finds the location of the closest biome of a particular
|
|
7407
|
+
* type. Note that the findClosestBiome operation can take some
|
|
7408
|
+
* time to complete, so avoid using many of these calls within
|
|
7409
|
+
* a particular tick.
|
|
7410
|
+
*
|
|
7411
|
+
* @param pos
|
|
7412
|
+
* Starting location to look for a biome to find.
|
|
7413
|
+
* @param biomeToFind
|
|
7414
|
+
* Identifier of the biome to look for.
|
|
7415
|
+
* @param options
|
|
7416
|
+
* Additional selection criteria for a biome search.
|
|
7417
|
+
* @returns
|
|
7418
|
+
* Returns a location of the biome, or undefined if a biome
|
|
7419
|
+
* could not be found.
|
|
7420
|
+
* @throws This function can throw errors.
|
|
7421
|
+
*
|
|
7422
|
+
* {@link minecraftcommon.EngineError}
|
|
7423
|
+
*
|
|
7424
|
+
* {@link Error}
|
|
7425
|
+
*/
|
|
7426
|
+
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
5957
7427
|
/**
|
|
5958
7428
|
* @rc
|
|
5959
7429
|
* @remarks
|
|
@@ -6174,6 +7644,43 @@ export class Dimension {
|
|
|
6174
7644
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6175
7645
|
*/
|
|
6176
7646
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
7647
|
+
/**
|
|
7648
|
+
* @beta
|
|
7649
|
+
* @remarks
|
|
7650
|
+
* Returns a vector of generated structures that contain the
|
|
7651
|
+
* specified location (ex: Pillager Outpost, Mineshaft, etc.).
|
|
7652
|
+
* The vector will be empty if no structures are found.
|
|
7653
|
+
*
|
|
7654
|
+
* @param location
|
|
7655
|
+
* Location at which to check for structures.
|
|
7656
|
+
* @throws
|
|
7657
|
+
* An error will be thrown if the location is out of world
|
|
7658
|
+
* bounds.
|
|
7659
|
+
* An error will be thrown if the location is in an unloaded
|
|
7660
|
+
* chunk.
|
|
7661
|
+
*
|
|
7662
|
+
* {@link LocationInUnloadedChunkError}
|
|
7663
|
+
*
|
|
7664
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
7665
|
+
*/
|
|
7666
|
+
getGeneratedStructures(location: Vector3): (minecraftvanilladata.MinecraftFeatureTypes | string)[];
|
|
7667
|
+
/**
|
|
7668
|
+
* @beta
|
|
7669
|
+
* @remarks
|
|
7670
|
+
* Returns the total brightness level of light shining on a
|
|
7671
|
+
* certain block position.
|
|
7672
|
+
*
|
|
7673
|
+
* @param location
|
|
7674
|
+
* Location of the block we want to check the brightness of.
|
|
7675
|
+
* @returns
|
|
7676
|
+
* The brightness level on the block.
|
|
7677
|
+
* @throws This function can throw errors.
|
|
7678
|
+
*
|
|
7679
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7680
|
+
*
|
|
7681
|
+
* {@link LocationInUnloadedChunkError}
|
|
7682
|
+
*/
|
|
7683
|
+
getLightLevel(location: Vector3): number;
|
|
6177
7684
|
/**
|
|
6178
7685
|
* @remarks
|
|
6179
7686
|
* Returns a set of players based on a set of conditions
|
|
@@ -6191,6 +7698,23 @@ export class Dimension {
|
|
|
6191
7698
|
* {@link minecraftcommon.InvalidArgumentError}
|
|
6192
7699
|
*/
|
|
6193
7700
|
getPlayers(options?: EntityQueryOptions): Player[];
|
|
7701
|
+
/**
|
|
7702
|
+
* @beta
|
|
7703
|
+
* @remarks
|
|
7704
|
+
* Returns the brightness level of light shining from the sky
|
|
7705
|
+
* on a certain block position.
|
|
7706
|
+
*
|
|
7707
|
+
* @param location
|
|
7708
|
+
* Position of the block we want to check the brightness of.
|
|
7709
|
+
* @returns
|
|
7710
|
+
* The brightness level on the block.
|
|
7711
|
+
* @throws This function can throw errors.
|
|
7712
|
+
*
|
|
7713
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7714
|
+
*
|
|
7715
|
+
* {@link LocationInUnloadedChunkError}
|
|
7716
|
+
*/
|
|
7717
|
+
getSkyLightLevel(location: Vector3): number;
|
|
6194
7718
|
/**
|
|
6195
7719
|
* @remarks
|
|
6196
7720
|
* Returns the highest block at the given XZ location.
|
|
@@ -6203,6 +7727,26 @@ export class Dimension {
|
|
|
6203
7727
|
* @throws This function can throw errors.
|
|
6204
7728
|
*/
|
|
6205
7729
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
7730
|
+
/**
|
|
7731
|
+
* @beta
|
|
7732
|
+
* @remarks
|
|
7733
|
+
* Returns the current weather.
|
|
7734
|
+
*
|
|
7735
|
+
* @returns
|
|
7736
|
+
* Returns a WeatherType that explains the broad category of
|
|
7737
|
+
* weather that is currently going on.
|
|
7738
|
+
*/
|
|
7739
|
+
getWeather(): WeatherType;
|
|
7740
|
+
/**
|
|
7741
|
+
* @beta
|
|
7742
|
+
* @remarks
|
|
7743
|
+
* Returns true if the chunk at the given location is loaded
|
|
7744
|
+
* (and valid for use with scripting).
|
|
7745
|
+
*
|
|
7746
|
+
* @param location
|
|
7747
|
+
* Location to check if the chunk is loaded.
|
|
7748
|
+
*/
|
|
7749
|
+
isChunkLoaded(location: Vector3): boolean;
|
|
6206
7750
|
/**
|
|
6207
7751
|
* @remarks
|
|
6208
7752
|
* Places the given feature into the dimension at the specified
|
|
@@ -6436,7 +7980,11 @@ export class Dimension {
|
|
|
6436
7980
|
* }
|
|
6437
7981
|
* ```
|
|
6438
7982
|
*/
|
|
6439
|
-
spawnEntity
|
|
7983
|
+
spawnEntity<T = never>(
|
|
7984
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
7985
|
+
location: Vector3,
|
|
7986
|
+
options?: SpawnEntityOptions,
|
|
7987
|
+
): Entity;
|
|
6440
7988
|
/**
|
|
6441
7989
|
* @remarks
|
|
6442
7990
|
* Creates a new item stack as an entity at the specified
|
|
@@ -6531,6 +8079,26 @@ export class Dimension {
|
|
|
6531
8079
|
* ```
|
|
6532
8080
|
*/
|
|
6533
8081
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
8082
|
+
/**
|
|
8083
|
+
* @beta
|
|
8084
|
+
* @remarks
|
|
8085
|
+
* Stops all sounds from playing for all players.
|
|
8086
|
+
*
|
|
8087
|
+
* This function can't be called in read-only mode.
|
|
8088
|
+
*
|
|
8089
|
+
*/
|
|
8090
|
+
stopAllSounds(): void;
|
|
8091
|
+
/**
|
|
8092
|
+
* @beta
|
|
8093
|
+
* @remarks
|
|
8094
|
+
* Stops a sound from playing for all players.
|
|
8095
|
+
*
|
|
8096
|
+
* This function can't be called in read-only mode.
|
|
8097
|
+
*
|
|
8098
|
+
* @param soundId
|
|
8099
|
+
* Identifier of the sound.
|
|
8100
|
+
*/
|
|
8101
|
+
stopSound(soundId: string): void;
|
|
6534
8102
|
}
|
|
6535
8103
|
|
|
6536
8104
|
/**
|
|
@@ -6779,6 +8347,25 @@ export class EffectTypes {
|
|
|
6779
8347
|
static getAll(): EffectType[];
|
|
6780
8348
|
}
|
|
6781
8349
|
|
|
8350
|
+
/**
|
|
8351
|
+
* @beta
|
|
8352
|
+
* Represents a completely empty entry in a loot pool. If this
|
|
8353
|
+
* entry is chosen, no items will drop.
|
|
8354
|
+
*/
|
|
8355
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
8356
|
+
export class EmptyLootItem extends LootPoolEntry {
|
|
8357
|
+
private constructor();
|
|
8358
|
+
}
|
|
8359
|
+
|
|
8360
|
+
/**
|
|
8361
|
+
* @beta
|
|
8362
|
+
*/
|
|
8363
|
+
export class EnchantInfo {
|
|
8364
|
+
private constructor();
|
|
8365
|
+
readonly enchantment: string;
|
|
8366
|
+
readonly range: minecraftcommon.NumberRange;
|
|
8367
|
+
}
|
|
8368
|
+
|
|
6782
8369
|
/**
|
|
6783
8370
|
* Contains information on a type of enchantment.
|
|
6784
8371
|
*/
|
|
@@ -6978,6 +8565,18 @@ export class Entity {
|
|
|
6978
8565
|
*
|
|
6979
8566
|
*/
|
|
6980
8567
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
8568
|
+
/**
|
|
8569
|
+
* @beta
|
|
8570
|
+
* @remarks
|
|
8571
|
+
* Retrieves or sets an entity that is used as the target of
|
|
8572
|
+
* AI-related behaviors, like attacking. If the entity
|
|
8573
|
+
* currently has no target returns undefined.
|
|
8574
|
+
*
|
|
8575
|
+
* @throws This property can throw when used.
|
|
8576
|
+
*
|
|
8577
|
+
* {@link InvalidEntityError}
|
|
8578
|
+
*/
|
|
8579
|
+
readonly target?: Entity;
|
|
6981
8580
|
/**
|
|
6982
8581
|
* @remarks
|
|
6983
8582
|
* Identifier of the type of the entity - for example,
|
|
@@ -7287,6 +8886,23 @@ export class Entity {
|
|
|
7287
8886
|
* ```
|
|
7288
8887
|
*/
|
|
7289
8888
|
extinguishFire(useEffects?: boolean): boolean;
|
|
8889
|
+
/**
|
|
8890
|
+
* @beta
|
|
8891
|
+
* @remarks
|
|
8892
|
+
* Gets the solid blocks that this entity is directly standing
|
|
8893
|
+
* on. Ignores pressure plates.
|
|
8894
|
+
*
|
|
8895
|
+
* @param options
|
|
8896
|
+
* Additional configuration options for what blocks are
|
|
8897
|
+
* returned.
|
|
8898
|
+
* @returns
|
|
8899
|
+
* The solid blocks that this entity is directly standing on.
|
|
8900
|
+
* Returns an empty list if the entity is jumping or flying.
|
|
8901
|
+
* @throws This function can throw errors.
|
|
8902
|
+
*
|
|
8903
|
+
* {@link InvalidEntityError}
|
|
8904
|
+
*/
|
|
8905
|
+
getAllBlocksStandingOn(options?: GetBlocksStandingOnOptions): Block[];
|
|
7290
8906
|
/**
|
|
7291
8907
|
* @remarks
|
|
7292
8908
|
* Returns the first intersecting block from the direction that
|
|
@@ -7302,6 +8918,24 @@ export class Entity {
|
|
|
7302
8918
|
* {@link InvalidEntityError}
|
|
7303
8919
|
*/
|
|
7304
8920
|
getBlockFromViewDirection(options?: BlockRaycastOptions): BlockRaycastHit | undefined;
|
|
8921
|
+
/**
|
|
8922
|
+
* @beta
|
|
8923
|
+
* @remarks
|
|
8924
|
+
* Gets a single solid block closest to the center of the
|
|
8925
|
+
* entity that this entity is directly standing on. Ignores
|
|
8926
|
+
* pressure plates.
|
|
8927
|
+
*
|
|
8928
|
+
* @param options
|
|
8929
|
+
* Additional configuration options for what block is returned.
|
|
8930
|
+
* @returns
|
|
8931
|
+
* A single solid block closest to the center of the entity
|
|
8932
|
+
* that this entity is directly standing on. Undefined if
|
|
8933
|
+
* entity is flying or jumping.
|
|
8934
|
+
* @throws This function can throw errors.
|
|
8935
|
+
*
|
|
8936
|
+
* {@link InvalidEntityError}
|
|
8937
|
+
*/
|
|
8938
|
+
getBlockStandingOn(options?: GetBlocksStandingOnOptions): Block | undefined;
|
|
7305
8939
|
/**
|
|
7306
8940
|
* @remarks
|
|
7307
8941
|
* Gets a component (that represents additional capabilities)
|
|
@@ -7735,6 +9369,21 @@ export class Entity {
|
|
|
7735
9369
|
* {@link InvalidEntityError}
|
|
7736
9370
|
*/
|
|
7737
9371
|
runCommand(commandString: string): CommandResult;
|
|
9372
|
+
/**
|
|
9373
|
+
* @beta
|
|
9374
|
+
* @remarks
|
|
9375
|
+
* Sets multiple dynamic properties with specific values.
|
|
9376
|
+
*
|
|
9377
|
+
* @param values
|
|
9378
|
+
* A Record of key value pairs of the dynamic properties to
|
|
9379
|
+
* set.
|
|
9380
|
+
* @throws This function can throw errors.
|
|
9381
|
+
*
|
|
9382
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
9383
|
+
*
|
|
9384
|
+
* {@link InvalidEntityError}
|
|
9385
|
+
*/
|
|
9386
|
+
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
7738
9387
|
/**
|
|
7739
9388
|
* @remarks
|
|
7740
9389
|
* Sets a specified property to a value.
|
|
@@ -8148,6 +9797,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
8148
9797
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
8149
9798
|
export class EntityBreathableComponent extends EntityComponent {
|
|
8150
9799
|
private constructor();
|
|
9800
|
+
/**
|
|
9801
|
+
* @beta
|
|
9802
|
+
* @remarks
|
|
9803
|
+
* The current air supply of the entity.
|
|
9804
|
+
*
|
|
9805
|
+
* This property can't be edited in read-only mode.
|
|
9806
|
+
*
|
|
9807
|
+
* @throws
|
|
9808
|
+
* Will throw an error if the air supply is out of bounds
|
|
9809
|
+
* [suffocationTime, maxAirSupply].
|
|
9810
|
+
*/
|
|
9811
|
+
airSupply: number;
|
|
8151
9812
|
/**
|
|
8152
9813
|
* @remarks
|
|
8153
9814
|
* If true, this entity can breathe in air.
|
|
@@ -8176,6 +9837,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
8176
9837
|
* @throws This property can throw when used.
|
|
8177
9838
|
*/
|
|
8178
9839
|
readonly breathesWater: boolean;
|
|
9840
|
+
/**
|
|
9841
|
+
* @beta
|
|
9842
|
+
* @remarks
|
|
9843
|
+
* If true, the entity is able to breathe.
|
|
9844
|
+
*
|
|
9845
|
+
* @throws This property can throw when used.
|
|
9846
|
+
*/
|
|
9847
|
+
readonly canBreathe: boolean;
|
|
8179
9848
|
/**
|
|
8180
9849
|
* @remarks
|
|
8181
9850
|
* If true, this entity will have visible bubbles while in
|
|
@@ -8536,6 +10205,40 @@ export class EntityFrictionModifierComponent extends EntityComponent {
|
|
|
8536
10205
|
static readonly componentId = 'minecraft:friction_modifier';
|
|
8537
10206
|
}
|
|
8538
10207
|
|
|
10208
|
+
/**
|
|
10209
|
+
* @beta
|
|
10210
|
+
* Loot item condition that checks the value of the mark
|
|
10211
|
+
* variant of a mob as it drops its loot.
|
|
10212
|
+
*/
|
|
10213
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10214
|
+
export class EntityHasMarkVariantCondition extends LootItemCondition {
|
|
10215
|
+
private constructor();
|
|
10216
|
+
/**
|
|
10217
|
+
* @remarks
|
|
10218
|
+
* The mark variant value the mob must have for this condition
|
|
10219
|
+
* to pass.
|
|
10220
|
+
*
|
|
10221
|
+
*/
|
|
10222
|
+
readonly value: number;
|
|
10223
|
+
}
|
|
10224
|
+
|
|
10225
|
+
/**
|
|
10226
|
+
* @beta
|
|
10227
|
+
* Loot item condition that checks the variant value of a mob
|
|
10228
|
+
* as it drops its loot.
|
|
10229
|
+
*/
|
|
10230
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10231
|
+
export class EntityHasVariantCondition extends LootItemCondition {
|
|
10232
|
+
private constructor();
|
|
10233
|
+
/**
|
|
10234
|
+
* @remarks
|
|
10235
|
+
* The variant value the mob must have for this condition to
|
|
10236
|
+
* pass.
|
|
10237
|
+
*
|
|
10238
|
+
*/
|
|
10239
|
+
readonly value: number;
|
|
10240
|
+
}
|
|
10241
|
+
|
|
8539
10242
|
/**
|
|
8540
10243
|
* Defines the interactions with this entity for healing it.
|
|
8541
10244
|
*/
|
|
@@ -9073,6 +10776,23 @@ export class EntityItemComponent extends EntityComponent {
|
|
|
9073
10776
|
static readonly componentId = 'minecraft:item';
|
|
9074
10777
|
}
|
|
9075
10778
|
|
|
10779
|
+
/**
|
|
10780
|
+
* @beta
|
|
10781
|
+
* Loot item condition that checks the entity type of the
|
|
10782
|
+
* entity dropping its loot.
|
|
10783
|
+
*/
|
|
10784
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
10785
|
+
export class EntityKilledCondition extends LootItemCondition {
|
|
10786
|
+
private constructor();
|
|
10787
|
+
/**
|
|
10788
|
+
* @remarks
|
|
10789
|
+
* The entity type required for this condition to pass.
|
|
10790
|
+
* Example: 'minecraft:skeleton'.
|
|
10791
|
+
*
|
|
10792
|
+
*/
|
|
10793
|
+
readonly entityType: string;
|
|
10794
|
+
}
|
|
10795
|
+
|
|
9076
10796
|
/**
|
|
9077
10797
|
* Defines the base movement speed in lava of this entity.
|
|
9078
10798
|
*/
|
|
@@ -9569,13 +11289,49 @@ export class EntityNavigationHoverComponent extends EntityNavigationComponent {
|
|
|
9569
11289
|
}
|
|
9570
11290
|
|
|
9571
11291
|
/**
|
|
9572
|
-
* Allows this entity to generate paths by walking around and
|
|
9573
|
-
* jumping up and down a block like regular mobs.
|
|
11292
|
+
* Allows this entity to generate paths by walking around and
|
|
11293
|
+
* jumping up and down a block like regular mobs.
|
|
11294
|
+
*/
|
|
11295
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11296
|
+
export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
11297
|
+
private constructor();
|
|
11298
|
+
static readonly componentId = 'minecraft:navigation.walk';
|
|
11299
|
+
}
|
|
11300
|
+
|
|
11301
|
+
/**
|
|
11302
|
+
* @beta
|
|
11303
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
11304
|
+
* name, and dialogue interactions.
|
|
9574
11305
|
*/
|
|
9575
11306
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
9576
|
-
export class
|
|
11307
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
9577
11308
|
private constructor();
|
|
9578
|
-
|
|
11309
|
+
/**
|
|
11310
|
+
* @remarks
|
|
11311
|
+
* The DialogueScene that is opened when players first interact
|
|
11312
|
+
* with the NPC.
|
|
11313
|
+
*
|
|
11314
|
+
* This property can't be edited in read-only mode.
|
|
11315
|
+
*
|
|
11316
|
+
*/
|
|
11317
|
+
defaultScene: string;
|
|
11318
|
+
/**
|
|
11319
|
+
* @remarks
|
|
11320
|
+
* The name of the NPC as it is displayed to players.
|
|
11321
|
+
*
|
|
11322
|
+
* This property can't be edited in read-only mode.
|
|
11323
|
+
*
|
|
11324
|
+
*/
|
|
11325
|
+
name: string;
|
|
11326
|
+
/**
|
|
11327
|
+
* @remarks
|
|
11328
|
+
* The index of the skin the NPC will use.
|
|
11329
|
+
*
|
|
11330
|
+
* This property can't be edited in read-only mode.
|
|
11331
|
+
*
|
|
11332
|
+
*/
|
|
11333
|
+
skinIndex: number;
|
|
11334
|
+
static readonly componentId = 'minecraft:npc';
|
|
9579
11335
|
}
|
|
9580
11336
|
|
|
9581
11337
|
/**
|
|
@@ -10444,7 +12200,7 @@ export class EntityTypes {
|
|
|
10444
12200
|
* Retrieves an entity type using a string-based identifier.
|
|
10445
12201
|
*
|
|
10446
12202
|
*/
|
|
10447
|
-
static get(identifier:
|
|
12203
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
10448
12204
|
/**
|
|
10449
12205
|
* @remarks
|
|
10450
12206
|
* Retrieves a set of all entity types within this world.
|
|
@@ -10855,6 +12611,13 @@ export class GameRules {
|
|
|
10855
12611
|
*
|
|
10856
12612
|
*/
|
|
10857
12613
|
keepInventory: boolean;
|
|
12614
|
+
/**
|
|
12615
|
+
* @beta
|
|
12616
|
+
* @remarks
|
|
12617
|
+
* This property can't be edited in read-only mode.
|
|
12618
|
+
*
|
|
12619
|
+
*/
|
|
12620
|
+
locatorBar: boolean;
|
|
10858
12621
|
/**
|
|
10859
12622
|
* @remarks
|
|
10860
12623
|
* This property can't be edited in read-only mode.
|
|
@@ -11013,6 +12776,16 @@ export class InputInfo {
|
|
|
11013
12776
|
getMovementVector(): Vector2;
|
|
11014
12777
|
}
|
|
11015
12778
|
|
|
12779
|
+
/**
|
|
12780
|
+
* @beta
|
|
12781
|
+
* Loot item condition that checks whether or not the entity
|
|
12782
|
+
* dropping loot is a baby.
|
|
12783
|
+
*/
|
|
12784
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12785
|
+
export class IsBabyCondition extends LootItemCondition {
|
|
12786
|
+
private constructor();
|
|
12787
|
+
}
|
|
12788
|
+
|
|
11016
12789
|
/**
|
|
11017
12790
|
* @rc
|
|
11018
12791
|
* When present on an item, this item is a book item. Can
|
|
@@ -11911,6 +13684,56 @@ export class ItemFoodComponent extends ItemComponent {
|
|
|
11911
13684
|
static readonly componentId = 'minecraft:food';
|
|
11912
13685
|
}
|
|
11913
13686
|
|
|
13687
|
+
/**
|
|
13688
|
+
* @beta
|
|
13689
|
+
* This component is added to items with the `Storage Item`
|
|
13690
|
+
* component. Can access and modify this items inventory
|
|
13691
|
+
* container.
|
|
13692
|
+
*/
|
|
13693
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13694
|
+
export class ItemInventoryComponent extends ItemComponent {
|
|
13695
|
+
private constructor();
|
|
13696
|
+
/**
|
|
13697
|
+
* @throws This property can throw when used.
|
|
13698
|
+
*
|
|
13699
|
+
* {@link InvalidContainerError}
|
|
13700
|
+
*/
|
|
13701
|
+
readonly container: Container;
|
|
13702
|
+
static readonly componentId = 'minecraft:inventory';
|
|
13703
|
+
}
|
|
13704
|
+
|
|
13705
|
+
/**
|
|
13706
|
+
* @beta
|
|
13707
|
+
* When present on an item, this item is a potion item.
|
|
13708
|
+
*/
|
|
13709
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13710
|
+
export class ItemPotionComponent extends ItemComponent {
|
|
13711
|
+
private constructor();
|
|
13712
|
+
/**
|
|
13713
|
+
* @remarks
|
|
13714
|
+
* The PotionDeliveryType associated with the potion item.
|
|
13715
|
+
*
|
|
13716
|
+
* @throws This property can throw when used.
|
|
13717
|
+
*
|
|
13718
|
+
* {@link minecraftcommon.EngineError}
|
|
13719
|
+
*
|
|
13720
|
+
* {@link Error}
|
|
13721
|
+
*/
|
|
13722
|
+
readonly potionDeliveryType: PotionDeliveryType;
|
|
13723
|
+
/**
|
|
13724
|
+
* @remarks
|
|
13725
|
+
* The PotionEffectType associated with the potion item.
|
|
13726
|
+
*
|
|
13727
|
+
* @throws This property can throw when used.
|
|
13728
|
+
*
|
|
13729
|
+
* {@link minecraftcommon.EngineError}
|
|
13730
|
+
*
|
|
13731
|
+
* {@link Error}
|
|
13732
|
+
*/
|
|
13733
|
+
readonly potionEffectType: PotionEffectType;
|
|
13734
|
+
static readonly componentId = 'minecraft:potion';
|
|
13735
|
+
}
|
|
13736
|
+
|
|
11914
13737
|
/**
|
|
11915
13738
|
* Contains information related to a chargeable item when the
|
|
11916
13739
|
* player has finished using the item and released the build
|
|
@@ -12124,6 +13947,16 @@ export class ItemStack {
|
|
|
12124
13947
|
*
|
|
12125
13948
|
*/
|
|
12126
13949
|
readonly typeId: string;
|
|
13950
|
+
/**
|
|
13951
|
+
* @beta
|
|
13952
|
+
* @remarks
|
|
13953
|
+
* The total weight of all items in the stack plus the weight
|
|
13954
|
+
* of all items in the items container which is defined with
|
|
13955
|
+
* the `Storage Item` component. The weight per item can be
|
|
13956
|
+
* modified by the `Storage Weight Modifier` component.
|
|
13957
|
+
*
|
|
13958
|
+
*/
|
|
13959
|
+
readonly weight: number;
|
|
12127
13960
|
/**
|
|
12128
13961
|
* @remarks
|
|
12129
13962
|
* Creates a new instance of a stack of items for use in the
|
|
@@ -12408,6 +14241,21 @@ export class ItemStack {
|
|
|
12408
14241
|
* ```
|
|
12409
14242
|
*/
|
|
12410
14243
|
setCanPlaceOn(blockIdentifiers?: string[]): void;
|
|
14244
|
+
/**
|
|
14245
|
+
* @beta
|
|
14246
|
+
* @remarks
|
|
14247
|
+
* Sets multiple dynamic properties with specific values.
|
|
14248
|
+
*
|
|
14249
|
+
* @param values
|
|
14250
|
+
* A Record of key value pairs of the dynamic properties to
|
|
14251
|
+
* set.
|
|
14252
|
+
* @throws This function can throw errors.
|
|
14253
|
+
*
|
|
14254
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
14255
|
+
*
|
|
14256
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
14257
|
+
*/
|
|
14258
|
+
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
12411
14259
|
/**
|
|
12412
14260
|
* @remarks
|
|
12413
14261
|
* Sets a specified property to a value. Note: This function
|
|
@@ -12870,6 +14718,44 @@ export class ItemUseOnEvent {
|
|
|
12870
14718
|
readonly itemStack: ItemStack;
|
|
12871
14719
|
}
|
|
12872
14720
|
|
|
14721
|
+
/**
|
|
14722
|
+
* @beta
|
|
14723
|
+
* Loot item condition that checks whether or not the drop
|
|
14724
|
+
* source was killed by a specific type of entity.
|
|
14725
|
+
*/
|
|
14726
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14727
|
+
export class KilledByEntityCondition extends LootItemCondition {
|
|
14728
|
+
private constructor();
|
|
14729
|
+
/**
|
|
14730
|
+
* @remarks
|
|
14731
|
+
* The entity type required for this condition to pass.
|
|
14732
|
+
* Example: 'minecraft:skeleton'.
|
|
14733
|
+
*
|
|
14734
|
+
*/
|
|
14735
|
+
readonly entityType: string;
|
|
14736
|
+
}
|
|
14737
|
+
|
|
14738
|
+
/**
|
|
14739
|
+
* @beta
|
|
14740
|
+
* Loot item condition that checks whether or not the source of
|
|
14741
|
+
* the loot drop was killed by the player.
|
|
14742
|
+
*/
|
|
14743
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14744
|
+
export class KilledByPlayerCondition extends LootItemCondition {
|
|
14745
|
+
private constructor();
|
|
14746
|
+
}
|
|
14747
|
+
|
|
14748
|
+
/**
|
|
14749
|
+
* @beta
|
|
14750
|
+
* Loot item condition that checks whether or not the source of
|
|
14751
|
+
* the loot drop was killed by the player or any of the
|
|
14752
|
+
* player's pets.
|
|
14753
|
+
*/
|
|
14754
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14755
|
+
export class KilledByPlayerOrPetsCondition extends LootItemCondition {
|
|
14756
|
+
private constructor();
|
|
14757
|
+
}
|
|
14758
|
+
|
|
12873
14759
|
/**
|
|
12874
14760
|
* Contains information related to changes to a lever
|
|
12875
14761
|
* activating or deactivating.
|
|
@@ -12907,118 +14793,289 @@ export class ItemUseOnEvent {
|
|
|
12907
14793
|
* }
|
|
12908
14794
|
* ```
|
|
12909
14795
|
*/
|
|
12910
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12911
|
-
export class LeverActionAfterEvent extends BlockEvent {
|
|
14796
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14797
|
+
export class LeverActionAfterEvent extends BlockEvent {
|
|
14798
|
+
private constructor();
|
|
14799
|
+
/**
|
|
14800
|
+
* @remarks
|
|
14801
|
+
* True if the lever is activated (that is, transmitting
|
|
14802
|
+
* power).
|
|
14803
|
+
*
|
|
14804
|
+
*/
|
|
14805
|
+
readonly isPowered: boolean;
|
|
14806
|
+
/**
|
|
14807
|
+
* @remarks
|
|
14808
|
+
* Optional player that triggered the lever activation.
|
|
14809
|
+
*
|
|
14810
|
+
*/
|
|
14811
|
+
readonly player: Player;
|
|
14812
|
+
}
|
|
14813
|
+
|
|
14814
|
+
/**
|
|
14815
|
+
* Manages callbacks that are connected to lever moves
|
|
14816
|
+
* (activates or deactivates).
|
|
14817
|
+
* @example leverActionEvent.ts
|
|
14818
|
+
* ```typescript
|
|
14819
|
+
* import { world, system, BlockPermutation, LeverActionAfterEvent, DimensionLocation } from "@minecraft/server";
|
|
14820
|
+
* import { MinecraftBlockTypes } from "@minecraft/vanilla-data";
|
|
14821
|
+
*
|
|
14822
|
+
* function leverActionEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
|
|
14823
|
+
* // set up a lever
|
|
14824
|
+
* const cobblestone = targetLocation.dimension.getBlock(targetLocation);
|
|
14825
|
+
* const lever = targetLocation.dimension.getBlock({
|
|
14826
|
+
* x: targetLocation.x,
|
|
14827
|
+
* y: targetLocation.y + 1,
|
|
14828
|
+
* z: targetLocation.z,
|
|
14829
|
+
* });
|
|
14830
|
+
*
|
|
14831
|
+
* if (cobblestone === undefined || lever === undefined) {
|
|
14832
|
+
* log("Could not find block at location.");
|
|
14833
|
+
* return -1;
|
|
14834
|
+
* }
|
|
14835
|
+
*
|
|
14836
|
+
* cobblestone.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.Cobblestone));
|
|
14837
|
+
* lever.setPermutation(
|
|
14838
|
+
* BlockPermutation.resolve(MinecraftBlockTypes.Lever).withState("lever_direction", "up_north_south")
|
|
14839
|
+
* );
|
|
14840
|
+
*
|
|
14841
|
+
* world.afterEvents.leverAction.subscribe((leverActionEvent: LeverActionAfterEvent) => {
|
|
14842
|
+
* const eventLoc = leverActionEvent.block.location;
|
|
14843
|
+
*
|
|
14844
|
+
* if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y + 1 && eventLoc.z === targetLocation.z) {
|
|
14845
|
+
* log("Lever activate event at tick " + system.currentTick);
|
|
14846
|
+
* }
|
|
14847
|
+
* });
|
|
14848
|
+
* }
|
|
14849
|
+
* ```
|
|
14850
|
+
*/
|
|
14851
|
+
export class LeverActionAfterEventSignal {
|
|
14852
|
+
private constructor();
|
|
14853
|
+
/**
|
|
14854
|
+
* @remarks
|
|
14855
|
+
* Adds a callback that will be called when a lever is moved
|
|
14856
|
+
* (activates or deactivates).
|
|
14857
|
+
*
|
|
14858
|
+
* This function can't be called in read-only mode.
|
|
14859
|
+
*
|
|
14860
|
+
* This function can be called in early-execution mode.
|
|
14861
|
+
*
|
|
14862
|
+
*/
|
|
14863
|
+
subscribe(callback: (arg0: LeverActionAfterEvent) => void): (arg0: LeverActionAfterEvent) => void;
|
|
14864
|
+
/**
|
|
14865
|
+
* @remarks
|
|
14866
|
+
* Removes a callback from being called when a lever is moved
|
|
14867
|
+
* (activates or deactivates).
|
|
14868
|
+
*
|
|
14869
|
+
* This function can't be called in read-only mode.
|
|
14870
|
+
*
|
|
14871
|
+
* This function can be called in early-execution mode.
|
|
14872
|
+
*
|
|
14873
|
+
*/
|
|
14874
|
+
unsubscribe(callback: (arg0: LeverActionAfterEvent) => void): void;
|
|
14875
|
+
}
|
|
14876
|
+
|
|
14877
|
+
/**
|
|
14878
|
+
* Volume composed of an unordered container of unique block
|
|
14879
|
+
* locations.
|
|
14880
|
+
*/
|
|
14881
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14882
|
+
export class ListBlockVolume extends BlockVolumeBase {
|
|
14883
|
+
/**
|
|
14884
|
+
* @remarks
|
|
14885
|
+
* Creates a new instance of ListBlockVolume.
|
|
14886
|
+
*
|
|
14887
|
+
* @param locations
|
|
14888
|
+
* Initial array of block locations that ListBlockVolume will
|
|
14889
|
+
* be constructed with.
|
|
14890
|
+
*/
|
|
14891
|
+
constructor(locations: Vector3[]);
|
|
14892
|
+
/**
|
|
14893
|
+
* @remarks
|
|
14894
|
+
* Insert block locations into container.
|
|
14895
|
+
*
|
|
14896
|
+
* @param locations
|
|
14897
|
+
* Array of block locations to be inserted into container.
|
|
14898
|
+
*/
|
|
14899
|
+
add(locations: Vector3[]): void;
|
|
14900
|
+
/**
|
|
14901
|
+
* @remarks
|
|
14902
|
+
* Remove block locations from container.
|
|
14903
|
+
*
|
|
14904
|
+
* @param locations
|
|
14905
|
+
* Array of block locations to be removed from container.
|
|
14906
|
+
*/
|
|
14907
|
+
remove(locations: Vector3[]): void;
|
|
14908
|
+
}
|
|
14909
|
+
|
|
14910
|
+
/**
|
|
14911
|
+
* @beta
|
|
14912
|
+
* Represents a loot pool entry containing an item to drop.
|
|
14913
|
+
*/
|
|
14914
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14915
|
+
export class LootItem extends LootPoolEntry {
|
|
14916
|
+
private constructor();
|
|
14917
|
+
/**
|
|
14918
|
+
* @remarks
|
|
14919
|
+
* The name of the item contained in this entry.
|
|
14920
|
+
*
|
|
14921
|
+
*/
|
|
14922
|
+
readonly name?: ItemType;
|
|
14923
|
+
}
|
|
14924
|
+
|
|
14925
|
+
/**
|
|
14926
|
+
* @beta
|
|
14927
|
+
* An abstract base class from which all loot item conditions
|
|
14928
|
+
* are derived. A loot item condition is a set of rules or
|
|
14929
|
+
* requirements which must be met for a loot drop to happen.
|
|
14930
|
+
*/
|
|
14931
|
+
export class LootItemCondition {
|
|
14932
|
+
private constructor();
|
|
14933
|
+
}
|
|
14934
|
+
|
|
14935
|
+
/**
|
|
14936
|
+
* @beta
|
|
14937
|
+
* A collection of entries which individually determine loot
|
|
14938
|
+
* drops. Can contain values determining drop outcomes,
|
|
14939
|
+
* including rolls, bonus rolls and tiers.
|
|
14940
|
+
*/
|
|
14941
|
+
export class LootPool {
|
|
14942
|
+
private constructor();
|
|
14943
|
+
/**
|
|
14944
|
+
* @remarks
|
|
14945
|
+
* Returns the number of extra times a loot pool will be rolled
|
|
14946
|
+
* based on the player's luck level, represented as a range
|
|
14947
|
+
* from minimum to maximum rolls.
|
|
14948
|
+
*
|
|
14949
|
+
*/
|
|
14950
|
+
readonly bonusRolls: minecraftcommon.NumberRange;
|
|
14951
|
+
readonly conditions: LootItemCondition[];
|
|
14952
|
+
/**
|
|
14953
|
+
* @remarks
|
|
14954
|
+
* Gets a complete list of all loot pool entries contained in
|
|
14955
|
+
* the loot pool.
|
|
14956
|
+
*
|
|
14957
|
+
*/
|
|
14958
|
+
readonly entries: LootPoolEntry[];
|
|
14959
|
+
/**
|
|
14960
|
+
* @remarks
|
|
14961
|
+
* Returns the number of times a loot pool will be rolled,
|
|
14962
|
+
* represented as a range from minimum to maximum rolls.
|
|
14963
|
+
*
|
|
14964
|
+
*/
|
|
14965
|
+
readonly rolls: minecraftcommon.NumberRange;
|
|
14966
|
+
/**
|
|
14967
|
+
* @remarks
|
|
14968
|
+
* Gets the loot pool tier values for a given table if they
|
|
14969
|
+
* exist.
|
|
14970
|
+
*
|
|
14971
|
+
*/
|
|
14972
|
+
readonly tiers?: LootPoolTiers;
|
|
14973
|
+
}
|
|
14974
|
+
|
|
14975
|
+
/**
|
|
14976
|
+
* @beta
|
|
14977
|
+
* Represents one entry within Loot Table, which describes one
|
|
14978
|
+
* possible drop when a loot drop occurs. Can contain an item,
|
|
14979
|
+
* another loot table, a path to another loot table, or an
|
|
14980
|
+
* empty drop.
|
|
14981
|
+
*/
|
|
14982
|
+
export class LootPoolEntry {
|
|
12912
14983
|
private constructor();
|
|
12913
14984
|
/**
|
|
12914
14985
|
* @remarks
|
|
12915
|
-
*
|
|
12916
|
-
* power).
|
|
14986
|
+
* Gets the quality of a given loot pool entry.
|
|
12917
14987
|
*
|
|
12918
14988
|
*/
|
|
12919
|
-
readonly
|
|
14989
|
+
readonly quality: number;
|
|
12920
14990
|
/**
|
|
12921
14991
|
* @remarks
|
|
12922
|
-
*
|
|
14992
|
+
* Gets the subtable of a given loot pool entry.
|
|
12923
14993
|
*
|
|
12924
14994
|
*/
|
|
12925
|
-
readonly
|
|
14995
|
+
readonly subTable?: LootPoolEntry;
|
|
14996
|
+
/**
|
|
14997
|
+
* @remarks
|
|
14998
|
+
* Gets the weight of a given loot pool entry.
|
|
14999
|
+
*
|
|
15000
|
+
*/
|
|
15001
|
+
readonly weight: number;
|
|
12926
15002
|
}
|
|
12927
15003
|
|
|
12928
15004
|
/**
|
|
12929
|
-
*
|
|
12930
|
-
*
|
|
12931
|
-
*
|
|
12932
|
-
*
|
|
12933
|
-
*
|
|
12934
|
-
* import { MinecraftBlockTypes } from "@minecraft/vanilla-data";
|
|
12935
|
-
*
|
|
12936
|
-
* function leverActionEvent(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
|
|
12937
|
-
* // set up a lever
|
|
12938
|
-
* const cobblestone = targetLocation.dimension.getBlock(targetLocation);
|
|
12939
|
-
* const lever = targetLocation.dimension.getBlock({
|
|
12940
|
-
* x: targetLocation.x,
|
|
12941
|
-
* y: targetLocation.y + 1,
|
|
12942
|
-
* z: targetLocation.z,
|
|
12943
|
-
* });
|
|
12944
|
-
*
|
|
12945
|
-
* if (cobblestone === undefined || lever === undefined) {
|
|
12946
|
-
* log("Could not find block at location.");
|
|
12947
|
-
* return -1;
|
|
12948
|
-
* }
|
|
12949
|
-
*
|
|
12950
|
-
* cobblestone.setPermutation(BlockPermutation.resolve(MinecraftBlockTypes.Cobblestone));
|
|
12951
|
-
* lever.setPermutation(
|
|
12952
|
-
* BlockPermutation.resolve(MinecraftBlockTypes.Lever).withState("lever_direction", "up_north_south")
|
|
12953
|
-
* );
|
|
12954
|
-
*
|
|
12955
|
-
* world.afterEvents.leverAction.subscribe((leverActionEvent: LeverActionAfterEvent) => {
|
|
12956
|
-
* const eventLoc = leverActionEvent.block.location;
|
|
12957
|
-
*
|
|
12958
|
-
* if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y + 1 && eventLoc.z === targetLocation.z) {
|
|
12959
|
-
* log("Lever activate event at tick " + system.currentTick);
|
|
12960
|
-
* }
|
|
12961
|
-
* });
|
|
12962
|
-
* }
|
|
12963
|
-
* ```
|
|
15005
|
+
* @beta
|
|
15006
|
+
* Represents the values which determine loot drops in a tiered
|
|
15007
|
+
* loot pool. Potential drops from tiered loot pools are
|
|
15008
|
+
* ordered, and chosen via logic controlled by the values in
|
|
15009
|
+
* this object.
|
|
12964
15010
|
*/
|
|
12965
|
-
export class
|
|
15011
|
+
export class LootPoolTiers {
|
|
12966
15012
|
private constructor();
|
|
12967
15013
|
/**
|
|
12968
15014
|
* @remarks
|
|
12969
|
-
*
|
|
12970
|
-
*
|
|
12971
|
-
*
|
|
12972
|
-
* This function can't be called in read-only mode.
|
|
12973
|
-
*
|
|
12974
|
-
* This function can be called in early-execution mode.
|
|
15015
|
+
* The chance for each bonus roll attempt to upgrade the tier
|
|
15016
|
+
* of the dropped item.
|
|
12975
15017
|
*
|
|
12976
15018
|
*/
|
|
12977
|
-
|
|
15019
|
+
readonly bonusChance: number;
|
|
12978
15020
|
/**
|
|
12979
15021
|
* @remarks
|
|
12980
|
-
*
|
|
12981
|
-
*
|
|
15022
|
+
* The number of attempts for the loot drop to upgrade its
|
|
15023
|
+
* tier, thereby incrementing its position in the loot pool
|
|
15024
|
+
* entry array, resulting in a higher tier drop.
|
|
12982
15025
|
*
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
|
|
15026
|
+
*/
|
|
15027
|
+
readonly bonusRolls: number;
|
|
15028
|
+
/**
|
|
15029
|
+
* @remarks
|
|
15030
|
+
* Represents the upper bound for the starting point in
|
|
15031
|
+
* determining which tier of loot to drop. The lower bound is
|
|
15032
|
+
* always 1. For example, a value of 3 would result in the tier
|
|
15033
|
+
* drop logic starting at a randomly selected position in the
|
|
15034
|
+
* loot pool entry array between 1 and 3.
|
|
12986
15035
|
*
|
|
12987
15036
|
*/
|
|
12988
|
-
|
|
15037
|
+
readonly initialRange: number;
|
|
12989
15038
|
}
|
|
12990
15039
|
|
|
12991
15040
|
/**
|
|
12992
|
-
*
|
|
12993
|
-
*
|
|
15041
|
+
* @beta
|
|
15042
|
+
* Represents a single Loot Table, which determines what items
|
|
15043
|
+
* are generated when killing a mob, breaking a block, filling
|
|
15044
|
+
* a container, and more.
|
|
12994
15045
|
*/
|
|
12995
|
-
|
|
12996
|
-
|
|
15046
|
+
export class LootTable {
|
|
15047
|
+
private constructor();
|
|
12997
15048
|
/**
|
|
12998
15049
|
* @remarks
|
|
12999
|
-
*
|
|
15050
|
+
* Returns the path to the JSON file that represents this loot
|
|
15051
|
+
* table. Does not include file extension, or 'loot_tables/'
|
|
15052
|
+
* folder prefix. Example: `entities/creeper`.
|
|
13000
15053
|
*
|
|
13001
|
-
* @param locations
|
|
13002
|
-
* Initial array of block locations that ListBlockVolume will
|
|
13003
|
-
* be constructed with.
|
|
13004
15054
|
*/
|
|
13005
|
-
|
|
15055
|
+
readonly path: string;
|
|
13006
15056
|
/**
|
|
13007
15057
|
* @remarks
|
|
13008
|
-
*
|
|
15058
|
+
* Returns the array of loot pools on a given loot table.
|
|
13009
15059
|
*
|
|
13010
|
-
* @param locations
|
|
13011
|
-
* Array of block locations to be inserted into container.
|
|
13012
15060
|
*/
|
|
13013
|
-
|
|
15061
|
+
readonly pools: LootPool[];
|
|
15062
|
+
}
|
|
15063
|
+
|
|
15064
|
+
/**
|
|
15065
|
+
* @beta
|
|
15066
|
+
* Represents a loot pool entry containing another separate,
|
|
15067
|
+
* nested loot table.
|
|
15068
|
+
*/
|
|
15069
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15070
|
+
export class LootTableEntry extends LootPoolEntry {
|
|
15071
|
+
private constructor();
|
|
13014
15072
|
/**
|
|
13015
15073
|
* @remarks
|
|
13016
|
-
*
|
|
15074
|
+
* Gets the loot table stored as a subtable in the parent loot
|
|
15075
|
+
* pool.
|
|
13017
15076
|
*
|
|
13018
|
-
* @param locations
|
|
13019
|
-
* Array of block locations to be removed from container.
|
|
13020
15077
|
*/
|
|
13021
|
-
|
|
15078
|
+
readonly lootTable: LootTable;
|
|
13022
15079
|
}
|
|
13023
15080
|
|
|
13024
15081
|
/**
|
|
@@ -13105,6 +15162,137 @@ export class LootTableManager {
|
|
|
13105
15162
|
* Can be empty if no loot dropped.
|
|
13106
15163
|
*/
|
|
13107
15164
|
generateLootFromEntityType(entityType: EntityType, tool?: ItemStack): ItemStack[] | undefined;
|
|
15165
|
+
/**
|
|
15166
|
+
* @beta
|
|
15167
|
+
* @remarks
|
|
15168
|
+
* Generates loot from a given LootTable.
|
|
15169
|
+
*
|
|
15170
|
+
* @param tool
|
|
15171
|
+
* Optional. The tool to use in the looting operation.
|
|
15172
|
+
* @returns
|
|
15173
|
+
* An array of item stacks dropped from the loot drop event.
|
|
15174
|
+
* Can be empty if no loot dropped, or undefined if the
|
|
15175
|
+
* provided tool is insufficient to mine the block.
|
|
15176
|
+
*/
|
|
15177
|
+
generateLootFromTable(lootTable: LootTable, tool?: ItemStack): ItemStack[] | undefined;
|
|
15178
|
+
/**
|
|
15179
|
+
* @beta
|
|
15180
|
+
* @remarks
|
|
15181
|
+
* Retrieves a single loot table from the level's current
|
|
15182
|
+
* registry.
|
|
15183
|
+
*
|
|
15184
|
+
* @param path
|
|
15185
|
+
* Path to the table to retrieve. Does not include file
|
|
15186
|
+
* extension, or 'loot_tables/' folder prefix. Example:
|
|
15187
|
+
* `entities/creeper`.
|
|
15188
|
+
* @returns
|
|
15189
|
+
* Returns a LootTable if one is found, or `undefined` if the
|
|
15190
|
+
* provided path does not correspond to an existing loot table.
|
|
15191
|
+
*/
|
|
15192
|
+
getLootTable(path: string): LootTable | undefined;
|
|
15193
|
+
}
|
|
15194
|
+
|
|
15195
|
+
/**
|
|
15196
|
+
* @beta
|
|
15197
|
+
* Represents a loot pool entry containing a reference to
|
|
15198
|
+
* another loot table, described by its path.
|
|
15199
|
+
*/
|
|
15200
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15201
|
+
export class LootTableReference extends LootPoolEntry {
|
|
15202
|
+
private constructor();
|
|
15203
|
+
/**
|
|
15204
|
+
* @remarks
|
|
15205
|
+
* The path to the referenced loot table. Example:
|
|
15206
|
+
* `loot_tables/chests/village/village_bundle.json`
|
|
15207
|
+
*
|
|
15208
|
+
*/
|
|
15209
|
+
readonly path: string;
|
|
15210
|
+
}
|
|
15211
|
+
|
|
15212
|
+
/**
|
|
15213
|
+
* @beta
|
|
15214
|
+
* Loot item condition that checks whether an appropriate tool
|
|
15215
|
+
* was used to trigger the loot event. Can describe item type,
|
|
15216
|
+
* count, durability, enchantments, or arrays of item tags to
|
|
15217
|
+
* compare against.
|
|
15218
|
+
*/
|
|
15219
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15220
|
+
export class MatchToolCondition extends LootItemCondition {
|
|
15221
|
+
private constructor();
|
|
15222
|
+
/**
|
|
15223
|
+
* @remarks
|
|
15224
|
+
* The stack size, or count, required for this condition to
|
|
15225
|
+
* pass.
|
|
15226
|
+
*
|
|
15227
|
+
*/
|
|
15228
|
+
readonly count: minecraftcommon.NumberRange;
|
|
15229
|
+
/**
|
|
15230
|
+
* @remarks
|
|
15231
|
+
* The durability value required for this condition to pass.
|
|
15232
|
+
*
|
|
15233
|
+
*/
|
|
15234
|
+
readonly durability: minecraftcommon.NumberRange;
|
|
15235
|
+
/**
|
|
15236
|
+
* @remarks
|
|
15237
|
+
* Array of enchantments required for this condition to pass.
|
|
15238
|
+
*
|
|
15239
|
+
*/
|
|
15240
|
+
readonly enchantments: EnchantInfo[];
|
|
15241
|
+
/**
|
|
15242
|
+
* @remarks
|
|
15243
|
+
* The name of the tool item required for this condition to
|
|
15244
|
+
* pass.
|
|
15245
|
+
*
|
|
15246
|
+
*/
|
|
15247
|
+
readonly itemName: string;
|
|
15248
|
+
/**
|
|
15249
|
+
* @remarks
|
|
15250
|
+
* Array of item tags which ALL must be matched for this
|
|
15251
|
+
* condition to pass.
|
|
15252
|
+
*
|
|
15253
|
+
*/
|
|
15254
|
+
readonly itemTagsAll: string[];
|
|
15255
|
+
/**
|
|
15256
|
+
* @remarks
|
|
15257
|
+
* Array of item tags, from which at least 1 must be matched
|
|
15258
|
+
* for this condition to pass.
|
|
15259
|
+
*
|
|
15260
|
+
*/
|
|
15261
|
+
readonly itemTagsAny: string[];
|
|
15262
|
+
/**
|
|
15263
|
+
* @remarks
|
|
15264
|
+
* Array of item tags, from which exactly zero must match for
|
|
15265
|
+
* this condition to pass.
|
|
15266
|
+
*
|
|
15267
|
+
*/
|
|
15268
|
+
readonly itemTagsNone: string[];
|
|
15269
|
+
}
|
|
15270
|
+
|
|
15271
|
+
/**
|
|
15272
|
+
* @beta
|
|
15273
|
+
* A specific currently-internal event used for passing
|
|
15274
|
+
* messages from client to server.
|
|
15275
|
+
*/
|
|
15276
|
+
export class MessageReceiveAfterEvent {
|
|
15277
|
+
private constructor();
|
|
15278
|
+
/**
|
|
15279
|
+
* @remarks
|
|
15280
|
+
* The message identifier.
|
|
15281
|
+
*
|
|
15282
|
+
*/
|
|
15283
|
+
readonly id: string;
|
|
15284
|
+
/**
|
|
15285
|
+
* @remarks
|
|
15286
|
+
* The message.
|
|
15287
|
+
*
|
|
15288
|
+
*/
|
|
15289
|
+
readonly message: string;
|
|
15290
|
+
/**
|
|
15291
|
+
* @remarks
|
|
15292
|
+
* The player who sent the message.
|
|
15293
|
+
*
|
|
15294
|
+
*/
|
|
15295
|
+
readonly player: Player;
|
|
13108
15296
|
}
|
|
13109
15297
|
|
|
13110
15298
|
/**
|
|
@@ -13175,6 +15363,65 @@ export class MolangVariableMap {
|
|
|
13175
15363
|
setVector3(variableName: string, vector: Vector3): void;
|
|
13176
15364
|
}
|
|
13177
15365
|
|
|
15366
|
+
/**
|
|
15367
|
+
* @beta
|
|
15368
|
+
* Pack setting name and value that changed.
|
|
15369
|
+
*/
|
|
15370
|
+
export class PackSettingChangeAfterEvent {
|
|
15371
|
+
private constructor();
|
|
15372
|
+
/**
|
|
15373
|
+
* @remarks
|
|
15374
|
+
* The name of the setting.
|
|
15375
|
+
*
|
|
15376
|
+
*/
|
|
15377
|
+
readonly settingName: string;
|
|
15378
|
+
/**
|
|
15379
|
+
* @remarks
|
|
15380
|
+
* The value of the setting.
|
|
15381
|
+
*
|
|
15382
|
+
*/
|
|
15383
|
+
readonly settingValue: boolean | number | string;
|
|
15384
|
+
}
|
|
15385
|
+
|
|
15386
|
+
/**
|
|
15387
|
+
* @beta
|
|
15388
|
+
*/
|
|
15389
|
+
export class PackSettingChangeAfterEventSignal {
|
|
15390
|
+
private constructor();
|
|
15391
|
+
/**
|
|
15392
|
+
* @remarks
|
|
15393
|
+
* This function can't be called in read-only mode.
|
|
15394
|
+
*
|
|
15395
|
+
* This function can be called in early-execution mode.
|
|
15396
|
+
*
|
|
15397
|
+
*/
|
|
15398
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
15399
|
+
/**
|
|
15400
|
+
* @remarks
|
|
15401
|
+
* This function can't be called in read-only mode.
|
|
15402
|
+
*
|
|
15403
|
+
* This function can be called in early-execution mode.
|
|
15404
|
+
*
|
|
15405
|
+
*/
|
|
15406
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
15407
|
+
}
|
|
15408
|
+
|
|
15409
|
+
/**
|
|
15410
|
+
* @beta
|
|
15411
|
+
* Loot item condition that checks whether the looting entity
|
|
15412
|
+
* is currently a passenger of a specific type of entity.
|
|
15413
|
+
*/
|
|
15414
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
15415
|
+
export class PassengerOfEntityCondition extends LootItemCondition {
|
|
15416
|
+
private constructor();
|
|
15417
|
+
/**
|
|
15418
|
+
* @remarks
|
|
15419
|
+
* The entity type required for this condition to pass.
|
|
15420
|
+
*
|
|
15421
|
+
*/
|
|
15422
|
+
readonly entityType: string;
|
|
15423
|
+
}
|
|
15424
|
+
|
|
13178
15425
|
/**
|
|
13179
15426
|
* Contains information related to changes to a piston
|
|
13180
15427
|
* expanding or retracting.
|
|
@@ -13473,6 +15720,37 @@ export class Player extends Entity {
|
|
|
13473
15720
|
* Throws if the entity is invalid.
|
|
13474
15721
|
*/
|
|
13475
15722
|
clearPropertyOverridesForEntity(targetEntity: Entity): void;
|
|
15723
|
+
/**
|
|
15724
|
+
* @beta
|
|
15725
|
+
* @remarks
|
|
15726
|
+
* Eats an item, providing the item's hunger and saturation
|
|
15727
|
+
* effects to the player. Can only be used on food items.
|
|
15728
|
+
*
|
|
15729
|
+
* This function can't be called in read-only mode.
|
|
15730
|
+
*
|
|
15731
|
+
* @param itemStack
|
|
15732
|
+
* The item to eat.
|
|
15733
|
+
* @throws
|
|
15734
|
+
* Throws if the item is not a food item.
|
|
15735
|
+
*/
|
|
15736
|
+
eatItem(itemStack: ItemStack): void;
|
|
15737
|
+
/**
|
|
15738
|
+
* @beta
|
|
15739
|
+
* @remarks
|
|
15740
|
+
* The player's aim-assist settings.
|
|
15741
|
+
*
|
|
15742
|
+
*/
|
|
15743
|
+
getAimAssist(): PlayerAimAssist;
|
|
15744
|
+
/**
|
|
15745
|
+
* @beta
|
|
15746
|
+
* @remarks
|
|
15747
|
+
* Returns the player's current control scheme.
|
|
15748
|
+
*
|
|
15749
|
+
* @throws This function can throw errors.
|
|
15750
|
+
*
|
|
15751
|
+
* {@link InvalidEntityError}
|
|
15752
|
+
*/
|
|
15753
|
+
getControlScheme(): ControlScheme;
|
|
13476
15754
|
/**
|
|
13477
15755
|
* @remarks
|
|
13478
15756
|
* Retrieves the active gamemode for this player, if specified.
|
|
@@ -13558,6 +15836,17 @@ export class Player extends Entity {
|
|
|
13558
15836
|
* ```
|
|
13559
15837
|
*/
|
|
13560
15838
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
|
|
15839
|
+
/**
|
|
15840
|
+
* @beta
|
|
15841
|
+
* @remarks
|
|
15842
|
+
* This is an internal-facing method for posting a system
|
|
15843
|
+
* message to downstream clients.
|
|
15844
|
+
*
|
|
15845
|
+
* This function can't be called in read-only mode.
|
|
15846
|
+
*
|
|
15847
|
+
* @throws This function can throw errors.
|
|
15848
|
+
*/
|
|
15849
|
+
postClientMessage(id: string, value: string): void;
|
|
13561
15850
|
/**
|
|
13562
15851
|
* @remarks
|
|
13563
15852
|
* Queues an additional music track that only this particular
|
|
@@ -13689,11 +15978,38 @@ export class Player extends Entity {
|
|
|
13689
15978
|
* ) {
|
|
13690
15979
|
* const players = world.getPlayers();
|
|
13691
15980
|
*
|
|
13692
|
-
* players[0].sendMessage({ translate: "authentication.welcome", with: ["Amazing Player 1"] });
|
|
13693
|
-
* }
|
|
13694
|
-
* ```
|
|
15981
|
+
* players[0].sendMessage({ translate: "authentication.welcome", with: ["Amazing Player 1"] });
|
|
15982
|
+
* }
|
|
15983
|
+
* ```
|
|
15984
|
+
*/
|
|
15985
|
+
sendMessage(message: (RawMessage | string)[] | RawMessage | string): void;
|
|
15986
|
+
/**
|
|
15987
|
+
* @beta
|
|
15988
|
+
* @remarks
|
|
15989
|
+
* Set a player's control scheme. The player's active camera
|
|
15990
|
+
* preset must be set by scripts like with camera.setCamera()
|
|
15991
|
+
* or commands.
|
|
15992
|
+
*
|
|
15993
|
+
* This function can't be called in read-only mode.
|
|
15994
|
+
*
|
|
15995
|
+
* @param controlScheme
|
|
15996
|
+
* Control scheme type. If this argument is undefined, this
|
|
15997
|
+
* method will clear the player's control scheme back to the
|
|
15998
|
+
* player camera's default control scheme.
|
|
15999
|
+
* @returns
|
|
16000
|
+
* Returns nothing if the control scheme was added or updated
|
|
16001
|
+
* successfully. This can throw an InvalidArgumentError if the
|
|
16002
|
+
* control scheme is not allowed by the player's current
|
|
16003
|
+
* camera.
|
|
16004
|
+
* @throws This function can throw errors.
|
|
16005
|
+
*
|
|
16006
|
+
* {@link minecraftcommon.EngineError}
|
|
16007
|
+
*
|
|
16008
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
16009
|
+
*
|
|
16010
|
+
* {@link InvalidEntityError}
|
|
13695
16011
|
*/
|
|
13696
|
-
|
|
16012
|
+
setControlScheme(controlScheme?: string): void;
|
|
13697
16013
|
/**
|
|
13698
16014
|
* @remarks
|
|
13699
16015
|
* Sets a gamemode override for this player.
|
|
@@ -13808,6 +16124,18 @@ export class Player extends Entity {
|
|
|
13808
16124
|
* @throws This function can throw errors.
|
|
13809
16125
|
*/
|
|
13810
16126
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
16127
|
+
/**
|
|
16128
|
+
* @beta
|
|
16129
|
+
* @remarks
|
|
16130
|
+
* Stops all sounds from playing for this particular player.
|
|
16131
|
+
*
|
|
16132
|
+
* This function can't be called in read-only mode.
|
|
16133
|
+
*
|
|
16134
|
+
* @throws This function can throw errors.
|
|
16135
|
+
*
|
|
16136
|
+
* {@link InvalidEntityError}
|
|
16137
|
+
*/
|
|
16138
|
+
stopAllSounds(): void;
|
|
13811
16139
|
/**
|
|
13812
16140
|
* @remarks
|
|
13813
16141
|
* Stops any music tracks from playing for this particular
|
|
@@ -13818,6 +16146,59 @@ export class Player extends Entity {
|
|
|
13818
16146
|
* @throws This function can throw errors.
|
|
13819
16147
|
*/
|
|
13820
16148
|
stopMusic(): void;
|
|
16149
|
+
/**
|
|
16150
|
+
* @beta
|
|
16151
|
+
* @remarks
|
|
16152
|
+
* Stops a sound from playing for this particular player.
|
|
16153
|
+
*
|
|
16154
|
+
* This function can't be called in read-only mode.
|
|
16155
|
+
*
|
|
16156
|
+
* @param soundId
|
|
16157
|
+
* Identifier of the sound.
|
|
16158
|
+
* @throws This function can throw errors.
|
|
16159
|
+
*
|
|
16160
|
+
* {@link InvalidEntityError}
|
|
16161
|
+
*/
|
|
16162
|
+
stopSound(soundId: string): void;
|
|
16163
|
+
}
|
|
16164
|
+
|
|
16165
|
+
/**
|
|
16166
|
+
* @beta
|
|
16167
|
+
* A container for APIs related to player aim-assist.
|
|
16168
|
+
*/
|
|
16169
|
+
export class PlayerAimAssist {
|
|
16170
|
+
private constructor();
|
|
16171
|
+
/**
|
|
16172
|
+
* @remarks
|
|
16173
|
+
* The player's currently active aim-assist settings, or
|
|
16174
|
+
* undefined if not active.
|
|
16175
|
+
*
|
|
16176
|
+
*/
|
|
16177
|
+
readonly settings?: PlayerAimAssistSettings;
|
|
16178
|
+
/**
|
|
16179
|
+
* @remarks
|
|
16180
|
+
* Sets the player's aim-assist settings.
|
|
16181
|
+
*
|
|
16182
|
+
* This function can't be called in read-only mode.
|
|
16183
|
+
*
|
|
16184
|
+
* @param settings
|
|
16185
|
+
* Aim-assist settings to activate for the player, if undefined
|
|
16186
|
+
* aim-assist will be disabled.
|
|
16187
|
+
* @throws This function can throw errors.
|
|
16188
|
+
*
|
|
16189
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
16190
|
+
*
|
|
16191
|
+
* {@link minecraftcommon.EngineError}
|
|
16192
|
+
*
|
|
16193
|
+
* {@link Error}
|
|
16194
|
+
*
|
|
16195
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
16196
|
+
*
|
|
16197
|
+
* {@link InvalidEntityError}
|
|
16198
|
+
*
|
|
16199
|
+
* {@link NamespaceNameError}
|
|
16200
|
+
*/
|
|
16201
|
+
set(settings?: PlayerAimAssistSettings): void;
|
|
13821
16202
|
}
|
|
13822
16203
|
|
|
13823
16204
|
/**
|
|
@@ -14877,215 +17258,515 @@ export class PlayerJoinAfterEventSignal {
|
|
|
14877
17258
|
* This function can be called in early-execution mode.
|
|
14878
17259
|
*
|
|
14879
17260
|
*/
|
|
14880
|
-
subscribe(callback: (arg0: PlayerJoinAfterEvent) => void): (arg0: PlayerJoinAfterEvent) => void;
|
|
17261
|
+
subscribe(callback: (arg0: PlayerJoinAfterEvent) => void): (arg0: PlayerJoinAfterEvent) => void;
|
|
17262
|
+
/**
|
|
17263
|
+
* @remarks
|
|
17264
|
+
* Removes a callback from being called when a player joins the
|
|
17265
|
+
* world.
|
|
17266
|
+
*
|
|
17267
|
+
* This function can't be called in read-only mode.
|
|
17268
|
+
*
|
|
17269
|
+
* This function can be called in early-execution mode.
|
|
17270
|
+
*
|
|
17271
|
+
*/
|
|
17272
|
+
unsubscribe(callback: (arg0: PlayerJoinAfterEvent) => void): void;
|
|
17273
|
+
}
|
|
17274
|
+
|
|
17275
|
+
/**
|
|
17276
|
+
* Contains information regarding a player that has left the
|
|
17277
|
+
* world.
|
|
17278
|
+
*/
|
|
17279
|
+
export class PlayerLeaveAfterEvent {
|
|
17280
|
+
private constructor();
|
|
17281
|
+
/**
|
|
17282
|
+
* @remarks
|
|
17283
|
+
* Opaque string identifier of the player that has left the
|
|
17284
|
+
* event.
|
|
17285
|
+
*
|
|
17286
|
+
*/
|
|
17287
|
+
readonly playerId: string;
|
|
17288
|
+
/**
|
|
17289
|
+
* @remarks
|
|
17290
|
+
* Player that has left the world.
|
|
17291
|
+
*
|
|
17292
|
+
*/
|
|
17293
|
+
readonly playerName: string;
|
|
17294
|
+
}
|
|
17295
|
+
|
|
17296
|
+
/**
|
|
17297
|
+
* Manages callbacks that are connected to a player leaving the
|
|
17298
|
+
* world.
|
|
17299
|
+
*/
|
|
17300
|
+
export class PlayerLeaveAfterEventSignal {
|
|
17301
|
+
private constructor();
|
|
17302
|
+
/**
|
|
17303
|
+
* @remarks
|
|
17304
|
+
* Adds a callback that will be called when a player leaves the
|
|
17305
|
+
* world.
|
|
17306
|
+
*
|
|
17307
|
+
* This function can't be called in read-only mode.
|
|
17308
|
+
*
|
|
17309
|
+
* This function can be called in early-execution mode.
|
|
17310
|
+
*
|
|
17311
|
+
*/
|
|
17312
|
+
subscribe(callback: (arg0: PlayerLeaveAfterEvent) => void): (arg0: PlayerLeaveAfterEvent) => void;
|
|
17313
|
+
/**
|
|
17314
|
+
* @remarks
|
|
17315
|
+
* Removes a callback from being called when a player leaves
|
|
17316
|
+
* the world.
|
|
17317
|
+
*
|
|
17318
|
+
* This function can't be called in read-only mode.
|
|
17319
|
+
*
|
|
17320
|
+
* This function can be called in early-execution mode.
|
|
17321
|
+
*
|
|
17322
|
+
*/
|
|
17323
|
+
unsubscribe(callback: (arg0: PlayerLeaveAfterEvent) => void): void;
|
|
17324
|
+
}
|
|
17325
|
+
|
|
17326
|
+
/**
|
|
17327
|
+
* Contains information regarding a player that is leaving the
|
|
17328
|
+
* world.
|
|
17329
|
+
*/
|
|
17330
|
+
export class PlayerLeaveBeforeEvent {
|
|
17331
|
+
private constructor();
|
|
17332
|
+
/**
|
|
17333
|
+
* @remarks
|
|
17334
|
+
* The leaving player.
|
|
17335
|
+
*
|
|
17336
|
+
*/
|
|
17337
|
+
readonly player: Player;
|
|
17338
|
+
}
|
|
17339
|
+
|
|
17340
|
+
/**
|
|
17341
|
+
* Manages callbacks that are connected to a player leaving the
|
|
17342
|
+
* world.
|
|
17343
|
+
*/
|
|
17344
|
+
export class PlayerLeaveBeforeEventSignal {
|
|
17345
|
+
private constructor();
|
|
17346
|
+
/**
|
|
17347
|
+
* @remarks
|
|
17348
|
+
* Adds a callback that will be called when a player leaves the
|
|
17349
|
+
* world.
|
|
17350
|
+
*
|
|
17351
|
+
* This function can't be called in read-only mode.
|
|
17352
|
+
*
|
|
17353
|
+
* This function can be called in early-execution mode.
|
|
17354
|
+
*
|
|
17355
|
+
*/
|
|
17356
|
+
subscribe(callback: (arg0: PlayerLeaveBeforeEvent) => void): (arg0: PlayerLeaveBeforeEvent) => void;
|
|
17357
|
+
/**
|
|
17358
|
+
* @remarks
|
|
17359
|
+
* Removes a callback that will be called when a player leaves
|
|
17360
|
+
* the world.
|
|
17361
|
+
*
|
|
17362
|
+
* This function can't be called in read-only mode.
|
|
17363
|
+
*
|
|
17364
|
+
* This function can be called in early-execution mode.
|
|
17365
|
+
*
|
|
17366
|
+
*/
|
|
17367
|
+
unsubscribe(callback: (arg0: PlayerLeaveBeforeEvent) => void): void;
|
|
17368
|
+
}
|
|
17369
|
+
|
|
17370
|
+
/**
|
|
17371
|
+
* Contains information regarding an event where a player
|
|
17372
|
+
* places a block.
|
|
17373
|
+
*/
|
|
17374
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
17375
|
+
export class PlayerPlaceBlockAfterEvent extends BlockEvent {
|
|
17376
|
+
private constructor();
|
|
17377
|
+
/**
|
|
17378
|
+
* @remarks
|
|
17379
|
+
* Player that placed the block for this event.
|
|
17380
|
+
*
|
|
17381
|
+
*/
|
|
17382
|
+
readonly player: Player;
|
|
17383
|
+
}
|
|
17384
|
+
|
|
17385
|
+
/**
|
|
17386
|
+
* Manages callbacks that are connected to when a block is
|
|
17387
|
+
* placed by a player.
|
|
17388
|
+
*/
|
|
17389
|
+
export class PlayerPlaceBlockAfterEventSignal {
|
|
17390
|
+
private constructor();
|
|
17391
|
+
/**
|
|
17392
|
+
* @remarks
|
|
17393
|
+
* Adds a callback that will be called when a block is placed
|
|
17394
|
+
* by a player.
|
|
17395
|
+
*
|
|
17396
|
+
* This function can't be called in read-only mode.
|
|
17397
|
+
*
|
|
17398
|
+
* This function can be called in early-execution mode.
|
|
17399
|
+
*
|
|
17400
|
+
*/
|
|
17401
|
+
subscribe(
|
|
17402
|
+
callback: (arg0: PlayerPlaceBlockAfterEvent) => void,
|
|
17403
|
+
options?: BlockEventOptions,
|
|
17404
|
+
): (arg0: PlayerPlaceBlockAfterEvent) => void;
|
|
17405
|
+
/**
|
|
17406
|
+
* @remarks
|
|
17407
|
+
* Removes a callback from being called when an block is placed
|
|
17408
|
+
* by a player.
|
|
17409
|
+
*
|
|
17410
|
+
* This function can't be called in read-only mode.
|
|
17411
|
+
*
|
|
17412
|
+
* This function can be called in early-execution mode.
|
|
17413
|
+
*
|
|
17414
|
+
*/
|
|
17415
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
17416
|
+
}
|
|
17417
|
+
|
|
17418
|
+
/**
|
|
17419
|
+
* @beta
|
|
17420
|
+
* Contains information regarding an event before a player
|
|
17421
|
+
* places a block.
|
|
17422
|
+
*/
|
|
17423
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
17424
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
17425
|
+
private constructor();
|
|
17426
|
+
/**
|
|
17427
|
+
* @remarks
|
|
17428
|
+
* If set to true, cancels the block place event.
|
|
17429
|
+
*
|
|
17430
|
+
*/
|
|
17431
|
+
cancel: boolean;
|
|
17432
|
+
/**
|
|
17433
|
+
* @remarks
|
|
17434
|
+
* The face of the block that the new block is being placed on.
|
|
17435
|
+
*
|
|
17436
|
+
*/
|
|
17437
|
+
readonly face: Direction;
|
|
17438
|
+
/**
|
|
17439
|
+
* @remarks
|
|
17440
|
+
* Location relative to the bottom north-west corner of the
|
|
17441
|
+
* block where the new block is being placed onto.
|
|
17442
|
+
*
|
|
17443
|
+
*/
|
|
17444
|
+
readonly faceLocation: Vector3;
|
|
17445
|
+
/**
|
|
17446
|
+
* @remarks
|
|
17447
|
+
* The block permutation that will be placed if the event is
|
|
17448
|
+
* not cancelled.
|
|
17449
|
+
*
|
|
17450
|
+
*/
|
|
17451
|
+
readonly permutationToPlace: BlockPermutation;
|
|
17452
|
+
/**
|
|
17453
|
+
* @remarks
|
|
17454
|
+
* Player that is placing the block for this event.
|
|
17455
|
+
*
|
|
17456
|
+
*/
|
|
17457
|
+
readonly player: Player;
|
|
17458
|
+
}
|
|
17459
|
+
|
|
17460
|
+
/**
|
|
17461
|
+
* @beta
|
|
17462
|
+
* Manages callbacks that are connected to before a block is
|
|
17463
|
+
* placed by a player.
|
|
17464
|
+
*/
|
|
17465
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
17466
|
+
private constructor();
|
|
17467
|
+
/**
|
|
17468
|
+
* @remarks
|
|
17469
|
+
* Adds a callback that will be called before a block is placed
|
|
17470
|
+
* by a player.
|
|
17471
|
+
*
|
|
17472
|
+
* This function can't be called in read-only mode.
|
|
17473
|
+
*
|
|
17474
|
+
* This function can be called in early-execution mode.
|
|
17475
|
+
*
|
|
17476
|
+
*/
|
|
17477
|
+
subscribe(
|
|
17478
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
17479
|
+
options?: BlockEventOptions,
|
|
17480
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
14881
17481
|
/**
|
|
14882
17482
|
* @remarks
|
|
14883
|
-
* Removes a callback from being called
|
|
14884
|
-
*
|
|
17483
|
+
* Removes a callback from being called before an block is
|
|
17484
|
+
* placed by a player.
|
|
14885
17485
|
*
|
|
14886
17486
|
* This function can't be called in read-only mode.
|
|
14887
17487
|
*
|
|
14888
17488
|
* This function can be called in early-execution mode.
|
|
14889
17489
|
*
|
|
14890
17490
|
*/
|
|
14891
|
-
unsubscribe(callback: (arg0:
|
|
17491
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
14892
17492
|
}
|
|
14893
17493
|
|
|
14894
17494
|
/**
|
|
14895
|
-
*
|
|
14896
|
-
*
|
|
17495
|
+
* An event that contains more information about a player
|
|
17496
|
+
* spawning.
|
|
14897
17497
|
*/
|
|
14898
|
-
export class
|
|
17498
|
+
export class PlayerSpawnAfterEvent {
|
|
14899
17499
|
private constructor();
|
|
14900
17500
|
/**
|
|
14901
17501
|
* @remarks
|
|
14902
|
-
*
|
|
14903
|
-
*
|
|
17502
|
+
* If true, this is the initial spawn of a player after joining
|
|
17503
|
+
* the game.
|
|
17504
|
+
*
|
|
17505
|
+
* This property can't be edited in read-only mode.
|
|
14904
17506
|
*
|
|
14905
17507
|
*/
|
|
14906
|
-
|
|
17508
|
+
initialSpawn: boolean;
|
|
14907
17509
|
/**
|
|
14908
17510
|
* @remarks
|
|
14909
|
-
*
|
|
17511
|
+
* Object that represents the player that joined the game.
|
|
17512
|
+
*
|
|
17513
|
+
* This property can't be edited in read-only mode.
|
|
14910
17514
|
*
|
|
14911
17515
|
*/
|
|
14912
|
-
|
|
17516
|
+
player: Player;
|
|
14913
17517
|
}
|
|
14914
17518
|
|
|
14915
17519
|
/**
|
|
14916
|
-
*
|
|
14917
|
-
* world.
|
|
17520
|
+
* Registers an event when a player is spawned (or re-spawned
|
|
17521
|
+
* after death) and fully ready within the world.
|
|
14918
17522
|
*/
|
|
14919
|
-
export class
|
|
17523
|
+
export class PlayerSpawnAfterEventSignal {
|
|
14920
17524
|
private constructor();
|
|
14921
17525
|
/**
|
|
14922
17526
|
* @remarks
|
|
14923
|
-
*
|
|
14924
|
-
*
|
|
17527
|
+
* Registers a new event receiver for this particular type of
|
|
17528
|
+
* event.
|
|
14925
17529
|
*
|
|
14926
17530
|
* This function can't be called in read-only mode.
|
|
14927
17531
|
*
|
|
14928
17532
|
* This function can be called in early-execution mode.
|
|
14929
17533
|
*
|
|
14930
17534
|
*/
|
|
14931
|
-
subscribe(callback: (arg0:
|
|
17535
|
+
subscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): (arg0: PlayerSpawnAfterEvent) => void;
|
|
14932
17536
|
/**
|
|
14933
17537
|
* @remarks
|
|
14934
|
-
*
|
|
14935
|
-
* the world.
|
|
17538
|
+
* De-registers an event receiver for the player spawn event.
|
|
14936
17539
|
*
|
|
14937
17540
|
* This function can't be called in read-only mode.
|
|
14938
17541
|
*
|
|
14939
17542
|
* This function can be called in early-execution mode.
|
|
14940
17543
|
*
|
|
14941
17544
|
*/
|
|
14942
|
-
unsubscribe(callback: (arg0:
|
|
17545
|
+
unsubscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): void;
|
|
14943
17546
|
}
|
|
14944
17547
|
|
|
14945
17548
|
/**
|
|
14946
|
-
*
|
|
14947
|
-
*
|
|
17549
|
+
* @beta
|
|
17550
|
+
* Contains information regarding a player starting to swing
|
|
17551
|
+
* their arm.
|
|
14948
17552
|
*/
|
|
14949
|
-
export class
|
|
17553
|
+
export class PlayerSwingStartAfterEvent {
|
|
14950
17554
|
private constructor();
|
|
14951
17555
|
/**
|
|
14952
17556
|
* @remarks
|
|
14953
|
-
* The
|
|
17557
|
+
* The item stack being held by the player at the start of
|
|
17558
|
+
* their swing.
|
|
17559
|
+
*
|
|
17560
|
+
*/
|
|
17561
|
+
readonly heldItemStack?: ItemStack;
|
|
17562
|
+
/**
|
|
17563
|
+
* @remarks
|
|
17564
|
+
* Source Player for this event.
|
|
14954
17565
|
*
|
|
14955
17566
|
*/
|
|
14956
17567
|
readonly player: Player;
|
|
14957
17568
|
}
|
|
14958
17569
|
|
|
14959
17570
|
/**
|
|
14960
|
-
*
|
|
14961
|
-
*
|
|
17571
|
+
* @beta
|
|
17572
|
+
* Manages callbacks that are connected to when a player starts
|
|
17573
|
+
* to swing their arm (e.g. attacking, using an item,
|
|
17574
|
+
* interacting).
|
|
14962
17575
|
*/
|
|
14963
|
-
export class
|
|
17576
|
+
export class PlayerSwingStartAfterEventSignal {
|
|
14964
17577
|
private constructor();
|
|
14965
17578
|
/**
|
|
14966
17579
|
* @remarks
|
|
14967
|
-
* Adds a callback that will be called when a player
|
|
14968
|
-
*
|
|
17580
|
+
* Adds a callback that will be called when a player starts to
|
|
17581
|
+
* swing their arm (e.g. attacking, using an item,
|
|
17582
|
+
* interacting).
|
|
14969
17583
|
*
|
|
14970
17584
|
* This function can't be called in read-only mode.
|
|
14971
17585
|
*
|
|
14972
17586
|
* This function can be called in early-execution mode.
|
|
14973
17587
|
*
|
|
14974
17588
|
*/
|
|
14975
|
-
subscribe(
|
|
17589
|
+
subscribe(
|
|
17590
|
+
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
17591
|
+
options?: PlayerSwingEventOptions,
|
|
17592
|
+
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
14976
17593
|
/**
|
|
14977
17594
|
* @remarks
|
|
14978
|
-
* Removes a callback
|
|
14979
|
-
*
|
|
17595
|
+
* Removes a callback from being called when a player starts to
|
|
17596
|
+
* swing their arm (e.g. attacking, using an item,
|
|
17597
|
+
* interacting).
|
|
14980
17598
|
*
|
|
14981
17599
|
* This function can't be called in read-only mode.
|
|
14982
17600
|
*
|
|
14983
17601
|
* This function can be called in early-execution mode.
|
|
14984
17602
|
*
|
|
14985
17603
|
*/
|
|
14986
|
-
unsubscribe(callback: (arg0:
|
|
17604
|
+
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
14987
17605
|
}
|
|
14988
17606
|
|
|
14989
17607
|
/**
|
|
14990
|
-
*
|
|
14991
|
-
*
|
|
17608
|
+
* @beta
|
|
17609
|
+
* Contains information related to when a player successfully
|
|
17610
|
+
* names an Entity with a named Name Tag item.
|
|
14992
17611
|
*/
|
|
14993
|
-
|
|
14994
|
-
export class PlayerPlaceBlockAfterEvent extends BlockEvent {
|
|
17612
|
+
export class PlayerUseNameTagAfterEvent {
|
|
14995
17613
|
private constructor();
|
|
14996
17614
|
/**
|
|
14997
17615
|
* @remarks
|
|
14998
|
-
*
|
|
17616
|
+
* The entity that was named by the player.
|
|
17617
|
+
*
|
|
17618
|
+
* This property can't be edited in read-only mode.
|
|
14999
17619
|
*
|
|
15000
17620
|
*/
|
|
15001
|
-
|
|
17621
|
+
entityNamed: Entity;
|
|
17622
|
+
/**
|
|
17623
|
+
* @remarks
|
|
17624
|
+
* The new name that the player has given to the entity.
|
|
17625
|
+
*
|
|
17626
|
+
* This property can't be edited in read-only mode.
|
|
17627
|
+
*
|
|
17628
|
+
*/
|
|
17629
|
+
newName: string;
|
|
17630
|
+
/**
|
|
17631
|
+
* @remarks
|
|
17632
|
+
* Handle to the player that used the name tag.
|
|
17633
|
+
*
|
|
17634
|
+
* This property can't be edited in read-only mode.
|
|
17635
|
+
*
|
|
17636
|
+
*/
|
|
17637
|
+
player: Player;
|
|
17638
|
+
/**
|
|
17639
|
+
* @remarks
|
|
17640
|
+
* The previous name of the entity before the player used the
|
|
17641
|
+
* name tag. This will be undefined if the entity was not
|
|
17642
|
+
* previously named.
|
|
17643
|
+
*
|
|
17644
|
+
* This property can't be edited in read-only mode.
|
|
17645
|
+
*
|
|
17646
|
+
*/
|
|
17647
|
+
previousName?: string;
|
|
15002
17648
|
}
|
|
15003
17649
|
|
|
15004
17650
|
/**
|
|
15005
|
-
*
|
|
15006
|
-
*
|
|
17651
|
+
* @beta
|
|
17652
|
+
* Manages callbacks that are connected to when a player
|
|
17653
|
+
* successfully names an Entity with a named Name Tag item.
|
|
15007
17654
|
*/
|
|
15008
|
-
export class
|
|
17655
|
+
export class PlayerUseNameTagAfterEventSignal {
|
|
15009
17656
|
private constructor();
|
|
15010
17657
|
/**
|
|
15011
17658
|
* @remarks
|
|
15012
|
-
*
|
|
15013
|
-
*
|
|
17659
|
+
* Subscribes the specified callback to a player use name tag
|
|
17660
|
+
* after event.
|
|
15014
17661
|
*
|
|
15015
17662
|
* This function can't be called in read-only mode.
|
|
15016
17663
|
*
|
|
15017
17664
|
* This function can be called in early-execution mode.
|
|
15018
17665
|
*
|
|
15019
17666
|
*/
|
|
15020
|
-
subscribe(
|
|
15021
|
-
callback: (arg0: PlayerPlaceBlockAfterEvent) => void,
|
|
15022
|
-
options?: BlockEventOptions,
|
|
15023
|
-
): (arg0: PlayerPlaceBlockAfterEvent) => void;
|
|
17667
|
+
subscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): (arg0: PlayerUseNameTagAfterEvent) => void;
|
|
15024
17668
|
/**
|
|
15025
17669
|
* @remarks
|
|
15026
|
-
* Removes
|
|
15027
|
-
*
|
|
17670
|
+
* Removes the specified callback from a player use name tag
|
|
17671
|
+
* after event.
|
|
15028
17672
|
*
|
|
15029
17673
|
* This function can't be called in read-only mode.
|
|
15030
17674
|
*
|
|
15031
17675
|
* This function can be called in early-execution mode.
|
|
15032
17676
|
*
|
|
15033
17677
|
*/
|
|
15034
|
-
unsubscribe(callback: (arg0:
|
|
17678
|
+
unsubscribe(callback: (arg0: PlayerUseNameTagAfterEvent) => void): void;
|
|
15035
17679
|
}
|
|
15036
17680
|
|
|
15037
17681
|
/**
|
|
15038
|
-
*
|
|
15039
|
-
*
|
|
17682
|
+
* @beta
|
|
17683
|
+
* Represents how the potion effect is delivered.
|
|
15040
17684
|
*/
|
|
15041
|
-
export class
|
|
17685
|
+
export class PotionDeliveryType {
|
|
17686
|
+
private constructor();
|
|
17687
|
+
readonly id: string;
|
|
17688
|
+
}
|
|
17689
|
+
|
|
17690
|
+
/**
|
|
17691
|
+
* @beta
|
|
17692
|
+
* Represents a type of potion effect - like healing or
|
|
17693
|
+
* leaping.
|
|
17694
|
+
*/
|
|
17695
|
+
export class PotionEffectType {
|
|
15042
17696
|
private constructor();
|
|
15043
17697
|
/**
|
|
15044
17698
|
* @remarks
|
|
15045
|
-
*
|
|
15046
|
-
* the
|
|
15047
|
-
*
|
|
15048
|
-
* This property can't be edited in read-only mode.
|
|
15049
|
-
*
|
|
15050
|
-
*/
|
|
15051
|
-
initialSpawn: boolean;
|
|
15052
|
-
/**
|
|
15053
|
-
* @remarks
|
|
15054
|
-
* Object that represents the player that joined the game.
|
|
17699
|
+
* Duration of the effect when applied to an entity in ticks.
|
|
17700
|
+
* Undefined means the effect does not expire.
|
|
15055
17701
|
*
|
|
15056
|
-
* This property can
|
|
17702
|
+
* @throws This property can throw when used.
|
|
15057
17703
|
*
|
|
17704
|
+
* {@link minecraftcommon.EngineError}
|
|
15058
17705
|
*/
|
|
15059
|
-
|
|
17706
|
+
readonly durationTicks?: number;
|
|
17707
|
+
readonly id: string;
|
|
15060
17708
|
}
|
|
15061
17709
|
|
|
15062
17710
|
/**
|
|
15063
|
-
*
|
|
15064
|
-
*
|
|
17711
|
+
* @beta
|
|
17712
|
+
* Used for accessing all potion effect types, delivery types,
|
|
17713
|
+
* and creating potions.
|
|
15065
17714
|
*/
|
|
15066
|
-
export class
|
|
17715
|
+
export class Potions {
|
|
15067
17716
|
private constructor();
|
|
15068
17717
|
/**
|
|
15069
17718
|
* @remarks
|
|
15070
|
-
*
|
|
15071
|
-
* event.
|
|
17719
|
+
* Retrieves handles for all registered potion delivery types.
|
|
15072
17720
|
*
|
|
15073
|
-
*
|
|
17721
|
+
* @returns
|
|
17722
|
+
* Array of all registered delivery type handles.
|
|
17723
|
+
*/
|
|
17724
|
+
static getAllDeliveryTypes(): PotionDeliveryType[];
|
|
17725
|
+
/**
|
|
17726
|
+
* @remarks
|
|
17727
|
+
* Retrieves all type handle for all registered potion effects.
|
|
15074
17728
|
*
|
|
15075
|
-
*
|
|
17729
|
+
* @returns
|
|
17730
|
+
* Array of all registered effect type handles.
|
|
17731
|
+
*/
|
|
17732
|
+
static getAllEffectTypes(): PotionEffectType[];
|
|
17733
|
+
/**
|
|
17734
|
+
* @remarks
|
|
17735
|
+
* Retrieves a type handle for a specified potion delivery id.
|
|
15076
17736
|
*
|
|
17737
|
+
* @returns
|
|
17738
|
+
* A type handle wrapping the valid delivery id, or undefined
|
|
17739
|
+
* for an invalid delivery id.
|
|
15077
17740
|
*/
|
|
15078
|
-
|
|
17741
|
+
static getDeliveryType(potionDeliveryId: string): PotionDeliveryType | undefined;
|
|
15079
17742
|
/**
|
|
15080
17743
|
* @remarks
|
|
15081
|
-
*
|
|
17744
|
+
* Retrieves a type handle for a specified potion effect id.
|
|
15082
17745
|
*
|
|
15083
|
-
*
|
|
17746
|
+
* @param potionEffectId
|
|
17747
|
+
* A valid potion effect id. See
|
|
17748
|
+
* @minecraft/vanilla-data.MinecraftPotionEffectTypes
|
|
17749
|
+
* @returns
|
|
17750
|
+
* A type handle wrapping the valid effect id, or undefined for
|
|
17751
|
+
* an invalid effect id.
|
|
17752
|
+
*/
|
|
17753
|
+
static getEffectType(potionEffectId: string): PotionEffectType | undefined;
|
|
17754
|
+
/**
|
|
17755
|
+
* @remarks
|
|
17756
|
+
* Creates a potion given an effect and delivery type.
|
|
15084
17757
|
*
|
|
15085
|
-
* This function can
|
|
17758
|
+
* @throws This function can throw errors.
|
|
15086
17759
|
*
|
|
17760
|
+
* {@link minecraftcommon.EngineError}
|
|
17761
|
+
*
|
|
17762
|
+
* {@link InvalidPotionDeliveryTypeError}
|
|
17763
|
+
*
|
|
17764
|
+
* {@link InvalidPotionEffectTypeError}
|
|
15087
17765
|
*/
|
|
15088
|
-
|
|
17766
|
+
static resolve<
|
|
17767
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
17768
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
17769
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
15089
17770
|
}
|
|
15090
17771
|
|
|
15091
17772
|
/**
|
|
@@ -15354,6 +18035,82 @@ export class ProjectileHitEntityAfterEventSignal {
|
|
|
15354
18035
|
unsubscribe(callback: (arg0: ProjectileHitEntityAfterEvent) => void): void;
|
|
15355
18036
|
}
|
|
15356
18037
|
|
|
18038
|
+
/**
|
|
18039
|
+
* @beta
|
|
18040
|
+
* Loot item condition that applies a given value to the
|
|
18041
|
+
* chances that loot will drop.
|
|
18042
|
+
*/
|
|
18043
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18044
|
+
export class RandomChanceCondition extends LootItemCondition {
|
|
18045
|
+
private constructor();
|
|
18046
|
+
/**
|
|
18047
|
+
* @remarks
|
|
18048
|
+
* The chance, from 0.0-1.0, that loot will drop.
|
|
18049
|
+
*
|
|
18050
|
+
*/
|
|
18051
|
+
readonly chance: number;
|
|
18052
|
+
}
|
|
18053
|
+
|
|
18054
|
+
/**
|
|
18055
|
+
* @beta
|
|
18056
|
+
* Loot item condition that applies a given value to the
|
|
18057
|
+
* chances that loot will drop, modified by the level of
|
|
18058
|
+
* looting enchantment on the tool used.
|
|
18059
|
+
*/
|
|
18060
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18061
|
+
export class RandomChanceWithLootingCondition extends LootItemCondition {
|
|
18062
|
+
private constructor();
|
|
18063
|
+
/**
|
|
18064
|
+
* @remarks
|
|
18065
|
+
* The base chance, from 0.0-1.0, that loot will drop. Will be
|
|
18066
|
+
* modified by the 'lootingMultiplier' value.
|
|
18067
|
+
*
|
|
18068
|
+
*/
|
|
18069
|
+
readonly chance: number;
|
|
18070
|
+
/**
|
|
18071
|
+
* @remarks
|
|
18072
|
+
* The increase in drop chance per looting enchant level.
|
|
18073
|
+
*
|
|
18074
|
+
*/
|
|
18075
|
+
readonly lootingMultiplier: number;
|
|
18076
|
+
}
|
|
18077
|
+
|
|
18078
|
+
/**
|
|
18079
|
+
* @beta
|
|
18080
|
+
* Loot item condition that applies given values to the chances
|
|
18081
|
+
* that loot will drop based on the current difficulty level.
|
|
18082
|
+
*/
|
|
18083
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18084
|
+
export class RandomDifficultyChanceCondition extends LootItemCondition {
|
|
18085
|
+
private constructor();
|
|
18086
|
+
/**
|
|
18087
|
+
* @remarks
|
|
18088
|
+
* A four-element array containing the chance of a loot drop
|
|
18089
|
+
* occurring for each difficulty level, in order: Peaceful,
|
|
18090
|
+
* Easy, Normal, Hard.
|
|
18091
|
+
*
|
|
18092
|
+
*/
|
|
18093
|
+
readonly chances: number[];
|
|
18094
|
+
}
|
|
18095
|
+
|
|
18096
|
+
/**
|
|
18097
|
+
* @beta
|
|
18098
|
+
* Loot item condition that applies a given value to the
|
|
18099
|
+
* chances that loot will drop, modified by the region the drop
|
|
18100
|
+
* is happening within.
|
|
18101
|
+
*/
|
|
18102
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
18103
|
+
export class RandomRegionalDifficultyChanceCondition extends LootItemCondition {
|
|
18104
|
+
private constructor();
|
|
18105
|
+
/**
|
|
18106
|
+
* @remarks
|
|
18107
|
+
* The base chance, from 0.0-1.0, that loot will drop. Will be
|
|
18108
|
+
* modified by the current region's multiplier.
|
|
18109
|
+
*
|
|
18110
|
+
*/
|
|
18111
|
+
readonly maxChance: number;
|
|
18112
|
+
}
|
|
18113
|
+
|
|
15357
18114
|
/**
|
|
15358
18115
|
* Contains objectives and participants for the scoreboard.
|
|
15359
18116
|
* @example updateScoreboard.ts
|
|
@@ -16038,6 +18795,38 @@ export class Seat {
|
|
|
16038
18795
|
readonly seatRotation: number;
|
|
16039
18796
|
}
|
|
16040
18797
|
|
|
18798
|
+
/**
|
|
18799
|
+
* @beta
|
|
18800
|
+
* Manages callbacks that are message passing to a server. This
|
|
18801
|
+
* event is not currently fully implemented, and should not be
|
|
18802
|
+
* used.
|
|
18803
|
+
*/
|
|
18804
|
+
export class ServerMessageAfterEventSignal {
|
|
18805
|
+
private constructor();
|
|
18806
|
+
/**
|
|
18807
|
+
* @remarks
|
|
18808
|
+
* Adds a callback that will be called when an internal message
|
|
18809
|
+
* is passed.
|
|
18810
|
+
*
|
|
18811
|
+
* This function can't be called in read-only mode.
|
|
18812
|
+
*
|
|
18813
|
+
* This function can be called in early-execution mode.
|
|
18814
|
+
*
|
|
18815
|
+
*/
|
|
18816
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
18817
|
+
/**
|
|
18818
|
+
* @remarks
|
|
18819
|
+
* Removes a callback from being called when an internal
|
|
18820
|
+
* message is passed.
|
|
18821
|
+
*
|
|
18822
|
+
* This function can't be called in read-only mode.
|
|
18823
|
+
*
|
|
18824
|
+
* This function can be called in early-execution mode.
|
|
18825
|
+
*
|
|
18826
|
+
*/
|
|
18827
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
18828
|
+
}
|
|
18829
|
+
|
|
16041
18830
|
/**
|
|
16042
18831
|
* Provides an adaptable interface for callers to subscribe to
|
|
16043
18832
|
* an event that fires before the game world shuts down. This
|
|
@@ -16753,6 +19542,19 @@ export class SystemBeforeEvents {
|
|
|
16753
19542
|
*
|
|
16754
19543
|
*/
|
|
16755
19544
|
readonly startup: StartupBeforeEventSignal;
|
|
19545
|
+
/**
|
|
19546
|
+
* @beta
|
|
19547
|
+
* @remarks
|
|
19548
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
19549
|
+
* can be due to using too much memory, or by causing
|
|
19550
|
+
* significant slowdown or hang.
|
|
19551
|
+
* To prevent shutdown, set the event's cancel property to
|
|
19552
|
+
* true.
|
|
19553
|
+
*
|
|
19554
|
+
* This property can be read in early-execution mode.
|
|
19555
|
+
*
|
|
19556
|
+
*/
|
|
19557
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
16756
19558
|
}
|
|
16757
19559
|
|
|
16758
19560
|
/**
|
|
@@ -16943,30 +19745,89 @@ export class TripWireTripAfterEvent extends BlockEvent {
|
|
|
16943
19745
|
* }
|
|
16944
19746
|
* ```
|
|
16945
19747
|
*/
|
|
16946
|
-
export class TripWireTripAfterEventSignal {
|
|
19748
|
+
export class TripWireTripAfterEventSignal {
|
|
19749
|
+
private constructor();
|
|
19750
|
+
/**
|
|
19751
|
+
* @remarks
|
|
19752
|
+
* Adds a callback that will be called when a trip wire is
|
|
19753
|
+
* tripped.
|
|
19754
|
+
*
|
|
19755
|
+
* This function can't be called in read-only mode.
|
|
19756
|
+
*
|
|
19757
|
+
* This function can be called in early-execution mode.
|
|
19758
|
+
*
|
|
19759
|
+
*/
|
|
19760
|
+
subscribe(callback: (arg0: TripWireTripAfterEvent) => void): (arg0: TripWireTripAfterEvent) => void;
|
|
19761
|
+
/**
|
|
19762
|
+
* @remarks
|
|
19763
|
+
* Removes a callback from being called when a trip wire is
|
|
19764
|
+
* tripped.
|
|
19765
|
+
*
|
|
19766
|
+
* This function can't be called in read-only mode.
|
|
19767
|
+
*
|
|
19768
|
+
* This function can be called in early-execution mode.
|
|
19769
|
+
*
|
|
19770
|
+
*/
|
|
19771
|
+
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
19772
|
+
}
|
|
19773
|
+
|
|
19774
|
+
/**
|
|
19775
|
+
* @beta
|
|
19776
|
+
* Contains information related to a script watchdog
|
|
19777
|
+
* termination.
|
|
19778
|
+
*/
|
|
19779
|
+
export class WatchdogTerminateBeforeEvent {
|
|
16947
19780
|
private constructor();
|
|
16948
19781
|
/**
|
|
16949
19782
|
* @remarks
|
|
16950
|
-
*
|
|
16951
|
-
*
|
|
19783
|
+
* If set to true, cancels the termination of the script
|
|
19784
|
+
* runtime. Note that depending on server configuration
|
|
19785
|
+
* settings, cancellation of the termination may not be
|
|
19786
|
+
* allowed.
|
|
19787
|
+
*
|
|
19788
|
+
*/
|
|
19789
|
+
cancel: boolean;
|
|
19790
|
+
/**
|
|
19791
|
+
* @remarks
|
|
19792
|
+
* Contains the reason why a script runtime is to be
|
|
19793
|
+
* terminated.
|
|
19794
|
+
*
|
|
19795
|
+
*/
|
|
19796
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
19797
|
+
}
|
|
19798
|
+
|
|
19799
|
+
/**
|
|
19800
|
+
* @beta
|
|
19801
|
+
* Manages callbacks that are connected to a callback that will
|
|
19802
|
+
* be called when a script runtime is being terminated due to a
|
|
19803
|
+
* violation of the performance watchdog system.
|
|
19804
|
+
*/
|
|
19805
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
19806
|
+
private constructor();
|
|
19807
|
+
/**
|
|
19808
|
+
* @remarks
|
|
19809
|
+
* Adds a callback that will be called when a script runtime is
|
|
19810
|
+
* being terminated due to a violation of the performance
|
|
19811
|
+
* watchdog system.
|
|
16952
19812
|
*
|
|
16953
19813
|
* This function can't be called in read-only mode.
|
|
16954
19814
|
*
|
|
16955
19815
|
* This function can be called in early-execution mode.
|
|
16956
19816
|
*
|
|
16957
19817
|
*/
|
|
16958
|
-
subscribe(callback: (arg0:
|
|
19818
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
16959
19819
|
/**
|
|
16960
19820
|
* @remarks
|
|
16961
|
-
* Removes a callback from being called when a
|
|
16962
|
-
*
|
|
19821
|
+
* Removes a callback from being called when a script runtime
|
|
19822
|
+
* is being terminated due to a violation of the performance
|
|
19823
|
+
* watchdog system.
|
|
16963
19824
|
*
|
|
16964
19825
|
* This function can't be called in read-only mode.
|
|
16965
19826
|
*
|
|
16966
19827
|
* This function can be called in early-execution mode.
|
|
16967
19828
|
*
|
|
16968
19829
|
*/
|
|
16969
|
-
unsubscribe(callback: (arg0:
|
|
19830
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
16970
19831
|
}
|
|
16971
19832
|
|
|
16972
19833
|
/**
|
|
@@ -17156,6 +20017,20 @@ export class World {
|
|
|
17156
20017
|
*
|
|
17157
20018
|
*/
|
|
17158
20019
|
readonly structureManager: StructureManager;
|
|
20020
|
+
/**
|
|
20021
|
+
* @beta
|
|
20022
|
+
* @remarks
|
|
20023
|
+
* A method that is internal-only, used for broadcasting
|
|
20024
|
+
* specific messages between client and server.
|
|
20025
|
+
*
|
|
20026
|
+
* This function can't be called in read-only mode.
|
|
20027
|
+
*
|
|
20028
|
+
* @param id
|
|
20029
|
+
* The message identifier.
|
|
20030
|
+
* @param value
|
|
20031
|
+
* The message.
|
|
20032
|
+
*/
|
|
20033
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
17159
20034
|
/**
|
|
17160
20035
|
* @remarks
|
|
17161
20036
|
* Clears the set of dynamic properties declared for this
|
|
@@ -17169,6 +20044,14 @@ export class World {
|
|
|
17169
20044
|
*
|
|
17170
20045
|
*/
|
|
17171
20046
|
getAbsoluteTime(): number;
|
|
20047
|
+
/**
|
|
20048
|
+
* @beta
|
|
20049
|
+
* @remarks
|
|
20050
|
+
* The aim-assist presets and categories that can be used in
|
|
20051
|
+
* the world.
|
|
20052
|
+
*
|
|
20053
|
+
*/
|
|
20054
|
+
getAimAssist(): AimAssistRegistry;
|
|
17172
20055
|
/**
|
|
17173
20056
|
* @remarks
|
|
17174
20057
|
* Returns an array of all active players within the world.
|
|
@@ -17346,6 +20229,15 @@ export class World {
|
|
|
17346
20229
|
*
|
|
17347
20230
|
*/
|
|
17348
20231
|
getMoonPhase(): MoonPhase;
|
|
20232
|
+
/**
|
|
20233
|
+
* @beta
|
|
20234
|
+
* @remarks
|
|
20235
|
+
* Returns a map of pack setting name and value pairs.
|
|
20236
|
+
*
|
|
20237
|
+
* This function can be called in early-execution mode.
|
|
20238
|
+
*
|
|
20239
|
+
*/
|
|
20240
|
+
getPackSettings(): Record<string, boolean | number | string>;
|
|
17349
20241
|
/**
|
|
17350
20242
|
* @remarks
|
|
17351
20243
|
* Returns a set of players based on a set of conditions
|
|
@@ -17479,6 +20371,19 @@ export class World {
|
|
|
17479
20371
|
* The difficulty we want to set the world to.
|
|
17480
20372
|
*/
|
|
17481
20373
|
setDifficulty(difficulty: Difficulty): void;
|
|
20374
|
+
/**
|
|
20375
|
+
* @beta
|
|
20376
|
+
* @remarks
|
|
20377
|
+
* Sets multiple dynamic properties with specific values.
|
|
20378
|
+
*
|
|
20379
|
+
* @param values
|
|
20380
|
+
* A Record of key value pairs of the dynamic properties to
|
|
20381
|
+
* set.
|
|
20382
|
+
* @throws This function can throw errors.
|
|
20383
|
+
*
|
|
20384
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
20385
|
+
*/
|
|
20386
|
+
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
17482
20387
|
/**
|
|
17483
20388
|
* @remarks
|
|
17484
20389
|
* Sets a specified property to a value.
|
|
@@ -17607,6 +20512,16 @@ export class WorldAfterEvents {
|
|
|
17607
20512
|
*
|
|
17608
20513
|
*/
|
|
17609
20514
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
20515
|
+
/**
|
|
20516
|
+
* @beta
|
|
20517
|
+
* @remarks
|
|
20518
|
+
* This event is triggered after a chat message has been
|
|
20519
|
+
* broadcast or sent to players.
|
|
20520
|
+
*
|
|
20521
|
+
* This property can be read in early-execution mode.
|
|
20522
|
+
*
|
|
20523
|
+
*/
|
|
20524
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
17610
20525
|
/**
|
|
17611
20526
|
* @remarks
|
|
17612
20527
|
* This event is fired when an entity event has been triggered
|
|
@@ -17782,6 +20697,25 @@ export class WorldAfterEvents {
|
|
|
17782
20697
|
*
|
|
17783
20698
|
*/
|
|
17784
20699
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
20700
|
+
/**
|
|
20701
|
+
* @beta
|
|
20702
|
+
* @remarks
|
|
20703
|
+
* This event is an internal implementation detail, and is
|
|
20704
|
+
* otherwise not currently functional.
|
|
20705
|
+
*
|
|
20706
|
+
* This property can be read in early-execution mode.
|
|
20707
|
+
*
|
|
20708
|
+
*/
|
|
20709
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
20710
|
+
/**
|
|
20711
|
+
* @beta
|
|
20712
|
+
* @remarks
|
|
20713
|
+
* This event is triggered when a pack setting is changed.
|
|
20714
|
+
*
|
|
20715
|
+
* This property can be read in early-execution mode.
|
|
20716
|
+
*
|
|
20717
|
+
*/
|
|
20718
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
17785
20719
|
/**
|
|
17786
20720
|
* @remarks
|
|
17787
20721
|
* This event fires when a piston expands or retracts.
|
|
@@ -17912,6 +20846,23 @@ export class WorldAfterEvents {
|
|
|
17912
20846
|
*
|
|
17913
20847
|
*/
|
|
17914
20848
|
readonly playerSpawn: PlayerSpawnAfterEventSignal;
|
|
20849
|
+
/**
|
|
20850
|
+
* @beta
|
|
20851
|
+
* @remarks
|
|
20852
|
+
* This property can be read in early-execution mode.
|
|
20853
|
+
*
|
|
20854
|
+
*/
|
|
20855
|
+
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
20856
|
+
/**
|
|
20857
|
+
* @beta
|
|
20858
|
+
* @remarks
|
|
20859
|
+
* An event for when a player uses a named name tag on an
|
|
20860
|
+
* entity.
|
|
20861
|
+
*
|
|
20862
|
+
* This property can be read in early-execution mode.
|
|
20863
|
+
*
|
|
20864
|
+
*/
|
|
20865
|
+
readonly playerUseNameTag: PlayerUseNameTagAfterEventSignal;
|
|
17915
20866
|
/**
|
|
17916
20867
|
* @remarks
|
|
17917
20868
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -17988,6 +20939,43 @@ export class WorldAfterEvents {
|
|
|
17988
20939
|
*/
|
|
17989
20940
|
export class WorldBeforeEvents {
|
|
17990
20941
|
private constructor();
|
|
20942
|
+
/**
|
|
20943
|
+
* @beta
|
|
20944
|
+
* @remarks
|
|
20945
|
+
* This event is triggered after a chat message has been
|
|
20946
|
+
* broadcast or sent to players.
|
|
20947
|
+
*
|
|
20948
|
+
* This property can be read in early-execution mode.
|
|
20949
|
+
*
|
|
20950
|
+
* @example customCommand.ts
|
|
20951
|
+
* ```typescript
|
|
20952
|
+
* import { world, DimensionLocation } from "@minecraft/server";
|
|
20953
|
+
*
|
|
20954
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
20955
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
|
|
20956
|
+
* if (eventData.message.includes("cancel")) {
|
|
20957
|
+
* // Cancel event if the message contains "cancel"
|
|
20958
|
+
* eventData.cancel = true;
|
|
20959
|
+
* } else {
|
|
20960
|
+
* const args = eventData.message.split(" ");
|
|
20961
|
+
*
|
|
20962
|
+
* if (args.length > 0) {
|
|
20963
|
+
* switch (args[0].toLowerCase()) {
|
|
20964
|
+
* case "echo":
|
|
20965
|
+
* // Send a modified version of chat message
|
|
20966
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
20967
|
+
* break;
|
|
20968
|
+
* case "help":
|
|
20969
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
20970
|
+
* break;
|
|
20971
|
+
* }
|
|
20972
|
+
* }
|
|
20973
|
+
* }
|
|
20974
|
+
* });
|
|
20975
|
+
* }
|
|
20976
|
+
* ```
|
|
20977
|
+
*/
|
|
20978
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
17991
20979
|
/**
|
|
17992
20980
|
* @remarks
|
|
17993
20981
|
* This event is triggered after an event has been added to an
|
|
@@ -18061,6 +21049,15 @@ export class WorldBeforeEvents {
|
|
|
18061
21049
|
*
|
|
18062
21050
|
*/
|
|
18063
21051
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
21052
|
+
/**
|
|
21053
|
+
* @beta
|
|
21054
|
+
* @remarks
|
|
21055
|
+
* This event fires before a block is placed by a player.
|
|
21056
|
+
*
|
|
21057
|
+
* This property can be read in early-execution mode.
|
|
21058
|
+
*
|
|
21059
|
+
*/
|
|
21060
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
18064
21061
|
/**
|
|
18065
21062
|
* @remarks
|
|
18066
21063
|
* This property can be read in early-execution mode.
|
|
@@ -18093,13 +21090,27 @@ export class WorldLoadAfterEventSignal {
|
|
|
18093
21090
|
unsubscribe(callback: (arg0: WorldLoadAfterEvent) => void): void;
|
|
18094
21091
|
}
|
|
18095
21092
|
|
|
21093
|
+
/**
|
|
21094
|
+
* @beta
|
|
21095
|
+
* Contains additional options for searches for the
|
|
21096
|
+
* dimension.findNearestBiome API.
|
|
21097
|
+
*/
|
|
21098
|
+
export interface BiomeSearchOptions {
|
|
21099
|
+
/**
|
|
21100
|
+
* @remarks
|
|
21101
|
+
* Bounding volume size to look within.
|
|
21102
|
+
*
|
|
21103
|
+
*/
|
|
21104
|
+
boundingSize?: Vector3;
|
|
21105
|
+
}
|
|
21106
|
+
|
|
18096
21107
|
/**
|
|
18097
21108
|
* A BlockBoundingBox is an interface to an object which
|
|
18098
21109
|
* represents an AABB aligned rectangle.
|
|
18099
21110
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
18100
21111
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
18101
|
-
* created using the associated {@link
|
|
18102
|
-
*
|
|
21112
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
21113
|
+
* utility functions.
|
|
18103
21114
|
* The min/max coordinates represent the diametrically opposite
|
|
18104
21115
|
* corners of the rectangle.
|
|
18105
21116
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -18478,6 +21489,76 @@ export interface CameraTargetOptions {
|
|
|
18478
21489
|
targetEntity: Entity;
|
|
18479
21490
|
}
|
|
18480
21491
|
|
|
21492
|
+
/**
|
|
21493
|
+
* @beta
|
|
21494
|
+
* This interface defines an entry into the {@link
|
|
21495
|
+
* CompoundBlockVolume} which represents a volume of positive
|
|
21496
|
+
* or negative space.
|
|
21497
|
+
*
|
|
21498
|
+
*/
|
|
21499
|
+
export interface CompoundBlockVolumeItem {
|
|
21500
|
+
/**
|
|
21501
|
+
* @remarks
|
|
21502
|
+
* The 'action' defines how the block volume is represented in
|
|
21503
|
+
* the compound block volume stack.
|
|
21504
|
+
* 'Add' creates a block volume which is positively selected
|
|
21505
|
+
* 'Subtract' creates a block volume which represents a hole or
|
|
21506
|
+
* negative space in the overall compound block volume.
|
|
21507
|
+
*
|
|
21508
|
+
*/
|
|
21509
|
+
action?: CompoundBlockVolumeAction;
|
|
21510
|
+
/**
|
|
21511
|
+
* @remarks
|
|
21512
|
+
* The relativity enumeration determines whether the
|
|
21513
|
+
* BlockVolume specified is positioned relative to the parent
|
|
21514
|
+
* compound block volume origin, or in absolute world space.
|
|
21515
|
+
*
|
|
21516
|
+
*/
|
|
21517
|
+
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
21518
|
+
/**
|
|
21519
|
+
* @remarks
|
|
21520
|
+
* The volume of space
|
|
21521
|
+
*
|
|
21522
|
+
*/
|
|
21523
|
+
volume: BlockVolume;
|
|
21524
|
+
}
|
|
21525
|
+
|
|
21526
|
+
/**
|
|
21527
|
+
* @beta
|
|
21528
|
+
* Rules that if broken on container operations will throw an
|
|
21529
|
+
* error.
|
|
21530
|
+
*/
|
|
21531
|
+
export interface ContainerRules {
|
|
21532
|
+
/**
|
|
21533
|
+
* @remarks
|
|
21534
|
+
* Defines the items that are exclusively allowed in the
|
|
21535
|
+
* container. If empty all items are allowed in the container.
|
|
21536
|
+
*
|
|
21537
|
+
*/
|
|
21538
|
+
allowedItems: string[];
|
|
21539
|
+
/**
|
|
21540
|
+
* @remarks
|
|
21541
|
+
* Determines whether other storage items can be placed into
|
|
21542
|
+
* the container.
|
|
21543
|
+
*
|
|
21544
|
+
*/
|
|
21545
|
+
allowNestedStorageItems: boolean;
|
|
21546
|
+
/**
|
|
21547
|
+
* @remarks
|
|
21548
|
+
* Defines the items that are not allowed in the container.
|
|
21549
|
+
*
|
|
21550
|
+
*/
|
|
21551
|
+
bannedItems: string[];
|
|
21552
|
+
/**
|
|
21553
|
+
* @remarks
|
|
21554
|
+
* Defines the maximum allowed total weight of all items in the
|
|
21555
|
+
* storage item container. If undefined container has no weight
|
|
21556
|
+
* limit.
|
|
21557
|
+
*
|
|
21558
|
+
*/
|
|
21559
|
+
weightLimit?: number;
|
|
21560
|
+
}
|
|
21561
|
+
|
|
18481
21562
|
/**
|
|
18482
21563
|
* Define the custom command, including name, permissions, and
|
|
18483
21564
|
* parameters.
|
|
@@ -18527,6 +21608,15 @@ export interface CustomCommand {
|
|
|
18527
21608
|
* command.
|
|
18528
21609
|
*/
|
|
18529
21610
|
export interface CustomCommandParameter {
|
|
21611
|
+
/**
|
|
21612
|
+
* @beta
|
|
21613
|
+
* @remarks
|
|
21614
|
+
* Can be used to reference the enum name when {@link
|
|
21615
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
21616
|
+
* to be different from the enum name.
|
|
21617
|
+
*
|
|
21618
|
+
*/
|
|
21619
|
+
enumName?: string;
|
|
18530
21620
|
/**
|
|
18531
21621
|
* @remarks
|
|
18532
21622
|
* The name of parameter as it appears on the command line.
|
|
@@ -18579,6 +21669,14 @@ export interface DefinitionModifier {
|
|
|
18579
21669
|
*
|
|
18580
21670
|
*/
|
|
18581
21671
|
removedComponentGroups: string[];
|
|
21672
|
+
/**
|
|
21673
|
+
* @beta
|
|
21674
|
+
* @remarks
|
|
21675
|
+
* The list of entity definition events that will be fired via
|
|
21676
|
+
* this update.
|
|
21677
|
+
*
|
|
21678
|
+
*/
|
|
21679
|
+
triggers: Trigger[];
|
|
18582
21680
|
}
|
|
18583
21681
|
|
|
18584
21682
|
/**
|
|
@@ -19318,6 +22416,29 @@ export interface ExplosionOptions {
|
|
|
19318
22416
|
source?: Entity;
|
|
19319
22417
|
}
|
|
19320
22418
|
|
|
22419
|
+
/**
|
|
22420
|
+
* @beta
|
|
22421
|
+
* Contains additional options for getBlockStandingOn and
|
|
22422
|
+
* getAllBlocksStandingOn.
|
|
22423
|
+
*/
|
|
22424
|
+
export interface GetBlocksStandingOnOptions {
|
|
22425
|
+
/**
|
|
22426
|
+
* @remarks
|
|
22427
|
+
* When specified, the function will include / exclude what
|
|
22428
|
+
* block(s) are returned based on the block filter.
|
|
22429
|
+
*
|
|
22430
|
+
*/
|
|
22431
|
+
blockFilter?: BlockFilter;
|
|
22432
|
+
/**
|
|
22433
|
+
* @remarks
|
|
22434
|
+
* If true, all blocks of height 0.2 or lower like trapdoors
|
|
22435
|
+
* and carpets will be ignored, and the block underneath will
|
|
22436
|
+
* be returned.
|
|
22437
|
+
*
|
|
22438
|
+
*/
|
|
22439
|
+
ignoreThinBlocks?: boolean;
|
|
22440
|
+
}
|
|
22441
|
+
|
|
19321
22442
|
/**
|
|
19322
22443
|
* Greater than operator.
|
|
19323
22444
|
*/
|
|
@@ -19509,6 +22630,14 @@ export interface JigsawPlaceOptions {
|
|
|
19509
22630
|
*
|
|
19510
22631
|
*/
|
|
19511
22632
|
keepJigsaws?: boolean;
|
|
22633
|
+
/**
|
|
22634
|
+
* @beta
|
|
22635
|
+
* @remarks
|
|
22636
|
+
* Specifies how to handle waterloggable blocks overlapping
|
|
22637
|
+
* with existing liquid. Defaults to `ApplyWaterlogging`.
|
|
22638
|
+
*
|
|
22639
|
+
*/
|
|
22640
|
+
liquidSettings?: LiquidSettings;
|
|
19512
22641
|
}
|
|
19513
22642
|
|
|
19514
22643
|
/**
|
|
@@ -19538,6 +22667,14 @@ export interface JigsawStructurePlaceOptions {
|
|
|
19538
22667
|
*
|
|
19539
22668
|
*/
|
|
19540
22669
|
keepJigsaws?: boolean;
|
|
22670
|
+
/**
|
|
22671
|
+
* @beta
|
|
22672
|
+
* @remarks
|
|
22673
|
+
* Specifies how to handle waterloggable blocks overlapping
|
|
22674
|
+
* with existing liquid. Defaults to `ApplyWaterlogging`.
|
|
22675
|
+
*
|
|
22676
|
+
*/
|
|
22677
|
+
liquidSettings?: LiquidSettings;
|
|
19541
22678
|
}
|
|
19542
22679
|
|
|
19543
22680
|
/**
|
|
@@ -19639,6 +22776,38 @@ export interface PlayAnimationOptions {
|
|
|
19639
22776
|
stopExpression?: string;
|
|
19640
22777
|
}
|
|
19641
22778
|
|
|
22779
|
+
/**
|
|
22780
|
+
* @beta
|
|
22781
|
+
* Settings relating to a player's aim-assist targeting.
|
|
22782
|
+
*/
|
|
22783
|
+
export interface PlayerAimAssistSettings {
|
|
22784
|
+
/**
|
|
22785
|
+
* @remarks
|
|
22786
|
+
* The view distance limit to use for aim-assist targeting.
|
|
22787
|
+
*
|
|
22788
|
+
*/
|
|
22789
|
+
distance?: number;
|
|
22790
|
+
/**
|
|
22791
|
+
* @remarks
|
|
22792
|
+
* The Id of the aim-assist preset to activate. Must have a
|
|
22793
|
+
* namespace.
|
|
22794
|
+
*
|
|
22795
|
+
*/
|
|
22796
|
+
presetId: string;
|
|
22797
|
+
/**
|
|
22798
|
+
* @remarks
|
|
22799
|
+
* The mode to use for aim-assist targeting.
|
|
22800
|
+
*
|
|
22801
|
+
*/
|
|
22802
|
+
targetMode?: AimAssistTargetMode;
|
|
22803
|
+
/**
|
|
22804
|
+
* @remarks
|
|
22805
|
+
* The view angle limit to use for aim-assist targeting.
|
|
22806
|
+
*
|
|
22807
|
+
*/
|
|
22808
|
+
viewAngle?: Vector2;
|
|
22809
|
+
}
|
|
22810
|
+
|
|
19642
22811
|
/**
|
|
19643
22812
|
* Additional options for how a sound plays for a player.
|
|
19644
22813
|
*/
|
|
@@ -19664,6 +22833,24 @@ export interface PlayerSoundOptions {
|
|
|
19664
22833
|
volume?: number;
|
|
19665
22834
|
}
|
|
19666
22835
|
|
|
22836
|
+
/**
|
|
22837
|
+
* @beta
|
|
22838
|
+
* An interface that is passed into {@link
|
|
22839
|
+
* @minecraft/Server.PlayerSwingStartAfterEvent.subscribe} that
|
|
22840
|
+
* filters out which events are passed to the provided
|
|
22841
|
+
* callback.
|
|
22842
|
+
*/
|
|
22843
|
+
export interface PlayerSwingEventOptions {
|
|
22844
|
+
/**
|
|
22845
|
+
* @remarks
|
|
22846
|
+
* The held item option that the callback should be called for.
|
|
22847
|
+
* If undefined, the callback will be called whether or not the
|
|
22848
|
+
* player is holding an item in their hand.
|
|
22849
|
+
*
|
|
22850
|
+
*/
|
|
22851
|
+
heldItemOption?: HeldItemOption;
|
|
22852
|
+
}
|
|
22853
|
+
|
|
19667
22854
|
/**
|
|
19668
22855
|
* Optional arguments for
|
|
19669
22856
|
* @minecraft/server.EntityProjectileComponent.shoot.
|
|
@@ -19941,6 +23128,23 @@ export interface ScriptEventMessageFilterOptions {
|
|
|
19941
23128
|
* Contains additional options for spawning an Entity.
|
|
19942
23129
|
*/
|
|
19943
23130
|
export interface SpawnEntityOptions {
|
|
23131
|
+
/**
|
|
23132
|
+
* @beta
|
|
23133
|
+
* @remarks
|
|
23134
|
+
* Optional boolean which determines if this entity should
|
|
23135
|
+
* persist in the game world. Persistence prevents the entity
|
|
23136
|
+
* from automatically despawning.
|
|
23137
|
+
*
|
|
23138
|
+
*/
|
|
23139
|
+
initialPersistence?: boolean;
|
|
23140
|
+
/**
|
|
23141
|
+
* @beta
|
|
23142
|
+
* @remarks
|
|
23143
|
+
* Optional initial rotation, in degrees, to set on the entity
|
|
23144
|
+
* when it spawns.
|
|
23145
|
+
*
|
|
23146
|
+
*/
|
|
23147
|
+
initialRotation?: number;
|
|
19944
23148
|
/**
|
|
19945
23149
|
* @remarks
|
|
19946
23150
|
* Optional spawn event to send to the entity after it is
|
|
@@ -20304,12 +23508,21 @@ export class CommandError extends Error {
|
|
|
20304
23508
|
}
|
|
20305
23509
|
|
|
20306
23510
|
/**
|
|
20307
|
-
* Error thrown if {@link
|
|
20308
|
-
*
|
|
23511
|
+
* Error thrown if {@link ContainerRules} are broken on
|
|
23512
|
+
* container operations.
|
|
20309
23513
|
*/
|
|
20310
23514
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20311
23515
|
export class ContainerRulesError extends Error {
|
|
20312
23516
|
private constructor();
|
|
23517
|
+
/**
|
|
23518
|
+
* @beta
|
|
23519
|
+
* @remarks
|
|
23520
|
+
* The specific reason the error was thrown.
|
|
23521
|
+
*
|
|
23522
|
+
* This property can be read in early-execution mode.
|
|
23523
|
+
*
|
|
23524
|
+
*/
|
|
23525
|
+
reason: ContainerRulesErrorReason;
|
|
20313
23526
|
}
|
|
20314
23527
|
|
|
20315
23528
|
/**
|
|
@@ -20364,6 +23577,14 @@ export class EntitySpawnError extends Error {
|
|
|
20364
23577
|
private constructor();
|
|
20365
23578
|
}
|
|
20366
23579
|
|
|
23580
|
+
/**
|
|
23581
|
+
* @beta
|
|
23582
|
+
*/
|
|
23583
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
23584
|
+
export class InvalidBlockComponentError extends Error {
|
|
23585
|
+
private constructor();
|
|
23586
|
+
}
|
|
23587
|
+
|
|
20367
23588
|
/**
|
|
20368
23589
|
* The container is invalid. This can occur if the container is
|
|
20369
23590
|
* missing or deleted.
|
|
@@ -20430,6 +23651,22 @@ export class InvalidIteratorError extends Error {
|
|
|
20430
23651
|
private constructor();
|
|
20431
23652
|
}
|
|
20432
23653
|
|
|
23654
|
+
/**
|
|
23655
|
+
* @beta
|
|
23656
|
+
*/
|
|
23657
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
23658
|
+
export class InvalidPotionDeliveryTypeError extends Error {
|
|
23659
|
+
private constructor();
|
|
23660
|
+
}
|
|
23661
|
+
|
|
23662
|
+
/**
|
|
23663
|
+
* @beta
|
|
23664
|
+
*/
|
|
23665
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
23666
|
+
export class InvalidPotionEffectTypeError extends Error {
|
|
23667
|
+
private constructor();
|
|
23668
|
+
}
|
|
23669
|
+
|
|
20433
23670
|
/**
|
|
20434
23671
|
* Thrown when a Structure is invalid. A structure becomes
|
|
20435
23672
|
* invalid when it is deleted.
|