@minecraft/server 1.7.0-rc.1.20.60-preview.20 → 1.7.0

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 +96 -274
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  * ```json
16
16
  * {
17
17
  * "module_name": "@minecraft/server",
18
- * "version": "1.6.0"
18
+ * "version": "1.7.0"
19
19
  * }
20
20
  * ```
21
21
  *
@@ -347,11 +347,16 @@ export enum EntityInitializationCause {
347
347
  Born = 'Born',
348
348
  /**
349
349
  * @remarks
350
- * Case when an entity is created by an event, e.g., Wandering
351
- * trader spawning llamas.
350
+ * Case when an entity is created by an event, e.g., a
351
+ * Wandering trader spawning llamas.
352
352
  *
353
353
  */
354
354
  Event = 'Event',
355
+ /**
356
+ * @remarks
357
+ * Case when an entity is loaded into the world.
358
+ *
359
+ */
355
360
  Loaded = 'Loaded',
356
361
  /**
357
362
  * @remarks
@@ -636,11 +641,47 @@ export enum ScriptEventSource {
636
641
  * day.
637
642
  */
638
643
  export enum TimeOfDay {
644
+ /**
645
+ * @remarks
646
+ * Sets the time to the start of the day, which is time of the
647
+ * day 1,000 (or the equivalent of 7am) in Minecraft.
648
+ *
649
+ */
639
650
  Day = 1000,
651
+ /**
652
+ * @remarks
653
+ * Sets the time to noon, which is time of the day 6,000 in
654
+ * Minecraft.
655
+ *
656
+ */
640
657
  Noon = 6000,
658
+ /**
659
+ * @remarks
660
+ * Sets the time to sunset, which is time of the day 12,000 (or
661
+ * the equivalent of 6pm) in Minecraft.
662
+ *
663
+ */
641
664
  Sunset = 12000,
665
+ /**
666
+ * @remarks
667
+ * Sets the time to night, which is time of the day 13,000 (or
668
+ * the equivalent of 7:00pm) in Minecraft.
669
+ *
670
+ */
642
671
  Night = 13000,
672
+ /**
673
+ * @remarks
674
+ * Sets the time to midnight, which is time of the day 18,000
675
+ * (or the equivalent of 12:00am) in Minecraft.
676
+ *
677
+ */
643
678
  Midnight = 18000,
679
+ /**
680
+ * @remarks
681
+ * Sets the time to sunrise, which is time of the day 23,000
682
+ * (or the equivalent of 5am) in Minecraft.
683
+ *
684
+ */
644
685
  Sunrise = 23000,
645
686
  }
646
687
 
@@ -747,7 +788,6 @@ export class Block {
747
788
  */
748
789
  readonly z: number;
749
790
  /**
750
- * @beta
751
791
  * @remarks
752
792
  * Returns the {@link Block} above this block (positive in the
753
793
  * Y direction).
@@ -762,7 +802,6 @@ export class Block {
762
802
  */
763
803
  above(steps?: number): Block | undefined;
764
804
  /**
765
- * @beta
766
805
  * @remarks
767
806
  * Returns the {@link Block} below this block (negative in the
768
807
  * Y direction).
@@ -777,7 +816,6 @@ export class Block {
777
816
  */
778
817
  below(steps?: number): Block | undefined;
779
818
  /**
780
- * @beta
781
819
  * @remarks
782
820
  * Returns the {@link @minecraft/server.Location} of the center
783
821
  * of this block on the X and Z axis.
@@ -785,7 +823,6 @@ export class Block {
785
823
  */
786
824
  bottomCenter(): Vector3;
787
825
  /**
788
- * @beta
789
826
  * @remarks
790
827
  * Returns the {@link @minecraft/server.Location} of the center
791
828
  * of this block on the X, Y, and Z axis.
@@ -793,7 +830,6 @@ export class Block {
793
830
  */
794
831
  center(): Vector3;
795
832
  /**
796
- * @beta
797
833
  * @remarks
798
834
  * Returns the {@link Block} to the east of this block
799
835
  * (positive in the X direction).
@@ -839,7 +875,6 @@ export class Block {
839
875
  */
840
876
  isValid(): boolean;
841
877
  /**
842
- * @beta
843
878
  * @remarks
844
879
  * Returns the {@link Block} to the north of this block
845
880
  * (negative in the Z direction).
@@ -854,7 +889,16 @@ export class Block {
854
889
  */
855
890
  north(steps?: number): Block | undefined;
856
891
  /**
857
- * @beta
892
+ * @remarks
893
+ * Returns a block at an offset relative vector to this block.
894
+ *
895
+ * @param offset
896
+ * The offset vector. For example, an offset of 0, 1, 0 will
897
+ * return the block above the current block.
898
+ * @returns
899
+ * Block at the specified offset, or undefined if that block
900
+ * could not be retrieved (for example, the block and its
901
+ * relative chunk is not loaded yet.)
858
902
  * @throws This function can throw errors.
859
903
  *
860
904
  * {@link LocationInUnloadedChunkError}
@@ -880,7 +924,6 @@ export class Block {
880
924
  */
881
925
  setPermutation(permutation: BlockPermutation): void;
882
926
  /**
883
- * @beta
884
927
  * @remarks
885
928
  * Returns the {@link Block} to the south of this block
886
929
  * (positive in the Z direction).
@@ -895,7 +938,6 @@ export class Block {
895
938
  */
896
939
  south(steps?: number): Block | undefined;
897
940
  /**
898
- * @beta
899
941
  * @remarks
900
942
  * Returns the {@link Block} to the west of this block
901
943
  * (negative in the X direction).
@@ -1326,67 +1368,6 @@ export class Container {
1326
1368
  transferItem(fromSlot: number, toContainer: Container): ItemStack | undefined;
1327
1369
  }
1328
1370
 
1329
- /**
1330
- * @beta
1331
- * Contains information related to firing of a data driven
1332
- * entity event - for example, the minecraft:ageable_grow_up
1333
- * event on a chicken.
1334
- */
1335
- export class DataDrivenEntityTriggerAfterEvent {
1336
- private constructor();
1337
- /**
1338
- * @remarks
1339
- * Entity that the event triggered on.
1340
- *
1341
- */
1342
- readonly entity: Entity;
1343
- /**
1344
- * @remarks
1345
- * Name of the data driven event being triggered.
1346
- *
1347
- */
1348
- readonly eventId: string;
1349
- /**
1350
- * @remarks
1351
- * An updateable list of modifications to component state that
1352
- * are the effect of this triggered event.
1353
- *
1354
- */
1355
- getModifiers(): DefinitionModifier[];
1356
- }
1357
-
1358
- /**
1359
- * @beta
1360
- * Contains event registration related to firing of a data
1361
- * driven entity event - for example, the
1362
- * minecraft:ageable_grow_up event on a chicken.
1363
- */
1364
- export class DataDrivenEntityTriggerAfterEventSignal {
1365
- private constructor();
1366
- /**
1367
- * @remarks
1368
- * Adds a callback that will be called after a data driven
1369
- * entity event is triggered.
1370
- *
1371
- * This function can't be called in read-only mode.
1372
- *
1373
- */
1374
- subscribe(
1375
- callback: (arg: DataDrivenEntityTriggerAfterEvent) => void,
1376
- options?: EntityDataDrivenTriggerEventOptions,
1377
- ): (arg: DataDrivenEntityTriggerAfterEvent) => void;
1378
- /**
1379
- * @remarks
1380
- * Removes a callback that will be called after a data driven
1381
- * entity event is triggered.
1382
- *
1383
- * This function can't be called in read-only mode.
1384
- *
1385
- * @throws This function can throw errors.
1386
- */
1387
- unsubscribe(callback: (arg: DataDrivenEntityTriggerAfterEvent) => void): void;
1388
- }
1389
-
1390
1371
  /**
1391
1372
  * A class that represents a particular dimension (e.g., The
1392
1373
  * End) within a world.
@@ -1394,7 +1375,6 @@ export class DataDrivenEntityTriggerAfterEventSignal {
1394
1375
  export class Dimension {
1395
1376
  private constructor();
1396
1377
  /**
1397
- * @beta
1398
1378
  * @remarks
1399
1379
  * Height range of the dimension.
1400
1380
  *
@@ -2110,7 +2090,10 @@ export class Entity {
2110
2090
  */
2111
2091
  applyKnockback(directionX: number, directionZ: number, horizontalStrength: number, verticalStrength: number): void;
2112
2092
  /**
2113
- * @beta
2093
+ * @remarks
2094
+ * Clears all dynamic properties that have been set on this
2095
+ * entity.
2096
+ *
2114
2097
  * @throws This function can throw errors.
2115
2098
  */
2116
2099
  clearDynamicProperties(): void;
@@ -2172,7 +2155,6 @@ export class Entity {
2172
2155
  */
2173
2156
  getComponents(): EntityComponent[];
2174
2157
  /**
2175
- * @beta
2176
2158
  * @remarks
2177
2159
  * Returns a property value.
2178
2160
  *
@@ -2185,12 +2167,24 @@ export class Entity {
2185
2167
  */
2186
2168
  getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
2187
2169
  /**
2188
- * @beta
2170
+ * @remarks
2171
+ * Returns the available set of dynamic property identifiers
2172
+ * that have been used on this entity.
2173
+ *
2174
+ * @returns
2175
+ * A string array of the dynamic properties set on this entity.
2189
2176
  * @throws This function can throw errors.
2190
2177
  */
2191
2178
  getDynamicPropertyIds(): string[];
2192
2179
  /**
2193
- * @beta
2180
+ * @remarks
2181
+ * Returns the total size, in bytes, of all the dynamic
2182
+ * properties that are currently stored for this entity. This
2183
+ * can be useful for diagnosing performance warning signs - if,
2184
+ * for example, an entity has many megabytes of associated
2185
+ * dynamic properties, it may be slow to load on various
2186
+ * devices.
2187
+ *
2194
2188
  * @throws This function can throw errors.
2195
2189
  */
2196
2190
  getDynamicPropertyTotalByteCount(): number;
@@ -2371,7 +2365,6 @@ export class Entity {
2371
2365
  */
2372
2366
  kill(): boolean;
2373
2367
  /**
2374
- * @beta
2375
2368
  * @remarks
2376
2369
  * Matches the entity against the passed in options. Uses the
2377
2370
  * location of the entity for matching if the location is not
@@ -2384,7 +2377,6 @@ export class Entity {
2384
2377
  */
2385
2378
  matches(options: EntityQueryOptions): boolean;
2386
2379
  /**
2387
- * @beta
2388
2380
  * @remarks
2389
2381
  * Immediately removes the entity from the world. The removed
2390
2382
  * entity will not perform a death animation or drop loot upon
@@ -2481,7 +2473,6 @@ export class Entity {
2481
2473
  */
2482
2474
  runCommandAsync(commandString: string): Promise<CommandResult>;
2483
2475
  /**
2484
- * @beta
2485
2476
  * @remarks
2486
2477
  * Sets a specified property to a value.
2487
2478
  *
@@ -3778,115 +3769,6 @@ export class EntityWantsJockeyComponent extends EntityComponent {
3778
3769
  static readonly componentId = 'minecraft:wants_jockey';
3779
3770
  }
3780
3771
 
3781
- /**
3782
- * @beta
3783
- * Contains information regarding an explosion that has
3784
- * happened.
3785
- */
3786
- export class ExplosionAfterEvent {
3787
- private constructor();
3788
- /**
3789
- * @remarks
3790
- * Dimension where the explosion has occurred.
3791
- *
3792
- */
3793
- readonly dimension: Dimension;
3794
- /**
3795
- * @remarks
3796
- * Optional source of the explosion.
3797
- *
3798
- */
3799
- readonly source?: Entity;
3800
- /**
3801
- * @remarks
3802
- * A collection of blocks impacted by this explosion event.
3803
- *
3804
- */
3805
- getImpactedBlocks(): Block[];
3806
- }
3807
-
3808
- /**
3809
- * @beta
3810
- * Manages callbacks that are connected to when an explosion
3811
- * occurs.
3812
- */
3813
- export class ExplosionAfterEventSignal {
3814
- private constructor();
3815
- /**
3816
- * @remarks
3817
- * Adds a callback that will be called when an explosion
3818
- * occurs.
3819
- *
3820
- * This function can't be called in read-only mode.
3821
- *
3822
- */
3823
- subscribe(callback: (arg: ExplosionAfterEvent) => void): (arg: ExplosionAfterEvent) => void;
3824
- /**
3825
- * @remarks
3826
- * Removes a callback from being called when an explosion
3827
- * occurs.
3828
- *
3829
- * This function can't be called in read-only mode.
3830
- *
3831
- * @throws This function can throw errors.
3832
- */
3833
- unsubscribe(callback: (arg: ExplosionAfterEvent) => void): void;
3834
- }
3835
-
3836
- /**
3837
- * @beta
3838
- * Contains information regarding an explosion that has
3839
- * happened.
3840
- */
3841
- // @ts-ignore Class inheritance allowed for native defined classes
3842
- export class ExplosionBeforeEvent extends ExplosionAfterEvent {
3843
- private constructor();
3844
- /**
3845
- * @remarks
3846
- * If set to true, cancels the explosion event.
3847
- *
3848
- */
3849
- cancel: boolean;
3850
- /**
3851
- * @remarks
3852
- * Updates a collection of blocks impacted by this explosion
3853
- * event.
3854
- *
3855
- * @param blocks
3856
- * New list of blocks that are impacted by this explosion.
3857
- */
3858
- setImpactedBlocks(blocks: Block[]): void;
3859
- }
3860
-
3861
- /**
3862
- * @beta
3863
- * Manages callbacks that are connected to before an explosion
3864
- * occurs.
3865
- */
3866
- export class ExplosionBeforeEventSignal {
3867
- private constructor();
3868
- /**
3869
- * @remarks
3870
- * Adds a callback that will be called when before an explosion
3871
- * occurs. The callback can optionally change or cancel
3872
- * explosion behavior.
3873
- *
3874
- * This function can't be called in read-only mode.
3875
- *
3876
- */
3877
- subscribe(callback: (arg: ExplosionBeforeEvent) => void): (arg: ExplosionBeforeEvent) => void;
3878
- /**
3879
- * @remarks
3880
- * Removes a callback from being called from before when an
3881
- * explosion would occur.
3882
- *
3883
- * This function can't be called in read-only mode.
3884
- *
3885
- * @throws This function can throw errors.
3886
- */
3887
- unsubscribe(callback: (arg: ExplosionBeforeEvent) => void): void;
3888
- }
3889
-
3890
3772
  /**
3891
3773
  * As part of the Healable component, represents a specific
3892
3774
  * item that can be fed to an entity to cause health effects.
@@ -4153,7 +4035,7 @@ export class ItemReleaseUseAfterEvent {
4153
4035
  * Returns the item stack that triggered this item event.
4154
4036
  *
4155
4037
  */
4156
- readonly itemStack?: ItemStack;
4038
+ readonly itemStack: ItemStack;
4157
4039
  /**
4158
4040
  * @remarks
4159
4041
  * Returns the source entity that triggered this item event.
@@ -5490,7 +5372,6 @@ export class PlayerDimensionChangeAfterEventSignal {
5490
5372
  }
5491
5373
 
5492
5374
  /**
5493
- * @beta
5494
5375
  * Contains information regarding an event after a player
5495
5376
  * interacts with a block.
5496
5377
  */
@@ -5531,7 +5412,6 @@ export class PlayerInteractWithBlockAfterEvent {
5531
5412
  }
5532
5413
 
5533
5414
  /**
5534
- * @beta
5535
5415
  * Manages callbacks that are connected to after a player
5536
5416
  * interacts with a block.
5537
5417
  */
@@ -5561,7 +5441,6 @@ export class PlayerInteractWithBlockAfterEventSignal {
5561
5441
  }
5562
5442
 
5563
5443
  /**
5564
- * @beta
5565
5444
  * Contains information regarding an event before a player
5566
5445
  * interacts with a block.
5567
5446
  */
@@ -5608,7 +5487,6 @@ export class PlayerInteractWithBlockBeforeEvent {
5608
5487
  }
5609
5488
 
5610
5489
  /**
5611
- * @beta
5612
5490
  * Manages callbacks that are connected to before a player
5613
5491
  * interacts with a block.
5614
5492
  */
@@ -5638,7 +5516,6 @@ export class PlayerInteractWithBlockBeforeEventSignal {
5638
5516
  }
5639
5517
 
5640
5518
  /**
5641
- * @beta
5642
5519
  * Contains information regarding an event after a player
5643
5520
  * interacts with an entity.
5644
5521
  */
@@ -5666,7 +5543,6 @@ export class PlayerInteractWithEntityAfterEvent {
5666
5543
  }
5667
5544
 
5668
5545
  /**
5669
- * @beta
5670
5546
  * Manages callbacks that are connected to after a player
5671
5547
  * interacts with an entity.
5672
5548
  */
@@ -5696,7 +5572,6 @@ export class PlayerInteractWithEntityAfterEventSignal {
5696
5572
  }
5697
5573
 
5698
5574
  /**
5699
- * @beta
5700
5575
  * Contains information regarding an event before a player
5701
5576
  * interacts with an entity.
5702
5577
  */
@@ -5730,7 +5605,6 @@ export class PlayerInteractWithEntityBeforeEvent {
5730
5605
  }
5731
5606
 
5732
5607
  /**
5733
- * @beta
5734
5608
  * Manages callbacks that are connected to before a player
5735
5609
  * interacts with an entity.
5736
5610
  */
@@ -5820,17 +5694,11 @@ export class PlayerLeaveAfterEventSignal extends IPlayerLeaveAfterEventSignal {
5820
5694
  private constructor();
5821
5695
  }
5822
5696
 
5823
- /**
5824
- * @beta
5825
- */
5826
5697
  export class PlayerLeaveBeforeEvent {
5827
5698
  private constructor();
5828
5699
  readonly player: Player;
5829
5700
  }
5830
5701
 
5831
- /**
5832
- * @beta
5833
- */
5834
5702
  export class PlayerLeaveBeforeEventSignal {
5835
5703
  private constructor();
5836
5704
  /**
@@ -6824,7 +6692,10 @@ export class World {
6824
6692
  */
6825
6693
  readonly scoreboard: Scoreboard;
6826
6694
  /**
6827
- * @beta
6695
+ * @remarks
6696
+ * Clears the set of dynamic properties declared for this
6697
+ * behavior pack within the world.
6698
+ *
6828
6699
  */
6829
6700
  clearDynamicProperties(): void;
6830
6701
  /**
@@ -6873,7 +6744,6 @@ export class World {
6873
6744
  */
6874
6745
  getDimension(dimensionId: string): Dimension;
6875
6746
  /**
6876
- * @beta
6877
6747
  * @remarks
6878
6748
  * Returns a property value.
6879
6749
  *
@@ -6940,15 +6810,23 @@ export class World {
6940
6810
  */
6941
6811
  getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
6942
6812
  /**
6943
- * @beta
6813
+ * @remarks
6814
+ * Gets a set of dynamic property identifiers that have been
6815
+ * set in this world.
6816
+ *
6817
+ * @returns
6818
+ * A string array of active dynamic property identifiers.
6944
6819
  */
6945
6820
  getDynamicPropertyIds(): string[];
6946
6821
  /**
6947
- * @beta
6822
+ * @remarks
6823
+ * Gets the total byte count of dynamic properties. This could
6824
+ * potentially be used for your own analytics to ensure you're
6825
+ * not storing gigantic sets of dynamic properties.
6826
+ *
6948
6827
  */
6949
6828
  getDynamicPropertyTotalByteCount(): number;
6950
6829
  /**
6951
- * @beta
6952
6830
  * @remarks
6953
6831
  * Returns an entity based on the provided id.
6954
6832
  *
@@ -7141,7 +7019,6 @@ export class World {
7141
7019
  */
7142
7020
  setDefaultSpawnLocation(spawnLocation: Vector3): void;
7143
7021
  /**
7144
- * @beta
7145
7022
  * @remarks
7146
7023
  * Sets a specified property to a value.
7147
7024
  *
@@ -7241,15 +7118,6 @@ export class WorldAfterEvents {
7241
7118
  *
7242
7119
  */
7243
7120
  readonly buttonPush: ButtonPushAfterEventSignal;
7244
- /**
7245
- * @beta
7246
- * @remarks
7247
- * This event is fired when an entity event has been triggered
7248
- * that will update the component definition state of an
7249
- * entity.
7250
- *
7251
- */
7252
- readonly dataDrivenEntityTriggerEvent: DataDrivenEntityTriggerAfterEventSignal;
7253
7121
  /**
7254
7122
  * @remarks
7255
7123
  * This event fires when an entity dies.
@@ -7481,7 +7349,9 @@ export class WorldBeforeEvents {
7481
7349
  */
7482
7350
  readonly playerBreakBlock: PlayerBreakBlockBeforeEventSignal;
7483
7351
  /**
7484
- * @beta
7352
+ * @remarks
7353
+ * Fires when a player leaves the game.
7354
+ *
7485
7355
  */
7486
7356
  readonly playerLeave: PlayerLeaveBeforeEventSignal;
7487
7357
  }
@@ -7584,6 +7454,11 @@ export interface BlockRaycastOptions {
7584
7454
  }
7585
7455
 
7586
7456
  export interface CameraDefaultOptions {
7457
+ /**
7458
+ * @remarks
7459
+ * Sets a set of easing options for the camera.
7460
+ *
7461
+ */
7587
7462
  easeOptions: CameraEaseOptions;
7588
7463
  }
7589
7464
 
@@ -7670,28 +7545,6 @@ export interface CameraSetRotOptions {
7670
7545
  rotation: Vector2;
7671
7546
  }
7672
7547
 
7673
- /**
7674
- * @beta
7675
- * Contains a set of updates to the component definition state
7676
- * of an entity.
7677
- */
7678
- export interface DefinitionModifier {
7679
- /**
7680
- * @remarks
7681
- * Retrieves the list of component groups that will be added
7682
- * via this definition modification.
7683
- *
7684
- */
7685
- addedComponentGroups: string[];
7686
- /**
7687
- * @remarks
7688
- * The list of component groups that will be removed via this
7689
- * definition modification.
7690
- *
7691
- */
7692
- removedComponentGroups: string[];
7693
- }
7694
-
7695
7548
  /**
7696
7549
  * An exact coordinate within the world, including its
7697
7550
  * dimension and location.
@@ -7785,36 +7638,6 @@ export interface EntityDamageSource {
7785
7638
  damagingProjectile?: Entity;
7786
7639
  }
7787
7640
 
7788
- /**
7789
- * @beta
7790
- * Specifies additional filters that are used in registering a
7791
- * data driven trigger event for entities.
7792
- */
7793
- export interface EntityDataDrivenTriggerEventOptions {
7794
- /**
7795
- * @remarks
7796
- * If this value is set, this event will only fire for entities
7797
- * that match the entities within this collection.
7798
- *
7799
- */
7800
- entities?: Entity[];
7801
- /**
7802
- * @remarks
7803
- * If this value is set, this event will only fire if the
7804
- * impacted entities' type matches this parameter.
7805
- *
7806
- */
7807
- entityTypes?: string[];
7808
- /**
7809
- * @remarks
7810
- * If this value is set, this event will only fire if the
7811
- * impacted triggered event matches one of the events listed in
7812
- * this parameter.
7813
- *
7814
- */
7815
- eventTypes?: string[];
7816
- }
7817
-
7818
7641
  /**
7819
7642
  * Contains additional options for entity effects.
7820
7643
  */
@@ -8457,7 +8280,6 @@ export class LocationOutOfWorldBoundariesError extends Error {
8457
8280
  */
8458
8281
  export const MoonPhaseCount = 8;
8459
8282
  /**
8460
- * @beta
8461
8283
  * @remarks
8462
8284
  * How many times the server ticks per second of real time.
8463
8285
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.7.0-rc.1.20.60-preview.20",
3
+ "version": "1.7.0",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/common": "^1.1.0-rc.1.20.60-preview.20"
16
+ "@minecraft/common": "^1.1.0"
17
17
  },
18
18
  "license": "MIT"
19
19
  }