@minecraft/server 2.8.0-rc.1.26.30-preview.27 → 2.8.0-rc.1.26.30-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.
Files changed (2) hide show
  1. package/index.d.ts +292 -0
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1438,6 +1438,13 @@ export enum EntityHealCause {
1438
1438
  *
1439
1439
  */
1440
1440
  SelfHeal = 'SelfHeal',
1441
+ /**
1442
+ * @rc
1443
+ * @remarks
1444
+ * Healing caused when Totem of Undying is activated.
1445
+ *
1446
+ */
1447
+ TotemOfUndying = 'TotemOfUndying',
1441
1448
  }
1442
1449
 
1443
1450
  /**
@@ -4343,6 +4350,22 @@ export class BlockComponentBlockBreakEvent extends BlockEvent {
4343
4350
  readonly entitySource?: Entity;
4344
4351
  }
4345
4352
 
4353
+ /**
4354
+ * @rc
4355
+ * Contains information regarding a specific block permutation
4356
+ * that was changed from a previous permutation.
4357
+ */
4358
+ // @ts-ignore Class inheritance allowed for native defined classes
4359
+ export class BlockComponentBlockStateChangeEvent extends BlockEvent {
4360
+ private constructor();
4361
+ /**
4362
+ * @remarks
4363
+ * The previous BlockPermutation.
4364
+ *
4365
+ */
4366
+ readonly previousPermutation: BlockPermutation;
4367
+ }
4368
+
4346
4369
  /**
4347
4370
  * Contains information regarding an event sent by an entity to
4348
4371
  * this block in the world.
@@ -12586,6 +12609,34 @@ export class EntityUnderwaterMovementComponent extends EntityAttributeComponent
12586
12609
  static readonly componentId = 'minecraft:underwater_movement';
12587
12610
  }
12588
12611
 
12612
+ /**
12613
+ * @rc
12614
+ * Contains information related to firing of a data driven
12615
+ * entity version upgrade.
12616
+ */
12617
+ export class EntityUpgradeAfterEvent {
12618
+ private constructor();
12619
+ /**
12620
+ * @remarks
12621
+ * Entity that the upgrade triggered on.
12622
+ *
12623
+ */
12624
+ readonly entity: Entity;
12625
+ /**
12626
+ * @remarks
12627
+ * Name of the data driven upgrade being triggered.
12628
+ *
12629
+ */
12630
+ readonly upgradeId: string;
12631
+ /**
12632
+ * @remarks
12633
+ * An updateable list of modifications to component state that
12634
+ * are the effect of this triggered upgrade.
12635
+ *
12636
+ */
12637
+ getModifiers(): DefinitionModifier[];
12638
+ }
12639
+
12589
12640
  /**
12590
12641
  * Used to differentiate the component group of a variant of an
12591
12642
  * entity from others. (e.g. ocelot, villager).
@@ -18126,6 +18177,151 @@ export class PressurePlatePushAfterEventSignal {
18126
18177
  unsubscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): void;
18127
18178
  }
18128
18179
 
18180
+ /**
18181
+ * @rc
18182
+ * The base class for a text primitive. Represents an object in
18183
+ * the world and its base properties.
18184
+ */
18185
+ export class PrimitiveShape {
18186
+ private constructor();
18187
+ /**
18188
+ * @remarks
18189
+ * The entity this shape is attached to. When set, this shape
18190
+ * will copy the root location of the attached entity and the
18191
+ * shape's position will be used as an offset.
18192
+ *
18193
+ */
18194
+ attachedTo?: Entity;
18195
+ /**
18196
+ * @remarks
18197
+ * The color of the shape.
18198
+ *
18199
+ */
18200
+ color: RGBA;
18201
+ /**
18202
+ * @remarks
18203
+ * The dimension the shape is visible within. If the dimension
18204
+ * is undefined, it will display in all dimensions.
18205
+ *
18206
+ */
18207
+ readonly dimension: Dimension;
18208
+ /**
18209
+ * @remarks
18210
+ * Returns true if the shape has a limited time span before
18211
+ * being removed.
18212
+ *
18213
+ */
18214
+ readonly hasDuration: boolean;
18215
+ /**
18216
+ * @remarks
18217
+ * The location of the shape.
18218
+ *
18219
+ */
18220
+ readonly location: Vector3;
18221
+ /**
18222
+ * @remarks
18223
+ * If defined, this distance will be used to determine how far
18224
+ * away this primitive will be rendered for each client. By
18225
+ * default the distance will match the client's render distance
18226
+ * setting.
18227
+ *
18228
+ * Minimum Value: 0
18229
+ */
18230
+ maximumRenderDistance?: number;
18231
+ /**
18232
+ * @remarks
18233
+ * The rotation of the shape (Euler angles - [Pitch, Yaw,
18234
+ * Roll]).
18235
+ *
18236
+ */
18237
+ rotation: Vector3;
18238
+ /**
18239
+ * @remarks
18240
+ * The scale of the shape.
18241
+ *
18242
+ * Bounds: [-1000, 1000]
18243
+ */
18244
+ scale: number;
18245
+ /**
18246
+ * @remarks
18247
+ * The time left (in seconds) until this shape is automatically
18248
+ * removed. Returns undefined if the shape does not have a
18249
+ * limited life-span.
18250
+ *
18251
+ */
18252
+ timeLeft?: number;
18253
+ /**
18254
+ * @remarks
18255
+ * The total initial time-span (in seconds) until this shape is
18256
+ * automatically removed. Returns undefined if the shape does
18257
+ * not have a limited life-span.
18258
+ *
18259
+ */
18260
+ readonly totalTimeLeft?: number;
18261
+ /**
18262
+ * @remarks
18263
+ * The list of players that this shape will be visible to. If
18264
+ * left empty, the shape will be visible to all players.
18265
+ *
18266
+ */
18267
+ visibleTo: Player[];
18268
+ /**
18269
+ * @remarks
18270
+ * Removes this shape from the world. The shape can be re-added
18271
+ * via the PrimitiveShapesManager's addText method.
18272
+ *
18273
+ */
18274
+ remove(): void;
18275
+ /**
18276
+ * @remarks
18277
+ * Set the location and dimension of the shape. If the
18278
+ * dimension is undefined, it will display in all dimensions.
18279
+ *
18280
+ */
18281
+ setLocation(location: DimensionLocation | Vector3): void;
18282
+ }
18283
+
18284
+ /**
18285
+ * @rc
18286
+ * Primitive Shapes class used to allow adding and removing
18287
+ * text primitives to the world.
18288
+ */
18289
+ export class PrimitiveShapesManager {
18290
+ private constructor();
18291
+ /**
18292
+ * @remarks
18293
+ * This is the maximum number of allowed primitive shapes.
18294
+ *
18295
+ */
18296
+ readonly maxShapes: number;
18297
+ /**
18298
+ * @remarks
18299
+ * Adds a new text primitive to the world.
18300
+ *
18301
+ * @param text
18302
+ * The text primitive to be added.
18303
+ * @throws This function can throw errors.
18304
+ *
18305
+ * {@link minecraftcommon.EngineError}
18306
+ *
18307
+ * {@link PrimitiveShapeError}
18308
+ */
18309
+ addText(text: TextPrimitive, dimension?: Dimension): void;
18310
+ /**
18311
+ * @remarks
18312
+ * Removes all text primitives from the world.
18313
+ *
18314
+ */
18315
+ removeAll(): void;
18316
+ /**
18317
+ * @remarks
18318
+ * Removes an instance of a text primitive from the world. This
18319
+ * is equivalent to calling remove on the text itself.
18320
+ *
18321
+ */
18322
+ removeText(text: TextPrimitive): void;
18323
+ }
18324
+
18129
18325
  /**
18130
18326
  * Contains information related to a projectile hitting a
18131
18327
  * block.
@@ -20132,6 +20328,73 @@ export class TargetBlockHitAfterEventSignal {
20132
20328
  unsubscribe(callback: (arg0: TargetBlockHitAfterEvent) => void): void;
20133
20329
  }
20134
20330
 
20331
+ /**
20332
+ * @rc
20333
+ * A primitive shape class that represents a text label in the
20334
+ * world with a background.
20335
+ */
20336
+ // @ts-ignore Class inheritance allowed for native defined classes
20337
+ export class TextPrimitive extends PrimitiveShape {
20338
+ /**
20339
+ * @remarks
20340
+ * If set to true, the text primitive will render the back-face
20341
+ * of the background. Defaults to true but will always be false
20342
+ * if 'useRotation' is set to false.
20343
+ *
20344
+ */
20345
+ backfaceVisible: boolean;
20346
+ /**
20347
+ * @remarks
20348
+ * The color of the background plate of the text. If set to
20349
+ * undefined, it will use the default color.
20350
+ *
20351
+ */
20352
+ backgroundColorOverride?: RGBA;
20353
+ /**
20354
+ * @remarks
20355
+ * If set to true, the text will be hidden behind blocks or
20356
+ * entities. By default this is set to false (will always
20357
+ * render).
20358
+ *
20359
+ */
20360
+ depthTest: boolean;
20361
+ /**
20362
+ * @remarks
20363
+ * Get the text of the debug text shape. Returns the RawText of
20364
+ * the debug text if `setText` was called with a RawMessage or
20365
+ * a RawText object, otherwise returns a string.
20366
+ *
20367
+ */
20368
+ readonly text: RawMessage | string;
20369
+ /**
20370
+ * @remarks
20371
+ * If set to true, the text primitive will render the back-face
20372
+ * of the text. Defaults to true but will always be false if
20373
+ * 'useRotation' is set to false.
20374
+ *
20375
+ */
20376
+ textBackfaceVisible: boolean;
20377
+ /**
20378
+ * @remarks
20379
+ * If set to true, the text will not face the camera and
20380
+ * instead will use the rotation from the shape.
20381
+ *
20382
+ */
20383
+ useRotation: boolean;
20384
+ constructor(location: DimensionLocation | Vector3, text: RawMessage | string);
20385
+ /**
20386
+ * @remarks
20387
+ * Sets the text to display.
20388
+ *
20389
+ * @throws This function can throw errors.
20390
+ *
20391
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
20392
+ *
20393
+ * {@link RawMessageError}
20394
+ */
20395
+ setText(text: RawMessage | string): void;
20396
+ }
20397
+
20135
20398
  /**
20136
20399
  * This manager is used to add, remove or query temporary
20137
20400
  * ticking areas to a dimension. These ticking areas are
@@ -20553,6 +20816,14 @@ export class World {
20553
20816
  */
20554
20817
  readonly gameRules: GameRules;
20555
20818
  readonly isHardcore: boolean;
20819
+ /**
20820
+ * @rc
20821
+ * @remarks
20822
+ * Manager for adding and removing primitive text objects in
20823
+ * the world.
20824
+ *
20825
+ */
20826
+ readonly primitiveShapesManager: PrimitiveShapesManager;
20556
20827
  /**
20557
20828
  * @remarks
20558
20829
  * Returns the general global scoreboard that applies to the
@@ -20772,6 +21043,15 @@ export class World {
20772
21043
  *
20773
21044
  */
20774
21045
  getMoonPhase(): MoonPhase;
21046
+ /**
21047
+ * @rc
21048
+ * @remarks
21049
+ * Returns a map of pack setting name and value pairs.
21050
+ *
21051
+ * This function can be called in early-execution mode.
21052
+ *
21053
+ */
21054
+ getPackSettings(): Record<string, boolean | number | string>;
20775
21055
  /**
20776
21056
  * @remarks
20777
21057
  * Returns a set of players based on a set of conditions
@@ -21725,6 +22005,10 @@ export interface BlockCustomComponent {
21725
22005
  *
21726
22006
  */
21727
22007
  beforeOnPlayerPlace?: (arg0: BlockComponentPlayerPlaceBeforeEvent, arg1: CustomComponentParameters) => void;
22008
+ /**
22009
+ * @rc
22010
+ */
22011
+ onBlockStateChange?: (arg0: BlockComponentBlockStateChangeEvent, arg1: CustomComponentParameters) => void;
21728
22012
  /**
21729
22013
  * @remarks
21730
22014
  * This function will be called when a specific block is
@@ -24631,6 +24915,14 @@ export class PlaceJigsawError extends Error {
24631
24915
  private constructor();
24632
24916
  }
24633
24917
 
24918
+ /**
24919
+ * @rc
24920
+ */
24921
+ // @ts-ignore Class inheritance allowed for native defined classes
24922
+ export class PrimitiveShapeError extends Error {
24923
+ private constructor();
24924
+ }
24925
+
24634
24926
  // @ts-ignore Class inheritance allowed for native defined classes
24635
24927
  export class RawMessageError extends Error {
24636
24928
  private constructor();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "2.8.0-rc.1.26.30-preview.27",
3
+ "version": "2.8.0-rc.1.26.30-preview.28",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "peerDependencies": {
16
16
  "@minecraft/common": "^1.2.0",
17
- "@minecraft/vanilla-data": ">=1.20.70 || 1.26.30-preview.27"
17
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.26.30-preview.28"
18
18
  },
19
19
  "license": "MIT"
20
20
  }