@minecraft/server 2.12.0-rc.1.26.70-preview.20 → 2.12.0-rc.1.26.70-preview.21

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 +443 -8
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -2105,6 +2105,13 @@ export enum InputMode {
2105
2105
  *
2106
2106
  */
2107
2107
  Gamepad = 'Gamepad',
2108
+ /**
2109
+ * @rc
2110
+ * @remarks
2111
+ * Gamepad and mouse input.
2112
+ *
2113
+ */
2114
+ GamepadAndMouse = 'GamepadAndMouse',
2108
2115
  /**
2109
2116
  * @remarks
2110
2117
  * Keyboard and mouse input.
@@ -2214,7 +2221,7 @@ export enum InputPermissionCategory {
2214
2221
  * function ItemStack.getComponent.
2215
2222
  */
2216
2223
  export enum ItemComponentTypes {
2217
- BlockDynamicProperties = 'minecraft:block_actor_dynamic_properties',
2224
+ BlockDynamicProperties = 'minecraft:block_dynamic_properties',
2218
2225
  /**
2219
2226
  * @remarks
2220
2227
  * The minecraft:book component.
@@ -2686,6 +2693,34 @@ export enum PlayerSplitScreenSlot {
2686
2693
  Third = 'Third',
2687
2694
  }
2688
2695
 
2696
+ /**
2697
+ * @rc
2698
+ * Specifies how a block point-of-interest query filters
2699
+ * instances by ticket occupancy.
2700
+ */
2701
+ export enum PoiBlockOccupancyFilter {
2702
+ /**
2703
+ * @remarks
2704
+ * Includes POI instances regardless of their occupancy or
2705
+ * available ticket count.
2706
+ *
2707
+ */
2708
+ Any = 'Any',
2709
+ /**
2710
+ * @remarks
2711
+ * Includes POI instances with no available tickets.
2712
+ *
2713
+ */
2714
+ Full = 'Full',
2715
+ /**
2716
+ * @remarks
2717
+ * Includes POI instances with at least one ticket available to
2718
+ * be claimed.
2719
+ *
2720
+ */
2721
+ HasVacancy = 'HasVacancy',
2722
+ }
2723
+
2689
2724
  /**
2690
2725
  * Contains objectives and participants for the scoreboard.
2691
2726
  */
@@ -3254,7 +3289,7 @@ export type ItemComponentReturnType<T extends string> = T extends keyof ItemComp
3254
3289
  : ItemCustomComponentInstance;
3255
3290
 
3256
3291
  export type ItemComponentTypeMap = {
3257
- block_actor_dynamic_properties: ItemBlockDynamicPropertiesComponent;
3292
+ block_dynamic_properties: ItemBlockDynamicPropertiesComponent;
3258
3293
  book: ItemBookComponent;
3259
3294
  compostable: ItemCompostableComponent;
3260
3295
  cooldown: ItemCooldownComponent;
@@ -3263,7 +3298,7 @@ export type ItemComponentTypeMap = {
3263
3298
  enchantable: ItemEnchantableComponent;
3264
3299
  food: ItemFoodComponent;
3265
3300
  inventory: ItemInventoryComponent;
3266
- 'minecraft:block_actor_dynamic_properties': ItemBlockDynamicPropertiesComponent;
3301
+ 'minecraft:block_dynamic_properties': ItemBlockDynamicPropertiesComponent;
3267
3302
  'minecraft:book': ItemBookComponent;
3268
3303
  'minecraft:compostable': ItemCompostableComponent;
3269
3304
  'minecraft:cooldown': ItemCooldownComponent;
@@ -7544,6 +7579,15 @@ export class Dimension {
7544
7579
  *
7545
7580
  */
7546
7581
  readonly localizationKey: string;
7582
+ /**
7583
+ * @rc
7584
+ * @remarks
7585
+ * Provides access to point-of-interest (POI) managers for this
7586
+ * dimension. This property is available only when the POI
7587
+ * experiment is enabled.
7588
+ *
7589
+ */
7590
+ readonly poiManager: PoiManager;
7547
7591
  /**
7548
7592
  * @remarks
7549
7593
  * Calculates the location of the closest biome of a particular
@@ -7817,7 +7861,7 @@ export class Dimension {
7817
7861
  * The options to decide if a block is a valid result.
7818
7862
  * @throws This function can throw errors.
7819
7863
  */
7820
- getBlockAbove(location: Vector3, options?: BlockRaycastOptions): Block | undefined;
7864
+ getBlockAbove(location: Vector3, options?: BlockSearchOptions): Block | undefined;
7821
7865
  /**
7822
7866
  * @remarks
7823
7867
  * Gets the first block found below a given block location
@@ -7830,7 +7874,7 @@ export class Dimension {
7830
7874
  * The options to decide if a block is a valid result.
7831
7875
  * @throws This function can throw errors.
7832
7876
  */
7833
- getBlockBelow(location: Vector3, options?: BlockRaycastOptions): Block | undefined;
7877
+ getBlockBelow(location: Vector3, options?: BlockSearchOptions): Block | undefined;
7834
7878
  /**
7835
7879
  * @remarks
7836
7880
  * Gets the first block that intersects with a vector emanating
@@ -14178,7 +14222,7 @@ export class ISerializable {
14178
14222
  // @ts-ignore Class inheritance allowed for native defined classes
14179
14223
  export class ItemBlockDynamicPropertiesComponent extends ItemComponent {
14180
14224
  private constructor();
14181
- static readonly componentId = 'minecraft:block_actor_dynamic_properties';
14225
+ static readonly componentId = 'minecraft:block_dynamic_properties';
14182
14226
  /**
14183
14227
  * @remarks
14184
14228
  * Returns a DynamicProperty that was stored with the provided
@@ -19310,6 +19354,299 @@ export class PlayerWaypoint extends EntityWaypoint {
19310
19354
  );
19311
19355
  }
19312
19356
 
19357
+ /**
19358
+ * @rc
19359
+ * Describes a block point-of-interest instance returned by a
19360
+ * query.
19361
+ */
19362
+ export class PoiBlockInstance {
19363
+ private constructor();
19364
+ /**
19365
+ * @remarks
19366
+ * Block position of this POI instance.
19367
+ *
19368
+ */
19369
+ readonly position: Vector3;
19370
+ /**
19371
+ * @remarks
19372
+ * Number of tickets currently available to be claimed from
19373
+ * this POI instance.
19374
+ *
19375
+ */
19376
+ readonly tickets: number;
19377
+ /**
19378
+ * @remarks
19379
+ * Type of this POI instance.
19380
+ *
19381
+ */
19382
+ readonly 'type': PoiBlockType;
19383
+ }
19384
+
19385
+ /**
19386
+ * @rc
19387
+ * Provides methods for querying and managing block-based
19388
+ * points of interest in a dimension.
19389
+ */
19390
+ export class PoiBlockManager {
19391
+ private constructor();
19392
+ /**
19393
+ * @remarks
19394
+ * Adds a block point of interest at a position. This method is
19395
+ * intended for temporary usage. Will be replaced when chunk is
19396
+ * reloaded
19397
+ *
19398
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19399
+ *
19400
+ * @param position
19401
+ * Block position at which to add the POI.
19402
+ * @param poi
19403
+ * POI type to add, specified by numeric type Id, type name, or
19404
+ * POI type object.
19405
+ */
19406
+ addTemporary(position: Vector3, poi: PoiBlockType | string | number): void;
19407
+ /**
19408
+ * @remarks
19409
+ * Gets the type of the block point of interest at a position.
19410
+ *
19411
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19412
+ *
19413
+ * @param position
19414
+ * Block position to inspect.
19415
+ * @returns
19416
+ * The POI type at the position, or undefined if no POI exists
19417
+ * there.
19418
+ */
19419
+ at(position: Vector3): PoiBlockType | undefined;
19420
+ /**
19421
+ * @remarks
19422
+ * Tests whether a block point of interest at a position
19423
+ * matches a type filter.
19424
+ *
19425
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19426
+ *
19427
+ * @param position
19428
+ * Block position to inspect.
19429
+ * @param filter
19430
+ * Filter used to select the POI type. A callback receives the
19431
+ * POI type and returns whether it matches; a name filter
19432
+ * matches a type name; and a tag filter requires all specified
19433
+ * tags.
19434
+ * @returns
19435
+ * True if a POI exists at the position and its type matches
19436
+ * the filter; otherwise false.
19437
+ */
19438
+ exists(position: Vector3, filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter): boolean;
19439
+ /**
19440
+ * @remarks
19441
+ * Returns block points of interest that match the supplied
19442
+ * type and occupancy filters within the specified distance of
19443
+ * a location.
19444
+ *
19445
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19446
+ *
19447
+ * @param filter
19448
+ * Filter used to select POI types. A callback receives each
19449
+ * POI type and returns whether it should be included; a name
19450
+ * filter matches a type name; and a tag filter requires all
19451
+ * specified tags.
19452
+ * @param center
19453
+ * Center of the search.
19454
+ * @param blockRadius
19455
+ * Maximum three-dimensional distance from the center, in
19456
+ * blocks.
19457
+ * @param occupancyFilter
19458
+ * Optional filter applied to the occupancy state of matching
19459
+ * POIs. If omitted, POIs in any occupancy state are returned.
19460
+ * @returns
19461
+ * The matching POI instances within range. The result order is
19462
+ * not guaranteed.
19463
+ */
19464
+ getInRange(
19465
+ filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
19466
+ center: Vector3,
19467
+ blockRadius: number,
19468
+ occupancyFilter?: PoiBlockOccupancyFilter,
19469
+ ): PoiBlockInstance[];
19470
+ /**
19471
+ * @remarks
19472
+ * Returns block points of interest that match the supplied
19473
+ * type and occupancy filters within an axis-aligned square
19474
+ * centered on the specified location, sorted from nearest to
19475
+ * farthest.
19476
+ *
19477
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19478
+ *
19479
+ * @param filter
19480
+ * Filter used to select POI types. A callback receives each
19481
+ * POI type and returns whether it should be included; a name
19482
+ * filter matches a type name; and a tag filter requires all
19483
+ * specified tags.
19484
+ * @param center
19485
+ * Center of the search and the location from which distances
19486
+ * are calculated.
19487
+ * @param blockRadius
19488
+ * Maximum three-dimensional distance from the center, in
19489
+ * blocks.
19490
+ * @param occupancyFilter
19491
+ * Optional filter applied to the occupancy state of matching
19492
+ * POIs. If omitted, POIs in any occupancy state are returned.
19493
+ * @returns
19494
+ * The matching POI instances and their squared distances from
19495
+ * the center, sorted in ascending distance order.
19496
+ */
19497
+ getInRangeSorted(
19498
+ filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
19499
+ center: Vector3,
19500
+ blockRadius: number,
19501
+ occupancyFilter?: PoiBlockOccupancyFilter,
19502
+ ): PoiDistancePair[];
19503
+ /**
19504
+ * @remarks
19505
+ * Returns block points of interest that match the supplied
19506
+ * type and occupancy filters within an axis-aligned square
19507
+ * centered on the specified location.
19508
+ *
19509
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19510
+ *
19511
+ * @param filter
19512
+ * Filter used to select POI types. A callback receives each
19513
+ * POI type and returns whether it should be included; a name
19514
+ * filter matches a type name; and a tag filter requires all
19515
+ * specified tags.
19516
+ * @param center
19517
+ * Center of the search volume.
19518
+ * @param blockRadius
19519
+ * Half-size of the search volume, in blocks, along each axis.
19520
+ * @param occupancyFilter
19521
+ * Optional filter applied to the occupancy state of matching
19522
+ * POIs. If omitted, POIs in any occupancy state are returned.
19523
+ * @returns
19524
+ * The matching POI instances in the search volume.
19525
+ */
19526
+ getInSquare(
19527
+ filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
19528
+ center: Vector3,
19529
+ blockRadius: number,
19530
+ occupancyFilter?: PoiBlockOccupancyFilter,
19531
+ ): PoiBlockInstance[];
19532
+ /**
19533
+ * @remarks
19534
+ * Releases one previously claimed ticket at a block point of
19535
+ * interest.
19536
+ *
19537
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19538
+ *
19539
+ * @param center
19540
+ * Block position of the POI whose ticket should be released.
19541
+ * @returns
19542
+ * True if a ticket was released; false if no POI exists at the
19543
+ * position or the POI has no claimed tickets.
19544
+ */
19545
+ release(center: Vector3): boolean;
19546
+ /**
19547
+ * @remarks
19548
+ * Claims one available ticket from a matching block point of
19549
+ * interest within range.
19550
+ *
19551
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19552
+ *
19553
+ * @param filter
19554
+ * Filter used to select the POI type to claim. A callback
19555
+ * receives each POI type and returns whether it should be
19556
+ * included; a name filter matches a type name; and a tag
19557
+ * filter requires all specified tags.
19558
+ * @param center
19559
+ * Center of the search.
19560
+ * @param blockRadius
19561
+ * Maximum three-dimensional distance from the center, in
19562
+ * blocks.
19563
+ * @returns
19564
+ * The block position of the claimed POI, or undefined if no
19565
+ * matching POI has an available ticket.
19566
+ */
19567
+ take(
19568
+ filter: ((arg0: PoiBlockType) => boolean) | PoiNameFilter | PoiTagFilter,
19569
+ center: Vector3,
19570
+ blockRadius: number,
19571
+ ): Vector3 | undefined;
19572
+ }
19573
+
19574
+ /**
19575
+ * @rc
19576
+ * Describes a block point-of-interest type.
19577
+ */
19578
+ export class PoiBlockType {
19579
+ private constructor();
19580
+ /**
19581
+ * @remarks
19582
+ * Numeric identifier of this POI type.
19583
+ *
19584
+ */
19585
+ readonly id: number;
19586
+ /**
19587
+ * @remarks
19588
+ * Namespaced identifier of this POI type.
19589
+ *
19590
+ */
19591
+ readonly name: string;
19592
+ /**
19593
+ * @remarks
19594
+ * Maximum number of tickets that can be claimed from each POI
19595
+ * instance of this type.
19596
+ *
19597
+ */
19598
+ readonly tickets: number;
19599
+ /**
19600
+ * @remarks
19601
+ * Maximum range, in blocks, at which this POI type is
19602
+ * considered usable.
19603
+ *
19604
+ */
19605
+ readonly usableRange: number;
19606
+ /**
19607
+ * @remarks
19608
+ * Tests whether this object and another object describe the
19609
+ * same POI type.
19610
+ *
19611
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19612
+ *
19613
+ * @param other
19614
+ * POI type to compare with this type.
19615
+ * @returns
19616
+ * True if both objects describe the same POI type; otherwise
19617
+ * false.
19618
+ */
19619
+ equals(other: PoiBlockType): boolean;
19620
+ /**
19621
+ * @remarks
19622
+ * Tests whether the type has the provided tag attribute
19623
+ *
19624
+ * @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
19625
+ *
19626
+ * @param tag
19627
+ * POI tag to check.
19628
+ * @returns
19629
+ * True if the POI conatains the tag; otherwise false.
19630
+ */
19631
+ hasTag(tag: string): boolean;
19632
+ }
19633
+
19634
+ /**
19635
+ * @rc
19636
+ * Provides access to point-of-interest (POI) data in a
19637
+ * dimension.
19638
+ */
19639
+ export class PoiManager {
19640
+ private constructor();
19641
+ /**
19642
+ * @remarks
19643
+ * Provides access to block-based points of interest in the
19644
+ * dimension.
19645
+ *
19646
+ */
19647
+ readonly blocks: PoiBlockManager;
19648
+ }
19649
+
19313
19650
  /**
19314
19651
  * Represents how the potion effect is delivered.
19315
19652
  */
@@ -19530,6 +19867,16 @@ export class PrimitiveShape {
19530
19867
  *
19531
19868
  */
19532
19869
  color: RGBA;
19870
+ /**
19871
+ * @rc
19872
+ * @remarks
19873
+ * Defaults to true. If set to true, we default to being
19874
+ * visible to all players if visibleTo is empty - hiddenFrom
19875
+ * still applies afterwards. If set to false, we default to
19876
+ * hiding the shape from all players if visibleTo is empty.
19877
+ *
19878
+ */
19879
+ defaultVisibleToAll: boolean;
19533
19880
  /**
19534
19881
  * @remarks
19535
19882
  * The dimension the shape is visible within. If the dimension
@@ -19544,6 +19891,15 @@ export class PrimitiveShape {
19544
19891
  *
19545
19892
  */
19546
19893
  readonly hasDuration: boolean;
19894
+ /**
19895
+ * @rc
19896
+ * @remarks
19897
+ * The list of players that this shape will be hidden from. If
19898
+ * a player is listed in both this and visibleTo, this takes
19899
+ * priority (it will be hidden from the player).
19900
+ *
19901
+ */
19902
+ hiddenFrom: Player[];
19547
19903
  /**
19548
19904
  * @remarks
19549
19905
  * The location of the shape.
@@ -24612,7 +24968,35 @@ export interface BlockRaycastOptions extends BlockFilter {
24612
24968
  includePassableBlocks?: boolean;
24613
24969
  /**
24614
24970
  * @remarks
24615
- * Maximum distance, in blocks, to process the raycast.
24971
+ * Maximum raycast distance, in blocks.
24972
+ *
24973
+ * Bounds: [-2147483648, 2147483647]
24974
+ */
24975
+ maxDistance?: number;
24976
+ }
24977
+
24978
+ /**
24979
+ * Options for finding blocks.
24980
+ */
24981
+ // @ts-ignore Class inheritance allowed for native defined classes
24982
+ export interface BlockSearchOptions extends BlockFilter {
24983
+ /**
24984
+ * @remarks
24985
+ * When true, includes liquid blocks.
24986
+ *
24987
+ */
24988
+ includeLiquidBlocks?: boolean;
24989
+ /**
24990
+ * @remarks
24991
+ * When true, includes passable blocks, such as vines and
24992
+ * flowers.
24993
+ *
24994
+ */
24995
+ includePassableBlocks?: boolean;
24996
+ /**
24997
+ * @remarks
24998
+ * Maximum search distance, in blocks. Vertical searches use
24999
+ * whole blocks.
24616
25000
  *
24617
25001
  */
24618
25002
  maxDistance?: number;
@@ -25773,8 +26157,9 @@ export interface EntityRaycastOptions extends EntityFilter {
25773
26157
  includePassableBlocks?: boolean;
25774
26158
  /**
25775
26159
  * @remarks
25776
- * Maximum distance, in blocks, to process the raycast.
26160
+ * Maximum raycast distance, in blocks.
25777
26161
  *
26162
+ * Bounds: [-2147483648, 2147483647]
25778
26163
  */
25779
26164
  maxDistance?: number;
25780
26165
  }
@@ -26423,6 +26808,56 @@ export interface PlayerVisibilityRules extends EntityVisibilityRules {
26423
26808
  showSpectatorToSpectator?: boolean;
26424
26809
  }
26425
26810
 
26811
+ /**
26812
+ * @rc
26813
+ * Associates a block point-of-interest instance with its
26814
+ * squared distance from a query center.
26815
+ */
26816
+ export interface PoiDistancePair {
26817
+ /**
26818
+ * @remarks
26819
+ * Squared three-dimensional distance, in blocks squared, from
26820
+ * the query center to the POI position.
26821
+ *
26822
+ */
26823
+ distance: number;
26824
+ /**
26825
+ * @remarks
26826
+ * POI instance at this distance.
26827
+ *
26828
+ */
26829
+ poi: PoiBlockInstance;
26830
+ }
26831
+
26832
+ /**
26833
+ * @rc
26834
+ * Selects block point-of-interest types by their exact
26835
+ * namespaced identifier.
26836
+ */
26837
+ export interface PoiNameFilter {
26838
+ /**
26839
+ * @remarks
26840
+ * Exact namespaced POI type identifier to match.
26841
+ *
26842
+ */
26843
+ name: string;
26844
+ }
26845
+
26846
+ /**
26847
+ * @rc
26848
+ * Selects block point-of-interest types that have all
26849
+ * specified tags.
26850
+ */
26851
+ export interface PoiTagFilter {
26852
+ /**
26853
+ * @remarks
26854
+ * Namespaced POI tags that a matching type must contain. All
26855
+ * tags in the array are required.
26856
+ *
26857
+ */
26858
+ tags: string[];
26859
+ }
26860
+
26426
26861
  /**
26427
26862
  * Contains optional filters that control which primitive
26428
26863
  * shapes are returned from a primitive shapes query.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "2.12.0-rc.1.26.70-preview.20",
3
+ "version": "2.12.0-rc.1.26.70-preview.21",
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.70-preview.20"
17
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.26.70-preview.21"
18
18
  },
19
19
  "license": "MIT"
20
20
  }