@minecraft/server 2.10.0-beta.1.26.40-preview.20 → 2.10.0-beta.1.26.40-preview.23

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 +307 -164
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -1172,15 +1172,6 @@ export enum EntityComponentTypes {
1172
1172
  *
1173
1173
  */
1174
1174
  Exhaustion = 'minecraft:player.exhaustion',
1175
- /**
1176
- * @beta
1177
- * @remarks
1178
- * Use this component to access and manipulate the fog
1179
- * definitions stack of a player. This is only available on
1180
- * players.
1181
- *
1182
- */
1183
- Fog = 'minecraft:player.fog',
1184
1175
  /**
1185
1176
  * @remarks
1186
1177
  * Use this component to read the hunger of a player. This is
@@ -2731,6 +2722,38 @@ export enum PlayerPermissionLevel {
2731
2722
  Custom = 3,
2732
2723
  }
2733
2724
 
2725
+ /**
2726
+ * @rc
2727
+ * The split screen slot of a player.
2728
+ */
2729
+ export enum PlayerSplitScreenSlot {
2730
+ /**
2731
+ * @remarks
2732
+ * The first player in the split screen session. This is the
2733
+ * primary player.
2734
+ *
2735
+ */
2736
+ First = 'First',
2737
+ /**
2738
+ * @remarks
2739
+ * The fourth player in the split screen session.
2740
+ *
2741
+ */
2742
+ Fourth = 'Fourth',
2743
+ /**
2744
+ * @remarks
2745
+ * The second player in the split screen session.
2746
+ *
2747
+ */
2748
+ Second = 'Second',
2749
+ /**
2750
+ * @remarks
2751
+ * The third player in the split screen session.
2752
+ *
2753
+ */
2754
+ Third = 'Third',
2755
+ }
2756
+
2734
2757
  /**
2735
2758
  * @beta
2736
2759
  */
@@ -3280,7 +3303,6 @@ export type EntityComponentTypeMap = {
3280
3303
  'minecraft:npc': EntityNpcComponent;
3281
3304
  'minecraft:onfire': EntityOnFireComponent;
3282
3305
  'minecraft:player.exhaustion': EntityExhaustionComponent;
3283
- 'minecraft:player.fog': EntityFogComponent;
3284
3306
  'minecraft:player.hunger': EntityHungerComponent;
3285
3307
  'minecraft:player.saturation': EntitySaturationComponent;
3286
3308
  'minecraft:projectile': EntityProjectileComponent;
@@ -3315,7 +3337,6 @@ export type EntityComponentTypeMap = {
3315
3337
  npc: EntityNpcComponent;
3316
3338
  onfire: EntityOnFireComponent;
3317
3339
  'player.exhaustion': EntityExhaustionComponent;
3318
- 'player.fog': EntityFogComponent;
3319
3340
  'player.hunger': EntityHungerComponent;
3320
3341
  'player.saturation': EntitySaturationComponent;
3321
3342
  projectile: EntityProjectileComponent;
@@ -4345,7 +4366,7 @@ export class Block {
4345
4366
  */
4346
4367
  getMapColor(): RGBA;
4347
4368
  /**
4348
- * @beta
4369
+ * @rc
4349
4370
  * @remarks
4350
4371
  * Returns array of all loaded block parts if this block has
4351
4372
  * the 'minecraft:multi_block' trait. If it does not have the
@@ -6525,6 +6546,38 @@ export class BlockVolumeBase {
6525
6546
  *
6526
6547
  */
6527
6548
  getCapacity(): number;
6549
+ /**
6550
+ * @beta
6551
+ * @remarks
6552
+ * Returns a list of block positions within the volume that are
6553
+ * closest to a given location, sorted by distance (nearest
6554
+ * first)
6555
+ *
6556
+ * @param count
6557
+ * Number of closest positions to return
6558
+ * @param location
6559
+ * Position to measure distance from
6560
+ * @throws This function can throw errors.
6561
+ *
6562
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
6563
+ */
6564
+ getClosest(count: number, location: Vector3): Vector3[];
6565
+ /**
6566
+ * @beta
6567
+ * @remarks
6568
+ * Returns a list of block positions within the volume that are
6569
+ * farthest from a given location, sorted by distance (farthest
6570
+ * first)
6571
+ *
6572
+ * @param count
6573
+ * Number of farthest positions to return
6574
+ * @param location
6575
+ * Position to measure distance from
6576
+ * @throws This function can throw errors.
6577
+ *
6578
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
6579
+ */
6580
+ getFarthest(count: number, location: Vector3): Vector3[];
6528
6581
  /**
6529
6582
  * @remarks
6530
6583
  * Get the largest corner position of the volume (guaranteed to
@@ -11572,140 +11625,6 @@ export class EntityFlyingSpeedComponent extends EntityComponent {
11572
11625
  static readonly componentId = 'minecraft:flying_speed';
11573
11626
  }
11574
11627
 
11575
- /**
11576
- * @beta
11577
- * Provides access to the fog definitions stack of a player
11578
- * entity, allowing scripts to push, pop, remove, and query
11579
- * active fog definitions.
11580
- */
11581
- // @ts-ignore Class inheritance allowed for native defined classes
11582
- export class EntityFogComponent extends EntityComponent {
11583
- private constructor();
11584
- static readonly componentId = 'minecraft:player.fog';
11585
- /**
11586
- * @remarks
11587
- * Sets the player's fog stack to the given list of fog
11588
- * identifiers, replacing any existing entries.
11589
- *
11590
- * This function can't be called in restricted-execution mode.
11591
- *
11592
- * @param fogIds
11593
- * A stack of fog definition identifiers to set on the player's
11594
- * fog stack (e.g. ['minecraft:fog_bamboo_jungle']). Maximum of
11595
- * 16 entries.
11596
- * @param tag
11597
- * An optional tag to associate with the new entries, used to
11598
- * target them with pop or remove.
11599
- * @throws
11600
- * Throws if the entity is invalid, if more than 16 fog
11601
- * identifiers are provided, or if any fog identifier is
11602
- * invalid.
11603
- *
11604
- * {@link EntityFogComponentError}
11605
- *
11606
- * {@link InvalidEntityError}
11607
- */
11608
- applyStack(fogIds: string[], tag?: string): void;
11609
- /**
11610
- * @remarks
11611
- * Returns the list of fog identifiers currently on the
11612
- * player's fog stack, ordered from bottom to top.
11613
- *
11614
- * This function can't be called in restricted-execution mode.
11615
- *
11616
- * @returns
11617
- * An array of fog definition identifiers currently on the
11618
- * stack.
11619
- * @throws
11620
- * Throws if the entity is invalid.
11621
- *
11622
- * {@link InvalidEntityError}
11623
- */
11624
- getStack(): string[];
11625
- /**
11626
- * @remarks
11627
- * Returns the list of tags currently present on the player's
11628
- * fog stack.
11629
- *
11630
- * This function can't be called in restricted-execution mode.
11631
- *
11632
- * @returns
11633
- * An array of tag strings associated with fog settings on the
11634
- * stack.
11635
- * @throws
11636
- * Throws if the entity is invalid.
11637
- *
11638
- * {@link InvalidEntityError}
11639
- */
11640
- getTags(): string[];
11641
- /**
11642
- * @remarks
11643
- * Removes the most recently pushed fog definition from the
11644
- * player's fog stack.
11645
- *
11646
- * This function can't be called in restricted-execution mode.
11647
- *
11648
- * @param tag
11649
- * An optional tag identifying which entry to pop. If provided,
11650
- * searches the stack from top to bottom and removes the most
11651
- * recently pushed entry with this tag. If omitted, removes the
11652
- * most recently pushed entry regardless of tag.
11653
- * @returns
11654
- * Returns the identifier of the popped fog definition, or
11655
- * undefined if the stack was unchanged.
11656
- * @throws
11657
- * Throws if the entity is invalid.
11658
- *
11659
- * {@link InvalidEntityError}
11660
- */
11661
- pop(tag?: string): string | undefined;
11662
- /**
11663
- * @remarks
11664
- * Pushes a new fog definition onto the player's fog stack.
11665
- *
11666
- * This function can't be called in restricted-execution mode.
11667
- *
11668
- * @param fogId
11669
- * The identifier of the fog definition to push onto the stack
11670
- * (e.g. 'minecraft:fog_bamboo_jungle').
11671
- * @param tag
11672
- * An optional tag used to label this fog definition on the
11673
- * stack, allowing it to be targeted by pop or remove. If
11674
- * omitted, the entry is stored with the tag 'untagged'.
11675
- * @returns
11676
- * Returns the zero-based index at which the fog definition was
11677
- * inserted into the stack.
11678
- * @throws
11679
- * Throws if the entity is invalid, the fog identifier is
11680
- * invalid, or if the stack limit of 16 has been exceeded.
11681
- *
11682
- * {@link EntityFogComponentError}
11683
- *
11684
- * {@link InvalidEntityError}
11685
- */
11686
- push(fogId: string, tag?: string): number;
11687
- /**
11688
- * @remarks
11689
- * Removes all fog definitions with the given tag from the
11690
- * player's fog stack. If no tag is provided, clears all fog
11691
- * definitions.
11692
- *
11693
- * This function can't be called in restricted-execution mode.
11694
- *
11695
- * @param tag
11696
- * An optional tag identifying which the entries to remove. If
11697
- * omitted, clears all fog definitions regardless of tag.
11698
- * @returns
11699
- * Returns true if at least one entry was removed, or false if
11700
- * the stack was unchanged.
11701
- * @throws
11702
- * Throws if the entity is invalid.
11703
- *
11704
- * {@link InvalidEntityError}
11705
- */
11706
- remove(tag?: string): boolean;
11707
- }
11708
-
11709
11628
  /**
11710
11629
  * Defines how much friction affects this entity.
11711
11630
  */
@@ -14115,6 +14034,67 @@ export class EntityTamedAfterEventSignal {
14115
14034
  unsubscribe(callback: (arg0: EntityTamedAfterEvent) => void): void;
14116
14035
  }
14117
14036
 
14037
+ /**
14038
+ * @beta
14039
+ * Contains information regarding an event before an entity is
14040
+ * tamed.
14041
+ */
14042
+ export class EntityTamedBeforeEvent {
14043
+ private constructor();
14044
+ /**
14045
+ * @remarks
14046
+ * When set to true will cancel the event.
14047
+ *
14048
+ */
14049
+ cancel: boolean;
14050
+ /**
14051
+ * @remarks
14052
+ * The entity that is being tamed.
14053
+ *
14054
+ */
14055
+ readonly entity: Entity;
14056
+ /**
14057
+ * @remarks
14058
+ * The entity that is attempting to tame the entity.
14059
+ *
14060
+ */
14061
+ readonly tamingEntity: Entity;
14062
+ }
14063
+
14064
+ /**
14065
+ * @beta
14066
+ * Manages callbacks that are connected to before an entity is
14067
+ * tamed.
14068
+ */
14069
+ export class EntityTamedBeforeEventSignal {
14070
+ private constructor();
14071
+ /**
14072
+ * @remarks
14073
+ * This function can't be called in restricted-execution mode.
14074
+ *
14075
+ * This function can be called in early-execution mode.
14076
+ *
14077
+ * @param callback
14078
+ * This closure is called with restricted-execution privilege.
14079
+ * @returns
14080
+ * Closure that is called with restricted-execution privilege.
14081
+ */
14082
+ subscribe(
14083
+ callback: (arg0: EntityTamedBeforeEvent) => void,
14084
+ options?: EntityTamedEventFilter,
14085
+ ): (arg0: EntityTamedBeforeEvent) => void;
14086
+ /**
14087
+ * @remarks
14088
+ * This function can't be called in restricted-execution mode.
14089
+ *
14090
+ * This function can be called in early-execution mode.
14091
+ *
14092
+ * @param callback
14093
+ * This closure is called with restricted-execution privilege.
14094
+ */
14095
+ unsubscribe(callback: (arg0: EntityTamedBeforeEvent) => void): void;
14096
+ }
14097
+
14118
14098
  /**
14119
14099
  * Contains options for taming a rideable entity based on the
14120
14100
  * entity that mounts it.
@@ -14635,6 +14615,138 @@ export class FluidContainer {
14635
14615
  static readonly minFillLevel = 0;
14636
14616
  }
14637
14617
 
14618
+ /**
14619
+ * @beta
14620
+ * Provides access to the fog definitions stack of a player
14621
+ * entity, allowing scripts to push, pop, remove, and query
14622
+ * active fog definitions.
14623
+ */
14624
+ export class FogSettings {
14625
+ private constructor();
14626
+ /**
14627
+ * @remarks
14628
+ * Returns the list of fog identifiers currently on the
14629
+ * player's fog stack, ordered from bottom to top.
14630
+ *
14631
+ * This function can't be called in restricted-execution mode.
14632
+ *
14633
+ * @returns
14634
+ * An array of fog definition identifiers currently on the
14635
+ * stack.
14636
+ * @throws
14637
+ * Throws if the entity is invalid.
14638
+ *
14639
+ * {@link InvalidEntityError}
14640
+ */
14641
+ getStack(): string[];
14642
+ /**
14643
+ * @remarks
14644
+ * Returns the list of tags currently present on the player's
14645
+ * fog stack.
14646
+ *
14647
+ * This function can't be called in restricted-execution mode.
14648
+ *
14649
+ * @returns
14650
+ * An array of tag strings associated with fog settings on the
14651
+ * stack.
14652
+ * @throws
14653
+ * Throws if the entity is invalid.
14654
+ *
14655
+ * {@link InvalidEntityError}
14656
+ */
14657
+ getTags(): string[];
14658
+ /**
14659
+ * @remarks
14660
+ * Removes the most recently pushed fog definition from the
14661
+ * player's fog stack.
14662
+ *
14663
+ * This function can't be called in restricted-execution mode.
14664
+ *
14665
+ * @param tag
14666
+ * An optional tag identifying which entry to pop. If provided,
14667
+ * searches the stack from top to bottom and removes the most
14668
+ * recently pushed entry with this tag. If omitted, removes the
14669
+ * most recently pushed entry regardless of tag.
14670
+ * @returns
14671
+ * Returns the identifier of the popped fog definition, or
14672
+ * undefined if the stack was unchanged.
14673
+ * @throws
14674
+ * Throws if the entity is invalid.
14675
+ *
14676
+ * {@link InvalidEntityError}
14677
+ */
14678
+ pop(tag?: string): string | undefined;
14679
+ /**
14680
+ * @remarks
14681
+ * Pushes a new fog definition onto the player's fog stack.
14682
+ *
14683
+ * This function can't be called in restricted-execution mode.
14684
+ *
14685
+ * @param fogId
14686
+ * The identifier of the fog definition to push onto the stack
14687
+ * (e.g. 'minecraft:fog_bamboo_jungle').
14688
+ * @param tag
14689
+ * An optional tag used to label this fog definition on the
14690
+ * stack, allowing it to be targeted by pop or remove. If
14691
+ * omitted, the entry is stored with the tag 'untagged'.
14692
+ * @returns
14693
+ * Returns the zero-based index at which the fog definition was
14694
+ * inserted into the stack.
14695
+ * @throws
14696
+ * Throws if the entity is invalid, the fog identifier is
14697
+ * invalid, or if the stack limit of 16 has been exceeded.
14698
+ *
14699
+ * {@link FogSettingsError}
14700
+ *
14701
+ * {@link InvalidEntityError}
14702
+ */
14703
+ push(fogId: string, tag?: string): number;
14704
+ /**
14705
+ * @remarks
14706
+ * Removes all fog definitions with the given tag from the
14707
+ * player's fog stack. If no tag is provided, clears all fog
14708
+ * definitions.
14709
+ *
14710
+ * This function can't be called in restricted-execution mode.
14711
+ *
14712
+ * @param tag
14713
+ * An optional tag identifying which the entries to remove. If
14714
+ * omitted, clears all fog definitions regardless of tag.
14715
+ * @returns
14716
+ * Returns true if at least one entry was removed, or false if
14717
+ * the stack was unchanged.
14718
+ * @throws
14719
+ * Throws if the entity is invalid.
14720
+ *
14721
+ * {@link InvalidEntityError}
14722
+ */
14723
+ remove(tag?: string): boolean;
14724
+ /**
14725
+ * @remarks
14726
+ * Sets the player's fog stack to the given list of fog
14727
+ * identifiers, replacing any existing entries.
14728
+ *
14729
+ * This function can't be called in restricted-execution mode.
14730
+ *
14731
+ * @param fogIds
14732
+ * A stack of fog definition identifiers to set on the player's
14733
+ * fog stack (e.g. ['minecraft:fog_bamboo_jungle']). Maximum of
14734
+ * 16 entries.
14735
+ * @param tag
14736
+ * An optional tag to associate with the new entries, used to
14737
+ * target them with pop or remove.
14738
+ * @throws
14739
+ * Throws if the entity is invalid, if more than 16 fog
14740
+ * identifiers are provided, or if any fog identifier is
14741
+ * invalid.
14742
+ *
14743
+ * {@link FogSettingsError}
14744
+ *
14745
+ * {@link InvalidEntityError}
14746
+ */
14747
+ setStack(fogIds: string[], tag?: string): void;
14748
+ }
14749
+
14638
14750
  /**
14639
14751
  * Contains information regarding a changed world.gameRules
14640
14752
  * property.
@@ -18103,6 +18215,14 @@ export class Player extends Entity {
18103
18215
  *
18104
18216
  */
18105
18217
  commandPermissionLevel: CommandPermissionLevel;
18218
+ /**
18219
+ * @beta
18220
+ * @remarks
18221
+ * Contains methods for manipulating the render distance fog
18222
+ * settings of a Player.
18223
+ *
18224
+ */
18225
+ readonly fogSettings: FogSettings;
18106
18226
  /**
18107
18227
  * @remarks
18108
18228
  * Gets the current graphics mode of the player's client. This
@@ -18187,16 +18307,11 @@ export class Player extends Entity {
18187
18307
  * @throws This property can throw when used.
18188
18308
  */
18189
18309
  readonly onScreenDisplay: ScreenDisplay;
18190
- /**
18191
- * @throws This property can throw when used.
18192
- *
18193
- * {@link InvalidEntityError}
18194
- */
18195
- readonly playerPermissionLevel: PlayerPermissionLevel;
18196
18310
  /**
18197
18311
  * @beta
18198
18312
  * @remarks
18199
- * Gets the player's Playfab ID.
18313
+ * An identifier that can be used to identify a player across
18314
+ * sessions.
18200
18315
  *
18201
18316
  * @throws This property can throw when used.
18202
18317
  *
@@ -18204,7 +18319,13 @@ export class Player extends Entity {
18204
18319
  *
18205
18320
  * {@link InvalidEntityError}
18206
18321
  */
18207
- readonly playfabId: string;
18322
+ readonly persistentId: string;
18323
+ /**
18324
+ * @throws This property can throw when used.
18325
+ *
18326
+ * {@link InvalidEntityError}
18327
+ */
18328
+ readonly playerPermissionLevel: PlayerPermissionLevel;
18208
18329
  /**
18209
18330
  * @remarks
18210
18331
  * This property can't be edited in restricted-execution mode.
@@ -18324,8 +18445,6 @@ export class Player extends Entity {
18324
18445
  * @remarks
18325
18446
  * Gets the player's ping in milliseconds.
18326
18447
  *
18327
- * This function can't be called in restricted-execution mode.
18328
- *
18329
18448
  * @returns
18330
18449
  * The player's ping in milliseconds.
18331
18450
  * @throws This function can throw errors.
@@ -18342,6 +18461,21 @@ export class Player extends Entity {
18342
18461
  * @throws This function can throw errors.
18343
18462
  */
18344
18463
  getSpawnPoint(): DimensionLocation | undefined;
18464
+ /**
18465
+ * @beta
18466
+ * @remarks
18467
+ * Returns the split screen slot of the player.
18468
+ *
18469
+ * @returns
18470
+ * The split screen slot of the player or undefined if the
18471
+ * player is not in a split screen session.
18472
+ * @throws This function can throw errors.
18473
+ *
18474
+ * {@link minecraftcommon.EngineError}
18475
+ *
18476
+ * {@link InvalidEntityError}
18477
+ */
18478
+ getSplitScreenSlot(): PlayerSplitScreenSlot | undefined;
18345
18479
  /**
18346
18480
  * @remarks
18347
18481
  * Gets the total experience of the Player.
@@ -24874,6 +25008,15 @@ export class WorldBeforeEvents {
24874
25008
  *
24875
25009
  */
24876
25010
  readonly entityRemove: EntityRemoveBeforeEventSignal;
25011
+ /**
25012
+ * @beta
25013
+ * @remarks
25014
+ * Fires before an entity is tamed.
25015
+ *
25016
+ * This property can be read in early-execution mode.
25017
+ *
25018
+ */
25019
+ readonly entityTamed: EntityTamedBeforeEventSignal;
24877
25020
  /**
24878
25021
  * @remarks
24879
25022
  * This event is fired after an explosion occurs.
@@ -28204,19 +28347,19 @@ export class EnchantmentTypeUnknownIdError extends Error {
28204
28347
  private constructor();
28205
28348
  }
28206
28349
 
28207
- /**
28208
- * @beta
28209
- * Error thrown by {@link EntityFogComponent} operations when
28210
- * the fog stack limit is exceeded or an invalid fog identifier
28211
- * is provided.
28212
- */
28213
28350
  // @ts-ignore Class inheritance allowed for native defined classes
28214
- export class EntityFogComponentError extends Error {
28351
+ export class EntitySpawnError extends Error {
28215
28352
  private constructor();
28216
28353
  }
28217
28354
 
28355
+ /**
28356
+ * @beta
28357
+ * Error thrown by {@link FogSettings} operations when the fog
28358
+ * stack limit is exceeded or an invalid fog identifier is
28359
+ * provided.
28360
+ */
28218
28361
  // @ts-ignore Class inheritance allowed for native defined classes
28219
- export class EntitySpawnError extends Error {
28362
+ export class FogSettingsError extends Error {
28220
28363
  private constructor();
28221
28364
  }
28222
28365
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "2.10.0-beta.1.26.40-preview.20",
3
+ "version": "2.10.0-beta.1.26.40-preview.23",
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.40-preview.20"
17
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.26.40-preview.23"
18
18
  },
19
19
  "license": "MIT"
20
20
  }