@minecraft/server 1.12.0-beta.1.21.0-preview.21 → 1.12.0-beta.1.21.0-preview.22

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 +53 -24
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4880,10 +4880,6 @@ export class Dimension {
4880
4880
  *
4881
4881
  * This function can't be called in read-only mode.
4882
4882
  *
4883
- * @param begin
4884
- * The lower northwest starting corner of the area.
4885
- * @param end
4886
- * The upper southeast ending corner of the area.
4887
4883
  * @param block
4888
4884
  * Type of block to fill the volume with.
4889
4885
  * @param options
@@ -4892,13 +4888,18 @@ export class Dimension {
4892
4888
  * @returns
4893
4889
  * Returns number of blocks placed.
4894
4890
  * @throws This function can throw errors.
4891
+ *
4892
+ * {@link minecraftcommon.EngineError}
4893
+ *
4894
+ * {@link Error}
4895
+ *
4896
+ * {@link UnloadedChunksError}
4895
4897
  */
4896
4898
  fillBlocks(
4897
- begin: Vector3,
4898
- end: Vector3,
4899
+ volume: BlockVolumeBase | CompoundBlockVolume,
4899
4900
  block: BlockPermutation | BlockType | string,
4900
4901
  options?: BlockFillOptions,
4901
- ): number;
4902
+ ): ListBlockVolume;
4902
4903
  /**
4903
4904
  * @beta
4904
4905
  * @remarks
@@ -8805,7 +8806,11 @@ export class EntityTameableComponent extends EntityComponent {
8805
8806
  *
8806
8807
  * @throws This function can throw errors.
8807
8808
  */
8808
- getTameItems(): string[];
8809
+ getTameItems(): ItemStack[];
8810
+ /**
8811
+ * @throws This function can throw errors.
8812
+ */
8813
+ isTamed(): boolean;
8809
8814
  /**
8810
8815
  * @remarks
8811
8816
  * Tames this entity.
@@ -8816,7 +8821,15 @@ export class EntityTameableComponent extends EntityComponent {
8816
8821
  * Returns true if the entity was tamed.
8817
8822
  * @throws This function can throw errors.
8818
8823
  */
8819
- tame(): boolean;
8824
+ tame(player: Player): boolean;
8825
+ /**
8826
+ * @throws This function can throw errors.
8827
+ */
8828
+ tamedToPlayer(): Player | undefined;
8829
+ /**
8830
+ * @throws This function can throw errors.
8831
+ */
8832
+ tamedToPlayerId(): string;
8820
8833
  }
8821
8834
 
8822
8835
  /**
@@ -9600,6 +9613,15 @@ export class ItemCompleteUseAfterEventSignal {
9600
9613
  unsubscribe(callback: (arg: ItemCompleteUseAfterEvent) => void): void;
9601
9614
  }
9602
9615
 
9616
+ /**
9617
+ * @beta
9618
+ */
9619
+ export class ItemCompleteUseEvent {
9620
+ private constructor();
9621
+ readonly itemStack: ItemStack;
9622
+ readonly source: Player;
9623
+ }
9624
+
9603
9625
  /**
9604
9626
  * Base class for item components.
9605
9627
  */
@@ -9642,6 +9664,14 @@ export class ItemComponentBeforeDurabilityDamageEvent {
9642
9664
  itemStack?: ItemStack;
9643
9665
  }
9644
9666
 
9667
+ /**
9668
+ * @beta
9669
+ */
9670
+ // @ts-ignore Class inheritance allowed for native defined classes
9671
+ export class ItemComponentCompleteUseEvent extends ItemCompleteUseEvent {
9672
+ private constructor();
9673
+ }
9674
+
9645
9675
  /**
9646
9676
  * @beta
9647
9677
  * Contains information regarding when an item is used to hit
@@ -13557,9 +13587,6 @@ export class Structure {
13557
13587
  * The block location relative to the Structure's origin.
13558
13588
  * @param blockPermutation
13559
13589
  * The BlockPermutation to set.
13560
- * @param waterlogged
13561
- * Specifies whether the block should be waterlogged. Air and
13562
- * undefined blocks cannot be waterlogged.
13563
13590
  * @throws
13564
13591
  * Throws if the type of block is StructureVoid.
13565
13592
  * Throws if the block is undefined and waterlogged is set to
@@ -13572,7 +13599,7 @@ export class Structure {
13572
13599
  *
13573
13600
  * {@link InvalidStructureError}
13574
13601
  */
13575
- setBlockPermutation(location: Vector3, blockPermutation?: BlockPermutation, waterlogged?: boolean): void;
13602
+ setBlockPermutation(location: Vector3, blockPermutation?: BlockPermutation): void;
13576
13603
  }
13577
13604
 
13578
13605
  /**
@@ -13624,8 +13651,6 @@ export class StructureManager {
13624
13651
  * namespace and must be unique.
13625
13652
  * @param dimension
13626
13653
  * The dimension where the blocks should be read from.
13627
- * @param blockVolume
13628
- * The location and bounds of the blocks that should be read.
13629
13654
  * @param options
13630
13655
  * Additional options for creating a structure from the world.
13631
13656
  * @returns
@@ -13643,7 +13668,8 @@ export class StructureManager {
13643
13668
  createFromWorld(
13644
13669
  identifier: string,
13645
13670
  dimension: Dimension,
13646
- blockVolume: BlockVolume,
13671
+ from: Vector3,
13672
+ to: Vector3,
13647
13673
  options?: StructureCreateOptions,
13648
13674
  ): Structure;
13649
13675
  /**
@@ -13684,7 +13710,7 @@ export class StructureManager {
13684
13710
  * This function can't be called in read-only mode.
13685
13711
  *
13686
13712
  */
13687
- getIds(): string[];
13713
+ getWorldStructureIds(): string[];
13688
13714
  /**
13689
13715
  * @remarks
13690
13716
  * Places a structure in the world. Structures placed in
@@ -13879,6 +13905,13 @@ export class System {
13879
13905
  * to stop the run of this function on an interval.
13880
13906
  */
13881
13907
  runTimeout(callback: () => void, tickDelay?: number): number;
13908
+ /**
13909
+ * @beta
13910
+ * @throws This function can throw errors.
13911
+ *
13912
+ * {@link minecraftcommon.EngineError}
13913
+ */
13914
+ waitTick(ticks?: number): Promise<void>;
13882
13915
  }
13883
13916
 
13884
13917
  /**
@@ -15397,13 +15430,8 @@ export interface BlockEventOptions {
15397
15430
  * Contains additional options for a block fill operation.
15398
15431
  */
15399
15432
  export interface BlockFillOptions {
15400
- /**
15401
- * @remarks
15402
- * When specified, the fill operation will only apply to blocks
15403
- * that match this description.
15404
- *
15405
- */
15406
- matchingBlock?: BlockPermutation;
15433
+ blockFilter?: BlockFilter;
15434
+ ignoreChunkBoundErrors?: boolean;
15407
15435
  }
15408
15436
 
15409
15437
  export interface BlockFilter {
@@ -16546,6 +16574,7 @@ export interface GreaterThanOrEqualsComparison {
16546
16574
  */
16547
16575
  export interface ItemCustomComponent {
16548
16576
  onBeforeDurabilityDamage?: (arg: ItemComponentBeforeDurabilityDamageEvent) => void;
16577
+ onCompleteUse?: (arg: ItemComponentCompleteUseEvent) => void;
16549
16578
  onHitEntity?: (arg: ItemComponentHitEntityEvent) => void;
16550
16579
  /**
16551
16580
  * @remarks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.12.0-beta.1.21.0-preview.21",
3
+ "version": "1.12.0-beta.1.21.0-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {