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

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 +405 -78
  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.24"
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
@@ -121,42 +122,42 @@ export enum Direction {
121
122
  /**
122
123
  * @beta
123
124
  * @remarks
124
- * Returns the block beneath (y - 1) of this item.
125
+ * Returns the {@link Block} beneath (y - 1) of this item.
125
126
  *
126
127
  */
127
128
  Down = 'Down',
128
129
  /**
129
130
  * @beta
130
131
  * @remarks
131
- * Returns the block to the east (x + 1) of this item.
132
+ * Returns the {@link Block} to the east (x + 1) of this item.
132
133
  *
133
134
  */
134
135
  East = 'East',
135
136
  /**
136
137
  * @beta
137
138
  * @remarks
138
- * Returns the block to the east (z + 1) of this item.
139
+ * Returns the {@link Block} to the east (z + 1) of this item.
139
140
  *
140
141
  */
141
142
  North = 'North',
142
143
  /**
143
144
  * @beta
144
145
  * @remarks
145
- * Returns the block to the south (z - 1) of this item.
146
+ * Returns the {@link Block} to the south (z - 1) of this item.
146
147
  *
147
148
  */
148
149
  South = 'South',
149
150
  /**
150
151
  * @beta
151
152
  * @remarks
152
- * Returns the block above (y + 1) of this item.
153
+ * Returns the {@link Block} above (y + 1) of this item.
153
154
  *
154
155
  */
155
156
  Up = 'Up',
156
157
  /**
157
158
  * @beta
158
159
  * @remarks
159
- * Returns the block to the west (x - 1) of this item.
160
+ * Returns the {@link Block} to the west (x - 1) of this item.
160
161
  *
161
162
  */
162
163
  West = 'West',
@@ -349,42 +350,244 @@ export enum EasingType {
349
350
 
350
351
  /**
351
352
  * @beta
353
+ * Describes the source of damage from an Entity.
352
354
  */
353
355
  export enum EntityDamageCause {
356
+ /**
357
+ * @beta
358
+ * @remarks
359
+ * Damage caused by a falling anvil.
360
+ *
361
+ */
354
362
  anvil = 'anvil',
363
+ /**
364
+ * @beta
365
+ * @remarks
366
+ * Damage caused from a non-Entity explosion. For example, an
367
+ * exploding bed.
368
+ *
369
+ */
355
370
  blockExplosion = 'blockExplosion',
356
371
  campfire = 'campfire',
372
+ /**
373
+ * @beta
374
+ * @remarks
375
+ * Unused.
376
+ *
377
+ */
357
378
  charging = 'charging',
379
+ /**
380
+ * @beta
381
+ * @remarks
382
+ * Damage caused by physically touching an Entity or Block. For
383
+ * example, touching a Sweet Berry bush or Pufferfish.
384
+ *
385
+ */
358
386
  contact = 'contact',
387
+ /**
388
+ * @beta
389
+ * @remarks
390
+ * Damage caused by an Entity being out of air and inside a
391
+ * liquid block.
392
+ *
393
+ */
359
394
  drowning = 'drowning',
395
+ /**
396
+ * @beta
397
+ * @remarks
398
+ * Damage caused by an Entity attack.
399
+ *
400
+ */
360
401
  entityAttack = 'entityAttack',
402
+ /**
403
+ * @beta
404
+ * @remarks
405
+ * Damage caused by an Entity explosion. For example, a Creeper
406
+ * or Wither.
407
+ *
408
+ */
361
409
  entityExplosion = 'entityExplosion',
410
+ /**
411
+ * @beta
412
+ * @remarks
413
+ * Damage caused by falling onto the ground.
414
+ *
415
+ */
362
416
  fall = 'fall',
417
+ /**
418
+ * @beta
419
+ * @remarks
420
+ * Damage caused by falling blocks. Note: Anvils and
421
+ * Stalactites have their own damage causes.
422
+ *
423
+ */
363
424
  fallingBlock = 'fallingBlock',
425
+ /**
426
+ * @beta
427
+ * @remarks
428
+ * Damage caused by catching on fire.
429
+ *
430
+ */
364
431
  fire = 'fire',
432
+ /**
433
+ * @beta
434
+ * @remarks
435
+ * Damage caused by burning over time.
436
+ *
437
+ */
365
438
  fireTick = 'fireTick',
439
+ /**
440
+ * @beta
441
+ * @remarks
442
+ * Damage caused by fireworks.
443
+ *
444
+ */
366
445
  fireworks = 'fireworks',
446
+ /**
447
+ * @beta
448
+ * @remarks
449
+ * Damage caused by flying into a wall at high speed while
450
+ * gliding with Elytra.
451
+ *
452
+ */
367
453
  flyIntoWall = 'flyIntoWall',
454
+ /**
455
+ * @beta
456
+ * @remarks
457
+ * Damage caused by staying inside a Powder Snow block.
458
+ *
459
+ */
368
460
  freezing = 'freezing',
461
+ /**
462
+ * @beta
463
+ * @remarks
464
+ * Damage caused by touching a Lava block.
465
+ *
466
+ */
369
467
  lava = 'lava',
468
+ /**
469
+ * @beta
470
+ * @remarks
471
+ * Damage caused by being struck by lightning.
472
+ *
473
+ */
370
474
  lightning = 'lightning',
475
+ /**
476
+ * @beta
477
+ * @remarks
478
+ * Damage caused by magical attacks. For example, Evoker Fang
479
+ * or Conduit Block.
480
+ *
481
+ */
371
482
  magic = 'magic',
483
+ /**
484
+ * @beta
485
+ * @remarks
486
+ * Damage caused by touching a Magma block.
487
+ *
488
+ */
372
489
  magma = 'magma',
490
+ /**
491
+ * @beta
492
+ * @remarks
493
+ * Damage caused by no source. For example, from a command or
494
+ * script.
495
+ *
496
+ */
373
497
  none = 'none',
498
+ /**
499
+ * @beta
500
+ * @remarks
501
+ * Damage caused by an indirect source. For example, setting a
502
+ * mob's health to 0 in a behavior pack.
503
+ *
504
+ */
374
505
  override = 'override',
506
+ /**
507
+ * @beta
508
+ * @remarks
509
+ * Damage caused by a Piston.
510
+ *
511
+ */
375
512
  piston = 'piston',
513
+ /**
514
+ * @beta
515
+ * @remarks
516
+ * Damage caused by a projectile.
517
+ *
518
+ */
376
519
  projectile = 'projectile',
377
520
  ramAttack = 'ramAttack',
378
521
  sonicBoom = 'sonicBoom',
379
522
  soulCampfire = 'soulCampfire',
523
+ /**
524
+ * @beta
525
+ * @remarks
526
+ * Damage caused by a falling Stalactite block.
527
+ *
528
+ */
380
529
  stalactite = 'stalactite',
530
+ /**
531
+ * @beta
532
+ * @remarks
533
+ * Damage caused by touching a Stalagmite block.
534
+ *
535
+ */
381
536
  stalagmite = 'stalagmite',
537
+ /**
538
+ * @beta
539
+ * @remarks
540
+ * Damage caused over time by having an empty hunger bar.
541
+ *
542
+ */
382
543
  starve = 'starve',
544
+ /**
545
+ * @beta
546
+ * @remarks
547
+ * Damage caused by an Entity being out of air and inside a
548
+ * non-liquid block.
549
+ *
550
+ */
383
551
  suffocation = 'suffocation',
552
+ /**
553
+ * @beta
554
+ * @remarks
555
+ * Damage caused by an Entity killing itself. For example, from
556
+ * the /kill command.
557
+ *
558
+ */
384
559
  suicide = 'suicide',
560
+ /**
561
+ * @beta
562
+ * @remarks
563
+ * Damage caused by an Entity being in an inhabitable climate.
564
+ * For example, a Snow Golem in a biome with a temperature
565
+ * greater than 1.
566
+ *
567
+ */
385
568
  temperature = 'temperature',
569
+ /**
570
+ * @beta
571
+ * @remarks
572
+ * Damage caused by the Thorns armor enchantment and by the
573
+ * Guardian thorns effect.
574
+ *
575
+ */
386
576
  thorns = 'thorns',
577
+ /**
578
+ * @beta
579
+ * @remarks
580
+ * Damage caused over time by falling into the void.
581
+ *
582
+ */
387
583
  'void' = 'void',
584
+ /**
585
+ * @beta
586
+ * @remarks
587
+ * Damage caused by the Wither effect. For example, from
588
+ * touching a Wither Rose.
589
+ *
590
+ */
388
591
  wither = 'wither',
389
592
  }
390
593
 
@@ -628,17 +831,72 @@ export enum ItemLockMode {
628
831
  /**
629
832
  * @beta
630
833
  * Enum containing the different phases of the moon based on
631
- * the current day.
632
- * Obtain the current MoonPhase using world.getMoonPhase
834
+ * the current day.,Obtain the current MoonPhase using
835
+ * world.getMoonPhase.
836
+ *
837
+ * The fullness of the moon controls various mob behaviors such
838
+ * as the number of slimes that spawn in Swamp biomes, the
839
+ * chance skeletons and zombies have to spawn with armor, as
840
+ * well as the chance for spiders to spawn with certain status
841
+ * effects.
633
842
  */
634
843
  export enum MoonPhase {
844
+ /**
845
+ * @beta
846
+ * @remarks
847
+ * The brightest moon phase. During this phase, cats have a 50%
848
+ * chance of spawning as black cats.
849
+ *
850
+ */
635
851
  FullMoon = 0,
852
+ /**
853
+ * @beta
854
+ * @remarks
855
+ * The phase following the Full Moon.
856
+ *
857
+ */
636
858
  WaningGibbous = 1,
859
+ /**
860
+ * @beta
861
+ * @remarks
862
+ * The phase following the Waxing Crescent.
863
+ *
864
+ */
637
865
  FirstQuarter = 2,
866
+ /**
867
+ * @beta
868
+ * @remarks
869
+ * The phase following the Last Quarter.
870
+ *
871
+ */
638
872
  WaningCrescent = 3,
873
+ /**
874
+ * @beta
875
+ * @remarks
876
+ * The darkest moon phase.
877
+ *
878
+ */
639
879
  NewMoon = 4,
880
+ /**
881
+ * @beta
882
+ * @remarks
883
+ * The phase following the New Moon.
884
+ *
885
+ */
640
886
  WaxingCrescent = 5,
887
+ /**
888
+ * @beta
889
+ * @remarks
890
+ * The phase following the Waning Gibbous.
891
+ *
892
+ */
641
893
  LastQuarter = 6,
894
+ /**
895
+ * @beta
896
+ * @remarks
897
+ * The phase following the First Quarter.
898
+ *
899
+ */
642
900
  WaxingGibbous = 7,
643
901
  }
644
902
 
@@ -952,6 +1210,12 @@ export class Block {
952
1210
  readonly z: number;
953
1211
  /**
954
1212
  * @beta
1213
+ * @remarks
1214
+ * Returns the {@link Block} above this block (positive in the
1215
+ * Y direction).
1216
+ *
1217
+ * @param steps
1218
+ * Number of steps above to step before returning.
955
1219
  * @throws This function can throw errors.
956
1220
  *
957
1221
  * {@link LocationInUnloadedChunkError}
@@ -961,6 +1225,12 @@ export class Block {
961
1225
  above(steps?: number): Block | undefined;
962
1226
  /**
963
1227
  * @beta
1228
+ * @remarks
1229
+ * Returns the {@link Block} below this block (negative in the
1230
+ * Y direction).
1231
+ *
1232
+ * @param steps
1233
+ * Number of steps below to step before returning.
964
1234
  * @throws This function can throw errors.
965
1235
  *
966
1236
  * {@link LocationInUnloadedChunkError}
@@ -970,6 +1240,10 @@ export class Block {
970
1240
  below(steps?: number): Block | undefined;
971
1241
  /**
972
1242
  * @beta
1243
+ * @remarks
1244
+ * Returns the {@link @minecraft/server.Location} of the center
1245
+ * of this block on the X and Z axis.
1246
+ *
973
1247
  */
974
1248
  bottomCenter(): Vector3;
975
1249
  /**
@@ -998,10 +1272,20 @@ export class Block {
998
1272
  canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
999
1273
  /**
1000
1274
  * @beta
1275
+ * @remarks
1276
+ * Returns the {@link @minecraft/server.Location} of the center
1277
+ * of this block on the X, Y, and Z axis.
1278
+ *
1001
1279
  */
1002
1280
  center(): Vector3;
1003
1281
  /**
1004
1282
  * @beta
1283
+ * @remarks
1284
+ * Returns the {@link Block} to the east of this block
1285
+ * (positive in the X direction).
1286
+ *
1287
+ * @param steps
1288
+ * Number of steps to the east to step before returning.
1005
1289
  * @throws This function can throw errors.
1006
1290
  *
1007
1291
  * {@link LocationInUnloadedChunkError}
@@ -1012,16 +1296,13 @@ export class Block {
1012
1296
  /**
1013
1297
  * @beta
1014
1298
  * @remarks
1015
- * Gets additional configuration properties (a component) for
1016
- * specific capabilities of particular blocks - for example, an
1017
- * inventory component of a chest block.
1299
+ * Gets a component (that represents additional capabilities)
1300
+ * for a block - for example, an inventory component of a chest
1301
+ * block.
1018
1302
  *
1019
- * @param componentName
1020
- * Identifier of the component. If a namespace is not
1021
- * specified, minecraft: is assumed.
1022
1303
  * @returns
1023
- * Returns the component object if it is present on the
1024
- * particular block.
1304
+ * Returns the component if it exists on the block, otherwise
1305
+ * undefined.
1025
1306
  * @throws This function can throw errors.
1026
1307
  *
1027
1308
  * {@link LocationInUnloadedChunkError}
@@ -1041,13 +1322,16 @@ export class Block {
1041
1322
  * @param withData
1042
1323
  * Whether additional data facets of the item stack are
1043
1324
  * included.
1325
+ * @returns
1326
+ * An itemStack with the specified amount of items and data.
1327
+ * Returns undefined if block type is incompatible.
1044
1328
  * @throws This function can throw errors.
1045
1329
  *
1046
1330
  * {@link LocationInUnloadedChunkError}
1047
1331
  *
1048
1332
  * {@link LocationOutOfWorldBoundariesError}
1049
1333
  */
1050
- getItemStack(amount?: number, withData?: boolean): ItemStack;
1334
+ getItemStack(amount?: number, withData?: boolean): ItemStack | undefined;
1051
1335
  /**
1052
1336
  * @beta
1053
1337
  * @remarks
@@ -1119,6 +1403,12 @@ export class Block {
1119
1403
  isValid(): boolean;
1120
1404
  /**
1121
1405
  * @beta
1406
+ * @remarks
1407
+ * Returns the {@link Block} to the north of this block
1408
+ * (negative in the Z direction).
1409
+ *
1410
+ * @param steps
1411
+ * Number of steps to the north to step before returning.
1122
1412
  * @throws This function can throw errors.
1123
1413
  *
1124
1414
  * {@link LocationInUnloadedChunkError}
@@ -1173,6 +1463,12 @@ export class Block {
1173
1463
  setType(blockType: BlockType | string): void;
1174
1464
  /**
1175
1465
  * @beta
1466
+ * @remarks
1467
+ * Returns the {@link Block} to the south of this block
1468
+ * (positive in the Z direction).
1469
+ *
1470
+ * @param steps
1471
+ * Number of steps to the south to step before returning.
1176
1472
  * @throws This function can throw errors.
1177
1473
  *
1178
1474
  * {@link LocationInUnloadedChunkError}
@@ -1203,6 +1499,12 @@ export class Block {
1203
1499
  trySetPermutation(permutation: BlockPermutation): boolean;
1204
1500
  /**
1205
1501
  * @beta
1502
+ * @remarks
1503
+ * Returns the {@link Block} to the west of this block
1504
+ * (negative in the X direction).
1505
+ *
1506
+ * @param steps
1507
+ * Number of steps to the west to step before returning.
1206
1508
  * @throws This function can throw errors.
1207
1509
  *
1208
1510
  * {@link LocationInUnloadedChunkError}
@@ -1854,8 +2156,8 @@ export class BlockStates {
1854
2156
  * Retrieves a specific block state instance.
1855
2157
  *
1856
2158
  * @returns
1857
- * Returns the block state instance if it is found. If the
1858
- * block state instance is not found returns undefined.
2159
+ * Returns the {@link Block} state instance if it is found. If
2160
+ * the block state instance is not found returns undefined.
1859
2161
  */
1860
2162
  static get(stateName: string): BlockStateType | undefined;
1861
2163
  /**
@@ -2786,7 +3088,7 @@ export class Container {
2786
3088
  * The stack of items to add.
2787
3089
  * @throws This function can throw errors.
2788
3090
  */
2789
- addItem(itemStack: ItemStack): ItemStack;
3091
+ addItem(itemStack: ItemStack): ItemStack | undefined;
2790
3092
  /**
2791
3093
  * @remarks
2792
3094
  * Clears all inventory items in the container.
@@ -2922,6 +3224,9 @@ export class Container {
2922
3224
  * @param toContainer
2923
3225
  * Target container to transfer to. Note this can be the same
2924
3226
  * container as the source.
3227
+ * @returns
3228
+ * An itemStack with the items that couldn't be transferred.
3229
+ * Returns undefined if all items were transferred.
2925
3230
  * @throws
2926
3231
  * Throws if either this container or `toContainer` are invalid
2927
3232
  * or if the `fromSlot` or `toSlot` indices out of bounds.
@@ -2933,7 +3238,7 @@ export class Container {
2933
3238
  * fromInventory.container.transferItem(0, toInventory.container);
2934
3239
  * ```
2935
3240
  */
2936
- transferItem(fromSlot: number, toContainer: Container): ItemStack;
3241
+ transferItem(fromSlot: number, toContainer: Container): ItemStack | undefined;
2937
3242
  }
2938
3243
 
2939
3244
  /**
@@ -3904,8 +4209,6 @@ export class EffectAddAfterEvent {
3904
4209
  effect: Effect;
3905
4210
  /**
3906
4211
  * @remarks
3907
- * Additional variant number for the effect.
3908
- *
3909
4212
  * This property can't be edited in read-only mode.
3910
4213
  *
3911
4214
  */
@@ -4616,10 +4919,10 @@ export class Entity {
4616
4919
  * for an entity.
4617
4920
  *
4618
4921
  * @param componentId
4619
- * The identifier of the component (e.g., 'minecraft:rideable')
4620
- * to retrieve. If no namespace prefix is specified,
4621
- * 'minecraft:' is assumed. If the component is not present on
4622
- * the entity, undefined is returned.
4922
+ * The identifier of the component (e.g., 'minecraft:health').
4923
+ * If no namespace prefix is specified, 'minecraft:' is
4924
+ * assumed. Available component IDs can be found as part of the
4925
+ * {@link @minecraft/server.EntityComponentTypes} enum.
4623
4926
  * @returns
4624
4927
  * Returns the component if it exists on the entity, otherwise
4625
4928
  * undefined.
@@ -4850,6 +5153,11 @@ export class Entity {
4850
5153
  * ```
4851
5154
  */
4852
5155
  kill(): boolean;
5156
+ /**
5157
+ * @beta
5158
+ * @throws This function can throw errors.
5159
+ */
5160
+ matches(options: EntityQueryOptions): boolean;
4853
5161
  /**
4854
5162
  * @beta
4855
5163
  * @remarks
@@ -4925,6 +5233,10 @@ export class Entity {
4925
5233
  * returned.
4926
5234
  * @throws
4927
5235
  * Throws if the entity is invalid.
5236
+ *
5237
+ * {@link minecraftcommon.EngineError}
5238
+ *
5239
+ * {@link Error}
4928
5240
  */
4929
5241
  resetProperty(identifier: string): boolean | number | string;
4930
5242
  /**
@@ -7472,12 +7784,16 @@ export class IButtonPushAfterEventSignal {
7472
7784
  private constructor();
7473
7785
  /**
7474
7786
  * @remarks
7787
+ * Subscribes to the event.
7788
+ *
7475
7789
  * This function can't be called in read-only mode.
7476
7790
  *
7477
7791
  */
7478
7792
  subscribe(callback: (arg: ButtonPushAfterEvent) => void): (arg: ButtonPushAfterEvent) => void;
7479
7793
  /**
7480
7794
  * @remarks
7795
+ * Unsubscribes from the event.
7796
+ *
7481
7797
  * This function can't be called in read-only mode.
7482
7798
  *
7483
7799
  * @throws This function can throw errors.
@@ -7494,12 +7810,16 @@ export class ILeverActionAfterEventSignal {
7494
7810
  private constructor();
7495
7811
  /**
7496
7812
  * @remarks
7813
+ * Subscribes to the event.
7814
+ *
7497
7815
  * This function can't be called in read-only mode.
7498
7816
  *
7499
7817
  */
7500
7818
  subscribe(callback: (arg: LeverActionAfterEvent) => void): (arg: LeverActionAfterEvent) => void;
7501
7819
  /**
7502
7820
  * @remarks
7821
+ * Unsubscribes from the event.
7822
+ *
7503
7823
  * This function can't be called in read-only mode.
7504
7824
  *
7505
7825
  * @throws This function can throw errors.
@@ -7516,12 +7836,16 @@ export class IPlayerJoinAfterEventSignal {
7516
7836
  private constructor();
7517
7837
  /**
7518
7838
  * @remarks
7839
+ * Subscribes to the event.
7840
+ *
7519
7841
  * This function can't be called in read-only mode.
7520
7842
  *
7521
7843
  */
7522
7844
  subscribe(callback: (arg: PlayerJoinAfterEvent) => void): (arg: PlayerJoinAfterEvent) => void;
7523
7845
  /**
7524
7846
  * @remarks
7847
+ * Unsubscribes from the event.
7848
+ *
7525
7849
  * This function can't be called in read-only mode.
7526
7850
  *
7527
7851
  * @throws This function can throw errors.
@@ -7538,12 +7862,16 @@ export class IPlayerLeaveAfterEventSignal {
7538
7862
  private constructor();
7539
7863
  /**
7540
7864
  * @remarks
7865
+ * Subscribes to the event.
7866
+ *
7541
7867
  * This function can't be called in read-only mode.
7542
7868
  *
7543
7869
  */
7544
7870
  subscribe(callback: (arg: PlayerLeaveAfterEvent) => void): (arg: PlayerLeaveAfterEvent) => void;
7545
7871
  /**
7546
7872
  * @remarks
7873
+ * Unsubscribes from the event.
7874
+ *
7547
7875
  * This function can't be called in read-only mode.
7548
7876
  *
7549
7877
  * @throws This function can throw errors.
@@ -7560,12 +7888,16 @@ export class IPlayerSpawnAfterEventSignal {
7560
7888
  private constructor();
7561
7889
  /**
7562
7890
  * @remarks
7891
+ * Subscribes to the event.
7892
+ *
7563
7893
  * This function can't be called in read-only mode.
7564
7894
  *
7565
7895
  */
7566
7896
  subscribe(callback: (arg: PlayerSpawnAfterEvent) => void): (arg: PlayerSpawnAfterEvent) => void;
7567
7897
  /**
7568
7898
  * @remarks
7899
+ * Unsubscribes from the event.
7900
+ *
7569
7901
  * This function can't be called in read-only mode.
7570
7902
  *
7571
7903
  * @throws This function can throw errors.
@@ -8095,15 +8427,18 @@ export class ItemStack {
8095
8427
  * for an item stack.
8096
8428
  *
8097
8429
  * @param componentId
8098
- * The identifier of the component (e.g., 'minecraft:food') to
8099
- * retrieve. If no namespace prefix is specified, 'minecraft:'
8100
- * is assumed. If the component is not present on the item
8101
- * stack or doesn't exist, undefined is returned.
8430
+ * The identifier of the component (e.g., 'minecraft:food'). If
8431
+ * no namespace prefix is specified, 'minecraft:' is assumed.
8432
+ * Available component IDs can be found as part of the {@link
8433
+ * @minecraft/server.ItemComponentTypes} enum.
8434
+ * @returns
8435
+ * Returns the component if it exists on the item stack,
8436
+ * otherwise undefined.
8102
8437
  * @example durability.ts
8103
8438
  * ```typescript
8104
8439
  * // Get the maximum durability of a custom sword item
8105
- * const itemStack = new ItemStack("custom:sword");
8106
- * const durability = itemStack.getComponent("minecraft:durability") as ItemDurabilityComponent;
8440
+ * const itemStack = new ItemStack('custom:sword');
8441
+ * const durability = itemStack.getComponent(ItemComponentTypes.Durability);
8107
8442
  * const maxDurability = durability.maxDurability;
8108
8443
  * ```
8109
8444
  */
@@ -8549,8 +8884,9 @@ export class ItemTypes {
8549
8884
 
8550
8885
  /**
8551
8886
  * @beta
8552
- * Contains information related to an item being used. This
8553
- * event fires when an item is successfully used by a player.
8887
+ * Contains information related to an item being used on a
8888
+ * block. This event fires when an item used by a player
8889
+ * successfully triggers an entity interaction.
8554
8890
  */
8555
8891
  export class ItemUseAfterEvent {
8556
8892
  private constructor();
@@ -8636,8 +8972,8 @@ export class ItemUseBeforeEventSignal {
8636
8972
  /**
8637
8973
  * @beta
8638
8974
  * Contains information related to an item being used on a
8639
- * block. This event fires when an item is successfully used on
8640
- * a block by a player.
8975
+ * block. This event fires when an item used by a player
8976
+ * successfully triggers a block interaction.
8641
8977
  */
8642
8978
  export class ItemUseOnAfterEvent {
8643
8979
  private constructor();
@@ -9698,40 +10034,6 @@ export class PlayerDimensionChangeAfterEventSignal {
9698
10034
  unsubscribe(callback: (arg: PlayerDimensionChangeAfterEvent) => void): void;
9699
10035
  }
9700
10036
 
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
10037
  /**
9736
10038
  * @beta
9737
10039
  * Contains information regarding an event after a player
@@ -10061,6 +10363,34 @@ export class PlayerLeaveAfterEventSignal extends IPlayerLeaveAfterEventSignal {
10061
10363
  private constructor();
10062
10364
  }
10063
10365
 
10366
+ /**
10367
+ * @beta
10368
+ */
10369
+ export class PlayerLeaveBeforeEvent {
10370
+ private constructor();
10371
+ readonly player: Player;
10372
+ }
10373
+
10374
+ /**
10375
+ * @beta
10376
+ */
10377
+ export class PlayerLeaveBeforeEventSignal {
10378
+ private constructor();
10379
+ /**
10380
+ * @remarks
10381
+ * This function can't be called in read-only mode.
10382
+ *
10383
+ */
10384
+ subscribe(callback: (arg: PlayerLeaveBeforeEvent) => void): (arg: PlayerLeaveBeforeEvent) => void;
10385
+ /**
10386
+ * @remarks
10387
+ * This function can't be called in read-only mode.
10388
+ *
10389
+ * @throws This function can throw errors.
10390
+ */
10391
+ unsubscribe(callback: (arg: PlayerLeaveBeforeEvent) => void): void;
10392
+ }
10393
+
10064
10394
  /**
10065
10395
  * @beta
10066
10396
  * Contains information regarding an event where a player
@@ -12379,19 +12709,16 @@ export class WorldBeforeEvents {
12379
12709
  readonly playerBreakBlock: PlayerBreakBlockBeforeEventSignal;
12380
12710
  /**
12381
12711
  * @beta
12382
- * @remarks
12383
- * Fires before a player is about to change dimensions.
12384
- *
12385
12712
  */
12386
- readonly playerDimensionChange: PlayerDimensionChangeBeforeEventSignal;
12713
+ readonly playerInteractWithBlock: PlayerInteractWithBlockBeforeEventSignal;
12387
12714
  /**
12388
12715
  * @beta
12389
12716
  */
12390
- readonly playerInteractWithBlock: PlayerInteractWithBlockBeforeEventSignal;
12717
+ readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
12391
12718
  /**
12392
12719
  * @beta
12393
12720
  */
12394
- readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
12721
+ readonly playerLeave: PlayerLeaveBeforeEventSignal;
12395
12722
  /**
12396
12723
  * @beta
12397
12724
  * @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.24",
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.24"
17
+ },
15
18
  "license": "MIT"
16
19
  }