@minecraft/server 1.1.0-beta.1.19.60-preview.25 → 1.1.0-beta.1.19.70-preview.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +315 -556
- package/package.json +1 -1
- package/tests.ts +47 -41
package/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* ```json
|
|
17
17
|
* {
|
|
18
18
|
* "module_name": "@minecraft/server",
|
|
19
|
-
* "version": "1.1.0-internal.1.19.
|
|
19
|
+
* "version": "1.1.0-internal.1.19.70-preview.20"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -285,10 +285,8 @@ export class BeforeChatEvent {
|
|
|
285
285
|
* players (i.e., is not broadcast.)
|
|
286
286
|
*/
|
|
287
287
|
sendToTargets: boolean;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
*/
|
|
291
|
-
targets: Player[];
|
|
288
|
+
getTargets(): Player[];
|
|
289
|
+
setTargets(players: Player[]): void;
|
|
292
290
|
}
|
|
293
291
|
/**
|
|
294
292
|
* @beta
|
|
@@ -333,11 +331,8 @@ export class BeforeDataDrivenEntityTriggerEvent {
|
|
|
333
331
|
* Name of the data driven event being triggered.
|
|
334
332
|
*/
|
|
335
333
|
readonly id: string;
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
* are the effect of this triggered event.
|
|
339
|
-
*/
|
|
340
|
-
modifiers: DefinitionModifier[];
|
|
334
|
+
getModifiers(): DefinitionModifier[];
|
|
335
|
+
setModifiers(modifiers: DefinitionModifier[]): void;
|
|
341
336
|
}
|
|
342
337
|
/**
|
|
343
338
|
* @beta
|
|
@@ -387,7 +382,7 @@ export class BeforeExplosionEvent {
|
|
|
387
382
|
* Note that this property can be updated to change the set of
|
|
388
383
|
* blocks impacted.
|
|
389
384
|
*/
|
|
390
|
-
impactedBlocks:
|
|
385
|
+
impactedBlocks: Vector3[];
|
|
391
386
|
/**
|
|
392
387
|
* Optional source of the explosion.
|
|
393
388
|
*/
|
|
@@ -521,7 +516,7 @@ export class BeforeItemUseOnEvent {
|
|
|
521
516
|
/**
|
|
522
517
|
* Location of the block being impacted.
|
|
523
518
|
*/
|
|
524
|
-
readonly blockLocation:
|
|
519
|
+
readonly blockLocation: Vector3;
|
|
525
520
|
/**
|
|
526
521
|
* If set to true, this will cancel the item use behavior.
|
|
527
522
|
*/
|
|
@@ -686,8 +681,9 @@ export class Block {
|
|
|
686
681
|
isWaterlogged: boolean;
|
|
687
682
|
/**
|
|
688
683
|
* Coordinates of the specified block.
|
|
684
|
+
* @throws This property can throw when used.
|
|
689
685
|
*/
|
|
690
|
-
readonly location:
|
|
686
|
+
readonly location: Vector3;
|
|
691
687
|
/**
|
|
692
688
|
* Additional block configuration data that describes the
|
|
693
689
|
* block.
|
|
@@ -775,10 +771,10 @@ export class Block {
|
|
|
775
771
|
* @throws This function can throw errors.
|
|
776
772
|
* @example check_block_tags.js
|
|
777
773
|
* ```typescript
|
|
778
|
-
* import { world
|
|
774
|
+
* import { world } from "@minecraft/server";
|
|
779
775
|
*
|
|
780
776
|
* // Fetch the block
|
|
781
|
-
* const block = world.getDimension("overworld").getBlock(
|
|
777
|
+
* const block = world.getDimension("overworld").getBlock({ x: 1, y: 2, z: 3 });
|
|
782
778
|
*
|
|
783
779
|
* console.log(`Block is dirt: ${block.hasTag("dirt")}`);
|
|
784
780
|
* console.log(`Block is wood: ${block.hasTag("wood")}`);
|
|
@@ -787,6 +783,9 @@ export class Block {
|
|
|
787
783
|
* ```
|
|
788
784
|
*/
|
|
789
785
|
hasTag(tag: string): boolean;
|
|
786
|
+
isAir(): boolean;
|
|
787
|
+
isLiquid(): boolean;
|
|
788
|
+
isSolid(): boolean;
|
|
790
789
|
/**
|
|
791
790
|
* @remarks
|
|
792
791
|
* Sets the block in the dimension to the state of the
|
|
@@ -976,29 +975,6 @@ export class BlockExplodeEventSignal {
|
|
|
976
975
|
*/
|
|
977
976
|
unsubscribe(callback: (arg: BlockExplodeEvent) => void): void;
|
|
978
977
|
}
|
|
979
|
-
/**
|
|
980
|
-
* @beta
|
|
981
|
-
* Contains more information for events where a block is hit.
|
|
982
|
-
*/
|
|
983
|
-
export class BlockHitInformation {
|
|
984
|
-
protected constructor();
|
|
985
|
-
/**
|
|
986
|
-
* Block that was hit.
|
|
987
|
-
*/
|
|
988
|
-
readonly block: Block;
|
|
989
|
-
/**
|
|
990
|
-
* Face of the block that was hit.
|
|
991
|
-
*/
|
|
992
|
-
readonly face: Direction;
|
|
993
|
-
/**
|
|
994
|
-
* X coordinate on the face that was hit.
|
|
995
|
-
*/
|
|
996
|
-
readonly faceLocationX: number;
|
|
997
|
-
/**
|
|
998
|
-
* Y coordinate on the face that was hit.
|
|
999
|
-
*/
|
|
1000
|
-
readonly faceLocationY: number;
|
|
1001
|
-
}
|
|
1002
978
|
/**
|
|
1003
979
|
* @beta
|
|
1004
980
|
* Represents the inventory of a block in the world. Used with
|
|
@@ -1014,7 +990,7 @@ export class BlockInventoryComponent extends BlockComponent {
|
|
|
1014
990
|
/**
|
|
1015
991
|
* Coordinates of the specified block.
|
|
1016
992
|
*/
|
|
1017
|
-
readonly location:
|
|
993
|
+
readonly location: Vector3;
|
|
1018
994
|
/**
|
|
1019
995
|
* Identifier of this component. Should always be
|
|
1020
996
|
* minecraft:inventory.
|
|
@@ -1155,7 +1131,7 @@ export class BlockLavaContainerComponent extends BlockComponent {
|
|
|
1155
1131
|
/**
|
|
1156
1132
|
* Source location of the block.
|
|
1157
1133
|
*/
|
|
1158
|
-
readonly location:
|
|
1134
|
+
readonly location: Vector3;
|
|
1159
1135
|
/**
|
|
1160
1136
|
* Identifier of this component. Should always be
|
|
1161
1137
|
* minecraft:lavaContainer.
|
|
@@ -1167,85 +1143,6 @@ export class BlockLavaContainerComponent extends BlockComponent {
|
|
|
1167
1143
|
*/
|
|
1168
1144
|
static readonly componentId = 'minecraft:lavaContainer';
|
|
1169
1145
|
}
|
|
1170
|
-
/**
|
|
1171
|
-
* @beta
|
|
1172
|
-
* Contains the integer X, Y, Z coordinates for a block. For
|
|
1173
|
-
* decimal locations useful for entities, items, and more, see
|
|
1174
|
-
* {@link Location}.
|
|
1175
|
-
*/
|
|
1176
|
-
export class BlockLocation {
|
|
1177
|
-
/**
|
|
1178
|
-
* The X coordinate.
|
|
1179
|
-
*/
|
|
1180
|
-
x: number;
|
|
1181
|
-
/**
|
|
1182
|
-
* The integer-based Y position.
|
|
1183
|
-
*/
|
|
1184
|
-
y: number;
|
|
1185
|
-
/**
|
|
1186
|
-
* The integer-based Z position.
|
|
1187
|
-
*/
|
|
1188
|
-
z: number;
|
|
1189
|
-
/**
|
|
1190
|
-
* @remarks
|
|
1191
|
-
* Creates a new instance of an abstract block location.
|
|
1192
|
-
* @param x
|
|
1193
|
-
* X position of the block location. This number should be an
|
|
1194
|
-
* integer.
|
|
1195
|
-
* @param y
|
|
1196
|
-
* Y position of the block location. This number should be an
|
|
1197
|
-
* integer.
|
|
1198
|
-
* @param z
|
|
1199
|
-
* Z position of the block location. This number should be an
|
|
1200
|
-
* integer.
|
|
1201
|
-
*/
|
|
1202
|
-
constructor(x: number, y: number, z: number);
|
|
1203
|
-
/**
|
|
1204
|
-
* @remarks
|
|
1205
|
-
* Returns a BlockLocation for a block above this BlockLocation
|
|
1206
|
-
* (that is, y + 1).
|
|
1207
|
-
*/
|
|
1208
|
-
above(): BlockLocation;
|
|
1209
|
-
/**
|
|
1210
|
-
* @remarks
|
|
1211
|
-
* Returns an array of block locations representing all blocks
|
|
1212
|
-
* in the volume (cuboid) between this location and another
|
|
1213
|
-
* location.
|
|
1214
|
-
* @param other
|
|
1215
|
-
* Additional BlockLocation used to determine the set of
|
|
1216
|
-
* locations in between this location and another point.
|
|
1217
|
-
* @returns
|
|
1218
|
-
* Array of block locations representing the volume between
|
|
1219
|
-
* this location and another, inclusive of the start and end
|
|
1220
|
-
* points.
|
|
1221
|
-
*/
|
|
1222
|
-
blocksBetween(other: BlockLocation): BlockLocation[];
|
|
1223
|
-
/**
|
|
1224
|
-
* @remarks
|
|
1225
|
-
* Compares this BlockLocation and another BlockLocation to one
|
|
1226
|
-
* another.
|
|
1227
|
-
* @param other
|
|
1228
|
-
* Other block location to compare this BlockLocation to.
|
|
1229
|
-
* @returns
|
|
1230
|
-
* True if the two block locations are equal.
|
|
1231
|
-
*/
|
|
1232
|
-
equals(other: BlockLocation): boolean;
|
|
1233
|
-
/**
|
|
1234
|
-
* @remarks
|
|
1235
|
-
* Returns a block location using a position relative to this
|
|
1236
|
-
* block location
|
|
1237
|
-
* @param x
|
|
1238
|
-
* X offset relative to this BlockLocation.
|
|
1239
|
-
* @param y
|
|
1240
|
-
* Y offset relative to this BlockLocation.
|
|
1241
|
-
* @param z
|
|
1242
|
-
* Z offset relative to this BlockLocation.
|
|
1243
|
-
* @returns
|
|
1244
|
-
* BlockLocation that is positioned relative to this
|
|
1245
|
-
* BlockLocation.
|
|
1246
|
-
*/
|
|
1247
|
-
offset(x: number, y: number, z: number): BlockLocation;
|
|
1248
|
-
}
|
|
1249
1146
|
/**
|
|
1250
1147
|
* @beta
|
|
1251
1148
|
* Contains the combination of type {@link BlockType} and
|
|
@@ -1296,10 +1193,10 @@ export class BlockPermutation {
|
|
|
1296
1193
|
* Returns `true` if the permutation has the tag, else `false`.
|
|
1297
1194
|
* @example check_block_tags.js
|
|
1298
1195
|
* ```typescript
|
|
1299
|
-
* import { world
|
|
1196
|
+
* import { world } from "@minecraft/server";
|
|
1300
1197
|
*
|
|
1301
1198
|
* // Fetch the block
|
|
1302
|
-
* const block = world.getDimension("overworld").getBlock(
|
|
1199
|
+
* const block = world.getDimension("overworld").getBlock({ x: 1, y: 2, z: 3 });
|
|
1303
1200
|
* const blockPerm = block.getPermutation();
|
|
1304
1201
|
*
|
|
1305
1202
|
* console.log(`Block is dirt: ${blockPerm.hasTag("dirt")}`);
|
|
@@ -1322,7 +1219,7 @@ export class BlockPistonComponent extends BlockComponent {
|
|
|
1322
1219
|
* activation of this piston.
|
|
1323
1220
|
* @throws This property can throw when used.
|
|
1324
1221
|
*/
|
|
1325
|
-
readonly attachedBlocks:
|
|
1222
|
+
readonly attachedBlocks: Vector3[];
|
|
1326
1223
|
/**
|
|
1327
1224
|
* Whether the piston is fully expanded.
|
|
1328
1225
|
* @throws This property can throw when used.
|
|
@@ -1352,7 +1249,7 @@ export class BlockPistonComponent extends BlockComponent {
|
|
|
1352
1249
|
/**
|
|
1353
1250
|
* Source location of the block.
|
|
1354
1251
|
*/
|
|
1355
|
-
readonly location:
|
|
1252
|
+
readonly location: Vector3;
|
|
1356
1253
|
/**
|
|
1357
1254
|
* Identifier of this component.
|
|
1358
1255
|
*/
|
|
@@ -1422,7 +1319,7 @@ export class BlockPotionContainerComponent extends BlockComponent {
|
|
|
1422
1319
|
/**
|
|
1423
1320
|
* Source location of the block.
|
|
1424
1321
|
*/
|
|
1425
|
-
readonly location:
|
|
1322
|
+
readonly location: Vector3;
|
|
1426
1323
|
/**
|
|
1427
1324
|
* Identifier of this component. Should always be
|
|
1428
1325
|
* minecraft:potionContainer.
|
|
@@ -2057,7 +1954,7 @@ export class BlockRecordPlayerComponent extends BlockComponent {
|
|
|
2057
1954
|
/**
|
|
2058
1955
|
* Location of this record-playing block.
|
|
2059
1956
|
*/
|
|
2060
|
-
readonly location:
|
|
1957
|
+
readonly location: Vector3;
|
|
2061
1958
|
/**
|
|
2062
1959
|
* Identifier of this component. Should always be
|
|
2063
1960
|
* minecraft:recordPlayer.
|
|
@@ -2099,7 +1996,7 @@ export class BlockSignComponent extends BlockComponent {
|
|
|
2099
1996
|
/**
|
|
2100
1997
|
* Location of the sign.
|
|
2101
1998
|
*/
|
|
2102
|
-
readonly location:
|
|
1999
|
+
readonly location: Vector3;
|
|
2103
2000
|
/**
|
|
2104
2001
|
* Text of the sign
|
|
2105
2002
|
* @throws This property can throw when used.
|
|
@@ -2132,7 +2029,7 @@ export class BlockSnowContainerComponent extends BlockComponent {
|
|
|
2132
2029
|
/**
|
|
2133
2030
|
* Source location of the block.
|
|
2134
2031
|
*/
|
|
2135
|
-
readonly location:
|
|
2032
|
+
readonly location: Vector3;
|
|
2136
2033
|
/**
|
|
2137
2034
|
* Identifier of this component. Should always be
|
|
2138
2035
|
* minecraft:snowContainer.
|
|
@@ -2178,10 +2075,6 @@ export class BlockType {
|
|
|
2178
2075
|
*/
|
|
2179
2076
|
export class BlockWaterContainerComponent extends BlockComponent {
|
|
2180
2077
|
protected constructor();
|
|
2181
|
-
/**
|
|
2182
|
-
* Represents a color facet of the water.
|
|
2183
|
-
*/
|
|
2184
|
-
customColor: Color;
|
|
2185
2078
|
/**
|
|
2186
2079
|
* Relative level of water within this block. Valid values are
|
|
2187
2080
|
* between FluidContainer.minFillLevel (0) and
|
|
@@ -2191,7 +2084,7 @@ export class BlockWaterContainerComponent extends BlockComponent {
|
|
|
2191
2084
|
/**
|
|
2192
2085
|
* Source location of the block.
|
|
2193
2086
|
*/
|
|
2194
|
-
readonly location:
|
|
2087
|
+
readonly location: Vector3;
|
|
2195
2088
|
/**
|
|
2196
2089
|
* Identifier of this component. Should always be
|
|
2197
2090
|
* minecraft:waterContainer.
|
|
@@ -2209,6 +2102,8 @@ export class BlockWaterContainerComponent extends BlockComponent {
|
|
|
2209
2102
|
* @throws This function can throw errors.
|
|
2210
2103
|
*/
|
|
2211
2104
|
addDye(itemType: ItemType): void;
|
|
2105
|
+
getCustomColor(): Color;
|
|
2106
|
+
setCustomColor(color: Color): void;
|
|
2212
2107
|
}
|
|
2213
2108
|
/**
|
|
2214
2109
|
* @beta
|
|
@@ -2221,18 +2116,16 @@ export class BoolBlockProperty extends IBlockProperty {
|
|
|
2221
2116
|
* The name of this property.
|
|
2222
2117
|
*/
|
|
2223
2118
|
readonly name: string;
|
|
2224
|
-
/**
|
|
2225
|
-
* A list of valid values for this property.
|
|
2226
|
-
*/
|
|
2227
|
-
readonly validValues: boolean[];
|
|
2228
2119
|
/**
|
|
2229
2120
|
* The current value of this property.
|
|
2230
2121
|
* @throws
|
|
2231
2122
|
* Setting this property can throw if the value passed is not
|
|
2232
2123
|
* valid for the property. Use {@link
|
|
2233
|
-
* BoolBlockProperty.validValues} to check
|
|
2124
|
+
* @minecraft/server.BoolBlockProperty.validValues} to check
|
|
2125
|
+
* allowed values.
|
|
2234
2126
|
*/
|
|
2235
2127
|
value: boolean;
|
|
2128
|
+
getValidValues(): boolean[];
|
|
2236
2129
|
}
|
|
2237
2130
|
/**
|
|
2238
2131
|
* @beta
|
|
@@ -2297,10 +2190,7 @@ export class ChatEvent {
|
|
|
2297
2190
|
* players (i.e., is not broadcast.)
|
|
2298
2191
|
*/
|
|
2299
2192
|
sendToTargets: boolean;
|
|
2300
|
-
|
|
2301
|
-
* List of players that will receive this message.
|
|
2302
|
-
*/
|
|
2303
|
-
targets: Player[];
|
|
2193
|
+
getTargets(): Player[];
|
|
2304
2194
|
}
|
|
2305
2195
|
/**
|
|
2306
2196
|
* @beta
|
|
@@ -2338,41 +2228,6 @@ export class ChatEventSignal {
|
|
|
2338
2228
|
*/
|
|
2339
2229
|
unsubscribe(callback: (arg: ChatEvent) => void): void;
|
|
2340
2230
|
}
|
|
2341
|
-
/**
|
|
2342
|
-
* @beta
|
|
2343
|
-
* Represents a fully customizable color within Minecraft.
|
|
2344
|
-
*/
|
|
2345
|
-
export class Color {
|
|
2346
|
-
/**
|
|
2347
|
-
* Determines a color's alpha (opacity) component. Valid values
|
|
2348
|
-
* are between 0 (transparent) and 1.0 (opaque).
|
|
2349
|
-
*/
|
|
2350
|
-
alpha: number;
|
|
2351
|
-
/**
|
|
2352
|
-
* Determines a color's blue component. Valid values are
|
|
2353
|
-
* between 0 and 1.0.
|
|
2354
|
-
*/
|
|
2355
|
-
blue: number;
|
|
2356
|
-
/**
|
|
2357
|
-
* Determines a color's green component. Valid values are
|
|
2358
|
-
* between 0 and 1.0.
|
|
2359
|
-
*/
|
|
2360
|
-
green: number;
|
|
2361
|
-
/**
|
|
2362
|
-
* Determines a color's red component. Valid values are between
|
|
2363
|
-
* 0 and 1.0.
|
|
2364
|
-
*/
|
|
2365
|
-
red: number;
|
|
2366
|
-
/**
|
|
2367
|
-
* @remarks
|
|
2368
|
-
* Creates a new color using the specified color values.
|
|
2369
|
-
* @param red
|
|
2370
|
-
* @param green
|
|
2371
|
-
* @param blue
|
|
2372
|
-
* @param alpha
|
|
2373
|
-
*/
|
|
2374
|
-
constructor(red: number, green: number, blue: number, alpha: number);
|
|
2375
|
-
}
|
|
2376
2231
|
/**
|
|
2377
2232
|
* Contains return data on the result of a command execution.
|
|
2378
2233
|
*/
|
|
@@ -2540,6 +2395,7 @@ export class ContainerSlot {
|
|
|
2540
2395
|
* @throws This function can throw errors.
|
|
2541
2396
|
*/
|
|
2542
2397
|
clearItem(): void;
|
|
2398
|
+
clearLore(): void;
|
|
2543
2399
|
/**
|
|
2544
2400
|
* @remarks
|
|
2545
2401
|
* Returns the item stored within the container.
|
|
@@ -2552,7 +2408,7 @@ export class ContainerSlot {
|
|
|
2552
2408
|
* container slot.
|
|
2553
2409
|
* @throws This function can throw errors.
|
|
2554
2410
|
*/
|
|
2555
|
-
getLore(): string[]
|
|
2411
|
+
getLore(): string[];
|
|
2556
2412
|
/**
|
|
2557
2413
|
* @remarks
|
|
2558
2414
|
* Sets the item within the slot to a new value.
|
|
@@ -2568,7 +2424,7 @@ export class ContainerSlot {
|
|
|
2568
2424
|
* An array of strings for lines of text for this lore.
|
|
2569
2425
|
* @throws This function can throw errors.
|
|
2570
2426
|
*/
|
|
2571
|
-
setLore(loreList
|
|
2427
|
+
setLore(loreList?: string[]): void;
|
|
2572
2428
|
}
|
|
2573
2429
|
/**
|
|
2574
2430
|
* @beta
|
|
@@ -2586,11 +2442,7 @@ export class DataDrivenEntityTriggerEvent {
|
|
|
2586
2442
|
* Name of the data driven event being triggered.
|
|
2587
2443
|
*/
|
|
2588
2444
|
readonly id: string;
|
|
2589
|
-
|
|
2590
|
-
* A list of modifications to component state that are the
|
|
2591
|
-
* effect of this triggered event.
|
|
2592
|
-
*/
|
|
2593
|
-
readonly modifiers: DefinitionModifier[];
|
|
2445
|
+
getModifiers(): DefinitionModifier[];
|
|
2594
2446
|
}
|
|
2595
2447
|
/**
|
|
2596
2448
|
* @beta
|
|
@@ -2626,21 +2478,12 @@ export class DataDrivenEntityTriggerEventSignal {
|
|
|
2626
2478
|
* of an entity.
|
|
2627
2479
|
*/
|
|
2628
2480
|
export class DefinitionModifier {
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
* A list of components that will be removed via this
|
|
2636
|
-
* definition modification.
|
|
2637
|
-
*/
|
|
2638
|
-
readonly componentGroupsToRemove: string[];
|
|
2639
|
-
/**
|
|
2640
|
-
* A list of entity definition events that will be fired via
|
|
2641
|
-
* this update.
|
|
2642
|
-
*/
|
|
2643
|
-
triggers: Trigger[];
|
|
2481
|
+
getComponentGroupsToAdd(): string[];
|
|
2482
|
+
getComponentGroupsToRemove(): string[];
|
|
2483
|
+
getTriggers(): Trigger[];
|
|
2484
|
+
setComponentGroupsToAdd(newGroups: string[]): void;
|
|
2485
|
+
setComponentGroupsToRemove(removedGroups: string[]): void;
|
|
2486
|
+
setTriggers(newTriggers: Trigger[]): void;
|
|
2644
2487
|
}
|
|
2645
2488
|
/**
|
|
2646
2489
|
* A class that represents a particular dimension (e.g., The
|
|
@@ -2670,46 +2513,43 @@ export class Dimension {
|
|
|
2670
2513
|
* ```
|
|
2671
2514
|
* @example createFireAndWaterExplosions.ts
|
|
2672
2515
|
* ```typescript
|
|
2673
|
-
*
|
|
2516
|
+
* const explosionLoc: mc.Vector3 = { x: targetLocation.x + 0.5, y: targetLocation.y + 0.5, z: targetLocation.z + 0.5 };
|
|
2517
|
+
*
|
|
2518
|
+
* const fireExplosionOptions = new mc.ExplosionOptions();
|
|
2674
2519
|
*
|
|
2675
|
-
*
|
|
2520
|
+
* // Explode with fire
|
|
2521
|
+
* fireExplosionOptions.causesFire = true;
|
|
2676
2522
|
*
|
|
2677
|
-
*
|
|
2678
|
-
*
|
|
2523
|
+
* overworld.createExplosion(explosionLoc, 15, fireExplosionOptions);
|
|
2524
|
+
* const waterExplosionOptions = new mc.ExplosionOptions();
|
|
2679
2525
|
*
|
|
2680
|
-
*
|
|
2681
|
-
*
|
|
2526
|
+
* // Explode in water
|
|
2527
|
+
* waterExplosionOptions.allowUnderwater = true;
|
|
2682
2528
|
*
|
|
2683
|
-
*
|
|
2684
|
-
* waterExplosionOptions.allowUnderwater = true;
|
|
2529
|
+
* const belowWaterLoc: mc.Vector3 = { x: targetLocation.x + 3, y: targetLocation.y + 1, z: targetLocation.z + 3 };
|
|
2685
2530
|
*
|
|
2686
|
-
*
|
|
2531
|
+
* overworld.createExplosion(belowWaterLoc, 10, waterExplosionOptions);
|
|
2687
2532
|
*
|
|
2688
|
-
* overworld.createExplosion(belowWaterLoc, 10, waterExplosionOptions);
|
|
2689
2533
|
* ```
|
|
2690
2534
|
* @example createNoBlockExplosion.ts
|
|
2691
2535
|
* ```typescript
|
|
2692
|
-
*
|
|
2536
|
+
* const explosionOptions = new mc.ExplosionOptions();
|
|
2693
2537
|
*
|
|
2694
|
-
*
|
|
2695
|
-
*
|
|
2538
|
+
* // Start by exploding without breaking blocks
|
|
2539
|
+
* explosionOptions.breaksBlocks = false;
|
|
2696
2540
|
*
|
|
2697
|
-
*
|
|
2698
|
-
*
|
|
2699
|
-
*
|
|
2700
|
-
*
|
|
2701
|
-
*
|
|
2541
|
+
* const explodeNoBlocksLoc: mc.Vector3 = {
|
|
2542
|
+
* x: Math.floor(targetLocation.x + 1),
|
|
2543
|
+
* y: Math.floor(targetLocation.y + 2),
|
|
2544
|
+
* z: Math.floor(targetLocation.z + 1),
|
|
2545
|
+
* };
|
|
2546
|
+
*
|
|
2547
|
+
* overworld.createExplosion(explodeNoBlocksLoc, 15, explosionOptions);
|
|
2702
2548
|
*
|
|
2703
|
-
* overworld.createExplosion(explodeNoBlocksLoc, 15, explosionOptions);
|
|
2704
2549
|
* ```
|
|
2705
2550
|
*/
|
|
2706
|
-
createExplosion(location:
|
|
2707
|
-
fillBlocks(
|
|
2708
|
-
begin: BlockLocation,
|
|
2709
|
-
end: BlockLocation,
|
|
2710
|
-
block: BlockPermutation | BlockType,
|
|
2711
|
-
options?: BlockFillOptions,
|
|
2712
|
-
): number;
|
|
2551
|
+
createExplosion(location: Vector3, radius: number, explosionOptions?: ExplosionOptions): void;
|
|
2552
|
+
fillBlocks(begin: Vector3, end: Vector3, block: BlockPermutation | BlockType, options?: BlockFillOptions): number;
|
|
2713
2553
|
/**
|
|
2714
2554
|
* @beta
|
|
2715
2555
|
* @remarks
|
|
@@ -2721,7 +2561,7 @@ export class Dimension {
|
|
|
2721
2561
|
* Block at the specified location.
|
|
2722
2562
|
* @throws This function can throw errors.
|
|
2723
2563
|
*/
|
|
2724
|
-
getBlock(location:
|
|
2564
|
+
getBlock(location: Vector3): Block;
|
|
2725
2565
|
/**
|
|
2726
2566
|
* @beta
|
|
2727
2567
|
* @remarks
|
|
@@ -2733,7 +2573,7 @@ export class Dimension {
|
|
|
2733
2573
|
* Additional options for processing this raycast query.
|
|
2734
2574
|
* @throws This function can throw errors.
|
|
2735
2575
|
*/
|
|
2736
|
-
getBlockFromRay(location:
|
|
2576
|
+
getBlockFromRay(location: Vector3, direction: Vector3, options?: BlockRaycastOptions): Block;
|
|
2737
2577
|
/**
|
|
2738
2578
|
* @beta
|
|
2739
2579
|
* @remarks
|
|
@@ -2774,7 +2614,7 @@ export class Dimension {
|
|
|
2774
2614
|
* @returns
|
|
2775
2615
|
* Zero or more entities at the specified location.
|
|
2776
2616
|
*/
|
|
2777
|
-
getEntitiesAtBlockLocation(location:
|
|
2617
|
+
getEntitiesAtBlockLocation(location: Vector3): Entity[];
|
|
2778
2618
|
/**
|
|
2779
2619
|
* @beta
|
|
2780
2620
|
* @remarks
|
|
@@ -2786,7 +2626,7 @@ export class Dimension {
|
|
|
2786
2626
|
* Additional options for processing this raycast query.
|
|
2787
2627
|
* @throws This function can throw errors.
|
|
2788
2628
|
*/
|
|
2789
|
-
getEntitiesFromRay(location:
|
|
2629
|
+
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): Entity[];
|
|
2790
2630
|
/**
|
|
2791
2631
|
* @beta
|
|
2792
2632
|
* @remarks
|
|
@@ -2834,20 +2674,23 @@ export class Dimension {
|
|
|
2834
2674
|
* ```
|
|
2835
2675
|
* @example quickFoxLazyDog.ts
|
|
2836
2676
|
* ```typescript
|
|
2837
|
-
*
|
|
2838
|
-
*
|
|
2839
|
-
*
|
|
2840
|
-
*
|
|
2841
|
-
*
|
|
2842
|
-
*
|
|
2677
|
+
* const fox = overworld.spawnEntity("minecraft:fox", {
|
|
2678
|
+
* x: targetLocation.x + 1,
|
|
2679
|
+
* y: targetLocation.y + 2,
|
|
2680
|
+
* z: targetLocation.z + 3,
|
|
2681
|
+
* });
|
|
2682
|
+
* fox.addEffect(mc.MinecraftEffectTypes.speed, 10, 20);
|
|
2683
|
+
* log("Created a fox.");
|
|
2684
|
+
*
|
|
2685
|
+
* const wolf = overworld.spawnEntity("minecraft:wolf", {
|
|
2686
|
+
* x: targetLocation.x + 4,
|
|
2687
|
+
* y: targetLocation.y + 2,
|
|
2688
|
+
* z: targetLocation.z + 3,
|
|
2689
|
+
* });
|
|
2690
|
+
* wolf.addEffect(mc.MinecraftEffectTypes.slowness, 10, 20);
|
|
2691
|
+
* wolf.isSneaking = true;
|
|
2692
|
+
* log("Created a sneaking wolf.", 1);
|
|
2843
2693
|
*
|
|
2844
|
-
* const wolf = overworld.spawnEntity(
|
|
2845
|
-
* "minecraft:wolf",
|
|
2846
|
-
* new mc.BlockLocation(targetLocation.x + 4, targetLocation.y + 2, targetLocation.z + 3)
|
|
2847
|
-
* );
|
|
2848
|
-
* wolf.addEffect(mc.MinecraftEffectTypes.slowness, 10, 20);
|
|
2849
|
-
* wolf.isSneaking = true;
|
|
2850
|
-
* log("Created a sneaking wolf.", 1);
|
|
2851
2694
|
* ```
|
|
2852
2695
|
* @example trapTick.ts
|
|
2853
2696
|
* ```typescript
|
|
@@ -2863,7 +2706,7 @@ export class Dimension {
|
|
|
2863
2706
|
* });
|
|
2864
2707
|
* ```
|
|
2865
2708
|
*/
|
|
2866
|
-
spawnEntity(identifier: string, location:
|
|
2709
|
+
spawnEntity(identifier: string, location: Vector3): Entity;
|
|
2867
2710
|
/**
|
|
2868
2711
|
* @beta
|
|
2869
2712
|
* @remarks
|
|
@@ -2877,17 +2720,18 @@ export class Dimension {
|
|
|
2877
2720
|
* @throws This function can throw errors.
|
|
2878
2721
|
* @example itemStacks.ts
|
|
2879
2722
|
* ```typescript
|
|
2880
|
-
*
|
|
2881
|
-
*
|
|
2882
|
-
*
|
|
2723
|
+
* const oneItemLoc: mc.Vector3 = { x: 3, y: 2, z: 1 };
|
|
2724
|
+
* const fiveItemsLoc: mc.Vector3 = { x: 1, y: 2, z: 1 };
|
|
2725
|
+
* const diamondPickaxeLoc: mc.Vector3 = { x: 2, y: 2, z: 4 };
|
|
2883
2726
|
*
|
|
2884
|
-
*
|
|
2885
|
-
*
|
|
2886
|
-
*
|
|
2727
|
+
* const oneEmerald = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 1, 0);
|
|
2728
|
+
* const onePickaxe = new mc.ItemStack(mc.MinecraftItemTypes.diamondPickaxe, 1, 0);
|
|
2729
|
+
* const fiveEmeralds = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 5, 0);
|
|
2730
|
+
*
|
|
2731
|
+
* overworld.spawnItem(oneEmerald, oneItemLoc);
|
|
2732
|
+
* overworld.spawnItem(fiveEmeralds, fiveItemsLoc);
|
|
2733
|
+
* overworld.spawnItem(onePickaxe, diamondPickaxeLoc);
|
|
2887
2734
|
*
|
|
2888
|
-
* overworld.spawnItem(oneEmerald, oneItemLoc);
|
|
2889
|
-
* overworld.spawnItem(fiveEmeralds, fiveItemsLoc);
|
|
2890
|
-
* overworld.spawnItem(onePickaxe, diamondPickaxeLoc);
|
|
2891
2735
|
* ```
|
|
2892
2736
|
* @example spawnItem.ts
|
|
2893
2737
|
* ```typescript
|
|
@@ -2897,7 +2741,7 @@ export class Dimension {
|
|
|
2897
2741
|
* log("New feather created!");
|
|
2898
2742
|
* ```
|
|
2899
2743
|
*/
|
|
2900
|
-
spawnItem(item: ItemStack, location:
|
|
2744
|
+
spawnItem(item: ItemStack, location: Vector3): Entity;
|
|
2901
2745
|
/**
|
|
2902
2746
|
* @beta
|
|
2903
2747
|
* @remarks
|
|
@@ -2913,7 +2757,7 @@ export class Dimension {
|
|
|
2913
2757
|
* @returns
|
|
2914
2758
|
* Newly created entity at the specified location.
|
|
2915
2759
|
*/
|
|
2916
|
-
spawnParticle(effectName: string, location:
|
|
2760
|
+
spawnParticle(effectName: string, location: Vector3, molangVariables: MolangVariableMap): void;
|
|
2917
2761
|
}
|
|
2918
2762
|
/**
|
|
2919
2763
|
* @beta
|
|
@@ -2926,15 +2770,11 @@ export class DirectionBlockProperty extends IBlockProperty {
|
|
|
2926
2770
|
* Name of the property.
|
|
2927
2771
|
*/
|
|
2928
2772
|
readonly name: string;
|
|
2929
|
-
/**
|
|
2930
|
-
* A set of acceptable potential values for the direction-based
|
|
2931
|
-
* block property.
|
|
2932
|
-
*/
|
|
2933
|
-
readonly validValues: Direction[];
|
|
2934
2773
|
/**
|
|
2935
2774
|
* Value of the block property.
|
|
2936
2775
|
*/
|
|
2937
2776
|
value: Direction;
|
|
2777
|
+
getValidValues(): Direction[];
|
|
2938
2778
|
}
|
|
2939
2779
|
/**
|
|
2940
2780
|
* @beta
|
|
@@ -3189,7 +3029,7 @@ export class Entity {
|
|
|
3189
3029
|
* Location of the center of the head component of the entity.
|
|
3190
3030
|
* @throws This property can throw when used.
|
|
3191
3031
|
*/
|
|
3192
|
-
readonly headLocation:
|
|
3032
|
+
readonly headLocation: Vector3;
|
|
3193
3033
|
/**
|
|
3194
3034
|
* Unique identifier of the entity. This identifier is intended
|
|
3195
3035
|
* to be consistent across loads of a world instance. No
|
|
@@ -3215,12 +3055,6 @@ export class Entity {
|
|
|
3215
3055
|
* Given name of the entity.
|
|
3216
3056
|
*/
|
|
3217
3057
|
nameTag: string;
|
|
3218
|
-
/**
|
|
3219
|
-
* @beta
|
|
3220
|
-
* Main rotation of the entity.
|
|
3221
|
-
* @throws This property can throw when used.
|
|
3222
|
-
*/
|
|
3223
|
-
readonly rotation: XYRotation;
|
|
3224
3058
|
/**
|
|
3225
3059
|
* @beta
|
|
3226
3060
|
* Returns a scoreboard identity that represents this entity.
|
|
@@ -3240,18 +3074,6 @@ export class Entity {
|
|
|
3240
3074
|
* @throws This property can throw when used.
|
|
3241
3075
|
*/
|
|
3242
3076
|
readonly typeId: string;
|
|
3243
|
-
/**
|
|
3244
|
-
* @beta
|
|
3245
|
-
* Velocity of the entity.
|
|
3246
|
-
* @throws This property can throw when used.
|
|
3247
|
-
*/
|
|
3248
|
-
readonly velocity: Vector;
|
|
3249
|
-
/**
|
|
3250
|
-
* @beta
|
|
3251
|
-
* Direction that this entity is looking out from.
|
|
3252
|
-
* @throws This property can throw when used.
|
|
3253
|
-
*/
|
|
3254
|
-
readonly viewDirection: Vector3;
|
|
3255
3077
|
/**
|
|
3256
3078
|
* @beta
|
|
3257
3079
|
* @remarks
|
|
@@ -3267,29 +3089,34 @@ export class Entity {
|
|
|
3267
3089
|
* @example addEffect.js
|
|
3268
3090
|
* ```typescript
|
|
3269
3091
|
* const villagerId = "minecraft:villager_v2<minecraft:ageable_grow_up>";
|
|
3270
|
-
* const villagerLoc =
|
|
3092
|
+
* const villagerLoc: mc.Vector3 = { x: 1, y: 2, z: 1 };
|
|
3271
3093
|
* const villager = test.spawn(villagerId, villagerLoc);
|
|
3272
3094
|
* const duration = 20;
|
|
3273
3095
|
*
|
|
3274
3096
|
* villager.addEffect(MinecraftEffectTypes.poison, duration, 1);
|
|
3275
3097
|
*
|
|
3098
|
+
*
|
|
3276
3099
|
* ```
|
|
3277
3100
|
* @example quickFoxLazyDog.ts
|
|
3278
3101
|
* ```typescript
|
|
3279
|
-
*
|
|
3280
|
-
*
|
|
3281
|
-
*
|
|
3282
|
-
*
|
|
3283
|
-
*
|
|
3284
|
-
*
|
|
3102
|
+
* const fox = overworld.spawnEntity("minecraft:fox", {
|
|
3103
|
+
* x: targetLocation.x + 1,
|
|
3104
|
+
* y: targetLocation.y + 2,
|
|
3105
|
+
* z: targetLocation.z + 3,
|
|
3106
|
+
* });
|
|
3107
|
+
* fox.addEffect(mc.MinecraftEffectTypes.speed, 10, 20);
|
|
3108
|
+
* log("Created a fox.");
|
|
3109
|
+
*
|
|
3110
|
+
* const wolf = overworld.spawnEntity("minecraft:wolf", {
|
|
3111
|
+
* x: targetLocation.x + 4,
|
|
3112
|
+
* y: targetLocation.y + 2,
|
|
3113
|
+
* z: targetLocation.z + 3,
|
|
3114
|
+
* });
|
|
3115
|
+
* wolf.addEffect(mc.MinecraftEffectTypes.slowness, 10, 20);
|
|
3116
|
+
* wolf.isSneaking = true;
|
|
3117
|
+
* log("Created a sneaking wolf.", 1);
|
|
3118
|
+
*
|
|
3285
3119
|
*
|
|
3286
|
-
* const wolf = overworld.spawnEntity(
|
|
3287
|
-
* "minecraft:wolf",
|
|
3288
|
-
* new mc.BlockLocation(targetLocation.x + 4, targetLocation.y + 2, targetLocation.z + 3)
|
|
3289
|
-
* );
|
|
3290
|
-
* wolf.addEffect(mc.MinecraftEffectTypes.slowness, 10, 20);
|
|
3291
|
-
* wolf.isSneaking = true;
|
|
3292
|
-
* log("Created a sneaking wolf.", 1);
|
|
3293
3120
|
* ```
|
|
3294
3121
|
*/
|
|
3295
3122
|
addEffect(effectType: EffectType, duration: number, amplifier?: number, showParticles?: boolean): void;
|
|
@@ -3365,6 +3192,7 @@ export class Entity {
|
|
|
3365
3192
|
* @throws This function can throw errors.
|
|
3366
3193
|
*/
|
|
3367
3194
|
getEntitiesFromViewDirection(options?: EntityRaycastOptions): Entity[];
|
|
3195
|
+
getRotation(): XYRotation;
|
|
3368
3196
|
/**
|
|
3369
3197
|
* @beta
|
|
3370
3198
|
* @remarks
|
|
@@ -3372,6 +3200,8 @@ export class Entity {
|
|
|
3372
3200
|
* @throws This function can throw errors.
|
|
3373
3201
|
*/
|
|
3374
3202
|
getTags(): string[];
|
|
3203
|
+
getVelocity(): Vector3;
|
|
3204
|
+
getViewDirection(): Vector3;
|
|
3375
3205
|
/**
|
|
3376
3206
|
* @beta
|
|
3377
3207
|
* @remarks
|
|
@@ -3548,24 +3378,12 @@ export class EntityAddRiderComponent extends IEntityComponent {
|
|
|
3548
3378
|
*/
|
|
3549
3379
|
export class EntityAgeableComponent extends IEntityComponent {
|
|
3550
3380
|
protected constructor();
|
|
3551
|
-
/**
|
|
3552
|
-
* List of items that the entity drops when it grows up.
|
|
3553
|
-
* @throws This property can throw when used.
|
|
3554
|
-
*/
|
|
3555
|
-
readonly dropItems: string[];
|
|
3556
3381
|
/**
|
|
3557
3382
|
* Amount of time before the entity grows up, -1 for always a
|
|
3558
3383
|
* baby.
|
|
3559
3384
|
* @throws This property can throw when used.
|
|
3560
3385
|
*/
|
|
3561
3386
|
readonly duration: number;
|
|
3562
|
-
/**
|
|
3563
|
-
* List of items that can be fed to the entity. Includes 'item'
|
|
3564
|
-
* for the item name and 'growth' to define how much time it
|
|
3565
|
-
* grows up by.
|
|
3566
|
-
* @throws This property can throw when used.
|
|
3567
|
-
*/
|
|
3568
|
-
readonly feedItems: EntityDefinitionFeedItem[];
|
|
3569
3387
|
/**
|
|
3570
3388
|
* Event to run when this entity grows up.
|
|
3571
3389
|
* @throws This property can throw when used.
|
|
@@ -3581,6 +3399,8 @@ export class EntityAgeableComponent extends IEntityComponent {
|
|
|
3581
3399
|
* minecraft:ageable.
|
|
3582
3400
|
*/
|
|
3583
3401
|
static readonly componentId = 'minecraft:ageable';
|
|
3402
|
+
getDropItems(): string[];
|
|
3403
|
+
getFeedItems(): EntityDefinitionFeedItem[];
|
|
3584
3404
|
}
|
|
3585
3405
|
/**
|
|
3586
3406
|
* @beta
|
|
@@ -3589,12 +3409,6 @@ export class EntityAgeableComponent extends IEntityComponent {
|
|
|
3589
3409
|
*/
|
|
3590
3410
|
export class EntityBreathableComponent extends IEntityComponent {
|
|
3591
3411
|
protected constructor();
|
|
3592
|
-
/**
|
|
3593
|
-
* List of blocks this entity can breathe in, in addition to
|
|
3594
|
-
* the separate properties for classes of blocks.
|
|
3595
|
-
* @throws This property can throw when used.
|
|
3596
|
-
*/
|
|
3597
|
-
readonly breatheBlocks: BlockPermutation[];
|
|
3598
3412
|
/**
|
|
3599
3413
|
* If true, this entity can breathe in air.
|
|
3600
3414
|
* @throws This property can throw when used.
|
|
@@ -3626,11 +3440,6 @@ export class EntityBreathableComponent extends IEntityComponent {
|
|
|
3626
3440
|
* @throws This property can throw when used.
|
|
3627
3441
|
*/
|
|
3628
3442
|
readonly inhaleTime: number;
|
|
3629
|
-
/**
|
|
3630
|
-
* List of blocks this entity can't breathe in.
|
|
3631
|
-
* @throws This property can throw when used.
|
|
3632
|
-
*/
|
|
3633
|
-
readonly nonBreatheBlocks: BlockPermutation[];
|
|
3634
3443
|
/**
|
|
3635
3444
|
* Time in seconds between suffocation damage.
|
|
3636
3445
|
* @throws This property can throw when used.
|
|
@@ -3651,6 +3460,8 @@ export class EntityBreathableComponent extends IEntityComponent {
|
|
|
3651
3460
|
* minecraft:breathable.
|
|
3652
3461
|
*/
|
|
3653
3462
|
static readonly componentId = 'minecraft:breathable';
|
|
3463
|
+
getBreatheBlocks(): BlockPermutation[];
|
|
3464
|
+
getNonBreatheBlocks(): BlockPermutation[];
|
|
3654
3465
|
/**
|
|
3655
3466
|
* @remarks
|
|
3656
3467
|
* Sets the current air supply of the entity.
|
|
@@ -3757,6 +3568,16 @@ export class EntityDefinitionFeedItem {
|
|
|
3757
3568
|
*/
|
|
3758
3569
|
readonly item: string;
|
|
3759
3570
|
}
|
|
3571
|
+
export class EntityDieEvent {
|
|
3572
|
+
protected constructor();
|
|
3573
|
+
readonly damageSource: EntityDamageSource;
|
|
3574
|
+
readonly deadEntity: Entity;
|
|
3575
|
+
}
|
|
3576
|
+
export class EntityDieEventSignal {
|
|
3577
|
+
protected constructor();
|
|
3578
|
+
subscribe(callback: (arg: EntityDieEvent) => void, options?: EntityEventOptions): (arg: EntityDieEvent) => void;
|
|
3579
|
+
unsubscribe(callback: (arg: EntityDieEvent) => void): void;
|
|
3580
|
+
}
|
|
3760
3581
|
/**
|
|
3761
3582
|
* @beta
|
|
3762
3583
|
* When added, this component signifies that this entity
|
|
@@ -3877,11 +3698,6 @@ export class EntityHealableComponent extends IEntityComponent {
|
|
|
3877
3698
|
* @throws This property can throw when used.
|
|
3878
3699
|
*/
|
|
3879
3700
|
readonly forceUse: boolean;
|
|
3880
|
-
/**
|
|
3881
|
-
* A set of items that can specifically heal this entity.
|
|
3882
|
-
* @throws This property can throw when used.
|
|
3883
|
-
*/
|
|
3884
|
-
readonly items: FeedItem[];
|
|
3885
3701
|
/**
|
|
3886
3702
|
* Identifier of this component. Should always be
|
|
3887
3703
|
* minecraft:healable.
|
|
@@ -3892,6 +3708,7 @@ export class EntityHealableComponent extends IEntityComponent {
|
|
|
3892
3708
|
* minecraft:healable.
|
|
3893
3709
|
*/
|
|
3894
3710
|
static readonly componentId = 'minecraft:healable';
|
|
3711
|
+
getFeedItems(): FeedItem[];
|
|
3895
3712
|
}
|
|
3896
3713
|
/**
|
|
3897
3714
|
* @beta
|
|
@@ -3946,7 +3763,7 @@ export class EntityHealthComponent extends IEntityComponent {
|
|
|
3946
3763
|
* @param value
|
|
3947
3764
|
* @throws This function can throw errors.
|
|
3948
3765
|
*/
|
|
3949
|
-
setCurrent(value: number):
|
|
3766
|
+
setCurrent(value: number): boolean;
|
|
3950
3767
|
}
|
|
3951
3768
|
/**
|
|
3952
3769
|
* @beta
|
|
@@ -3998,18 +3815,6 @@ export class EntityHitEventSignal {
|
|
|
3998
3815
|
*/
|
|
3999
3816
|
unsubscribe(callback: (arg: EntityHitEvent) => void): void;
|
|
4000
3817
|
}
|
|
4001
|
-
/**
|
|
4002
|
-
* @beta
|
|
4003
|
-
* Contains additional information about an entity that was
|
|
4004
|
-
* hit.
|
|
4005
|
-
*/
|
|
4006
|
-
export class EntityHitInformation {
|
|
4007
|
-
protected constructor();
|
|
4008
|
-
/**
|
|
4009
|
-
* Entity that was hit.
|
|
4010
|
-
*/
|
|
4011
|
-
readonly entity: Entity;
|
|
4012
|
-
}
|
|
4013
3818
|
/**
|
|
4014
3819
|
* @beta
|
|
4015
3820
|
* Contains information related to an entity getting hurt by
|
|
@@ -4434,7 +4239,7 @@ export class EntityLavaMovementComponent extends IEntityComponent {
|
|
|
4434
4239
|
* @param value
|
|
4435
4240
|
* @throws This function can throw errors.
|
|
4436
4241
|
*/
|
|
4437
|
-
setCurrent(value: number):
|
|
4242
|
+
setCurrent(value: number): boolean;
|
|
4438
4243
|
}
|
|
4439
4244
|
/**
|
|
4440
4245
|
* @beta
|
|
@@ -4624,7 +4429,7 @@ export class EntityMovementComponent extends IEntityComponent {
|
|
|
4624
4429
|
* @param value
|
|
4625
4430
|
* @throws This function can throw errors.
|
|
4626
4431
|
*/
|
|
4627
|
-
setCurrent(value: number):
|
|
4432
|
+
setCurrent(value: number): boolean;
|
|
4628
4433
|
}
|
|
4629
4434
|
/**
|
|
4630
4435
|
* @beta
|
|
@@ -5620,12 +5425,6 @@ export class EntityRideableComponent extends IEntityComponent {
|
|
|
5620
5425
|
* @throws This property can throw when used.
|
|
5621
5426
|
*/
|
|
5622
5427
|
readonly crouchingSkipInteract: boolean;
|
|
5623
|
-
/**
|
|
5624
|
-
* A string-list of entity types that this entity can support
|
|
5625
|
-
* as riders.
|
|
5626
|
-
* @throws This property can throw when used.
|
|
5627
|
-
*/
|
|
5628
|
-
readonly familyTypes: string[];
|
|
5629
5428
|
/**
|
|
5630
5429
|
* Set of text that should be displayed when a player is
|
|
5631
5430
|
* looking to ride on this entity (commonly with touch-screen
|
|
@@ -5650,12 +5449,6 @@ export class EntityRideableComponent extends IEntityComponent {
|
|
|
5650
5449
|
* @throws This property can throw when used.
|
|
5651
5450
|
*/
|
|
5652
5451
|
readonly seatCount: number;
|
|
5653
|
-
/**
|
|
5654
|
-
* The list of positions and number of riders for each position
|
|
5655
|
-
* for entities riding this entity.
|
|
5656
|
-
* @throws This property can throw when used.
|
|
5657
|
-
*/
|
|
5658
|
-
readonly seats: Seat[];
|
|
5659
5452
|
/**
|
|
5660
5453
|
* Identifier of this component. Should always be
|
|
5661
5454
|
* minecraft:rideable.
|
|
@@ -5690,6 +5483,8 @@ export class EntityRideableComponent extends IEntityComponent {
|
|
|
5690
5483
|
* @throws This function can throw errors.
|
|
5691
5484
|
*/
|
|
5692
5485
|
ejectRiders(): void;
|
|
5486
|
+
getFamilyTypes(): string[];
|
|
5487
|
+
getSeats(): Seat[];
|
|
5693
5488
|
}
|
|
5694
5489
|
/**
|
|
5695
5490
|
* @beta
|
|
@@ -5821,11 +5616,6 @@ export class EntityTameableComponent extends IEntityComponent {
|
|
|
5821
5616
|
* @throws This property can throw when used.
|
|
5822
5617
|
*/
|
|
5823
5618
|
readonly tameEvent: Trigger;
|
|
5824
|
-
/**
|
|
5825
|
-
* The list of items that can be used to tame this entity.
|
|
5826
|
-
* @throws This property can throw when used.
|
|
5827
|
-
*/
|
|
5828
|
-
readonly tameItems: string[];
|
|
5829
5619
|
/**
|
|
5830
5620
|
* Identifier of this component. Should always be
|
|
5831
5621
|
* minecraft:tameable.
|
|
@@ -5836,6 +5626,7 @@ export class EntityTameableComponent extends IEntityComponent {
|
|
|
5836
5626
|
* minecraft:tameable.
|
|
5837
5627
|
*/
|
|
5838
5628
|
static readonly componentId = 'minecraft:tameable';
|
|
5629
|
+
getTameItems(): string[];
|
|
5839
5630
|
/**
|
|
5840
5631
|
* @remarks
|
|
5841
5632
|
* Tames this entity.
|
|
@@ -5945,7 +5736,7 @@ export class EntityUnderwaterMovementComponent extends IEntityComponent {
|
|
|
5945
5736
|
* @param value
|
|
5946
5737
|
* @throws This function can throw errors.
|
|
5947
5738
|
*/
|
|
5948
|
-
setCurrent(value: number):
|
|
5739
|
+
setCurrent(value: number): boolean;
|
|
5949
5740
|
}
|
|
5950
5741
|
/**
|
|
5951
5742
|
* @beta
|
|
@@ -6068,6 +5859,7 @@ export class Events {
|
|
|
6068
5859
|
* an entity.
|
|
6069
5860
|
*/
|
|
6070
5861
|
readonly effectAdd: EffectAddEventSignal;
|
|
5862
|
+
readonly entityDie: EntityDieEventSignal;
|
|
6071
5863
|
/**
|
|
6072
5864
|
* This event fires when an entity hits (makes a melee attack)
|
|
6073
5865
|
* and potentially impacts another entity or block.
|
|
@@ -6161,11 +5953,7 @@ export class Events {
|
|
|
6161
5953
|
/**
|
|
6162
5954
|
* This event fires when a projectile hits an entity or block.
|
|
6163
5955
|
*/
|
|
6164
|
-
projectileHit: ProjectileHitEventSignal;
|
|
6165
|
-
/**
|
|
6166
|
-
* This event fires every tick - which is 20 times per second.
|
|
6167
|
-
*/
|
|
6168
|
-
readonly tick: TickEventSignal;
|
|
5956
|
+
readonly projectileHit: ProjectileHitEventSignal;
|
|
6169
5957
|
/**
|
|
6170
5958
|
* This event will be triggered when the weather changes within
|
|
6171
5959
|
* Minecraft.
|
|
@@ -6192,7 +5980,7 @@ export class ExplosionEvent {
|
|
|
6192
5980
|
/**
|
|
6193
5981
|
* A collection of blocks impacted by this explosion event.
|
|
6194
5982
|
*/
|
|
6195
|
-
readonly impactedBlocks:
|
|
5983
|
+
readonly impactedBlocks: Vector3[];
|
|
6196
5984
|
/**
|
|
6197
5985
|
* Optional source of the explosion.
|
|
6198
5986
|
*/
|
|
@@ -6228,11 +6016,6 @@ export class ExplosionEventSignal {
|
|
|
6228
6016
|
*/
|
|
6229
6017
|
export class FeedItem {
|
|
6230
6018
|
protected constructor();
|
|
6231
|
-
/**
|
|
6232
|
-
* As part of the Healable component, an optional collection of
|
|
6233
|
-
* side effects that can occur from being fed an item.
|
|
6234
|
-
*/
|
|
6235
|
-
readonly effects: FeedItemEffect[];
|
|
6236
6019
|
/**
|
|
6237
6020
|
* The amount of health this entity gains when fed this item.
|
|
6238
6021
|
* This number is an integer starting at 0. Sample values can
|
|
@@ -6245,6 +6028,7 @@ export class FeedItem {
|
|
|
6245
6028
|
* include 'wheat' or 'golden_apple'.
|
|
6246
6029
|
*/
|
|
6247
6030
|
readonly item: string;
|
|
6031
|
+
getEffects(): FeedItemEffect[];
|
|
6248
6032
|
}
|
|
6249
6033
|
/**
|
|
6250
6034
|
* @beta
|
|
@@ -6335,18 +6119,16 @@ export class IntBlockProperty extends IBlockProperty {
|
|
|
6335
6119
|
* The name of this property.
|
|
6336
6120
|
*/
|
|
6337
6121
|
readonly name: string;
|
|
6338
|
-
/**
|
|
6339
|
-
* A list of valid values for this particular property.
|
|
6340
|
-
*/
|
|
6341
|
-
readonly validValues: number[];
|
|
6342
6122
|
/**
|
|
6343
6123
|
* The current value of this property.
|
|
6344
6124
|
* @throws
|
|
6345
6125
|
* Setting this property can throw if the value passed is not
|
|
6346
6126
|
* valid for the property. Use {@link
|
|
6347
|
-
* IntBlockProperty.validValues} to check
|
|
6127
|
+
* @minecraft/server.IntBlockProperty.validValues} to check
|
|
6128
|
+
* allowed values.
|
|
6348
6129
|
*/
|
|
6349
6130
|
value: number;
|
|
6131
|
+
getValidValues(): number[];
|
|
6350
6132
|
}
|
|
6351
6133
|
/**
|
|
6352
6134
|
* @beta
|
|
@@ -6595,12 +6377,6 @@ export class ItemDurabilityComponent {
|
|
|
6595
6377
|
* Returns the current damage level of this particular item.
|
|
6596
6378
|
*/
|
|
6597
6379
|
damage: number;
|
|
6598
|
-
/**
|
|
6599
|
-
* A range of numbers that describes the chance of the item
|
|
6600
|
-
* losing durability.
|
|
6601
|
-
* @throws This property can throw when used.
|
|
6602
|
-
*/
|
|
6603
|
-
readonly damageRange: NumberRange;
|
|
6604
6380
|
/**
|
|
6605
6381
|
* Represents the amount of damage that this item can take
|
|
6606
6382
|
* before breaking.
|
|
@@ -6623,6 +6399,7 @@ export class ItemDurabilityComponent {
|
|
|
6623
6399
|
* @throws This function can throw errors.
|
|
6624
6400
|
*/
|
|
6625
6401
|
getDamageChance(unbreaking?: number): number;
|
|
6402
|
+
getDamageRange(): NumberRange;
|
|
6626
6403
|
}
|
|
6627
6404
|
/**
|
|
6628
6405
|
* @beta
|
|
@@ -6788,6 +6565,7 @@ export class ItemStack {
|
|
|
6788
6565
|
* data value is specified.
|
|
6789
6566
|
*/
|
|
6790
6567
|
constructor(itemType: ItemType, amount?: number, data?: number);
|
|
6568
|
+
clearLore(): void;
|
|
6791
6569
|
/**
|
|
6792
6570
|
* @remarks
|
|
6793
6571
|
* Gets a component (that represents additional capabilities)
|
|
@@ -6827,7 +6605,7 @@ export class ItemStack {
|
|
|
6827
6605
|
* ItemStack.
|
|
6828
6606
|
* @param loreList
|
|
6829
6607
|
*/
|
|
6830
|
-
setLore(loreList
|
|
6608
|
+
setLore(loreList?: string[]): void;
|
|
6831
6609
|
/**
|
|
6832
6610
|
* @remarks
|
|
6833
6611
|
* Triggers an item type event. For custom items, a number of
|
|
@@ -6897,12 +6675,12 @@ export class ItemStartUseOnEvent {
|
|
|
6897
6675
|
/**
|
|
6898
6676
|
* Location of the block being impacted.
|
|
6899
6677
|
*/
|
|
6900
|
-
readonly blockLocation:
|
|
6678
|
+
readonly blockLocation: Vector3;
|
|
6901
6679
|
/**
|
|
6902
6680
|
* Location of the resulting build block position. Useful for
|
|
6903
6681
|
* determining where a block was placed.
|
|
6904
6682
|
*/
|
|
6905
|
-
readonly buildBlockLocation:
|
|
6683
|
+
readonly buildBlockLocation: Vector3;
|
|
6906
6684
|
/**
|
|
6907
6685
|
* The impacted item stack that is starting to be used.
|
|
6908
6686
|
*/
|
|
@@ -6991,7 +6769,7 @@ export class ItemStopUseOnEvent {
|
|
|
6991
6769
|
/**
|
|
6992
6770
|
* Location of the block being impacted.
|
|
6993
6771
|
*/
|
|
6994
|
-
readonly blockLocation:
|
|
6772
|
+
readonly blockLocation: Vector3;
|
|
6995
6773
|
/**
|
|
6996
6774
|
* The impacted item stack that is being used on a block.
|
|
6997
6775
|
*/
|
|
@@ -7114,7 +6892,7 @@ export class ItemUseOnEvent {
|
|
|
7114
6892
|
/**
|
|
7115
6893
|
* Location of the block being impacted.
|
|
7116
6894
|
*/
|
|
7117
|
-
readonly blockLocation:
|
|
6895
|
+
readonly blockLocation: Vector3;
|
|
7118
6896
|
/**
|
|
7119
6897
|
* X coordinate of the item-use impact location on the face of
|
|
7120
6898
|
* the target block.
|
|
@@ -7206,61 +6984,6 @@ export class LeverActionEventSignal {
|
|
|
7206
6984
|
*/
|
|
7207
6985
|
unsubscribe(callback: (arg: LeverActionEvent) => void): void;
|
|
7208
6986
|
}
|
|
7209
|
-
/**
|
|
7210
|
-
* @beta
|
|
7211
|
-
* Contains a location description that is useful for entities
|
|
7212
|
-
* and other items. X, Y, and Z can contain decimal fractions.
|
|
7213
|
-
* For integer-based locations useful for blocks, see {@link
|
|
7214
|
-
* BlockLocation}.
|
|
7215
|
-
*/
|
|
7216
|
-
export class Location {
|
|
7217
|
-
/**
|
|
7218
|
-
* X component of this location.
|
|
7219
|
-
*/
|
|
7220
|
-
x: number;
|
|
7221
|
-
/**
|
|
7222
|
-
* Y component of this location.
|
|
7223
|
-
*/
|
|
7224
|
-
y: number;
|
|
7225
|
-
/**
|
|
7226
|
-
* Z component of this location.
|
|
7227
|
-
*/
|
|
7228
|
-
z: number;
|
|
7229
|
-
/**
|
|
7230
|
-
* @remarks
|
|
7231
|
-
* Creates a new instance of an abstract location.
|
|
7232
|
-
* @param x
|
|
7233
|
-
* X position of the location.
|
|
7234
|
-
* @param y
|
|
7235
|
-
* Y position of the location.
|
|
7236
|
-
* @param z
|
|
7237
|
-
* Z position of the location.
|
|
7238
|
-
*/
|
|
7239
|
-
constructor(x: number, y: number, z: number);
|
|
7240
|
-
/**
|
|
7241
|
-
* @remarks
|
|
7242
|
-
* Compares this Location and another Location to one another.
|
|
7243
|
-
* @param other
|
|
7244
|
-
* Other location to compare this Location to.
|
|
7245
|
-
* @returns
|
|
7246
|
-
* True if the two locations are equal.
|
|
7247
|
-
*/
|
|
7248
|
-
equals(other: Location): boolean;
|
|
7249
|
-
/**
|
|
7250
|
-
* @remarks
|
|
7251
|
-
* Determines whether or not two Locations are considered to be
|
|
7252
|
-
* near each other.
|
|
7253
|
-
* @param other
|
|
7254
|
-
* Other Location to compare this Location to.
|
|
7255
|
-
* @param epsilon
|
|
7256
|
-
* Maximum distance that the Locations can be from each other
|
|
7257
|
-
* to be considered nearby.
|
|
7258
|
-
* @returns
|
|
7259
|
-
* True if the two Locations are within epsilon distance of
|
|
7260
|
-
* each other.
|
|
7261
|
-
*/
|
|
7262
|
-
isNear(other: Location, epsilon: number): boolean;
|
|
7263
|
-
}
|
|
7264
6987
|
/**
|
|
7265
6988
|
* @beta
|
|
7266
6989
|
* A specific currently-internal event used for passing
|
|
@@ -7494,6 +7217,7 @@ export class MinecraftBlockTypes {
|
|
|
7494
7217
|
* Represents a blackstone wall within Minecraft.
|
|
7495
7218
|
*/
|
|
7496
7219
|
static readonly blackstoneWall: BlockType;
|
|
7220
|
+
static readonly blackWool: BlockType;
|
|
7497
7221
|
/**
|
|
7498
7222
|
* Represents a blast furnace within Minecraft.
|
|
7499
7223
|
*/
|
|
@@ -7514,6 +7238,7 @@ export class MinecraftBlockTypes {
|
|
|
7514
7238
|
* Represents a blue ice block within Minecraft.
|
|
7515
7239
|
*/
|
|
7516
7240
|
static readonly blueIce: BlockType;
|
|
7241
|
+
static readonly blueWool: BlockType;
|
|
7517
7242
|
/**
|
|
7518
7243
|
* Represents a bone block within Minecraft.
|
|
7519
7244
|
*/
|
|
@@ -7558,6 +7283,7 @@ export class MinecraftBlockTypes {
|
|
|
7558
7283
|
* Represents a block of brown mushroom within Minecraft.
|
|
7559
7284
|
*/
|
|
7560
7285
|
static readonly brownMushroomBlock: BlockType;
|
|
7286
|
+
static readonly brownWool: BlockType;
|
|
7561
7287
|
/**
|
|
7562
7288
|
* Represents a column of bubbles within Minecraft.
|
|
7563
7289
|
*/
|
|
@@ -7912,6 +7638,7 @@ export class MinecraftBlockTypes {
|
|
|
7912
7638
|
* Minecraft.
|
|
7913
7639
|
*/
|
|
7914
7640
|
static readonly cyanGlazedTerracotta: BlockType;
|
|
7641
|
+
static readonly cyanWool: BlockType;
|
|
7915
7642
|
/**
|
|
7916
7643
|
* Represents a dark oak button within Minecraft.
|
|
7917
7644
|
*/
|
|
@@ -8912,6 +8639,7 @@ export class MinecraftBlockTypes {
|
|
|
8912
8639
|
* Minecraft.
|
|
8913
8640
|
*/
|
|
8914
8641
|
static readonly grayGlazedTerracotta: BlockType;
|
|
8642
|
+
static readonly grayWool: BlockType;
|
|
8915
8643
|
/**
|
|
8916
8644
|
* Represents a green-colored candle within Minecraft.
|
|
8917
8645
|
*/
|
|
@@ -8925,6 +8653,7 @@ export class MinecraftBlockTypes {
|
|
|
8925
8653
|
* Minecraft.
|
|
8926
8654
|
*/
|
|
8927
8655
|
static readonly greenGlazedTerracotta: BlockType;
|
|
8656
|
+
static readonly greenWool: BlockType;
|
|
8928
8657
|
/**
|
|
8929
8658
|
* Represents a grindstone within Minecraft.
|
|
8930
8659
|
*/
|
|
@@ -9121,6 +8850,7 @@ export class MinecraftBlockTypes {
|
|
|
9121
8850
|
* Minecraft.
|
|
9122
8851
|
*/
|
|
9123
8852
|
static readonly lightBlueGlazedTerracotta: BlockType;
|
|
8853
|
+
static readonly lightBlueWool: BlockType;
|
|
9124
8854
|
/**
|
|
9125
8855
|
* Represents a light gray candle within Minecraft.
|
|
9126
8856
|
*/
|
|
@@ -9129,6 +8859,7 @@ export class MinecraftBlockTypes {
|
|
|
9129
8859
|
* Represents a light gray candle cake within Minecraft.
|
|
9130
8860
|
*/
|
|
9131
8861
|
static readonly lightGrayCandleCake: BlockType;
|
|
8862
|
+
static readonly lightGrayWool: BlockType;
|
|
9132
8863
|
/**
|
|
9133
8864
|
* Represents a lightning rod within Minecraft.
|
|
9134
8865
|
*/
|
|
@@ -9150,6 +8881,7 @@ export class MinecraftBlockTypes {
|
|
|
9150
8881
|
* Minecraft.
|
|
9151
8882
|
*/
|
|
9152
8883
|
static readonly limeGlazedTerracotta: BlockType;
|
|
8884
|
+
static readonly limeWool: BlockType;
|
|
9153
8885
|
/**
|
|
9154
8886
|
* Represents a lit blast furnace within Minecraft.
|
|
9155
8887
|
*/
|
|
@@ -9208,6 +8940,7 @@ export class MinecraftBlockTypes {
|
|
|
9208
8940
|
* within Minecraft.
|
|
9209
8941
|
*/
|
|
9210
8942
|
static readonly magentaGlazedTerracotta: BlockType;
|
|
8943
|
+
static readonly magentaWool: BlockType;
|
|
9211
8944
|
/**
|
|
9212
8945
|
* Represents magma within Minecraft.
|
|
9213
8946
|
*/
|
|
@@ -9361,6 +9094,7 @@ export class MinecraftBlockTypes {
|
|
|
9361
9094
|
* within Minecraft.
|
|
9362
9095
|
*/
|
|
9363
9096
|
static readonly orangeGlazedTerracotta: BlockType;
|
|
9097
|
+
static readonly orangeWool: BlockType;
|
|
9364
9098
|
/**
|
|
9365
9099
|
* Represents a block of oxidized copper within Minecraft.
|
|
9366
9100
|
*/
|
|
@@ -9402,6 +9136,7 @@ export class MinecraftBlockTypes {
|
|
|
9402
9136
|
* Minecraft.
|
|
9403
9137
|
*/
|
|
9404
9138
|
static readonly pinkGlazedTerracotta: BlockType;
|
|
9139
|
+
static readonly pinkWool: BlockType;
|
|
9405
9140
|
/**
|
|
9406
9141
|
* Represents a piston within Minecraft.
|
|
9407
9142
|
*/
|
|
@@ -9568,6 +9303,7 @@ export class MinecraftBlockTypes {
|
|
|
9568
9303
|
* within Minecraft.
|
|
9569
9304
|
*/
|
|
9570
9305
|
static readonly purpleGlazedTerracotta: BlockType;
|
|
9306
|
+
static readonly purpleWool: BlockType;
|
|
9571
9307
|
/**
|
|
9572
9308
|
* Represents a purpur block within Minecraft.
|
|
9573
9309
|
*/
|
|
@@ -9672,6 +9408,7 @@ export class MinecraftBlockTypes {
|
|
|
9672
9408
|
* Represents a redstone wire within Minecraft.
|
|
9673
9409
|
*/
|
|
9674
9410
|
static readonly redstoneWire: BlockType;
|
|
9411
|
+
static readonly redWool: BlockType;
|
|
9675
9412
|
/**
|
|
9676
9413
|
* Represents reeds within Minecraft.
|
|
9677
9414
|
*/
|
|
@@ -10302,6 +10039,7 @@ export class MinecraftBlockTypes {
|
|
|
10302
10039
|
* Minecraft.
|
|
10303
10040
|
*/
|
|
10304
10041
|
static readonly whiteGlazedTerracotta: BlockType;
|
|
10042
|
+
static readonly whiteWool: BlockType;
|
|
10305
10043
|
/**
|
|
10306
10044
|
* Represents a wither rose within Minecraft.
|
|
10307
10045
|
*/
|
|
@@ -10326,10 +10064,6 @@ export class MinecraftBlockTypes {
|
|
|
10326
10064
|
* Represents a wooden slab within Minecraft.
|
|
10327
10065
|
*/
|
|
10328
10066
|
static readonly woodenSlab: BlockType;
|
|
10329
|
-
/**
|
|
10330
|
-
* Represents wool within Minecraft.
|
|
10331
|
-
*/
|
|
10332
|
-
static readonly wool: BlockType;
|
|
10333
10067
|
/**
|
|
10334
10068
|
* Represents a yellow candle within Minecraft.
|
|
10335
10069
|
*/
|
|
@@ -10347,6 +10081,7 @@ export class MinecraftBlockTypes {
|
|
|
10347
10081
|
* Minecraft.
|
|
10348
10082
|
*/
|
|
10349
10083
|
static readonly yellowGlazedTerracotta: BlockType;
|
|
10084
|
+
static readonly yellowWool: BlockType;
|
|
10350
10085
|
/**
|
|
10351
10086
|
* @remarks
|
|
10352
10087
|
* Returns a specific Minecraft block type given a type id.
|
|
@@ -10821,6 +10556,7 @@ export class MinecraftItemTypes {
|
|
|
10821
10556
|
* Minecraft.
|
|
10822
10557
|
*/
|
|
10823
10558
|
static readonly blackstoneWall: ItemType;
|
|
10559
|
+
static readonly blackWool: ItemType;
|
|
10824
10560
|
/**
|
|
10825
10561
|
* Represents an item that can place a blast furnace within
|
|
10826
10562
|
* Minecraft.
|
|
@@ -10845,6 +10581,7 @@ export class MinecraftItemTypes {
|
|
|
10845
10581
|
* Minecraft.
|
|
10846
10582
|
*/
|
|
10847
10583
|
static readonly blueIce: ItemType;
|
|
10584
|
+
static readonly blueWool: ItemType;
|
|
10848
10585
|
static readonly boat: ItemType;
|
|
10849
10586
|
static readonly bone: ItemType;
|
|
10850
10587
|
/**
|
|
@@ -10904,6 +10641,7 @@ export class MinecraftItemTypes {
|
|
|
10904
10641
|
* within Minecraft.
|
|
10905
10642
|
*/
|
|
10906
10643
|
static readonly brownMushroomBlock: ItemType;
|
|
10644
|
+
static readonly brownWool: ItemType;
|
|
10907
10645
|
static readonly bucket: ItemType;
|
|
10908
10646
|
/**
|
|
10909
10647
|
* Represents an item that can place a block of budding
|
|
@@ -11245,6 +10983,7 @@ export class MinecraftItemTypes {
|
|
|
11245
10983
|
* glazed terracotta within Minecraft.
|
|
11246
10984
|
*/
|
|
11247
10985
|
static readonly cyanGlazedTerracotta: ItemType;
|
|
10986
|
+
static readonly cyanWool: ItemType;
|
|
11248
10987
|
static readonly darkOakBoat: ItemType;
|
|
11249
10988
|
/**
|
|
11250
10989
|
* Represents an item that can place a dark oak button within
|
|
@@ -11704,6 +11443,7 @@ export class MinecraftItemTypes {
|
|
|
11704
11443
|
* glazed terracotta within Minecraft.
|
|
11705
11444
|
*/
|
|
11706
11445
|
static readonly grayGlazedTerracotta: ItemType;
|
|
11446
|
+
static readonly grayWool: ItemType;
|
|
11707
11447
|
/**
|
|
11708
11448
|
* Represents an item that can place a green-colored candle
|
|
11709
11449
|
* within Minecraft.
|
|
@@ -11715,6 +11455,7 @@ export class MinecraftItemTypes {
|
|
|
11715
11455
|
* terracotta within Minecraft.
|
|
11716
11456
|
*/
|
|
11717
11457
|
static readonly greenGlazedTerracotta: ItemType;
|
|
11458
|
+
static readonly greenWool: ItemType;
|
|
11718
11459
|
/**
|
|
11719
11460
|
* Represents an item that can place a grindstone within
|
|
11720
11461
|
* Minecraft.
|
|
@@ -11929,12 +11670,14 @@ export class MinecraftItemTypes {
|
|
|
11929
11670
|
* glazed terracotta within Minecraft.
|
|
11930
11671
|
*/
|
|
11931
11672
|
static readonly lightBlueGlazedTerracotta: ItemType;
|
|
11673
|
+
static readonly lightBlueWool: ItemType;
|
|
11932
11674
|
/**
|
|
11933
11675
|
* Represents an item that can place a light gray candle within
|
|
11934
11676
|
* Minecraft.
|
|
11935
11677
|
*/
|
|
11936
11678
|
static readonly lightGrayCandle: ItemType;
|
|
11937
11679
|
static readonly lightGrayDye: ItemType;
|
|
11680
|
+
static readonly lightGrayWool: ItemType;
|
|
11938
11681
|
/**
|
|
11939
11682
|
* Represents an item that can place a lightning rod within
|
|
11940
11683
|
* Minecraft.
|
|
@@ -11956,6 +11699,7 @@ export class MinecraftItemTypes {
|
|
|
11956
11699
|
* glazed terracotta within Minecraft.
|
|
11957
11700
|
*/
|
|
11958
11701
|
static readonly limeGlazedTerracotta: ItemType;
|
|
11702
|
+
static readonly limeWool: ItemType;
|
|
11959
11703
|
static readonly lingeringPotion: ItemType;
|
|
11960
11704
|
/**
|
|
11961
11705
|
* Represents an item that can place a lit pumpkin within
|
|
@@ -11993,6 +11737,7 @@ export class MinecraftItemTypes {
|
|
|
11993
11737
|
* glazed terracotta within Minecraft.
|
|
11994
11738
|
*/
|
|
11995
11739
|
static readonly magentaGlazedTerracotta: ItemType;
|
|
11740
|
+
static readonly magentaWool: ItemType;
|
|
11996
11741
|
/**
|
|
11997
11742
|
* Represents magma within Minecraft.
|
|
11998
11743
|
*/
|
|
@@ -12199,6 +11944,7 @@ export class MinecraftItemTypes {
|
|
|
12199
11944
|
* glazed terracotta within Minecraft.
|
|
12200
11945
|
*/
|
|
12201
11946
|
static readonly orangeGlazedTerracotta: ItemType;
|
|
11947
|
+
static readonly orangeWool: ItemType;
|
|
12202
11948
|
/**
|
|
12203
11949
|
* Represents an item that can place a block of oxidized copper
|
|
12204
11950
|
* within Minecraft.
|
|
@@ -12248,6 +11994,7 @@ export class MinecraftItemTypes {
|
|
|
12248
11994
|
* glazed terracotta within Minecraft.
|
|
12249
11995
|
*/
|
|
12250
11996
|
static readonly pinkGlazedTerracotta: ItemType;
|
|
11997
|
+
static readonly pinkWool: ItemType;
|
|
12251
11998
|
/**
|
|
12252
11999
|
* Represents an item that can place a piston within Minecraft.
|
|
12253
12000
|
*/
|
|
@@ -12400,6 +12147,7 @@ export class MinecraftItemTypes {
|
|
|
12400
12147
|
* glazed terracotta within Minecraft.
|
|
12401
12148
|
*/
|
|
12402
12149
|
static readonly purpleGlazedTerracotta: ItemType;
|
|
12150
|
+
static readonly purpleWool: ItemType;
|
|
12403
12151
|
/**
|
|
12404
12152
|
* Represents an item that can place a purpur block within
|
|
12405
12153
|
* Minecraft.
|
|
@@ -12528,6 +12276,7 @@ export class MinecraftItemTypes {
|
|
|
12528
12276
|
* Minecraft.
|
|
12529
12277
|
*/
|
|
12530
12278
|
static readonly redstoneTorch: ItemType;
|
|
12279
|
+
static readonly redWool: ItemType;
|
|
12531
12280
|
static readonly reinforcedDeepslate: ItemType;
|
|
12532
12281
|
static readonly repeater: ItemType;
|
|
12533
12282
|
/**
|
|
@@ -13168,6 +12917,7 @@ export class MinecraftItemTypes {
|
|
|
13168
12917
|
* terracotta within Minecraft.
|
|
13169
12918
|
*/
|
|
13170
12919
|
static readonly whiteGlazedTerracotta: ItemType;
|
|
12920
|
+
static readonly whiteWool: ItemType;
|
|
13171
12921
|
static readonly witchSpawnEgg: ItemType;
|
|
13172
12922
|
/**
|
|
13173
12923
|
* Represents an item that can place a wither rose within
|
|
@@ -13228,6 +12978,7 @@ export class MinecraftItemTypes {
|
|
|
13228
12978
|
* terracotta within Minecraft.
|
|
13229
12979
|
*/
|
|
13230
12980
|
static readonly yellowGlazedTerracotta: ItemType;
|
|
12981
|
+
static readonly yellowWool: ItemType;
|
|
13231
12982
|
static readonly zoglinSpawnEgg: ItemType;
|
|
13232
12983
|
static readonly zombieHorseSpawnEgg: ItemType;
|
|
13233
12984
|
static readonly zombiePigmanSpawnEgg: ItemType;
|
|
@@ -13290,29 +13041,7 @@ export class NavigationResult {
|
|
|
13290
13041
|
/**
|
|
13291
13042
|
* A set of block locations that comprise the navigation route.
|
|
13292
13043
|
*/
|
|
13293
|
-
readonly path:
|
|
13294
|
-
}
|
|
13295
|
-
/**
|
|
13296
|
-
* @beta
|
|
13297
|
-
* Represents a min/max structure for expressing a potential
|
|
13298
|
-
* range of numbers.
|
|
13299
|
-
*/
|
|
13300
|
-
export class NumberRange {
|
|
13301
|
-
protected constructor();
|
|
13302
|
-
/**
|
|
13303
|
-
* Maximum value within a range.
|
|
13304
|
-
*/
|
|
13305
|
-
max: number;
|
|
13306
|
-
/**
|
|
13307
|
-
* Minimum value within a range.
|
|
13308
|
-
*/
|
|
13309
|
-
min: number;
|
|
13310
|
-
/**
|
|
13311
|
-
* @remarks
|
|
13312
|
-
* Returns a random number between the minimum and maximum of
|
|
13313
|
-
* the range.
|
|
13314
|
-
*/
|
|
13315
|
-
next(): number;
|
|
13044
|
+
readonly path: Vector3[];
|
|
13316
13045
|
}
|
|
13317
13046
|
/**
|
|
13318
13047
|
* @beta
|
|
@@ -13352,21 +13081,23 @@ export class PistonActivateEventSignal {
|
|
|
13352
13081
|
* @param callback
|
|
13353
13082
|
* @example pistonEvent.ts
|
|
13354
13083
|
* ```typescript
|
|
13355
|
-
*
|
|
13084
|
+
* let canceled = false;
|
|
13085
|
+
*
|
|
13086
|
+
* const pistonLoc: mc.Vector3 = {
|
|
13087
|
+
* x: Math.floor(targetLocation.x) + 1,
|
|
13088
|
+
* y: Math.floor(targetLocation.y) + 2,
|
|
13089
|
+
* z: Math.floor(targetLocation.z) + 1,
|
|
13090
|
+
* };
|
|
13091
|
+
*
|
|
13092
|
+
* const pistonCallback = mc.world.events.beforePistonActivate.subscribe((pistonEvent: mc.BeforePistonActivateEvent) => {
|
|
13093
|
+
* if (pistonEvent.piston.location.equals(pistonLoc)) {
|
|
13094
|
+
* log("Cancelling piston event");
|
|
13095
|
+
* pistonEvent.cancel = true;
|
|
13096
|
+
* canceled = true;
|
|
13097
|
+
* }
|
|
13098
|
+
* });
|
|
13356
13099
|
*
|
|
13357
|
-
* const pistonLoc = new mc.BlockLocation(
|
|
13358
|
-
* Math.floor(targetLocation.x) + 1,
|
|
13359
|
-
* Math.floor(targetLocation.y) + 2,
|
|
13360
|
-
* Math.floor(targetLocation.z) + 1
|
|
13361
|
-
* );
|
|
13362
13100
|
*
|
|
13363
|
-
* const pistonCallback = mc.world.events.beforePistonActivate.subscribe((pistonEvent: mc.BeforePistonActivateEvent) => {
|
|
13364
|
-
* if (pistonEvent.piston.location.equals(pistonLoc)) {
|
|
13365
|
-
* log("Cancelling piston event");
|
|
13366
|
-
* pistonEvent.cancel = true;
|
|
13367
|
-
* canceled = true;
|
|
13368
|
-
* }
|
|
13369
|
-
* });
|
|
13370
13101
|
* ```
|
|
13371
13102
|
*/
|
|
13372
13103
|
subscribe(callback: (arg: PistonActivateEvent) => void): (arg: PistonActivateEvent) => void;
|
|
@@ -13395,7 +13126,7 @@ export class Player extends Entity {
|
|
|
13395
13126
|
* Location of the center of the head component of the player.
|
|
13396
13127
|
* @throws This property can throw when used.
|
|
13397
13128
|
*/
|
|
13398
|
-
readonly headLocation:
|
|
13129
|
+
readonly headLocation: Vector3;
|
|
13399
13130
|
/**
|
|
13400
13131
|
* Unique identifier of the player. This identifier is intended
|
|
13401
13132
|
* to be consistent across loads of a world instance. No
|
|
@@ -13432,12 +13163,6 @@ export class Player extends Entity {
|
|
|
13432
13163
|
* Player.
|
|
13433
13164
|
*/
|
|
13434
13165
|
readonly onScreenDisplay: ScreenDisplay;
|
|
13435
|
-
/**
|
|
13436
|
-
* @beta
|
|
13437
|
-
* Main rotation of the entity.
|
|
13438
|
-
* @throws This property can throw when used.
|
|
13439
|
-
*/
|
|
13440
|
-
readonly rotation: XYRotation;
|
|
13441
13166
|
/**
|
|
13442
13167
|
* @beta
|
|
13443
13168
|
* Returns a scoreboard identity that represents this entity.
|
|
@@ -13449,6 +13174,7 @@ export class Player extends Entity {
|
|
|
13449
13174
|
* Manages the selected slot in the player's hotbar.
|
|
13450
13175
|
*/
|
|
13451
13176
|
selectedSlot: number;
|
|
13177
|
+
readonly spawnDimension?: Dimension;
|
|
13452
13178
|
/**
|
|
13453
13179
|
* @beta
|
|
13454
13180
|
* Retrieves or sets an entity that is used as the target of
|
|
@@ -13465,18 +13191,6 @@ export class Player extends Entity {
|
|
|
13465
13191
|
* @throws This property can throw when used.
|
|
13466
13192
|
*/
|
|
13467
13193
|
readonly typeId: string;
|
|
13468
|
-
/**
|
|
13469
|
-
* @beta
|
|
13470
|
-
* Current speed of the player across X, Y, and Z dimensions.
|
|
13471
|
-
* @throws This property can throw when used.
|
|
13472
|
-
*/
|
|
13473
|
-
readonly velocity: Vector;
|
|
13474
|
-
/**
|
|
13475
|
-
* @beta
|
|
13476
|
-
* Direction that the player is looking, from their head.
|
|
13477
|
-
* @throws This property can throw when used.
|
|
13478
|
-
*/
|
|
13479
|
-
readonly viewDirection: Vector3;
|
|
13480
13194
|
readonly xpEarnedAtCurrentLevel: number;
|
|
13481
13195
|
/**
|
|
13482
13196
|
* @beta
|
|
@@ -13504,6 +13218,7 @@ export class Player extends Entity {
|
|
|
13504
13218
|
*/
|
|
13505
13219
|
addTag(tag: string): boolean;
|
|
13506
13220
|
applyDamage(amount: number, source?: EntityDamageSource): boolean;
|
|
13221
|
+
clearSpawn(): void;
|
|
13507
13222
|
extinguishFire(useEffects?: boolean): boolean;
|
|
13508
13223
|
/**
|
|
13509
13224
|
* @beta
|
|
@@ -13577,6 +13292,8 @@ export class Player extends Entity {
|
|
|
13577
13292
|
* @throws This function can throw errors.
|
|
13578
13293
|
*/
|
|
13579
13294
|
getItemCooldown(itemCategory: string): number;
|
|
13295
|
+
getRotation(): XYRotation;
|
|
13296
|
+
getSpawnPosition(): Vector3 | undefined;
|
|
13580
13297
|
/**
|
|
13581
13298
|
* @beta
|
|
13582
13299
|
* @remarks
|
|
@@ -13585,6 +13302,8 @@ export class Player extends Entity {
|
|
|
13585
13302
|
*/
|
|
13586
13303
|
getTags(): string[];
|
|
13587
13304
|
getTotalXp(): number;
|
|
13305
|
+
getVelocity(): Vector3;
|
|
13306
|
+
getViewDirection(): Vector3;
|
|
13588
13307
|
/**
|
|
13589
13308
|
* @beta
|
|
13590
13309
|
* @remarks
|
|
@@ -13672,6 +13391,7 @@ export class Player extends Entity {
|
|
|
13672
13391
|
* @throws This function can throw errors.
|
|
13673
13392
|
*/
|
|
13674
13393
|
runCommandAsync(commandString: string): Promise<CommandResult>;
|
|
13394
|
+
sendMessage(message: (RawMessage | string)[] | RawMessage | string): void;
|
|
13675
13395
|
/**
|
|
13676
13396
|
* @beta
|
|
13677
13397
|
* @remarks
|
|
@@ -13701,6 +13421,7 @@ export class Player extends Entity {
|
|
|
13701
13421
|
* @throws This function can throw errors.
|
|
13702
13422
|
*/
|
|
13703
13423
|
setRotation(degreesX: number, degreesY: number): void;
|
|
13424
|
+
setSpawn(spawnPosition: Vector3, spawnDimension: Dimension): void;
|
|
13704
13425
|
/**
|
|
13705
13426
|
* @beta
|
|
13706
13427
|
* @remarks
|
|
@@ -13760,15 +13481,6 @@ export class Player extends Entity {
|
|
|
13760
13481
|
* @throws This function can throw errors.
|
|
13761
13482
|
*/
|
|
13762
13483
|
teleportFacing(location: Vector3, dimension: Dimension, facingLocation: Vector3, keepVelocity?: boolean): void;
|
|
13763
|
-
/**
|
|
13764
|
-
* @beta
|
|
13765
|
-
* @remarks
|
|
13766
|
-
* Sends a message that is displayed on the connected client
|
|
13767
|
-
* for this player.
|
|
13768
|
-
* @param message
|
|
13769
|
-
* @throws This function can throw errors.
|
|
13770
|
-
*/
|
|
13771
|
-
tell(message: RawMessage | string): void;
|
|
13772
13484
|
/**
|
|
13773
13485
|
* @beta
|
|
13774
13486
|
* @remarks
|
|
@@ -14023,20 +13735,10 @@ export class PlayerSpawnEventSignal {
|
|
|
14023
13735
|
*/
|
|
14024
13736
|
export class ProjectileHitEvent {
|
|
14025
13737
|
protected constructor();
|
|
14026
|
-
/**
|
|
14027
|
-
* Contains additional information about the block that was hit
|
|
14028
|
-
* by the projectile, or undefined if the projectile did not
|
|
14029
|
-
* hit a block.
|
|
14030
|
-
*/
|
|
14031
|
-
readonly blockHit?: BlockHitInformation;
|
|
14032
13738
|
/**
|
|
14033
13739
|
* Dimension where this projectile hit took place.
|
|
14034
13740
|
*/
|
|
14035
13741
|
readonly dimension: Dimension;
|
|
14036
|
-
/**
|
|
14037
|
-
* Contains additional information about a block that was hit.
|
|
14038
|
-
*/
|
|
14039
|
-
readonly entityHit?: EntityHitInformation;
|
|
14040
13742
|
/**
|
|
14041
13743
|
* Direction vector of the projectile as it hit a block/entity.
|
|
14042
13744
|
*/
|
|
@@ -14044,7 +13746,7 @@ export class ProjectileHitEvent {
|
|
|
14044
13746
|
/**
|
|
14045
13747
|
* Location where the projectile hit occurred.
|
|
14046
13748
|
*/
|
|
14047
|
-
readonly location:
|
|
13749
|
+
readonly location: Vector3;
|
|
14048
13750
|
/**
|
|
14049
13751
|
* Entity for the projectile that hit a block/entity.
|
|
14050
13752
|
*/
|
|
@@ -14053,6 +13755,8 @@ export class ProjectileHitEvent {
|
|
|
14053
13755
|
* Optional source entity that fired the projectile.
|
|
14054
13756
|
*/
|
|
14055
13757
|
readonly source: Entity;
|
|
13758
|
+
getBlockHit(): BlockHitInformation | undefined;
|
|
13759
|
+
getEntityHit(): EntityHitInformation | undefined;
|
|
14056
13760
|
}
|
|
14057
13761
|
/**
|
|
14058
13762
|
* @beta
|
|
@@ -14153,6 +13857,7 @@ export class Scoreboard {
|
|
|
14153
13857
|
* @throws This function can throw errors.
|
|
14154
13858
|
*/
|
|
14155
13859
|
getParticipants(): ScoreboardIdentity[];
|
|
13860
|
+
getScore(objective: ScoreboardObjective, participant: ScoreboardIdentity): number;
|
|
14156
13861
|
/**
|
|
14157
13862
|
* @remarks
|
|
14158
13863
|
* Removes an objective from the scoreboard.
|
|
@@ -14172,6 +13877,7 @@ export class Scoreboard {
|
|
|
14172
13877
|
displaySlotId: string,
|
|
14173
13878
|
objectiveDisplaySetting: ScoreboardObjectiveDisplayOptions,
|
|
14174
13879
|
): ScoreboardObjective;
|
|
13880
|
+
setScore(objective: ScoreboardObjective, participant: ScoreboardIdentity, score: number): boolean;
|
|
14175
13881
|
}
|
|
14176
13882
|
/**
|
|
14177
13883
|
* @beta
|
|
@@ -14198,6 +13904,9 @@ export class ScoreboardIdentity {
|
|
|
14198
13904
|
* @throws This function can throw errors.
|
|
14199
13905
|
*/
|
|
14200
13906
|
getEntity(): Entity;
|
|
13907
|
+
getScore(objective: ScoreboardObjective): number;
|
|
13908
|
+
removeFromObjective(objective: ScoreboardObjective): boolean;
|
|
13909
|
+
setScore(objective: ScoreboardObjective, score: number): boolean;
|
|
14201
13910
|
}
|
|
14202
13911
|
/**
|
|
14203
13912
|
* @beta
|
|
@@ -14236,6 +13945,8 @@ export class ScoreboardObjective {
|
|
|
14236
13945
|
* @throws This function can throw errors.
|
|
14237
13946
|
*/
|
|
14238
13947
|
getScores(): ScoreboardScoreInfo[];
|
|
13948
|
+
removeParticipant(participant: ScoreboardIdentity): boolean;
|
|
13949
|
+
setScore(participant: ScoreboardIdentity, score: number): boolean;
|
|
14239
13950
|
}
|
|
14240
13951
|
/**
|
|
14241
13952
|
* @beta
|
|
@@ -14352,7 +14063,7 @@ export class Seat {
|
|
|
14352
14063
|
* Physical location of this seat, relative to the entity's
|
|
14353
14064
|
* location.
|
|
14354
14065
|
*/
|
|
14355
|
-
readonly position:
|
|
14066
|
+
readonly position: Vector3;
|
|
14356
14067
|
}
|
|
14357
14068
|
/**
|
|
14358
14069
|
* @beta
|
|
@@ -14389,18 +14100,16 @@ export class StringBlockProperty extends IBlockProperty {
|
|
|
14389
14100
|
* Name of this property.
|
|
14390
14101
|
*/
|
|
14391
14102
|
readonly name: string;
|
|
14392
|
-
/**
|
|
14393
|
-
* A list of allowed values for this string property.
|
|
14394
|
-
*/
|
|
14395
|
-
readonly validValues: string[];
|
|
14396
14103
|
/**
|
|
14397
14104
|
* The current value of this property.
|
|
14398
14105
|
* @throws
|
|
14399
14106
|
* Setting this property can throw if the value passed is not
|
|
14400
14107
|
* valid for the property. Use {@link
|
|
14401
|
-
* StringBlockProperty.validValues} to check
|
|
14108
|
+
* @minecraft/server.StringBlockProperty.validValues} to check
|
|
14109
|
+
* allowed values.
|
|
14402
14110
|
*/
|
|
14403
14111
|
value: string;
|
|
14112
|
+
getValidValues(): string[];
|
|
14404
14113
|
}
|
|
14405
14114
|
/**
|
|
14406
14115
|
* A class that provides system-level events and functions.
|
|
@@ -14426,14 +14135,6 @@ export class System {
|
|
|
14426
14135
|
* @param runId
|
|
14427
14136
|
*/
|
|
14428
14137
|
clearRun(runId: number): void;
|
|
14429
|
-
/**
|
|
14430
|
-
* @beta
|
|
14431
|
-
* @remarks
|
|
14432
|
-
* Cancels the execution of a scheduled function run that was
|
|
14433
|
-
* previously scheduled via the `runSchedule` function.
|
|
14434
|
-
* @param runScheduleId
|
|
14435
|
-
*/
|
|
14436
|
-
clearRunSchedule(runScheduleId: number): void;
|
|
14437
14138
|
/**
|
|
14438
14139
|
* @remarks
|
|
14439
14140
|
* Runs a specified function at a future time. This is
|
|
@@ -14447,23 +14148,8 @@ export class System {
|
|
|
14447
14148
|
* function to cancel the execution of this run.
|
|
14448
14149
|
*/
|
|
14449
14150
|
run(callback: () => void): number;
|
|
14450
|
-
|
|
14451
|
-
|
|
14452
|
-
* @remarks
|
|
14453
|
-
* Runs a specified function at a scheduled interval. This is
|
|
14454
|
-
* frequently used to implement delayed behaviors and game
|
|
14455
|
-
* loops.
|
|
14456
|
-
* @param callback
|
|
14457
|
-
* Function callback to run on the specified schedule.
|
|
14458
|
-
* @param tickInterval
|
|
14459
|
-
* The number of ticks to run this function within - run this
|
|
14460
|
-
* function every `tickInterval` ticks.
|
|
14461
|
-
* @returns
|
|
14462
|
-
* An opaque identifier that can be used with the
|
|
14463
|
-
* `clearRunSchedule` function to cancel the execution of this
|
|
14464
|
-
* scheduled run.
|
|
14465
|
-
*/
|
|
14466
|
-
runSchedule(callback: () => void, tickInterval?: number): number;
|
|
14151
|
+
runInterval(callback: () => void, tickInterval?: number): number;
|
|
14152
|
+
runTimeout(callback: () => void, tickDelay?: number): number;
|
|
14467
14153
|
}
|
|
14468
14154
|
/**
|
|
14469
14155
|
* @beta
|
|
@@ -14774,6 +14460,7 @@ export class World {
|
|
|
14774
14460
|
* @throws This function can throw errors.
|
|
14775
14461
|
*/
|
|
14776
14462
|
getAllPlayers(): Player[];
|
|
14463
|
+
getDefaultSpawnPosition(): Vector3;
|
|
14777
14464
|
/**
|
|
14778
14465
|
* @remarks
|
|
14779
14466
|
* Returns a dimension object.
|
|
@@ -14844,15 +14531,8 @@ export class World {
|
|
|
14844
14531
|
* @throws This function can throw errors.
|
|
14845
14532
|
*/
|
|
14846
14533
|
removeDynamicProperty(identifier: string): boolean;
|
|
14847
|
-
|
|
14848
|
-
|
|
14849
|
-
* @remarks
|
|
14850
|
-
* Broadcasts a message that is displayed on all connected
|
|
14851
|
-
* clients.
|
|
14852
|
-
* @param message
|
|
14853
|
-
* @throws This function can throw errors.
|
|
14854
|
-
*/
|
|
14855
|
-
say(message: RawMessage | string): void;
|
|
14534
|
+
sendMessage(message: (RawMessage | string)[] | RawMessage | string): void;
|
|
14535
|
+
setDefaultSpawn(spawnPosition: Vector3): void;
|
|
14856
14536
|
/**
|
|
14857
14537
|
* @beta
|
|
14858
14538
|
* @remarks
|
|
@@ -14952,6 +14632,28 @@ export class XYRotation {
|
|
|
14952
14632
|
export interface BlockFillOptions {
|
|
14953
14633
|
matchingBlock?: BlockPermutation;
|
|
14954
14634
|
}
|
|
14635
|
+
/**
|
|
14636
|
+
* @beta
|
|
14637
|
+
* Contains more information for events where a block is hit.
|
|
14638
|
+
*/
|
|
14639
|
+
export interface BlockHitInformation {
|
|
14640
|
+
/**
|
|
14641
|
+
* Block that was hit.
|
|
14642
|
+
*/
|
|
14643
|
+
block: Block;
|
|
14644
|
+
/**
|
|
14645
|
+
* Face of the block that was hit.
|
|
14646
|
+
*/
|
|
14647
|
+
face: Direction;
|
|
14648
|
+
/**
|
|
14649
|
+
* X coordinate on the face that was hit.
|
|
14650
|
+
*/
|
|
14651
|
+
faceLocationX: number;
|
|
14652
|
+
/**
|
|
14653
|
+
* Y coordinate on the face that was hit.
|
|
14654
|
+
*/
|
|
14655
|
+
faceLocationY: number;
|
|
14656
|
+
}
|
|
14955
14657
|
/**
|
|
14956
14658
|
* @beta
|
|
14957
14659
|
* Contains additional options for configuring a block raycast
|
|
@@ -14973,6 +14675,32 @@ export interface BlockRaycastOptions {
|
|
|
14973
14675
|
*/
|
|
14974
14676
|
maxDistance?: number;
|
|
14975
14677
|
}
|
|
14678
|
+
/**
|
|
14679
|
+
* @beta
|
|
14680
|
+
* Represents a fully customizable color within Minecraft.
|
|
14681
|
+
*/
|
|
14682
|
+
export interface Color {
|
|
14683
|
+
/**
|
|
14684
|
+
* Determines a color's alpha (opacity) component. Valid values
|
|
14685
|
+
* are between 0 (transparent) and 1.0 (opaque).
|
|
14686
|
+
*/
|
|
14687
|
+
alpha: number;
|
|
14688
|
+
/**
|
|
14689
|
+
* Determines a color's blue component. Valid values are
|
|
14690
|
+
* between 0 and 1.0.
|
|
14691
|
+
*/
|
|
14692
|
+
blue: number;
|
|
14693
|
+
/**
|
|
14694
|
+
* Determines a color's green component. Valid values are
|
|
14695
|
+
* between 0 and 1.0.
|
|
14696
|
+
*/
|
|
14697
|
+
green: number;
|
|
14698
|
+
/**
|
|
14699
|
+
* Determines a color's red component. Valid values are between
|
|
14700
|
+
* 0 and 1.0.
|
|
14701
|
+
*/
|
|
14702
|
+
red: number;
|
|
14703
|
+
}
|
|
14976
14704
|
export interface EntityDamageSource {
|
|
14977
14705
|
cause: EntityDamageCause;
|
|
14978
14706
|
damagingEntity?: Entity;
|
|
@@ -15018,6 +14746,17 @@ export interface EntityEventOptions {
|
|
|
15018
14746
|
*/
|
|
15019
14747
|
entityTypes?: string[];
|
|
15020
14748
|
}
|
|
14749
|
+
/**
|
|
14750
|
+
* @beta
|
|
14751
|
+
* Contains additional information about an entity that was
|
|
14752
|
+
* hit.
|
|
14753
|
+
*/
|
|
14754
|
+
export interface EntityHitInformation {
|
|
14755
|
+
/**
|
|
14756
|
+
* Entity that was hit.
|
|
14757
|
+
*/
|
|
14758
|
+
entity: Entity;
|
|
14759
|
+
}
|
|
15021
14760
|
/**
|
|
15022
14761
|
* @beta
|
|
15023
14762
|
* Contains options for selecting entities within an area.
|
|
@@ -15076,7 +14815,7 @@ export interface EntityQueryOptions {
|
|
|
15076
14815
|
* conjunction with closest, farthest, limit, volume, and
|
|
15077
14816
|
* distance properties.
|
|
15078
14817
|
*/
|
|
15079
|
-
location?:
|
|
14818
|
+
location?: Vector3;
|
|
15080
14819
|
/**
|
|
15081
14820
|
* If specified, includes entities that are less than this
|
|
15082
14821
|
* distance away from the location specified in the location
|
|
@@ -15221,11 +14960,31 @@ export interface MusicOptions {
|
|
|
15221
14960
|
*/
|
|
15222
14961
|
volume?: number;
|
|
15223
14962
|
}
|
|
14963
|
+
/**
|
|
14964
|
+
* @beta
|
|
14965
|
+
* Represents a min/max structure for expressing a potential
|
|
14966
|
+
* range of numbers.
|
|
14967
|
+
*/
|
|
14968
|
+
export interface NumberRange {
|
|
14969
|
+
/**
|
|
14970
|
+
* Maximum value within a range.
|
|
14971
|
+
*/
|
|
14972
|
+
max: number;
|
|
14973
|
+
/**
|
|
14974
|
+
* Minimum value within a range.
|
|
14975
|
+
*/
|
|
14976
|
+
min: number;
|
|
14977
|
+
}
|
|
15224
14978
|
export interface RawMessage {
|
|
15225
14979
|
rawtext?: (RawMessage | string)[];
|
|
14980
|
+
score?: RawMessageScore;
|
|
15226
14981
|
text?: string;
|
|
15227
14982
|
translate?: string;
|
|
15228
|
-
with?:
|
|
14983
|
+
with?: string[] | RawMessage;
|
|
14984
|
+
}
|
|
14985
|
+
export interface RawMessageScore {
|
|
14986
|
+
name?: string;
|
|
14987
|
+
objective?: string;
|
|
15229
14988
|
}
|
|
15230
14989
|
/**
|
|
15231
14990
|
* @beta
|
|
@@ -15254,7 +15013,7 @@ export interface SoundOptions {
|
|
|
15254
15013
|
/**
|
|
15255
15014
|
* Specifies a location of where to play a particular sound.
|
|
15256
15015
|
*/
|
|
15257
|
-
location?:
|
|
15016
|
+
location?: Vector3;
|
|
15258
15017
|
/**
|
|
15259
15018
|
* Pitch adjustment level for the sound.
|
|
15260
15019
|
*/
|