@minecraft/server 2.0.0-beta.1.21.80-preview.26 → 2.0.0-beta.1.21.80-preview.28
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 +162 -95
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -238,6 +238,20 @@ export enum CustomCommandErrorReason {
|
|
|
238
238
|
*
|
|
239
239
|
*/
|
|
240
240
|
AlreadyRegistered = 'AlreadyRegistered',
|
|
241
|
+
/**
|
|
242
|
+
* @remarks
|
|
243
|
+
* Custom Command references an enum that has not been
|
|
244
|
+
* registered.
|
|
245
|
+
*
|
|
246
|
+
*/
|
|
247
|
+
EnumDependencyMissing = 'EnumDependencyMissing',
|
|
248
|
+
/**
|
|
249
|
+
* @remarks
|
|
250
|
+
* Supplied Custom Command namespace does not match previous
|
|
251
|
+
* registrations for this add-on.
|
|
252
|
+
*
|
|
253
|
+
*/
|
|
254
|
+
NamespaceMismatch = 'NamespaceMismatch',
|
|
241
255
|
/**
|
|
242
256
|
* @remarks
|
|
243
257
|
* Too many command parameters defined in CustomCommand.
|
|
@@ -262,17 +276,69 @@ export enum CustomCommandErrorReason {
|
|
|
262
276
|
|
|
263
277
|
/**
|
|
264
278
|
* @beta
|
|
279
|
+
* The types of paramaters accepted by a custom command.
|
|
265
280
|
*/
|
|
266
281
|
export enum CustomCommandParamType {
|
|
282
|
+
/**
|
|
283
|
+
* @remarks
|
|
284
|
+
* Command boolean parameter expecting true or false as input.
|
|
285
|
+
*
|
|
286
|
+
*/
|
|
267
287
|
Boolean = 0,
|
|
288
|
+
/**
|
|
289
|
+
* @remarks
|
|
290
|
+
* Command integer parameter.
|
|
291
|
+
*
|
|
292
|
+
*/
|
|
268
293
|
Integer = 1,
|
|
294
|
+
/**
|
|
295
|
+
* @remarks
|
|
296
|
+
* Command float parameter.
|
|
297
|
+
*
|
|
298
|
+
*/
|
|
269
299
|
Float = 2,
|
|
300
|
+
/**
|
|
301
|
+
* @remarks
|
|
302
|
+
* Command string parameter.
|
|
303
|
+
*
|
|
304
|
+
*/
|
|
270
305
|
String = 3,
|
|
306
|
+
/**
|
|
307
|
+
* @remarks
|
|
308
|
+
* Command entity selector parameter.
|
|
309
|
+
*
|
|
310
|
+
*/
|
|
271
311
|
EntitySelector = 4,
|
|
312
|
+
/**
|
|
313
|
+
* @remarks
|
|
314
|
+
* Command player selector parameter.
|
|
315
|
+
*
|
|
316
|
+
*/
|
|
272
317
|
PlayerSelector = 5,
|
|
318
|
+
/**
|
|
319
|
+
* @remarks
|
|
320
|
+
* Command location parameter.
|
|
321
|
+
*
|
|
322
|
+
*/
|
|
273
323
|
Location = 6,
|
|
324
|
+
/**
|
|
325
|
+
* @remarks
|
|
326
|
+
* Command block type parameter expecting a Minecraft block.
|
|
327
|
+
*
|
|
328
|
+
*/
|
|
274
329
|
BlockType = 7,
|
|
330
|
+
/**
|
|
331
|
+
* @remarks
|
|
332
|
+
* Command item name parameter.
|
|
333
|
+
*
|
|
334
|
+
*/
|
|
275
335
|
ItemType = 8,
|
|
336
|
+
/**
|
|
337
|
+
* @remarks
|
|
338
|
+
* Command enum parameter.
|
|
339
|
+
*
|
|
340
|
+
*/
|
|
341
|
+
Enum = 9,
|
|
276
342
|
}
|
|
277
343
|
|
|
278
344
|
/**
|
|
@@ -670,13 +736,6 @@ export enum EntityComponentTypes {
|
|
|
670
736
|
*
|
|
671
737
|
*/
|
|
672
738
|
FrictionModifier = 'minecraft:friction_modifier',
|
|
673
|
-
/**
|
|
674
|
-
* @remarks
|
|
675
|
-
* Sets the offset from the ground that the entity is actually
|
|
676
|
-
* at.
|
|
677
|
-
*
|
|
678
|
-
*/
|
|
679
|
-
GroundOffset = 'minecraft:ground_offset',
|
|
680
739
|
/**
|
|
681
740
|
* @remarks
|
|
682
741
|
* Defines the interactions with this entity for healing it.
|
|
@@ -2555,7 +2614,7 @@ export enum WeatherType {
|
|
|
2555
2614
|
|
|
2556
2615
|
export type BlockComponentReturnType<T extends string> = T extends keyof BlockComponentTypeMap
|
|
2557
2616
|
? BlockComponentTypeMap[T]
|
|
2558
|
-
:
|
|
2617
|
+
: BlockCustomComponentInstance;
|
|
2559
2618
|
|
|
2560
2619
|
export type BlockComponentTypeMap = {
|
|
2561
2620
|
destruction_particles: BlockDestructionParticlesComponent;
|
|
@@ -2605,7 +2664,6 @@ export type EntityComponentTypeMap = {
|
|
|
2605
2664
|
floats_in_liquid: EntityFloatsInLiquidComponent;
|
|
2606
2665
|
flying_speed: EntityFlyingSpeedComponent;
|
|
2607
2666
|
friction_modifier: EntityFrictionModifierComponent;
|
|
2608
|
-
ground_offset: EntityGroundOffsetComponent;
|
|
2609
2667
|
healable: EntityHealableComponent;
|
|
2610
2668
|
health: EntityHealthComponent;
|
|
2611
2669
|
inventory: EntityInventoryComponent;
|
|
@@ -2640,7 +2698,6 @@ export type EntityComponentTypeMap = {
|
|
|
2640
2698
|
'minecraft:floats_in_liquid': EntityFloatsInLiquidComponent;
|
|
2641
2699
|
'minecraft:flying_speed': EntityFlyingSpeedComponent;
|
|
2642
2700
|
'minecraft:friction_modifier': EntityFrictionModifierComponent;
|
|
2643
|
-
'minecraft:ground_offset': EntityGroundOffsetComponent;
|
|
2644
2701
|
'minecraft:healable': EntityHealableComponent;
|
|
2645
2702
|
'minecraft:health': EntityHealthComponent;
|
|
2646
2703
|
'minecraft:inventory': EntityInventoryComponent;
|
|
@@ -2777,8 +2834,6 @@ export class AimAssistCategory {
|
|
|
2777
2834
|
* getBlockPriorities.
|
|
2778
2835
|
*
|
|
2779
2836
|
* @throws This property can throw when used.
|
|
2780
|
-
*
|
|
2781
|
-
* {@link Error}
|
|
2782
2837
|
*/
|
|
2783
2838
|
readonly defaultBlockPriority: number;
|
|
2784
2839
|
/**
|
|
@@ -2787,8 +2842,6 @@ export class AimAssistCategory {
|
|
|
2787
2842
|
* in getEntityPriorities.
|
|
2788
2843
|
*
|
|
2789
2844
|
* @throws This property can throw when used.
|
|
2790
|
-
*
|
|
2791
|
-
* {@link Error}
|
|
2792
2845
|
*/
|
|
2793
2846
|
readonly defaultEntityPriority: number;
|
|
2794
2847
|
/**
|
|
@@ -2805,8 +2858,6 @@ export class AimAssistCategory {
|
|
|
2805
2858
|
* The record mapping block Ids to their priority settings.
|
|
2806
2859
|
* Larger numbers have greater priority.
|
|
2807
2860
|
* @throws This function can throw errors.
|
|
2808
|
-
*
|
|
2809
|
-
* {@link Error}
|
|
2810
2861
|
*/
|
|
2811
2862
|
getBlockPriorities(): Record<string, number>;
|
|
2812
2863
|
/**
|
|
@@ -2817,8 +2868,6 @@ export class AimAssistCategory {
|
|
|
2817
2868
|
* The record mapping entity Ids to their priority settings.
|
|
2818
2869
|
* Larger numbers have greater priority.
|
|
2819
2870
|
* @throws This function can throw errors.
|
|
2820
|
-
*
|
|
2821
|
-
* {@link Error}
|
|
2822
2871
|
*/
|
|
2823
2872
|
getEntityPriorities(): Record<string, number>;
|
|
2824
2873
|
}
|
|
@@ -2920,8 +2969,6 @@ export class AimAssistPreset {
|
|
|
2920
2969
|
* provided to setItemSettings.
|
|
2921
2970
|
*
|
|
2922
2971
|
* @throws This property can throw when used.
|
|
2923
|
-
*
|
|
2924
|
-
* {@link Error}
|
|
2925
2972
|
*/
|
|
2926
2973
|
readonly defaultItemSettings?: string;
|
|
2927
2974
|
/**
|
|
@@ -2929,8 +2976,6 @@ export class AimAssistPreset {
|
|
|
2929
2976
|
* Optional. Aim-assist category Id used for an empty hand.
|
|
2930
2977
|
*
|
|
2931
2978
|
* @throws This property can throw when used.
|
|
2932
|
-
*
|
|
2933
|
-
* {@link Error}
|
|
2934
2979
|
*/
|
|
2935
2980
|
readonly handSettings?: string;
|
|
2936
2981
|
/**
|
|
@@ -2947,8 +2992,6 @@ export class AimAssistPreset {
|
|
|
2947
2992
|
* @returns
|
|
2948
2993
|
* The array of block/entity Ids.
|
|
2949
2994
|
* @throws This function can throw errors.
|
|
2950
|
-
*
|
|
2951
|
-
* {@link Error}
|
|
2952
2995
|
*/
|
|
2953
2996
|
getExcludedTargets(): string[];
|
|
2954
2997
|
/**
|
|
@@ -2958,8 +3001,6 @@ export class AimAssistPreset {
|
|
|
2958
3001
|
* @returns
|
|
2959
3002
|
* The record mapping item Ids to aim-assist category Ids.
|
|
2960
3003
|
* @throws This function can throw errors.
|
|
2961
|
-
*
|
|
2962
|
-
* {@link Error}
|
|
2963
3004
|
*/
|
|
2964
3005
|
getItemSettings(): Record<string, string>;
|
|
2965
3006
|
/**
|
|
@@ -2970,8 +3011,6 @@ export class AimAssistPreset {
|
|
|
2970
3011
|
* @returns
|
|
2971
3012
|
* The array of item Ids.
|
|
2972
3013
|
* @throws This function can throw errors.
|
|
2973
|
-
*
|
|
2974
|
-
* {@link Error}
|
|
2975
3014
|
*/
|
|
2976
3015
|
getLiquidTargetingItems(): string[];
|
|
2977
3016
|
}
|
|
@@ -3373,6 +3412,7 @@ export class Block {
|
|
|
3373
3412
|
*
|
|
3374
3413
|
* @param steps
|
|
3375
3414
|
* Number of steps above to step before returning.
|
|
3415
|
+
* Defaults to: 1
|
|
3376
3416
|
* @throws This function can throw errors.
|
|
3377
3417
|
*
|
|
3378
3418
|
* {@link LocationInUnloadedChunkError}
|
|
@@ -3387,6 +3427,7 @@ export class Block {
|
|
|
3387
3427
|
*
|
|
3388
3428
|
* @param steps
|
|
3389
3429
|
* Number of steps below to step before returning.
|
|
3430
|
+
* Defaults to: 1
|
|
3390
3431
|
* @throws This function can throw errors.
|
|
3391
3432
|
*
|
|
3392
3433
|
* {@link LocationInUnloadedChunkError}
|
|
@@ -3475,6 +3516,7 @@ export class Block {
|
|
|
3475
3516
|
*
|
|
3476
3517
|
* @param steps
|
|
3477
3518
|
* Number of steps to the east to step before returning.
|
|
3519
|
+
* Defaults to: 1
|
|
3478
3520
|
* @throws This function can throw errors.
|
|
3479
3521
|
*
|
|
3480
3522
|
* {@link LocationInUnloadedChunkError}
|
|
@@ -3491,8 +3533,9 @@ export class Block {
|
|
|
3491
3533
|
* @param componentId
|
|
3492
3534
|
* The identifier of the component (e.g.,
|
|
3493
3535
|
* 'minecraft:inventory'). If no namespace prefix is specified,
|
|
3494
|
-
* 'minecraft:' is assumed. Available component IDs
|
|
3495
|
-
*
|
|
3536
|
+
* 'minecraft:' is assumed. Available component IDs are those
|
|
3537
|
+
* in the {@link BlockComponentTypes} enum and custom component
|
|
3538
|
+
* IDs registered with the {@link BlockComponentRegistry}.
|
|
3496
3539
|
* @returns
|
|
3497
3540
|
* Returns the component if it exists on the block, otherwise
|
|
3498
3541
|
* undefined.
|
|
@@ -3511,9 +3554,11 @@ export class Block {
|
|
|
3511
3554
|
* @param amount
|
|
3512
3555
|
* Number of instances of this block to place in the item
|
|
3513
3556
|
* stack.
|
|
3557
|
+
* Defaults to: 1
|
|
3514
3558
|
* @param withData
|
|
3515
3559
|
* Whether additional data facets of the item stack are
|
|
3516
3560
|
* included.
|
|
3561
|
+
* Defaults to: false
|
|
3517
3562
|
* @returns
|
|
3518
3563
|
* An itemStack with the specified amount of items and data.
|
|
3519
3564
|
* Returns undefined if block type is incompatible.
|
|
@@ -3674,6 +3719,7 @@ export class Block {
|
|
|
3674
3719
|
*
|
|
3675
3720
|
* @param steps
|
|
3676
3721
|
* Number of steps to the north to step before returning.
|
|
3722
|
+
* Defaults to: 1
|
|
3677
3723
|
* @throws This function can throw errors.
|
|
3678
3724
|
*
|
|
3679
3725
|
* {@link LocationInUnloadedChunkError}
|
|
@@ -3759,6 +3805,7 @@ export class Block {
|
|
|
3759
3805
|
*
|
|
3760
3806
|
* @param steps
|
|
3761
3807
|
* Number of steps to the south to step before returning.
|
|
3808
|
+
* Defaults to: 1
|
|
3762
3809
|
* @throws This function can throw errors.
|
|
3763
3810
|
*
|
|
3764
3811
|
* {@link LocationInUnloadedChunkError}
|
|
@@ -3794,6 +3841,7 @@ export class Block {
|
|
|
3794
3841
|
*
|
|
3795
3842
|
* @param steps
|
|
3796
3843
|
* Number of steps to the west to step before returning.
|
|
3844
|
+
* Defaults to: 1
|
|
3797
3845
|
* @throws This function can throw errors.
|
|
3798
3846
|
*
|
|
3799
3847
|
* {@link LocationInUnloadedChunkError}
|
|
@@ -4141,6 +4189,15 @@ export class BlockComponentTickEvent extends BlockEvent {
|
|
|
4141
4189
|
private constructor();
|
|
4142
4190
|
}
|
|
4143
4191
|
|
|
4192
|
+
/**
|
|
4193
|
+
* @beta
|
|
4194
|
+
* An instance of a custom component on a block.
|
|
4195
|
+
*/
|
|
4196
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
4197
|
+
export class BlockCustomComponentInstance extends BlockComponent {
|
|
4198
|
+
private constructor();
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4144
4201
|
/**
|
|
4145
4202
|
* @beta
|
|
4146
4203
|
* Represents the particles that appear when the block is
|
|
@@ -4154,8 +4211,6 @@ export class BlockDestructionParticlesComponent extends BlockComponent {
|
|
|
4154
4211
|
* Name of the texture used for the particles.
|
|
4155
4212
|
*
|
|
4156
4213
|
* @throws This property can throw when used.
|
|
4157
|
-
*
|
|
4158
|
-
* {@link Error}
|
|
4159
4214
|
*/
|
|
4160
4215
|
readonly texture: string;
|
|
4161
4216
|
/**
|
|
@@ -4163,8 +4218,6 @@ export class BlockDestructionParticlesComponent extends BlockComponent {
|
|
|
4163
4218
|
* Type of tint applied to the particles.
|
|
4164
4219
|
*
|
|
4165
4220
|
* @throws This property can throw when used.
|
|
4166
|
-
*
|
|
4167
|
-
* {@link Error}
|
|
4168
4221
|
*/
|
|
4169
4222
|
readonly tintMethod: TintMethod;
|
|
4170
4223
|
static readonly componentId = 'minecraft:destruction_particles';
|
|
@@ -4274,8 +4327,6 @@ export class BlockFluidContainerComponent extends BlockComponent {
|
|
|
4274
4327
|
* This function can't be called in read-only mode.
|
|
4275
4328
|
*
|
|
4276
4329
|
* @throws This function can throw errors.
|
|
4277
|
-
*
|
|
4278
|
-
* {@link Error}
|
|
4279
4330
|
*/
|
|
4280
4331
|
addDye(dye: ItemType): void;
|
|
4281
4332
|
/**
|
|
@@ -4285,8 +4336,6 @@ export class BlockFluidContainerComponent extends BlockComponent {
|
|
|
4285
4336
|
* This function can't be called in read-only mode.
|
|
4286
4337
|
*
|
|
4287
4338
|
* @throws This function can throw errors.
|
|
4288
|
-
*
|
|
4289
|
-
* {@link Error}
|
|
4290
4339
|
*/
|
|
4291
4340
|
getFluidType(): FluidType;
|
|
4292
4341
|
/**
|
|
@@ -4296,8 +4345,6 @@ export class BlockFluidContainerComponent extends BlockComponent {
|
|
|
4296
4345
|
* This function can't be called in read-only mode.
|
|
4297
4346
|
*
|
|
4298
4347
|
* @throws This function can throw errors.
|
|
4299
|
-
*
|
|
4300
|
-
* {@link Error}
|
|
4301
4348
|
*/
|
|
4302
4349
|
setFluidType(fluidType: FluidType): void;
|
|
4303
4350
|
/**
|
|
@@ -4308,8 +4355,6 @@ export class BlockFluidContainerComponent extends BlockComponent {
|
|
|
4308
4355
|
* This function can't be called in read-only mode.
|
|
4309
4356
|
*
|
|
4310
4357
|
* @throws This function can throw errors.
|
|
4311
|
-
*
|
|
4312
|
-
* {@link Error}
|
|
4313
4358
|
*/
|
|
4314
4359
|
setPotion(itemStack: ItemStack): void;
|
|
4315
4360
|
}
|
|
@@ -4419,8 +4464,6 @@ export class BlockMapColorComponent extends BlockComponent {
|
|
|
4419
4464
|
* Base map color defined for that block.
|
|
4420
4465
|
*
|
|
4421
4466
|
* @throws This property can throw when used.
|
|
4422
|
-
*
|
|
4423
|
-
* {@link Error}
|
|
4424
4467
|
*/
|
|
4425
4468
|
readonly color: RGBA;
|
|
4426
4469
|
/**
|
|
@@ -4435,8 +4478,6 @@ export class BlockMapColorComponent extends BlockComponent {
|
|
|
4435
4478
|
* Type of tint applied to the color.
|
|
4436
4479
|
*
|
|
4437
4480
|
* @throws This property can throw when used.
|
|
4438
|
-
*
|
|
4439
|
-
* {@link Error}
|
|
4440
4481
|
*/
|
|
4441
4482
|
readonly tintMethod: TintMethod;
|
|
4442
4483
|
static readonly componentId = 'minecraft:map_color';
|
|
@@ -4491,8 +4532,6 @@ export class BlockPermutation {
|
|
|
4491
4532
|
* @returns
|
|
4492
4533
|
* Whether this block is removed when touched by liquid.
|
|
4493
4534
|
* @throws This function can throw errors.
|
|
4494
|
-
*
|
|
4495
|
-
* {@link Error}
|
|
4496
4535
|
*/
|
|
4497
4536
|
canBeDestroyedByLiquidSpread(liquidType: LiquidType): boolean;
|
|
4498
4537
|
/**
|
|
@@ -4505,8 +4544,6 @@ export class BlockPermutation {
|
|
|
4505
4544
|
* @returns
|
|
4506
4545
|
* Whether this block can have a liquid placed over it.
|
|
4507
4546
|
* @throws This function can throw errors.
|
|
4508
|
-
*
|
|
4509
|
-
* {@link Error}
|
|
4510
4547
|
*/
|
|
4511
4548
|
canContainLiquid(liquidType: LiquidType): boolean;
|
|
4512
4549
|
/**
|
|
@@ -4528,6 +4565,7 @@ export class BlockPermutation {
|
|
|
4528
4565
|
* @param amount
|
|
4529
4566
|
* Number of instances of this block to place in the prototype
|
|
4530
4567
|
* item stack.
|
|
4568
|
+
* Defaults to: 1
|
|
4531
4569
|
*/
|
|
4532
4570
|
getItemStack(amount?: number): ItemStack | undefined;
|
|
4533
4571
|
/**
|
|
@@ -4582,8 +4620,6 @@ export class BlockPermutation {
|
|
|
4582
4620
|
* @returns
|
|
4583
4621
|
* Whether this block stops liquid from flowing.
|
|
4584
4622
|
* @throws This function can throw errors.
|
|
4585
|
-
*
|
|
4586
|
-
* {@link Error}
|
|
4587
4623
|
*/
|
|
4588
4624
|
isLiquidBlocking(liquidType: LiquidType): boolean;
|
|
4589
4625
|
/**
|
|
@@ -4597,8 +4633,6 @@ export class BlockPermutation {
|
|
|
4597
4633
|
* Whether this block is removed and spawns its item when
|
|
4598
4634
|
* touched by liquid.
|
|
4599
4635
|
* @throws This function can throw errors.
|
|
4600
|
-
*
|
|
4601
|
-
* {@link Error}
|
|
4602
4636
|
*/
|
|
4603
4637
|
liquidSpreadCausesSpawn(liquidType: LiquidType): boolean;
|
|
4604
4638
|
/**
|
|
@@ -4785,6 +4819,8 @@ export class BlockRecordPlayerComponent extends BlockComponent {
|
|
|
4785
4819
|
*
|
|
4786
4820
|
* This function can't be called in read-only mode.
|
|
4787
4821
|
*
|
|
4822
|
+
* @param startPlaying
|
|
4823
|
+
* Defaults to: true
|
|
4788
4824
|
* @throws This function can throw errors.
|
|
4789
4825
|
*/
|
|
4790
4826
|
setRecord(recordItemType?: ItemType | string, startPlaying?: boolean): void;
|
|
@@ -4925,6 +4961,7 @@ export class BlockSignComponent extends BlockComponent {
|
|
|
4925
4961
|
* The side of the sign to read the message from. If not
|
|
4926
4962
|
* provided, this will return the message from the front side
|
|
4927
4963
|
* of the sign.
|
|
4964
|
+
* Defaults to: 0
|
|
4928
4965
|
* @throws This function can throw errors.
|
|
4929
4966
|
*/
|
|
4930
4967
|
getRawText(side?: SignSide): RawText | undefined;
|
|
@@ -4937,6 +4974,7 @@ export class BlockSignComponent extends BlockComponent {
|
|
|
4937
4974
|
* The side of the sign to read the message from. If not
|
|
4938
4975
|
* provided, this will return the message from the front side
|
|
4939
4976
|
* of the sign.
|
|
4977
|
+
* Defaults to: 0
|
|
4940
4978
|
* @throws This function can throw errors.
|
|
4941
4979
|
*/
|
|
4942
4980
|
getText(side?: SignSide): string | undefined;
|
|
@@ -4948,6 +4986,7 @@ export class BlockSignComponent extends BlockComponent {
|
|
|
4948
4986
|
* @param side
|
|
4949
4987
|
* The side of the sign to read the dye from. If not provided,
|
|
4950
4988
|
* this will return the dye on the front side of the sign.
|
|
4989
|
+
* Defaults to: 0
|
|
4951
4990
|
* @throws This function can throw errors.
|
|
4952
4991
|
*/
|
|
4953
4992
|
getTextDyeColor(side?: SignSide): DyeColor | undefined;
|
|
@@ -4967,6 +5006,7 @@ export class BlockSignComponent extends BlockComponent {
|
|
|
4967
5006
|
* The side of the sign the message will be set on. If not
|
|
4968
5007
|
* provided, the message will be set on the front side of the
|
|
4969
5008
|
* sign.
|
|
5009
|
+
* Defaults to: 0
|
|
4970
5010
|
* @throws
|
|
4971
5011
|
* Throws if the provided message is greater than 512
|
|
4972
5012
|
* characters in length.
|
|
@@ -4981,10 +5021,12 @@ export class BlockSignComponent extends BlockComponent {
|
|
|
4981
5021
|
* @param color
|
|
4982
5022
|
* The dye color to apply to the sign or undefined to clear the
|
|
4983
5023
|
* dye on the sign.
|
|
5024
|
+
* Defaults to: null
|
|
4984
5025
|
* @param side
|
|
4985
5026
|
* The side of the sign the color will be set on. If not
|
|
4986
5027
|
* provided, the color will be set on the front side of the
|
|
4987
5028
|
* sign.
|
|
5029
|
+
* Defaults to: 0
|
|
4988
5030
|
* @throws This function can throw errors.
|
|
4989
5031
|
*/
|
|
4990
5032
|
setTextDyeColor(color?: DyeColor, side?: SignSide): void;
|
|
@@ -6676,6 +6718,23 @@ export class CustomCommandRegistry {
|
|
|
6676
6718
|
customCommand: CustomCommand,
|
|
6677
6719
|
callback: (origin: CustomCommandOrigin, ...args: any[]) => CustomCommandResult | undefined,
|
|
6678
6720
|
): void;
|
|
6721
|
+
/**
|
|
6722
|
+
* @remarks
|
|
6723
|
+
* Registers a custom command enum.
|
|
6724
|
+
*
|
|
6725
|
+
* This function can't be called in read-only mode.
|
|
6726
|
+
*
|
|
6727
|
+
* This function can be called in early-execution mode.
|
|
6728
|
+
*
|
|
6729
|
+
* @throws This function can throw errors.
|
|
6730
|
+
*
|
|
6731
|
+
* {@link CustomCommandError}
|
|
6732
|
+
*
|
|
6733
|
+
* {@link minecraftcommon.EngineError}
|
|
6734
|
+
*
|
|
6735
|
+
* {@link NamespaceNameError}
|
|
6736
|
+
*/
|
|
6737
|
+
registerEnum(name: string, values: string[]): void;
|
|
6679
6738
|
}
|
|
6680
6739
|
|
|
6681
6740
|
/**
|
|
@@ -6789,6 +6848,7 @@ export class Dimension {
|
|
|
6789
6848
|
* or all of the block volume is outside of the loaded chunks.
|
|
6790
6849
|
* Will only check the block locations that are within the
|
|
6791
6850
|
* loaded chunks in the volume.
|
|
6851
|
+
* Defaults to: false
|
|
6792
6852
|
* @returns
|
|
6793
6853
|
* Returns true if at least one block in the volume satisfies
|
|
6794
6854
|
* the filter, false otherwise.
|
|
@@ -6983,6 +7043,7 @@ export class Dimension {
|
|
|
6983
7043
|
* or all of the block volume is outside of the loaded chunks.
|
|
6984
7044
|
* Will only check the block locations that are within the
|
|
6985
7045
|
* loaded chunks in the volume.
|
|
7046
|
+
* Defaults to: false
|
|
6986
7047
|
* @returns
|
|
6987
7048
|
* Returns the ListBlockVolume that contains all the block
|
|
6988
7049
|
* locations that satisfied the block filter.
|
|
@@ -7151,6 +7212,7 @@ export class Dimension {
|
|
|
7151
7212
|
* Note: The function call will always throw an error if using
|
|
7152
7213
|
* an unknown feature name or trying to place in a unloaded
|
|
7153
7214
|
* chunk.
|
|
7215
|
+
* Defaults to: false
|
|
7154
7216
|
* @throws
|
|
7155
7217
|
* An error will be thrown if the feature name is invalid.
|
|
7156
7218
|
* An error will be thrown if the location is in an unloaded
|
|
@@ -7302,20 +7364,24 @@ export class Dimension {
|
|
|
7302
7364
|
* Newly created entity at the specified location.
|
|
7303
7365
|
* @throws This function can throw errors.
|
|
7304
7366
|
*
|
|
7367
|
+
* {@link Error}
|
|
7368
|
+
*
|
|
7369
|
+
* {@link minecraftcommon.InvalidArgumentError}
|
|
7370
|
+
*
|
|
7305
7371
|
* {@link LocationInUnloadedChunkError}
|
|
7306
7372
|
*
|
|
7307
7373
|
* {@link LocationOutOfWorldBoundariesError}
|
|
7308
7374
|
* @example spawnAdultHorse.ts
|
|
7309
7375
|
* ```typescript
|
|
7310
|
-
* import { DimensionLocation } from
|
|
7311
|
-
* import { Vector3Utils } from
|
|
7376
|
+
* import { DimensionLocation } from '@minecraft/server';
|
|
7377
|
+
* import { Vector3Utils } from '@minecraft/math';
|
|
7312
7378
|
*
|
|
7313
7379
|
* function spawnAdultHorse(log: (message: string, status?: number) => void, targetLocation: DimensionLocation) {
|
|
7314
|
-
*
|
|
7315
|
-
*
|
|
7316
|
-
*
|
|
7317
|
-
*
|
|
7318
|
-
*
|
|
7380
|
+
* log('Create a horse and triggering the ageable_grow_up event, ensuring the horse is created as an adult');
|
|
7381
|
+
* targetLocation.dimension.spawnEntity(
|
|
7382
|
+
* 'minecraft:horse<minecraft:ageable_grow_up>',
|
|
7383
|
+
* Vector3Utils.add(targetLocation, { x: 0, y: 1, z: 0 })
|
|
7384
|
+
* );
|
|
7319
7385
|
* }
|
|
7320
7386
|
* ```
|
|
7321
7387
|
* @example quickFoxLazyDog.ts
|
|
@@ -8153,6 +8219,7 @@ export class Entity {
|
|
|
8153
8219
|
* @param useEffects
|
|
8154
8220
|
* Whether to show any visual effects connected to the
|
|
8155
8221
|
* extinguishing.
|
|
8222
|
+
* Defaults to: true
|
|
8156
8223
|
* @returns
|
|
8157
8224
|
* Returns whether the entity was on fire.
|
|
8158
8225
|
* @throws This function can throw errors.
|
|
@@ -8561,7 +8628,7 @@ export class Entity {
|
|
|
8561
8628
|
*
|
|
8562
8629
|
* {@link CommandError}
|
|
8563
8630
|
*
|
|
8564
|
-
* {@link
|
|
8631
|
+
* {@link InvalidEntityError}
|
|
8565
8632
|
*/
|
|
8566
8633
|
runCommand(commandString: string): CommandResult;
|
|
8567
8634
|
/**
|
|
@@ -8600,6 +8667,7 @@ export class Entity {
|
|
|
8600
8667
|
* Whether side-effects should be applied (e.g. thawing freeze)
|
|
8601
8668
|
* and other conditions such as rain or fire protection should
|
|
8602
8669
|
* be taken into consideration.
|
|
8670
|
+
* Defaults to: true
|
|
8603
8671
|
* @returns
|
|
8604
8672
|
* Whether the entity was set on fire. This can fail if seconds
|
|
8605
8673
|
* is less than or equal to zero, the entity is wet or the
|
|
@@ -9336,26 +9404,6 @@ export class EntityFrictionModifierComponent extends EntityComponent {
|
|
|
9336
9404
|
static readonly componentId = 'minecraft:friction_modifier';
|
|
9337
9405
|
}
|
|
9338
9406
|
|
|
9339
|
-
/**
|
|
9340
|
-
* Sets the offset from the ground that the entity is actually
|
|
9341
|
-
* at.
|
|
9342
|
-
*/
|
|
9343
|
-
// @ts-ignore Class inheritance allowed for native defined classes
|
|
9344
|
-
export class EntityGroundOffsetComponent extends EntityComponent {
|
|
9345
|
-
private constructor();
|
|
9346
|
-
/**
|
|
9347
|
-
* @remarks
|
|
9348
|
-
* Value of this particular ground offset. Note that this value
|
|
9349
|
-
* is effectively read only; setting the ground offset value
|
|
9350
|
-
* will not have an impact on the related entity.
|
|
9351
|
-
*
|
|
9352
|
-
* This property can't be edited in read-only mode.
|
|
9353
|
-
*
|
|
9354
|
-
*/
|
|
9355
|
-
value: number;
|
|
9356
|
-
static readonly componentId = 'minecraft:ground_offset';
|
|
9357
|
-
}
|
|
9358
|
-
|
|
9359
9407
|
/**
|
|
9360
9408
|
* Defines the interactions with this entity for healing it.
|
|
9361
9409
|
*/
|
|
@@ -12217,8 +12265,6 @@ export class ItemCompostableComponent extends ItemComponent {
|
|
|
12217
12265
|
*
|
|
12218
12266
|
* @throws
|
|
12219
12267
|
* Throws if value outside the range [1 - 100]
|
|
12220
|
-
*
|
|
12221
|
-
* {@link Error}
|
|
12222
12268
|
*/
|
|
12223
12269
|
readonly compostingChance: number;
|
|
12224
12270
|
static readonly componentId = 'minecraft:compostable';
|
|
@@ -12351,6 +12397,7 @@ export class ItemDurabilityComponent extends ItemComponent {
|
|
|
12351
12397
|
* Unbreaking factor to consider in factoring the damage
|
|
12352
12398
|
* chance. Incoming unbreaking parameter must be within the
|
|
12353
12399
|
* range [0, 3].
|
|
12400
|
+
* Defaults to: 0
|
|
12354
12401
|
* @throws This function can throw errors.
|
|
12355
12402
|
*/
|
|
12356
12403
|
getDamageChance(unbreakingEnchantmentLevel?: number): number;
|
|
@@ -12387,8 +12434,6 @@ export class ItemDyeableComponent extends ItemComponent {
|
|
|
12387
12434
|
* Returns the default color of the item.
|
|
12388
12435
|
*
|
|
12389
12436
|
* @throws This property can throw when used.
|
|
12390
|
-
*
|
|
12391
|
-
* {@link Error}
|
|
12392
12437
|
*/
|
|
12393
12438
|
readonly defaultColor?: RGB;
|
|
12394
12439
|
static readonly componentId = 'minecraft:dyeable';
|
|
@@ -12863,6 +12908,7 @@ export class ItemStack {
|
|
|
12863
12908
|
* provided value will be clamped to the item's maximum stack
|
|
12864
12909
|
* size. Note that certain items can only have one item in the
|
|
12865
12910
|
* stack.
|
|
12911
|
+
* Defaults to: 1
|
|
12866
12912
|
* @throws
|
|
12867
12913
|
* Throws if `itemType` is invalid, or if `amount` is outside
|
|
12868
12914
|
* the range of 1-255.
|
|
@@ -13986,8 +14032,6 @@ export class Player extends Entity {
|
|
|
13986
14032
|
* Contains the player's device information.
|
|
13987
14033
|
*
|
|
13988
14034
|
* @throws This property can throw when used.
|
|
13989
|
-
*
|
|
13990
|
-
* {@link Error}
|
|
13991
14035
|
*/
|
|
13992
14036
|
readonly clientSystemInfo: ClientSystemInfo;
|
|
13993
14037
|
/**
|
|
@@ -15129,8 +15173,6 @@ export class PlayerInputPermissions {
|
|
|
15129
15173
|
* This function can't be called in read-only mode.
|
|
15130
15174
|
*
|
|
15131
15175
|
* @throws This function can throw errors.
|
|
15132
|
-
*
|
|
15133
|
-
* {@link Error}
|
|
15134
15176
|
*/
|
|
15135
15177
|
isPermissionCategoryEnabled(permissionCategory: InputPermissionCategory): boolean;
|
|
15136
15178
|
/**
|
|
@@ -17022,6 +17064,7 @@ export class Structure {
|
|
|
17022
17064
|
* @param saveMode
|
|
17023
17065
|
* Determines how the Structure should be saved. Defaults to
|
|
17024
17066
|
* saving to the world.
|
|
17067
|
+
* Defaults to: 1
|
|
17025
17068
|
* @returns
|
|
17026
17069
|
* Returns the newly created structure.
|
|
17027
17070
|
* @throws
|
|
@@ -17058,9 +17101,11 @@ export class Structure {
|
|
|
17058
17101
|
* The block location relative to the Structure's origin.
|
|
17059
17102
|
* @param blockPermutation
|
|
17060
17103
|
* The BlockPermutation to set.
|
|
17104
|
+
* Defaults to: null
|
|
17061
17105
|
* @param waterlogged
|
|
17062
17106
|
* Specifies whether the block should be waterlogged. Air and
|
|
17063
17107
|
* undefined blocks cannot be waterlogged.
|
|
17108
|
+
* Defaults to: false
|
|
17064
17109
|
* @throws
|
|
17065
17110
|
* Throws if the type of block is StructureVoid.
|
|
17066
17111
|
* Throws if the block is undefined and waterlogged is set to
|
|
@@ -17099,6 +17144,7 @@ export class StructureManager {
|
|
|
17099
17144
|
* @param saveMode
|
|
17100
17145
|
* How the Structure should be saved upon creation. Defaults to
|
|
17101
17146
|
* StructureSaveMode.Memory.
|
|
17147
|
+
* Defaults to: 0
|
|
17102
17148
|
* @returns
|
|
17103
17149
|
* Returns the newly created Structure.
|
|
17104
17150
|
* @throws
|
|
@@ -17216,7 +17262,7 @@ export class StructureManager {
|
|
|
17216
17262
|
options?: StructurePlaceOptions,
|
|
17217
17263
|
): void;
|
|
17218
17264
|
/**
|
|
17219
|
-
* @
|
|
17265
|
+
* @rc
|
|
17220
17266
|
* @remarks
|
|
17221
17267
|
* Places a partial jigsaw structure in the world. This is
|
|
17222
17268
|
* useful for debugging connections between jigsaw blocks.
|
|
@@ -17260,7 +17306,7 @@ export class StructureManager {
|
|
|
17260
17306
|
options?: JigsawPlaceOptions,
|
|
17261
17307
|
): BlockBoundingBox;
|
|
17262
17308
|
/**
|
|
17263
|
-
* @
|
|
17309
|
+
* @rc
|
|
17264
17310
|
* @remarks
|
|
17265
17311
|
* Places a jigsaw structure in the world.
|
|
17266
17312
|
*
|
|
@@ -20435,7 +20481,7 @@ export interface ItemCustomComponent {
|
|
|
20435
20481
|
}
|
|
20436
20482
|
|
|
20437
20483
|
/**
|
|
20438
|
-
* @
|
|
20484
|
+
* @rc
|
|
20439
20485
|
* Provides additional options for {@link
|
|
20440
20486
|
* StructureManager.placeJigsaw}.
|
|
20441
20487
|
*/
|
|
@@ -20457,7 +20503,7 @@ export interface JigsawPlaceOptions {
|
|
|
20457
20503
|
}
|
|
20458
20504
|
|
|
20459
20505
|
/**
|
|
20460
|
-
* @
|
|
20506
|
+
* @rc
|
|
20461
20507
|
* Provides additional options for {@link
|
|
20462
20508
|
* StructureManager.placeJigsawStructure}.
|
|
20463
20509
|
*/
|
|
@@ -20946,10 +20992,31 @@ export interface ScriptEventMessageFilterOptions {
|
|
|
20946
20992
|
|
|
20947
20993
|
/**
|
|
20948
20994
|
* @beta
|
|
20995
|
+
* Contains additional options for spawning an Entity.
|
|
20949
20996
|
*/
|
|
20950
20997
|
export interface SpawnEntityOptions {
|
|
20998
|
+
/**
|
|
20999
|
+
* @remarks
|
|
21000
|
+
* Optional boolean which determines if this entity should
|
|
21001
|
+
* persist in the game world. Persistence prevents the entity
|
|
21002
|
+
* from automatically despawning.
|
|
21003
|
+
*
|
|
21004
|
+
*/
|
|
20951
21005
|
initialPersistence?: boolean;
|
|
21006
|
+
/**
|
|
21007
|
+
* @remarks
|
|
21008
|
+
* Optional initial rotation, in degrees, to set on the entity
|
|
21009
|
+
* when it spawns.
|
|
21010
|
+
*
|
|
21011
|
+
*/
|
|
20952
21012
|
initialRotation?: number;
|
|
21013
|
+
/**
|
|
21014
|
+
* @remarks
|
|
21015
|
+
* Optional spawn event to send to the entity after it is
|
|
21016
|
+
* spawned.
|
|
21017
|
+
*
|
|
21018
|
+
*/
|
|
21019
|
+
spawnEvent?: string;
|
|
20953
21020
|
}
|
|
20954
21021
|
|
|
20955
21022
|
/**
|
|
@@ -21436,7 +21503,7 @@ export class NamespaceNameError extends Error {
|
|
|
21436
21503
|
}
|
|
21437
21504
|
|
|
21438
21505
|
/**
|
|
21439
|
-
* @
|
|
21506
|
+
* @rc
|
|
21440
21507
|
*/
|
|
21441
21508
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21442
21509
|
export class PlaceJigsawError extends Error {
|