@minecraft/server-editor 0.1.0-beta.1.20.30-preview.22 → 0.1.0-beta.1.20.40-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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +86 -29
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -4,4 +4,4 @@
4
4
 
5
5
  See full documentation for this module here:
6
6
 
7
- https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/@minecraft/server-editor/@minecraft/server-editor
7
+ https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-editor/minecraft-server-editor
package/index.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * ```json
15
15
  * {
16
16
  * "module_name": "@minecraft/server-editor",
17
- * "version": "0.1.0-beta.1.20.30-preview.22"
17
+ * "version": "0.1.0-beta.1.20.40-preview.22"
18
18
  * }
19
19
  * ```
20
20
  *
@@ -303,7 +303,17 @@ export declare enum KeyboardKey {
303
303
  * Keyboard Key Actions
304
304
  */
305
305
  export declare enum KeyInputType {
306
+ /**
307
+ * @remarks
308
+ * Button was pressed.
309
+ *
310
+ */
306
311
  Press = 1,
312
+ /**
313
+ * @remarks
314
+ * Button was released.
315
+ *
316
+ */
307
317
  Release = 2,
308
318
  }
309
319
 
@@ -311,8 +321,23 @@ export declare enum KeyInputType {
311
321
  * Mouse device action categories
312
322
  */
313
323
  export declare enum MouseActionCategory {
324
+ /**
325
+ * @remarks
326
+ * Mouse button was used.
327
+ *
328
+ */
314
329
  Button = 1,
330
+ /**
331
+ * @remarks
332
+ * Mouse wheel was used.
333
+ *
334
+ */
315
335
  Wheel = 2,
336
+ /**
337
+ * @remarks
338
+ * Mouse was dragged.
339
+ *
340
+ */
316
341
  Drag = 3,
317
342
  }
318
343
 
@@ -339,6 +364,21 @@ export declare enum MouseInputType {
339
364
  DragEnd = 7,
340
365
  }
341
366
 
367
+ export enum PlaytestSessionResult {
368
+ OK = 0,
369
+ InvalidSessionHandle = 1,
370
+ SessionInfoNotFound = 2,
371
+ TooManyPlayers = 3,
372
+ WorldExportFailed = 4,
373
+ WorldExportBusy = 5,
374
+ UnsupportedScenario = 6,
375
+ EditorSystemFailure = 7,
376
+ InvalidLevelId = 8,
377
+ PlayerNotFound = 9,
378
+ ResponseTimeout = 10,
379
+ UnspecifiedError = 11,
380
+ }
381
+
342
382
  /**
343
383
  * Full set of all possible raw actions
344
384
  */
@@ -407,6 +447,20 @@ export type IPlayerUISession<PerPlayerStorage = Record<string, never>> = {
407
447
  scratchStorage: PerPlayerStorage | undefined;
408
448
  };
409
449
 
450
+ /**
451
+ * A property item which supports Vector3 properties
452
+ */
453
+ export type IVector3PropertyItem<T extends PropertyBag, Prop extends keyof T & string> = IPropertyItem<T, Prop> & {
454
+ updateAxisLimits(limits: {
455
+ minX?: number;
456
+ maxX?: number;
457
+ minY?: number;
458
+ maxY?: number;
459
+ minZ?: number;
460
+ maxZ?: number;
461
+ }): void;
462
+ };
463
+
410
464
  /**
411
465
  * Modal tool lifecycle event payload
412
466
  */
@@ -542,33 +596,7 @@ export declare class BedrockEventSubscriptionCache {
542
596
  subscribeToBedrockEvent<T extends keyof minecraftserver.WorldAfterEvents>(
543
597
  event: T,
544
598
  ...params: Parameters<minecraftserver.WorldAfterEvents[T]['subscribe']>
545
- ):
546
- | ((arg: minecraftserver.BlockBreakAfterEvent) => void)
547
- | ((arg: minecraftserver.BlockExplodeAfterEvent) => void)
548
- | ((arg: minecraftserver.ChatSendAfterEvent) => void)
549
- | ((arg: minecraftserver.DataDrivenEntityTriggerAfterEvent) => void)
550
- | ((arg: minecraftserver.EffectAddAfterEvent) => void)
551
- | ((arg: minecraftserver.EntityDieAfterEvent) => void)
552
- | ((arg: minecraftserver.EntityHealthChangedAfterEvent) => void)
553
- | ((arg: minecraftserver.EntityHitBlockAfterEvent) => void)
554
- | ((arg: minecraftserver.EntityHitEntityAfterEvent) => void)
555
- | ((arg: minecraftserver.EntityHurtAfterEvent) => void)
556
- | ((arg: minecraftserver.EntityRemoveAfterEvent) => void)
557
- | ((arg: minecraftserver.ExplosionAfterEvent) => void)
558
- | ((arg: minecraftserver.ItemCompleteUseAfterEvent) => void)
559
- | ((arg: minecraftserver.ItemDefinitionTriggeredAfterEvent) => void)
560
- | ((arg: minecraftserver.ItemUseOnAfterEvent) => void)
561
- | ((arg: minecraftserver.LeverActionAfterEvent) => void)
562
- | ((arg: minecraftserver.MessageReceiveAfterEvent) => void)
563
- | ((arg: minecraftserver.PistonActivateAfterEvent) => void)
564
- | ((arg: minecraftserver.PlayerJoinAfterEvent) => void)
565
- | ((arg: minecraftserver.PlayerSpawnAfterEvent) => void)
566
- | ((arg: minecraftserver.ProjectileHitBlockAfterEvent) => void)
567
- | ((arg: minecraftserver.ProjectileHitEntityAfterEvent) => void)
568
- | ((arg: minecraftserver.TargetBlockHitAfterEvent) => void)
569
- | ((arg: minecraftserver.TripWireTripAfterEvent) => void)
570
- | ((arg: minecraftserver.WeatherChangeAfterEvent) => void)
571
- | ((arg: minecraftserver.WorldInitializeAfterEvent) => void);
599
+ ): ReturnType<minecraftserver.WorldAfterEvents[T]['subscribe']>;
572
600
  /**
573
601
  * @remarks
574
602
  * Cleans up the set of internal registrations and
@@ -935,6 +963,7 @@ export class ExtensionContext {
935
963
  *
936
964
  */
937
965
  readonly player: minecraftserver.Player;
966
+ readonly playtest: PlaytestManager;
938
967
  /**
939
968
  * @remarks
940
969
  * The instance of the players Selection Manager and the main
@@ -1076,6 +1105,24 @@ export class MinecraftEditor {
1076
1105
  ): Extension;
1077
1106
  }
1078
1107
 
1108
+ export class PlaytestManager {
1109
+ private constructor();
1110
+ /**
1111
+ * @remarks
1112
+ * This function can't be called in read-only mode.
1113
+ *
1114
+ * @throws This function can throw errors.
1115
+ */
1116
+ beginPlaytest(options: PlaytestGameOptions): Promise<PlaytestSessionResult>;
1117
+ /**
1118
+ * @remarks
1119
+ * This function can't be called in read-only mode.
1120
+ *
1121
+ * @throws This function can throw errors.
1122
+ */
1123
+ getPlaytestSessionAvailability(): PlaytestSessionResult;
1124
+ }
1125
+
1079
1126
  /**
1080
1127
  * The Selection represents a volume in space, which may
1081
1128
  * potentially be made up of one or more block locations.
@@ -1697,6 +1744,16 @@ export interface LogProperties {
1697
1744
  tags?: string[];
1698
1745
  }
1699
1746
 
1747
+ export interface PlaytestGameOptions {
1748
+ alwaysDay?: boolean;
1749
+ difficulty?: minecraftserver.Difficulty;
1750
+ disableWeather?: boolean;
1751
+ gameMode?: minecraftserver.GameMode;
1752
+ showCoordinates?: boolean;
1753
+ spawnPosition?: minecraftserver.Vector3;
1754
+ timeOfDay?: number;
1755
+ }
1756
+
1700
1757
  /**
1701
1758
  * Binds actions to the client and manages their lifetime.
1702
1759
  * Action managers are managed on a per player basis since
@@ -2275,7 +2332,7 @@ export interface IPropertyPane {
2275
2332
  obj: T,
2276
2333
  property: Prop,
2277
2334
  options?: IPropertyItemOptionsVector3,
2278
- ): IPropertyItem<T, Prop>;
2335
+ ): IVector3PropertyItem<T, Prop>;
2279
2336
  /**
2280
2337
  * @remarks
2281
2338
  * Collapse the pane.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.20.30-preview.22",
3
+ "version": "0.1.0-beta.1.20.40-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/server": "^1.6.0-beta.1.20.30-preview.22"
16
+ "@minecraft/server": "^1.7.0-beta.1.20.40-preview.22"
17
17
  },
18
18
  "license": "MIT"
19
19
  }