@minecraft/server 2.6.0-beta.1.26.0-preview.25 → 2.6.0-beta.1.26.0-preview.27

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 +163 -0
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -3299,6 +3299,8 @@ export class AimAssistCategory {
3299
3299
  * The record mapping block tags to their priority settings.
3300
3300
  * Larger numbers have greater priority.
3301
3301
  * @throws This function can throw errors.
3302
+ *
3303
+ * {@link minecraftcommon.EngineError}
3302
3304
  */
3303
3305
  getBlockTagPriorities(): Record<string, number>;
3304
3306
  /**
@@ -3311,6 +3313,18 @@ export class AimAssistCategory {
3311
3313
  * @throws This function can throw errors.
3312
3314
  */
3313
3315
  getEntityPriorities(): Record<string, number>;
3316
+ /**
3317
+ * @remarks
3318
+ * Gets the priority settings used for entity targeting.
3319
+ *
3320
+ * @returns
3321
+ * Map entity type families to their priority settings in a
3322
+ * Record. Larger numbers have greater priority.
3323
+ * @throws This function can throw errors.
3324
+ *
3325
+ * {@link minecraftcommon.EngineError}
3326
+ */
3327
+ getEntityTypeFamilyPriorities(): Record<string, number>;
3314
3328
  }
3315
3329
 
3316
3330
  /**
@@ -3378,6 +3392,15 @@ export class AimAssistCategorySettings {
3378
3392
  * Larger numbers have greater priority.
3379
3393
  */
3380
3394
  getEntityPriorities(): Record<string, number>;
3395
+ /**
3396
+ * @remarks
3397
+ * Gets the priority settings used for entity targeting.
3398
+ *
3399
+ * @returns
3400
+ * Map entity type families to their priority settings in a
3401
+ * Record. Larger numbers have greater priority.
3402
+ */
3403
+ getEntityTypeFamilyPriorities(): Record<string, number>;
3381
3404
  /**
3382
3405
  * @remarks
3383
3406
  * Sets the priority settings used for block targeting.
@@ -3412,6 +3435,14 @@ export class AimAssistCategorySettings {
3412
3435
  setEntityPriorities(
3413
3436
  entityPriorities: Record<keyof typeof minecraftvanilladata.MinecraftEntityTypes | string, number>,
3414
3437
  ): void;
3438
+ /**
3439
+ * @remarks
3440
+ * Sets the priority settings used for entity targeting.
3441
+ *
3442
+ * This function can't be called in restricted-execution mode.
3443
+ *
3444
+ */
3445
+ setEntityTypeFamilyPriorities(entityTypeFamilyPriorities: Record<string, number>): void;
3415
3446
  }
3416
3447
 
3417
3448
  /**
@@ -3450,6 +3481,8 @@ export class AimAssistPreset {
3450
3481
  * @returns
3451
3482
  * The array of block tags.
3452
3483
  * @throws This function can throw errors.
3484
+ *
3485
+ * {@link minecraftcommon.EngineError}
3453
3486
  */
3454
3487
  getExcludedBlockTagTargets(): string[];
3455
3488
  /**
@@ -3472,6 +3505,18 @@ export class AimAssistPreset {
3472
3505
  * @throws This function can throw errors.
3473
3506
  */
3474
3507
  getExcludedEntityTargets(): string[];
3508
+ /**
3509
+ * @remarks
3510
+ * Gets the list of entity type families to exclude from aim
3511
+ * assist targeting.
3512
+ *
3513
+ * @returns
3514
+ * The array of entity type families.
3515
+ * @throws This function can throw errors.
3516
+ *
3517
+ * {@link minecraftcommon.EngineError}
3518
+ */
3519
+ getExcludedEntityTypeFamilyTargets(): string[];
3475
3520
  /**
3476
3521
  * @remarks
3477
3522
  * Gets the per-item aim-assist category Ids.
@@ -3557,6 +3602,15 @@ export class AimAssistPresetSettings {
3557
3602
  * The array of entity Ids.
3558
3603
  */
3559
3604
  getExcludedEntityTargets(): string[] | undefined;
3605
+ /**
3606
+ * @remarks
3607
+ * Gets the list of entity type families to exclude from aim
3608
+ * assist targeting.
3609
+ *
3610
+ * @returns
3611
+ * The array of entity type families.
3612
+ */
3613
+ getExcludedEntityTypeFamilyTargets(): string[] | undefined;
3560
3614
  /**
3561
3615
  * @remarks
3562
3616
  * Gets the per-item aim-assist category Ids.
@@ -3607,6 +3661,17 @@ export class AimAssistPresetSettings {
3607
3661
  * An array of entity Ids.
3608
3662
  */
3609
3663
  setExcludedEntityTargets(targets?: (keyof typeof minecraftvanilladata.MinecraftEntityTypes | string)[]): void;
3664
+ /**
3665
+ * @remarks
3666
+ * Sets the list of entity type families to exclude from aim
3667
+ * assist targeting.
3668
+ *
3669
+ * This function can't be called in restricted-execution mode.
3670
+ *
3671
+ * @param targets
3672
+ * An array of entity type families.
3673
+ */
3674
+ setExcludedEntityTypeFamilyTargets(targets?: string[]): void;
3610
3675
  /**
3611
3676
  * @remarks
3612
3677
  * Sets the per-item aim-assist category Ids.
@@ -4792,6 +4857,16 @@ export class BlockComponentRedstoneUpdateEvent extends BlockEvent {
4792
4857
  *
4793
4858
  */
4794
4859
  readonly powerLevel: number;
4860
+ /**
4861
+ * @beta
4862
+ * @remarks
4863
+ * The redstone signal strength from the last tick that was
4864
+ * passing through this block. It is guaranteed to be >= the
4865
+ * `min_power` of the block's 'minecraft:redstone_consumer'
4866
+ * component.
4867
+ *
4868
+ */
4869
+ readonly previousPowerLevel: number;
4795
4870
  }
4796
4871
 
4797
4872
  export class BlockComponentRegistry {
@@ -11555,6 +11630,61 @@ export class EntityItemComponent extends EntityComponent {
11555
11630
  static readonly componentId = 'minecraft:item';
11556
11631
  }
11557
11632
 
11633
+ /**
11634
+ * @beta
11635
+ * Contains information related to an entity having dropped
11636
+ * items.
11637
+ */
11638
+ export class EntityItemDropAfterEvent {
11639
+ private constructor();
11640
+ /**
11641
+ * @remarks
11642
+ * The entity that has dropped the items.
11643
+ *
11644
+ */
11645
+ readonly entity: Entity;
11646
+ /**
11647
+ * @remarks
11648
+ * The list of items the entity has dropped.
11649
+ *
11650
+ */
11651
+ readonly items: Entity[];
11652
+ }
11653
+
11654
+ /**
11655
+ * @beta
11656
+ * Manages callbacks that are connected to when an entity has
11657
+ * dropped items.
11658
+ */
11659
+ export class EntityItemDropAfterEventSignal {
11660
+ private constructor();
11661
+ /**
11662
+ * @remarks
11663
+ * Adds a callback that will be called when an entity has
11664
+ * dropped items.
11665
+ *
11666
+ * This function can't be called in restricted-execution mode.
11667
+ *
11668
+ * This function can be called in early-execution mode.
11669
+ *
11670
+ */
11671
+ subscribe(
11672
+ callback: (arg0: EntityItemDropAfterEvent) => void,
11673
+ options?: EntityItemDropEventOptions,
11674
+ ): (arg0: EntityItemDropAfterEvent) => void;
11675
+ /**
11676
+ * @remarks
11677
+ * Removes a callback from being called when an entity has
11678
+ * dropped items.
11679
+ *
11680
+ * This function can't be called in restricted-execution mode.
11681
+ *
11682
+ * This function can be called in early-execution mode.
11683
+ *
11684
+ */
11685
+ unsubscribe(callback: (arg0: EntityItemDropAfterEvent) => void): void;
11686
+ }
11687
+
11558
11688
  /**
11559
11689
  * @beta
11560
11690
  * Contains information related to an entity having picked up
@@ -22052,6 +22182,15 @@ export class WorldAfterEvents {
22052
22182
  *
22053
22183
  */
22054
22184
  readonly entityHurt: EntityHurtAfterEventSignal;
22185
+ /**
22186
+ * @beta
22187
+ * @remarks
22188
+ * This event fires when an entity drops items.
22189
+ *
22190
+ * This property can be read in early-execution mode.
22191
+ *
22192
+ */
22193
+ readonly entityItemDrop: EntityItemDropAfterEventSignal;
22055
22194
  /**
22056
22195
  * @beta
22057
22196
  * @remarks
@@ -23692,6 +23831,30 @@ export interface EntityHurtBeforeEventOptions {
23692
23831
  entityFilter?: EntityFilter;
23693
23832
  }
23694
23833
 
23834
+ /**
23835
+ * @beta
23836
+ * An interface that is passed into {@link
23837
+ * @minecraft/Server.EntityItemDropAfterEventSignal.subscribe}
23838
+ * that filters out which events are passed to the provided
23839
+ * callback.
23840
+ */
23841
+ export interface EntityItemDropEventOptions {
23842
+ /**
23843
+ * @remarks
23844
+ * If this value is set, this event will only fire for entities
23845
+ * that match.
23846
+ *
23847
+ */
23848
+ entityFilter?: EntityFilter;
23849
+ /**
23850
+ * @remarks
23851
+ * If this value is set, this event will only fire if an item
23852
+ * in the event matches.
23853
+ *
23854
+ */
23855
+ itemFilter?: ItemFilter;
23856
+ }
23857
+
23695
23858
  /**
23696
23859
  * @beta
23697
23860
  * An interface that is passed into {@link
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "2.6.0-beta.1.26.0-preview.25",
3
+ "version": "2.6.0-beta.1.26.0-preview.27",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "peerDependencies": {
16
16
  "@minecraft/common": "^1.2.0",
17
- "@minecraft/vanilla-data": ">=1.20.70 || 1.26.0-preview.25"
17
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.26.0-preview.27"
18
18
  },
19
19
  "license": "MIT"
20
20
  }