@minecraft/server 1.9.0-beta.1.20.60-preview.24 → 1.9.0-beta.1.20.60-preview.26

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 +109 -2
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -3610,6 +3610,8 @@ export class ContainerSlot {
3610
3610
  *
3611
3611
  * @throws
3612
3612
  * Throws if the slot's container is invalid.
3613
+ *
3614
+ * {@link InvalidContainerSlotError}
3613
3615
  */
3614
3616
  readonly isStackable: boolean;
3615
3617
  /**
@@ -3641,6 +3643,8 @@ export class ContainerSlot {
3641
3643
  *
3642
3644
  * @throws
3643
3645
  * Throws if the slot's container is invalid.
3646
+ *
3647
+ * {@link InvalidContainerSlotError}
3644
3648
  */
3645
3649
  readonly maxAmount: number;
3646
3650
  /**
@@ -3662,6 +3666,10 @@ export class ContainerSlot {
3662
3666
  *
3663
3667
  * @throws
3664
3668
  * Throws if the slot's container is invalid.
3669
+ *
3670
+ * {@link minecraftcommon.EngineError}
3671
+ *
3672
+ * {@link InvalidContainerSlotError}
3665
3673
  */
3666
3674
  readonly 'type': ItemType;
3667
3675
  /**
@@ -3672,8 +3680,10 @@ export class ContainerSlot {
3672
3680
  *
3673
3681
  * @throws
3674
3682
  * Throws if the slot's container is invalid.
3683
+ *
3684
+ * {@link InvalidContainerSlotError}
3675
3685
  */
3676
- readonly typeId?: string;
3686
+ readonly typeId: string;
3677
3687
  /**
3678
3688
  * @remarks
3679
3689
  * Clears all dynamic properties that have been set on this
@@ -3681,8 +3691,22 @@ export class ContainerSlot {
3681
3691
  *
3682
3692
  * @throws
3683
3693
  * Throws if the slot's container is invalid.
3694
+ *
3695
+ * {@link InvalidContainerSlotError}
3684
3696
  */
3685
3697
  clearDynamicProperties(): void;
3698
+ /**
3699
+ * @throws This function can throw errors.
3700
+ *
3701
+ * {@link InvalidContainerSlotError}
3702
+ */
3703
+ getCanDestroy(): string[];
3704
+ /**
3705
+ * @throws This function can throw errors.
3706
+ *
3707
+ * {@link InvalidContainerSlotError}
3708
+ */
3709
+ getCanPlaceOn(): string[];
3686
3710
  /**
3687
3711
  * @remarks
3688
3712
  * Returns a property value.
@@ -3694,6 +3718,8 @@ export class ContainerSlot {
3694
3718
  * property has not been set.
3695
3719
  * @throws
3696
3720
  * Throws if the slot's container is invalid.
3721
+ *
3722
+ * {@link InvalidContainerSlotError}
3697
3723
  */
3698
3724
  getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
3699
3725
  /**
@@ -3705,6 +3731,8 @@ export class ContainerSlot {
3705
3731
  * A string array of the dynamic properties set on this entity.
3706
3732
  * @throws
3707
3733
  * Throws if the slot's container is invalid.
3734
+ *
3735
+ * {@link InvalidContainerSlotError}
3708
3736
  */
3709
3737
  getDynamicPropertyIds(): string[];
3710
3738
  /**
@@ -3718,6 +3746,8 @@ export class ContainerSlot {
3718
3746
  *
3719
3747
  * @throws
3720
3748
  * Throws if the slot's container is invalid.
3749
+ *
3750
+ * {@link InvalidContainerSlotError}
3721
3751
  */
3722
3752
  getDynamicPropertyTotalByteCount(): number;
3723
3753
  /**
@@ -3730,6 +3760,8 @@ export class ContainerSlot {
3730
3760
  * the slot is empty.
3731
3761
  * @throws
3732
3762
  * Throws if the slot's container is invalid.
3763
+ *
3764
+ * {@link InvalidContainerSlotError}
3733
3765
  */
3734
3766
  getItem(): ItemStack | undefined;
3735
3767
  /**
@@ -3742,6 +3774,8 @@ export class ContainerSlot {
3742
3774
  * returns an empty array.
3743
3775
  * @throws
3744
3776
  * Throws if the slot's container is invalid.
3777
+ *
3778
+ * {@link InvalidContainerSlotError}
3745
3779
  */
3746
3780
  getLore(): string[];
3747
3781
  /**
@@ -3753,8 +3787,16 @@ export class ContainerSlot {
3753
3787
  * array if the the slot is empty.
3754
3788
  * @throws
3755
3789
  * Throws if the slot's container is invalid.
3790
+ *
3791
+ * {@link InvalidContainerSlotError}
3756
3792
  */
3757
3793
  getTags(): string[];
3794
+ /**
3795
+ * @throws This function can throw errors.
3796
+ *
3797
+ * {@link InvalidContainerSlotError}
3798
+ */
3799
+ hasItem(): boolean;
3758
3800
  /**
3759
3801
  * @remarks
3760
3802
  * Returns whether the item in the slot slot has the given tag.
@@ -3766,6 +3808,8 @@ export class ContainerSlot {
3766
3808
  * does not have the given tag.
3767
3809
  * @throws
3768
3810
  * Throws if the slot's container is invalid.
3811
+ *
3812
+ * {@link InvalidContainerSlotError}
3769
3813
  */
3770
3814
  hasTag(tag: string): boolean;
3771
3815
  /**
@@ -3783,6 +3827,8 @@ export class ContainerSlot {
3783
3827
  * given `itemStack`.
3784
3828
  * @throws
3785
3829
  * Throws if the slot's container is invalid.
3830
+ *
3831
+ * {@link InvalidContainerSlotError}
3786
3832
  */
3787
3833
  isStackableWith(itemStack: ItemStack): boolean;
3788
3834
  /**
@@ -3806,6 +3852,10 @@ export class ContainerSlot {
3806
3852
  * @throws
3807
3853
  * Throws if the slot's container is invalid. Also throws if
3808
3854
  * any of the provided block identifiers are invalid.
3855
+ *
3856
+ * {@link Error}
3857
+ *
3858
+ * {@link InvalidContainerSlotError}
3809
3859
  */
3810
3860
  setCanDestroy(blockIdentifiers?: string[]): void;
3811
3861
  /**
@@ -3822,6 +3872,10 @@ export class ContainerSlot {
3822
3872
  * @throws
3823
3873
  * Throws if the slot's container is invalid. Also throws if
3824
3874
  * any of the provided block identifiers are invalid.
3875
+ *
3876
+ * {@link Error}
3877
+ *
3878
+ * {@link InvalidContainerSlotError}
3825
3879
  */
3826
3880
  setCanPlaceOn(blockIdentifiers?: string[]): void;
3827
3881
  /**
@@ -3834,6 +3888,10 @@ export class ContainerSlot {
3834
3888
  * Data value of the property to set.
3835
3889
  * @throws
3836
3890
  * Throws if the slot's container is invalid.
3891
+ *
3892
+ * {@link Error}
3893
+ *
3894
+ * {@link InvalidContainerSlotError}
3837
3895
  */
3838
3896
  setDynamicProperty(identifier: string, value?: boolean | number | string | Vector3): void;
3839
3897
  /**
@@ -3847,6 +3905,8 @@ export class ContainerSlot {
3847
3905
  * The ItemStack to be placed in the slot.
3848
3906
  * @throws
3849
3907
  * Throws if the slot's container is invalid.
3908
+ *
3909
+ * {@link InvalidContainerSlotError}
3850
3910
  */
3851
3911
  setItem(itemStack?: ItemStack): void;
3852
3912
  /**
@@ -3861,6 +3921,10 @@ export class ContainerSlot {
3861
3921
  * will clear the lore.
3862
3922
  * @throws
3863
3923
  * Throws if the slot's container is invalid.
3924
+ *
3925
+ * {@link Error}
3926
+ *
3927
+ * {@link InvalidContainerSlotError}
3864
3928
  */
3865
3929
  setLore(loreList?: string[]): void;
3866
3930
  }
@@ -11810,7 +11874,7 @@ export class System {
11810
11874
  /**
11811
11875
  * @beta
11812
11876
  */
11813
- runJob(generator: Generator<void, void, void>): number;
11877
+ runJob(generator: generator): number;
11814
11878
  /**
11815
11879
  * @remarks
11816
11880
  * Runs a set of code at a future time specified by tickDelay.
@@ -12277,6 +12341,37 @@ export class WeatherChangeAfterEventSignal {
12277
12341
  unsubscribe(callback: (arg: WeatherChangeAfterEvent) => void): void;
12278
12342
  }
12279
12343
 
12344
+ /**
12345
+ * @beta
12346
+ */
12347
+ export class WeatherChangeBeforeEvent {
12348
+ private constructor();
12349
+ cancel: boolean;
12350
+ duration: number;
12351
+ newWeather: WeatherType;
12352
+ readonly previousWeather: WeatherType;
12353
+ }
12354
+
12355
+ /**
12356
+ * @beta
12357
+ */
12358
+ export class WeatherChangeBeforeEventSignal {
12359
+ private constructor();
12360
+ /**
12361
+ * @remarks
12362
+ * This function can't be called in read-only mode.
12363
+ *
12364
+ */
12365
+ subscribe(callback: (arg: WeatherChangeBeforeEvent) => void): (arg: WeatherChangeBeforeEvent) => void;
12366
+ /**
12367
+ * @remarks
12368
+ * This function can't be called in read-only mode.
12369
+ *
12370
+ * @throws This function can throw errors.
12371
+ */
12372
+ unsubscribe(callback: (arg: WeatherChangeBeforeEvent) => void): void;
12373
+ }
12374
+
12280
12375
  /**
12281
12376
  * A class that wraps the state of a world - a set of
12282
12377
  * dimensions and the environment of Minecraft.
@@ -13143,6 +13238,10 @@ export class WorldBeforeEvents {
13143
13238
  *
13144
13239
  */
13145
13240
  readonly playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
13241
+ /**
13242
+ * @beta
13243
+ */
13244
+ readonly weatherChange: WeatherChangeBeforeEventSignal;
13146
13245
  }
13147
13246
 
13148
13247
  /**
@@ -14420,6 +14519,14 @@ export class EnchantmentTypeUnknownIdError extends Error {
14420
14519
  private constructor();
14421
14520
  }
14422
14521
 
14522
+ /**
14523
+ * @beta
14524
+ */
14525
+ // @ts-ignore Class inheritance allowed for native defined classes
14526
+ export class InvalidContainerSlotError extends Error {
14527
+ private constructor();
14528
+ }
14529
+
14423
14530
  // @ts-ignore Class inheritance allowed for native defined classes
14424
14531
  export class LocationInUnloadedChunkError extends Error {
14425
14532
  private constructor();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.9.0-beta.1.20.60-preview.24",
3
+ "version": "1.9.0-beta.1.20.60-preview.26",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {