@minecraft/server 1.8.0-beta.1.20.50-preview.20 → 1.8.0-beta.1.20.50-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 +100 -36
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * ```json
17
17
  * {
18
18
  * "module_name": "@minecraft/server",
19
- * "version": "1.8.0-internal.1.20.50-preview.20"
19
+ * "version": "1.8.0-internal.1.20.50-preview.22"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -416,6 +416,7 @@ export enum EntityComponentTypes {
416
416
  NavigationGeneric = 'minecraft:navigation.generic',
417
417
  NavigationHover = 'minecraft:navigation.hover',
418
418
  NavigationWalk = 'minecraft:navigation.walk',
419
+ Npc = 'minecraft:npc',
419
420
  OnFire = 'minecraft:onfire',
420
421
  PushThrough = 'minecraft:push_through',
421
422
  Rideable = 'minecraft:rideable',
@@ -1280,6 +1281,7 @@ export type EntityComponentTypeMap = {
1280
1281
  'minecraft:navigation.generic': EntityNavigationGenericComponent;
1281
1282
  'minecraft:navigation.hover': EntityNavigationHoverComponent;
1282
1283
  'minecraft:navigation.walk': EntityNavigationWalkComponent;
1284
+ 'minecraft:npc': EntityNpcComponent;
1283
1285
  'minecraft:onfire': EntityOnFireComponent;
1284
1286
  'minecraft:push_through': EntityPushThroughComponent;
1285
1287
  'minecraft:rideable': EntityRideableComponent;
@@ -1308,6 +1310,7 @@ export type EntityComponentTypeMap = {
1308
1310
  'navigation.generic': EntityNavigationGenericComponent;
1309
1311
  'navigation.hover': EntityNavigationHoverComponent;
1310
1312
  'navigation.walk': EntityNavigationWalkComponent;
1313
+ npc: EntityNpcComponent;
1311
1314
  onfire: EntityOnFireComponent;
1312
1315
  push_through: EntityPushThroughComponent;
1313
1316
  rideable: EntityRideableComponent;
@@ -3923,7 +3926,7 @@ export class Dimension {
3923
3926
  *
3924
3927
  * @throws This property can throw when used.
3925
3928
  */
3926
- readonly heightRange: NumberRange;
3929
+ readonly heightRange: minecraftcommon.NumberRange;
3927
3930
  /**
3928
3931
  * @remarks
3929
3932
  * Identifier of the dimension.
@@ -4941,11 +4944,12 @@ export class Entity {
4941
4944
  * @beta
4942
4945
  * @remarks
4943
4946
  * Retrieves or sets an entity that is used as the target of
4944
- * AI-related behaviors, like attacking.
4947
+ * AI-related behaviors, like attacking. If the entity
4948
+ * currently has no target returns undefined.
4945
4949
  *
4946
4950
  * @throws This property can throw when used.
4947
4951
  */
4948
- readonly target: Entity;
4952
+ readonly target?: Entity;
4949
4953
  /**
4950
4954
  * @remarks
4951
4955
  * Identifier of the type of the entity - for example,
@@ -5356,10 +5360,8 @@ export class Entity {
5356
5360
  /**
5357
5361
  * @beta
5358
5362
  * @remarks
5359
- * Returns all tags associated with an entity.
5360
- *
5361
5363
  * @returns
5362
- * Returns the current rotation component of this entity.
5364
+ * Returns all tags associated with an entity.
5363
5365
  * @throws This function can throw errors.
5364
5366
  */
5365
5367
  getTags(): string[];
@@ -5465,6 +5467,14 @@ export class Entity {
5465
5467
  kill(): boolean;
5466
5468
  /**
5467
5469
  * @beta
5470
+ * @remarks
5471
+ * Matches the entity against the passed in options. Uses the
5472
+ * location of the entity for matching if the location is not
5473
+ * specified in the passed in EntityQueryOptions.
5474
+ *
5475
+ * @returns
5476
+ * Returns true if the entity matches the criteria in the
5477
+ * passed in EntityQueryOptions, otherwise it returns false.
5468
5478
  * @throws This function can throw errors.
5469
5479
  */
5470
5480
  matches(options: EntityQueryOptions): boolean;
@@ -6084,10 +6094,11 @@ export class EntityComponent extends Component {
6084
6094
  /**
6085
6095
  * @beta
6086
6096
  * @remarks
6087
- * The entity that owns this component.
6097
+ * The entity that owns this component. The entity will be
6098
+ * undefined if it has been removed.
6088
6099
  *
6089
6100
  */
6090
- readonly entity: Entity;
6101
+ readonly entity?: Entity;
6091
6102
  }
6092
6103
 
6093
6104
  /**
@@ -6603,11 +6614,12 @@ export class EntityInventoryComponent extends EntityComponent {
6603
6614
  readonly canBeSiphonedFrom: boolean;
6604
6615
  /**
6605
6616
  * @remarks
6606
- * Defines the container for this entity.
6617
+ * Defines the container for this entity. The container will be
6618
+ * undefined if the entity has been removed.
6607
6619
  *
6608
6620
  * @throws This property can throw when used.
6609
6621
  */
6610
- readonly container: Container;
6622
+ readonly container?: Container;
6611
6623
  /**
6612
6624
  * @remarks
6613
6625
  * Type of container this entity has.
@@ -7330,6 +7342,42 @@ export class EntityNavigationWalkComponent extends EntityNavigationComponent {
7330
7342
  static readonly componentId = 'minecraft:navigation.walk';
7331
7343
  }
7332
7344
 
7345
+ /**
7346
+ * @beta
7347
+ * Adds NPC capabilities to an entity such as custom skin,
7348
+ * name, and dialogue interactions.
7349
+ */
7350
+ // @ts-ignore Class inheritance allowed for native defined classes
7351
+ export class EntityNpcComponent extends EntityComponent {
7352
+ private constructor();
7353
+ /**
7354
+ * @remarks
7355
+ * The DialogueScene that is opened when players first interact
7356
+ * with the NPC.
7357
+ *
7358
+ * This property can't be edited in read-only mode.
7359
+ *
7360
+ */
7361
+ defaultScene: string;
7362
+ /**
7363
+ * @remarks
7364
+ * The name of the NPC as it is displayed to players.
7365
+ *
7366
+ * This property can't be edited in read-only mode.
7367
+ *
7368
+ */
7369
+ name: string;
7370
+ /**
7371
+ * @remarks
7372
+ * The index of the skin the NPC will use.
7373
+ *
7374
+ * This property can't be edited in read-only mode.
7375
+ *
7376
+ */
7377
+ skinIndex: number;
7378
+ static readonly componentId = 'minecraft:npc';
7379
+ }
7380
+
7333
7381
  /**
7334
7382
  * @beta
7335
7383
  * When present on an entity, this entity is on fire.
@@ -8471,7 +8519,7 @@ export class ItemDurabilityComponent extends ItemComponent {
8471
8519
  *
8472
8520
  * @throws This function can throw errors.
8473
8521
  */
8474
- getDamageRange(): NumberRange;
8522
+ getDamageRange(): minecraftcommon.NumberRange;
8475
8523
  }
8476
8524
 
8477
8525
  /**
@@ -8998,10 +9046,12 @@ export class ItemStartUseOnAfterEvent {
8998
9046
  readonly blockFace: Direction;
8999
9047
  /**
9000
9048
  * @remarks
9001
- * The impacted item stack that is starting to be used.
9049
+ * The impacted item stack that is starting to be used. Can be
9050
+ * undefined in some gameplay scenarios like pushing a button
9051
+ * with an empty hand.
9002
9052
  *
9003
9053
  */
9004
- readonly itemStack: ItemStack;
9054
+ readonly itemStack?: ItemStack;
9005
9055
  /**
9006
9056
  * @remarks
9007
9057
  * Returns the source entity that triggered this item event.
@@ -9049,9 +9099,11 @@ export class ItemStopUseAfterEvent {
9049
9099
  /**
9050
9100
  * @remarks
9051
9101
  * The impacted item stack that is stopping being charged.
9102
+ * ItemStopUseAfterEvent can be called when teleporting to a
9103
+ * different dimension and this can be undefined.
9052
9104
  *
9053
9105
  */
9054
- readonly itemStack: ItemStack;
9106
+ readonly itemStack?: ItemStack;
9055
9107
  /**
9056
9108
  * @remarks
9057
9109
  * Returns the source entity that triggered this item event.
@@ -10387,11 +10439,16 @@ export class PlayerInteractWithBlockAfterEvent {
10387
10439
 
10388
10440
  /**
10389
10441
  * @beta
10442
+ * Manages callbacks that are connected to after a player
10443
+ * interacts with a block.
10390
10444
  */
10391
10445
  export class PlayerInteractWithBlockAfterEventSignal {
10392
10446
  private constructor();
10393
10447
  /**
10394
10448
  * @remarks
10449
+ * Adds a callback that will be called after a player interacts
10450
+ * with a block.
10451
+ *
10395
10452
  * This function can't be called in read-only mode.
10396
10453
  *
10397
10454
  */
@@ -10400,6 +10457,9 @@ export class PlayerInteractWithBlockAfterEventSignal {
10400
10457
  ): (arg: PlayerInteractWithBlockAfterEvent) => void;
10401
10458
  /**
10402
10459
  * @remarks
10460
+ * Removes a callback from being called after a player
10461
+ * interacts with a block.
10462
+ *
10403
10463
  * This function can't be called in read-only mode.
10404
10464
  *
10405
10465
  * @throws This function can throw errors.
@@ -10456,11 +10516,16 @@ export class PlayerInteractWithBlockBeforeEvent {
10456
10516
 
10457
10517
  /**
10458
10518
  * @beta
10519
+ * Manages callbacks that are connected to before a player
10520
+ * interacts with a block.
10459
10521
  */
10460
10522
  export class PlayerInteractWithBlockBeforeEventSignal {
10461
10523
  private constructor();
10462
10524
  /**
10463
10525
  * @remarks
10526
+ * Adds a callback that will be called before a player
10527
+ * interacts with a block.
10528
+ *
10464
10529
  * This function can't be called in read-only mode.
10465
10530
  *
10466
10531
  */
@@ -10469,6 +10534,9 @@ export class PlayerInteractWithBlockBeforeEventSignal {
10469
10534
  ): (arg: PlayerInteractWithBlockBeforeEvent) => void;
10470
10535
  /**
10471
10536
  * @remarks
10537
+ * Removes a callback from being called before a player
10538
+ * interacts with a block.
10539
+ *
10472
10540
  * This function can't be called in read-only mode.
10473
10541
  *
10474
10542
  * @throws This function can throw errors.
@@ -10506,11 +10574,16 @@ export class PlayerInteractWithEntityAfterEvent {
10506
10574
 
10507
10575
  /**
10508
10576
  * @beta
10577
+ * Manages callbacks that are connected to after a player
10578
+ * interacts with an entity.
10509
10579
  */
10510
10580
  export class PlayerInteractWithEntityAfterEventSignal {
10511
10581
  private constructor();
10512
10582
  /**
10513
10583
  * @remarks
10584
+ * Adds a callback that will be called after a player interacts
10585
+ * with an entity.
10586
+ *
10514
10587
  * This function can't be called in read-only mode.
10515
10588
  *
10516
10589
  */
@@ -10519,6 +10592,9 @@ export class PlayerInteractWithEntityAfterEventSignal {
10519
10592
  ): (arg: PlayerInteractWithEntityAfterEvent) => void;
10520
10593
  /**
10521
10594
  * @remarks
10595
+ * Removes a callback from being called after a player
10596
+ * interacts with an entity.
10597
+ *
10522
10598
  * This function can't be called in read-only mode.
10523
10599
  *
10524
10600
  * @throws This function can throw errors.
@@ -10562,11 +10638,16 @@ export class PlayerInteractWithEntityBeforeEvent {
10562
10638
 
10563
10639
  /**
10564
10640
  * @beta
10641
+ * Manages callbacks that are connected to before a player
10642
+ * interacts with an entity.
10565
10643
  */
10566
10644
  export class PlayerInteractWithEntityBeforeEventSignal {
10567
10645
  private constructor();
10568
10646
  /**
10569
10647
  * @remarks
10648
+ * Adds a callback that will be called before a player
10649
+ * interacts with an entity.
10650
+ *
10570
10651
  * This function can't be called in read-only mode.
10571
10652
  *
10572
10653
  */
@@ -10575,6 +10656,9 @@ export class PlayerInteractWithEntityBeforeEventSignal {
10575
10656
  ): (arg: PlayerInteractWithEntityBeforeEvent) => void;
10576
10657
  /**
10577
10658
  * @remarks
10659
+ * Removes a callback from being called before a player
10660
+ * interacts with an entity.
10661
+ *
10578
10662
  * This function can't be called in read-only mode.
10579
10663
  *
10580
10664
  * @throws This function can throw errors.
@@ -13603,7 +13687,7 @@ export interface EntityHitInformation {
13603
13687
  * Entity that was hit.
13604
13688
  *
13605
13689
  */
13606
- entity: Entity;
13690
+ entity?: Entity;
13607
13691
  }
13608
13692
 
13609
13693
  /**
@@ -13904,26 +13988,6 @@ export interface MusicOptions {
13904
13988
  volume?: number;
13905
13989
  }
13906
13990
 
13907
- /**
13908
- * @beta
13909
- * Represents a min/max structure for expressing a potential
13910
- * range of numbers.
13911
- */
13912
- export interface NumberRange {
13913
- /**
13914
- * @remarks
13915
- * Maximum value within a range.
13916
- *
13917
- */
13918
- max: number;
13919
- /**
13920
- * @remarks
13921
- * Minimum value within a range.
13922
- *
13923
- */
13924
- min: number;
13925
- }
13926
-
13927
13991
  /**
13928
13992
  * @beta
13929
13993
  * Contains additional options for how an animation is played.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.8.0-beta.1.20.50-preview.20",
3
+ "version": "1.8.0-beta.1.20.50-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/common": "^1.0.0-rc.1.20.50-preview.20"
16
+ "@minecraft/common": "^1.1.0-rc.1.20.50-preview.22"
17
17
  },
18
18
  "license": "MIT"
19
19
  }