@minecraft/server 2.0.0-beta.1.21.70-preview.25 → 2.0.0-beta.1.21.80-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 +50 -7
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2624,7 +2624,7 @@ export type EntityComponentTypeMap = {
|
|
|
2624
2624
|
*/
|
|
2625
2625
|
export type ItemComponentReturnType<T extends string> = T extends keyof ItemComponentTypeMap
|
|
2626
2626
|
? ItemComponentTypeMap[T]
|
|
2627
|
-
:
|
|
2627
|
+
: ItemCustomComponentInstance;
|
|
2628
2628
|
|
|
2629
2629
|
/**
|
|
2630
2630
|
* @rc
|
|
@@ -10394,10 +10394,9 @@ export class EntityPushThroughComponent extends EntityComponent {
|
|
|
10394
10394
|
* @remarks
|
|
10395
10395
|
* Value of the push through distances of this entity.
|
|
10396
10396
|
*
|
|
10397
|
-
* This property can
|
|
10398
|
-
*
|
|
10397
|
+
* @throws This property can throw when used.
|
|
10399
10398
|
*/
|
|
10400
|
-
value: number;
|
|
10399
|
+
readonly value: number;
|
|
10401
10400
|
static readonly componentId = 'minecraft:push_through';
|
|
10402
10401
|
}
|
|
10403
10402
|
|
|
@@ -11999,6 +11998,15 @@ export class ItemCooldownComponent extends ItemComponent {
|
|
|
11999
11998
|
startCooldown(player: Player): void;
|
|
12000
11999
|
}
|
|
12001
12000
|
|
|
12001
|
+
/**
|
|
12002
|
+
* @beta
|
|
12003
|
+
* An instance of a custom component on an item.
|
|
12004
|
+
*/
|
|
12005
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
12006
|
+
export class ItemCustomComponentInstance extends ItemComponent {
|
|
12007
|
+
private constructor();
|
|
12008
|
+
}
|
|
12009
|
+
|
|
12002
12010
|
/**
|
|
12003
12011
|
* When present on an item, this item can take damage in the
|
|
12004
12012
|
* process of being used. Note that this component only applies
|
|
@@ -12608,8 +12616,9 @@ export class ItemStack {
|
|
|
12608
12616
|
* @param componentId
|
|
12609
12617
|
* The identifier of the component (e.g., 'minecraft:food'). If
|
|
12610
12618
|
* no namespace prefix is specified, 'minecraft:' is assumed.
|
|
12611
|
-
* Available component IDs
|
|
12612
|
-
* ItemComponentTypes} enum
|
|
12619
|
+
* Available component IDs are those in the {@link
|
|
12620
|
+
* ItemComponentTypes} enum and custom component IDs registered
|
|
12621
|
+
* with the {@link ItemComponentRegistry}.
|
|
12613
12622
|
* @returns
|
|
12614
12623
|
* Returns the component if it exists on the item stack,
|
|
12615
12624
|
* otherwise undefined.
|
|
@@ -14012,6 +14021,10 @@ export class Player extends Entity {
|
|
|
14012
14021
|
* This method can throw if the provided {@link RawMessage} is
|
|
14013
14022
|
* in an invalid format. For example, if an empty `name` string
|
|
14014
14023
|
* is provided to `score`.
|
|
14024
|
+
*
|
|
14025
|
+
* {@link InvalidEntityError}
|
|
14026
|
+
*
|
|
14027
|
+
* {@link RawMessageError}
|
|
14015
14028
|
* @example nestedTranslation.ts
|
|
14016
14029
|
* ```typescript
|
|
14017
14030
|
* import { world, DimensionLocation } from "@minecraft/server";
|
|
@@ -16224,6 +16237,8 @@ export class ScreenDisplay {
|
|
|
16224
16237
|
* This function can't be called in read-only mode.
|
|
16225
16238
|
*
|
|
16226
16239
|
* @throws This function can throw errors.
|
|
16240
|
+
*
|
|
16241
|
+
* {@link InvalidEntityError}
|
|
16227
16242
|
*/
|
|
16228
16243
|
getHiddenHudElements(): HudElement[];
|
|
16229
16244
|
/**
|
|
@@ -16231,6 +16246,8 @@ export class ScreenDisplay {
|
|
|
16231
16246
|
* This function can't be called in read-only mode.
|
|
16232
16247
|
*
|
|
16233
16248
|
* @throws This function can throw errors.
|
|
16249
|
+
*
|
|
16250
|
+
* {@link InvalidEntityError}
|
|
16234
16251
|
*/
|
|
16235
16252
|
hideAllExcept(hudElements?: HudElement[]): void;
|
|
16236
16253
|
/**
|
|
@@ -16238,15 +16255,20 @@ export class ScreenDisplay {
|
|
|
16238
16255
|
* This function can't be called in read-only mode.
|
|
16239
16256
|
*
|
|
16240
16257
|
* @throws This function can throw errors.
|
|
16258
|
+
*
|
|
16259
|
+
* {@link InvalidEntityError}
|
|
16241
16260
|
*/
|
|
16242
16261
|
isForcedHidden(hudElement: HudElement): boolean;
|
|
16243
16262
|
/**
|
|
16263
|
+
* @beta
|
|
16244
16264
|
* @remarks
|
|
16245
16265
|
* This function can't be called in read-only mode.
|
|
16246
16266
|
*
|
|
16247
16267
|
* @throws This function can throw errors.
|
|
16268
|
+
*
|
|
16269
|
+
* {@link InvalidEntityError}
|
|
16248
16270
|
*/
|
|
16249
|
-
|
|
16271
|
+
resetHudElementsVisibility(): void;
|
|
16250
16272
|
/**
|
|
16251
16273
|
* @remarks
|
|
16252
16274
|
* Set the action bar text - a piece of text that displays
|
|
@@ -16257,6 +16279,10 @@ export class ScreenDisplay {
|
|
|
16257
16279
|
* @param text
|
|
16258
16280
|
* New value for the action bar text.
|
|
16259
16281
|
* @throws This function can throw errors.
|
|
16282
|
+
*
|
|
16283
|
+
* {@link InvalidEntityError}
|
|
16284
|
+
*
|
|
16285
|
+
* {@link RawMessageError}
|
|
16260
16286
|
*/
|
|
16261
16287
|
setActionBar(text: (RawMessage | string)[] | RawMessage | string): void;
|
|
16262
16288
|
/**
|
|
@@ -16272,6 +16298,8 @@ export class ScreenDisplay {
|
|
|
16272
16298
|
* @param hudElements
|
|
16273
16299
|
* Optional list of HUD elements to configure visibility for.
|
|
16274
16300
|
* @throws This function can throw errors.
|
|
16301
|
+
*
|
|
16302
|
+
* {@link InvalidEntityError}
|
|
16275
16303
|
*/
|
|
16276
16304
|
setHudVisibility(visible: HudVisibility, hudElements?: HudElement[]): void;
|
|
16277
16305
|
/**
|
|
@@ -16284,6 +16312,12 @@ export class ScreenDisplay {
|
|
|
16284
16312
|
* This function can't be called in read-only mode.
|
|
16285
16313
|
*
|
|
16286
16314
|
* @throws This function can throw errors.
|
|
16315
|
+
*
|
|
16316
|
+
* {@link minecraftcommon.ArgumentOutOfBoundsError}
|
|
16317
|
+
*
|
|
16318
|
+
* {@link InvalidEntityError}
|
|
16319
|
+
*
|
|
16320
|
+
* {@link RawMessageError}
|
|
16287
16321
|
* @example setTitle.ts
|
|
16288
16322
|
* ```typescript
|
|
16289
16323
|
* import { world, DimensionLocation } from "@minecraft/server";
|
|
@@ -16349,6 +16383,10 @@ export class ScreenDisplay {
|
|
|
16349
16383
|
* This function can't be called in read-only mode.
|
|
16350
16384
|
*
|
|
16351
16385
|
* @throws This function can throw errors.
|
|
16386
|
+
*
|
|
16387
|
+
* {@link InvalidEntityError}
|
|
16388
|
+
*
|
|
16389
|
+
* {@link RawMessageError}
|
|
16352
16390
|
* @example countdown.ts
|
|
16353
16391
|
* ```typescript
|
|
16354
16392
|
* import { world, system, DimensionLocation } from "@minecraft/server";
|
|
@@ -21006,6 +21044,11 @@ export class PlaceJigsawError extends Error {
|
|
|
21006
21044
|
private constructor();
|
|
21007
21045
|
}
|
|
21008
21046
|
|
|
21047
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
21048
|
+
export class RawMessageError extends Error {
|
|
21049
|
+
private constructor();
|
|
21050
|
+
}
|
|
21051
|
+
|
|
21009
21052
|
/**
|
|
21010
21053
|
* Error thrown when the specified area contains one or more
|
|
21011
21054
|
* unloaded chunks.
|