@minecraft/server 1.7.0-beta.1.20.40-preview.22 → 1.7.0-beta.1.20.40-preview.23

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 +45 -44
  2. package/package.json +4 -1
package/index.d.ts CHANGED
@@ -16,11 +16,12 @@
16
16
  * ```json
17
17
  * {
18
18
  * "module_name": "@minecraft/server",
19
- * "version": "1.7.0-internal.1.20.40-preview.22"
19
+ * "version": "1.7.0-internal.1.20.40-preview.23"
20
20
  * }
21
21
  * ```
22
22
  *
23
23
  */
24
+ import * as minecraftcommon from '@minecraft/common';
24
25
  /**
25
26
  * @beta
26
27
  * Description of the resulting intersection test on two
@@ -1047,7 +1048,7 @@ export class Block {
1047
1048
  *
1048
1049
  * {@link LocationOutOfWorldBoundariesError}
1049
1050
  */
1050
- getItemStack(amount?: number, withData?: boolean): ItemStack;
1051
+ getItemStack(amount?: number, withData?: boolean): ItemStack | undefined;
1051
1052
  /**
1052
1053
  * @beta
1053
1054
  * @remarks
@@ -2786,7 +2787,7 @@ export class Container {
2786
2787
  * The stack of items to add.
2787
2788
  * @throws This function can throw errors.
2788
2789
  */
2789
- addItem(itemStack: ItemStack): ItemStack;
2790
+ addItem(itemStack: ItemStack): ItemStack | undefined;
2790
2791
  /**
2791
2792
  * @remarks
2792
2793
  * Clears all inventory items in the container.
@@ -2933,7 +2934,7 @@ export class Container {
2933
2934
  * fromInventory.container.transferItem(0, toInventory.container);
2934
2935
  * ```
2935
2936
  */
2936
- transferItem(fromSlot: number, toContainer: Container): ItemStack;
2937
+ transferItem(fromSlot: number, toContainer: Container): ItemStack | undefined;
2937
2938
  }
2938
2939
 
2939
2940
  /**
@@ -4850,6 +4851,11 @@ export class Entity {
4850
4851
  * ```
4851
4852
  */
4852
4853
  kill(): boolean;
4854
+ /**
4855
+ * @beta
4856
+ * @throws This function can throw errors.
4857
+ */
4858
+ matches(options: EntityQueryOptions): boolean;
4853
4859
  /**
4854
4860
  * @beta
4855
4861
  * @remarks
@@ -4925,6 +4931,10 @@ export class Entity {
4925
4931
  * returned.
4926
4932
  * @throws
4927
4933
  * Throws if the entity is invalid.
4934
+ *
4935
+ * {@link minecraftcommon.EngineError}
4936
+ *
4937
+ * {@link Error}
4928
4938
  */
4929
4939
  resetProperty(identifier: string): boolean | number | string;
4930
4940
  /**
@@ -9698,40 +9708,6 @@ export class PlayerDimensionChangeAfterEventSignal {
9698
9708
  unsubscribe(callback: (arg: PlayerDimensionChangeAfterEvent) => void): void;
9699
9709
  }
9700
9710
 
9701
- /**
9702
- * @beta
9703
- */
9704
- export class PlayerDimensionChangeBeforeEvent {
9705
- private constructor();
9706
- readonly fromDimension: Dimension;
9707
- readonly fromLocation: Vector3;
9708
- readonly player: Player;
9709
- readonly toDimension: Dimension;
9710
- readonly toLocation: Vector3;
9711
- }
9712
-
9713
- /**
9714
- * @beta
9715
- */
9716
- export class PlayerDimensionChangeBeforeEventSignal {
9717
- private constructor();
9718
- /**
9719
- * @remarks
9720
- * This function can't be called in read-only mode.
9721
- *
9722
- */
9723
- subscribe(
9724
- callback: (arg: PlayerDimensionChangeBeforeEvent) => void,
9725
- ): (arg: PlayerDimensionChangeBeforeEvent) => void;
9726
- /**
9727
- * @remarks
9728
- * This function can't be called in read-only mode.
9729
- *
9730
- * @throws This function can throw errors.
9731
- */
9732
- unsubscribe(callback: (arg: PlayerDimensionChangeBeforeEvent) => void): void;
9733
- }
9734
-
9735
9711
  /**
9736
9712
  * @beta
9737
9713
  * Contains information regarding an event after a player
@@ -10061,6 +10037,34 @@ export class PlayerLeaveAfterEventSignal extends IPlayerLeaveAfterEventSignal {
10061
10037
  private constructor();
10062
10038
  }
10063
10039
 
10040
+ /**
10041
+ * @beta
10042
+ */
10043
+ export class PlayerLeaveBeforeEvent {
10044
+ private constructor();
10045
+ readonly player: Player;
10046
+ }
10047
+
10048
+ /**
10049
+ * @beta
10050
+ */
10051
+ export class PlayerLeaveBeforeEventSignal {
10052
+ private constructor();
10053
+ /**
10054
+ * @remarks
10055
+ * This function can't be called in read-only mode.
10056
+ *
10057
+ */
10058
+ subscribe(callback: (arg: PlayerLeaveBeforeEvent) => void): (arg: PlayerLeaveBeforeEvent) => void;
10059
+ /**
10060
+ * @remarks
10061
+ * This function can't be called in read-only mode.
10062
+ *
10063
+ * @throws This function can throw errors.
10064
+ */
10065
+ unsubscribe(callback: (arg: PlayerLeaveBeforeEvent) => void): void;
10066
+ }
10067
+
10064
10068
  /**
10065
10069
  * @beta
10066
10070
  * Contains information regarding an event where a player
@@ -12379,19 +12383,16 @@ export class WorldBeforeEvents {
12379
12383
  readonly playerBreakBlock: PlayerBreakBlockBeforeEventSignal;
12380
12384
  /**
12381
12385
  * @beta
12382
- * @remarks
12383
- * Fires before a player is about to change dimensions.
12384
- *
12385
12386
  */
12386
- readonly playerDimensionChange: PlayerDimensionChangeBeforeEventSignal;
12387
+ readonly playerInteractWithBlock: PlayerInteractWithBlockBeforeEventSignal;
12387
12388
  /**
12388
12389
  * @beta
12389
12390
  */
12390
- readonly playerInteractWithBlock: PlayerInteractWithBlockBeforeEventSignal;
12391
+ readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
12391
12392
  /**
12392
12393
  * @beta
12393
12394
  */
12394
- readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
12395
+ readonly playerLeave: PlayerLeaveBeforeEventSignal;
12395
12396
  /**
12396
12397
  * @beta
12397
12398
  * @remarks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.7.0-beta.1.20.40-preview.22",
3
+ "version": "1.7.0-beta.1.20.40-preview.23",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -12,5 +12,8 @@
12
12
  "email": "mikeam@microsoft.com"
13
13
  }
14
14
  ],
15
+ "dependencies": {
16
+ "@minecraft/common": "^1.0.0-rc.1.20.40-preview.23"
17
+ },
15
18
  "license": "MIT"
16
19
  }