@minecraft/server 2.12.0-beta.1.26.60-preview.30 → 2.13.0-beta.1.26.70-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.
Files changed (2) hide show
  1. package/index.d.ts +294 -30
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * ```json
17
17
  * {
18
18
  * "module_name": "@minecraft/server",
19
- * "version": "2.12.0-beta"
19
+ * "version": "2.13.0-beta"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -2262,6 +2262,10 @@ export enum InputPermissionCategory {
2262
2262
  */
2263
2263
  export enum ItemComponentTypes {
2264
2264
  BlockDynamicProperties = 'minecraft:block_actor_dynamic_properties',
2265
+ /**
2266
+ * @beta
2267
+ */
2268
+ BlockEntityStorage = 'minecraft:block_entity_storage',
2265
2269
  /**
2266
2270
  * @remarks
2267
2271
  * The minecraft:book component.
@@ -2633,6 +2637,31 @@ export enum PaletteColor {
2633
2637
  Black = 15,
2634
2638
  }
2635
2639
 
2640
+ /**
2641
+ * @beta
2642
+ * Specifies the pose of an entity passenger of a block.
2643
+ */
2644
+ export enum PassengerOfBlockEmoteType {
2645
+ /**
2646
+ * @remarks
2647
+ * The entity will be laying on the block.
2648
+ *
2649
+ */
2650
+ Laying = 'Laying',
2651
+ /**
2652
+ * @remarks
2653
+ * The entity will be sitting on the block.
2654
+ *
2655
+ */
2656
+ Riding = 'Riding',
2657
+ /**
2658
+ * @remarks
2659
+ * The entity will be standing on the block.
2660
+ *
2661
+ */
2662
+ Standing = 'Standing',
2663
+ }
2664
+
2636
2665
  /**
2637
2666
  * Describes what kind of platform is a device.
2638
2667
  */
@@ -3380,6 +3409,7 @@ export type ItemComponentReturnType<T extends string> = T extends keyof ItemComp
3380
3409
 
3381
3410
  export type ItemComponentTypeMap = {
3382
3411
  block_actor_dynamic_properties: ItemBlockDynamicPropertiesComponent;
3412
+ block_entity_storage: ItemBlockEntityStorageComponent;
3383
3413
  book: ItemBookComponent;
3384
3414
  compostable: ItemCompostableComponent;
3385
3415
  cooldown: ItemCooldownComponent;
@@ -3389,6 +3419,7 @@ export type ItemComponentTypeMap = {
3389
3419
  food: ItemFoodComponent;
3390
3420
  inventory: ItemInventoryComponent;
3391
3421
  'minecraft:block_actor_dynamic_properties': ItemBlockDynamicPropertiesComponent;
3422
+ 'minecraft:block_entity_storage': ItemBlockEntityStorageComponent;
3392
3423
  'minecraft:book': ItemBookComponent;
3393
3424
  'minecraft:compostable': ItemCompostableComponent;
3394
3425
  'minecraft:cooldown': ItemCooldownComponent;
@@ -4293,6 +4324,23 @@ export class Block {
4293
4324
  * {@link LocationOutOfWorldBoundariesError}
4294
4325
  */
4295
4326
  east(steps?: number): Block | undefined;
4327
+ /**
4328
+ * @beta
4329
+ * @remarks
4330
+ * Returns the named tick events scheduled at this block by the
4331
+ * calling script pack.
4332
+ *
4333
+ * @returns
4334
+ * The scheduled named tick events. Each event contains its
4335
+ * eventName and the number of ticks until it is raised as
4336
+ * tickDelay.
4337
+ * @throws This function can throw errors.
4338
+ *
4339
+ * {@link LocationInUnloadedChunkError}
4340
+ *
4341
+ * {@link LocationOutOfWorldBoundariesError}
4342
+ */
4343
+ getAllScheduledNamedTicks(): ScheduledNamedTick[];
4296
4344
  /**
4297
4345
  * @remarks
4298
4346
  * Gets a component (that represents additional capabilities)
@@ -4403,6 +4451,22 @@ export class Block {
4403
4451
  * {@link LocationOutOfWorldBoundariesError}
4404
4452
  */
4405
4453
  getRedstonePower(): number | undefined;
4454
+ /**
4455
+ * @beta
4456
+ * @remarks
4457
+ * Returns the number of named tick events scheduled at this
4458
+ * block, regardless of which script pack scheduled them.
4459
+ *
4460
+ * @returns
4461
+ * The number of named tick events currently scheduled at this
4462
+ * block.
4463
+ * @throws This function can throw errors.
4464
+ *
4465
+ * {@link LocationInUnloadedChunkError}
4466
+ *
4467
+ * {@link LocationOutOfWorldBoundariesError}
4468
+ */
4469
+ getScheduledNamedTickCount(): number;
4406
4470
  /**
4407
4471
  * @remarks
4408
4472
  * Returns the brightness level of light shining from the sky
@@ -4613,7 +4677,7 @@ export class Block {
4613
4677
  *
4614
4678
  * {@link LocationOutOfWorldBoundariesError}
4615
4679
  */
4616
- removeScheduledNamedTick(eventName: string): void;
4680
+ removeScheduledNamedTicks(eventName: string): void;
4617
4681
  /**
4618
4682
  * @beta
4619
4683
  * @remarks
@@ -4991,18 +5055,20 @@ export class BlockComponentNamedTickEvent extends BlockEvent {
4991
5055
  private constructor();
4992
5056
  /**
4993
5057
  * @remarks
4994
- * Checks whether this named tick event has the specified name.
4995
- * Events are namespaced with their content UUID. Two named
4996
- * tick events with the same name but scheduled from different
4997
- * packs will not respond the same to this method.
5058
+ * Name of the named tick event.
5059
+ *
5060
+ */
5061
+ readonly name: string;
5062
+ /**
5063
+ * @remarks
5064
+ * Checks whether this named tick event was scheduled by this
5065
+ * pack.
4998
5066
  *
4999
- * @param eventName
5000
- * The name to check against this event.
5001
5067
  * @returns
5002
- * Returns true if the event name matches the specified name;
5068
+ * True if this named tick event was scheduled by this pack;
5003
5069
  * otherwise, false.
5004
5070
  */
5005
- isName(eventName: string): boolean;
5071
+ isMine(): boolean;
5006
5072
  }
5007
5073
 
5008
5074
  /**
@@ -7329,6 +7395,19 @@ export class CarryOverBlockEntityDataFunction extends LootItemFunction {
7329
7395
  *
7330
7396
  */
7331
7397
  readonly dynamicProperties: boolean;
7398
+ /**
7399
+ * @remarks
7400
+ * If true, and if the block entity supports entity storage,
7401
+ * the function will copy the stored entities from the block
7402
+ * entity to the dropped item without releasing them. Placing
7403
+ * the item restores the stored entities if the placed block
7404
+ * supports entity storage. In loot table JSON, the optional
7405
+ * entity_storage Boolean field defaults to false and is
7406
+ * independent of dynamic_properties. Requires the Upcoming
7407
+ * Creator Features experiment.
7408
+ *
7409
+ */
7410
+ readonly entityStorage: boolean;
7332
7411
  }
7333
7412
 
7334
7413
  /**
@@ -8439,6 +8518,8 @@ export class CustomCommandRegistry {
8439
8518
  * {@link minecraftcommon.EngineError}
8440
8519
  *
8441
8520
  * {@link NamespaceNameError}
8521
+ *
8522
+ * {@link RawMessageError}
8442
8523
  */
8443
8524
  registerCommand(
8444
8525
  customCommand: CustomCommand,
@@ -8459,6 +8540,8 @@ export class CustomCommandRegistry {
8459
8540
  * {@link minecraftcommon.EngineError}
8460
8541
  *
8461
8542
  * {@link NamespaceNameError}
8543
+ *
8544
+ * {@link RawMessageError}
8462
8545
  */
8463
8546
  registerEnum(name: string, values: string[]): void;
8464
8547
  }
@@ -9992,6 +10075,16 @@ export class Entity {
9992
10075
  * {@link InvalidEntityError}
9993
10076
  */
9994
10077
  readonly isOnGround: boolean;
10078
+ /**
10079
+ * @beta
10080
+ * @remarks
10081
+ * Returns true if the entity is a passenger of a block.
10082
+ *
10083
+ * @throws This property can throw when used.
10084
+ *
10085
+ * {@link InvalidEntityError}
10086
+ */
10087
+ readonly isPassengerOfBlock: boolean;
9995
10088
  /**
9996
10089
  * @remarks
9997
10090
  * If true, the entity is currently sleeping.
@@ -11032,6 +11125,47 @@ export class Entity {
11032
11125
  * {@link InvalidEntityError}
11033
11126
  */
11034
11127
  setRotation(rotation: Vector2): void;
11128
+ /**
11129
+ * @beta
11130
+ * @remarks
11131
+ * Starts the entity as being a passenger of a block with the
11132
+ * specified configuration.
11133
+ *
11134
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
11135
+ *
11136
+ * @param blockPosition
11137
+ * The integer block position to ride.
11138
+ * @param offset
11139
+ * The offset from the block position.
11140
+ * @param rotation
11141
+ * The rotation of the passenger on the block.
11142
+ * @param rotationLimit
11143
+ * The maximum rotation range of the passenger on the block.
11144
+ * @param emote
11145
+ * The pose of the passenger on the block.
11146
+ * @throws This function can throw errors.
11147
+ *
11148
+ * {@link InvalidEntityError}
11149
+ */
11150
+ startPassengerOfBlock(
11151
+ blockPosition: Vector3,
11152
+ offset: Vector3,
11153
+ rotation: number,
11154
+ rotationLimit: number,
11155
+ emote: PassengerOfBlockEmoteType,
11156
+ ): void;
11157
+ /**
11158
+ * @beta
11159
+ * @remarks
11160
+ * Stops the entity from being a passenger of a block.
11161
+ *
11162
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
11163
+ *
11164
+ * @throws This function can throw errors.
11165
+ *
11166
+ * {@link InvalidEntityError}
11167
+ */
11168
+ stopPassengerOfBlock(): void;
11035
11169
  /**
11036
11170
  * @remarks
11037
11171
  * Teleports the selected entity to a new location
@@ -15402,6 +15536,137 @@ export class ItemBlockDynamicPropertiesComponent extends ItemComponent {
15402
15536
  totalByteCount(): number;
15403
15537
  }
15404
15538
 
15539
+ /**
15540
+ * @beta
15541
+ * Stores serialized non-player mobs on an item stack. Each
15542
+ * calling behavior pack can only access its manifest UUID
15543
+ * bucket. All buckets share a four-entity limit. Available on
15544
+ * item stacks even when empty. Destroying the item discards
15545
+ * its storage without spawning entities. Data is compatible
15546
+ * with entity-storage block carry-over and placement.
15547
+ */
15548
+ // @ts-ignore Class inheritance allowed for native defined classes
15549
+ export class ItemBlockEntityStorageComponent extends ItemComponent {
15550
+ private constructor();
15551
+ static readonly componentId = 'minecraft:block_entity_storage';
15552
+ /**
15553
+ * @remarks
15554
+ * Inspects the serialized entities in the calling pack's
15555
+ * manifest UUID bucket without loading or spawning them.
15556
+ *
15557
+ * @returns
15558
+ * Stored entity IDs and definition IDs, or an empty array for
15559
+ * an empty bucket.
15560
+ * @throws
15561
+ * Throws if the item is invalid or its entity-storage format
15562
+ * is unsupported.
15563
+ *
15564
+ * {@link Error}
15565
+ *
15566
+ * {@link InvalidItemStackError}
15567
+ */
15568
+ getEntities(): BlockEntityStorageInfo[];
15569
+ /**
15570
+ * @remarks
15571
+ * Releases a stored mob at the supplied dimension and world
15572
+ * position. Does not require a block target. The serialized
15573
+ * position is replaced before the actor is loaded. Removes the
15574
+ * entry from this item after spawning it.
15575
+ *
15576
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
15577
+ *
15578
+ * @param entityId
15579
+ * A stored entity ID in the calling pack's bucket.
15580
+ * @param location
15581
+ * The target DimensionLocation. Must be finite, within world
15582
+ * bounds, and in a loaded, ticking chunk.
15583
+ * @returns
15584
+ * The spawned entity.
15585
+ * @throws
15586
+ * Throws for an invalid item, ID, dimension, or location, a
15587
+ * missing entity, or a load or spawn failure. Failed releases
15588
+ * preserve serialized storage.
15589
+ *
15590
+ * {@link Error}
15591
+ *
15592
+ * {@link InvalidItemStackError}
15593
+ *
15594
+ * {@link LocationInUnloadedChunkError}
15595
+ *
15596
+ * {@link LocationOutOfWorldBoundariesError}
15597
+ */
15598
+ release(entityId: string, location: DimensionLocation): Entity;
15599
+ /**
15600
+ * @remarks
15601
+ * Returns the number of serialized entities in the calling
15602
+ * pack's manifest UUID bucket.
15603
+ *
15604
+ * @returns
15605
+ * The number of entities in this pack's bucket, or zero if
15606
+ * empty.
15607
+ * @throws
15608
+ * Throws if the item is invalid or its entity-storage format
15609
+ * is unsupported.
15610
+ *
15611
+ * {@link Error}
15612
+ *
15613
+ * {@link InvalidItemStackError}
15614
+ */
15615
+ size(): number;
15616
+ /**
15617
+ * @remarks
15618
+ * Serializes and despawns a non-player mob into the calling
15619
+ * pack's item storage. Mounted entities and entities with
15620
+ * passengers cannot be stored.
15621
+ *
15622
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
15623
+ *
15624
+ * @param entity
15625
+ * The live mob to store.
15626
+ * @returns
15627
+ * The stored entity ID, used for inspection, release, or
15628
+ * transfer.
15629
+ * @throws
15630
+ * Throws if the item or entity is invalid, storage is full,
15631
+ * the entity is already stored, serialization fails, or the
15632
+ * entity is not allowed. Rejected entities remain in the
15633
+ * world.
15634
+ *
15635
+ * {@link Error}
15636
+ *
15637
+ * {@link InvalidItemStackError}
15638
+ */
15639
+ store(entity: Entity): string;
15640
+ /**
15641
+ * @remarks
15642
+ * Moves serialized ownership from the calling pack's item
15643
+ * bucket into the same bucket of a block's entity-storage
15644
+ * without loading or spawning the entity. The target can be in
15645
+ * any dimension and must have entity storage.
15646
+ *
15647
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
15648
+ *
15649
+ * @param entityId
15650
+ * A stored entity ID in the calling pack's bucket.
15651
+ * @param targetBlock
15652
+ * A loaded block with an entity-storage component and
15653
+ * available capacity.
15654
+ * @throws
15655
+ * Throws for an invalid item, ID, or target, a missing entity,
15656
+ * full target storage, or an ID already stored at the target.
15657
+ * Failure preserves both owners.
15658
+ *
15659
+ * {@link Error}
15660
+ *
15661
+ * {@link InvalidItemStackError}
15662
+ *
15663
+ * {@link LocationInUnloadedChunkError}
15664
+ *
15665
+ * {@link LocationOutOfWorldBoundariesError}
15666
+ */
15667
+ transfer(entityId: string, targetBlock: Block): void;
15668
+ }
15669
+
15405
15670
  /**
15406
15671
  * When present on an item, this item is a book item. Can
15407
15672
  * access and modify the contents of the book and sign it.
@@ -18763,8 +19028,12 @@ export class Player extends Entity {
18763
19028
  * @param musicOptions
18764
19029
  * Additional options for the music track.
18765
19030
  * @throws This function can throw errors.
19031
+ *
19032
+ * {@link minecraftcommon.EngineError}
19033
+ *
19034
+ * {@link minecraftcommon.PropertyOutOfBoundsError}
18766
19035
  */
18767
- playMusic(trackId: string, musicOptions?: MusicOptions): void;
19036
+ playMusic(trackId: SoundDefinition | string, musicOptions?: MusicOptions): SoundInstance | undefined;
18768
19037
  /**
18769
19038
  * @remarks
18770
19039
  * Plays a sound that only this particular player can hear.
@@ -21132,10 +21401,6 @@ export class PlayerWaypoint extends EntityWaypoint {
21132
21401
  * @beta
21133
21402
  * Describes a block point-of-interest instance returned by a
21134
21403
  * query.
21135
- *
21136
- * Required Experiments:
21137
- * - Poi
21138
- *
21139
21404
  */
21140
21405
  export class PoiBlockInstance {
21141
21406
  private constructor();
@@ -21164,10 +21429,6 @@ export class PoiBlockInstance {
21164
21429
  * @beta
21165
21430
  * Provides methods for querying and managing block-based
21166
21431
  * points of interest in a dimension.
21167
- *
21168
- * Required Experiments:
21169
- * - Poi
21170
- *
21171
21432
  */
21172
21433
  export class PoiBlockManager {
21173
21434
  private constructor();
@@ -21356,10 +21617,6 @@ export class PoiBlockManager {
21356
21617
  /**
21357
21618
  * @beta
21358
21619
  * Describes a block point-of-interest type.
21359
- *
21360
- * Required Experiments:
21361
- * - Poi
21362
- *
21363
21620
  */
21364
21621
  export class PoiBlockType {
21365
21622
  private constructor();
@@ -21421,10 +21678,6 @@ export class PoiBlockType {
21421
21678
  * @beta
21422
21679
  * Provides access to point-of-interest (POI) data in a
21423
21680
  * dimension.
21424
- *
21425
- * Required Experiments:
21426
- * - Poi
21427
- *
21428
21681
  */
21429
21682
  export class PoiManager {
21430
21683
  private constructor();
@@ -25240,6 +25493,8 @@ export class World {
25240
25493
  *
25241
25494
  * @throws This function can throw errors.
25242
25495
  *
25496
+ * {@link minecraftcommon.EngineError}
25497
+ *
25243
25498
  * {@link minecraftcommon.PropertyOutOfBoundsError}
25244
25499
  * @example playMusicAndSound.ts
25245
25500
  * ```typescript
@@ -25270,7 +25525,7 @@ export class World {
25270
25525
  * }
25271
25526
  * ```
25272
25527
  */
25273
- playMusic(trackId: string, musicOptions?: MusicOptions): void;
25528
+ playMusic(trackId: SoundDefinition | string, musicOptions?: MusicOptions): SoundInstance | undefined;
25274
25529
  /**
25275
25530
  * @remarks
25276
25531
  * Queues an additional music track for players. If a track is
@@ -27440,10 +27695,11 @@ export interface CustomCommandParameter {
27440
27695
  export interface CustomCommandResult {
27441
27696
  /**
27442
27697
  * @remarks
27443
- * Message displayed to chat after command execution.
27698
+ * Message displayed to chat after command execution. Accepts a
27699
+ * {@link RawMessage} or a plain string.
27444
27700
  *
27445
27701
  */
27446
- message?: string;
27702
+ message?: RawMessage | string;
27447
27703
  /**
27448
27704
  * @remarks
27449
27705
  * Command execution Success or Failure. Determines how the
@@ -29380,6 +29636,14 @@ export interface RotationKeyFrame {
29380
29636
  timeSeconds: number;
29381
29637
  }
29382
29638
 
29639
+ /**
29640
+ * @beta
29641
+ */
29642
+ export interface ScheduledNamedTick {
29643
+ eventName: string;
29644
+ tickDelay: number;
29645
+ }
29646
+
29383
29647
  /**
29384
29648
  * Contains additional options for how a scoreboard should be
29385
29649
  * displayed within its display slot.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "2.12.0-beta.1.26.60-preview.30",
3
+ "version": "2.13.0-beta.1.26.70-preview.20",
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.60-preview.30"
17
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.26.70-preview.20"
18
18
  },
19
19
  "license": "MIT"
20
20
  }