@minecraft/server-editor 0.1.0-beta.1.20.30-preview.24 → 0.1.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 +87 -30
  2. package/package.json +3 -2
package/index.d.ts CHANGED
@@ -14,11 +14,12 @@
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.23"
18
18
  * }
19
19
  * ```
20
20
  *
21
21
  */
22
+ import * as minecraftcommon from '@minecraft/common';
22
23
  import * as minecraftserver from '@minecraft/server';
23
24
  /**
24
25
  * The types of actions that are supported. This type
@@ -303,7 +304,17 @@ export declare enum KeyboardKey {
303
304
  * Keyboard Key Actions
304
305
  */
305
306
  export declare enum KeyInputType {
307
+ /**
308
+ * @remarks
309
+ * Button was pressed.
310
+ *
311
+ */
306
312
  Press = 1,
313
+ /**
314
+ * @remarks
315
+ * Button was released.
316
+ *
317
+ */
307
318
  Release = 2,
308
319
  }
309
320
 
@@ -311,8 +322,23 @@ export declare enum KeyInputType {
311
322
  * Mouse device action categories
312
323
  */
313
324
  export declare enum MouseActionCategory {
325
+ /**
326
+ * @remarks
327
+ * Mouse button was used.
328
+ *
329
+ */
314
330
  Button = 1,
331
+ /**
332
+ * @remarks
333
+ * Mouse wheel was used.
334
+ *
335
+ */
315
336
  Wheel = 2,
337
+ /**
338
+ * @remarks
339
+ * Mouse was dragged.
340
+ *
341
+ */
316
342
  Drag = 3,
317
343
  }
318
344
 
@@ -339,6 +365,21 @@ export declare enum MouseInputType {
339
365
  DragEnd = 7,
340
366
  }
341
367
 
368
+ export enum PlaytestSessionResult {
369
+ OK = 0,
370
+ InvalidSessionHandle = 1,
371
+ SessionInfoNotFound = 2,
372
+ TooManyPlayers = 3,
373
+ WorldExportFailed = 4,
374
+ WorldExportBusy = 5,
375
+ UnsupportedScenario = 6,
376
+ EditorSystemFailure = 7,
377
+ InvalidLevelId = 8,
378
+ PlayerNotFound = 9,
379
+ ResponseTimeout = 10,
380
+ UnspecifiedError = 11,
381
+ }
382
+
342
383
  /**
343
384
  * Full set of all possible raw actions
344
385
  */
@@ -407,6 +448,20 @@ export type IPlayerUISession<PerPlayerStorage = Record<string, never>> = {
407
448
  scratchStorage: PerPlayerStorage | undefined;
408
449
  };
409
450
 
451
+ /**
452
+ * A property item which supports Vector3 properties
453
+ */
454
+ export type IVector3PropertyItem<T extends PropertyBag, Prop extends keyof T & string> = IPropertyItem<T, Prop> & {
455
+ updateAxisLimits(limits: {
456
+ minX?: number;
457
+ maxX?: number;
458
+ minY?: number;
459
+ maxY?: number;
460
+ minZ?: number;
461
+ maxZ?: number;
462
+ }): void;
463
+ };
464
+
410
465
  /**
411
466
  * Modal tool lifecycle event payload
412
467
  */
@@ -542,34 +597,7 @@ export declare class BedrockEventSubscriptionCache {
542
597
  subscribeToBedrockEvent<T extends keyof minecraftserver.WorldAfterEvents>(
543
598
  event: T,
544
599
  ...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);
600
+ ): ReturnType<minecraftserver.WorldAfterEvents[T]['subscribe']>;
573
601
  /**
574
602
  * @remarks
575
603
  * Cleans up the set of internal registrations and
@@ -936,6 +964,7 @@ export class ExtensionContext {
936
964
  *
937
965
  */
938
966
  readonly player: minecraftserver.Player;
967
+ readonly playtest: PlaytestManager;
939
968
  /**
940
969
  * @remarks
941
970
  * The instance of the players Selection Manager and the main
@@ -1077,6 +1106,24 @@ export class MinecraftEditor {
1077
1106
  ): Extension;
1078
1107
  }
1079
1108
 
1109
+ export class PlaytestManager {
1110
+ private constructor();
1111
+ /**
1112
+ * @remarks
1113
+ * This function can't be called in read-only mode.
1114
+ *
1115
+ * @throws This function can throw errors.
1116
+ */
1117
+ beginPlaytest(options: PlaytestGameOptions): Promise<PlaytestSessionResult>;
1118
+ /**
1119
+ * @remarks
1120
+ * This function can't be called in read-only mode.
1121
+ *
1122
+ * @throws This function can throw errors.
1123
+ */
1124
+ getPlaytestSessionAvailability(): PlaytestSessionResult;
1125
+ }
1126
+
1080
1127
  /**
1081
1128
  * The Selection represents a volume in space, which may
1082
1129
  * potentially be made up of one or more block locations.
@@ -1698,6 +1745,16 @@ export interface LogProperties {
1698
1745
  tags?: string[];
1699
1746
  }
1700
1747
 
1748
+ export interface PlaytestGameOptions {
1749
+ alwaysDay?: boolean;
1750
+ difficulty?: minecraftserver.Difficulty;
1751
+ disableWeather?: boolean;
1752
+ gameMode?: minecraftserver.GameMode;
1753
+ showCoordinates?: boolean;
1754
+ spawnPosition?: minecraftserver.Vector3;
1755
+ timeOfDay?: number;
1756
+ }
1757
+
1701
1758
  /**
1702
1759
  * Binds actions to the client and manages their lifetime.
1703
1760
  * Action managers are managed on a per player basis since
@@ -2276,7 +2333,7 @@ export interface IPropertyPane {
2276
2333
  obj: T,
2277
2334
  property: Prop,
2278
2335
  options?: IPropertyItemOptionsVector3,
2279
- ): IPropertyItem<T, Prop>;
2336
+ ): IVector3PropertyItem<T, Prop>;
2280
2337
  /**
2281
2338
  * @remarks
2282
2339
  * 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.23",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,8 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/server": "^1.6.0-beta.1.20.30-preview.24"
16
+ "@minecraft/common": "^1.0.0-rc.1.20.40-preview.23",
17
+ "@minecraft/server": "^1.7.0-beta.1.20.40-preview.23"
17
18
  },
18
19
  "license": "MIT"
19
20
  }