@minecraft/server-editor 0.1.0-beta.1.20.30-preview.24 → 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 (2) hide show
  1. package/index.d.ts +86 -30
  2. package/package.json +2 -2
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.24"
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,34 +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.BlockExplodeAfterEvent) => void)
547
- | ((arg: minecraftserver.ChatSendAfterEvent) => void)
548
- | ((arg: minecraftserver.DataDrivenEntityTriggerAfterEvent) => void)
549
- | ((arg: minecraftserver.EffectAddAfterEvent) => void)
550
- | ((arg: minecraftserver.EntityDieAfterEvent) => void)
551
- | ((arg: minecraftserver.EntityHealthChangedAfterEvent) => void)
552
- | ((arg: minecraftserver.EntityHitBlockAfterEvent) => void)
553
- | ((arg: minecraftserver.EntityHitEntityAfterEvent) => void)
554
- | ((arg: minecraftserver.EntityHurtAfterEvent) => void)
555
- | ((arg: minecraftserver.EntityRemoveAfterEvent) => void)
556
- | ((arg: minecraftserver.EntitySpawnAfterEvent) => 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.PlayerBreakBlockAfterEvent) => void)
565
- | ((arg: minecraftserver.PlayerJoinAfterEvent) => void)
566
- | ((arg: minecraftserver.PlayerSpawnAfterEvent) => void)
567
- | ((arg: minecraftserver.ProjectileHitBlockAfterEvent) => void)
568
- | ((arg: minecraftserver.ProjectileHitEntityAfterEvent) => void)
569
- | ((arg: minecraftserver.TargetBlockHitAfterEvent) => void)
570
- | ((arg: minecraftserver.TripWireTripAfterEvent) => void)
571
- | ((arg: minecraftserver.WeatherChangeAfterEvent) => void)
572
- | ((arg: minecraftserver.WorldInitializeAfterEvent) => void);
599
+ ): ReturnType<minecraftserver.WorldAfterEvents[T]['subscribe']>;
573
600
  /**
574
601
  * @remarks
575
602
  * Cleans up the set of internal registrations and
@@ -936,6 +963,7 @@ export class ExtensionContext {
936
963
  *
937
964
  */
938
965
  readonly player: minecraftserver.Player;
966
+ readonly playtest: PlaytestManager;
939
967
  /**
940
968
  * @remarks
941
969
  * The instance of the players Selection Manager and the main
@@ -1077,6 +1105,24 @@ export class MinecraftEditor {
1077
1105
  ): Extension;
1078
1106
  }
1079
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
+
1080
1126
  /**
1081
1127
  * The Selection represents a volume in space, which may
1082
1128
  * potentially be made up of one or more block locations.
@@ -1698,6 +1744,16 @@ export interface LogProperties {
1698
1744
  tags?: string[];
1699
1745
  }
1700
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
+
1701
1757
  /**
1702
1758
  * Binds actions to the client and manages their lifetime.
1703
1759
  * Action managers are managed on a per player basis since
@@ -2276,7 +2332,7 @@ export interface IPropertyPane {
2276
2332
  obj: T,
2277
2333
  property: Prop,
2278
2334
  options?: IPropertyItemOptionsVector3,
2279
- ): IPropertyItem<T, Prop>;
2335
+ ): IVector3PropertyItem<T, Prop>;
2280
2336
  /**
2281
2337
  * @remarks
2282
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.24",
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.24"
16
+ "@minecraft/server": "^1.7.0-beta.1.20.40-preview.22"
17
17
  },
18
18
  "license": "MIT"
19
19
  }