@minecraft/server 1.9.0-beta.1.20.60-preview.20 → 1.9.0-beta.1.20.60-preview.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +341 -427
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* ```json
|
|
16
16
|
* {
|
|
17
17
|
* "module_name": "@minecraft/server",
|
|
18
|
-
* "version": "1.
|
|
18
|
+
* "version": "1.7.0"
|
|
19
19
|
* }
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
@@ -35,6 +35,16 @@ export enum BlockComponentTypes {
|
|
|
35
35
|
WaterContainer = 'minecraft:waterContainer',
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
41
|
+
export enum BlockPistonState {
|
|
42
|
+
Expanded = 'Expanded',
|
|
43
|
+
Expanding = 'Expanding',
|
|
44
|
+
Retracted = 'Retracted',
|
|
45
|
+
Retracting = 'Retracting',
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
/**
|
|
39
49
|
* @beta
|
|
40
50
|
* Description of the resulting intersection test on two
|
|
@@ -119,11 +129,37 @@ export enum CompoundBlockVolumePositionRelativity {
|
|
|
119
129
|
|
|
120
130
|
/**
|
|
121
131
|
* @beta
|
|
132
|
+
* An enumeration for the various difficulty levels of
|
|
133
|
+
* Minecraft.
|
|
122
134
|
*/
|
|
123
135
|
export enum Difficulty {
|
|
136
|
+
/**
|
|
137
|
+
* @beta
|
|
138
|
+
* @remarks
|
|
139
|
+
* Peaceful difficulty level.
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
124
142
|
Peaceful = 0,
|
|
143
|
+
/**
|
|
144
|
+
* @beta
|
|
145
|
+
* @remarks
|
|
146
|
+
* Easy difficulty level.
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
125
149
|
Easy = 1,
|
|
150
|
+
/**
|
|
151
|
+
* @beta
|
|
152
|
+
* @remarks
|
|
153
|
+
* Normal difficulty level.
|
|
154
|
+
*
|
|
155
|
+
*/
|
|
126
156
|
Normal = 2,
|
|
157
|
+
/**
|
|
158
|
+
* @beta
|
|
159
|
+
* @remarks
|
|
160
|
+
* Hard difficulty level.
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
127
163
|
Hard = 3,
|
|
128
164
|
}
|
|
129
165
|
|
|
@@ -640,11 +676,16 @@ export enum EntityInitializationCause {
|
|
|
640
676
|
Born = 'Born',
|
|
641
677
|
/**
|
|
642
678
|
* @remarks
|
|
643
|
-
* Case when an entity is created by an event, e.g.,
|
|
644
|
-
* trader spawning llamas.
|
|
679
|
+
* Case when an entity is created by an event, e.g., a
|
|
680
|
+
* Wandering trader spawning llamas.
|
|
645
681
|
*
|
|
646
682
|
*/
|
|
647
683
|
Event = 'Event',
|
|
684
|
+
/**
|
|
685
|
+
* @remarks
|
|
686
|
+
* Case when an entity is loaded into the world.
|
|
687
|
+
*
|
|
688
|
+
*/
|
|
648
689
|
Loaded = 'Loaded',
|
|
649
690
|
/**
|
|
650
691
|
* @remarks
|
|
@@ -823,7 +864,7 @@ export enum GameMode {
|
|
|
823
864
|
export enum ItemComponentTypes {
|
|
824
865
|
Cooldown = 'minecraft:cooldown',
|
|
825
866
|
Durability = 'minecraft:durability',
|
|
826
|
-
|
|
867
|
+
Enchantable = 'minecraft:enchantable',
|
|
827
868
|
Food = 'minecraft:food',
|
|
828
869
|
}
|
|
829
870
|
|
|
@@ -1021,11 +1062,47 @@ export enum SignSide {
|
|
|
1021
1062
|
* day.
|
|
1022
1063
|
*/
|
|
1023
1064
|
export enum TimeOfDay {
|
|
1065
|
+
/**
|
|
1066
|
+
* @remarks
|
|
1067
|
+
* Sets the time to the start of the day, which is time of the
|
|
1068
|
+
* day 1,000 (or the equivalent of 7am) in Minecraft.
|
|
1069
|
+
*
|
|
1070
|
+
*/
|
|
1024
1071
|
Day = 1000,
|
|
1072
|
+
/**
|
|
1073
|
+
* @remarks
|
|
1074
|
+
* Sets the time to noon, which is time of the day 6,000 in
|
|
1075
|
+
* Minecraft.
|
|
1076
|
+
*
|
|
1077
|
+
*/
|
|
1025
1078
|
Noon = 6000,
|
|
1079
|
+
/**
|
|
1080
|
+
* @remarks
|
|
1081
|
+
* Sets the time to sunset, which is time of the day 12,000 (or
|
|
1082
|
+
* the equivalent of 6pm) in Minecraft.
|
|
1083
|
+
*
|
|
1084
|
+
*/
|
|
1026
1085
|
Sunset = 12000,
|
|
1086
|
+
/**
|
|
1087
|
+
* @remarks
|
|
1088
|
+
* Sets the time to night, which is time of the day 13,000 (or
|
|
1089
|
+
* the equivalent of 7:00pm) in Minecraft.
|
|
1090
|
+
*
|
|
1091
|
+
*/
|
|
1027
1092
|
Night = 13000,
|
|
1093
|
+
/**
|
|
1094
|
+
* @remarks
|
|
1095
|
+
* Sets the time to midnight, which is time of the day 18,000
|
|
1096
|
+
* (or the equivalent of 12:00am) in Minecraft.
|
|
1097
|
+
*
|
|
1098
|
+
*/
|
|
1028
1099
|
Midnight = 18000,
|
|
1100
|
+
/**
|
|
1101
|
+
* @remarks
|
|
1102
|
+
* Sets the time to sunrise, which is time of the day 23,000
|
|
1103
|
+
* (or the equivalent of 5am) in Minecraft.
|
|
1104
|
+
*
|
|
1105
|
+
*/
|
|
1029
1106
|
Sunrise = 23000,
|
|
1030
1107
|
}
|
|
1031
1108
|
|
|
@@ -1237,11 +1314,11 @@ export type EntityComponentTypeMap = {
|
|
|
1237
1314
|
export type ItemComponentTypeMap = {
|
|
1238
1315
|
cooldown: ItemCooldownComponent;
|
|
1239
1316
|
durability: ItemDurabilityComponent;
|
|
1240
|
-
|
|
1317
|
+
enchantable: ItemEnchantableComponent;
|
|
1241
1318
|
food: ItemFoodComponent;
|
|
1242
1319
|
'minecraft:cooldown': ItemCooldownComponent;
|
|
1243
1320
|
'minecraft:durability': ItemDurabilityComponent;
|
|
1244
|
-
'minecraft:
|
|
1321
|
+
'minecraft:enchantable': ItemEnchantableComponent;
|
|
1245
1322
|
'minecraft:food': ItemFoodComponent;
|
|
1246
1323
|
};
|
|
1247
1324
|
|
|
@@ -1370,7 +1447,6 @@ export class Block {
|
|
|
1370
1447
|
*/
|
|
1371
1448
|
readonly z: number;
|
|
1372
1449
|
/**
|
|
1373
|
-
* @beta
|
|
1374
1450
|
* @remarks
|
|
1375
1451
|
* Returns the {@link Block} above this block (positive in the
|
|
1376
1452
|
* Y direction).
|
|
@@ -1385,7 +1461,6 @@ export class Block {
|
|
|
1385
1461
|
*/
|
|
1386
1462
|
above(steps?: number): Block | undefined;
|
|
1387
1463
|
/**
|
|
1388
|
-
* @beta
|
|
1389
1464
|
* @remarks
|
|
1390
1465
|
* Returns the {@link Block} below this block (negative in the
|
|
1391
1466
|
* Y direction).
|
|
@@ -1400,7 +1475,6 @@ export class Block {
|
|
|
1400
1475
|
*/
|
|
1401
1476
|
below(steps?: number): Block | undefined;
|
|
1402
1477
|
/**
|
|
1403
|
-
* @beta
|
|
1404
1478
|
* @remarks
|
|
1405
1479
|
* Returns the {@link @minecraft/server.Location} of the center
|
|
1406
1480
|
* of this block on the X and Z axis.
|
|
@@ -1432,7 +1506,6 @@ export class Block {
|
|
|
1432
1506
|
*/
|
|
1433
1507
|
canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
|
|
1434
1508
|
/**
|
|
1435
|
-
* @beta
|
|
1436
1509
|
* @remarks
|
|
1437
1510
|
* Returns the {@link @minecraft/server.Location} of the center
|
|
1438
1511
|
* of this block on the X, Y, and Z axis.
|
|
@@ -1440,7 +1513,6 @@ export class Block {
|
|
|
1440
1513
|
*/
|
|
1441
1514
|
center(): Vector3;
|
|
1442
1515
|
/**
|
|
1443
|
-
* @beta
|
|
1444
1516
|
* @remarks
|
|
1445
1517
|
* Returns the {@link Block} to the east of this block
|
|
1446
1518
|
* (positive in the X direction).
|
|
@@ -1566,7 +1638,6 @@ export class Block {
|
|
|
1566
1638
|
*/
|
|
1567
1639
|
isValid(): boolean;
|
|
1568
1640
|
/**
|
|
1569
|
-
* @beta
|
|
1570
1641
|
* @remarks
|
|
1571
1642
|
* Returns the {@link Block} to the north of this block
|
|
1572
1643
|
* (negative in the Z direction).
|
|
@@ -1581,7 +1652,16 @@ export class Block {
|
|
|
1581
1652
|
*/
|
|
1582
1653
|
north(steps?: number): Block | undefined;
|
|
1583
1654
|
/**
|
|
1584
|
-
* @
|
|
1655
|
+
* @remarks
|
|
1656
|
+
* Returns a block at an offset relative vector to this block.
|
|
1657
|
+
*
|
|
1658
|
+
* @param offset
|
|
1659
|
+
* The offset vector. For example, an offset of 0, 1, 0 will
|
|
1660
|
+
* return the block above the current block.
|
|
1661
|
+
* @returns
|
|
1662
|
+
* Block at the specified offset, or undefined if that block
|
|
1663
|
+
* could not be retrieved (for example, the block and its
|
|
1664
|
+
* relative chunk is not loaded yet.)
|
|
1585
1665
|
* @throws This function can throw errors.
|
|
1586
1666
|
*
|
|
1587
1667
|
* {@link LocationInUnloadedChunkError}
|
|
@@ -1626,7 +1706,6 @@ export class Block {
|
|
|
1626
1706
|
*/
|
|
1627
1707
|
setType(blockType: BlockType | string): void;
|
|
1628
1708
|
/**
|
|
1629
|
-
* @beta
|
|
1630
1709
|
* @remarks
|
|
1631
1710
|
* Returns the {@link Block} to the south of this block
|
|
1632
1711
|
* (positive in the Z direction).
|
|
@@ -1662,7 +1741,6 @@ export class Block {
|
|
|
1662
1741
|
*/
|
|
1663
1742
|
trySetPermutation(permutation: BlockPermutation): boolean;
|
|
1664
1743
|
/**
|
|
1665
|
-
* @beta
|
|
1666
1744
|
* @remarks
|
|
1667
1745
|
* Returns the {@link Block} to the west of this block
|
|
1668
1746
|
* (negative in the X direction).
|
|
@@ -2066,20 +2144,6 @@ export class BlockPermutation {
|
|
|
2066
2144
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2067
2145
|
export class BlockPistonComponent extends BlockComponent {
|
|
2068
2146
|
private constructor();
|
|
2069
|
-
/**
|
|
2070
|
-
* @remarks
|
|
2071
|
-
* Whether the piston is fully expanded.
|
|
2072
|
-
*
|
|
2073
|
-
* @throws This property can throw when used.
|
|
2074
|
-
*/
|
|
2075
|
-
readonly isExpanded: boolean;
|
|
2076
|
-
/**
|
|
2077
|
-
* @remarks
|
|
2078
|
-
* Whether the piston is in the process of expanding.
|
|
2079
|
-
*
|
|
2080
|
-
* @throws This property can throw when used.
|
|
2081
|
-
*/
|
|
2082
|
-
readonly isExpanding: boolean;
|
|
2083
2147
|
/**
|
|
2084
2148
|
* @remarks
|
|
2085
2149
|
* Whether the piston is in the process of expanding or
|
|
@@ -2089,19 +2153,9 @@ export class BlockPistonComponent extends BlockComponent {
|
|
|
2089
2153
|
*/
|
|
2090
2154
|
readonly isMoving: boolean;
|
|
2091
2155
|
/**
|
|
2092
|
-
* @remarks
|
|
2093
|
-
* Whether the piston is fully retracted.
|
|
2094
|
-
*
|
|
2095
|
-
* @throws This property can throw when used.
|
|
2096
|
-
*/
|
|
2097
|
-
readonly isRetracted: boolean;
|
|
2098
|
-
/**
|
|
2099
|
-
* @remarks
|
|
2100
|
-
* Whether the piston is in the process of retracting.
|
|
2101
|
-
*
|
|
2102
2156
|
* @throws This property can throw when used.
|
|
2103
2157
|
*/
|
|
2104
|
-
readonly
|
|
2158
|
+
readonly state: BlockPistonState;
|
|
2105
2159
|
static readonly componentId = 'minecraft:piston';
|
|
2106
2160
|
/**
|
|
2107
2161
|
* @remarks
|
|
@@ -2110,7 +2164,11 @@ export class BlockPistonComponent extends BlockComponent {
|
|
|
2110
2164
|
*
|
|
2111
2165
|
* @throws This function can throw errors.
|
|
2112
2166
|
*/
|
|
2113
|
-
getAttachedBlocks():
|
|
2167
|
+
getAttachedBlocks(): Block[];
|
|
2168
|
+
/**
|
|
2169
|
+
* @throws This function can throw errors.
|
|
2170
|
+
*/
|
|
2171
|
+
getAttachedBlocksLocations(): Vector3[];
|
|
2114
2172
|
}
|
|
2115
2173
|
|
|
2116
2174
|
/**
|
|
@@ -2290,7 +2348,7 @@ export class BlockSignComponent extends BlockComponent {
|
|
|
2290
2348
|
*
|
|
2291
2349
|
* @throws This function can throw errors.
|
|
2292
2350
|
*/
|
|
2293
|
-
setWaxed(): void;
|
|
2351
|
+
setWaxed(waxed: boolean): void;
|
|
2294
2352
|
}
|
|
2295
2353
|
|
|
2296
2354
|
/**
|
|
@@ -2359,12 +2417,14 @@ export class BlockStateType {
|
|
|
2359
2417
|
export class BlockType {
|
|
2360
2418
|
private constructor();
|
|
2361
2419
|
/**
|
|
2420
|
+
* @beta
|
|
2362
2421
|
* @remarks
|
|
2363
2422
|
* Represents whether this type of block can be waterlogged.
|
|
2364
2423
|
*
|
|
2365
2424
|
*/
|
|
2366
2425
|
readonly canBeWaterlogged: boolean;
|
|
2367
2426
|
/**
|
|
2427
|
+
* @beta
|
|
2368
2428
|
* @remarks
|
|
2369
2429
|
* Block type name - for example, `minecraft:acacia_stairs`.
|
|
2370
2430
|
*
|
|
@@ -2790,33 +2850,24 @@ export class ChatSendAfterEvent {
|
|
|
2790
2850
|
private constructor();
|
|
2791
2851
|
/**
|
|
2792
2852
|
* @remarks
|
|
2793
|
-
* Message that is being broadcast.
|
|
2794
|
-
* handler, _message_ can be updated with edits before the
|
|
2795
|
-
* message is displayed to players.
|
|
2853
|
+
* Message that is being broadcast.
|
|
2796
2854
|
*
|
|
2797
2855
|
*/
|
|
2798
|
-
message: string;
|
|
2856
|
+
readonly message: string;
|
|
2799
2857
|
/**
|
|
2800
2858
|
* @remarks
|
|
2801
2859
|
* Player that sent the chat message.
|
|
2802
2860
|
*
|
|
2803
2861
|
*/
|
|
2804
|
-
sender: Player;
|
|
2862
|
+
readonly sender: Player;
|
|
2805
2863
|
/**
|
|
2806
2864
|
* @remarks
|
|
2807
|
-
*
|
|
2865
|
+
* Optional list of players that will receive this message. If
|
|
2866
|
+
* defined, this message is directly targeted to one or more
|
|
2808
2867
|
* players (i.e., is not broadcast.)
|
|
2809
2868
|
*
|
|
2810
2869
|
*/
|
|
2811
|
-
|
|
2812
|
-
/**
|
|
2813
|
-
* @remarks
|
|
2814
|
-
* List of players that will receive this message.
|
|
2815
|
-
*
|
|
2816
|
-
* @returns
|
|
2817
|
-
* List of player objects.
|
|
2818
|
-
*/
|
|
2819
|
-
getTargets(): Player[];
|
|
2870
|
+
readonly targets?: Player[];
|
|
2820
2871
|
}
|
|
2821
2872
|
|
|
2822
2873
|
/**
|
|
@@ -2863,8 +2914,7 @@ export class ChatSendAfterEventSignal {
|
|
|
2863
2914
|
* @beta
|
|
2864
2915
|
* An event that fires as players enter chat messages.
|
|
2865
2916
|
*/
|
|
2866
|
-
|
|
2867
|
-
export class ChatSendBeforeEvent extends ChatSendAfterEvent {
|
|
2917
|
+
export class ChatSendBeforeEvent {
|
|
2868
2918
|
private constructor();
|
|
2869
2919
|
/**
|
|
2870
2920
|
* @remarks
|
|
@@ -2875,13 +2925,24 @@ export class ChatSendBeforeEvent extends ChatSendAfterEvent {
|
|
|
2875
2925
|
cancel: boolean;
|
|
2876
2926
|
/**
|
|
2877
2927
|
* @remarks
|
|
2878
|
-
*
|
|
2879
|
-
*
|
|
2928
|
+
* Message that is being broadcast.
|
|
2929
|
+
*
|
|
2930
|
+
*/
|
|
2931
|
+
readonly message: string;
|
|
2932
|
+
/**
|
|
2933
|
+
* @remarks
|
|
2934
|
+
* Player that sent the chat message.
|
|
2935
|
+
*
|
|
2936
|
+
*/
|
|
2937
|
+
readonly sender: Player;
|
|
2938
|
+
/**
|
|
2939
|
+
* @remarks
|
|
2940
|
+
* Optional list of players that will receive this message. If
|
|
2941
|
+
* defined, this message is directly targeted to one or more
|
|
2942
|
+
* players (i.e., is not broadcast.)
|
|
2880
2943
|
*
|
|
2881
|
-
* @param players
|
|
2882
|
-
* Updated array of players that should receive this message.
|
|
2883
2944
|
*/
|
|
2884
|
-
|
|
2945
|
+
readonly targets?: Player[];
|
|
2885
2946
|
}
|
|
2886
2947
|
|
|
2887
2948
|
/**
|
|
@@ -3757,7 +3818,6 @@ export class DataDrivenEntityTriggerBeforeEventSignal {
|
|
|
3757
3818
|
export class Dimension {
|
|
3758
3819
|
private constructor();
|
|
3759
3820
|
/**
|
|
3760
|
-
* @beta
|
|
3761
3821
|
* @remarks
|
|
3762
3822
|
* Height range of the dimension.
|
|
3763
3823
|
*
|
|
@@ -3991,8 +4051,13 @@ export class Dimension {
|
|
|
3991
4051
|
/**
|
|
3992
4052
|
* @beta
|
|
3993
4053
|
* @remarks
|
|
4054
|
+
* Returns the current weather.
|
|
4055
|
+
*
|
|
3994
4056
|
* This function can't be called in read-only mode.
|
|
3995
4057
|
*
|
|
4058
|
+
* @returns
|
|
4059
|
+
* Returns a WeatherType that explains the broad category of
|
|
4060
|
+
* weather that is currently going on.
|
|
3996
4061
|
*/
|
|
3997
4062
|
getWeather(): WeatherType;
|
|
3998
4063
|
/**
|
|
@@ -4291,18 +4356,14 @@ export class EffectAddAfterEvent {
|
|
|
4291
4356
|
* @remarks
|
|
4292
4357
|
* Additional properties and details of the effect.
|
|
4293
4358
|
*
|
|
4294
|
-
* This property can't be edited in read-only mode.
|
|
4295
|
-
*
|
|
4296
4359
|
*/
|
|
4297
|
-
effect: Effect;
|
|
4360
|
+
readonly effect: Effect;
|
|
4298
4361
|
/**
|
|
4299
4362
|
* @remarks
|
|
4300
4363
|
* Entity that the effect is being added to.
|
|
4301
4364
|
*
|
|
4302
|
-
* This property can't be edited in read-only mode.
|
|
4303
|
-
*
|
|
4304
4365
|
*/
|
|
4305
|
-
entity: Entity;
|
|
4366
|
+
readonly entity: Entity;
|
|
4306
4367
|
}
|
|
4307
4368
|
|
|
4308
4369
|
/**
|
|
@@ -4349,6 +4410,11 @@ export class EffectAddBeforeEvent {
|
|
|
4349
4410
|
*
|
|
4350
4411
|
*/
|
|
4351
4412
|
cancel: boolean;
|
|
4413
|
+
/**
|
|
4414
|
+
* @remarks
|
|
4415
|
+
* Effect duration.
|
|
4416
|
+
*
|
|
4417
|
+
*/
|
|
4352
4418
|
duration: number;
|
|
4353
4419
|
/**
|
|
4354
4420
|
* @remarks
|
|
@@ -4438,150 +4504,6 @@ export class EffectTypes {
|
|
|
4438
4504
|
static getAll(): EffectType[];
|
|
4439
4505
|
}
|
|
4440
4506
|
|
|
4441
|
-
/**
|
|
4442
|
-
* @beta
|
|
4443
|
-
* This class represents a specific leveled enchantment that is
|
|
4444
|
-
* applied to an item.
|
|
4445
|
-
*/
|
|
4446
|
-
export class Enchantment {
|
|
4447
|
-
/**
|
|
4448
|
-
* @remarks
|
|
4449
|
-
* The level of this enchantment instance.
|
|
4450
|
-
*
|
|
4451
|
-
* This property can't be edited in read-only mode.
|
|
4452
|
-
*
|
|
4453
|
-
*/
|
|
4454
|
-
level: number;
|
|
4455
|
-
/**
|
|
4456
|
-
* @remarks
|
|
4457
|
-
* The enchantment type of this instance.
|
|
4458
|
-
*
|
|
4459
|
-
*/
|
|
4460
|
-
readonly 'type': EnchantmentType;
|
|
4461
|
-
/**
|
|
4462
|
-
* @remarks
|
|
4463
|
-
* Creates a new particular type of enchantment configuration.
|
|
4464
|
-
*
|
|
4465
|
-
* @param enchantmentType
|
|
4466
|
-
* Type of the enchantment.
|
|
4467
|
-
* @param level
|
|
4468
|
-
* Level of the enchantment.
|
|
4469
|
-
* @throws This function can throw errors.
|
|
4470
|
-
*/
|
|
4471
|
-
constructor(enchantmentType: EnchantmentType | string, level?: number);
|
|
4472
|
-
}
|
|
4473
|
-
|
|
4474
|
-
/**
|
|
4475
|
-
* @beta
|
|
4476
|
-
* This class represents a collection of enchantments that can
|
|
4477
|
-
* be applied to an item.
|
|
4478
|
-
*/
|
|
4479
|
-
export class EnchantmentList implements Iterable<Enchantment> {
|
|
4480
|
-
/**
|
|
4481
|
-
* @remarks
|
|
4482
|
-
* The item slot/type that this collection is applied to.
|
|
4483
|
-
*
|
|
4484
|
-
*/
|
|
4485
|
-
readonly slot: number;
|
|
4486
|
-
/**
|
|
4487
|
-
* @remarks
|
|
4488
|
-
* Creates a new EnchantmentList.
|
|
4489
|
-
*
|
|
4490
|
-
*/
|
|
4491
|
-
constructor(enchantmentSlot: number);
|
|
4492
|
-
/**
|
|
4493
|
-
* @remarks
|
|
4494
|
-
* This function can't be called in read-only mode.
|
|
4495
|
-
*
|
|
4496
|
-
*/
|
|
4497
|
-
[Symbol.iterator](): Iterator<Enchantment>;
|
|
4498
|
-
/**
|
|
4499
|
-
* @remarks
|
|
4500
|
-
* Attempts to add the enchantment to this collection. Returns
|
|
4501
|
-
* true if successful.
|
|
4502
|
-
*
|
|
4503
|
-
* This function can't be called in read-only mode.
|
|
4504
|
-
*
|
|
4505
|
-
*/
|
|
4506
|
-
addEnchantment(enchantment: Enchantment): boolean;
|
|
4507
|
-
/**
|
|
4508
|
-
* @remarks
|
|
4509
|
-
* Returns whether or not the provided EnchantmentInstance can
|
|
4510
|
-
* be added to this collection.
|
|
4511
|
-
*
|
|
4512
|
-
* This function can't be called in read-only mode.
|
|
4513
|
-
*
|
|
4514
|
-
*/
|
|
4515
|
-
canAddEnchantment(enchantment: Enchantment): boolean;
|
|
4516
|
-
/**
|
|
4517
|
-
* @remarks
|
|
4518
|
-
* Returns an enchantment associated with a type.
|
|
4519
|
-
*
|
|
4520
|
-
* This function can't be called in read-only mode.
|
|
4521
|
-
*
|
|
4522
|
-
* @throws This function can throw errors.
|
|
4523
|
-
*/
|
|
4524
|
-
getEnchantment(enchantmentType: EnchantmentType | string): Enchantment | undefined;
|
|
4525
|
-
/**
|
|
4526
|
-
* @remarks
|
|
4527
|
-
* If this collection has an EnchantmentInstance with type,
|
|
4528
|
-
* returns the level of the enchantment. Returns 0 if not
|
|
4529
|
-
* present.
|
|
4530
|
-
*
|
|
4531
|
-
* @throws This function can throw errors.
|
|
4532
|
-
*/
|
|
4533
|
-
hasEnchantment(enchantmentType: EnchantmentType | string): number;
|
|
4534
|
-
/**
|
|
4535
|
-
* @remarks
|
|
4536
|
-
* This function can't be called in read-only mode.
|
|
4537
|
-
*
|
|
4538
|
-
*/
|
|
4539
|
-
next(): IteratorResult<Enchantment>;
|
|
4540
|
-
/**
|
|
4541
|
-
* @remarks
|
|
4542
|
-
* Removes an EnchantmentInstance with type from this
|
|
4543
|
-
* collection if present.
|
|
4544
|
-
*
|
|
4545
|
-
* This function can't be called in read-only mode.
|
|
4546
|
-
*
|
|
4547
|
-
* @throws This function can throw errors.
|
|
4548
|
-
*/
|
|
4549
|
-
removeEnchantment(enchantmentType: EnchantmentType | string): void;
|
|
4550
|
-
}
|
|
4551
|
-
|
|
4552
|
-
/**
|
|
4553
|
-
* @beta
|
|
4554
|
-
* This enum represents the item slot or type that an
|
|
4555
|
-
* enchantment can be applied to.
|
|
4556
|
-
*/
|
|
4557
|
-
export class EnchantmentSlot {
|
|
4558
|
-
private constructor();
|
|
4559
|
-
static readonly all = -1;
|
|
4560
|
-
static readonly armorFeet = 4;
|
|
4561
|
-
static readonly armorHead = 1;
|
|
4562
|
-
static readonly armorLegs = 8;
|
|
4563
|
-
static readonly armorTorso = 2;
|
|
4564
|
-
static readonly axe = 512;
|
|
4565
|
-
static readonly bow = 32;
|
|
4566
|
-
static readonly carrotStick = 8192;
|
|
4567
|
-
static readonly cosmeticHead = 262144;
|
|
4568
|
-
static readonly crossbow = 65536;
|
|
4569
|
-
static readonly elytra = 16384;
|
|
4570
|
-
static readonly fishingRod = 4096;
|
|
4571
|
-
static readonly flintsteel = 256;
|
|
4572
|
-
static readonly gArmor = 15;
|
|
4573
|
-
static readonly gDigging = 3648;
|
|
4574
|
-
static readonly gTool = 131520;
|
|
4575
|
-
static readonly hoe = 64;
|
|
4576
|
-
static readonly none = 0;
|
|
4577
|
-
static readonly pickaxe = 1024;
|
|
4578
|
-
static readonly shears = 128;
|
|
4579
|
-
static readonly shield = 131072;
|
|
4580
|
-
static readonly shovel = 2048;
|
|
4581
|
-
static readonly spear = 32768;
|
|
4582
|
-
static readonly sword = 16;
|
|
4583
|
-
}
|
|
4584
|
-
|
|
4585
4507
|
/**
|
|
4586
4508
|
* @beta
|
|
4587
4509
|
* Contains information on a type of enchantment.
|
|
@@ -4951,7 +4873,10 @@ export class Entity {
|
|
|
4951
4873
|
*/
|
|
4952
4874
|
applyKnockback(directionX: number, directionZ: number, horizontalStrength: number, verticalStrength: number): void;
|
|
4953
4875
|
/**
|
|
4954
|
-
* @
|
|
4876
|
+
* @remarks
|
|
4877
|
+
* Clears all dynamic properties that have been set on this
|
|
4878
|
+
* entity.
|
|
4879
|
+
*
|
|
4955
4880
|
* @throws This function can throw errors.
|
|
4956
4881
|
*/
|
|
4957
4882
|
clearDynamicProperties(): void;
|
|
@@ -5057,7 +4982,6 @@ export class Entity {
|
|
|
5057
4982
|
*/
|
|
5058
4983
|
getComponents(): EntityComponent[];
|
|
5059
4984
|
/**
|
|
5060
|
-
* @beta
|
|
5061
4985
|
* @remarks
|
|
5062
4986
|
* Returns a property value.
|
|
5063
4987
|
*
|
|
@@ -5070,12 +4994,24 @@ export class Entity {
|
|
|
5070
4994
|
*/
|
|
5071
4995
|
getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
|
|
5072
4996
|
/**
|
|
5073
|
-
* @
|
|
4997
|
+
* @remarks
|
|
4998
|
+
* Returns the available set of dynamic property identifiers
|
|
4999
|
+
* that have been used on this entity.
|
|
5000
|
+
*
|
|
5001
|
+
* @returns
|
|
5002
|
+
* A string array of the dynamic properties set on this entity.
|
|
5074
5003
|
* @throws This function can throw errors.
|
|
5075
5004
|
*/
|
|
5076
5005
|
getDynamicPropertyIds(): string[];
|
|
5077
5006
|
/**
|
|
5078
|
-
* @
|
|
5007
|
+
* @remarks
|
|
5008
|
+
* Returns the total size, in bytes, of all the dynamic
|
|
5009
|
+
* properties that are currently stored for this entity. This
|
|
5010
|
+
* can be useful for diagnosing performance warning signs - if,
|
|
5011
|
+
* for example, an entity has many megabytes of associated
|
|
5012
|
+
* dynamic properties, it may be slow to load on various
|
|
5013
|
+
* devices.
|
|
5014
|
+
*
|
|
5079
5015
|
* @throws This function can throw errors.
|
|
5080
5016
|
*/
|
|
5081
5017
|
getDynamicPropertyTotalByteCount(): number;
|
|
@@ -5256,7 +5192,6 @@ export class Entity {
|
|
|
5256
5192
|
*/
|
|
5257
5193
|
kill(): boolean;
|
|
5258
5194
|
/**
|
|
5259
|
-
* @beta
|
|
5260
5195
|
* @remarks
|
|
5261
5196
|
* Matches the entity against the passed in options. Uses the
|
|
5262
5197
|
* location of the entity for matching if the location is not
|
|
@@ -5284,7 +5219,6 @@ export class Entity {
|
|
|
5284
5219
|
*/
|
|
5285
5220
|
playAnimation(animationName: string, options?: PlayAnimationOptions): void;
|
|
5286
5221
|
/**
|
|
5287
|
-
* @beta
|
|
5288
5222
|
* @remarks
|
|
5289
5223
|
* Immediately removes the entity from the world. The removed
|
|
5290
5224
|
* entity will not perform a death animation or drop loot upon
|
|
@@ -5381,7 +5315,6 @@ export class Entity {
|
|
|
5381
5315
|
*/
|
|
5382
5316
|
runCommandAsync(commandString: string): Promise<CommandResult>;
|
|
5383
5317
|
/**
|
|
5384
|
-
* @beta
|
|
5385
5318
|
* @remarks
|
|
5386
5319
|
* Sets a specified property to a value.
|
|
5387
5320
|
*
|
|
@@ -5969,8 +5902,6 @@ export class EntityEquippableComponent extends EntityComponent {
|
|
|
5969
5902
|
* @remarks
|
|
5970
5903
|
* Gets the equipped item for the given EquipmentSlot.
|
|
5971
5904
|
*
|
|
5972
|
-
* This function can't be called in read-only mode.
|
|
5973
|
-
*
|
|
5974
5905
|
* @param equipmentSlot
|
|
5975
5906
|
* The equipment slot. e.g. "head", "chest", "offhand"
|
|
5976
5907
|
* @returns
|
|
@@ -5985,8 +5916,6 @@ export class EntityEquippableComponent extends EntityComponent {
|
|
|
5985
5916
|
* Gets the ContainerSlot corresponding to the given
|
|
5986
5917
|
* EquipmentSlot.
|
|
5987
5918
|
*
|
|
5988
|
-
* This function can't be called in read-only mode.
|
|
5989
|
-
*
|
|
5990
5919
|
* @param equipmentSlot
|
|
5991
5920
|
* The equipment slot. e.g. "head", "chest", "offhand".
|
|
5992
5921
|
* @returns
|
|
@@ -7603,7 +7532,7 @@ export class EntityTypes {
|
|
|
7603
7532
|
* Retrieves an iterator of all entity types within this world.
|
|
7604
7533
|
*
|
|
7605
7534
|
*/
|
|
7606
|
-
static getAll():
|
|
7535
|
+
static getAll(): EntityType[];
|
|
7607
7536
|
}
|
|
7608
7537
|
|
|
7609
7538
|
/**
|
|
@@ -7646,7 +7575,6 @@ export class EntityWantsJockeyComponent extends EntityComponent {
|
|
|
7646
7575
|
}
|
|
7647
7576
|
|
|
7648
7577
|
/**
|
|
7649
|
-
* @beta
|
|
7650
7578
|
* Contains information regarding an explosion that has
|
|
7651
7579
|
* happened.
|
|
7652
7580
|
*/
|
|
@@ -7673,7 +7601,6 @@ export class ExplosionAfterEvent {
|
|
|
7673
7601
|
}
|
|
7674
7602
|
|
|
7675
7603
|
/**
|
|
7676
|
-
* @beta
|
|
7677
7604
|
* Manages callbacks that are connected to when an explosion
|
|
7678
7605
|
* occurs.
|
|
7679
7606
|
*/
|
|
@@ -7701,7 +7628,6 @@ export class ExplosionAfterEventSignal {
|
|
|
7701
7628
|
}
|
|
7702
7629
|
|
|
7703
7630
|
/**
|
|
7704
|
-
* @beta
|
|
7705
7631
|
* Contains information regarding an explosion that has
|
|
7706
7632
|
* happened.
|
|
7707
7633
|
*/
|
|
@@ -7726,7 +7652,6 @@ export class ExplosionBeforeEvent extends ExplosionAfterEvent {
|
|
|
7726
7652
|
}
|
|
7727
7653
|
|
|
7728
7654
|
/**
|
|
7729
|
-
* @beta
|
|
7730
7655
|
* Manages callbacks that are connected to before an explosion
|
|
7731
7656
|
* occurs.
|
|
7732
7657
|
*/
|
|
@@ -8213,53 +8138,97 @@ export class ItemDurabilityComponent extends ItemComponent {
|
|
|
8213
8138
|
*
|
|
8214
8139
|
* This function can't be called in read-only mode.
|
|
8215
8140
|
*
|
|
8216
|
-
* @param unbreaking
|
|
8217
|
-
* Unbreaking factor to consider in factoring the damage
|
|
8218
|
-
* chance. Incoming unbreaking parameter must be greater than
|
|
8219
|
-
* 0.
|
|
8220
8141
|
* @throws This function can throw errors.
|
|
8221
8142
|
*/
|
|
8222
|
-
getDamageChance(
|
|
8143
|
+
getDamageChance(unbreakingEnchantmentLevel?: number): number;
|
|
8223
8144
|
/**
|
|
8224
8145
|
* @remarks
|
|
8225
|
-
* A range of numbers that describes the chance of the item
|
|
8226
|
-
* losing durability.
|
|
8227
|
-
*
|
|
8228
8146
|
* This function can't be called in read-only mode.
|
|
8229
8147
|
*
|
|
8230
8148
|
* @throws This function can throw errors.
|
|
8231
8149
|
*/
|
|
8232
|
-
|
|
8150
|
+
getDamageChanceRange(): minecraftcommon.NumberRange;
|
|
8233
8151
|
}
|
|
8234
8152
|
|
|
8235
8153
|
/**
|
|
8236
8154
|
* @beta
|
|
8237
|
-
* When present on an item, this item has applied enchantment
|
|
8238
|
-
* effects. Note that this component only applies to
|
|
8239
|
-
* data-driven items.
|
|
8240
8155
|
*/
|
|
8241
8156
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
8242
|
-
export class
|
|
8157
|
+
export class ItemEnchantableComponent extends ItemComponent {
|
|
8243
8158
|
private constructor();
|
|
8159
|
+
static readonly componentId = 'minecraft:enchantable';
|
|
8244
8160
|
/**
|
|
8245
8161
|
* @remarks
|
|
8246
|
-
*
|
|
8247
|
-
* item stack.
|
|
8162
|
+
* This function can't be called in read-only mode.
|
|
8248
8163
|
*
|
|
8249
|
-
* This
|
|
8164
|
+
* @throws This function can throw errors.
|
|
8165
|
+
*
|
|
8166
|
+
* {@link EnchantmentLevelOutOfBoundsError}
|
|
8167
|
+
*
|
|
8168
|
+
* {@link EnchantmentTypeNotCompatibleError}
|
|
8250
8169
|
*
|
|
8170
|
+
* {@link EnchantmentTypeUnknownIdError}
|
|
8171
|
+
*
|
|
8172
|
+
* {@link Error}
|
|
8251
8173
|
*/
|
|
8252
|
-
|
|
8253
|
-
static readonly componentId = 'minecraft:enchantments';
|
|
8174
|
+
addEnchantment(enchantment: Enchantment): void;
|
|
8254
8175
|
/**
|
|
8255
8176
|
* @remarks
|
|
8256
|
-
*
|
|
8177
|
+
* This function can't be called in read-only mode.
|
|
8178
|
+
*
|
|
8179
|
+
* @throws This function can throw errors.
|
|
8180
|
+
*
|
|
8181
|
+
* {@link EnchantmentLevelOutOfBoundsError}
|
|
8182
|
+
*
|
|
8183
|
+
* {@link EnchantmentTypeNotCompatibleError}
|
|
8184
|
+
*
|
|
8185
|
+
* {@link EnchantmentTypeUnknownIdError}
|
|
8186
|
+
*
|
|
8187
|
+
* {@link Error}
|
|
8188
|
+
*/
|
|
8189
|
+
addEnchantments(enchantments: Enchantment[]): void;
|
|
8190
|
+
/**
|
|
8191
|
+
* @throws This function can throw errors.
|
|
8192
|
+
*
|
|
8193
|
+
* {@link EnchantmentLevelOutOfBoundsError}
|
|
8194
|
+
*
|
|
8195
|
+
* {@link EnchantmentTypeUnknownIdError}
|
|
8196
|
+
*/
|
|
8197
|
+
canAddEnchantment(enchantment: Enchantment): boolean;
|
|
8198
|
+
/**
|
|
8199
|
+
* @throws This function can throw errors.
|
|
8200
|
+
*
|
|
8201
|
+
* {@link EnchantmentTypeUnknownIdError}
|
|
8202
|
+
*/
|
|
8203
|
+
getEnchantment(enchantmentType: EnchantmentType | string): Enchantment | undefined;
|
|
8204
|
+
/**
|
|
8205
|
+
* @throws This function can throw errors.
|
|
8206
|
+
*/
|
|
8207
|
+
getEnchantments(): Enchantment[];
|
|
8208
|
+
/**
|
|
8209
|
+
* @throws This function can throw errors.
|
|
8257
8210
|
*
|
|
8211
|
+
* {@link EnchantmentTypeUnknownIdError}
|
|
8212
|
+
*/
|
|
8213
|
+
hasEnchantment(enchantmentType: EnchantmentType | string): boolean;
|
|
8214
|
+
/**
|
|
8215
|
+
* @remarks
|
|
8258
8216
|
* This function can't be called in read-only mode.
|
|
8259
8217
|
*
|
|
8260
8218
|
* @throws This function can throw errors.
|
|
8261
8219
|
*/
|
|
8262
8220
|
removeAllEnchantments(): void;
|
|
8221
|
+
/**
|
|
8222
|
+
* @remarks
|
|
8223
|
+
* This function can't be called in read-only mode.
|
|
8224
|
+
*
|
|
8225
|
+
* @throws This function can throw errors.
|
|
8226
|
+
*
|
|
8227
|
+
* {@link EnchantmentTypeUnknownIdError}
|
|
8228
|
+
*
|
|
8229
|
+
* {@link Error}
|
|
8230
|
+
*/
|
|
8231
|
+
removeEnchantment(enchantmentType: EnchantmentType | string): void;
|
|
8263
8232
|
}
|
|
8264
8233
|
|
|
8265
8234
|
/**
|
|
@@ -9293,29 +9262,6 @@ export class MolangVariableMap {
|
|
|
9293
9262
|
setVector3(variableName: string, vector: Vector3): void;
|
|
9294
9263
|
}
|
|
9295
9264
|
|
|
9296
|
-
/**
|
|
9297
|
-
* @beta
|
|
9298
|
-
* Contains data resulting from a navigation operation,
|
|
9299
|
-
* including whether the navigation is possible and the path of
|
|
9300
|
-
* navigation.
|
|
9301
|
-
*/
|
|
9302
|
-
export class NavigationResult {
|
|
9303
|
-
private constructor();
|
|
9304
|
-
/**
|
|
9305
|
-
* @remarks
|
|
9306
|
-
* Whether the navigation result contains a full path,
|
|
9307
|
-
* including to the requested destination.
|
|
9308
|
-
*
|
|
9309
|
-
*/
|
|
9310
|
-
readonly isFullPath: boolean;
|
|
9311
|
-
/**
|
|
9312
|
-
* @remarks
|
|
9313
|
-
* A set of block locations that comprise the navigation route.
|
|
9314
|
-
*
|
|
9315
|
-
*/
|
|
9316
|
-
getPath(): Vector3[];
|
|
9317
|
-
}
|
|
9318
|
-
|
|
9319
9265
|
/**
|
|
9320
9266
|
* @beta
|
|
9321
9267
|
* Contains information related to changes to a piston
|
|
@@ -9414,107 +9360,6 @@ export class PistonActivateAfterEventSignal {
|
|
|
9414
9360
|
unsubscribe(callback: (arg: PistonActivateAfterEvent) => void): void;
|
|
9415
9361
|
}
|
|
9416
9362
|
|
|
9417
|
-
/**
|
|
9418
|
-
* @beta
|
|
9419
|
-
* Contains information related to changes before a piston
|
|
9420
|
-
* expands or retracts.
|
|
9421
|
-
*/
|
|
9422
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
9423
|
-
export class PistonActivateBeforeEvent extends BlockEvent {
|
|
9424
|
-
private constructor();
|
|
9425
|
-
/**
|
|
9426
|
-
* @remarks
|
|
9427
|
-
* If this is set to true within an event handler, the piston
|
|
9428
|
-
* activation is canceled.
|
|
9429
|
-
*
|
|
9430
|
-
*/
|
|
9431
|
-
cancel: boolean;
|
|
9432
|
-
/**
|
|
9433
|
-
* @remarks
|
|
9434
|
-
* True if the piston is the process of expanding.
|
|
9435
|
-
*
|
|
9436
|
-
*/
|
|
9437
|
-
readonly isExpanding: boolean;
|
|
9438
|
-
/**
|
|
9439
|
-
* @remarks
|
|
9440
|
-
* Contains additional properties and details of the piston.
|
|
9441
|
-
*
|
|
9442
|
-
*/
|
|
9443
|
-
readonly piston: BlockPistonComponent;
|
|
9444
|
-
}
|
|
9445
|
-
|
|
9446
|
-
/**
|
|
9447
|
-
* @beta
|
|
9448
|
-
* Manages callbacks that are connected to an event that fires
|
|
9449
|
-
* before a piston is activated.
|
|
9450
|
-
*/
|
|
9451
|
-
export class PistonActivateBeforeEventSignal {
|
|
9452
|
-
private constructor();
|
|
9453
|
-
/**
|
|
9454
|
-
* @remarks
|
|
9455
|
-
* Adds a callback that will be called before a piston expands
|
|
9456
|
-
* or retracts.
|
|
9457
|
-
*
|
|
9458
|
-
* This function can't be called in read-only mode.
|
|
9459
|
-
*
|
|
9460
|
-
* @example pistonBeforeEvent.ts
|
|
9461
|
-
* ```typescript
|
|
9462
|
-
* // set up a couple of piston blocks
|
|
9463
|
-
* let piston = overworld.getBlock(targetLocation);
|
|
9464
|
-
* let button = overworld.getBlock({ x: targetLocation.x, y: targetLocation.y + 1, z: targetLocation.z });
|
|
9465
|
-
*
|
|
9466
|
-
* if (piston === undefined || button === undefined) {
|
|
9467
|
-
* log("Could not find block at location.");
|
|
9468
|
-
* return -1;
|
|
9469
|
-
* }
|
|
9470
|
-
*
|
|
9471
|
-
* piston.setPermutation(mc.BlockPermutation.resolve('piston').withState('facing_direction', 3));
|
|
9472
|
-
* button.setPermutation(mc.BlockPermutation.resolve('acacia_button').withState('facing_direction', 1));
|
|
9473
|
-
*
|
|
9474
|
-
* const uncanceledPistonLoc = {
|
|
9475
|
-
* x: Math.floor(targetLocation.x) + 2,
|
|
9476
|
-
* y: Math.floor(targetLocation.y),
|
|
9477
|
-
* z: Math.floor(targetLocation.z) + 2,
|
|
9478
|
-
* };
|
|
9479
|
-
*
|
|
9480
|
-
* // this is our control.
|
|
9481
|
-
* let uncanceledPiston = overworld.getBlock(uncanceledPistonLoc);
|
|
9482
|
-
* let uncanceledButton = overworld.getBlock({
|
|
9483
|
-
* x: uncanceledPistonLoc.x,
|
|
9484
|
-
* y: uncanceledPistonLoc.y + 1,
|
|
9485
|
-
* z: uncanceledPistonLoc.z,
|
|
9486
|
-
* });
|
|
9487
|
-
*
|
|
9488
|
-
* if (uncanceledPiston === undefined || uncanceledButton === undefined) {
|
|
9489
|
-
* log("Could not find block at location.");
|
|
9490
|
-
* return -1;
|
|
9491
|
-
* }
|
|
9492
|
-
*
|
|
9493
|
-
* uncanceledPiston.setPermutation(mc.BlockPermutation.resolve('piston').withState('facing_direction', 3));
|
|
9494
|
-
* uncanceledButton.setPermutation(mc.BlockPermutation.resolve('acacia_button').withState('facing_direction', 1));
|
|
9495
|
-
*
|
|
9496
|
-
* mc.world.beforeEvents.pistonActivate.subscribe((pistonEvent: mc.PistonActivateBeforeEvent) => {
|
|
9497
|
-
* let eventLoc = pistonEvent.piston.block.location;
|
|
9498
|
-
* if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y && eventLoc.z === targetLocation.z) {
|
|
9499
|
-
* log("Cancelling piston event");
|
|
9500
|
-
* pistonEvent.cancel = true;
|
|
9501
|
-
* }
|
|
9502
|
-
* });
|
|
9503
|
-
* ```
|
|
9504
|
-
*/
|
|
9505
|
-
subscribe(callback: (arg: PistonActivateBeforeEvent) => void): (arg: PistonActivateBeforeEvent) => void;
|
|
9506
|
-
/**
|
|
9507
|
-
* @remarks
|
|
9508
|
-
* Removes a callback from being called before a piston expands
|
|
9509
|
-
* or retracts.
|
|
9510
|
-
*
|
|
9511
|
-
* This function can't be called in read-only mode.
|
|
9512
|
-
*
|
|
9513
|
-
* @throws This function can throw errors.
|
|
9514
|
-
*/
|
|
9515
|
-
unsubscribe(callback: (arg: PistonActivateBeforeEvent) => void): void;
|
|
9516
|
-
}
|
|
9517
|
-
|
|
9518
9363
|
/**
|
|
9519
9364
|
* Represents a player within the world.
|
|
9520
9365
|
*/
|
|
@@ -9634,6 +9479,14 @@ export class Player extends Entity {
|
|
|
9634
9479
|
* @throws This function can throw errors.
|
|
9635
9480
|
*/
|
|
9636
9481
|
addLevels(amount: number): number;
|
|
9482
|
+
/**
|
|
9483
|
+
* @beta
|
|
9484
|
+
* @remarks
|
|
9485
|
+
* This function can't be called in read-only mode.
|
|
9486
|
+
*
|
|
9487
|
+
* @throws This function can throw errors.
|
|
9488
|
+
*/
|
|
9489
|
+
eatItem(itemStack: ItemStack): void;
|
|
9637
9490
|
/**
|
|
9638
9491
|
* @beta
|
|
9639
9492
|
* @remarks
|
|
@@ -9835,8 +9688,18 @@ export class Player extends Entity {
|
|
|
9835
9688
|
/**
|
|
9836
9689
|
* @beta
|
|
9837
9690
|
* @remarks
|
|
9691
|
+
* Creates a new particle emitter at a specified location in
|
|
9692
|
+
* the world. Only visible to the target player.
|
|
9693
|
+
*
|
|
9838
9694
|
* This function can't be called in read-only mode.
|
|
9839
9695
|
*
|
|
9696
|
+
* @param effectName
|
|
9697
|
+
* Identifier of the particle to create.
|
|
9698
|
+
* @param location
|
|
9699
|
+
* The location at which to create the particle emitter.
|
|
9700
|
+
* @param molangVariables
|
|
9701
|
+
* A set of optional, customizable variables that can be
|
|
9702
|
+
* adjusted for this particle.
|
|
9840
9703
|
* @throws This function can throw errors.
|
|
9841
9704
|
*
|
|
9842
9705
|
* {@link Error}
|
|
@@ -9844,6 +9707,26 @@ export class Player extends Entity {
|
|
|
9844
9707
|
* {@link LocationInUnloadedChunkError}
|
|
9845
9708
|
*
|
|
9846
9709
|
* {@link LocationOutOfWorldBoundariesError}
|
|
9710
|
+
* @example spawnParticle.ts
|
|
9711
|
+
* ```typescript
|
|
9712
|
+
* for (let i = 0; i < 100; i++) {
|
|
9713
|
+
* const molang = new mc.MolangVariableMap();
|
|
9714
|
+
*
|
|
9715
|
+
* molang.setColorRGB("variable.color", {
|
|
9716
|
+
* red: Math.random(),
|
|
9717
|
+
* green: Math.random(),
|
|
9718
|
+
* blue: Math.random(),
|
|
9719
|
+
* alpha: 1,
|
|
9720
|
+
* });
|
|
9721
|
+
*
|
|
9722
|
+
* let newLocation = {
|
|
9723
|
+
* x: targetLocation.x + Math.floor(Math.random() * 8) - 4,
|
|
9724
|
+
* y: targetLocation.y + Math.floor(Math.random() * 8) - 4,
|
|
9725
|
+
* z: targetLocation.z + Math.floor(Math.random() * 8) - 4,
|
|
9726
|
+
* };
|
|
9727
|
+
* player.spawnParticle("minecraft:colored_flame_particle", newLocation, molang);
|
|
9728
|
+
* }
|
|
9729
|
+
* ```
|
|
9847
9730
|
*/
|
|
9848
9731
|
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
|
|
9849
9732
|
/**
|
|
@@ -10066,7 +9949,6 @@ export class PlayerDimensionChangeAfterEventSignal {
|
|
|
10066
9949
|
}
|
|
10067
9950
|
|
|
10068
9951
|
/**
|
|
10069
|
-
* @beta
|
|
10070
9952
|
* Contains information regarding an event after a player
|
|
10071
9953
|
* interacts with a block.
|
|
10072
9954
|
*/
|
|
@@ -10107,7 +9989,6 @@ export class PlayerInteractWithBlockAfterEvent {
|
|
|
10107
9989
|
}
|
|
10108
9990
|
|
|
10109
9991
|
/**
|
|
10110
|
-
* @beta
|
|
10111
9992
|
* Manages callbacks that are connected to after a player
|
|
10112
9993
|
* interacts with a block.
|
|
10113
9994
|
*/
|
|
@@ -10137,7 +10018,6 @@ export class PlayerInteractWithBlockAfterEventSignal {
|
|
|
10137
10018
|
}
|
|
10138
10019
|
|
|
10139
10020
|
/**
|
|
10140
|
-
* @beta
|
|
10141
10021
|
* Contains information regarding an event before a player
|
|
10142
10022
|
* interacts with a block.
|
|
10143
10023
|
*/
|
|
@@ -10184,7 +10064,6 @@ export class PlayerInteractWithBlockBeforeEvent {
|
|
|
10184
10064
|
}
|
|
10185
10065
|
|
|
10186
10066
|
/**
|
|
10187
|
-
* @beta
|
|
10188
10067
|
* Manages callbacks that are connected to before a player
|
|
10189
10068
|
* interacts with a block.
|
|
10190
10069
|
*/
|
|
@@ -10214,7 +10093,6 @@ export class PlayerInteractWithBlockBeforeEventSignal {
|
|
|
10214
10093
|
}
|
|
10215
10094
|
|
|
10216
10095
|
/**
|
|
10217
|
-
* @beta
|
|
10218
10096
|
* Contains information regarding an event after a player
|
|
10219
10097
|
* interacts with an entity.
|
|
10220
10098
|
*/
|
|
@@ -10242,7 +10120,6 @@ export class PlayerInteractWithEntityAfterEvent {
|
|
|
10242
10120
|
}
|
|
10243
10121
|
|
|
10244
10122
|
/**
|
|
10245
|
-
* @beta
|
|
10246
10123
|
* Manages callbacks that are connected to after a player
|
|
10247
10124
|
* interacts with an entity.
|
|
10248
10125
|
*/
|
|
@@ -10272,7 +10149,6 @@ export class PlayerInteractWithEntityAfterEventSignal {
|
|
|
10272
10149
|
}
|
|
10273
10150
|
|
|
10274
10151
|
/**
|
|
10275
|
-
* @beta
|
|
10276
10152
|
* Contains information regarding an event before a player
|
|
10277
10153
|
* interacts with an entity.
|
|
10278
10154
|
*/
|
|
@@ -10306,7 +10182,6 @@ export class PlayerInteractWithEntityBeforeEvent {
|
|
|
10306
10182
|
}
|
|
10307
10183
|
|
|
10308
10184
|
/**
|
|
10309
|
-
* @beta
|
|
10310
10185
|
* Manages callbacks that are connected to before a player
|
|
10311
10186
|
* interacts with an entity.
|
|
10312
10187
|
*/
|
|
@@ -10422,17 +10297,11 @@ export class PlayerLeaveAfterEventSignal extends IPlayerLeaveAfterEventSignal {
|
|
|
10422
10297
|
private constructor();
|
|
10423
10298
|
}
|
|
10424
10299
|
|
|
10425
|
-
/**
|
|
10426
|
-
* @beta
|
|
10427
|
-
*/
|
|
10428
10300
|
export class PlayerLeaveBeforeEvent {
|
|
10429
10301
|
private constructor();
|
|
10430
10302
|
readonly player: Player;
|
|
10431
10303
|
}
|
|
10432
10304
|
|
|
10433
|
-
/**
|
|
10434
|
-
* @beta
|
|
10435
|
-
*/
|
|
10436
10305
|
export class PlayerLeaveBeforeEventSignal {
|
|
10437
10306
|
private constructor();
|
|
10438
10307
|
/**
|
|
@@ -10863,7 +10732,7 @@ export class Scoreboard {
|
|
|
10863
10732
|
*
|
|
10864
10733
|
* @throws This function can throw errors.
|
|
10865
10734
|
*/
|
|
10866
|
-
addObjective(objectiveId: string, displayName
|
|
10735
|
+
addObjective(objectiveId: string, displayName?: string): ScoreboardObjective;
|
|
10867
10736
|
/**
|
|
10868
10737
|
* @remarks
|
|
10869
10738
|
* Clears the objective that occupies a display slot.
|
|
@@ -11907,7 +11776,10 @@ export class World {
|
|
|
11907
11776
|
*/
|
|
11908
11777
|
broadcastClientMessage(id: string, value: string): void;
|
|
11909
11778
|
/**
|
|
11910
|
-
* @
|
|
11779
|
+
* @remarks
|
|
11780
|
+
* Clears the set of dynamic properties declared for this
|
|
11781
|
+
* behavior pack within the world.
|
|
11782
|
+
*
|
|
11911
11783
|
*/
|
|
11912
11784
|
clearDynamicProperties(): void;
|
|
11913
11785
|
/**
|
|
@@ -11956,7 +11828,6 @@ export class World {
|
|
|
11956
11828
|
*/
|
|
11957
11829
|
getDimension(dimensionId: string): Dimension;
|
|
11958
11830
|
/**
|
|
11959
|
-
* @beta
|
|
11960
11831
|
* @remarks
|
|
11961
11832
|
* Returns a property value.
|
|
11962
11833
|
*
|
|
@@ -12023,15 +11894,23 @@ export class World {
|
|
|
12023
11894
|
*/
|
|
12024
11895
|
getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
|
|
12025
11896
|
/**
|
|
12026
|
-
* @
|
|
11897
|
+
* @remarks
|
|
11898
|
+
* Gets a set of dynamic property identifiers that have been
|
|
11899
|
+
* set in this world.
|
|
11900
|
+
*
|
|
11901
|
+
* @returns
|
|
11902
|
+
* A string array of active dynamic property identifiers.
|
|
12027
11903
|
*/
|
|
12028
11904
|
getDynamicPropertyIds(): string[];
|
|
12029
11905
|
/**
|
|
12030
|
-
* @
|
|
11906
|
+
* @remarks
|
|
11907
|
+
* Gets the total byte count of dynamic properties. This could
|
|
11908
|
+
* potentially be used for your own analytics to ensure you're
|
|
11909
|
+
* not storing gigantic sets of dynamic properties.
|
|
11910
|
+
*
|
|
12031
11911
|
*/
|
|
12032
11912
|
getDynamicPropertyTotalByteCount(): number;
|
|
12033
11913
|
/**
|
|
12034
|
-
* @beta
|
|
12035
11914
|
* @remarks
|
|
12036
11915
|
* Returns an entity based on the provided id.
|
|
12037
11916
|
*
|
|
@@ -12224,7 +12103,6 @@ export class World {
|
|
|
12224
12103
|
*/
|
|
12225
12104
|
setDefaultSpawnLocation(spawnLocation: Vector3): void;
|
|
12226
12105
|
/**
|
|
12227
|
-
* @beta
|
|
12228
12106
|
* @remarks
|
|
12229
12107
|
* Sets a specified property to a value.
|
|
12230
12108
|
*
|
|
@@ -12349,7 +12227,7 @@ export class WorldAfterEvents {
|
|
|
12349
12227
|
* entity.
|
|
12350
12228
|
*
|
|
12351
12229
|
*/
|
|
12352
|
-
readonly
|
|
12230
|
+
readonly dataDrivenEntityTrigger: DataDrivenEntityTriggerAfterEventSignal;
|
|
12353
12231
|
/**
|
|
12354
12232
|
* @beta
|
|
12355
12233
|
* @remarks
|
|
@@ -12518,10 +12396,16 @@ export class WorldAfterEvents {
|
|
|
12518
12396
|
readonly playerDimensionChange: PlayerDimensionChangeAfterEventSignal;
|
|
12519
12397
|
/**
|
|
12520
12398
|
* @beta
|
|
12399
|
+
* @remarks
|
|
12400
|
+
* An event for when a player interacts with a block.
|
|
12401
|
+
*
|
|
12521
12402
|
*/
|
|
12522
12403
|
readonly playerInteractWithBlock: PlayerInteractWithBlockAfterEventSignal;
|
|
12523
12404
|
/**
|
|
12524
12405
|
* @beta
|
|
12406
|
+
* @remarks
|
|
12407
|
+
* This event fires when a player interacts with an entity.
|
|
12408
|
+
*
|
|
12525
12409
|
*/
|
|
12526
12410
|
readonly playerInteractWithEntity: PlayerInteractWithEntityAfterEventSignal;
|
|
12527
12411
|
/**
|
|
@@ -12681,13 +12565,6 @@ export class WorldBeforeEvents {
|
|
|
12681
12565
|
*
|
|
12682
12566
|
*/
|
|
12683
12567
|
readonly itemUseOn: ItemUseOnBeforeEventSignal;
|
|
12684
|
-
/**
|
|
12685
|
-
* @beta
|
|
12686
|
-
* @remarks
|
|
12687
|
-
* This event fires when a piston expands or retracts.
|
|
12688
|
-
*
|
|
12689
|
-
*/
|
|
12690
|
-
readonly pistonActivate: PistonActivateBeforeEventSignal;
|
|
12691
12568
|
/**
|
|
12692
12569
|
* @remarks
|
|
12693
12570
|
* This event fires before a block is broken by a player.
|
|
@@ -12696,14 +12573,22 @@ export class WorldBeforeEvents {
|
|
|
12696
12573
|
readonly playerBreakBlock: PlayerBreakBlockBeforeEventSignal;
|
|
12697
12574
|
/**
|
|
12698
12575
|
* @beta
|
|
12576
|
+
* @remarks
|
|
12577
|
+
* Fires before a player interacts with a block.
|
|
12578
|
+
*
|
|
12699
12579
|
*/
|
|
12700
12580
|
readonly playerInteractWithBlock: PlayerInteractWithBlockBeforeEventSignal;
|
|
12701
12581
|
/**
|
|
12702
12582
|
* @beta
|
|
12583
|
+
* @remarks
|
|
12584
|
+
* Fires before a player interacts with an entity.
|
|
12585
|
+
*
|
|
12703
12586
|
*/
|
|
12704
12587
|
readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
|
|
12705
12588
|
/**
|
|
12706
|
-
* @
|
|
12589
|
+
* @remarks
|
|
12590
|
+
* Fires when a player leaves the game.
|
|
12591
|
+
*
|
|
12707
12592
|
*/
|
|
12708
12593
|
readonly playerLeave: PlayerLeaveBeforeEventSignal;
|
|
12709
12594
|
/**
|
|
@@ -12951,6 +12836,11 @@ export interface BoundingBox {
|
|
|
12951
12836
|
}
|
|
12952
12837
|
|
|
12953
12838
|
export interface CameraDefaultOptions {
|
|
12839
|
+
/**
|
|
12840
|
+
* @remarks
|
|
12841
|
+
* Sets a set of easing options for the camera.
|
|
12842
|
+
*
|
|
12843
|
+
*/
|
|
12954
12844
|
easeOptions: CameraEaseOptions;
|
|
12955
12845
|
}
|
|
12956
12846
|
|
|
@@ -13132,6 +13022,26 @@ export interface DimensionLocation {
|
|
|
13132
13022
|
z: number;
|
|
13133
13023
|
}
|
|
13134
13024
|
|
|
13025
|
+
/**
|
|
13026
|
+
* @beta
|
|
13027
|
+
* This class represents a specific leveled enchantment that is
|
|
13028
|
+
* applied to an item.
|
|
13029
|
+
*/
|
|
13030
|
+
export interface Enchantment {
|
|
13031
|
+
/**
|
|
13032
|
+
* @remarks
|
|
13033
|
+
* The level of this enchantment instance.
|
|
13034
|
+
*
|
|
13035
|
+
*/
|
|
13036
|
+
level: number;
|
|
13037
|
+
/**
|
|
13038
|
+
* @remarks
|
|
13039
|
+
* The enchantment type of this instance.
|
|
13040
|
+
*
|
|
13041
|
+
*/
|
|
13042
|
+
type: EnchantmentType | string;
|
|
13043
|
+
}
|
|
13044
|
+
|
|
13135
13045
|
/**
|
|
13136
13046
|
* Additional options for when damage has been applied via a
|
|
13137
13047
|
* projectile.
|
|
@@ -13593,6 +13503,7 @@ export interface PlayAnimationOptions {
|
|
|
13593
13503
|
*
|
|
13594
13504
|
*/
|
|
13595
13505
|
nextState?: string;
|
|
13506
|
+
players?: string[];
|
|
13596
13507
|
/**
|
|
13597
13508
|
* @remarks
|
|
13598
13509
|
* Specifies a Molang expression for when this animation should
|
|
@@ -13734,7 +13645,8 @@ export interface RGB {
|
|
|
13734
13645
|
/**
|
|
13735
13646
|
* Represents a fully customizable color within Minecraft.
|
|
13736
13647
|
*/
|
|
13737
|
-
|
|
13648
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13649
|
+
export interface RGBA extends RGB {
|
|
13738
13650
|
/**
|
|
13739
13651
|
* @remarks
|
|
13740
13652
|
* Determines a color's alpha (opacity) component. Valid values
|
|
@@ -13742,27 +13654,6 @@ export interface RGBA {
|
|
|
13742
13654
|
*
|
|
13743
13655
|
*/
|
|
13744
13656
|
alpha: number;
|
|
13745
|
-
/**
|
|
13746
|
-
* @remarks
|
|
13747
|
-
* Determines a color's blue component. Valid values are
|
|
13748
|
-
* between 0 and 1.0.
|
|
13749
|
-
*
|
|
13750
|
-
*/
|
|
13751
|
-
blue: number;
|
|
13752
|
-
/**
|
|
13753
|
-
* @remarks
|
|
13754
|
-
* Determines a color's green component. Valid values are
|
|
13755
|
-
* between 0 and 1.0.
|
|
13756
|
-
*
|
|
13757
|
-
*/
|
|
13758
|
-
green: number;
|
|
13759
|
-
/**
|
|
13760
|
-
* @remarks
|
|
13761
|
-
* Determines a color's red component. Valid values are between
|
|
13762
|
-
* 0 and 1.0.
|
|
13763
|
-
*
|
|
13764
|
-
*/
|
|
13765
|
-
red: number;
|
|
13766
13657
|
}
|
|
13767
13658
|
|
|
13768
13659
|
/**
|
|
@@ -13941,6 +13832,30 @@ export class CommandError extends Error {
|
|
|
13941
13832
|
private constructor();
|
|
13942
13833
|
}
|
|
13943
13834
|
|
|
13835
|
+
/**
|
|
13836
|
+
* @beta
|
|
13837
|
+
*/
|
|
13838
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13839
|
+
export class EnchantmentLevelOutOfBoundsError extends Error {
|
|
13840
|
+
private constructor();
|
|
13841
|
+
}
|
|
13842
|
+
|
|
13843
|
+
/**
|
|
13844
|
+
* @beta
|
|
13845
|
+
*/
|
|
13846
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13847
|
+
export class EnchantmentTypeNotCompatibleError extends Error {
|
|
13848
|
+
private constructor();
|
|
13849
|
+
}
|
|
13850
|
+
|
|
13851
|
+
/**
|
|
13852
|
+
* @beta
|
|
13853
|
+
*/
|
|
13854
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13855
|
+
export class EnchantmentTypeUnknownIdError extends Error {
|
|
13856
|
+
private constructor();
|
|
13857
|
+
}
|
|
13858
|
+
|
|
13944
13859
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
13945
13860
|
export class LocationInUnloadedChunkError extends Error {
|
|
13946
13861
|
private constructor();
|
|
@@ -13962,7 +13877,6 @@ export const MoonPhaseCount = 8;
|
|
|
13962
13877
|
*/
|
|
13963
13878
|
export const TicksPerDay = 24000;
|
|
13964
13879
|
/**
|
|
13965
|
-
* @beta
|
|
13966
13880
|
* @remarks
|
|
13967
13881
|
* How many times the server ticks per second of real time.
|
|
13968
13882
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server",
|
|
3
|
-
"version": "1.9.0-beta.1.20.60-preview.
|
|
3
|
+
"version": "1.9.0-beta.1.20.60-preview.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@minecraft/common": "^1.1.0
|
|
16
|
+
"@minecraft/common": "^1.1.0"
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT"
|
|
19
19
|
}
|