@minecraft/server 2.8.0-rc.1.26.30-preview.27 → 2.8.0-rc.1.26.30-preview.30

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 +1013 -8
  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
  /**
@@ -2258,6 +2265,34 @@ export enum LiquidType {
2258
2265
  Water = 'Water',
2259
2266
  }
2260
2267
 
2268
+ /**
2269
+ * @rc
2270
+ * Enum representing the different reasons why a locator bar
2271
+ * operation may fail.
2272
+ */
2273
+ export enum LocatorBarErrorReason {
2274
+ /**
2275
+ * @remarks
2276
+ * The waypoint already exists in the locator bar and cannot be
2277
+ * added again.
2278
+ *
2279
+ */
2280
+ WaypointAlreadyExists = 'WaypointAlreadyExists',
2281
+ /**
2282
+ * @remarks
2283
+ * The maximum number of waypoints has been reached and no more
2284
+ * can be added.
2285
+ *
2286
+ */
2287
+ WaypointLimitExceeded = 'WaypointLimitExceeded',
2288
+ /**
2289
+ * @remarks
2290
+ * The specified waypoint does not exist in the locator bar.
2291
+ *
2292
+ */
2293
+ WaypointNotFound = 'WaypointNotFound',
2294
+ }
2295
+
2261
2296
  /**
2262
2297
  * Describes the memory of a device.
2263
2298
  */
@@ -2902,6 +2937,38 @@ export enum TintMethod {
2902
2937
  Water = 'Water',
2903
2938
  }
2904
2939
 
2940
+ /**
2941
+ * @rc
2942
+ * Enum representing different texture icons that can be
2943
+ * displayed for waypoints on the locator bar.
2944
+ */
2945
+ export enum WaypointTexture {
2946
+ /**
2947
+ * @remarks
2948
+ * Circle waypoint icon texture.
2949
+ *
2950
+ */
2951
+ Circle = 'minecraft:circle',
2952
+ /**
2953
+ * @remarks
2954
+ * Small square waypoint icon texture.
2955
+ *
2956
+ */
2957
+ SmallSquare = 'minecraft:small_square',
2958
+ /**
2959
+ * @remarks
2960
+ * Small star waypoint icon texture.
2961
+ *
2962
+ */
2963
+ SmallStar = 'minecraft:small_star',
2964
+ /**
2965
+ * @remarks
2966
+ * Square waypoint icon texture.
2967
+ *
2968
+ */
2969
+ Square = 'minecraft:square',
2970
+ }
2971
+
2905
2972
  /**
2906
2973
  * Used to specify the type of weather condition within the
2907
2974
  * world.
@@ -4343,6 +4410,22 @@ export class BlockComponentBlockBreakEvent extends BlockEvent {
4343
4410
  readonly entitySource?: Entity;
4344
4411
  }
4345
4412
 
4413
+ /**
4414
+ * @rc
4415
+ * Contains information regarding a specific block permutation
4416
+ * that was changed from a previous permutation.
4417
+ */
4418
+ // @ts-ignore Class inheritance allowed for native defined classes
4419
+ export class BlockComponentBlockStateChangeEvent extends BlockEvent {
4420
+ private constructor();
4421
+ /**
4422
+ * @remarks
4423
+ * The previous BlockPermutation.
4424
+ *
4425
+ */
4426
+ readonly previousPermutation: BlockPermutation;
4427
+ }
4428
+
4346
4429
  /**
4347
4430
  * Contains information regarding an event sent by an entity to
4348
4431
  * this block in the world.
@@ -7946,6 +8029,43 @@ export class Dimension {
7946
8029
  spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
7947
8030
  }
7948
8031
 
8032
+ /**
8033
+ * @rc
8034
+ * Provides the functionality for registering custom
8035
+ * dimensions. Custom dimensions can only be registered during
8036
+ * the system startup event.
8037
+ */
8038
+ export class DimensionRegistry {
8039
+ private constructor();
8040
+ /**
8041
+ * @remarks
8042
+ * Registers a new custom dimension type. Must be called during
8043
+ * the system startup event. The dimension will be created
8044
+ * using the void generator.
8045
+ *
8046
+ * This function can be called in early-execution mode.
8047
+ *
8048
+ * @param typeId
8049
+ * The namespaced identifier for the custom dimension (e.g.,
8050
+ * 'mypack:my_dimension'). Must include a namespace and use
8051
+ * only valid identifier characters.
8052
+ * @throws This function can throw errors.
8053
+ *
8054
+ * {@link CustomDimensionAlreadyRegisteredError}
8055
+ *
8056
+ * {@link CustomDimensionInvalidRegistryError}
8057
+ *
8058
+ * {@link CustomDimensionNameError}
8059
+ *
8060
+ * {@link CustomDimensionReloadNewDimensionError}
8061
+ *
8062
+ * {@link minecraftcommon.EngineError}
8063
+ *
8064
+ * {@link NamespaceNameError}
8065
+ */
8066
+ registerCustomDimension(typeId: string): void;
8067
+ }
8068
+
7949
8069
  /**
7950
8070
  * Represents a type of dimension. Currently only works with
7951
8071
  * Vanilla dimensions.
@@ -12586,6 +12706,68 @@ export class EntityUnderwaterMovementComponent extends EntityAttributeComponent
12586
12706
  static readonly componentId = 'minecraft:underwater_movement';
12587
12707
  }
12588
12708
 
12709
+ /**
12710
+ * @rc
12711
+ * Contains information related to firing of a data driven
12712
+ * entity version upgrade.
12713
+ */
12714
+ export class EntityUpgradeAfterEvent {
12715
+ private constructor();
12716
+ /**
12717
+ * @remarks
12718
+ * Entity that the upgrade triggered on.
12719
+ *
12720
+ */
12721
+ readonly entity: Entity;
12722
+ /**
12723
+ * @remarks
12724
+ * Name of the data driven upgrade being triggered.
12725
+ *
12726
+ */
12727
+ readonly upgradeId: string;
12728
+ /**
12729
+ * @remarks
12730
+ * An updateable list of modifications to component state that
12731
+ * are the effect of this triggered upgrade.
12732
+ *
12733
+ */
12734
+ getModifiers(): DefinitionModifier[];
12735
+ }
12736
+
12737
+ /**
12738
+ * @rc
12739
+ * Contains event registration related to firing of a data
12740
+ * driven entity version upgrade.
12741
+ */
12742
+ export class EntityUpgradeAfterEventSignal {
12743
+ private constructor();
12744
+ /**
12745
+ * @remarks
12746
+ * Adds a callback that will be called after a data driven
12747
+ * entity version upgrade is triggered.
12748
+ *
12749
+ * This function can't be called in restricted-execution mode.
12750
+ *
12751
+ * This function can be called in early-execution mode.
12752
+ *
12753
+ */
12754
+ subscribe(
12755
+ callback: (arg0: EntityUpgradeAfterEvent) => void,
12756
+ options?: EntityDataDrivenTriggerEventOptions,
12757
+ ): (arg0: EntityUpgradeAfterEvent) => void;
12758
+ /**
12759
+ * @remarks
12760
+ * Removes a callback that will be called after a data driven
12761
+ * entity version upgrade is triggered.
12762
+ *
12763
+ * This function can't be called in restricted-execution mode.
12764
+ *
12765
+ * This function can be called in early-execution mode.
12766
+ *
12767
+ */
12768
+ unsubscribe(callback: (arg0: EntityUpgradeAfterEvent) => void): void;
12769
+ }
12770
+
12589
12771
  /**
12590
12772
  * Used to differentiate the component group of a variant of an
12591
12773
  * entity from others. (e.g. ocelot, villager).
@@ -12614,6 +12796,51 @@ export class EntityWantsJockeyComponent extends EntityComponent {
12614
12796
  static readonly componentId = 'minecraft:wants_jockey';
12615
12797
  }
12616
12798
 
12799
+ /**
12800
+ * @rc
12801
+ * Waypoint that tracks an entity's position. The waypoint
12802
+ * automatically updates as the entity moves and becomes
12803
+ * invalid when the entity is removed.
12804
+ */
12805
+ // @ts-ignore Class inheritance allowed for native defined classes
12806
+ export class EntityWaypoint extends Waypoint {
12807
+ /**
12808
+ * @remarks
12809
+ * The entity being tracked by this waypoint.
12810
+ *
12811
+ * @throws This property can throw when used.
12812
+ *
12813
+ * {@link InvalidWaypointError}
12814
+ *
12815
+ * {@link InvalidWaypointTextureSelectorError}
12816
+ */
12817
+ readonly entity: Entity;
12818
+ /**
12819
+ * @remarks
12820
+ * The visibility rules that control when the waypoint is shown
12821
+ * based on the entity's state (e.g., sneaking, invisible,
12822
+ * dead).
12823
+ *
12824
+ * @throws This property can throw when used.
12825
+ *
12826
+ * {@link InvalidWaypointError}
12827
+ *
12828
+ * {@link InvalidWaypointTextureSelectorError}
12829
+ */
12830
+ readonly entityRules: EntityVisibilityRules;
12831
+ /**
12832
+ * @throws This function can throw errors.
12833
+ *
12834
+ * {@link InvalidWaypointTextureSelectorError}
12835
+ */
12836
+ constructor(
12837
+ entity: Entity,
12838
+ textureSelector: WaypointTextureSelector,
12839
+ entityRules: EntityVisibilityRules,
12840
+ color?: RGB,
12841
+ );
12842
+ }
12843
+
12617
12844
  /**
12618
12845
  * Loot item function that modifies a dropped treasure map to
12619
12846
  * mark a location.
@@ -13200,6 +13427,10 @@ export class IsBabyCondition extends LootItemCondition {
13200
13427
  private constructor();
13201
13428
  }
13202
13429
 
13430
+ export class ISerializable {
13431
+ private constructor();
13432
+ }
13433
+
13203
13434
  /**
13204
13435
  * When present on an item, this item is a book item. Can
13205
13436
  * access and modify the contents of the book and sign it.
@@ -15364,6 +15595,175 @@ export class ListBlockVolume extends BlockVolumeBase {
15364
15595
  remove(locations: Vector3[]): void;
15365
15596
  }
15366
15597
 
15598
+ /**
15599
+ * @rc
15600
+ * Waypoint that points to a fixed location in the world.
15601
+ * Unlike entity waypoints, location waypoints always remain
15602
+ * valid and their position can be updated.
15603
+ */
15604
+ // @ts-ignore Class inheritance allowed for native defined classes
15605
+ export class LocationWaypoint extends Waypoint {
15606
+ /**
15607
+ * @throws This function can throw errors.
15608
+ *
15609
+ * {@link InvalidWaypointTextureSelectorError}
15610
+ */
15611
+ constructor(dimensionLocation: DimensionLocation, textureSelector: WaypointTextureSelector, color?: RGB);
15612
+ /**
15613
+ * @remarks
15614
+ * Updates the dimension and location that this waypoint points
15615
+ * to.
15616
+ *
15617
+ * This function can't be called in restricted-execution mode.
15618
+ *
15619
+ * @param dimensionLocation
15620
+ * The new {@link DimensionLocation} (dimension and
15621
+ * coordinates) for the waypoint.
15622
+ */
15623
+ setDimensionLocation(dimensionLocation: DimensionLocation): void;
15624
+ }
15625
+
15626
+ /**
15627
+ * @rc
15628
+ * Manages the collection of waypoints displayed on a player's
15629
+ * locator bar. Allows adding, removing, and querying waypoints
15630
+ * with a maximum capacity limit.
15631
+ *
15632
+ * Invalid waypoints in the locator bar will be automatically
15633
+ * removed in the next tick. This includes waypoints tied to
15634
+ * entities that have been removed from the world.
15635
+ *
15636
+ * Note: You can control whether vanilla player waypoints are
15637
+ * automatically added to the locator bar using the
15638
+ * `playerWaypoints` {@link GameRule}. Accepted values are
15639
+ * `off` (players are not shown on the locator bar) and
15640
+ * `everyone` (all players are visible on the locator bar).
15641
+ *
15642
+ * Note: You can only modify, remove, or query waypoints that
15643
+ * were added by this pack.
15644
+ * @example sharedWaypoint.ts
15645
+ * ```typescript
15646
+ * /\*
15647
+ * import { world, LocationWaypoint, WaypointTextureSelector, WaypointTexture } from "@minecraft/server"
15648
+ *
15649
+ * function sharedWaypoint() {
15650
+ * const players = world.getAllPlayers();
15651
+ *
15652
+ * if (players.length < 2) {
15653
+ * console.warn("Need at least 2 players for this example.");
15654
+ * return;
15655
+ * }
15656
+ *
15657
+ * const playerA = players[0];
15658
+ * const playerB = players[1];
15659
+ *
15660
+ * // Create a single waypoint at a specific location
15661
+ * const textureSelector: WaypointTextureSelector = {
15662
+ * textureBoundsList: [
15663
+ * { lowerBound: 0, texture: WaypointTexture.Circle }
15664
+ * ]
15665
+ * };
15666
+ *
15667
+ * const waypoint = new LocationWaypoint(
15668
+ * { dimension: playerA.dimension, x: 100, y: 64, z: 100 },
15669
+ * textureSelector,
15670
+ * { red: 1, green: 0, blue: 0 } // Initially red
15671
+ * );
15672
+ *
15673
+ * // Add the same waypoint to both players' locator bars
15674
+ * playerA.locatorBar.addWaypoint(waypoint);
15675
+ * playerB.locatorBar.addWaypoint(waypoint);
15676
+ *
15677
+ * // Change the color - this affects both players
15678
+ * waypoint.color = { red: 0, green: 1, blue: 0 }; // Now green for both players
15679
+ * }
15680
+ * *\/
15681
+ * ```
15682
+ */
15683
+ export class LocatorBar {
15684
+ private constructor();
15685
+ /**
15686
+ * @remarks
15687
+ * The current number of waypoints in the locator bar.
15688
+ *
15689
+ */
15690
+ readonly count: number;
15691
+ /**
15692
+ * @remarks
15693
+ * The maximum number of waypoints that can be added to the
15694
+ * locator bar.
15695
+ *
15696
+ */
15697
+ readonly maxCount: number;
15698
+ /**
15699
+ * @remarks
15700
+ * Adds a waypoint to the locator bar. Throws an error if the
15701
+ * waypoint already exists, the maximum waypoint limit has been
15702
+ * reached, or the waypoint is invalid.
15703
+ *
15704
+ * This function can't be called in restricted-execution mode.
15705
+ *
15706
+ * @param waypoint
15707
+ * The {@link Waypoint} to add to the locator bar.
15708
+ * @throws This function can throw errors.
15709
+ *
15710
+ * {@link minecraftcommon.EngineError}
15711
+ *
15712
+ * {@link InvalidWaypointError}
15713
+ *
15714
+ * {@link LocatorBarError}
15715
+ */
15716
+ addWaypoint(waypoint: Waypoint): void;
15717
+ /**
15718
+ * @remarks
15719
+ * Returns an array of all waypoints currently in the locator
15720
+ * bar.
15721
+ *
15722
+ * This function can't be called in restricted-execution mode.
15723
+ *
15724
+ */
15725
+ getAllWaypoints(): Waypoint[];
15726
+ /**
15727
+ * @remarks
15728
+ * Checks whether the specified waypoint exists in the locator
15729
+ * bar.
15730
+ *
15731
+ * This function can't be called in restricted-execution mode.
15732
+ *
15733
+ * @param waypoint
15734
+ * The {@link Waypoint} to check for.
15735
+ */
15736
+ hasWaypoint(waypoint: Waypoint): boolean;
15737
+ /**
15738
+ * @remarks
15739
+ * Removes all waypoints from the locator bar, clearing it
15740
+ * completely.
15741
+ *
15742
+ * This function can't be called in restricted-execution mode.
15743
+ *
15744
+ * @throws This function can throw errors.
15745
+ *
15746
+ * {@link minecraftcommon.EngineError}
15747
+ */
15748
+ removeAllWaypoints(): void;
15749
+ /**
15750
+ * @remarks
15751
+ * Removes a specific waypoint from the locator bar. Returns an
15752
+ * error if the waypoint does not exist in the locator bar.
15753
+ *
15754
+ * This function can't be called in restricted-execution mode.
15755
+ *
15756
+ * @param waypoint
15757
+ * The {@link Waypoint} to remove from the locator bar.
15758
+ * @throws This function can throw errors.
15759
+ *
15760
+ * {@link minecraftcommon.EngineError}
15761
+ *
15762
+ * {@link LocatorBarError}
15763
+ */
15764
+ removeWaypoint(waypoint: Waypoint): void;
15765
+ }
15766
+
15367
15767
  /**
15368
15768
  * Loot item function that drops extra items if the provided
15369
15769
  * tool has the looting enchant.
@@ -16051,6 +16451,14 @@ export class Player extends Entity {
16051
16451
  * @throws This property can throw when used.
16052
16452
  */
16053
16453
  readonly level: number;
16454
+ /**
16455
+ * @rc
16456
+ * @remarks
16457
+ * The player's Locator Bar. This property is used for managing
16458
+ * waypoints displayed on the HUD.
16459
+ *
16460
+ */
16461
+ readonly locatorBar: LocatorBar;
16054
16462
  /**
16055
16463
  * @remarks
16056
16464
  * Name of the player.
@@ -17927,14 +18335,48 @@ export class PlayerSwingStartAfterEventSignal {
17927
18335
  }
17928
18336
 
17929
18337
  /**
17930
- * Represents how the potion effect is delivered.
18338
+ * @rc
18339
+ * Waypoint that tracks a player's position. Extends {@link
18340
+ * EntityWaypoint} with additional player-specific visibility
18341
+ * rules such as hidden state and spectator mode.
17931
18342
  */
17932
- export class PotionDeliveryType {
17933
- private constructor();
17934
- readonly id: string;
17935
- }
17936
-
17937
- /**
18343
+ // @ts-ignore Class inheritance allowed for native defined classes
18344
+ export class PlayerWaypoint extends EntityWaypoint {
18345
+ /**
18346
+ * @remarks
18347
+ * The {@link PlayerVisibilityRules} that control when the
18348
+ * waypoint is shown based on the player's state (e.g., hidden,
18349
+ * spectator mode, spectator viewing another spectator).
18350
+ *
18351
+ * @throws This property can throw when used.
18352
+ *
18353
+ * {@link InvalidWaypointError}
18354
+ *
18355
+ * {@link InvalidWaypointTextureSelectorError}
18356
+ */
18357
+ readonly playerRules: PlayerVisibilityRules;
18358
+ /**
18359
+ * @throws This function can throw errors.
18360
+ *
18361
+ * {@link InvalidWaypointTextureSelectorError}
18362
+ */
18363
+ constructor(
18364
+ player: Player,
18365
+ textureSelector: WaypointTextureSelector,
18366
+ playerRules: PlayerVisibilityRules,
18367
+ color?: RGB,
18368
+ );
18369
+ }
18370
+
18371
+ /**
18372
+ * Represents how the potion effect is delivered.
18373
+ */
18374
+ export class PotionDeliveryType {
18375
+ private constructor();
18376
+ readonly id: string;
18377
+ }
18378
+
18379
+ /**
17938
18380
  * Represents a type of potion effect - like healing or
17939
18381
  * leaping.
17940
18382
  */
@@ -18126,6 +18568,151 @@ export class PressurePlatePushAfterEventSignal {
18126
18568
  unsubscribe(callback: (arg0: PressurePlatePushAfterEvent) => void): void;
18127
18569
  }
18128
18570
 
18571
+ /**
18572
+ * @rc
18573
+ * The base class for a text primitive. Represents an object in
18574
+ * the world and its base properties.
18575
+ */
18576
+ export class PrimitiveShape {
18577
+ private constructor();
18578
+ /**
18579
+ * @remarks
18580
+ * The entity this shape is attached to. When set, this shape
18581
+ * will copy the root location of the attached entity and the
18582
+ * shape's position will be used as an offset.
18583
+ *
18584
+ */
18585
+ attachedTo?: Entity;
18586
+ /**
18587
+ * @remarks
18588
+ * The color of the shape.
18589
+ *
18590
+ */
18591
+ color: RGBA;
18592
+ /**
18593
+ * @remarks
18594
+ * The dimension the shape is visible within. If the dimension
18595
+ * is undefined, it will display in all dimensions.
18596
+ *
18597
+ */
18598
+ readonly dimension: Dimension;
18599
+ /**
18600
+ * @remarks
18601
+ * Returns true if the shape has a limited time span before
18602
+ * being removed.
18603
+ *
18604
+ */
18605
+ readonly hasDuration: boolean;
18606
+ /**
18607
+ * @remarks
18608
+ * The location of the shape.
18609
+ *
18610
+ */
18611
+ readonly location: Vector3;
18612
+ /**
18613
+ * @remarks
18614
+ * If defined, this distance will be used to determine how far
18615
+ * away this primitive will be rendered for each client. By
18616
+ * default the distance will match the client's render distance
18617
+ * setting.
18618
+ *
18619
+ * Minimum Value: 0
18620
+ */
18621
+ maximumRenderDistance?: number;
18622
+ /**
18623
+ * @remarks
18624
+ * The rotation of the shape (Euler angles - [Pitch, Yaw,
18625
+ * Roll]).
18626
+ *
18627
+ */
18628
+ rotation: Vector3;
18629
+ /**
18630
+ * @remarks
18631
+ * The scale of the shape.
18632
+ *
18633
+ * Bounds: [-1000, 1000]
18634
+ */
18635
+ scale: number;
18636
+ /**
18637
+ * @remarks
18638
+ * The time left (in seconds) until this shape is automatically
18639
+ * removed. Returns undefined if the shape does not have a
18640
+ * limited life-span.
18641
+ *
18642
+ */
18643
+ timeLeft?: number;
18644
+ /**
18645
+ * @remarks
18646
+ * The total initial time-span (in seconds) until this shape is
18647
+ * automatically removed. Returns undefined if the shape does
18648
+ * not have a limited life-span.
18649
+ *
18650
+ */
18651
+ readonly totalTimeLeft?: number;
18652
+ /**
18653
+ * @remarks
18654
+ * The list of players that this shape will be visible to. If
18655
+ * left empty, the shape will be visible to all players.
18656
+ *
18657
+ */
18658
+ visibleTo: Player[];
18659
+ /**
18660
+ * @remarks
18661
+ * Removes this shape from the world. The shape can be re-added
18662
+ * via the PrimitiveShapesManager's addText method.
18663
+ *
18664
+ */
18665
+ remove(): void;
18666
+ /**
18667
+ * @remarks
18668
+ * Set the location and dimension of the shape. If the
18669
+ * dimension is undefined, it will display in all dimensions.
18670
+ *
18671
+ */
18672
+ setLocation(location: DimensionLocation | Vector3): void;
18673
+ }
18674
+
18675
+ /**
18676
+ * @rc
18677
+ * Primitive Shapes class used to allow adding and removing
18678
+ * text primitives to the world.
18679
+ */
18680
+ export class PrimitiveShapesManager {
18681
+ private constructor();
18682
+ /**
18683
+ * @remarks
18684
+ * This is the maximum number of allowed primitive shapes.
18685
+ *
18686
+ */
18687
+ readonly maxShapes: number;
18688
+ /**
18689
+ * @remarks
18690
+ * Adds a new text primitive to the world.
18691
+ *
18692
+ * @param text
18693
+ * The text primitive to be added.
18694
+ * @throws This function can throw errors.
18695
+ *
18696
+ * {@link minecraftcommon.EngineError}
18697
+ *
18698
+ * {@link PrimitiveShapeError}
18699
+ */
18700
+ addText(text: TextPrimitive, dimension?: Dimension): void;
18701
+ /**
18702
+ * @remarks
18703
+ * Removes all text primitives from the world.
18704
+ *
18705
+ */
18706
+ removeAll(): void;
18707
+ /**
18708
+ * @remarks
18709
+ * Removes an instance of a text primitive from the world. This
18710
+ * is equivalent to calling remove on the text itself.
18711
+ *
18712
+ */
18713
+ removeText(text: TextPrimitive): void;
18714
+ }
18715
+
18129
18716
  /**
18130
18717
  * Contains information related to a projectile hitting a
18131
18718
  * block.
@@ -19397,6 +19984,13 @@ export class StartupEvent {
19397
19984
  *
19398
19985
  */
19399
19986
  readonly customCommandRegistry: CustomCommandRegistry;
19987
+ /**
19988
+ * @rc
19989
+ * @remarks
19990
+ * This property can be read in early-execution mode.
19991
+ *
19992
+ */
19993
+ readonly dimensionRegistry: DimensionRegistry;
19400
19994
  /**
19401
19995
  * @remarks
19402
19996
  * This property can be read in early-execution mode.
@@ -19410,7 +20004,8 @@ export class StartupEvent {
19410
20004
  * Structures can be placed in a world using the /structure
19411
20005
  * command or the {@link StructureManager} APIs.
19412
20006
  */
19413
- export class Structure {
20007
+ // @ts-ignore Class inheritance allowed for native defined classes
20008
+ export class Structure extends ISerializable {
19414
20009
  private constructor();
19415
20010
  /**
19416
20011
  * @remarks
@@ -20132,6 +20727,73 @@ export class TargetBlockHitAfterEventSignal {
20132
20727
  unsubscribe(callback: (arg0: TargetBlockHitAfterEvent) => void): void;
20133
20728
  }
20134
20729
 
20730
+ /**
20731
+ * @rc
20732
+ * A primitive shape class that represents a text label in the
20733
+ * world with a background.
20734
+ */
20735
+ // @ts-ignore Class inheritance allowed for native defined classes
20736
+ export class TextPrimitive extends PrimitiveShape {
20737
+ /**
20738
+ * @remarks
20739
+ * If set to true, the text primitive will render the back-face
20740
+ * of the background. Defaults to true but will always be false
20741
+ * if 'useRotation' is set to false.
20742
+ *
20743
+ */
20744
+ backfaceVisible: boolean;
20745
+ /**
20746
+ * @remarks
20747
+ * The color of the background plate of the text. If set to
20748
+ * undefined, it will use the default color.
20749
+ *
20750
+ */
20751
+ backgroundColorOverride?: RGBA;
20752
+ /**
20753
+ * @remarks
20754
+ * If set to true, the text will be hidden behind blocks or
20755
+ * entities. By default this is set to false (will always
20756
+ * render).
20757
+ *
20758
+ */
20759
+ depthTest: boolean;
20760
+ /**
20761
+ * @remarks
20762
+ * Get the text of the debug text shape. Returns the RawText of
20763
+ * the debug text if `setText` was called with a RawMessage or
20764
+ * a RawText object, otherwise returns a string.
20765
+ *
20766
+ */
20767
+ readonly text: RawMessage | string;
20768
+ /**
20769
+ * @remarks
20770
+ * If set to true, the text primitive will render the back-face
20771
+ * of the text. Defaults to true but will always be false if
20772
+ * 'useRotation' is set to false.
20773
+ *
20774
+ */
20775
+ textBackfaceVisible: boolean;
20776
+ /**
20777
+ * @remarks
20778
+ * If set to true, the text will not face the camera and
20779
+ * instead will use the rotation from the shape.
20780
+ *
20781
+ */
20782
+ useRotation: boolean;
20783
+ constructor(location: DimensionLocation | Vector3, text: RawMessage | string);
20784
+ /**
20785
+ * @remarks
20786
+ * Sets the text to display.
20787
+ *
20788
+ * @throws This function can throw errors.
20789
+ *
20790
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
20791
+ *
20792
+ * {@link RawMessageError}
20793
+ */
20794
+ setText(text: RawMessage | string): void;
20795
+ }
20796
+
20135
20797
  /**
20136
20798
  * This manager is used to add, remove or query temporary
20137
20799
  * ticking areas to a dimension. These ticking areas are
@@ -20373,6 +21035,86 @@ export class TripWireTripAfterEventSignal {
20373
21035
  unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
20374
21036
  }
20375
21037
 
21038
+ /**
21039
+ * @rc
21040
+ * Base class for waypoints displayed on the player's locator
21041
+ * bar. Waypoints can track locations or entities and are
21042
+ * rendered with customizable textures and colors.
21043
+ *
21044
+ * Waypoints act as shared handles that can be added to
21045
+ * multiple players' locator bars. When you modify a waypoint's
21046
+ * properties (such as color, texture, or enabled state), the
21047
+ * changes are reflected for all players who have that waypoint
21048
+ * in their locator bar. This allows you to efficiently manage
21049
+ * waypoints across multiple players without creating separate
21050
+ * instances for each player.
21051
+ */
21052
+ export class Waypoint {
21053
+ private constructor();
21054
+ /**
21055
+ * @remarks
21056
+ * Optional {@link RGB} color tint applied to the waypoint
21057
+ * icon. If not specified, the waypoint uses its default color.
21058
+ *
21059
+ * This property can't be edited in restricted-execution mode.
21060
+ *
21061
+ */
21062
+ color?: RGB;
21063
+ /**
21064
+ * @remarks
21065
+ * Controls whether the waypoint is currently displayed on the
21066
+ * player's screen. When disabled, the waypoint is hidden but
21067
+ * remains valid.
21068
+ *
21069
+ * This property can't be edited in restricted-execution mode.
21070
+ *
21071
+ */
21072
+ isEnabled: boolean;
21073
+ /**
21074
+ * @remarks
21075
+ * Returns whether the waypoint is currently valid. A waypoint
21076
+ * becomes invalid when its tracked entity is no longer valid.
21077
+ *
21078
+ */
21079
+ readonly isValid: boolean;
21080
+ /**
21081
+ * @remarks
21082
+ * The {@link WaypointTextureSelector} that determines which
21083
+ * icon texture is displayed for the waypoint based on distance
21084
+ * or other criteria.
21085
+ *
21086
+ * This property can't be edited in restricted-execution mode.
21087
+ *
21088
+ */
21089
+ textureSelector: WaypointTextureSelector;
21090
+ /**
21091
+ * @remarks
21092
+ * Gets the current {@link DimensionLocation} of the waypoint.
21093
+ * For entity waypoints, this returns the entity's current
21094
+ * position. For location waypoints, this returns the stored
21095
+ * location.
21096
+ *
21097
+ * This function can't be called in restricted-execution mode.
21098
+ *
21099
+ * @throws This function can throw errors.
21100
+ *
21101
+ * {@link InvalidWaypointError}
21102
+ *
21103
+ * {@link InvalidWaypointTextureSelectorError}
21104
+ */
21105
+ getDimensionLocation(): DimensionLocation;
21106
+ /**
21107
+ * @remarks
21108
+ * Removes the waypoint from all locator bars it has been added
21109
+ * to. This affects all players who have this waypoint in their
21110
+ * locator bar.
21111
+ *
21112
+ * This function can't be called in restricted-execution mode.
21113
+ *
21114
+ */
21115
+ remove(): void;
21116
+ }
21117
+
20376
21118
  /**
20377
21119
  * Contains information related to changes in weather in the
20378
21120
  * environment.
@@ -20553,6 +21295,14 @@ export class World {
20553
21295
  */
20554
21296
  readonly gameRules: GameRules;
20555
21297
  readonly isHardcore: boolean;
21298
+ /**
21299
+ * @rc
21300
+ * @remarks
21301
+ * Manager for adding and removing primitive text objects in
21302
+ * the world.
21303
+ *
21304
+ */
21305
+ readonly primitiveShapesManager: PrimitiveShapesManager;
20556
21306
  /**
20557
21307
  * @remarks
20558
21308
  * Returns the general global scoreboard that applies to the
@@ -20772,6 +21522,15 @@ export class World {
20772
21522
  *
20773
21523
  */
20774
21524
  getMoonPhase(): MoonPhase;
21525
+ /**
21526
+ * @rc
21527
+ * @remarks
21528
+ * Returns a map of pack setting name and value pairs.
21529
+ *
21530
+ * This function can be called in early-execution mode.
21531
+ *
21532
+ */
21533
+ getPackSettings(): Record<string, boolean | number | string>;
20775
21534
  /**
20776
21535
  * @remarks
20777
21536
  * Returns a set of players based on a set of conditions
@@ -21188,6 +21947,13 @@ export class WorldAfterEvents {
21188
21947
  *
21189
21948
  */
21190
21949
  readonly entitySpawn: EntitySpawnAfterEventSignal;
21950
+ /**
21951
+ * @rc
21952
+ * @remarks
21953
+ * This property can be read in early-execution mode.
21954
+ *
21955
+ */
21956
+ readonly entityUpgrade: EntityUpgradeAfterEventSignal;
21191
21957
  /**
21192
21958
  * @remarks
21193
21959
  * This event is fired after an explosion occurs.
@@ -21725,6 +22491,10 @@ export interface BlockCustomComponent {
21725
22491
  *
21726
22492
  */
21727
22493
  beforeOnPlayerPlace?: (arg0: BlockComponentPlayerPlaceBeforeEvent, arg1: CustomComponentParameters) => void;
22494
+ /**
22495
+ * @rc
22496
+ */
22497
+ onBlockStateChange?: (arg0: BlockComponentBlockStateChangeEvent, arg1: CustomComponentParameters) => void;
21728
22498
  /**
21729
22499
  * @remarks
21730
22500
  * This function will be called when a specific block is
@@ -22256,6 +23026,35 @@ export interface CustomCommandResult {
22256
23026
  status: CustomCommandStatus;
22257
23027
  }
22258
23028
 
23029
+ /**
23030
+ * @rc
23031
+ */
23032
+ export interface CustomTexture {
23033
+ /**
23034
+ * @remarks
23035
+ * The height of the icon, in relative units. Value must be
23036
+ * between 0.0 and 1.0, inclusive.
23037
+ *
23038
+ * Bounds: [0, 1]
23039
+ */
23040
+ iconHeight: number;
23041
+ /**
23042
+ * @remarks
23043
+ * The width of the icon, in relative units. Value must be
23044
+ * between 0.0 and 1.0, inclusive.
23045
+ *
23046
+ * Bounds: [0, 1]
23047
+ */
23048
+ iconWidth: number;
23049
+ /**
23050
+ * @remarks
23051
+ * The resource path to the custom texture. This should be a
23052
+ * valid string path to a texture asset.
23053
+ *
23054
+ */
23055
+ path: string;
23056
+ }
23057
+
22259
23058
  /**
22260
23059
  * Contains a set of updates to the component definition state
22261
23060
  * of an entity.
@@ -23076,6 +23875,37 @@ export interface EntityRaycastOptions extends EntityFilter {
23076
23875
  maxDistance?: number;
23077
23876
  }
23078
23877
 
23878
+ /**
23879
+ * @rc
23880
+ * Controls when a waypoint is visible based on the state of
23881
+ * the entity it tracks. These rules allow filtering waypoint
23882
+ * visibility by entity conditions like sneaking, invisibility,
23883
+ * and death state.
23884
+ */
23885
+ export interface EntityVisibilityRules {
23886
+ /**
23887
+ * @remarks
23888
+ * Controls whether the waypoint is shown when the tracked
23889
+ * entity is dead. If undefined, defaults to true.
23890
+ *
23891
+ */
23892
+ showDead?: boolean;
23893
+ /**
23894
+ * @remarks
23895
+ * Controls whether the waypoint is shown when the tracked
23896
+ * entity is invisible. If undefined, defaults to true.
23897
+ *
23898
+ */
23899
+ showInvisible?: boolean;
23900
+ /**
23901
+ * @remarks
23902
+ * Controls whether the waypoint is shown when the tracked
23903
+ * entity is sneaking. If undefined, defaults to true.
23904
+ *
23905
+ */
23906
+ showSneaking?: boolean;
23907
+ }
23908
+
23079
23909
  /**
23080
23910
  * Equal to operator.
23081
23911
  */
@@ -23601,6 +24431,39 @@ export interface PlayerSwingEventOptions {
23601
24431
  swingSource?: EntitySwingSource;
23602
24432
  }
23603
24433
 
24434
+ /**
24435
+ * @rc
24436
+ * Controls when a waypoint is visible based on player-specific
24437
+ * states. Extends {@link EntityVisibilityRules} with
24438
+ * additional rules for player-only states like hidden mode and
24439
+ * spectator mode.
24440
+ */
24441
+ // @ts-ignore Class inheritance allowed for native defined classes
24442
+ export interface PlayerVisibilityRules extends EntityVisibilityRules {
24443
+ /**
24444
+ * @remarks
24445
+ * Controls whether the waypoint is shown when the tracked
24446
+ * player is hidden. If undefined, defaults to true.
24447
+ *
24448
+ */
24449
+ showHidden?: boolean;
24450
+ /**
24451
+ * @remarks
24452
+ * Controls whether the waypoint is shown when the tracked
24453
+ * player is in spectator mode. If undefined, defaults to true.
24454
+ *
24455
+ */
24456
+ showSpectator?: boolean;
24457
+ /**
24458
+ * @remarks
24459
+ * Controls whether the waypoint is shown when a spectator is
24460
+ * viewing another spectator player. If undefined, defaults to
24461
+ * true.
24462
+ *
24463
+ */
24464
+ showSpectatorToSpectator?: boolean;
24465
+ }
24466
+
23604
24467
  /**
23605
24468
  * Key frame that holds the progress of the camera animation.
23606
24469
  */
@@ -24297,6 +25160,60 @@ export interface VectorXZ {
24297
25160
  z: number;
24298
25161
  }
24299
25162
 
25163
+ /**
25164
+ * @rc
25165
+ * Defines a texture and the distance range in which it should
25166
+ * be displayed. Used within a {@link WaypointTextureSelector}
25167
+ * to create distance-based texture switching.
25168
+ */
25169
+ export interface WaypointTextureBounds {
25170
+ /**
25171
+ * @remarks
25172
+ * The lower distance bound for this texture. The texture is
25173
+ * displayed when the distance to the waypoint is greater than
25174
+ * this value. Value must be greater than or equal to 0.
25175
+ *
25176
+ * Minimum Value: 0
25177
+ */
25178
+ lowerBound: number;
25179
+ /**
25180
+ * @remarks
25181
+ * The {@link WaypointTexture} or {@link CustomTexture} to
25182
+ * display within this distance range.
25183
+ *
25184
+ */
25185
+ texture: CustomTexture | WaypointTexture;
25186
+ /**
25187
+ * @remarks
25188
+ * The upper distance bound for this texture. The texture is
25189
+ * displayed when the distance to the waypoint is less than or
25190
+ * equal to this value. If undefined, there is no upper limit.
25191
+ * Value must be greater than or equal to 0.
25192
+ *
25193
+ * Minimum Value: 0
25194
+ */
25195
+ upperBound?: number;
25196
+ }
25197
+
25198
+ /**
25199
+ * @rc
25200
+ * Defines how waypoint textures change based on distance.
25201
+ * Contains a list of texture bounds that determine which
25202
+ * texture is displayed at different distance ranges.
25203
+ */
25204
+ export interface WaypointTextureSelector {
25205
+ /**
25206
+ * @remarks
25207
+ * An array of {@link WaypointTextureBounds} that define which
25208
+ * textures are displayed at different distance ranges. The
25209
+ * system evaluates these bounds to determine the appropriate
25210
+ * texture based on the current distance to the waypoint. The
25211
+ * list has a maximum size limit of 16.
25212
+ *
25213
+ */
25214
+ textureBoundsList: WaypointTextureBounds[];
25215
+ }
25216
+
24300
25217
  /**
24301
25218
  * Contains additional options for a playSound occurrence.
24302
25219
  */
@@ -24432,6 +25349,48 @@ export class CustomComponentNameError extends Error {
24432
25349
  readonly reason: CustomComponentNameErrorReason;
24433
25350
  }
24434
25351
 
25352
+ /**
25353
+ * @rc
25354
+ * Thrown when trying to register a custom dimension with a
25355
+ * name that has already been registered.
25356
+ */
25357
+ // @ts-ignore Class inheritance allowed for native defined classes
25358
+ export class CustomDimensionAlreadyRegisteredError extends Error {
25359
+ private constructor();
25360
+ }
25361
+
25362
+ /**
25363
+ * @rc
25364
+ * Thrown when trying to register a custom dimension outside of
25365
+ * the system startup event.
25366
+ */
25367
+ // @ts-ignore Class inheritance allowed for native defined classes
25368
+ export class CustomDimensionInvalidRegistryError extends Error {
25369
+ private constructor();
25370
+ }
25371
+
25372
+ /**
25373
+ * @rc
25374
+ * Thrown when trying to register a custom dimension with a
25375
+ * name that contains invalid characters.
25376
+ */
25377
+ // @ts-ignore Class inheritance allowed for native defined classes
25378
+ export class CustomDimensionNameError extends Error {
25379
+ private constructor();
25380
+ }
25381
+
25382
+ /**
25383
+ * @rc
25384
+ * Thrown after using the /reload command when trying to
25385
+ * register a custom dimension that was not previously
25386
+ * registered. New custom dimensions cannot be added during a
25387
+ * reload.
25388
+ */
25389
+ // @ts-ignore Class inheritance allowed for native defined classes
25390
+ export class CustomDimensionReloadNewDimensionError extends Error {
25391
+ private constructor();
25392
+ }
25393
+
24435
25394
  // @ts-ignore Class inheritance allowed for native defined classes
24436
25395
  export class EnchantmentLevelOutOfBoundsError extends Error {
24437
25396
  private constructor();
@@ -24555,6 +25514,25 @@ export class InvalidStructureError extends Error {
24555
25514
  private constructor();
24556
25515
  }
24557
25516
 
25517
+ /**
25518
+ * @rc
25519
+ * Error thrown when attempting to perform operations on an
25520
+ * invalid waypoint. A waypoint becomes invalid when it is
25521
+ * removed or when the entity it tracks is no longer valid.
25522
+ */
25523
+ // @ts-ignore Class inheritance allowed for native defined classes
25524
+ export class InvalidWaypointError extends Error {
25525
+ private constructor();
25526
+ }
25527
+
25528
+ /**
25529
+ * @rc
25530
+ */
25531
+ // @ts-ignore Class inheritance allowed for native defined classes
25532
+ export class InvalidWaypointTextureSelectorError extends Error {
25533
+ private constructor();
25534
+ }
25535
+
24558
25536
  /**
24559
25537
  * Thrown when trying to register an item custom component with
24560
25538
  * a name that has already been registered.
@@ -24611,6 +25589,25 @@ export class LocationOutOfWorldBoundariesError extends Error {
24611
25589
  private constructor();
24612
25590
  }
24613
25591
 
25592
+ /**
25593
+ * @rc
25594
+ * Error thrown when a locator bar operation fails. Contains a
25595
+ * reason code indicating the specific cause of the error.
25596
+ */
25597
+ // @ts-ignore Class inheritance allowed for native defined classes
25598
+ export class LocatorBarError extends Error {
25599
+ private constructor();
25600
+ /**
25601
+ * @remarks
25602
+ * The {@link LocatorBarErrorReason} code that indicates why
25603
+ * the locator bar operation failed.
25604
+ *
25605
+ * This property can be read in early-execution mode.
25606
+ *
25607
+ */
25608
+ readonly reason: LocatorBarErrorReason;
25609
+ }
25610
+
24614
25611
  /**
24615
25612
  * Thrown when a name requires a namespace and an error occurs
24616
25613
  * when validating that namespace
@@ -24631,6 +25628,14 @@ export class PlaceJigsawError extends Error {
24631
25628
  private constructor();
24632
25629
  }
24633
25630
 
25631
+ /**
25632
+ * @rc
25633
+ */
25634
+ // @ts-ignore Class inheritance allowed for native defined classes
25635
+ export class PrimitiveShapeError extends Error {
25636
+ private constructor();
25637
+ }
25638
+
24634
25639
  // @ts-ignore Class inheritance allowed for native defined classes
24635
25640
  export class RawMessageError extends Error {
24636
25641
  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.30",
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.30"
18
18
  },
19
19
  "license": "MIT"
20
20
  }