@minecraft/server 2.2.0 → 2.3.0-beta.1.12.111-stable
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/README.md +2 -0
- package/index.d.ts +2898 -117
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Copyright (c) Microsoft Corporation.
|
|
8
8
|
***************************************************************************** */
|
|
9
9
|
/**
|
|
10
|
+
* @beta
|
|
10
11
|
* @packageDocumentation
|
|
11
12
|
* Contains many types related to manipulating a Minecraft
|
|
12
13
|
* world, including entities, blocks, dimensions, and more.
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
* ```json
|
|
16
17
|
* {
|
|
17
18
|
* "module_name": "@minecraft/server",
|
|
18
|
-
* "version": "2.
|
|
19
|
+
* "version": "2.3.0-beta"
|
|
19
20
|
* }
|
|
20
21
|
* ```
|
|
21
22
|
*
|
|
@@ -23,6 +24,25 @@
|
|
|
23
24
|
import * as minecraftcommon from '@minecraft/common';
|
|
24
25
|
// @ts-ignore Optional types-only package, will decay to any if @minecraft/vanilla-data isn't installed
|
|
25
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
|
+
|
|
26
46
|
/**
|
|
27
47
|
* The types of block components that are accessible via
|
|
28
48
|
* function Block.getComponent.
|
|
@@ -185,6 +205,100 @@ export enum CommandPermissionLevel {
|
|
|
185
205
|
Owner = 4,
|
|
186
206
|
}
|
|
187
207
|
|
|
208
|
+
/**
|
|
209
|
+
* @beta
|
|
210
|
+
* The Action enum determines how the CompoundBlockVolume
|
|
211
|
+
* considers the associated CompoundBlockVolumeItem when
|
|
212
|
+
* performing inside/outside calculations.
|
|
213
|
+
*/
|
|
214
|
+
export enum CompoundBlockVolumeAction {
|
|
215
|
+
/**
|
|
216
|
+
* @remarks
|
|
217
|
+
* The associated BlockVolume is considered a positive space,
|
|
218
|
+
* and any intersection tests are considered hits
|
|
219
|
+
*
|
|
220
|
+
*/
|
|
221
|
+
Add = 0,
|
|
222
|
+
/**
|
|
223
|
+
* @remarks
|
|
224
|
+
* The associated BlockVolume is considered a negative or void
|
|
225
|
+
* space, and any intersection tests are considered misses.
|
|
226
|
+
* Using the Subtract action, it is possible to `punch holes`
|
|
227
|
+
* in block volumes so that any intersection tests may pass
|
|
228
|
+
* through such spaces
|
|
229
|
+
*
|
|
230
|
+
*/
|
|
231
|
+
Subtract = 1,
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @beta
|
|
236
|
+
* An enum describing the relativity of the
|
|
237
|
+
* CompoundBlockVolumeItem, relative to the parent
|
|
238
|
+
* CompoundVolume.
|
|
239
|
+
*/
|
|
240
|
+
export enum CompoundBlockVolumePositionRelativity {
|
|
241
|
+
/**
|
|
242
|
+
* @remarks
|
|
243
|
+
* The locations within the associated BlockVolume are relative
|
|
244
|
+
* to the CompoundBlockVolume to which they were added
|
|
245
|
+
*
|
|
246
|
+
*/
|
|
247
|
+
Relative = 0,
|
|
248
|
+
/**
|
|
249
|
+
* @remarks
|
|
250
|
+
* The locations within the associated BlockVolume are in
|
|
251
|
+
* absolute world space
|
|
252
|
+
*
|
|
253
|
+
*/
|
|
254
|
+
Absolute = 1,
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* @beta
|
|
259
|
+
* Reasons that the {@link
|
|
260
|
+
* @minecraft/server.ContainerRulesError} was thrown.
|
|
261
|
+
*/
|
|
262
|
+
export enum ContainerRulesErrorReason {
|
|
263
|
+
/**
|
|
264
|
+
* @remarks
|
|
265
|
+
* Thrown when trying to add item that was defined in {@link
|
|
266
|
+
* ContainerRules.bannedItems}.
|
|
267
|
+
*
|
|
268
|
+
*/
|
|
269
|
+
BannedItem = 'BannedItem',
|
|
270
|
+
/**
|
|
271
|
+
* @remarks
|
|
272
|
+
* Thrown when trying to add item with `Storage Item` component
|
|
273
|
+
* to container with {@link
|
|
274
|
+
* ContainerRules.allowNestedStorageItems} set to false.
|
|
275
|
+
*
|
|
276
|
+
*/
|
|
277
|
+
NestedStorageItem = 'NestedStorageItem',
|
|
278
|
+
/**
|
|
279
|
+
* @remarks
|
|
280
|
+
* Thrown when trying to add item not defined in non-empty
|
|
281
|
+
* {@link ContainerRules.allowedItems}.
|
|
282
|
+
*
|
|
283
|
+
*/
|
|
284
|
+
NotAllowedItem = 'NotAllowedItem',
|
|
285
|
+
/**
|
|
286
|
+
* @remarks
|
|
287
|
+
* Thrown when trying to add item that pushed the containers
|
|
288
|
+
* weight over the {@link ContainerRules.weightLimit}.
|
|
289
|
+
*
|
|
290
|
+
*/
|
|
291
|
+
OverWeightLimit = 'OverWeightLimit',
|
|
292
|
+
/**
|
|
293
|
+
* @remarks
|
|
294
|
+
* Thrown when trying to add item with zero weight defined by
|
|
295
|
+
* the `Storage Weight Modifier` component to container with a
|
|
296
|
+
* defined {@link ContainerRules.weightLimit}
|
|
297
|
+
*
|
|
298
|
+
*/
|
|
299
|
+
ZeroWeightItem = 'ZeroWeightItem',
|
|
300
|
+
}
|
|
301
|
+
|
|
188
302
|
/**
|
|
189
303
|
* Reason why custom command registration failed.
|
|
190
304
|
*/
|
|
@@ -229,6 +343,13 @@ export enum CustomCommandErrorReason {
|
|
|
229
343
|
*
|
|
230
344
|
*/
|
|
231
345
|
RegistryReadOnly = 'RegistryReadOnly',
|
|
346
|
+
/**
|
|
347
|
+
* @beta
|
|
348
|
+
* @remarks
|
|
349
|
+
* Non enum type command parameters cannot use enumName.
|
|
350
|
+
*
|
|
351
|
+
*/
|
|
352
|
+
UnexpectedEnumName = 'UnexpectedEnumName',
|
|
232
353
|
}
|
|
233
354
|
|
|
234
355
|
/**
|
|
@@ -942,6 +1063,14 @@ export enum EntityComponentTypes {
|
|
|
942
1063
|
*
|
|
943
1064
|
*/
|
|
944
1065
|
NavigationWalk = 'minecraft:navigation.walk',
|
|
1066
|
+
/**
|
|
1067
|
+
* @beta
|
|
1068
|
+
* @remarks
|
|
1069
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
1070
|
+
* name, and dialogue interactions.
|
|
1071
|
+
*
|
|
1072
|
+
*/
|
|
1073
|
+
Npc = 'minecraft:npc',
|
|
945
1074
|
/**
|
|
946
1075
|
* @remarks
|
|
947
1076
|
* When present on an entity, this entity is on fire.
|
|
@@ -1334,6 +1463,14 @@ export enum EntityInitializationCause {
|
|
|
1334
1463
|
* and mainhand slots.
|
|
1335
1464
|
*/
|
|
1336
1465
|
export enum EquipmentSlot {
|
|
1466
|
+
/**
|
|
1467
|
+
* @beta
|
|
1468
|
+
* @remarks
|
|
1469
|
+
* The body slot. This slot is used to hold armor for
|
|
1470
|
+
* non-humanoid mobs.
|
|
1471
|
+
*
|
|
1472
|
+
*/
|
|
1473
|
+
Body = 'Body',
|
|
1337
1474
|
/**
|
|
1338
1475
|
* @remarks
|
|
1339
1476
|
* The chest slot. This slot is used to hold items such as
|
|
@@ -1576,6 +1713,10 @@ export enum GameRule {
|
|
|
1576
1713
|
*
|
|
1577
1714
|
*/
|
|
1578
1715
|
KeepInventory = 'keepInventory',
|
|
1716
|
+
/**
|
|
1717
|
+
* @beta
|
|
1718
|
+
*/
|
|
1719
|
+
LocatorBar = 'locatorBar',
|
|
1579
1720
|
/**
|
|
1580
1721
|
* @remarks
|
|
1581
1722
|
* The maximum number of chained commands that can execute per
|
|
@@ -1749,6 +1890,26 @@ export enum GraphicsMode {
|
|
|
1749
1890
|
Simple = 'Simple',
|
|
1750
1891
|
}
|
|
1751
1892
|
|
|
1893
|
+
/**
|
|
1894
|
+
* @beta
|
|
1895
|
+
* Specifies options related to the item currently being held
|
|
1896
|
+
* by an entity.
|
|
1897
|
+
*/
|
|
1898
|
+
export enum HeldItemOption {
|
|
1899
|
+
/**
|
|
1900
|
+
* @remarks
|
|
1901
|
+
* Any item is being held.
|
|
1902
|
+
*
|
|
1903
|
+
*/
|
|
1904
|
+
AnyItem = 'AnyItem',
|
|
1905
|
+
/**
|
|
1906
|
+
* @remarks
|
|
1907
|
+
* No item is being held.
|
|
1908
|
+
*
|
|
1909
|
+
*/
|
|
1910
|
+
NoItem = 'NoItem',
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1752
1913
|
export enum HudElement {
|
|
1753
1914
|
PaperDoll = 0,
|
|
1754
1915
|
Armor = 1,
|
|
@@ -1965,6 +2126,14 @@ export enum ItemComponentTypes {
|
|
|
1965
2126
|
*
|
|
1966
2127
|
*/
|
|
1967
2128
|
Food = 'minecraft:food',
|
|
2129
|
+
/**
|
|
2130
|
+
* @beta
|
|
2131
|
+
*/
|
|
2132
|
+
Inventory = 'minecraft:inventory',
|
|
2133
|
+
/**
|
|
2134
|
+
* @beta
|
|
2135
|
+
*/
|
|
2136
|
+
Potion = 'minecraft:potion',
|
|
1968
2137
|
}
|
|
1969
2138
|
|
|
1970
2139
|
/**
|
|
@@ -1992,6 +2161,28 @@ export enum ItemLockMode {
|
|
|
1992
2161
|
slot = 'slot',
|
|
1993
2162
|
}
|
|
1994
2163
|
|
|
2164
|
+
/**
|
|
2165
|
+
* @beta
|
|
2166
|
+
* Specifies how to handle waterloggable blocks overlapping
|
|
2167
|
+
* with existing liquid.
|
|
2168
|
+
*/
|
|
2169
|
+
export enum LiquidSettings {
|
|
2170
|
+
/**
|
|
2171
|
+
* @remarks
|
|
2172
|
+
* Causes a waterloggable block to become waterlogged, if it
|
|
2173
|
+
* overlaps with existing liquid.
|
|
2174
|
+
*
|
|
2175
|
+
*/
|
|
2176
|
+
ApplyWaterlogging = 'ApplyWaterlogging',
|
|
2177
|
+
/**
|
|
2178
|
+
* @remarks
|
|
2179
|
+
* Do not waterlog any waterloggable blocks that overlap
|
|
2180
|
+
* existing liquid.
|
|
2181
|
+
*
|
|
2182
|
+
*/
|
|
2183
|
+
IgnoreWaterlogging = 'IgnoreWaterlogging',
|
|
2184
|
+
}
|
|
2185
|
+
|
|
1995
2186
|
/**
|
|
1996
2187
|
* Represents the type of liquid that can be placed on a block
|
|
1997
2188
|
* or flow dynamically in the world.
|
|
@@ -2615,6 +2806,29 @@ export enum TintMethod {
|
|
|
2615
2806
|
Water = 'Water',
|
|
2616
2807
|
}
|
|
2617
2808
|
|
|
2809
|
+
/**
|
|
2810
|
+
* @beta
|
|
2811
|
+
* An enumeration with the reason that a watchdog is deciding
|
|
2812
|
+
* to terminate execution of a behavior packs' script.
|
|
2813
|
+
*/
|
|
2814
|
+
export enum WatchdogTerminateReason {
|
|
2815
|
+
/**
|
|
2816
|
+
* @remarks
|
|
2817
|
+
* Script runtime for a behavior pack is terminated due to
|
|
2818
|
+
* non-responsiveness from script (a hang or infinite loop).
|
|
2819
|
+
*
|
|
2820
|
+
*/
|
|
2821
|
+
Hang = 'Hang',
|
|
2822
|
+
/**
|
|
2823
|
+
* @remarks
|
|
2824
|
+
* Script runtime for a behavior pack is terminated due to a
|
|
2825
|
+
* stack overflow (a long, and potentially infinite) chain of
|
|
2826
|
+
* function calls.
|
|
2827
|
+
*
|
|
2828
|
+
*/
|
|
2829
|
+
StackOverflow = 'StackOverflow',
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2618
2832
|
/**
|
|
2619
2833
|
* Used to specify the type of weather condition within the
|
|
2620
2834
|
* world.
|
|
@@ -2762,6 +2976,7 @@ export type EntityComponentTypeMap = {
|
|
|
2762
2976
|
'minecraft:navigation.generic': EntityNavigationGenericComponent;
|
|
2763
2977
|
'minecraft:navigation.hover': EntityNavigationHoverComponent;
|
|
2764
2978
|
'minecraft:navigation.walk': EntityNavigationWalkComponent;
|
|
2979
|
+
'minecraft:npc': EntityNpcComponent;
|
|
2765
2980
|
'minecraft:onfire': EntityOnFireComponent;
|
|
2766
2981
|
'minecraft:player.exhaustion': EntityExhaustionComponent;
|
|
2767
2982
|
'minecraft:player.hunger': EntityHungerComponent;
|
|
@@ -2795,6 +3010,7 @@ export type EntityComponentTypeMap = {
|
|
|
2795
3010
|
'navigation.generic': EntityNavigationGenericComponent;
|
|
2796
3011
|
'navigation.hover': EntityNavigationHoverComponent;
|
|
2797
3012
|
'navigation.walk': EntityNavigationWalkComponent;
|
|
3013
|
+
npc: EntityNpcComponent;
|
|
2798
3014
|
onfire: EntityOnFireComponent;
|
|
2799
3015
|
'player.exhaustion': EntityExhaustionComponent;
|
|
2800
3016
|
'player.hunger': EntityHungerComponent;
|
|
@@ -2814,6 +3030,15 @@ export type EntityComponentTypeMap = {
|
|
|
2814
3030
|
wants_jockey: EntityWantsJockeyComponent;
|
|
2815
3031
|
};
|
|
2816
3032
|
|
|
3033
|
+
/**
|
|
3034
|
+
* @beta
|
|
3035
|
+
*/
|
|
3036
|
+
export type EntityIdentifierType<T> = [T] extends [never]
|
|
3037
|
+
? VanillaEntityIdentifier
|
|
3038
|
+
: T extends string
|
|
3039
|
+
? VanillaEntityIdentifier | T
|
|
3040
|
+
: never;
|
|
3041
|
+
|
|
2817
3042
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
2818
3043
|
? ItemComponentTypeMap[T]
|
|
2819
3044
|
: ItemCustomComponentInstance;
|
|
@@ -2826,6 +3051,7 @@ export type ItemComponentTypeMap = {
|
|
|
2826
3051
|
dyeable: ItemDyeableComponent;
|
|
2827
3052
|
enchantable: ItemEnchantableComponent;
|
|
2828
3053
|
food: ItemFoodComponent;
|
|
3054
|
+
inventory: ItemInventoryComponent;
|
|
2829
3055
|
'minecraft:book': ItemBookComponent;
|
|
2830
3056
|
'minecraft:compostable': ItemCompostableComponent;
|
|
2831
3057
|
'minecraft:cooldown': ItemCooldownComponent;
|
|
@@ -2833,181 +3059,650 @@ export type ItemComponentTypeMap = {
|
|
|
2833
3059
|
'minecraft:dyeable': ItemDyeableComponent;
|
|
2834
3060
|
'minecraft:enchantable': ItemEnchantableComponent;
|
|
2835
3061
|
'minecraft:food': ItemFoodComponent;
|
|
3062
|
+
'minecraft:inventory': ItemInventoryComponent;
|
|
3063
|
+
'minecraft:potion': ItemPotionComponent;
|
|
3064
|
+
potion: ItemPotionComponent;
|
|
2836
3065
|
};
|
|
2837
3066
|
|
|
2838
3067
|
/**
|
|
2839
|
-
*
|
|
2840
|
-
* unique X, Y, and Z within a dimension and get/sets the state
|
|
2841
|
-
* of the block at that location. This type was significantly
|
|
2842
|
-
* updated in version 1.17.10.21.
|
|
3068
|
+
* @beta
|
|
2843
3069
|
*/
|
|
2844
|
-
export
|
|
3070
|
+
export type VanillaEntityIdentifier =
|
|
3071
|
+
| EntityType
|
|
3072
|
+
| minecraftvanilladata.MinecraftEntityTypes
|
|
3073
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}`
|
|
3074
|
+
| `${minecraftvanilladata.MinecraftEntityTypes}<${string}>`;
|
|
3075
|
+
|
|
3076
|
+
/**
|
|
3077
|
+
* @beta
|
|
3078
|
+
* Handle to an aim-assist category that exists in the
|
|
3079
|
+
* world.aimAssist registry.
|
|
3080
|
+
*/
|
|
3081
|
+
export class AimAssistCategory {
|
|
2845
3082
|
private constructor();
|
|
2846
3083
|
/**
|
|
2847
3084
|
* @remarks
|
|
2848
|
-
*
|
|
3085
|
+
* Default targeting priority used for block types not found in
|
|
3086
|
+
* getBlockPriorities.
|
|
2849
3087
|
*
|
|
3088
|
+
* @throws This property can throw when used.
|
|
2850
3089
|
*/
|
|
2851
|
-
readonly
|
|
3090
|
+
readonly defaultBlockPriority: number;
|
|
2852
3091
|
/**
|
|
2853
3092
|
* @remarks
|
|
2854
|
-
*
|
|
2855
|
-
*
|
|
3093
|
+
* Default targeting priority used for entity types not found
|
|
3094
|
+
* in getEntityPriorities.
|
|
2856
3095
|
*
|
|
2857
3096
|
* @throws This property can throw when used.
|
|
2858
|
-
*
|
|
2859
|
-
* {@link LocationInUnloadedChunkError}
|
|
2860
|
-
*
|
|
2861
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2862
3097
|
*/
|
|
2863
|
-
readonly
|
|
3098
|
+
readonly defaultEntityPriority: number;
|
|
2864
3099
|
/**
|
|
2865
3100
|
* @remarks
|
|
2866
|
-
*
|
|
2867
|
-
* water block and a lava block are liquid, while an air block
|
|
2868
|
-
* and a stone block are not. Water logged blocks are not
|
|
2869
|
-
* liquid blocks).
|
|
2870
|
-
*
|
|
2871
|
-
* @throws This property can throw when used.
|
|
2872
|
-
*
|
|
2873
|
-
* {@link LocationInUnloadedChunkError}
|
|
3101
|
+
* The unique Id associated with the category.
|
|
2874
3102
|
*
|
|
2875
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2876
3103
|
*/
|
|
2877
|
-
readonly
|
|
3104
|
+
readonly identifier: string;
|
|
2878
3105
|
/**
|
|
2879
3106
|
* @remarks
|
|
2880
|
-
*
|
|
2881
|
-
* (for example, if the block is unloaded, references to that
|
|
2882
|
-
* block will no longer be valid.)
|
|
3107
|
+
* Gets the priority settings used for block targeting.
|
|
2883
3108
|
*
|
|
3109
|
+
* @returns
|
|
3110
|
+
* The record mapping block Ids to their priority settings.
|
|
3111
|
+
* Larger numbers have greater priority.
|
|
3112
|
+
* @throws This function can throw errors.
|
|
2884
3113
|
*/
|
|
2885
|
-
|
|
3114
|
+
getBlockPriorities(): Record<string, number>;
|
|
2886
3115
|
/**
|
|
2887
3116
|
* @remarks
|
|
2888
|
-
*
|
|
3117
|
+
* Gets the priority settings used for entity targeting.
|
|
2889
3118
|
*
|
|
2890
|
-
* @
|
|
3119
|
+
* @returns
|
|
3120
|
+
* The record mapping entity Ids to their priority settings.
|
|
3121
|
+
* Larger numbers have greater priority.
|
|
3122
|
+
* @throws This function can throw errors.
|
|
3123
|
+
*/
|
|
3124
|
+
getEntityPriorities(): Record<string, number>;
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
/**
|
|
3128
|
+
* @beta
|
|
3129
|
+
* Settings used with AimAssistRegistry.addCategory for
|
|
3130
|
+
* creation of the AimAssistCategory.
|
|
3131
|
+
*/
|
|
3132
|
+
export class AimAssistCategorySettings {
|
|
3133
|
+
/**
|
|
3134
|
+
* @remarks
|
|
3135
|
+
* Optional. Default targeting priority used for block types
|
|
3136
|
+
* not provided to setBlockPriorities.
|
|
2891
3137
|
*
|
|
2892
|
-
*
|
|
3138
|
+
* This property can't be edited in read-only mode.
|
|
2893
3139
|
*
|
|
2894
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2895
3140
|
*/
|
|
2896
|
-
|
|
3141
|
+
defaultBlockPriority: number;
|
|
2897
3142
|
/**
|
|
2898
3143
|
* @remarks
|
|
2899
|
-
*
|
|
2900
|
-
*
|
|
2901
|
-
*
|
|
2902
|
-
* @throws This property can throw when used.
|
|
3144
|
+
* Optional. Default targeting priority used for entity types
|
|
3145
|
+
* not provided to setEntityPriorities.
|
|
2903
3146
|
*
|
|
2904
|
-
*
|
|
3147
|
+
* This property can't be edited in read-only mode.
|
|
2905
3148
|
*
|
|
2906
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2907
3149
|
*/
|
|
2908
|
-
|
|
3150
|
+
defaultEntityPriority: number;
|
|
2909
3151
|
/**
|
|
2910
3152
|
* @remarks
|
|
2911
|
-
*
|
|
3153
|
+
* The unique Id used to register the category with. Must have
|
|
3154
|
+
* a namespace.
|
|
2912
3155
|
*
|
|
2913
|
-
* @throws This property can throw when used.
|
|
2914
3156
|
*/
|
|
2915
|
-
readonly
|
|
3157
|
+
readonly identifier: string;
|
|
2916
3158
|
/**
|
|
2917
3159
|
* @remarks
|
|
2918
|
-
*
|
|
2919
|
-
*
|
|
3160
|
+
* Constructor that takes a unique Id to associate with the
|
|
3161
|
+
* created AimAssistCategory. Must have a namespace.
|
|
2920
3162
|
*
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
3163
|
+
*/
|
|
3164
|
+
constructor(identifier: string);
|
|
3165
|
+
/**
|
|
3166
|
+
* @remarks
|
|
3167
|
+
* Gets the priority settings used for block targeting.
|
|
2924
3168
|
*
|
|
2925
|
-
*
|
|
3169
|
+
* @returns
|
|
3170
|
+
* The record mapping block Ids to their priority settings.
|
|
3171
|
+
* Larger numbers have greater priority.
|
|
2926
3172
|
*/
|
|
2927
|
-
|
|
3173
|
+
getBlockPriorities(): Record<string, number>;
|
|
2928
3174
|
/**
|
|
2929
3175
|
* @remarks
|
|
2930
|
-
* Gets the
|
|
3176
|
+
* Gets the priority settings used for entity targeting.
|
|
2931
3177
|
*
|
|
2932
|
-
* @
|
|
3178
|
+
* @returns
|
|
3179
|
+
* The record mapping entity Ids to their priority settings.
|
|
3180
|
+
* Larger numbers have greater priority.
|
|
3181
|
+
*/
|
|
3182
|
+
getEntityPriorities(): Record<string, number>;
|
|
3183
|
+
/**
|
|
3184
|
+
* @remarks
|
|
3185
|
+
* Sets the priority settings used for block targeting.
|
|
2933
3186
|
*
|
|
2934
|
-
*
|
|
3187
|
+
* This function can't be called in read-only mode.
|
|
2935
3188
|
*
|
|
2936
|
-
*
|
|
3189
|
+
* @param blockPriorities
|
|
3190
|
+
* A record mapping block Ids to their priority settings.
|
|
3191
|
+
* Larger numbers have greater priority.
|
|
2937
3192
|
*/
|
|
2938
|
-
|
|
3193
|
+
setBlockPriorities(
|
|
3194
|
+
blockPriorities: Record<keyof typeof minecraftvanilladata.MinecraftBlockTypes | string, number>,
|
|
3195
|
+
): void;
|
|
2939
3196
|
/**
|
|
2940
3197
|
* @remarks
|
|
2941
|
-
*
|
|
2942
|
-
* Vanilla block names can be changed in future releases, try
|
|
2943
|
-
* using 'Block.matches' instead for block comparison.
|
|
2944
|
-
*
|
|
2945
|
-
* @throws This property can throw when used.
|
|
3198
|
+
* Sets the priority settings used for entity targeting.
|
|
2946
3199
|
*
|
|
2947
|
-
*
|
|
3200
|
+
* This function can't be called in read-only mode.
|
|
2948
3201
|
*
|
|
2949
|
-
*
|
|
3202
|
+
* @param entityPriorities
|
|
3203
|
+
* A record mapping entity Ids to their priority settings.
|
|
3204
|
+
* Larger numbers have greater priority.
|
|
2950
3205
|
*/
|
|
2951
|
-
|
|
3206
|
+
setEntityPriorities(
|
|
3207
|
+
entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
|
|
3208
|
+
): void;
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
/**
|
|
3212
|
+
* @beta
|
|
3213
|
+
* Handle to an aim-assist preset that exists in the
|
|
3214
|
+
* world.aimAssist registry.
|
|
3215
|
+
*/
|
|
3216
|
+
export class AimAssistPreset {
|
|
3217
|
+
private constructor();
|
|
2952
3218
|
/**
|
|
2953
3219
|
* @remarks
|
|
2954
|
-
*
|
|
3220
|
+
* Optional. Default aim-assist category Id used for items not
|
|
3221
|
+
* provided to setItemSettings.
|
|
2955
3222
|
*
|
|
3223
|
+
* @throws This property can throw when used.
|
|
2956
3224
|
*/
|
|
2957
|
-
readonly
|
|
3225
|
+
readonly defaultItemSettings?: string;
|
|
2958
3226
|
/**
|
|
2959
3227
|
* @remarks
|
|
2960
|
-
*
|
|
3228
|
+
* Optional. Aim-assist category Id used for an empty hand.
|
|
2961
3229
|
*
|
|
3230
|
+
* @throws This property can throw when used.
|
|
2962
3231
|
*/
|
|
2963
|
-
readonly
|
|
3232
|
+
readonly handSettings?: string;
|
|
2964
3233
|
/**
|
|
2965
3234
|
* @remarks
|
|
2966
|
-
*
|
|
3235
|
+
* The unique Id associated with the preset.
|
|
2967
3236
|
*
|
|
2968
3237
|
*/
|
|
2969
|
-
readonly
|
|
3238
|
+
readonly identifier: string;
|
|
2970
3239
|
/**
|
|
2971
3240
|
* @remarks
|
|
2972
|
-
*
|
|
2973
|
-
*
|
|
3241
|
+
* Gets the list of block/entity Ids to exclude from aim assist
|
|
3242
|
+
* targeting.
|
|
2974
3243
|
*
|
|
2975
|
-
* @
|
|
2976
|
-
*
|
|
2977
|
-
* Defaults to: 1
|
|
3244
|
+
* @returns
|
|
3245
|
+
* The array of block/entity Ids.
|
|
2978
3246
|
* @throws This function can throw errors.
|
|
2979
|
-
*
|
|
2980
|
-
* {@link LocationInUnloadedChunkError}
|
|
2981
|
-
*
|
|
2982
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2983
3247
|
*/
|
|
2984
|
-
|
|
3248
|
+
getExcludedTargets(): string[];
|
|
2985
3249
|
/**
|
|
2986
3250
|
* @remarks
|
|
2987
|
-
*
|
|
2988
|
-
* Y direction).
|
|
3251
|
+
* Gets the per-item aim-assist category Ids.
|
|
2989
3252
|
*
|
|
2990
|
-
* @
|
|
2991
|
-
*
|
|
2992
|
-
* Defaults to: 1
|
|
3253
|
+
* @returns
|
|
3254
|
+
* The record mapping item Ids to aim-assist category Ids.
|
|
2993
3255
|
* @throws This function can throw errors.
|
|
2994
|
-
*
|
|
2995
|
-
* {@link LocationInUnloadedChunkError}
|
|
2996
|
-
*
|
|
2997
|
-
* {@link LocationOutOfWorldBoundariesError}
|
|
2998
3256
|
*/
|
|
2999
|
-
|
|
3257
|
+
getItemSettings(): Record<string, string>;
|
|
3000
3258
|
/**
|
|
3001
3259
|
* @remarks
|
|
3002
|
-
*
|
|
3003
|
-
*
|
|
3260
|
+
* Gets the list of item Ids that will target liquid blocks
|
|
3261
|
+
* with aim-assist when being held.
|
|
3004
3262
|
*
|
|
3263
|
+
* @returns
|
|
3264
|
+
* The array of item Ids.
|
|
3265
|
+
* @throws This function can throw errors.
|
|
3005
3266
|
*/
|
|
3006
|
-
|
|
3267
|
+
getLiquidTargetingItems(): string[];
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
/**
|
|
3271
|
+
* @beta
|
|
3272
|
+
* Settings used with AimAssistRegistry.addPreset for creation
|
|
3273
|
+
* of the AimAssistPreset.
|
|
3274
|
+
*/
|
|
3275
|
+
export class AimAssistPresetSettings {
|
|
3007
3276
|
/**
|
|
3008
3277
|
* @remarks
|
|
3009
|
-
*
|
|
3010
|
-
*
|
|
3278
|
+
* Optional. Default aim-assist category Id used for items not
|
|
3279
|
+
* provided to setItemSettings.
|
|
3280
|
+
*
|
|
3281
|
+
* This property can't be edited in read-only mode.
|
|
3282
|
+
*
|
|
3283
|
+
*/
|
|
3284
|
+
defaultItemSettings?: string;
|
|
3285
|
+
/**
|
|
3286
|
+
* @remarks
|
|
3287
|
+
* Optional. Aim-assist category Id used for an empty hand.
|
|
3288
|
+
*
|
|
3289
|
+
* This property can't be edited in read-only mode.
|
|
3290
|
+
*
|
|
3291
|
+
*/
|
|
3292
|
+
handSettings?: string;
|
|
3293
|
+
/**
|
|
3294
|
+
* @remarks
|
|
3295
|
+
* The unique Id used to register the preset with. Must have a
|
|
3296
|
+
* namespace.
|
|
3297
|
+
*
|
|
3298
|
+
*/
|
|
3299
|
+
readonly identifier: string;
|
|
3300
|
+
/**
|
|
3301
|
+
* @remarks
|
|
3302
|
+
* Constructor that takes a unique Id to associate with the
|
|
3303
|
+
* created AimAssistPreset. Must have a namespace.
|
|
3304
|
+
*
|
|
3305
|
+
*/
|
|
3306
|
+
constructor(identifier: string);
|
|
3307
|
+
/**
|
|
3308
|
+
* @remarks
|
|
3309
|
+
* Gets the list of block/entity Ids to exclude from aim assist
|
|
3310
|
+
* targeting.
|
|
3311
|
+
*
|
|
3312
|
+
* @returns
|
|
3313
|
+
* The array of block/entity Ids.
|
|
3314
|
+
*/
|
|
3315
|
+
getExcludedTargets(): string[] | undefined;
|
|
3316
|
+
/**
|
|
3317
|
+
* @remarks
|
|
3318
|
+
* Gets the per-item aim-assist category Ids.
|
|
3319
|
+
*
|
|
3320
|
+
* @returns
|
|
3321
|
+
* The record mapping item Ids to aim-assist category Ids.
|
|
3322
|
+
*/
|
|
3323
|
+
getItemSettings(): Record<string, string>;
|
|
3324
|
+
/**
|
|
3325
|
+
* @remarks
|
|
3326
|
+
* Gets the list of item Ids that will target liquid blocks
|
|
3327
|
+
* with aim-assist when being held.
|
|
3328
|
+
*
|
|
3329
|
+
* @returns
|
|
3330
|
+
* The array of item Ids.
|
|
3331
|
+
*/
|
|
3332
|
+
getLiquidTargetingItems(): string[] | undefined;
|
|
3333
|
+
/**
|
|
3334
|
+
* @remarks
|
|
3335
|
+
* Sets the list of block/entity Ids to exclude from aim assist
|
|
3336
|
+
* targeting.
|
|
3337
|
+
*
|
|
3338
|
+
* This function can't be called in read-only mode.
|
|
3339
|
+
*
|
|
3340
|
+
* @param targets
|
|
3341
|
+
* An array of block/entity Ids.
|
|
3342
|
+
*/
|
|
3343
|
+
setExcludedTargets(
|
|
3344
|
+
targets?: (
|
|
3345
|
+
| keyof typeof minecraftvanilladata.MinecraftBlockTypes
|
|
3346
|
+
| keyof typeof minecraftvanilladata.MinecraftEntityTypes
|
|
3347
|
+
| string
|
|
3348
|
+
)[],
|
|
3349
|
+
): void;
|
|
3350
|
+
/**
|
|
3351
|
+
* @remarks
|
|
3352
|
+
* Sets the per-item aim-assist category Ids.
|
|
3353
|
+
*
|
|
3354
|
+
* This function can't be called in read-only mode.
|
|
3355
|
+
*
|
|
3356
|
+
* @param itemSettings
|
|
3357
|
+
* A record mapping item Ids to aim-assist category Ids.
|
|
3358
|
+
* Category Ids must have a namespace.
|
|
3359
|
+
*/
|
|
3360
|
+
setItemSettings(itemSettings: Record<keyof typeof minecraftvanilladata.MinecraftItemTypes | string, string>): void;
|
|
3361
|
+
/**
|
|
3362
|
+
* @remarks
|
|
3363
|
+
* Sets the list of item Ids that will target liquid blocks
|
|
3364
|
+
* with aim-assist when being held.
|
|
3365
|
+
*
|
|
3366
|
+
* This function can't be called in read-only mode.
|
|
3367
|
+
*
|
|
3368
|
+
* @param items
|
|
3369
|
+
* An array of item Ids.
|
|
3370
|
+
*/
|
|
3371
|
+
setLiquidTargetingItems(items?: (keyof typeof minecraftvanilladata.MinecraftItemTypes | string)[]): void;
|
|
3372
|
+
}
|
|
3373
|
+
|
|
3374
|
+
/**
|
|
3375
|
+
* @beta
|
|
3376
|
+
* A container for APIs related to the world's aim-assist
|
|
3377
|
+
* settings.
|
|
3378
|
+
*/
|
|
3379
|
+
export class AimAssistRegistry {
|
|
3380
|
+
private constructor();
|
|
3381
|
+
/**
|
|
3382
|
+
* @remarks
|
|
3383
|
+
* The default aim-assist category Id that is used when not
|
|
3384
|
+
* otherwise specified.
|
|
3385
|
+
*
|
|
3386
|
+
*/
|
|
3387
|
+
static readonly DefaultCategoryId = 'minecraft:default';
|
|
3388
|
+
/**
|
|
3389
|
+
* @remarks
|
|
3390
|
+
* The default aim-assist preset Id that is used when not
|
|
3391
|
+
* otherwise specified.
|
|
3392
|
+
*
|
|
3393
|
+
*/
|
|
3394
|
+
static readonly DefaultPresetId = 'minecraft:aim_assist_default';
|
|
3395
|
+
/**
|
|
3396
|
+
* @remarks
|
|
3397
|
+
* Adds an aim-assist category to the registry.
|
|
3398
|
+
*
|
|
3399
|
+
* This function can't be called in read-only mode.
|
|
3400
|
+
*
|
|
3401
|
+
* @param category
|
|
3402
|
+
* The category settings used to create the new category.
|
|
3403
|
+
* @returns
|
|
3404
|
+
* The created category handle.
|
|
3405
|
+
* @throws This function can throw errors.
|
|
3406
|
+
*
|
|
3407
|
+
* {@link minecraftcommon.EngineError}
|
|
3408
|
+
*
|
|
3409
|
+
* {@link Error}
|
|
3410
|
+
*
|
|
3411
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3412
|
+
*
|
|
3413
|
+
* {@link NamespaceNameError}
|
|
3414
|
+
*/
|
|
3415
|
+
addCategory(category: AimAssistCategorySettings): AimAssistCategory;
|
|
3416
|
+
/**
|
|
3417
|
+
* @remarks
|
|
3418
|
+
* Adds an aim-assist preset to the registry.
|
|
3419
|
+
*
|
|
3420
|
+
* This function can't be called in read-only mode.
|
|
3421
|
+
*
|
|
3422
|
+
* @param preset
|
|
3423
|
+
* The preset settings used to create the new preset.
|
|
3424
|
+
* @returns
|
|
3425
|
+
* The created preset handle.
|
|
3426
|
+
* @throws This function can throw errors.
|
|
3427
|
+
*
|
|
3428
|
+
* {@link minecraftcommon.EngineError}
|
|
3429
|
+
*
|
|
3430
|
+
* {@link Error}
|
|
3431
|
+
*
|
|
3432
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3433
|
+
*
|
|
3434
|
+
* {@link NamespaceNameError}
|
|
3435
|
+
*/
|
|
3436
|
+
addPreset(preset: AimAssistPresetSettings): AimAssistPreset;
|
|
3437
|
+
/**
|
|
3438
|
+
* @remarks
|
|
3439
|
+
* Gets all available categories in the registry.
|
|
3440
|
+
*
|
|
3441
|
+
* @returns
|
|
3442
|
+
* An array of all available category objects.
|
|
3443
|
+
*/
|
|
3444
|
+
getCategories(): AimAssistCategory[];
|
|
3445
|
+
/**
|
|
3446
|
+
* @remarks
|
|
3447
|
+
* Gets the category associated with the provided Id.
|
|
3448
|
+
*
|
|
3449
|
+
* This function can't be called in read-only mode.
|
|
3450
|
+
*
|
|
3451
|
+
* @returns
|
|
3452
|
+
* The category object if it exists, otherwise returns
|
|
3453
|
+
* undefined.
|
|
3454
|
+
*/
|
|
3455
|
+
getCategory(categoryId: string): AimAssistCategory | undefined;
|
|
3456
|
+
/**
|
|
3457
|
+
* @remarks
|
|
3458
|
+
* Gets the preset associated with the provided Id.
|
|
3459
|
+
*
|
|
3460
|
+
* This function can't be called in read-only mode.
|
|
3461
|
+
*
|
|
3462
|
+
* @param presetId
|
|
3463
|
+
* The Id of the preset to retrieve. Must have a namespace.
|
|
3464
|
+
* @returns
|
|
3465
|
+
* The preset object if it exists, otherwise returns undefined.
|
|
3466
|
+
*/
|
|
3467
|
+
getPreset(presetId: string): AimAssistPreset | undefined;
|
|
3468
|
+
/**
|
|
3469
|
+
* @remarks
|
|
3470
|
+
* Gets all available presets in the registry.
|
|
3471
|
+
*
|
|
3472
|
+
* @returns
|
|
3473
|
+
* An array of all available preset objects.
|
|
3474
|
+
*/
|
|
3475
|
+
getPresets(): AimAssistPreset[];
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
/**
|
|
3479
|
+
* @beta
|
|
3480
|
+
* Describes a type of biome.
|
|
3481
|
+
*/
|
|
3482
|
+
export class BiomeType {
|
|
3483
|
+
private constructor();
|
|
3484
|
+
/**
|
|
3485
|
+
* @remarks
|
|
3486
|
+
* Identifier of the biome type.
|
|
3487
|
+
*
|
|
3488
|
+
*/
|
|
3489
|
+
readonly id: string;
|
|
3490
|
+
}
|
|
3491
|
+
|
|
3492
|
+
/**
|
|
3493
|
+
* @beta
|
|
3494
|
+
* Supports a catalog of available biome types registered
|
|
3495
|
+
* within Minecraft.
|
|
3496
|
+
*/
|
|
3497
|
+
export class BiomeTypes {
|
|
3498
|
+
private constructor();
|
|
3499
|
+
/**
|
|
3500
|
+
* @remarks
|
|
3501
|
+
* Returns a specific biome type.
|
|
3502
|
+
*
|
|
3503
|
+
* @param typeName
|
|
3504
|
+
* Identifier of the biome. Generally, namespaced identifiers
|
|
3505
|
+
* (e.g., minecraft:frozen_peaks) should be used.
|
|
3506
|
+
* @returns
|
|
3507
|
+
* If the biome exists, a BiomeType object is returned. If not,
|
|
3508
|
+
* undefined is returned.
|
|
3509
|
+
*/
|
|
3510
|
+
static get(typeName: string): BiomeType | undefined;
|
|
3511
|
+
/**
|
|
3512
|
+
* @remarks
|
|
3513
|
+
* Returns all registered biome types within Minecraft
|
|
3514
|
+
*
|
|
3515
|
+
*/
|
|
3516
|
+
static getAll(): BiomeType[];
|
|
3517
|
+
}
|
|
3518
|
+
|
|
3519
|
+
/**
|
|
3520
|
+
* Represents a block in a dimension. A block represents a
|
|
3521
|
+
* unique X, Y, and Z within a dimension and get/sets the state
|
|
3522
|
+
* of the block at that location. This type was significantly
|
|
3523
|
+
* updated in version 1.17.10.21.
|
|
3524
|
+
*/
|
|
3525
|
+
export class Block {
|
|
3526
|
+
private constructor();
|
|
3527
|
+
/**
|
|
3528
|
+
* @remarks
|
|
3529
|
+
* Returns the dimension that the block is within.
|
|
3530
|
+
*
|
|
3531
|
+
*/
|
|
3532
|
+
readonly dimension: Dimension;
|
|
3533
|
+
/**
|
|
3534
|
+
* @remarks
|
|
3535
|
+
* Returns true if this block is an air block (i.e., empty
|
|
3536
|
+
* space).
|
|
3537
|
+
*
|
|
3538
|
+
* @throws This property can throw when used.
|
|
3539
|
+
*
|
|
3540
|
+
* {@link LocationInUnloadedChunkError}
|
|
3541
|
+
*
|
|
3542
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3543
|
+
*/
|
|
3544
|
+
readonly isAir: boolean;
|
|
3545
|
+
/**
|
|
3546
|
+
* @remarks
|
|
3547
|
+
* Returns true if this block is a liquid block - (e.g., a
|
|
3548
|
+
* water block and a lava block are liquid, while an air block
|
|
3549
|
+
* and a stone block are not. Water logged blocks are not
|
|
3550
|
+
* liquid blocks).
|
|
3551
|
+
*
|
|
3552
|
+
* @throws This property can throw when used.
|
|
3553
|
+
*
|
|
3554
|
+
* {@link LocationInUnloadedChunkError}
|
|
3555
|
+
*
|
|
3556
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3557
|
+
*/
|
|
3558
|
+
readonly isLiquid: boolean;
|
|
3559
|
+
/**
|
|
3560
|
+
* @beta
|
|
3561
|
+
* @remarks
|
|
3562
|
+
* Returns true if this block is solid and impassible - (e.g.,
|
|
3563
|
+
* a cobblestone block and a diamond block are solid, while a
|
|
3564
|
+
* ladder block and a fence block are not).
|
|
3565
|
+
*
|
|
3566
|
+
* @throws This property can throw when used.
|
|
3567
|
+
*
|
|
3568
|
+
* {@link LocationInUnloadedChunkError}
|
|
3569
|
+
*
|
|
3570
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3571
|
+
*/
|
|
3572
|
+
readonly isSolid: boolean;
|
|
3573
|
+
/**
|
|
3574
|
+
* @remarks
|
|
3575
|
+
* Returns true if this reference to a block is still valid
|
|
3576
|
+
* (for example, if the block is unloaded, references to that
|
|
3577
|
+
* block will no longer be valid.)
|
|
3578
|
+
*
|
|
3579
|
+
*/
|
|
3580
|
+
readonly isValid: boolean;
|
|
3581
|
+
/**
|
|
3582
|
+
* @remarks
|
|
3583
|
+
* Returns or sets whether this block has water on it.
|
|
3584
|
+
*
|
|
3585
|
+
* @throws This property can throw when used.
|
|
3586
|
+
*
|
|
3587
|
+
* {@link LocationInUnloadedChunkError}
|
|
3588
|
+
*
|
|
3589
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3590
|
+
*/
|
|
3591
|
+
readonly isWaterlogged: boolean;
|
|
3592
|
+
/**
|
|
3593
|
+
* @remarks
|
|
3594
|
+
* Key for the localization of this block's name used in .lang
|
|
3595
|
+
* files.
|
|
3596
|
+
*
|
|
3597
|
+
* @throws This property can throw when used.
|
|
3598
|
+
*
|
|
3599
|
+
* {@link LocationInUnloadedChunkError}
|
|
3600
|
+
*
|
|
3601
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3602
|
+
*/
|
|
3603
|
+
readonly localizationKey: string;
|
|
3604
|
+
/**
|
|
3605
|
+
* @remarks
|
|
3606
|
+
* Coordinates of the specified block.
|
|
3607
|
+
*
|
|
3608
|
+
* @throws This property can throw when used.
|
|
3609
|
+
*/
|
|
3610
|
+
readonly location: Vector3;
|
|
3611
|
+
/**
|
|
3612
|
+
* @remarks
|
|
3613
|
+
* Additional block configuration data that describes the
|
|
3614
|
+
* block.
|
|
3615
|
+
*
|
|
3616
|
+
* @throws This property can throw when used.
|
|
3617
|
+
*
|
|
3618
|
+
* {@link LocationInUnloadedChunkError}
|
|
3619
|
+
*
|
|
3620
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3621
|
+
*/
|
|
3622
|
+
readonly permutation: BlockPermutation;
|
|
3623
|
+
/**
|
|
3624
|
+
* @remarks
|
|
3625
|
+
* Gets the type of block.
|
|
3626
|
+
*
|
|
3627
|
+
* @throws This property can throw when used.
|
|
3628
|
+
*
|
|
3629
|
+
* {@link LocationInUnloadedChunkError}
|
|
3630
|
+
*
|
|
3631
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3632
|
+
*/
|
|
3633
|
+
readonly 'type': BlockType;
|
|
3634
|
+
/**
|
|
3635
|
+
* @remarks
|
|
3636
|
+
* Identifier of the type of block for this block. Warning:
|
|
3637
|
+
* Vanilla block names can be changed in future releases, try
|
|
3638
|
+
* using 'Block.matches' instead for block comparison.
|
|
3639
|
+
*
|
|
3640
|
+
* @throws This property can throw when used.
|
|
3641
|
+
*
|
|
3642
|
+
* {@link LocationInUnloadedChunkError}
|
|
3643
|
+
*
|
|
3644
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3645
|
+
*/
|
|
3646
|
+
readonly typeId: string;
|
|
3647
|
+
/**
|
|
3648
|
+
* @remarks
|
|
3649
|
+
* X coordinate of the block.
|
|
3650
|
+
*
|
|
3651
|
+
*/
|
|
3652
|
+
readonly x: number;
|
|
3653
|
+
/**
|
|
3654
|
+
* @remarks
|
|
3655
|
+
* Y coordinate of the block.
|
|
3656
|
+
*
|
|
3657
|
+
*/
|
|
3658
|
+
readonly y: number;
|
|
3659
|
+
/**
|
|
3660
|
+
* @remarks
|
|
3661
|
+
* Z coordinate of the block.
|
|
3662
|
+
*
|
|
3663
|
+
*/
|
|
3664
|
+
readonly z: number;
|
|
3665
|
+
/**
|
|
3666
|
+
* @remarks
|
|
3667
|
+
* Returns the {@link Block} above this block (positive in the
|
|
3668
|
+
* Y direction).
|
|
3669
|
+
*
|
|
3670
|
+
* @param steps
|
|
3671
|
+
* Number of steps above to step before returning.
|
|
3672
|
+
* Defaults to: 1
|
|
3673
|
+
* @throws This function can throw errors.
|
|
3674
|
+
*
|
|
3675
|
+
* {@link LocationInUnloadedChunkError}
|
|
3676
|
+
*
|
|
3677
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3678
|
+
*/
|
|
3679
|
+
above(steps?: number): Block | undefined;
|
|
3680
|
+
/**
|
|
3681
|
+
* @remarks
|
|
3682
|
+
* Returns the {@link Block} below this block (negative in the
|
|
3683
|
+
* Y direction).
|
|
3684
|
+
*
|
|
3685
|
+
* @param steps
|
|
3686
|
+
* Number of steps below to step before returning.
|
|
3687
|
+
* Defaults to: 1
|
|
3688
|
+
* @throws This function can throw errors.
|
|
3689
|
+
*
|
|
3690
|
+
* {@link LocationInUnloadedChunkError}
|
|
3691
|
+
*
|
|
3692
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3693
|
+
*/
|
|
3694
|
+
below(steps?: number): Block | undefined;
|
|
3695
|
+
/**
|
|
3696
|
+
* @remarks
|
|
3697
|
+
* Returns the {@link Vector3} of the center of this block on
|
|
3698
|
+
* the X and Z axis.
|
|
3699
|
+
*
|
|
3700
|
+
*/
|
|
3701
|
+
bottomCenter(): Vector3;
|
|
3702
|
+
/**
|
|
3703
|
+
* @remarks
|
|
3704
|
+
* Returns whether this block is removed when touched by
|
|
3705
|
+
* liquid.
|
|
3011
3706
|
*
|
|
3012
3707
|
* @param liquidType
|
|
3013
3708
|
* The type of liquid this function should be called for.
|
|
@@ -3040,6 +3735,30 @@ export class Block {
|
|
|
3040
3735
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3041
3736
|
*/
|
|
3042
3737
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
3738
|
+
/**
|
|
3739
|
+
* @beta
|
|
3740
|
+
* @remarks
|
|
3741
|
+
* Checks to see whether it is valid to place the specified
|
|
3742
|
+
* block type or block permutation, on a specified face on this
|
|
3743
|
+
* block.
|
|
3744
|
+
*
|
|
3745
|
+
* @param blockToPlace
|
|
3746
|
+
* Block type or block permutation to check placement for.
|
|
3747
|
+
* @param faceToPlaceOn
|
|
3748
|
+
* Optional specific face of this block to check placement
|
|
3749
|
+
* against.
|
|
3750
|
+
* @returns
|
|
3751
|
+
* Returns `true` if the block type or permutation can be
|
|
3752
|
+
* placed on this block, else `false`.
|
|
3753
|
+
* @throws This function can throw errors.
|
|
3754
|
+
*
|
|
3755
|
+
* {@link Error}
|
|
3756
|
+
*
|
|
3757
|
+
* {@link LocationInUnloadedChunkError}
|
|
3758
|
+
*
|
|
3759
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3760
|
+
*/
|
|
3761
|
+
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
3043
3762
|
/**
|
|
3044
3763
|
* @remarks
|
|
3045
3764
|
* Returns the {@link Vector3} of the center of this block on
|
|
@@ -3107,6 +3826,32 @@ export class Block {
|
|
|
3107
3826
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3108
3827
|
*/
|
|
3109
3828
|
getItemStack(amount?: number, withData?: boolean): ItemStack | undefined;
|
|
3829
|
+
/**
|
|
3830
|
+
* @beta
|
|
3831
|
+
* @remarks
|
|
3832
|
+
* Returns the total brightness level of light shining on a
|
|
3833
|
+
* certain block.
|
|
3834
|
+
*
|
|
3835
|
+
* This function can't be called in read-only mode.
|
|
3836
|
+
*
|
|
3837
|
+
* @returns
|
|
3838
|
+
* The brightness level on the block.
|
|
3839
|
+
* @throws This function can throw errors.
|
|
3840
|
+
*
|
|
3841
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3842
|
+
*
|
|
3843
|
+
* {@link LocationInUnloadedChunkError}
|
|
3844
|
+
*/
|
|
3845
|
+
getLightLevel(): number;
|
|
3846
|
+
/**
|
|
3847
|
+
* @beta
|
|
3848
|
+
* @throws This function can throw errors.
|
|
3849
|
+
*
|
|
3850
|
+
* {@link LocationInUnloadedChunkError}
|
|
3851
|
+
*
|
|
3852
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
3853
|
+
*/
|
|
3854
|
+
getMapColor(): RGBA;
|
|
3110
3855
|
/**
|
|
3111
3856
|
* @remarks
|
|
3112
3857
|
* Returns the net redstone power of this block.
|
|
@@ -3121,6 +3866,23 @@ export class Block {
|
|
|
3121
3866
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3122
3867
|
*/
|
|
3123
3868
|
getRedstonePower(): number | undefined;
|
|
3869
|
+
/**
|
|
3870
|
+
* @beta
|
|
3871
|
+
* @remarks
|
|
3872
|
+
* Returns the brightness level of light shining from the sky
|
|
3873
|
+
* on a certain block.
|
|
3874
|
+
*
|
|
3875
|
+
* This function can't be called in read-only mode.
|
|
3876
|
+
*
|
|
3877
|
+
* @returns
|
|
3878
|
+
* The brightness level on the block.
|
|
3879
|
+
* @throws This function can throw errors.
|
|
3880
|
+
*
|
|
3881
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
3882
|
+
*
|
|
3883
|
+
* {@link LocationInUnloadedChunkError}
|
|
3884
|
+
*/
|
|
3885
|
+
getSkyLightLevel(): number;
|
|
3124
3886
|
/**
|
|
3125
3887
|
* @remarks
|
|
3126
3888
|
* Returns a set of tags for a block.
|
|
@@ -3342,6 +4104,27 @@ export class Block {
|
|
|
3342
4104
|
* {@link LocationOutOfWorldBoundariesError}
|
|
3343
4105
|
*/
|
|
3344
4106
|
south(steps?: number): Block | undefined;
|
|
4107
|
+
/**
|
|
4108
|
+
* @beta
|
|
4109
|
+
* @remarks
|
|
4110
|
+
* Tries to set the block in the dimension to the state of the
|
|
4111
|
+
* permutation by first checking if the placement is valid.
|
|
4112
|
+
*
|
|
4113
|
+
* This function can't be called in read-only mode.
|
|
4114
|
+
*
|
|
4115
|
+
* @param permutation
|
|
4116
|
+
* Permutation that contains a set of property states for the
|
|
4117
|
+
* Block.
|
|
4118
|
+
* @returns
|
|
4119
|
+
* Returns `true` if the block permutation data was
|
|
4120
|
+
* successfully set, else `false`.
|
|
4121
|
+
* @throws This function can throw errors.
|
|
4122
|
+
*
|
|
4123
|
+
* {@link LocationInUnloadedChunkError}
|
|
4124
|
+
*
|
|
4125
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
4126
|
+
*/
|
|
4127
|
+
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
3345
4128
|
/**
|
|
3346
4129
|
* @remarks
|
|
3347
4130
|
* Returns the {@link Block} to the west of this block
|
|
@@ -3359,6 +4142,137 @@ export class Block {
|
|
|
3359
4142
|
west(steps?: number): Block | undefined;
|
|
3360
4143
|
}
|
|
3361
4144
|
|
|
4145
|
+
/**
|
|
4146
|
+
* @beta
|
|
4147
|
+
* Bounding Box Utils is a utility class that provides a number
|
|
4148
|
+
* of useful functions for the creation and utility of {@link
|
|
4149
|
+
* BlockBoundingBox} objects
|
|
4150
|
+
*/
|
|
4151
|
+
export class BlockBoundingBoxUtils {
|
|
4152
|
+
private constructor();
|
|
4153
|
+
/**
|
|
4154
|
+
* @remarks
|
|
4155
|
+
* Create a validated instance of a {@link BlockBoundingBox}
|
|
4156
|
+
* where the min and max components are guaranteed to be (min
|
|
4157
|
+
* <= max)
|
|
4158
|
+
*
|
|
4159
|
+
* This function can't be called in read-only mode.
|
|
4160
|
+
*
|
|
4161
|
+
* @param min
|
|
4162
|
+
* A corner world location
|
|
4163
|
+
* @param max
|
|
4164
|
+
* A corner world location diametrically opposite
|
|
4165
|
+
*/
|
|
4166
|
+
static createValid(min: Vector3, max: Vector3): BlockBoundingBox;
|
|
4167
|
+
/**
|
|
4168
|
+
* @remarks
|
|
4169
|
+
* Expand a {@link BlockBoundingBox} by a given amount along
|
|
4170
|
+
* each axis.
|
|
4171
|
+
* Sizes can be negative to perform contraction.
|
|
4172
|
+
* Note: corners can be inverted if the contraction size is
|
|
4173
|
+
* greater than the span, but the min/max relationship will
|
|
4174
|
+
* remain correct
|
|
4175
|
+
*
|
|
4176
|
+
* This function can't be called in read-only mode.
|
|
4177
|
+
*
|
|
4178
|
+
* @returns
|
|
4179
|
+
* Return a new {@link BlockBoundingBox} object representing
|
|
4180
|
+
* the changes
|
|
4181
|
+
*/
|
|
4182
|
+
static dilate(box: BlockBoundingBox, size: Vector3): BlockBoundingBox;
|
|
4183
|
+
/**
|
|
4184
|
+
* @remarks
|
|
4185
|
+
* Check if two {@link BlockBoundingBox} objects are identical
|
|
4186
|
+
*
|
|
4187
|
+
* This function can't be called in read-only mode.
|
|
4188
|
+
*
|
|
4189
|
+
*/
|
|
4190
|
+
static equals(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4191
|
+
/**
|
|
4192
|
+
* @remarks
|
|
4193
|
+
* Expand the initial box object bounds to include the 2nd box
|
|
4194
|
+
* argument. The resultant {@link BlockBoundingBox} object
|
|
4195
|
+
* will be a BlockBoundingBox which exactly encompasses the two
|
|
4196
|
+
* boxes.
|
|
4197
|
+
*
|
|
4198
|
+
* This function can't be called in read-only mode.
|
|
4199
|
+
*
|
|
4200
|
+
* @returns
|
|
4201
|
+
* A new {@link BlockBoundingBox} instance representing the
|
|
4202
|
+
* smallest possible bounding box which can encompass both
|
|
4203
|
+
*/
|
|
4204
|
+
static expand(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox;
|
|
4205
|
+
/**
|
|
4206
|
+
* @remarks
|
|
4207
|
+
* Calculate the center block of a given {@link
|
|
4208
|
+
* BlockBoundingBox} object.
|
|
4209
|
+
*
|
|
4210
|
+
* This function can't be called in read-only mode.
|
|
4211
|
+
*
|
|
4212
|
+
* @returns
|
|
4213
|
+
* Note that {@link BlockBoundingBox} objects represent whole
|
|
4214
|
+
* blocks, so the center of boxes which have odd numbered
|
|
4215
|
+
* bounds are not mathematically centered...
|
|
4216
|
+
* i.e. a BlockBoundingBox( 0,0,0 -> 3,3,3 ) would have a
|
|
4217
|
+
* center of (1,1,1) (not (1.5, 1.5, 1.5) as expected)
|
|
4218
|
+
*/
|
|
4219
|
+
static getCenter(box: BlockBoundingBox): Vector3;
|
|
4220
|
+
/**
|
|
4221
|
+
* @remarks
|
|
4222
|
+
* Calculate the BlockBoundingBox which represents the union
|
|
4223
|
+
* area of two intersecting BlockBoundingBoxes
|
|
4224
|
+
*
|
|
4225
|
+
* This function can't be called in read-only mode.
|
|
4226
|
+
*
|
|
4227
|
+
*/
|
|
4228
|
+
static getIntersection(box: BlockBoundingBox, other: BlockBoundingBox): BlockBoundingBox | undefined;
|
|
4229
|
+
/**
|
|
4230
|
+
* @remarks
|
|
4231
|
+
* Get the Span of each of the BlockBoundingBox Axis components
|
|
4232
|
+
*
|
|
4233
|
+
* This function can't be called in read-only mode.
|
|
4234
|
+
*
|
|
4235
|
+
*/
|
|
4236
|
+
static getSpan(box: BlockBoundingBox): Vector3;
|
|
4237
|
+
/**
|
|
4238
|
+
* @remarks
|
|
4239
|
+
* Check to see if two BlockBoundingBox objects intersect
|
|
4240
|
+
*
|
|
4241
|
+
* This function can't be called in read-only mode.
|
|
4242
|
+
*
|
|
4243
|
+
*/
|
|
4244
|
+
static intersects(box: BlockBoundingBox, other: BlockBoundingBox): boolean;
|
|
4245
|
+
/**
|
|
4246
|
+
* @remarks
|
|
4247
|
+
* Check to see if a given coordinate is inside a
|
|
4248
|
+
* BlockBoundingBox
|
|
4249
|
+
*
|
|
4250
|
+
* This function can't be called in read-only mode.
|
|
4251
|
+
*
|
|
4252
|
+
*/
|
|
4253
|
+
static isInside(box: BlockBoundingBox, pos: Vector3): boolean;
|
|
4254
|
+
/**
|
|
4255
|
+
* @remarks
|
|
4256
|
+
* Check to see if a BlockBoundingBox is valid (i.e. (min <=
|
|
4257
|
+
* max))
|
|
4258
|
+
*
|
|
4259
|
+
* This function can't be called in read-only mode.
|
|
4260
|
+
*
|
|
4261
|
+
*/
|
|
4262
|
+
static isValid(box: BlockBoundingBox): boolean;
|
|
4263
|
+
/**
|
|
4264
|
+
* @remarks
|
|
4265
|
+
* Move a BlockBoundingBox by a given amount
|
|
4266
|
+
*
|
|
4267
|
+
* This function can't be called in read-only mode.
|
|
4268
|
+
*
|
|
4269
|
+
* @returns
|
|
4270
|
+
* Return a new BlockBoundingBox object which represents the
|
|
4271
|
+
* change
|
|
4272
|
+
*/
|
|
4273
|
+
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
4274
|
+
}
|
|
4275
|
+
|
|
3362
4276
|
/**
|
|
3363
4277
|
* Base type for components associated with blocks.
|
|
3364
4278
|
*/
|
|
@@ -3784,6 +4698,18 @@ export class BlockLocationIterator implements Iterable<Vector3> {
|
|
|
3784
4698
|
*
|
|
3785
4699
|
*/
|
|
3786
4700
|
[Symbol.iterator](): Iterator<Vector3>;
|
|
4701
|
+
/**
|
|
4702
|
+
* @beta
|
|
4703
|
+
* @remarks
|
|
4704
|
+
* Checks if the underlining block volume has been invalidated.
|
|
4705
|
+
* Will return false if the block volume was modified between
|
|
4706
|
+
* creating the iterator and iterating it, and true otherwise.
|
|
4707
|
+
*
|
|
4708
|
+
* @throws This function can throw errors.
|
|
4709
|
+
*
|
|
4710
|
+
* {@link minecraftcommon.EngineError}
|
|
4711
|
+
*/
|
|
4712
|
+
isValid(): boolean;
|
|
3787
4713
|
/**
|
|
3788
4714
|
* @remarks
|
|
3789
4715
|
* This function can't be called in read-only mode.
|
|
@@ -4580,6 +5506,15 @@ export class BlockVolumeBase {
|
|
|
4580
5506
|
*
|
|
4581
5507
|
*/
|
|
4582
5508
|
getBlockLocationIterator(): BlockLocationIterator;
|
|
5509
|
+
/**
|
|
5510
|
+
* @beta
|
|
5511
|
+
* @remarks
|
|
5512
|
+
* Return a {@link BlockBoundingBox} object which represents
|
|
5513
|
+
* the validated min and max coordinates of the volume
|
|
5514
|
+
*
|
|
5515
|
+
* @throws This function can throw errors.
|
|
5516
|
+
*/
|
|
5517
|
+
getBoundingBox(): BlockBoundingBox;
|
|
4583
5518
|
/**
|
|
4584
5519
|
* @remarks
|
|
4585
5520
|
* Return the capacity (volume) of the BlockVolume (W*D*H)
|
|
@@ -4791,6 +5726,23 @@ export class Camera {
|
|
|
4791
5726
|
| CameraSetRotOptions
|
|
4792
5727
|
| CameraTargetOptions,
|
|
4793
5728
|
): void;
|
|
5729
|
+
/**
|
|
5730
|
+
* @beta
|
|
5731
|
+
* @remarks
|
|
5732
|
+
* Sets the current active camera with easing.
|
|
5733
|
+
*
|
|
5734
|
+
* This function can't be called in read-only mode.
|
|
5735
|
+
*
|
|
5736
|
+
* @param cameraPreset
|
|
5737
|
+
* Identifier of a camera preset file defined within JSON.
|
|
5738
|
+
* @param easeOptions
|
|
5739
|
+
* Options to ease the camera from the previous camera to the
|
|
5740
|
+
* current one.
|
|
5741
|
+
* @throws
|
|
5742
|
+
* Throws when easing to minecraft:first_person presets
|
|
5743
|
+
* currently without the experimental cameras toggle enabled.
|
|
5744
|
+
*/
|
|
5745
|
+
setCameraWithEase(cameraPreset: string, easeOptions: EaseOptions): void;
|
|
4794
5746
|
/**
|
|
4795
5747
|
* @remarks
|
|
4796
5748
|
* Sets the current active camera for the specified player and
|
|
@@ -4799,21 +5751,173 @@ export class Camera {
|
|
|
4799
5751
|
*
|
|
4800
5752
|
* This function can't be called in read-only mode.
|
|
4801
5753
|
*
|
|
4802
|
-
* @param cameraPreset
|
|
4803
|
-
* Identifier of a camera preset file defined within JSON.
|
|
4804
|
-
* @param easeOptions
|
|
4805
|
-
* Options to ease the camera back to its original position and
|
|
4806
|
-
* rotation.
|
|
4807
|
-
* @throws This function can throw errors.
|
|
5754
|
+
* @param cameraPreset
|
|
5755
|
+
* Identifier of a camera preset file defined within JSON.
|
|
5756
|
+
* @param easeOptions
|
|
5757
|
+
* Options to ease the camera back to its original position and
|
|
5758
|
+
* rotation.
|
|
5759
|
+
* @throws This function can throw errors.
|
|
5760
|
+
*/
|
|
5761
|
+
setDefaultCamera(cameraPreset: string, easeOptions?: EaseOptions): void;
|
|
5762
|
+
/**
|
|
5763
|
+
* @remarks
|
|
5764
|
+
* This function can't be called in read-only mode.
|
|
5765
|
+
*
|
|
5766
|
+
* @throws This function can throw errors.
|
|
5767
|
+
*/
|
|
5768
|
+
setFov(fovCameraOptions?: CameraFovOptions): void;
|
|
5769
|
+
}
|
|
5770
|
+
|
|
5771
|
+
/**
|
|
5772
|
+
* @beta
|
|
5773
|
+
* An event that fires as players enter chat messages.
|
|
5774
|
+
*/
|
|
5775
|
+
export class ChatSendAfterEvent {
|
|
5776
|
+
private constructor();
|
|
5777
|
+
/**
|
|
5778
|
+
* @remarks
|
|
5779
|
+
* Message that is being broadcast.
|
|
5780
|
+
*
|
|
5781
|
+
*/
|
|
5782
|
+
readonly message: string;
|
|
5783
|
+
/**
|
|
5784
|
+
* @remarks
|
|
5785
|
+
* Player that sent the chat message.
|
|
5786
|
+
*
|
|
5787
|
+
*/
|
|
5788
|
+
readonly sender: Player;
|
|
5789
|
+
/**
|
|
5790
|
+
* @remarks
|
|
5791
|
+
* Optional list of players that will receive this message. If
|
|
5792
|
+
* defined, this message is directly targeted to one or more
|
|
5793
|
+
* players (i.e., is not broadcast.)
|
|
5794
|
+
*
|
|
5795
|
+
*/
|
|
5796
|
+
readonly targets?: Player[];
|
|
5797
|
+
}
|
|
5798
|
+
|
|
5799
|
+
/**
|
|
5800
|
+
* @beta
|
|
5801
|
+
* Manages callbacks that are connected to chat messages being
|
|
5802
|
+
* sent.
|
|
5803
|
+
*/
|
|
5804
|
+
export class ChatSendAfterEventSignal {
|
|
5805
|
+
private constructor();
|
|
5806
|
+
/**
|
|
5807
|
+
* @remarks
|
|
5808
|
+
* Adds a callback that will be called when new chat messages
|
|
5809
|
+
* are sent.
|
|
5810
|
+
*
|
|
5811
|
+
* This function can't be called in read-only mode.
|
|
5812
|
+
*
|
|
5813
|
+
* This function can be called in early-execution mode.
|
|
5814
|
+
*
|
|
5815
|
+
*/
|
|
5816
|
+
subscribe(callback: (arg0: ChatSendAfterEvent) => void): (arg0: ChatSendAfterEvent) => void;
|
|
5817
|
+
/**
|
|
5818
|
+
* @remarks
|
|
5819
|
+
* Removes a callback from being called when new chat messages
|
|
5820
|
+
* are sent.
|
|
5821
|
+
*
|
|
5822
|
+
* This function can't be called in read-only mode.
|
|
5823
|
+
*
|
|
5824
|
+
* This function can be called in early-execution mode.
|
|
5825
|
+
*
|
|
5826
|
+
*/
|
|
5827
|
+
unsubscribe(callback: (arg0: ChatSendAfterEvent) => void): void;
|
|
5828
|
+
}
|
|
5829
|
+
|
|
5830
|
+
/**
|
|
5831
|
+
* @beta
|
|
5832
|
+
* An event that fires as players enter chat messages.
|
|
5833
|
+
*/
|
|
5834
|
+
export class ChatSendBeforeEvent {
|
|
5835
|
+
private constructor();
|
|
5836
|
+
/**
|
|
5837
|
+
* @remarks
|
|
5838
|
+
* If set to true in a beforeChat event handler, this message
|
|
5839
|
+
* is not broadcast out.
|
|
5840
|
+
*
|
|
5841
|
+
*/
|
|
5842
|
+
cancel: boolean;
|
|
5843
|
+
/**
|
|
5844
|
+
* @remarks
|
|
5845
|
+
* Message that is being broadcast.
|
|
5846
|
+
*
|
|
5847
|
+
*/
|
|
5848
|
+
readonly message: string;
|
|
5849
|
+
/**
|
|
5850
|
+
* @remarks
|
|
5851
|
+
* Player that sent the chat message.
|
|
5852
|
+
*
|
|
5853
|
+
*/
|
|
5854
|
+
readonly sender: Player;
|
|
5855
|
+
/**
|
|
5856
|
+
* @remarks
|
|
5857
|
+
* Optional list of players that will receive this message. If
|
|
5858
|
+
* defined, this message is directly targeted to one or more
|
|
5859
|
+
* players (i.e., is not broadcast.)
|
|
5860
|
+
*
|
|
5861
|
+
*/
|
|
5862
|
+
readonly targets?: Player[];
|
|
5863
|
+
}
|
|
5864
|
+
|
|
5865
|
+
/**
|
|
5866
|
+
* @beta
|
|
5867
|
+
* Manages callbacks that are connected to an event that fires
|
|
5868
|
+
* before chat messages are sent.
|
|
5869
|
+
* @example customCommand.ts
|
|
5870
|
+
* ```typescript
|
|
5871
|
+
* import { world, DimensionLocation } from "@minecraft/server";
|
|
5872
|
+
*
|
|
5873
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
5874
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
|
|
5875
|
+
* if (eventData.message.includes("cancel")) {
|
|
5876
|
+
* // Cancel event if the message contains "cancel"
|
|
5877
|
+
* eventData.cancel = true;
|
|
5878
|
+
* } else {
|
|
5879
|
+
* const args = eventData.message.split(" ");
|
|
5880
|
+
*
|
|
5881
|
+
* if (args.length > 0) {
|
|
5882
|
+
* switch (args[0].toLowerCase()) {
|
|
5883
|
+
* case "echo":
|
|
5884
|
+
* // Send a modified version of chat message
|
|
5885
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
5886
|
+
* break;
|
|
5887
|
+
* case "help":
|
|
5888
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
5889
|
+
* break;
|
|
5890
|
+
* }
|
|
5891
|
+
* }
|
|
5892
|
+
* }
|
|
5893
|
+
* });
|
|
5894
|
+
* }
|
|
5895
|
+
* ```
|
|
5896
|
+
*/
|
|
5897
|
+
export class ChatSendBeforeEventSignal {
|
|
5898
|
+
private constructor();
|
|
5899
|
+
/**
|
|
5900
|
+
* @remarks
|
|
5901
|
+
* Adds a callback that will be called before new chat messages
|
|
5902
|
+
* are sent.
|
|
5903
|
+
*
|
|
5904
|
+
* This function can't be called in read-only mode.
|
|
5905
|
+
*
|
|
5906
|
+
* This function can be called in early-execution mode.
|
|
5907
|
+
*
|
|
4808
5908
|
*/
|
|
4809
|
-
|
|
5909
|
+
subscribe(callback: (arg0: ChatSendBeforeEvent) => void): (arg0: ChatSendBeforeEvent) => void;
|
|
4810
5910
|
/**
|
|
4811
5911
|
* @remarks
|
|
5912
|
+
* Removes a callback from being called before new chat
|
|
5913
|
+
* messages are sent.
|
|
5914
|
+
*
|
|
4812
5915
|
* This function can't be called in read-only mode.
|
|
4813
5916
|
*
|
|
4814
|
-
*
|
|
5917
|
+
* This function can be called in early-execution mode.
|
|
5918
|
+
*
|
|
4815
5919
|
*/
|
|
4816
|
-
|
|
5920
|
+
unsubscribe(callback: (arg0: ChatSendBeforeEvent) => void): void;
|
|
4817
5921
|
}
|
|
4818
5922
|
|
|
4819
5923
|
/**
|
|
@@ -4873,6 +5977,258 @@ export class Component {
|
|
|
4873
5977
|
readonly typeId: string;
|
|
4874
5978
|
}
|
|
4875
5979
|
|
|
5980
|
+
/**
|
|
5981
|
+
* @beta
|
|
5982
|
+
* The Compound Block Volume is a collection of individual
|
|
5983
|
+
* block volume definitions which, as a collection, define a
|
|
5984
|
+
* larger volume of (sometimes non-contiguous) irregular
|
|
5985
|
+
* shapes.
|
|
5986
|
+
* This class is loosely based on the concept of CSG
|
|
5987
|
+
* (Computational Solid Geometry) and allows a user to create
|
|
5988
|
+
* complex volumes by building a stack of volumes and voids to
|
|
5989
|
+
* make a larger single volume.
|
|
5990
|
+
* For example - normally a creator would create a hollow cube
|
|
5991
|
+
* by creating 6 "wall" surfaces for each face.
|
|
5992
|
+
* With a Compound Block Volume, a creator can define a hollow
|
|
5993
|
+
* cube by creating a single outer solid cube, and then
|
|
5994
|
+
* defining a further single 'void' cube inside the larger one.
|
|
5995
|
+
* Similarly, the Compound Block Volume can represent irregular
|
|
5996
|
+
* shaped volumes (e.g. a tree consists of a trunk and lots of
|
|
5997
|
+
* leaf cubes which are not necessarily contiguously placed).
|
|
5998
|
+
* Each of the volumes added to the CompoundBlockVolume are (by
|
|
5999
|
+
* default) relative to the origin set (either at construction
|
|
6000
|
+
* or via one of the set functions).
|
|
6001
|
+
* However, it is also possible to push volumes to the compound
|
|
6002
|
+
* collection which are absolute in nature and are not affected
|
|
6003
|
+
* by origin changes.
|
|
6004
|
+
*/
|
|
6005
|
+
export class CompoundBlockVolume {
|
|
6006
|
+
/**
|
|
6007
|
+
* @remarks
|
|
6008
|
+
* Return the 'capacity' of the bounding rectangle which
|
|
6009
|
+
* represents the collection of volumes in the stack
|
|
6010
|
+
*
|
|
6011
|
+
*/
|
|
6012
|
+
readonly capacity: number;
|
|
6013
|
+
readonly items: CompoundBlockVolumeItem[];
|
|
6014
|
+
readonly itemsAbsolute: CompoundBlockVolumeItem[];
|
|
6015
|
+
/**
|
|
6016
|
+
* @remarks
|
|
6017
|
+
* Return the number of volumes (positive and negative) in the
|
|
6018
|
+
* volume stack
|
|
6019
|
+
*
|
|
6020
|
+
*/
|
|
6021
|
+
readonly volumeCount: number;
|
|
6022
|
+
/**
|
|
6023
|
+
* @remarks
|
|
6024
|
+
* Create a CompoundBlockVolume object
|
|
6025
|
+
*
|
|
6026
|
+
* @param origin
|
|
6027
|
+
* An optional world space origin on which to center the
|
|
6028
|
+
* compound volume.
|
|
6029
|
+
* If not specified, the origin is set to (0,0,0)
|
|
6030
|
+
*/
|
|
6031
|
+
constructor(origin?: Vector3);
|
|
6032
|
+
/**
|
|
6033
|
+
* @remarks
|
|
6034
|
+
* Clear the contents of the volume stack
|
|
6035
|
+
*
|
|
6036
|
+
* This function can't be called in read-only mode.
|
|
6037
|
+
*
|
|
6038
|
+
*/
|
|
6039
|
+
clear(): void;
|
|
6040
|
+
/**
|
|
6041
|
+
* @remarks
|
|
6042
|
+
* Fetch a Block Location Iterator for the Compound Block
|
|
6043
|
+
* Volume. This iterator will allow a creator to iterate
|
|
6044
|
+
* across all of the selected volumes within the larger
|
|
6045
|
+
* bounding area.
|
|
6046
|
+
* Areas of a volume which have been overridden by a
|
|
6047
|
+
* subtractive volume will not be included in the iterator
|
|
6048
|
+
* step.
|
|
6049
|
+
* (i.e. if you push a cube to the stack, and then push a
|
|
6050
|
+
* subtractive volume to the same location, then the iterator
|
|
6051
|
+
* will step over the initial volume because it is considered
|
|
6052
|
+
* negative space)
|
|
6053
|
+
* Note that the Block Locations returned by this iterator are
|
|
6054
|
+
* in absolute world space (irrespective of whether the
|
|
6055
|
+
* compound volume items pushed are absolute or relative)
|
|
6056
|
+
*
|
|
6057
|
+
* This function can't be called in read-only mode.
|
|
6058
|
+
*
|
|
6059
|
+
*/
|
|
6060
|
+
getBlockLocationIterator(): BlockLocationIterator;
|
|
6061
|
+
/**
|
|
6062
|
+
* @remarks
|
|
6063
|
+
* Get the largest bounding box that represents a container for
|
|
6064
|
+
* all of the volumes on the stack
|
|
6065
|
+
* Note that the bounding box returned is represented in
|
|
6066
|
+
* absolute world space (irrespective of whether the compound
|
|
6067
|
+
* volume items pushed are absolute or relative)
|
|
6068
|
+
*
|
|
6069
|
+
* This function can't be called in read-only mode.
|
|
6070
|
+
*
|
|
6071
|
+
*/
|
|
6072
|
+
getBoundingBox(): BlockBoundingBox;
|
|
6073
|
+
/**
|
|
6074
|
+
* @remarks
|
|
6075
|
+
* Get the max block location of the outermost bounding
|
|
6076
|
+
* rectangle which represents the volumes on the stack.
|
|
6077
|
+
* Note that the max location returned is in absolute world
|
|
6078
|
+
* space (irrespective of whether the compound volume items
|
|
6079
|
+
* pushed are absolute or relative)
|
|
6080
|
+
*
|
|
6081
|
+
* This function can't be called in read-only mode.
|
|
6082
|
+
*
|
|
6083
|
+
*/
|
|
6084
|
+
getMax(): Vector3;
|
|
6085
|
+
/**
|
|
6086
|
+
* @remarks
|
|
6087
|
+
* Get the min block location of the outermost bounding
|
|
6088
|
+
* rectangle which represents the volumes on the stack.
|
|
6089
|
+
* Note that the min location returned is in absolute world
|
|
6090
|
+
* space (irrespective of whether the compound volume items
|
|
6091
|
+
* pushed are absolute or relative)
|
|
6092
|
+
*
|
|
6093
|
+
* This function can't be called in read-only mode.
|
|
6094
|
+
*
|
|
6095
|
+
*/
|
|
6096
|
+
getMin(): Vector3;
|
|
6097
|
+
/**
|
|
6098
|
+
* @remarks
|
|
6099
|
+
* Fetch the origin in world space of the compound volume
|
|
6100
|
+
*
|
|
6101
|
+
* This function can't be called in read-only mode.
|
|
6102
|
+
*
|
|
6103
|
+
*/
|
|
6104
|
+
getOrigin(): Vector3;
|
|
6105
|
+
/**
|
|
6106
|
+
* @remarks
|
|
6107
|
+
* Return a boolean which signals if there are any volume items
|
|
6108
|
+
* pushed to the volume
|
|
6109
|
+
*
|
|
6110
|
+
* This function can't be called in read-only mode.
|
|
6111
|
+
*
|
|
6112
|
+
*/
|
|
6113
|
+
isEmpty(): boolean;
|
|
6114
|
+
/**
|
|
6115
|
+
* @remarks
|
|
6116
|
+
* Return a boolean representing whether or not a given
|
|
6117
|
+
* absolute world space block location is inside a positive
|
|
6118
|
+
* block volume.
|
|
6119
|
+
* E.g. if the stack contains a large cube followed by a
|
|
6120
|
+
* slightly smaller negative cube, and the test location is
|
|
6121
|
+
* within the negative cube - the function will return false
|
|
6122
|
+
* because it's not 'inside' a volume (it IS inside the
|
|
6123
|
+
* bounding rectangle, but it is not inside a positively
|
|
6124
|
+
* defined location)
|
|
6125
|
+
*
|
|
6126
|
+
* This function can't be called in read-only mode.
|
|
6127
|
+
*
|
|
6128
|
+
*/
|
|
6129
|
+
isInside(worldLocation: Vector3): boolean;
|
|
6130
|
+
/**
|
|
6131
|
+
* @remarks
|
|
6132
|
+
* Inspect the last entry pushed to the volume stack without
|
|
6133
|
+
* affecting the stack contents.
|
|
6134
|
+
*
|
|
6135
|
+
* This function can't be called in read-only mode.
|
|
6136
|
+
*
|
|
6137
|
+
* @param forceRelativity
|
|
6138
|
+
* Determine whether the function returns a
|
|
6139
|
+
* CompoundBlockVolumeItem which is forced into either relative
|
|
6140
|
+
* or absolute coordinate system.
|
|
6141
|
+
* `true` = force returned item to be relative to volume origin
|
|
6142
|
+
* `false` = force returned item to be absolute world space
|
|
6143
|
+
* location
|
|
6144
|
+
*
|
|
6145
|
+
* If no flag is specified, the item returned retains whatever
|
|
6146
|
+
* relativity it had when it was pushed
|
|
6147
|
+
* @returns
|
|
6148
|
+
* Returns undefined if the stack is empty
|
|
6149
|
+
*/
|
|
6150
|
+
peekLastVolume(forceRelativity?: CompoundBlockVolumePositionRelativity): CompoundBlockVolumeItem | undefined;
|
|
6151
|
+
/**
|
|
6152
|
+
* @remarks
|
|
6153
|
+
* Remove the last entry from the volume stack. This will
|
|
6154
|
+
* reduce the stack size by one
|
|
6155
|
+
*
|
|
6156
|
+
* This function can't be called in read-only mode.
|
|
6157
|
+
*
|
|
6158
|
+
*/
|
|
6159
|
+
popVolume(): boolean;
|
|
6160
|
+
/**
|
|
6161
|
+
* @remarks
|
|
6162
|
+
* Push a volume item to the stack. The volume item contains
|
|
6163
|
+
* an 'action' parameter which determines whether this volume
|
|
6164
|
+
* is a positive or negative space.
|
|
6165
|
+
* The item also contains a `locationRelativity` which
|
|
6166
|
+
* determines whether it is relative or absolute to the
|
|
6167
|
+
* compound volume origin
|
|
6168
|
+
*
|
|
6169
|
+
* This function can't be called in read-only mode.
|
|
6170
|
+
*
|
|
6171
|
+
* @param item
|
|
6172
|
+
* Item to push to the end of the stack
|
|
6173
|
+
*/
|
|
6174
|
+
pushVolume(item: CompoundBlockVolumeItem): void;
|
|
6175
|
+
/**
|
|
6176
|
+
* @remarks
|
|
6177
|
+
* If the volume stack is empty, this function will push the
|
|
6178
|
+
* specified item to the stack.
|
|
6179
|
+
* If the volume stack is NOT empty, this function will replace
|
|
6180
|
+
* the last item on the stack with the new item.
|
|
6181
|
+
*
|
|
6182
|
+
* This function can't be called in read-only mode.
|
|
6183
|
+
*
|
|
6184
|
+
* @param item
|
|
6185
|
+
* Item to add or replace
|
|
6186
|
+
*/
|
|
6187
|
+
replaceOrAddLastVolume(item: CompoundBlockVolumeItem): boolean;
|
|
6188
|
+
/**
|
|
6189
|
+
* @remarks
|
|
6190
|
+
* Set the origin of the compound volume to an absolute world
|
|
6191
|
+
* space location
|
|
6192
|
+
*
|
|
6193
|
+
* This function can't be called in read-only mode.
|
|
6194
|
+
*
|
|
6195
|
+
* @param preserveExistingVolumes
|
|
6196
|
+
* This optional boolean flag determines whether the relative
|
|
6197
|
+
* `CompoundBlockVolumeItem`'s are frozen in place, or are
|
|
6198
|
+
* affected by the new origin.
|
|
6199
|
+
* Imagine a scenario where you have a series of relative
|
|
6200
|
+
* locations around an origin which make up a sphere; all of
|
|
6201
|
+
* these locations are in the range of -2 to 2.
|
|
6202
|
+
* Push each of these locations to the compound volume as
|
|
6203
|
+
* relative items.
|
|
6204
|
+
* Now, move the origin and all of the locations representing
|
|
6205
|
+
* the sphere move accordingly.
|
|
6206
|
+
* However, let's say you want to add a 2nd sphere next to the
|
|
6207
|
+
* 1st.
|
|
6208
|
+
* In this case, set the new origin a few locations over, but
|
|
6209
|
+
* 'preserveExistingVolumes' = true.
|
|
6210
|
+
* This will set a new origin, but the existing sphere
|
|
6211
|
+
* locations will remain relative to the original origin.
|
|
6212
|
+
* Now, you can push the relative sphere locations again (this
|
|
6213
|
+
* time they will be relative to the new origin) - resulting in
|
|
6214
|
+
* 2 spheres next to each other.
|
|
6215
|
+
*/
|
|
6216
|
+
setOrigin(position: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6217
|
+
/**
|
|
6218
|
+
* @remarks
|
|
6219
|
+
* Similar to {@link CompoundBlockVolume.setOrigin} - this
|
|
6220
|
+
* function will translate the origin by a given delta to a new
|
|
6221
|
+
* position
|
|
6222
|
+
*
|
|
6223
|
+
* This function can't be called in read-only mode.
|
|
6224
|
+
*
|
|
6225
|
+
* @param preserveExistingVolumes
|
|
6226
|
+
* See the description for the arguments to {@link
|
|
6227
|
+
* CompoundBlockVolume.setOrigin}
|
|
6228
|
+
*/
|
|
6229
|
+
translateOrigin(delta: Vector3, preserveExistingVolumes?: boolean): void;
|
|
6230
|
+
}
|
|
6231
|
+
|
|
4876
6232
|
/**
|
|
4877
6233
|
* Represents a container that can hold sets of items. Used
|
|
4878
6234
|
* with entities such as Players, Chest Minecarts, Llamas, and
|
|
@@ -4955,6 +6311,10 @@ export class Component {
|
|
|
4955
6311
|
*/
|
|
4956
6312
|
export class Container {
|
|
4957
6313
|
private constructor();
|
|
6314
|
+
/**
|
|
6315
|
+
* @beta
|
|
6316
|
+
*/
|
|
6317
|
+
readonly containerRules?: ContainerRules;
|
|
4958
6318
|
/**
|
|
4959
6319
|
* @remarks
|
|
4960
6320
|
* Count of the slots in the container that are empty.
|
|
@@ -4982,6 +6342,16 @@ export class Container {
|
|
|
4982
6342
|
* Throws if the container is invalid.
|
|
4983
6343
|
*/
|
|
4984
6344
|
readonly size: number;
|
|
6345
|
+
/**
|
|
6346
|
+
* @beta
|
|
6347
|
+
* @remarks
|
|
6348
|
+
* The combined weight of all items in the container.
|
|
6349
|
+
*
|
|
6350
|
+
* @throws This property can throw when used.
|
|
6351
|
+
*
|
|
6352
|
+
* {@link InvalidContainerError}
|
|
6353
|
+
*/
|
|
6354
|
+
readonly weight: number;
|
|
4985
6355
|
/**
|
|
4986
6356
|
* @remarks
|
|
4987
6357
|
* Adds an item to the container. The item is placed in the
|
|
@@ -4993,7 +6363,9 @@ export class Container {
|
|
|
4993
6363
|
*
|
|
4994
6364
|
* @param itemStack
|
|
4995
6365
|
* The stack of items to add.
|
|
4996
|
-
* @throws
|
|
6366
|
+
* @throws
|
|
6367
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
6368
|
+
* limit but will instead add items up to the weight limit.
|
|
4997
6369
|
*
|
|
4998
6370
|
* {@link ContainerRulesError}
|
|
4999
6371
|
*
|
|
@@ -5225,6 +6597,8 @@ export class Container {
|
|
|
5225
6597
|
* @throws
|
|
5226
6598
|
* Throws if either this container or `toContainer` are invalid
|
|
5227
6599
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
6600
|
+
* Won't throw {@link ContainerRules} error for over weight
|
|
6601
|
+
* limit but will instead add items up to the weight limit.
|
|
5228
6602
|
*
|
|
5229
6603
|
* {@link ContainerRulesError}
|
|
5230
6604
|
*
|
|
@@ -5579,6 +6953,23 @@ export class ContainerSlot {
|
|
|
5579
6953
|
* {@link InvalidContainerSlotError}
|
|
5580
6954
|
*/
|
|
5581
6955
|
setCanPlaceOn(blockIdentifiers?: string[]): void;
|
|
6956
|
+
/**
|
|
6957
|
+
* @beta
|
|
6958
|
+
* @remarks
|
|
6959
|
+
* Sets multiple dynamic properties with specific values.
|
|
6960
|
+
*
|
|
6961
|
+
* @param values
|
|
6962
|
+
* A Record of key value pairs of the dynamic properties to
|
|
6963
|
+
* set.
|
|
6964
|
+
* @throws This function can throw errors.
|
|
6965
|
+
*
|
|
6966
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
6967
|
+
*
|
|
6968
|
+
* {@link InvalidContainerSlotError}
|
|
6969
|
+
*
|
|
6970
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6971
|
+
*/
|
|
6972
|
+
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
5582
6973
|
/**
|
|
5583
6974
|
* @remarks
|
|
5584
6975
|
* Sets a specified property to a value.
|
|
@@ -5931,10 +7322,52 @@ export class Dimension {
|
|
|
5931
7322
|
* {@link UnloadedChunksError}
|
|
5932
7323
|
*/
|
|
5933
7324
|
fillBlocks(
|
|
5934
|
-
volume: BlockVolumeBase,
|
|
7325
|
+
volume: BlockVolumeBase | CompoundBlockVolume,
|
|
5935
7326
|
block: BlockPermutation | BlockType | string,
|
|
5936
7327
|
options?: BlockFillOptions,
|
|
5937
7328
|
): ListBlockVolume;
|
|
7329
|
+
/**
|
|
7330
|
+
* @beta
|
|
7331
|
+
* @remarks
|
|
7332
|
+
* Finds the location of the closest biome of a particular
|
|
7333
|
+
* type. Note that the findClosestBiome operation can take some
|
|
7334
|
+
* time to complete, so avoid using many of these calls within
|
|
7335
|
+
* a particular tick.
|
|
7336
|
+
*
|
|
7337
|
+
* @param pos
|
|
7338
|
+
* Starting location to look for a biome to find.
|
|
7339
|
+
* @param biomeToFind
|
|
7340
|
+
* Identifier of the biome to look for.
|
|
7341
|
+
* @param options
|
|
7342
|
+
* Additional selection criteria for a biome search.
|
|
7343
|
+
* @returns
|
|
7344
|
+
* Returns a location of the biome, or undefined if a biome
|
|
7345
|
+
* could not be found.
|
|
7346
|
+
* @throws This function can throw errors.
|
|
7347
|
+
*
|
|
7348
|
+
* {@link minecraftcommon.EngineError}
|
|
7349
|
+
*
|
|
7350
|
+
* {@link Error}
|
|
7351
|
+
*/
|
|
7352
|
+
findClosestBiome(pos: Vector3, biomeToFind: BiomeType | string, options?: BiomeSearchOptions): Vector3 | undefined;
|
|
7353
|
+
/**
|
|
7354
|
+
* @beta
|
|
7355
|
+
* @remarks
|
|
7356
|
+
* Returns the biome type at the specified location.
|
|
7357
|
+
*
|
|
7358
|
+
* @param location
|
|
7359
|
+
* Location at which to check the biome.
|
|
7360
|
+
* @throws
|
|
7361
|
+
* An error will be thrown if the location is out of world
|
|
7362
|
+
* bounds.
|
|
7363
|
+
* An error will be thrown if the location is in an unloaded
|
|
7364
|
+
* chunk.
|
|
7365
|
+
*
|
|
7366
|
+
* {@link LocationInUnloadedChunkError}
|
|
7367
|
+
*
|
|
7368
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
7369
|
+
*/
|
|
7370
|
+
getBiome(location: Vector3): BiomeType;
|
|
5938
7371
|
/**
|
|
5939
7372
|
* @remarks
|
|
5940
7373
|
* Returns a block instance at the given location.
|
|
@@ -6137,6 +7570,23 @@ export class Dimension {
|
|
|
6137
7570
|
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
6138
7571
|
*/
|
|
6139
7572
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
7573
|
+
/**
|
|
7574
|
+
* @beta
|
|
7575
|
+
* @remarks
|
|
7576
|
+
* Returns the total brightness level of light shining on a
|
|
7577
|
+
* certain block position.
|
|
7578
|
+
*
|
|
7579
|
+
* @param location
|
|
7580
|
+
* Location of the block we want to check the brightness of.
|
|
7581
|
+
* @returns
|
|
7582
|
+
* The brightness level on the block.
|
|
7583
|
+
* @throws This function can throw errors.
|
|
7584
|
+
*
|
|
7585
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7586
|
+
*
|
|
7587
|
+
* {@link LocationInUnloadedChunkError}
|
|
7588
|
+
*/
|
|
7589
|
+
getLightLevel(location: Vector3): number;
|
|
6140
7590
|
/**
|
|
6141
7591
|
* @remarks
|
|
6142
7592
|
* Returns a set of players based on a set of conditions
|
|
@@ -6154,6 +7604,23 @@ export class Dimension {
|
|
|
6154
7604
|
* {@link minecraftcommon.InvalidArgumentError}
|
|
6155
7605
|
*/
|
|
6156
7606
|
getPlayers(options?: EntityQueryOptions): Player[];
|
|
7607
|
+
/**
|
|
7608
|
+
* @beta
|
|
7609
|
+
* @remarks
|
|
7610
|
+
* Returns the brightness level of light shining from the sky
|
|
7611
|
+
* on a certain block position.
|
|
7612
|
+
*
|
|
7613
|
+
* @param location
|
|
7614
|
+
* Position of the block we want to check the brightness of.
|
|
7615
|
+
* @returns
|
|
7616
|
+
* The brightness level on the block.
|
|
7617
|
+
* @throws This function can throw errors.
|
|
7618
|
+
*
|
|
7619
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7620
|
+
*
|
|
7621
|
+
* {@link LocationInUnloadedChunkError}
|
|
7622
|
+
*/
|
|
7623
|
+
getSkyLightLevel(location: Vector3): number;
|
|
6157
7624
|
/**
|
|
6158
7625
|
* @remarks
|
|
6159
7626
|
* Returns the highest block at the given XZ location.
|
|
@@ -6166,6 +7633,26 @@ export class Dimension {
|
|
|
6166
7633
|
* @throws This function can throw errors.
|
|
6167
7634
|
*/
|
|
6168
7635
|
getTopmostBlock(locationXZ: VectorXZ, minHeight?: number): Block | undefined;
|
|
7636
|
+
/**
|
|
7637
|
+
* @beta
|
|
7638
|
+
* @remarks
|
|
7639
|
+
* Returns the current weather.
|
|
7640
|
+
*
|
|
7641
|
+
* @returns
|
|
7642
|
+
* Returns a WeatherType that explains the broad category of
|
|
7643
|
+
* weather that is currently going on.
|
|
7644
|
+
*/
|
|
7645
|
+
getWeather(): WeatherType;
|
|
7646
|
+
/**
|
|
7647
|
+
* @beta
|
|
7648
|
+
* @remarks
|
|
7649
|
+
* Returns true if the chunk at the given location is loaded
|
|
7650
|
+
* (and valid for use with scripting).
|
|
7651
|
+
*
|
|
7652
|
+
* @param location
|
|
7653
|
+
* Location to check if the chunk is loaded.
|
|
7654
|
+
*/
|
|
7655
|
+
isChunkLoaded(location: Vector3): boolean;
|
|
6169
7656
|
/**
|
|
6170
7657
|
* @remarks
|
|
6171
7658
|
* Places the given feature into the dimension at the specified
|
|
@@ -6399,7 +7886,11 @@ export class Dimension {
|
|
|
6399
7886
|
* }
|
|
6400
7887
|
* ```
|
|
6401
7888
|
*/
|
|
6402
|
-
spawnEntity
|
|
7889
|
+
spawnEntity<T = never>(
|
|
7890
|
+
identifier: EntityIdentifierType<NoInfer<T>>,
|
|
7891
|
+
location: Vector3,
|
|
7892
|
+
options?: SpawnEntityOptions,
|
|
7893
|
+
): Entity;
|
|
6403
7894
|
/**
|
|
6404
7895
|
* @remarks
|
|
6405
7896
|
* Creates a new item stack as an entity at the specified
|
|
@@ -6494,6 +7985,26 @@ export class Dimension {
|
|
|
6494
7985
|
* ```
|
|
6495
7986
|
*/
|
|
6496
7987
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
7988
|
+
/**
|
|
7989
|
+
* @beta
|
|
7990
|
+
* @remarks
|
|
7991
|
+
* Stops all sounds from playing for all players.
|
|
7992
|
+
*
|
|
7993
|
+
* This function can't be called in read-only mode.
|
|
7994
|
+
*
|
|
7995
|
+
*/
|
|
7996
|
+
stopAllSounds(): void;
|
|
7997
|
+
/**
|
|
7998
|
+
* @beta
|
|
7999
|
+
* @remarks
|
|
8000
|
+
* Stops a sound from playing for all players.
|
|
8001
|
+
*
|
|
8002
|
+
* This function can't be called in read-only mode.
|
|
8003
|
+
*
|
|
8004
|
+
* @param soundId
|
|
8005
|
+
* Identifier of the sound.
|
|
8006
|
+
*/
|
|
8007
|
+
stopSound(soundId: string): void;
|
|
6497
8008
|
}
|
|
6498
8009
|
|
|
6499
8010
|
/**
|
|
@@ -6742,6 +8253,16 @@ export class EffectTypes {
|
|
|
6742
8253
|
static getAll(): EffectType[];
|
|
6743
8254
|
}
|
|
6744
8255
|
|
|
8256
|
+
/**
|
|
8257
|
+
* @beta
|
|
8258
|
+
* Represents a completely empty entry in a loot pool. If this
|
|
8259
|
+
* entry is chosen, no items will drop.
|
|
8260
|
+
*/
|
|
8261
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
8262
|
+
export class EmptyLootItem extends LootPoolEntry {
|
|
8263
|
+
private constructor();
|
|
8264
|
+
}
|
|
8265
|
+
|
|
6745
8266
|
/**
|
|
6746
8267
|
* Contains information on a type of enchantment.
|
|
6747
8268
|
*/
|
|
@@ -6941,6 +8462,18 @@ export class Entity {
|
|
|
6941
8462
|
*
|
|
6942
8463
|
*/
|
|
6943
8464
|
readonly scoreboardIdentity?: ScoreboardIdentity;
|
|
8465
|
+
/**
|
|
8466
|
+
* @beta
|
|
8467
|
+
* @remarks
|
|
8468
|
+
* Retrieves or sets an entity that is used as the target of
|
|
8469
|
+
* AI-related behaviors, like attacking. If the entity
|
|
8470
|
+
* currently has no target returns undefined.
|
|
8471
|
+
*
|
|
8472
|
+
* @throws This property can throw when used.
|
|
8473
|
+
*
|
|
8474
|
+
* {@link InvalidEntityError}
|
|
8475
|
+
*/
|
|
8476
|
+
readonly target?: Entity;
|
|
6944
8477
|
/**
|
|
6945
8478
|
* @remarks
|
|
6946
8479
|
* Identifier of the type of the entity - for example,
|
|
@@ -7250,6 +8783,23 @@ export class Entity {
|
|
|
7250
8783
|
* ```
|
|
7251
8784
|
*/
|
|
7252
8785
|
extinguishFire(useEffects?: boolean): boolean;
|
|
8786
|
+
/**
|
|
8787
|
+
* @beta
|
|
8788
|
+
* @remarks
|
|
8789
|
+
* Gets the solid blocks that this entity is directly standing
|
|
8790
|
+
* on. Ignores pressure plates.
|
|
8791
|
+
*
|
|
8792
|
+
* @param options
|
|
8793
|
+
* Additional configuration options for what blocks are
|
|
8794
|
+
* returned.
|
|
8795
|
+
* @returns
|
|
8796
|
+
* The solid blocks that this entity is directly standing on.
|
|
8797
|
+
* Returns an empty list if the entity is jumping or flying.
|
|
8798
|
+
* @throws This function can throw errors.
|
|
8799
|
+
*
|
|
8800
|
+
* {@link InvalidEntityError}
|
|
8801
|
+
*/
|
|
8802
|
+
getAllBlocksStandingOn(options?: GetBlocksStandingOnOptions): Block[];
|
|
7253
8803
|
/**
|
|
7254
8804
|
* @remarks
|
|
7255
8805
|
* Returns the first intersecting block from the direction that
|
|
@@ -7265,6 +8815,24 @@ export class Entity {
|
|
|
7265
8815
|
* {@link InvalidEntityError}
|
|
7266
8816
|
*/
|
|
7267
8817
|
getBlockFromViewDirection(options?: BlockRaycastOptions): BlockRaycastHit | undefined;
|
|
8818
|
+
/**
|
|
8819
|
+
* @beta
|
|
8820
|
+
* @remarks
|
|
8821
|
+
* Gets a single solid block closest to the center of the
|
|
8822
|
+
* entity that this entity is directly standing on. Ignores
|
|
8823
|
+
* pressure plates.
|
|
8824
|
+
*
|
|
8825
|
+
* @param options
|
|
8826
|
+
* Additional configuration options for what block is returned.
|
|
8827
|
+
* @returns
|
|
8828
|
+
* A single solid block closest to the center of the entity
|
|
8829
|
+
* that this entity is directly standing on. Undefined if
|
|
8830
|
+
* entity is flying or jumping.
|
|
8831
|
+
* @throws This function can throw errors.
|
|
8832
|
+
*
|
|
8833
|
+
* {@link InvalidEntityError}
|
|
8834
|
+
*/
|
|
8835
|
+
getBlockStandingOn(options?: GetBlocksStandingOnOptions): Block | undefined;
|
|
7268
8836
|
/**
|
|
7269
8837
|
* @remarks
|
|
7270
8838
|
* Gets a component (that represents additional capabilities)
|
|
@@ -7693,11 +9261,26 @@ export class Entity {
|
|
|
7693
9261
|
* successful.
|
|
7694
9262
|
* @throws This function can throw errors.
|
|
7695
9263
|
*
|
|
7696
|
-
* {@link CommandError}
|
|
9264
|
+
* {@link CommandError}
|
|
9265
|
+
*
|
|
9266
|
+
* {@link InvalidEntityError}
|
|
9267
|
+
*/
|
|
9268
|
+
runCommand(commandString: string): CommandResult;
|
|
9269
|
+
/**
|
|
9270
|
+
* @beta
|
|
9271
|
+
* @remarks
|
|
9272
|
+
* Sets multiple dynamic properties with specific values.
|
|
9273
|
+
*
|
|
9274
|
+
* @param values
|
|
9275
|
+
* A Record of key value pairs of the dynamic properties to
|
|
9276
|
+
* set.
|
|
9277
|
+
* @throws This function can throw errors.
|
|
9278
|
+
*
|
|
9279
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
7697
9280
|
*
|
|
7698
9281
|
* {@link InvalidEntityError}
|
|
7699
9282
|
*/
|
|
7700
|
-
|
|
9283
|
+
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
7701
9284
|
/**
|
|
7702
9285
|
* @remarks
|
|
7703
9286
|
* Sets a specified property to a value.
|
|
@@ -8111,6 +9694,18 @@ export class EntityBaseMovementComponent extends EntityComponent {
|
|
|
8111
9694
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
8112
9695
|
export class EntityBreathableComponent extends EntityComponent {
|
|
8113
9696
|
private constructor();
|
|
9697
|
+
/**
|
|
9698
|
+
* @beta
|
|
9699
|
+
* @remarks
|
|
9700
|
+
* The current air supply of the entity.
|
|
9701
|
+
*
|
|
9702
|
+
* This property can't be edited in read-only mode.
|
|
9703
|
+
*
|
|
9704
|
+
* @throws
|
|
9705
|
+
* Will throw an error if the air supply is out of bounds
|
|
9706
|
+
* [suffocationTime, maxAirSupply].
|
|
9707
|
+
*/
|
|
9708
|
+
airSupply: number;
|
|
8114
9709
|
/**
|
|
8115
9710
|
* @remarks
|
|
8116
9711
|
* If true, this entity can breathe in air.
|
|
@@ -8139,6 +9734,14 @@ export class EntityBreathableComponent extends EntityComponent {
|
|
|
8139
9734
|
* @throws This property can throw when used.
|
|
8140
9735
|
*/
|
|
8141
9736
|
readonly breathesWater: boolean;
|
|
9737
|
+
/**
|
|
9738
|
+
* @beta
|
|
9739
|
+
* @remarks
|
|
9740
|
+
* If true, the entity is able to breathe.
|
|
9741
|
+
*
|
|
9742
|
+
* @throws This property can throw when used.
|
|
9743
|
+
*/
|
|
9744
|
+
readonly canBreathe: boolean;
|
|
8142
9745
|
/**
|
|
8143
9746
|
* @remarks
|
|
8144
9747
|
* If true, this entity will have visible bubbles while in
|
|
@@ -9541,6 +11144,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
|
|
|
9541
11144
|
static readonly componentId = 'minecraft:navigation.walk';
|
|
9542
11145
|
}
|
|
9543
11146
|
|
|
11147
|
+
/**
|
|
11148
|
+
* @beta
|
|
11149
|
+
* Adds NPC capabilities to an entity such as custom skin,
|
|
11150
|
+
* name, and dialogue interactions.
|
|
11151
|
+
*/
|
|
11152
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
11153
|
+
export class EntityNpcComponent extends EntityComponent {
|
|
11154
|
+
private constructor();
|
|
11155
|
+
/**
|
|
11156
|
+
* @remarks
|
|
11157
|
+
* The DialogueScene that is opened when players first interact
|
|
11158
|
+
* with the NPC.
|
|
11159
|
+
*
|
|
11160
|
+
* This property can't be edited in read-only mode.
|
|
11161
|
+
*
|
|
11162
|
+
*/
|
|
11163
|
+
defaultScene: string;
|
|
11164
|
+
/**
|
|
11165
|
+
* @remarks
|
|
11166
|
+
* The name of the NPC as it is displayed to players.
|
|
11167
|
+
*
|
|
11168
|
+
* This property can't be edited in read-only mode.
|
|
11169
|
+
*
|
|
11170
|
+
*/
|
|
11171
|
+
name: string;
|
|
11172
|
+
/**
|
|
11173
|
+
* @remarks
|
|
11174
|
+
* The index of the skin the NPC will use.
|
|
11175
|
+
*
|
|
11176
|
+
* This property can't be edited in read-only mode.
|
|
11177
|
+
*
|
|
11178
|
+
*/
|
|
11179
|
+
skinIndex: number;
|
|
11180
|
+
static readonly componentId = 'minecraft:npc';
|
|
11181
|
+
}
|
|
11182
|
+
|
|
9544
11183
|
/**
|
|
9545
11184
|
* When present on an entity, this entity is on fire.
|
|
9546
11185
|
* @example setOnFire.ts
|
|
@@ -10407,7 +12046,7 @@ export class EntityTypes {
|
|
|
10407
12046
|
* Retrieves an entity type using a string-based identifier.
|
|
10408
12047
|
*
|
|
10409
12048
|
*/
|
|
10410
|
-
static get(identifier:
|
|
12049
|
+
static get<T = never>(identifier: EntityIdentifierType<NoInfer<T>>): EntityType | undefined;
|
|
10411
12050
|
/**
|
|
10412
12051
|
* @remarks
|
|
10413
12052
|
* Retrieves a set of all entity types within this world.
|
|
@@ -10818,6 +12457,13 @@ export class GameRules {
|
|
|
10818
12457
|
*
|
|
10819
12458
|
*/
|
|
10820
12459
|
keepInventory: boolean;
|
|
12460
|
+
/**
|
|
12461
|
+
* @beta
|
|
12462
|
+
* @remarks
|
|
12463
|
+
* This property can't be edited in read-only mode.
|
|
12464
|
+
*
|
|
12465
|
+
*/
|
|
12466
|
+
locatorBar: boolean;
|
|
10821
12467
|
/**
|
|
10822
12468
|
* @remarks
|
|
10823
12469
|
* This property can't be edited in read-only mode.
|
|
@@ -11873,6 +13519,56 @@ export class ItemFoodComponent extends ItemComponent {
|
|
|
11873
13519
|
static readonly componentId = 'minecraft:food';
|
|
11874
13520
|
}
|
|
11875
13521
|
|
|
13522
|
+
/**
|
|
13523
|
+
* @beta
|
|
13524
|
+
* This component is added to items with the `Storage Item`
|
|
13525
|
+
* component. Can access and modify this items inventory
|
|
13526
|
+
* container.
|
|
13527
|
+
*/
|
|
13528
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13529
|
+
export class ItemInventoryComponent extends ItemComponent {
|
|
13530
|
+
private constructor();
|
|
13531
|
+
/**
|
|
13532
|
+
* @throws This property can throw when used.
|
|
13533
|
+
*
|
|
13534
|
+
* {@link InvalidContainerError}
|
|
13535
|
+
*/
|
|
13536
|
+
readonly container: Container;
|
|
13537
|
+
static readonly componentId = 'minecraft:inventory';
|
|
13538
|
+
}
|
|
13539
|
+
|
|
13540
|
+
/**
|
|
13541
|
+
* @beta
|
|
13542
|
+
* When present on an item, this item is a potion item.
|
|
13543
|
+
*/
|
|
13544
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13545
|
+
export class ItemPotionComponent extends ItemComponent {
|
|
13546
|
+
private constructor();
|
|
13547
|
+
/**
|
|
13548
|
+
* @remarks
|
|
13549
|
+
* The PotionDeliveryType associated with the potion item.
|
|
13550
|
+
*
|
|
13551
|
+
* @throws This property can throw when used.
|
|
13552
|
+
*
|
|
13553
|
+
* {@link minecraftcommon.EngineError}
|
|
13554
|
+
*
|
|
13555
|
+
* {@link Error}
|
|
13556
|
+
*/
|
|
13557
|
+
readonly potionDeliveryType: PotionDeliveryType;
|
|
13558
|
+
/**
|
|
13559
|
+
* @remarks
|
|
13560
|
+
* The PotionEffectType associated with the potion item.
|
|
13561
|
+
*
|
|
13562
|
+
* @throws This property can throw when used.
|
|
13563
|
+
*
|
|
13564
|
+
* {@link minecraftcommon.EngineError}
|
|
13565
|
+
*
|
|
13566
|
+
* {@link Error}
|
|
13567
|
+
*/
|
|
13568
|
+
readonly potionEffectType: PotionEffectType;
|
|
13569
|
+
static readonly componentId = 'minecraft:potion';
|
|
13570
|
+
}
|
|
13571
|
+
|
|
11876
13572
|
/**
|
|
11877
13573
|
* Contains information related to a chargeable item when the
|
|
11878
13574
|
* player has finished using the item and released the build
|
|
@@ -12086,6 +13782,16 @@ export class ItemStack {
|
|
|
12086
13782
|
*
|
|
12087
13783
|
*/
|
|
12088
13784
|
readonly typeId: string;
|
|
13785
|
+
/**
|
|
13786
|
+
* @beta
|
|
13787
|
+
* @remarks
|
|
13788
|
+
* The total weight of all items in the stack plus the weight
|
|
13789
|
+
* of all items in the items container which is defined with
|
|
13790
|
+
* the `Storage Item` component. The weight per item can be
|
|
13791
|
+
* modified by the `Storage Weight Modifier` component.
|
|
13792
|
+
*
|
|
13793
|
+
*/
|
|
13794
|
+
readonly weight: number;
|
|
12089
13795
|
/**
|
|
12090
13796
|
* @remarks
|
|
12091
13797
|
* Creates a new instance of a stack of items for use in the
|
|
@@ -12369,6 +14075,21 @@ export class ItemStack {
|
|
|
12369
14075
|
* ```
|
|
12370
14076
|
*/
|
|
12371
14077
|
setCanPlaceOn(blockIdentifiers?: string[]): void;
|
|
14078
|
+
/**
|
|
14079
|
+
* @beta
|
|
14080
|
+
* @remarks
|
|
14081
|
+
* Sets multiple dynamic properties with specific values.
|
|
14082
|
+
*
|
|
14083
|
+
* @param values
|
|
14084
|
+
* A Record of key value pairs of the dynamic properties to
|
|
14085
|
+
* set.
|
|
14086
|
+
* @throws This function can throw errors.
|
|
14087
|
+
*
|
|
14088
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
14089
|
+
*
|
|
14090
|
+
* {@link minecraftcommon.UnsupportedFunctionalityError}
|
|
14091
|
+
*/
|
|
14092
|
+
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
12372
14093
|
/**
|
|
12373
14094
|
* @remarks
|
|
12374
14095
|
* Sets a specified property to a value. Note: This function
|
|
@@ -12982,6 +14703,166 @@ export class ListBlockVolume extends BlockVolumeBase {
|
|
|
12982
14703
|
remove(locations: Vector3[]): void;
|
|
12983
14704
|
}
|
|
12984
14705
|
|
|
14706
|
+
/**
|
|
14707
|
+
* @beta
|
|
14708
|
+
* Represents a loot pool entry containing an item to drop.
|
|
14709
|
+
*/
|
|
14710
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14711
|
+
export class LootItem extends LootPoolEntry {
|
|
14712
|
+
private constructor();
|
|
14713
|
+
/**
|
|
14714
|
+
* @remarks
|
|
14715
|
+
* The name of the item contained in this entry.
|
|
14716
|
+
*
|
|
14717
|
+
*/
|
|
14718
|
+
readonly name?: ItemType;
|
|
14719
|
+
}
|
|
14720
|
+
|
|
14721
|
+
/**
|
|
14722
|
+
* @beta
|
|
14723
|
+
* A collection of entries which individually determine loot
|
|
14724
|
+
* drops. Can contain values determining drop outcomes,
|
|
14725
|
+
* including rolls, bonus rolls and tiers.
|
|
14726
|
+
*/
|
|
14727
|
+
export class LootPool {
|
|
14728
|
+
private constructor();
|
|
14729
|
+
/**
|
|
14730
|
+
* @remarks
|
|
14731
|
+
* Returns the number of extra times a loot pool will be rolled
|
|
14732
|
+
* based on the player's luck level, represented as a range
|
|
14733
|
+
* from minimum to maximum rolls.
|
|
14734
|
+
*
|
|
14735
|
+
*/
|
|
14736
|
+
readonly bonusRolls: minecraftcommon.NumberRange;
|
|
14737
|
+
/**
|
|
14738
|
+
* @remarks
|
|
14739
|
+
* Gets a complete list of all loot pool entries contained in
|
|
14740
|
+
* the loot pool.
|
|
14741
|
+
*
|
|
14742
|
+
*/
|
|
14743
|
+
readonly entries: LootPoolEntry[];
|
|
14744
|
+
/**
|
|
14745
|
+
* @remarks
|
|
14746
|
+
* Returns the number of times a loot pool will be rolled,
|
|
14747
|
+
* represented as a range from minimum to maximum rolls.
|
|
14748
|
+
*
|
|
14749
|
+
*/
|
|
14750
|
+
readonly rolls: minecraftcommon.NumberRange;
|
|
14751
|
+
/**
|
|
14752
|
+
* @remarks
|
|
14753
|
+
* Gets the loot pool tier values for a given table if they
|
|
14754
|
+
* exist.
|
|
14755
|
+
*
|
|
14756
|
+
*/
|
|
14757
|
+
readonly tiers?: LootPoolTiers;
|
|
14758
|
+
}
|
|
14759
|
+
|
|
14760
|
+
/**
|
|
14761
|
+
* @beta
|
|
14762
|
+
* Represents one entry within Loot Table, which describes one
|
|
14763
|
+
* possible drop when a loot drop occurs. Can contain an item,
|
|
14764
|
+
* another loot table, a path to another loot table, or an
|
|
14765
|
+
* empty drop.
|
|
14766
|
+
*/
|
|
14767
|
+
export class LootPoolEntry {
|
|
14768
|
+
private constructor();
|
|
14769
|
+
/**
|
|
14770
|
+
* @remarks
|
|
14771
|
+
* Gets the quality of a given loot pool entry.
|
|
14772
|
+
*
|
|
14773
|
+
*/
|
|
14774
|
+
readonly quality: number;
|
|
14775
|
+
/**
|
|
14776
|
+
* @remarks
|
|
14777
|
+
* Gets the subtable of a given loot pool entry.
|
|
14778
|
+
*
|
|
14779
|
+
*/
|
|
14780
|
+
readonly subTable?: LootPoolEntry;
|
|
14781
|
+
/**
|
|
14782
|
+
* @remarks
|
|
14783
|
+
* Gets the weight of a given loot pool entry.
|
|
14784
|
+
*
|
|
14785
|
+
*/
|
|
14786
|
+
readonly weight: number;
|
|
14787
|
+
}
|
|
14788
|
+
|
|
14789
|
+
/**
|
|
14790
|
+
* @beta
|
|
14791
|
+
* Represents the values which determine loot drops in a tiered
|
|
14792
|
+
* loot pool. Potential drops from tiered loot pools are
|
|
14793
|
+
* ordered, and chosen via logic controlled by the values in
|
|
14794
|
+
* this object.
|
|
14795
|
+
*/
|
|
14796
|
+
export class LootPoolTiers {
|
|
14797
|
+
private constructor();
|
|
14798
|
+
/**
|
|
14799
|
+
* @remarks
|
|
14800
|
+
* The chance for each bonus roll attempt to upgrade the tier
|
|
14801
|
+
* of the dropped item.
|
|
14802
|
+
*
|
|
14803
|
+
*/
|
|
14804
|
+
readonly bonusChance: number;
|
|
14805
|
+
/**
|
|
14806
|
+
* @remarks
|
|
14807
|
+
* The number of attempts for the loot drop to upgrade its
|
|
14808
|
+
* tier, thereby incrementing its position in the loot pool
|
|
14809
|
+
* entry array, resulting in a higher tier drop.
|
|
14810
|
+
*
|
|
14811
|
+
*/
|
|
14812
|
+
readonly bonusRolls: number;
|
|
14813
|
+
/**
|
|
14814
|
+
* @remarks
|
|
14815
|
+
* Represents the upper bound for the starting point in
|
|
14816
|
+
* determining which tier of loot to drop. The lower bound is
|
|
14817
|
+
* always 1. For example, a value of 3 would result in the tier
|
|
14818
|
+
* drop logic starting at a randomly selected position in the
|
|
14819
|
+
* loot pool entry array between 1 and 3.
|
|
14820
|
+
*
|
|
14821
|
+
*/
|
|
14822
|
+
readonly initialRange: number;
|
|
14823
|
+
}
|
|
14824
|
+
|
|
14825
|
+
/**
|
|
14826
|
+
* @beta
|
|
14827
|
+
* Represents a single Loot Table, which determines what items
|
|
14828
|
+
* are generated when killing a mob, breaking a block, filling
|
|
14829
|
+
* a container, and more.
|
|
14830
|
+
*/
|
|
14831
|
+
export class LootTable {
|
|
14832
|
+
private constructor();
|
|
14833
|
+
/**
|
|
14834
|
+
* @remarks
|
|
14835
|
+
* Returns the path to the JSON file that represents this loot
|
|
14836
|
+
* table. Does not include file extension, or 'loot_tables/'
|
|
14837
|
+
* folder prefix. Example: `entities/creeper`.
|
|
14838
|
+
*
|
|
14839
|
+
*/
|
|
14840
|
+
readonly path: string;
|
|
14841
|
+
/**
|
|
14842
|
+
* @remarks
|
|
14843
|
+
* Returns the array of loot pools on a given loot table.
|
|
14844
|
+
*
|
|
14845
|
+
*/
|
|
14846
|
+
readonly pools: LootPool[];
|
|
14847
|
+
}
|
|
14848
|
+
|
|
14849
|
+
/**
|
|
14850
|
+
* @beta
|
|
14851
|
+
* Represents a loot pool entry containing another separate,
|
|
14852
|
+
* nested loot table.
|
|
14853
|
+
*/
|
|
14854
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14855
|
+
export class LootTableEntry extends LootPoolEntry {
|
|
14856
|
+
private constructor();
|
|
14857
|
+
/**
|
|
14858
|
+
* @remarks
|
|
14859
|
+
* Gets the loot table stored as a subtable in the parent loot
|
|
14860
|
+
* pool.
|
|
14861
|
+
*
|
|
14862
|
+
*/
|
|
14863
|
+
readonly lootTable: LootTable;
|
|
14864
|
+
}
|
|
14865
|
+
|
|
12985
14866
|
/**
|
|
12986
14867
|
* Manager for Loot Table related APIs. Allows for generation
|
|
12987
14868
|
* of drops from blocks and entities according to their loot
|
|
@@ -13065,6 +14946,78 @@ export class LootTableManager {
|
|
|
13065
14946
|
* Can be empty if no loot dropped.
|
|
13066
14947
|
*/
|
|
13067
14948
|
generateLootFromEntityType(entityType: EntityType, tool?: ItemStack): ItemStack[] | undefined;
|
|
14949
|
+
/**
|
|
14950
|
+
* @beta
|
|
14951
|
+
* @remarks
|
|
14952
|
+
* Generates loot from a given LootTable.
|
|
14953
|
+
*
|
|
14954
|
+
* @param tool
|
|
14955
|
+
* Optional. The tool to use in the looting operation.
|
|
14956
|
+
* @returns
|
|
14957
|
+
* An array of item stacks dropped from the loot drop event.
|
|
14958
|
+
* Can be empty if no loot dropped, or undefined if the
|
|
14959
|
+
* provided tool is insufficient to mine the block.
|
|
14960
|
+
*/
|
|
14961
|
+
generateLootFromTable(lootTable: LootTable, tool?: ItemStack): ItemStack[] | undefined;
|
|
14962
|
+
/**
|
|
14963
|
+
* @beta
|
|
14964
|
+
* @remarks
|
|
14965
|
+
* Retrieves a single loot table from the level's current
|
|
14966
|
+
* registry.
|
|
14967
|
+
*
|
|
14968
|
+
* @param path
|
|
14969
|
+
* Path to the table to retrieve. Does not include file
|
|
14970
|
+
* extension, or 'loot_tables/' folder prefix. Example:
|
|
14971
|
+
* `entities/creeper`.
|
|
14972
|
+
* @returns
|
|
14973
|
+
* Returns a LootTable if one is found, or `undefined` if the
|
|
14974
|
+
* provided path does not correspond to an existing loot table.
|
|
14975
|
+
*/
|
|
14976
|
+
getLootTable(path: string): LootTable | undefined;
|
|
14977
|
+
}
|
|
14978
|
+
|
|
14979
|
+
/**
|
|
14980
|
+
* @beta
|
|
14981
|
+
* Represents a loot pool entry containing a reference to
|
|
14982
|
+
* another loot table, described by its path.
|
|
14983
|
+
*/
|
|
14984
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
14985
|
+
export class LootTableReference extends LootPoolEntry {
|
|
14986
|
+
private constructor();
|
|
14987
|
+
/**
|
|
14988
|
+
* @remarks
|
|
14989
|
+
* The path to the referenced loot table. Example:
|
|
14990
|
+
* `loot_tables/chests/village/village_bundle.json`
|
|
14991
|
+
*
|
|
14992
|
+
*/
|
|
14993
|
+
readonly path: string;
|
|
14994
|
+
}
|
|
14995
|
+
|
|
14996
|
+
/**
|
|
14997
|
+
* @beta
|
|
14998
|
+
* A specific currently-internal event used for passing
|
|
14999
|
+
* messages from client to server.
|
|
15000
|
+
*/
|
|
15001
|
+
export class MessageReceiveAfterEvent {
|
|
15002
|
+
private constructor();
|
|
15003
|
+
/**
|
|
15004
|
+
* @remarks
|
|
15005
|
+
* The message identifier.
|
|
15006
|
+
*
|
|
15007
|
+
*/
|
|
15008
|
+
readonly id: string;
|
|
15009
|
+
/**
|
|
15010
|
+
* @remarks
|
|
15011
|
+
* The message.
|
|
15012
|
+
*
|
|
15013
|
+
*/
|
|
15014
|
+
readonly message: string;
|
|
15015
|
+
/**
|
|
15016
|
+
* @remarks
|
|
15017
|
+
* The player who sent the message.
|
|
15018
|
+
*
|
|
15019
|
+
*/
|
|
15020
|
+
readonly player: Player;
|
|
13068
15021
|
}
|
|
13069
15022
|
|
|
13070
15023
|
/**
|
|
@@ -13130,9 +15083,52 @@ export class MolangVariableMap {
|
|
|
13130
15083
|
* - `<variable_name>.z` - Z value from the {@link Vector3}
|
|
13131
15084
|
* provided
|
|
13132
15085
|
*
|
|
13133
|
-
* @throws This function can throw errors.
|
|
15086
|
+
* @throws This function can throw errors.
|
|
15087
|
+
*/
|
|
15088
|
+
setVector3(variableName: string, vector: Vector3): void;
|
|
15089
|
+
}
|
|
15090
|
+
|
|
15091
|
+
/**
|
|
15092
|
+
* @beta
|
|
15093
|
+
* Pack setting name and value that changed.
|
|
15094
|
+
*/
|
|
15095
|
+
export class PackSettingChangeAfterEvent {
|
|
15096
|
+
private constructor();
|
|
15097
|
+
/**
|
|
15098
|
+
* @remarks
|
|
15099
|
+
* The name of the setting.
|
|
15100
|
+
*
|
|
15101
|
+
*/
|
|
15102
|
+
readonly settingName: string;
|
|
15103
|
+
/**
|
|
15104
|
+
* @remarks
|
|
15105
|
+
* The value of the setting.
|
|
15106
|
+
*
|
|
15107
|
+
*/
|
|
15108
|
+
readonly settingValue: boolean | number | string;
|
|
15109
|
+
}
|
|
15110
|
+
|
|
15111
|
+
/**
|
|
15112
|
+
* @beta
|
|
15113
|
+
*/
|
|
15114
|
+
export class PackSettingChangeAfterEventSignal {
|
|
15115
|
+
private constructor();
|
|
15116
|
+
/**
|
|
15117
|
+
* @remarks
|
|
15118
|
+
* This function can't be called in read-only mode.
|
|
15119
|
+
*
|
|
15120
|
+
* This function can be called in early-execution mode.
|
|
15121
|
+
*
|
|
13134
15122
|
*/
|
|
13135
|
-
|
|
15123
|
+
subscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): (arg0: PackSettingChangeAfterEvent) => void;
|
|
15124
|
+
/**
|
|
15125
|
+
* @remarks
|
|
15126
|
+
* This function can't be called in read-only mode.
|
|
15127
|
+
*
|
|
15128
|
+
* This function can be called in early-execution mode.
|
|
15129
|
+
*
|
|
15130
|
+
*/
|
|
15131
|
+
unsubscribe(callback: (arg0: PackSettingChangeAfterEvent) => void): void;
|
|
13136
15132
|
}
|
|
13137
15133
|
|
|
13138
15134
|
/**
|
|
@@ -13433,6 +15429,27 @@ export class Player extends Entity {
|
|
|
13433
15429
|
* Throws if the entity is invalid.
|
|
13434
15430
|
*/
|
|
13435
15431
|
clearPropertyOverridesForEntity(targetEntity: Entity): void;
|
|
15432
|
+
/**
|
|
15433
|
+
* @beta
|
|
15434
|
+
* @remarks
|
|
15435
|
+
* Eats an item, providing the item's hunger and saturation
|
|
15436
|
+
* effects to the player. Can only be used on food items.
|
|
15437
|
+
*
|
|
15438
|
+
* This function can't be called in read-only mode.
|
|
15439
|
+
*
|
|
15440
|
+
* @param itemStack
|
|
15441
|
+
* The item to eat.
|
|
15442
|
+
* @throws
|
|
15443
|
+
* Throws if the item is not a food item.
|
|
15444
|
+
*/
|
|
15445
|
+
eatItem(itemStack: ItemStack): void;
|
|
15446
|
+
/**
|
|
15447
|
+
* @beta
|
|
15448
|
+
* @remarks
|
|
15449
|
+
* The player's aim-assist settings.
|
|
15450
|
+
*
|
|
15451
|
+
*/
|
|
15452
|
+
getAimAssist(): PlayerAimAssist;
|
|
13436
15453
|
/**
|
|
13437
15454
|
* @remarks
|
|
13438
15455
|
* Retrieves the active gamemode for this player, if specified.
|
|
@@ -13518,6 +15535,17 @@ export class Player extends Entity {
|
|
|
13518
15535
|
* ```
|
|
13519
15536
|
*/
|
|
13520
15537
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
|
|
15538
|
+
/**
|
|
15539
|
+
* @beta
|
|
15540
|
+
* @remarks
|
|
15541
|
+
* This is an internal-facing method for posting a system
|
|
15542
|
+
* message to downstream clients.
|
|
15543
|
+
*
|
|
15544
|
+
* This function can't be called in read-only mode.
|
|
15545
|
+
*
|
|
15546
|
+
* @throws This function can throw errors.
|
|
15547
|
+
*/
|
|
15548
|
+
postClientMessage(id: string, value: string): void;
|
|
13521
15549
|
/**
|
|
13522
15550
|
* @remarks
|
|
13523
15551
|
* Queues an additional music track that only this particular
|
|
@@ -13768,6 +15796,18 @@ export class Player extends Entity {
|
|
|
13768
15796
|
* @throws This function can throw errors.
|
|
13769
15797
|
*/
|
|
13770
15798
|
startItemCooldown(cooldownCategory: string, tickDuration: number): void;
|
|
15799
|
+
/**
|
|
15800
|
+
* @beta
|
|
15801
|
+
* @remarks
|
|
15802
|
+
* Stops all sounds from playing for this particular player.
|
|
15803
|
+
*
|
|
15804
|
+
* This function can't be called in read-only mode.
|
|
15805
|
+
*
|
|
15806
|
+
* @throws This function can throw errors.
|
|
15807
|
+
*
|
|
15808
|
+
* {@link InvalidEntityError}
|
|
15809
|
+
*/
|
|
15810
|
+
stopAllSounds(): void;
|
|
13771
15811
|
/**
|
|
13772
15812
|
* @remarks
|
|
13773
15813
|
* Stops any music tracks from playing for this particular
|
|
@@ -13778,6 +15818,59 @@ export class Player extends Entity {
|
|
|
13778
15818
|
* @throws This function can throw errors.
|
|
13779
15819
|
*/
|
|
13780
15820
|
stopMusic(): void;
|
|
15821
|
+
/**
|
|
15822
|
+
* @beta
|
|
15823
|
+
* @remarks
|
|
15824
|
+
* Stops a sound from playing for this particular player.
|
|
15825
|
+
*
|
|
15826
|
+
* This function can't be called in read-only mode.
|
|
15827
|
+
*
|
|
15828
|
+
* @param soundId
|
|
15829
|
+
* Identifier of the sound.
|
|
15830
|
+
* @throws This function can throw errors.
|
|
15831
|
+
*
|
|
15832
|
+
* {@link InvalidEntityError}
|
|
15833
|
+
*/
|
|
15834
|
+
stopSound(soundId: string): void;
|
|
15835
|
+
}
|
|
15836
|
+
|
|
15837
|
+
/**
|
|
15838
|
+
* @beta
|
|
15839
|
+
* A container for APIs related to player aim-assist.
|
|
15840
|
+
*/
|
|
15841
|
+
export class PlayerAimAssist {
|
|
15842
|
+
private constructor();
|
|
15843
|
+
/**
|
|
15844
|
+
* @remarks
|
|
15845
|
+
* The player's currently active aim-assist settings, or
|
|
15846
|
+
* undefined if not active.
|
|
15847
|
+
*
|
|
15848
|
+
*/
|
|
15849
|
+
readonly settings?: PlayerAimAssistSettings;
|
|
15850
|
+
/**
|
|
15851
|
+
* @remarks
|
|
15852
|
+
* Sets the player's aim-assist settings.
|
|
15853
|
+
*
|
|
15854
|
+
* This function can't be called in read-only mode.
|
|
15855
|
+
*
|
|
15856
|
+
* @param settings
|
|
15857
|
+
* Aim-assist settings to activate for the player, if undefined
|
|
15858
|
+
* aim-assist will be disabled.
|
|
15859
|
+
* @throws This function can throw errors.
|
|
15860
|
+
*
|
|
15861
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
15862
|
+
*
|
|
15863
|
+
* {@link minecraftcommon.EngineError}
|
|
15864
|
+
*
|
|
15865
|
+
* {@link Error}
|
|
15866
|
+
*
|
|
15867
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
15868
|
+
*
|
|
15869
|
+
* {@link InvalidEntityError}
|
|
15870
|
+
*
|
|
15871
|
+
* {@link NamespaceNameError}
|
|
15872
|
+
*/
|
|
15873
|
+
set(settings?: PlayerAimAssistSettings): void;
|
|
13781
15874
|
}
|
|
13782
15875
|
|
|
13783
15876
|
/**
|
|
@@ -14994,6 +17087,82 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
14994
17087
|
unsubscribe(callback: (arg0: PlayerPlaceBlockAfterEvent) => void): void;
|
|
14995
17088
|
}
|
|
14996
17089
|
|
|
17090
|
+
/**
|
|
17091
|
+
* @beta
|
|
17092
|
+
* Contains information regarding an event before a player
|
|
17093
|
+
* places a block.
|
|
17094
|
+
*/
|
|
17095
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
17096
|
+
export class PlayerPlaceBlockBeforeEvent extends BlockEvent {
|
|
17097
|
+
private constructor();
|
|
17098
|
+
/**
|
|
17099
|
+
* @remarks
|
|
17100
|
+
* If set to true, cancels the block place event.
|
|
17101
|
+
*
|
|
17102
|
+
*/
|
|
17103
|
+
cancel: boolean;
|
|
17104
|
+
/**
|
|
17105
|
+
* @remarks
|
|
17106
|
+
* The face of the block that the new block is being placed on.
|
|
17107
|
+
*
|
|
17108
|
+
*/
|
|
17109
|
+
readonly face: Direction;
|
|
17110
|
+
/**
|
|
17111
|
+
* @remarks
|
|
17112
|
+
* Location relative to the bottom north-west corner of the
|
|
17113
|
+
* block where the new block is being placed onto.
|
|
17114
|
+
*
|
|
17115
|
+
*/
|
|
17116
|
+
readonly faceLocation: Vector3;
|
|
17117
|
+
/**
|
|
17118
|
+
* @remarks
|
|
17119
|
+
* The block permutation that will be placed if the event is
|
|
17120
|
+
* not cancelled.
|
|
17121
|
+
*
|
|
17122
|
+
*/
|
|
17123
|
+
readonly permutationToPlace: BlockPermutation;
|
|
17124
|
+
/**
|
|
17125
|
+
* @remarks
|
|
17126
|
+
* Player that is placing the block for this event.
|
|
17127
|
+
*
|
|
17128
|
+
*/
|
|
17129
|
+
readonly player: Player;
|
|
17130
|
+
}
|
|
17131
|
+
|
|
17132
|
+
/**
|
|
17133
|
+
* @beta
|
|
17134
|
+
* Manages callbacks that are connected to before a block is
|
|
17135
|
+
* placed by a player.
|
|
17136
|
+
*/
|
|
17137
|
+
export class PlayerPlaceBlockBeforeEventSignal {
|
|
17138
|
+
private constructor();
|
|
17139
|
+
/**
|
|
17140
|
+
* @remarks
|
|
17141
|
+
* Adds a callback that will be called before a block is placed
|
|
17142
|
+
* by a player.
|
|
17143
|
+
*
|
|
17144
|
+
* This function can't be called in read-only mode.
|
|
17145
|
+
*
|
|
17146
|
+
* This function can be called in early-execution mode.
|
|
17147
|
+
*
|
|
17148
|
+
*/
|
|
17149
|
+
subscribe(
|
|
17150
|
+
callback: (arg0: PlayerPlaceBlockBeforeEvent) => void,
|
|
17151
|
+
options?: BlockEventOptions,
|
|
17152
|
+
): (arg0: PlayerPlaceBlockBeforeEvent) => void;
|
|
17153
|
+
/**
|
|
17154
|
+
* @remarks
|
|
17155
|
+
* Removes a callback from being called before an block is
|
|
17156
|
+
* placed by a player.
|
|
17157
|
+
*
|
|
17158
|
+
* This function can't be called in read-only mode.
|
|
17159
|
+
*
|
|
17160
|
+
* This function can be called in early-execution mode.
|
|
17161
|
+
*
|
|
17162
|
+
*/
|
|
17163
|
+
unsubscribe(callback: (arg0: PlayerPlaceBlockBeforeEvent) => void): void;
|
|
17164
|
+
}
|
|
17165
|
+
|
|
14997
17166
|
/**
|
|
14998
17167
|
* An event that contains more information about a player
|
|
14999
17168
|
* spawning.
|
|
@@ -15048,6 +17217,156 @@ export class PlayerSpawnAfterEventSignal {
|
|
|
15048
17217
|
unsubscribe(callback: (arg0: PlayerSpawnAfterEvent) => void): void;
|
|
15049
17218
|
}
|
|
15050
17219
|
|
|
17220
|
+
/**
|
|
17221
|
+
* @beta
|
|
17222
|
+
* Contains information regarding a player starting to swing
|
|
17223
|
+
* their arm.
|
|
17224
|
+
*/
|
|
17225
|
+
export class PlayerSwingStartAfterEvent {
|
|
17226
|
+
private constructor();
|
|
17227
|
+
/**
|
|
17228
|
+
* @remarks
|
|
17229
|
+
* The item stack being held by the player at the start of
|
|
17230
|
+
* their swing.
|
|
17231
|
+
*
|
|
17232
|
+
*/
|
|
17233
|
+
readonly heldItemStack?: ItemStack;
|
|
17234
|
+
/**
|
|
17235
|
+
* @remarks
|
|
17236
|
+
* Source Player for this event.
|
|
17237
|
+
*
|
|
17238
|
+
*/
|
|
17239
|
+
readonly player: Player;
|
|
17240
|
+
}
|
|
17241
|
+
|
|
17242
|
+
/**
|
|
17243
|
+
* @beta
|
|
17244
|
+
* Manages callbacks that are connected to when a player starts
|
|
17245
|
+
* to swing their arm (e.g. attacking, using an item,
|
|
17246
|
+
* interacting).
|
|
17247
|
+
*/
|
|
17248
|
+
export class PlayerSwingStartAfterEventSignal {
|
|
17249
|
+
private constructor();
|
|
17250
|
+
/**
|
|
17251
|
+
* @remarks
|
|
17252
|
+
* Adds a callback that will be called when a player starts to
|
|
17253
|
+
* swing their arm (e.g. attacking, using an item,
|
|
17254
|
+
* interacting).
|
|
17255
|
+
*
|
|
17256
|
+
* This function can't be called in read-only mode.
|
|
17257
|
+
*
|
|
17258
|
+
* This function can be called in early-execution mode.
|
|
17259
|
+
*
|
|
17260
|
+
*/
|
|
17261
|
+
subscribe(
|
|
17262
|
+
callback: (arg0: PlayerSwingStartAfterEvent) => void,
|
|
17263
|
+
options?: PlayerSwingEventOptions,
|
|
17264
|
+
): (arg0: PlayerSwingStartAfterEvent) => void;
|
|
17265
|
+
/**
|
|
17266
|
+
* @remarks
|
|
17267
|
+
* Removes a callback from being called when a player starts to
|
|
17268
|
+
* swing their arm (e.g. attacking, using an item,
|
|
17269
|
+
* interacting).
|
|
17270
|
+
*
|
|
17271
|
+
* This function can't be called in read-only mode.
|
|
17272
|
+
*
|
|
17273
|
+
* This function can be called in early-execution mode.
|
|
17274
|
+
*
|
|
17275
|
+
*/
|
|
17276
|
+
unsubscribe(callback: (arg0: PlayerSwingStartAfterEvent) => void): void;
|
|
17277
|
+
}
|
|
17278
|
+
|
|
17279
|
+
/**
|
|
17280
|
+
* @beta
|
|
17281
|
+
* Represents how the potion effect is delivered.
|
|
17282
|
+
*/
|
|
17283
|
+
export class PotionDeliveryType {
|
|
17284
|
+
private constructor();
|
|
17285
|
+
readonly id: string;
|
|
17286
|
+
}
|
|
17287
|
+
|
|
17288
|
+
/**
|
|
17289
|
+
* @beta
|
|
17290
|
+
* Represents a type of potion effect - like healing or
|
|
17291
|
+
* leaping.
|
|
17292
|
+
*/
|
|
17293
|
+
export class PotionEffectType {
|
|
17294
|
+
private constructor();
|
|
17295
|
+
/**
|
|
17296
|
+
* @remarks
|
|
17297
|
+
* Duration of the effect when applied to an entity in ticks.
|
|
17298
|
+
* Undefined means the effect does not expire.
|
|
17299
|
+
*
|
|
17300
|
+
* @throws This property can throw when used.
|
|
17301
|
+
*
|
|
17302
|
+
* {@link minecraftcommon.EngineError}
|
|
17303
|
+
*/
|
|
17304
|
+
readonly durationTicks?: number;
|
|
17305
|
+
readonly id: string;
|
|
17306
|
+
}
|
|
17307
|
+
|
|
17308
|
+
/**
|
|
17309
|
+
* @beta
|
|
17310
|
+
* Used for accessing all potion effect types, delivery types,
|
|
17311
|
+
* and creating potions.
|
|
17312
|
+
*/
|
|
17313
|
+
export class Potions {
|
|
17314
|
+
private constructor();
|
|
17315
|
+
/**
|
|
17316
|
+
* @remarks
|
|
17317
|
+
* Retrieves handles for all registered potion delivery types.
|
|
17318
|
+
*
|
|
17319
|
+
* @returns
|
|
17320
|
+
* Array of all registered delivery type handles.
|
|
17321
|
+
*/
|
|
17322
|
+
static getAllDeliveryTypes(): PotionDeliveryType[];
|
|
17323
|
+
/**
|
|
17324
|
+
* @remarks
|
|
17325
|
+
* Retrieves all type handle for all registered potion effects.
|
|
17326
|
+
*
|
|
17327
|
+
* @returns
|
|
17328
|
+
* Array of all registered effect type handles.
|
|
17329
|
+
*/
|
|
17330
|
+
static getAllEffectTypes(): PotionEffectType[];
|
|
17331
|
+
/**
|
|
17332
|
+
* @remarks
|
|
17333
|
+
* Retrieves a type handle for a specified potion delivery id.
|
|
17334
|
+
*
|
|
17335
|
+
* @returns
|
|
17336
|
+
* A type handle wrapping the valid delivery id, or undefined
|
|
17337
|
+
* for an invalid delivery id.
|
|
17338
|
+
*/
|
|
17339
|
+
static getDeliveryType(potionDeliveryId: string): PotionDeliveryType | undefined;
|
|
17340
|
+
/**
|
|
17341
|
+
* @remarks
|
|
17342
|
+
* Retrieves a type handle for a specified potion effect id.
|
|
17343
|
+
*
|
|
17344
|
+
* @param potionEffectId
|
|
17345
|
+
* A valid potion effect id. See
|
|
17346
|
+
* @minecraft/vanilla-data.MinecraftPotionEffectTypes
|
|
17347
|
+
* @returns
|
|
17348
|
+
* A type handle wrapping the valid effect id, or undefined for
|
|
17349
|
+
* an invalid effect id.
|
|
17350
|
+
*/
|
|
17351
|
+
static getEffectType(potionEffectId: string): PotionEffectType | undefined;
|
|
17352
|
+
/**
|
|
17353
|
+
* @remarks
|
|
17354
|
+
* Creates a potion given an effect and delivery type.
|
|
17355
|
+
*
|
|
17356
|
+
* @throws This function can throw errors.
|
|
17357
|
+
*
|
|
17358
|
+
* {@link minecraftcommon.EngineError}
|
|
17359
|
+
*
|
|
17360
|
+
* {@link InvalidPotionDeliveryTypeError}
|
|
17361
|
+
*
|
|
17362
|
+
* {@link InvalidPotionEffectTypeError}
|
|
17363
|
+
*/
|
|
17364
|
+
static resolve<
|
|
17365
|
+
T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
|
|
17366
|
+
U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
|
|
17367
|
+
>(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
|
|
17368
|
+
}
|
|
17369
|
+
|
|
15051
17370
|
/**
|
|
15052
17371
|
* Contains information related to changes to a pressure plate
|
|
15053
17372
|
* pop.
|
|
@@ -15998,6 +18317,38 @@ export class Seat {
|
|
|
15998
18317
|
readonly seatRotation: number;
|
|
15999
18318
|
}
|
|
16000
18319
|
|
|
18320
|
+
/**
|
|
18321
|
+
* @beta
|
|
18322
|
+
* Manages callbacks that are message passing to a server. This
|
|
18323
|
+
* event is not currently fully implemented, and should not be
|
|
18324
|
+
* used.
|
|
18325
|
+
*/
|
|
18326
|
+
export class ServerMessageAfterEventSignal {
|
|
18327
|
+
private constructor();
|
|
18328
|
+
/**
|
|
18329
|
+
* @remarks
|
|
18330
|
+
* Adds a callback that will be called when an internal message
|
|
18331
|
+
* is passed.
|
|
18332
|
+
*
|
|
18333
|
+
* This function can't be called in read-only mode.
|
|
18334
|
+
*
|
|
18335
|
+
* This function can be called in early-execution mode.
|
|
18336
|
+
*
|
|
18337
|
+
*/
|
|
18338
|
+
subscribe(callback: (arg0: MessageReceiveAfterEvent) => void): (arg0: MessageReceiveAfterEvent) => void;
|
|
18339
|
+
/**
|
|
18340
|
+
* @remarks
|
|
18341
|
+
* Removes a callback from being called when an internal
|
|
18342
|
+
* message is passed.
|
|
18343
|
+
*
|
|
18344
|
+
* This function can't be called in read-only mode.
|
|
18345
|
+
*
|
|
18346
|
+
* This function can be called in early-execution mode.
|
|
18347
|
+
*
|
|
18348
|
+
*/
|
|
18349
|
+
unsubscribe(callback: (arg0: MessageReceiveAfterEvent) => void): void;
|
|
18350
|
+
}
|
|
18351
|
+
|
|
16001
18352
|
/**
|
|
16002
18353
|
* Provides an adaptable interface for callers to subscribe to
|
|
16003
18354
|
* an event that fires before the game world shuts down. This
|
|
@@ -16712,7 +19063,20 @@ export class SystemBeforeEvents {
|
|
|
16712
19063
|
* This property can be read in early-execution mode.
|
|
16713
19064
|
*
|
|
16714
19065
|
*/
|
|
16715
|
-
readonly startup: StartupBeforeEventSignal;
|
|
19066
|
+
readonly startup: StartupBeforeEventSignal;
|
|
19067
|
+
/**
|
|
19068
|
+
* @beta
|
|
19069
|
+
* @remarks
|
|
19070
|
+
* Fires when the scripting watchdog shuts down the server. The
|
|
19071
|
+
* can be due to using too much memory, or by causing
|
|
19072
|
+
* significant slowdown or hang.
|
|
19073
|
+
* To prevent shutdown, set the event's cancel property to
|
|
19074
|
+
* true.
|
|
19075
|
+
*
|
|
19076
|
+
* This property can be read in early-execution mode.
|
|
19077
|
+
*
|
|
19078
|
+
*/
|
|
19079
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
16716
19080
|
}
|
|
16717
19081
|
|
|
16718
19082
|
/**
|
|
@@ -16929,6 +19293,65 @@ export class TripWireTripAfterEventSignal {
|
|
|
16929
19293
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
16930
19294
|
}
|
|
16931
19295
|
|
|
19296
|
+
/**
|
|
19297
|
+
* @beta
|
|
19298
|
+
* Contains information related to a script watchdog
|
|
19299
|
+
* termination.
|
|
19300
|
+
*/
|
|
19301
|
+
export class WatchdogTerminateBeforeEvent {
|
|
19302
|
+
private constructor();
|
|
19303
|
+
/**
|
|
19304
|
+
* @remarks
|
|
19305
|
+
* If set to true, cancels the termination of the script
|
|
19306
|
+
* runtime. Note that depending on server configuration
|
|
19307
|
+
* settings, cancellation of the termination may not be
|
|
19308
|
+
* allowed.
|
|
19309
|
+
*
|
|
19310
|
+
*/
|
|
19311
|
+
cancel: boolean;
|
|
19312
|
+
/**
|
|
19313
|
+
* @remarks
|
|
19314
|
+
* Contains the reason why a script runtime is to be
|
|
19315
|
+
* terminated.
|
|
19316
|
+
*
|
|
19317
|
+
*/
|
|
19318
|
+
readonly terminateReason: WatchdogTerminateReason;
|
|
19319
|
+
}
|
|
19320
|
+
|
|
19321
|
+
/**
|
|
19322
|
+
* @beta
|
|
19323
|
+
* Manages callbacks that are connected to a callback that will
|
|
19324
|
+
* be called when a script runtime is being terminated due to a
|
|
19325
|
+
* violation of the performance watchdog system.
|
|
19326
|
+
*/
|
|
19327
|
+
export class WatchdogTerminateBeforeEventSignal {
|
|
19328
|
+
private constructor();
|
|
19329
|
+
/**
|
|
19330
|
+
* @remarks
|
|
19331
|
+
* Adds a callback that will be called when a script runtime is
|
|
19332
|
+
* being terminated due to a violation of the performance
|
|
19333
|
+
* watchdog system.
|
|
19334
|
+
*
|
|
19335
|
+
* This function can't be called in read-only mode.
|
|
19336
|
+
*
|
|
19337
|
+
* This function can be called in early-execution mode.
|
|
19338
|
+
*
|
|
19339
|
+
*/
|
|
19340
|
+
subscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): (arg0: WatchdogTerminateBeforeEvent) => void;
|
|
19341
|
+
/**
|
|
19342
|
+
* @remarks
|
|
19343
|
+
* Removes a callback from being called when a script runtime
|
|
19344
|
+
* is being terminated due to a violation of the performance
|
|
19345
|
+
* watchdog system.
|
|
19346
|
+
*
|
|
19347
|
+
* This function can't be called in read-only mode.
|
|
19348
|
+
*
|
|
19349
|
+
* This function can be called in early-execution mode.
|
|
19350
|
+
*
|
|
19351
|
+
*/
|
|
19352
|
+
unsubscribe(callback: (arg0: WatchdogTerminateBeforeEvent) => void): void;
|
|
19353
|
+
}
|
|
19354
|
+
|
|
16932
19355
|
/**
|
|
16933
19356
|
* Contains information related to changes in weather in the
|
|
16934
19357
|
* environment.
|
|
@@ -17116,6 +19539,20 @@ export class World {
|
|
|
17116
19539
|
*
|
|
17117
19540
|
*/
|
|
17118
19541
|
readonly structureManager: StructureManager;
|
|
19542
|
+
/**
|
|
19543
|
+
* @beta
|
|
19544
|
+
* @remarks
|
|
19545
|
+
* A method that is internal-only, used for broadcasting
|
|
19546
|
+
* specific messages between client and server.
|
|
19547
|
+
*
|
|
19548
|
+
* This function can't be called in read-only mode.
|
|
19549
|
+
*
|
|
19550
|
+
* @param id
|
|
19551
|
+
* The message identifier.
|
|
19552
|
+
* @param value
|
|
19553
|
+
* The message.
|
|
19554
|
+
*/
|
|
19555
|
+
broadcastClientMessage(id: string, value: string): void;
|
|
17119
19556
|
/**
|
|
17120
19557
|
* @remarks
|
|
17121
19558
|
* Clears the set of dynamic properties declared for this
|
|
@@ -17129,6 +19566,14 @@ export class World {
|
|
|
17129
19566
|
*
|
|
17130
19567
|
*/
|
|
17131
19568
|
getAbsoluteTime(): number;
|
|
19569
|
+
/**
|
|
19570
|
+
* @beta
|
|
19571
|
+
* @remarks
|
|
19572
|
+
* The aim-assist presets and categories that can be used in
|
|
19573
|
+
* the world.
|
|
19574
|
+
*
|
|
19575
|
+
*/
|
|
19576
|
+
getAimAssist(): AimAssistRegistry;
|
|
17132
19577
|
/**
|
|
17133
19578
|
* @remarks
|
|
17134
19579
|
* Returns an array of all active players within the world.
|
|
@@ -17305,6 +19750,15 @@ export class World {
|
|
|
17305
19750
|
*
|
|
17306
19751
|
*/
|
|
17307
19752
|
getMoonPhase(): MoonPhase;
|
|
19753
|
+
/**
|
|
19754
|
+
* @beta
|
|
19755
|
+
* @remarks
|
|
19756
|
+
* Returns a map of pack setting name and value pairs.
|
|
19757
|
+
*
|
|
19758
|
+
* This function can be called in early-execution mode.
|
|
19759
|
+
*
|
|
19760
|
+
*/
|
|
19761
|
+
getPackSettings(): Record<string, boolean | number | string>;
|
|
17308
19762
|
/**
|
|
17309
19763
|
* @remarks
|
|
17310
19764
|
* Returns a set of players based on a set of conditions
|
|
@@ -17438,6 +19892,19 @@ export class World {
|
|
|
17438
19892
|
* The difficulty we want to set the world to.
|
|
17439
19893
|
*/
|
|
17440
19894
|
setDifficulty(difficulty: Difficulty): void;
|
|
19895
|
+
/**
|
|
19896
|
+
* @beta
|
|
19897
|
+
* @remarks
|
|
19898
|
+
* Sets multiple dynamic properties with specific values.
|
|
19899
|
+
*
|
|
19900
|
+
* @param values
|
|
19901
|
+
* A Record of key value pairs of the dynamic properties to
|
|
19902
|
+
* set.
|
|
19903
|
+
* @throws This function can throw errors.
|
|
19904
|
+
*
|
|
19905
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
19906
|
+
*/
|
|
19907
|
+
setDynamicProperties(values: Record<string, boolean | number | string | Vector3>): void;
|
|
17441
19908
|
/**
|
|
17442
19909
|
* @remarks
|
|
17443
19910
|
* Sets a specified property to a value.
|
|
@@ -17566,6 +20033,16 @@ export class WorldAfterEvents {
|
|
|
17566
20033
|
*
|
|
17567
20034
|
*/
|
|
17568
20035
|
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
20036
|
+
/**
|
|
20037
|
+
* @beta
|
|
20038
|
+
* @remarks
|
|
20039
|
+
* This event is triggered after a chat message has been
|
|
20040
|
+
* broadcast or sent to players.
|
|
20041
|
+
*
|
|
20042
|
+
* This property can be read in early-execution mode.
|
|
20043
|
+
*
|
|
20044
|
+
*/
|
|
20045
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
17569
20046
|
/**
|
|
17570
20047
|
* @remarks
|
|
17571
20048
|
* This event is fired when an entity event has been triggered
|
|
@@ -17741,6 +20218,25 @@ export class WorldAfterEvents {
|
|
|
17741
20218
|
*
|
|
17742
20219
|
*/
|
|
17743
20220
|
readonly leverAction: LeverActionAfterEventSignal;
|
|
20221
|
+
/**
|
|
20222
|
+
* @beta
|
|
20223
|
+
* @remarks
|
|
20224
|
+
* This event is an internal implementation detail, and is
|
|
20225
|
+
* otherwise not currently functional.
|
|
20226
|
+
*
|
|
20227
|
+
* This property can be read in early-execution mode.
|
|
20228
|
+
*
|
|
20229
|
+
*/
|
|
20230
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
20231
|
+
/**
|
|
20232
|
+
* @beta
|
|
20233
|
+
* @remarks
|
|
20234
|
+
* This event is triggered when a pack setting is changed.
|
|
20235
|
+
*
|
|
20236
|
+
* This property can be read in early-execution mode.
|
|
20237
|
+
*
|
|
20238
|
+
*/
|
|
20239
|
+
readonly packSettingChange: PackSettingChangeAfterEventSignal;
|
|
17744
20240
|
/**
|
|
17745
20241
|
* @remarks
|
|
17746
20242
|
* This event fires when a piston expands or retracts.
|
|
@@ -17871,6 +20367,13 @@ export class WorldAfterEvents {
|
|
|
17871
20367
|
*
|
|
17872
20368
|
*/
|
|
17873
20369
|
readonly playerSpawn: PlayerSpawnAfterEventSignal;
|
|
20370
|
+
/**
|
|
20371
|
+
* @beta
|
|
20372
|
+
* @remarks
|
|
20373
|
+
* This property can be read in early-execution mode.
|
|
20374
|
+
*
|
|
20375
|
+
*/
|
|
20376
|
+
readonly playerSwingStart: PlayerSwingStartAfterEventSignal;
|
|
17874
20377
|
/**
|
|
17875
20378
|
* @remarks
|
|
17876
20379
|
* A pressure plate has popped back up (i.e., there are no
|
|
@@ -17947,6 +20450,43 @@ export class WorldAfterEvents {
|
|
|
17947
20450
|
*/
|
|
17948
20451
|
export class WorldBeforeEvents {
|
|
17949
20452
|
private constructor();
|
|
20453
|
+
/**
|
|
20454
|
+
* @beta
|
|
20455
|
+
* @remarks
|
|
20456
|
+
* This event is triggered after a chat message has been
|
|
20457
|
+
* broadcast or sent to players.
|
|
20458
|
+
*
|
|
20459
|
+
* This property can be read in early-execution mode.
|
|
20460
|
+
*
|
|
20461
|
+
* @example customCommand.ts
|
|
20462
|
+
* ```typescript
|
|
20463
|
+
* import { world, DimensionLocation } from "@minecraft/server";
|
|
20464
|
+
*
|
|
20465
|
+
* function customCommand(targetLocation: DimensionLocation) {
|
|
20466
|
+
* const chatCallback = world.beforeEvents.chatSend.subscribe((eventData) => {
|
|
20467
|
+
* if (eventData.message.includes("cancel")) {
|
|
20468
|
+
* // Cancel event if the message contains "cancel"
|
|
20469
|
+
* eventData.cancel = true;
|
|
20470
|
+
* } else {
|
|
20471
|
+
* const args = eventData.message.split(" ");
|
|
20472
|
+
*
|
|
20473
|
+
* if (args.length > 0) {
|
|
20474
|
+
* switch (args[0].toLowerCase()) {
|
|
20475
|
+
* case "echo":
|
|
20476
|
+
* // Send a modified version of chat message
|
|
20477
|
+
* world.sendMessage(`Echo '${eventData.message.substring(4).trim()}'`);
|
|
20478
|
+
* break;
|
|
20479
|
+
* case "help":
|
|
20480
|
+
* world.sendMessage(`Available commands: echo <message>`);
|
|
20481
|
+
* break;
|
|
20482
|
+
* }
|
|
20483
|
+
* }
|
|
20484
|
+
* }
|
|
20485
|
+
* });
|
|
20486
|
+
* }
|
|
20487
|
+
* ```
|
|
20488
|
+
*/
|
|
20489
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
17950
20490
|
/**
|
|
17951
20491
|
* @remarks
|
|
17952
20492
|
* This event is triggered after an event has been added to an
|
|
@@ -18020,6 +20560,15 @@ export class WorldBeforeEvents {
|
|
|
18020
20560
|
*
|
|
18021
20561
|
*/
|
|
18022
20562
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
20563
|
+
/**
|
|
20564
|
+
* @beta
|
|
20565
|
+
* @remarks
|
|
20566
|
+
* This event fires before a block is placed by a player.
|
|
20567
|
+
*
|
|
20568
|
+
* This property can be read in early-execution mode.
|
|
20569
|
+
*
|
|
20570
|
+
*/
|
|
20571
|
+
readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
|
|
18023
20572
|
/**
|
|
18024
20573
|
* @remarks
|
|
18025
20574
|
* This property can be read in early-execution mode.
|
|
@@ -18052,13 +20601,27 @@ export class WorldLoadAfterEventSignal {
|
|
|
18052
20601
|
unsubscribe(callback: (arg0: WorldLoadAfterEvent) => void): void;
|
|
18053
20602
|
}
|
|
18054
20603
|
|
|
20604
|
+
/**
|
|
20605
|
+
* @beta
|
|
20606
|
+
* Contains additional options for searches for the
|
|
20607
|
+
* dimension.findNearestBiome API.
|
|
20608
|
+
*/
|
|
20609
|
+
export interface BiomeSearchOptions {
|
|
20610
|
+
/**
|
|
20611
|
+
* @remarks
|
|
20612
|
+
* Bounding volume size to look within.
|
|
20613
|
+
*
|
|
20614
|
+
*/
|
|
20615
|
+
boundingSize?: Vector3;
|
|
20616
|
+
}
|
|
20617
|
+
|
|
18055
20618
|
/**
|
|
18056
20619
|
* A BlockBoundingBox is an interface to an object which
|
|
18057
20620
|
* represents an AABB aligned rectangle.
|
|
18058
20621
|
* The BlockBoundingBox assumes that it was created in a valid
|
|
18059
20622
|
* state (min <= max) but cannot guarantee it (unless it was
|
|
18060
|
-
* created using the associated {@link
|
|
18061
|
-
*
|
|
20623
|
+
* created using the associated {@link BlockBoundingBoxUtils}
|
|
20624
|
+
* utility functions.
|
|
18062
20625
|
* The min/max coordinates represent the diametrically opposite
|
|
18063
20626
|
* corners of the rectangle.
|
|
18064
20627
|
* The BlockBoundingBox is not a representation of blocks - it
|
|
@@ -18436,6 +20999,76 @@ export interface CameraTargetOptions {
|
|
|
18436
20999
|
targetEntity: Entity;
|
|
18437
21000
|
}
|
|
18438
21001
|
|
|
21002
|
+
/**
|
|
21003
|
+
* @beta
|
|
21004
|
+
* This interface defines an entry into the {@link
|
|
21005
|
+
* CompoundBlockVolume} which represents a volume of positive
|
|
21006
|
+
* or negative space.
|
|
21007
|
+
*
|
|
21008
|
+
*/
|
|
21009
|
+
export interface CompoundBlockVolumeItem {
|
|
21010
|
+
/**
|
|
21011
|
+
* @remarks
|
|
21012
|
+
* The 'action' defines how the block volume is represented in
|
|
21013
|
+
* the compound block volume stack.
|
|
21014
|
+
* 'Add' creates a block volume which is positively selected
|
|
21015
|
+
* 'Subtract' creates a block volume which represents a hole or
|
|
21016
|
+
* negative space in the overall compound block volume.
|
|
21017
|
+
*
|
|
21018
|
+
*/
|
|
21019
|
+
action?: CompoundBlockVolumeAction;
|
|
21020
|
+
/**
|
|
21021
|
+
* @remarks
|
|
21022
|
+
* The relativity enumeration determines whether the
|
|
21023
|
+
* BlockVolume specified is positioned relative to the parent
|
|
21024
|
+
* compound block volume origin, or in absolute world space.
|
|
21025
|
+
*
|
|
21026
|
+
*/
|
|
21027
|
+
locationRelativity?: CompoundBlockVolumePositionRelativity;
|
|
21028
|
+
/**
|
|
21029
|
+
* @remarks
|
|
21030
|
+
* The volume of space
|
|
21031
|
+
*
|
|
21032
|
+
*/
|
|
21033
|
+
volume: BlockVolume;
|
|
21034
|
+
}
|
|
21035
|
+
|
|
21036
|
+
/**
|
|
21037
|
+
* @beta
|
|
21038
|
+
* Rules that if broken on container operations will throw an
|
|
21039
|
+
* error.
|
|
21040
|
+
*/
|
|
21041
|
+
export interface ContainerRules {
|
|
21042
|
+
/**
|
|
21043
|
+
* @remarks
|
|
21044
|
+
* Defines the items that are exclusively allowed in the
|
|
21045
|
+
* container. If empty all items are allowed in the container.
|
|
21046
|
+
*
|
|
21047
|
+
*/
|
|
21048
|
+
allowedItems: string[];
|
|
21049
|
+
/**
|
|
21050
|
+
* @remarks
|
|
21051
|
+
* Determines whether other storage items can be placed into
|
|
21052
|
+
* the container.
|
|
21053
|
+
*
|
|
21054
|
+
*/
|
|
21055
|
+
allowNestedStorageItems: boolean;
|
|
21056
|
+
/**
|
|
21057
|
+
* @remarks
|
|
21058
|
+
* Defines the items that are not allowed in the container.
|
|
21059
|
+
*
|
|
21060
|
+
*/
|
|
21061
|
+
bannedItems: string[];
|
|
21062
|
+
/**
|
|
21063
|
+
* @remarks
|
|
21064
|
+
* Defines the maximum allowed total weight of all items in the
|
|
21065
|
+
* storage item container. If undefined container has no weight
|
|
21066
|
+
* limit.
|
|
21067
|
+
*
|
|
21068
|
+
*/
|
|
21069
|
+
weightLimit?: number;
|
|
21070
|
+
}
|
|
21071
|
+
|
|
18439
21072
|
/**
|
|
18440
21073
|
* Define the custom command, including name, permissions, and
|
|
18441
21074
|
* parameters.
|
|
@@ -18485,6 +21118,15 @@ export interface CustomCommand {
|
|
|
18485
21118
|
* command.
|
|
18486
21119
|
*/
|
|
18487
21120
|
export interface CustomCommandParameter {
|
|
21121
|
+
/**
|
|
21122
|
+
* @beta
|
|
21123
|
+
* @remarks
|
|
21124
|
+
* Can be used to reference the enum name when {@link
|
|
21125
|
+
* CustomCommandParamType} is 'Enum'. Allows the parameter name
|
|
21126
|
+
* to be different from the enum name.
|
|
21127
|
+
*
|
|
21128
|
+
*/
|
|
21129
|
+
enumName?: string;
|
|
18488
21130
|
/**
|
|
18489
21131
|
* @remarks
|
|
18490
21132
|
* The name of parameter as it appears on the command line.
|
|
@@ -18537,6 +21179,14 @@ export interface DefinitionModifier {
|
|
|
18537
21179
|
*
|
|
18538
21180
|
*/
|
|
18539
21181
|
removedComponentGroups: string[];
|
|
21182
|
+
/**
|
|
21183
|
+
* @beta
|
|
21184
|
+
* @remarks
|
|
21185
|
+
* The list of entity definition events that will be fired via
|
|
21186
|
+
* this update.
|
|
21187
|
+
*
|
|
21188
|
+
*/
|
|
21189
|
+
triggers: Trigger[];
|
|
18540
21190
|
}
|
|
18541
21191
|
|
|
18542
21192
|
/**
|
|
@@ -19276,6 +21926,29 @@ export interface ExplosionOptions {
|
|
|
19276
21926
|
source?: Entity;
|
|
19277
21927
|
}
|
|
19278
21928
|
|
|
21929
|
+
/**
|
|
21930
|
+
* @beta
|
|
21931
|
+
* Contains additional options for getBlockStandingOn and
|
|
21932
|
+
* getAllBlocksStandingOn.
|
|
21933
|
+
*/
|
|
21934
|
+
export interface GetBlocksStandingOnOptions {
|
|
21935
|
+
/**
|
|
21936
|
+
* @remarks
|
|
21937
|
+
* When specified, the function will include / exclude what
|
|
21938
|
+
* block(s) are returned based on the block filter.
|
|
21939
|
+
*
|
|
21940
|
+
*/
|
|
21941
|
+
blockFilter?: BlockFilter;
|
|
21942
|
+
/**
|
|
21943
|
+
* @remarks
|
|
21944
|
+
* If true, all blocks of height 0.2 or lower like trapdoors
|
|
21945
|
+
* and carpets will be ignored, and the block underneath will
|
|
21946
|
+
* be returned.
|
|
21947
|
+
*
|
|
21948
|
+
*/
|
|
21949
|
+
ignoreThinBlocks?: boolean;
|
|
21950
|
+
}
|
|
21951
|
+
|
|
19279
21952
|
/**
|
|
19280
21953
|
* Greater than operator.
|
|
19281
21954
|
*/
|
|
@@ -19467,6 +22140,14 @@ export interface JigsawPlaceOptions {
|
|
|
19467
22140
|
*
|
|
19468
22141
|
*/
|
|
19469
22142
|
keepJigsaws?: boolean;
|
|
22143
|
+
/**
|
|
22144
|
+
* @beta
|
|
22145
|
+
* @remarks
|
|
22146
|
+
* Specifies how to handle waterloggable blocks overlapping
|
|
22147
|
+
* with existing liquid. Defaults to `ApplyWaterlogging`.
|
|
22148
|
+
*
|
|
22149
|
+
*/
|
|
22150
|
+
liquidSettings?: LiquidSettings;
|
|
19470
22151
|
}
|
|
19471
22152
|
|
|
19472
22153
|
/**
|
|
@@ -19496,6 +22177,14 @@ export interface JigsawStructurePlaceOptions {
|
|
|
19496
22177
|
*
|
|
19497
22178
|
*/
|
|
19498
22179
|
keepJigsaws?: boolean;
|
|
22180
|
+
/**
|
|
22181
|
+
* @beta
|
|
22182
|
+
* @remarks
|
|
22183
|
+
* Specifies how to handle waterloggable blocks overlapping
|
|
22184
|
+
* with existing liquid. Defaults to `ApplyWaterlogging`.
|
|
22185
|
+
*
|
|
22186
|
+
*/
|
|
22187
|
+
liquidSettings?: LiquidSettings;
|
|
19499
22188
|
}
|
|
19500
22189
|
|
|
19501
22190
|
/**
|
|
@@ -19597,6 +22286,38 @@ export interface PlayAnimationOptions {
|
|
|
19597
22286
|
stopExpression?: string;
|
|
19598
22287
|
}
|
|
19599
22288
|
|
|
22289
|
+
/**
|
|
22290
|
+
* @beta
|
|
22291
|
+
* Settings relating to a player's aim-assist targeting.
|
|
22292
|
+
*/
|
|
22293
|
+
export interface PlayerAimAssistSettings {
|
|
22294
|
+
/**
|
|
22295
|
+
* @remarks
|
|
22296
|
+
* The view distance limit to use for aim-assist targeting.
|
|
22297
|
+
*
|
|
22298
|
+
*/
|
|
22299
|
+
distance?: number;
|
|
22300
|
+
/**
|
|
22301
|
+
* @remarks
|
|
22302
|
+
* The Id of the aim-assist preset to activate. Must have a
|
|
22303
|
+
* namespace.
|
|
22304
|
+
*
|
|
22305
|
+
*/
|
|
22306
|
+
presetId: string;
|
|
22307
|
+
/**
|
|
22308
|
+
* @remarks
|
|
22309
|
+
* The mode to use for aim-assist targeting.
|
|
22310
|
+
*
|
|
22311
|
+
*/
|
|
22312
|
+
targetMode?: AimAssistTargetMode;
|
|
22313
|
+
/**
|
|
22314
|
+
* @remarks
|
|
22315
|
+
* The view angle limit to use for aim-assist targeting.
|
|
22316
|
+
*
|
|
22317
|
+
*/
|
|
22318
|
+
viewAngle?: Vector2;
|
|
22319
|
+
}
|
|
22320
|
+
|
|
19600
22321
|
/**
|
|
19601
22322
|
* Additional options for how a sound plays for a player.
|
|
19602
22323
|
*/
|
|
@@ -19622,6 +22343,24 @@ export interface PlayerSoundOptions {
|
|
|
19622
22343
|
volume?: number;
|
|
19623
22344
|
}
|
|
19624
22345
|
|
|
22346
|
+
/**
|
|
22347
|
+
* @beta
|
|
22348
|
+
* An interface that is passed into {@link
|
|
22349
|
+
* @minecraft/Server.PlayerSwingStartAfterEvent.subscribe} that
|
|
22350
|
+
* filters out which events are passed to the provided
|
|
22351
|
+
* callback.
|
|
22352
|
+
*/
|
|
22353
|
+
export interface PlayerSwingEventOptions {
|
|
22354
|
+
/**
|
|
22355
|
+
* @remarks
|
|
22356
|
+
* The held item option that the callback should be called for.
|
|
22357
|
+
* If undefined, the callback will be called whether or not the
|
|
22358
|
+
* player is holding an item in their hand.
|
|
22359
|
+
*
|
|
22360
|
+
*/
|
|
22361
|
+
heldItemOption?: HeldItemOption;
|
|
22362
|
+
}
|
|
22363
|
+
|
|
19625
22364
|
/**
|
|
19626
22365
|
* Optional arguments for
|
|
19627
22366
|
* @minecraft/server.EntityProjectileComponent.shoot.
|
|
@@ -19899,6 +22638,23 @@ export interface ScriptEventMessageFilterOptions {
|
|
|
19899
22638
|
* Contains additional options for spawning an Entity.
|
|
19900
22639
|
*/
|
|
19901
22640
|
export interface SpawnEntityOptions {
|
|
22641
|
+
/**
|
|
22642
|
+
* @beta
|
|
22643
|
+
* @remarks
|
|
22644
|
+
* Optional boolean which determines if this entity should
|
|
22645
|
+
* persist in the game world. Persistence prevents the entity
|
|
22646
|
+
* from automatically despawning.
|
|
22647
|
+
*
|
|
22648
|
+
*/
|
|
22649
|
+
initialPersistence?: boolean;
|
|
22650
|
+
/**
|
|
22651
|
+
* @beta
|
|
22652
|
+
* @remarks
|
|
22653
|
+
* Optional initial rotation, in degrees, to set on the entity
|
|
22654
|
+
* when it spawns.
|
|
22655
|
+
*
|
|
22656
|
+
*/
|
|
22657
|
+
initialRotation?: number;
|
|
19902
22658
|
/**
|
|
19903
22659
|
* @remarks
|
|
19904
22660
|
* Optional spawn event to send to the entity after it is
|
|
@@ -20260,12 +23016,21 @@ export class CommandError extends Error {
|
|
|
20260
23016
|
}
|
|
20261
23017
|
|
|
20262
23018
|
/**
|
|
20263
|
-
* Error thrown if {@link
|
|
20264
|
-
*
|
|
23019
|
+
* Error thrown if {@link ContainerRules} are broken on
|
|
23020
|
+
* container operations.
|
|
20265
23021
|
*/
|
|
20266
23022
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
20267
23023
|
export class ContainerRulesError extends Error {
|
|
20268
23024
|
private constructor();
|
|
23025
|
+
/**
|
|
23026
|
+
* @beta
|
|
23027
|
+
* @remarks
|
|
23028
|
+
* The specific reason the error was thrown.
|
|
23029
|
+
*
|
|
23030
|
+
* This property can be read in early-execution mode.
|
|
23031
|
+
*
|
|
23032
|
+
*/
|
|
23033
|
+
reason: ContainerRulesErrorReason;
|
|
20269
23034
|
}
|
|
20270
23035
|
|
|
20271
23036
|
/**
|
|
@@ -20385,6 +23150,22 @@ export class InvalidIteratorError extends Error {
|
|
|
20385
23150
|
private constructor();
|
|
20386
23151
|
}
|
|
20387
23152
|
|
|
23153
|
+
/**
|
|
23154
|
+
* @beta
|
|
23155
|
+
*/
|
|
23156
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
23157
|
+
export class InvalidPotionDeliveryTypeError extends Error {
|
|
23158
|
+
private constructor();
|
|
23159
|
+
}
|
|
23160
|
+
|
|
23161
|
+
/**
|
|
23162
|
+
* @beta
|
|
23163
|
+
*/
|
|
23164
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
23165
|
+
export class InvalidPotionEffectTypeError extends Error {
|
|
23166
|
+
private constructor();
|
|
23167
|
+
}
|
|
23168
|
+
|
|
20388
23169
|
/**
|
|
20389
23170
|
* Thrown when a Structure is invalid. A structure becomes
|
|
20390
23171
|
* invalid when it is deleted.
|