@minecraft/server 2.5.0-rc.1.26.10-preview.20 → 2.5.0

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 (3) hide show
  1. package/README.md +0 -2
  2. package/index.d.ts +39 -34
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Contains many types related to manipulating a Minecraft world, including entities, blocks, dimensions, and more.
4
4
 
5
- ## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
6
-
7
5
  See full documentation for this module here:
8
6
 
9
7
  https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/minecraft-server
package/index.d.ts CHANGED
@@ -7,7 +7,6 @@
7
7
  Copyright (c) Microsoft Corporation.
8
8
  ***************************************************************************** */
9
9
  /**
10
- * @preview
11
10
  * @packageDocumentation
12
11
  * Contains many types related to manipulating a Minecraft
13
12
  * world, including entities, blocks, dimensions, and more.
@@ -38,14 +37,12 @@ export enum BlockComponentTypes {
38
37
  */
39
38
  Inventory = 'minecraft:inventory',
40
39
  /**
41
- * @rc
42
40
  * @remarks
43
41
  * Represents the color of a block when displayed on a map.
44
42
  *
45
43
  */
46
44
  MapColor = 'minecraft:map_color',
47
45
  /**
48
- * @rc
49
46
  * @remarks
50
47
  * Represents a block that can move (such as a piston).
51
48
  *
@@ -59,7 +56,6 @@ export enum BlockComponentTypes {
59
56
  */
60
57
  Piston = 'minecraft:piston',
61
58
  /**
62
- * @rc
63
59
  * @remarks
64
60
  * Represents a how a block interacts with precipitation (such
65
61
  * as rain or snow).
@@ -73,7 +69,6 @@ export enum BlockComponentTypes {
73
69
  */
74
70
  RecordPlayer = 'minecraft:record_player',
75
71
  /**
76
- * @rc
77
72
  * @remarks
78
73
  * Represents a block that can output a redstone signal.
79
74
  *
@@ -1419,7 +1414,6 @@ export enum EntityInitializationCause {
1419
1414
  }
1420
1415
 
1421
1416
  /**
1422
- * @rc
1423
1417
  * Enumerator describing the source of an Entity swing. Sent as
1424
1418
  * part of {@link PlayerSwingStartAfterEvent}
1425
1419
  */
@@ -1901,7 +1895,6 @@ export enum GraphicsMode {
1901
1895
  }
1902
1896
 
1903
1897
  /**
1904
- * @rc
1905
1898
  * Specifies options related to the item currently being held
1906
1899
  * by an entity.
1907
1900
  */
@@ -3308,7 +3301,6 @@ export class Block {
3308
3301
  * Number of instances of this block to place in the item
3309
3302
  * stack.
3310
3303
  * Defaults to: 1
3311
- * Bounds: [1, 255]
3312
3304
  * @param withData
3313
3305
  * Whether additional data facets of the item stack are
3314
3306
  * included.
@@ -4223,7 +4215,6 @@ export class BlockPermutation {
4223
4215
  * Number of instances of this block to place in the prototype
4224
4216
  * item stack.
4225
4217
  * Defaults to: 1
4226
- * Bounds: [1, 255]
4227
4218
  */
4228
4219
  getItemStack(amount?: number): ItemStack | undefined;
4229
4220
  /**
@@ -5468,7 +5459,6 @@ export class Container {
5468
5459
  *
5469
5460
  * @param slot
5470
5461
  * Zero-based index of the slot to retrieve items from.
5471
- * Minimum value: 0
5472
5462
  * @throws
5473
5463
  * Throws if the container is invalid or if the `slot` index is
5474
5464
  * out of bounds.
@@ -5502,7 +5492,6 @@ export class Container {
5502
5492
  * @param slot
5503
5493
  * The index of the slot to return. This index must be within
5504
5494
  * the bounds of the container.
5505
- * Minimum value: 0
5506
5495
  * @throws
5507
5496
  * Throws if the container is invalid or if the `slot` index is
5508
5497
  * out of bounds.
@@ -5518,11 +5507,9 @@ export class Container {
5518
5507
  * @param fromSlot
5519
5508
  * Zero-based index of the slot to transfer an item from, on
5520
5509
  * this container.
5521
- * Minimum value: 0
5522
5510
  * @param toSlot
5523
5511
  * Zero-based index of the slot to transfer an item to, on
5524
5512
  * `toContainer`.
5525
- * Minimum value: 0
5526
5513
  * @param toContainer
5527
5514
  * Target container to transfer to. Note this can be the same
5528
5515
  * container as the source.
@@ -5571,7 +5558,6 @@ export class Container {
5571
5558
  *
5572
5559
  * @param slot
5573
5560
  * Zero-based index of the slot to set an item at.
5574
- * Minimum value: 0
5575
5561
  * @param itemStack
5576
5562
  * Stack of items to place within the specified slot. Setting
5577
5563
  * `itemStack` to undefined will clear the slot.
@@ -5592,10 +5578,8 @@ export class Container {
5592
5578
  *
5593
5579
  * @param slot
5594
5580
  * Zero-based index of the slot to swap from this container.
5595
- * Minimum value: 0
5596
5581
  * @param otherSlot
5597
5582
  * Zero-based index of the slot to swap with.
5598
- * Minimum value: 0
5599
5583
  * @param otherContainer
5600
5584
  * Target container to swap with. Note this can be the same
5601
5585
  * container as this source.
@@ -5618,7 +5602,6 @@ export class Container {
5618
5602
  * @param fromSlot
5619
5603
  * Zero-based index of the slot to transfer an item from, on
5620
5604
  * this container.
5621
- * Minimum value: 0
5622
5605
  * @param toContainer
5623
5606
  * Target container to transfer to. Note this can be the same
5624
5607
  * container as the source.
@@ -5678,7 +5661,6 @@ export class ContainerSlot {
5678
5661
  *
5679
5662
  * This property can't be edited in restricted-execution mode.
5680
5663
  *
5681
- * Bounds: [1, 255]
5682
5664
  * @throws
5683
5665
  * Throws if the value is outside the range of 1-255.
5684
5666
  */
@@ -6292,7 +6274,6 @@ export class Dimension {
6292
6274
  * The location of the explosion.
6293
6275
  * @param radius
6294
6276
  * Radius, in blocks, of the explosion to create.
6295
- * Bounds: [0, 1000]
6296
6277
  * @param explosionOptions
6297
6278
  * Additional configurable options for the explosion.
6298
6279
  * @throws This function can throw errors.
@@ -6813,7 +6794,6 @@ export class Dimension {
6813
6794
  * Sets the duration of the weather (in ticks). If no duration
6814
6795
  * is provided, the duration will be set to a random duration
6815
6796
  * between 300 and 900 seconds.
6816
- * Bounds: [1, 1000000]
6817
6797
  * @throws This function can throw errors.
6818
6798
  */
6819
6799
  setWeather(weatherType: WeatherType, duration?: number): void;
@@ -7536,7 +7516,6 @@ export class Entity {
7536
7516
  * 20 ticks per second. Use {@link TicksPerSecond} constant to
7537
7517
  * convert between ticks and seconds. The value must be within
7538
7518
  * the range [0, 20000000].
7539
- * Bounds: [1, 20000000]
7540
7519
  * @param options
7541
7520
  * Additional options for the effect.
7542
7521
  * @returns
@@ -9432,6 +9411,37 @@ export class EntityHurtAfterEvent {
9432
9411
  readonly hurtEntity: Entity;
9433
9412
  }
9434
9413
 
9414
+ /**
9415
+ * Manages callbacks that are connected to when an entity is
9416
+ * hurt.
9417
+ */
9418
+ export class EntityHurtAfterEventSignal {
9419
+ private constructor();
9420
+ /**
9421
+ * @remarks
9422
+ * Adds a callback that will be called when an entity is hurt.
9423
+ *
9424
+ * This function can't be called in restricted-execution mode.
9425
+ *
9426
+ * This function can be called in early-execution mode.
9427
+ *
9428
+ */
9429
+ subscribe(
9430
+ callback: (arg0: EntityHurtAfterEvent) => void,
9431
+ options?: EntityEventOptions,
9432
+ ): (arg0: EntityHurtAfterEvent) => void;
9433
+ /**
9434
+ * @remarks
9435
+ * Removes a callback from being called when an entity is hurt.
9436
+ *
9437
+ * This function can't be called in restricted-execution mode.
9438
+ *
9439
+ * This function can be called in early-execution mode.
9440
+ *
9441
+ */
9442
+ unsubscribe(callback: (arg0: EntityHurtAfterEvent) => void): void;
9443
+ }
9444
+
9435
9445
  /**
9436
9446
  * Defines this entity's inventory properties.
9437
9447
  */
@@ -12331,7 +12341,6 @@ export class ItemDurabilityComponent extends ItemComponent {
12331
12341
  * chance. Incoming unbreaking parameter must be within the
12332
12342
  * range [0, 3].
12333
12343
  * Defaults to: 0
12334
- * Bounds: [0, 3]
12335
12344
  * @throws This function can throw errors.
12336
12345
  */
12337
12346
  getDamageChance(unbreakingEnchantmentLevel?: number): number;
@@ -12770,7 +12779,6 @@ export class ItemStack {
12770
12779
  *
12771
12780
  * This property can't be edited in restricted-execution mode.
12772
12781
  *
12773
- * Bounds: [1, 255]
12774
12782
  * @throws
12775
12783
  * Throws if the value is outside the range of 1-255.
12776
12784
  */
@@ -12868,7 +12876,6 @@ export class ItemStack {
12868
12876
  * size. Note that certain items can only have one item in the
12869
12877
  * stack.
12870
12878
  * Defaults to: 1
12871
- * Bounds: [1, 255]
12872
12879
  * @throws
12873
12880
  * Throws if `itemType` is invalid, or if `amount` is outside
12874
12881
  * the range of 1-255.
@@ -14532,7 +14539,6 @@ export class Player extends Entity {
14532
14539
  * @param amount
14533
14540
  * Amount of experience to add. Note that this can be negative.
14534
14541
  * Min/max bounds at -2^24 ~ 2^24
14535
- * Bounds: [-16777216, 16777216]
14536
14542
  * @returns
14537
14543
  * Returns the current experience of the Player.
14538
14544
  * @throws This function can throw errors.
@@ -14547,7 +14553,6 @@ export class Player extends Entity {
14547
14553
  *
14548
14554
  * @param amount
14549
14555
  * Amount to add to the player. Min/max bounds at -2^24 ~ 2^24
14550
- * Bounds: [-16777216, 16777216]
14551
14556
  * @returns
14552
14557
  * Returns the current level of the Player.
14553
14558
  * @throws This function can throw errors.
@@ -14935,7 +14940,6 @@ export class Player extends Entity {
14935
14940
  * cooldown for.
14936
14941
  * @param tickDuration
14937
14942
  * Duration in ticks of the item cooldown.
14938
- * Bounds: [0, 32767]
14939
14943
  * @throws This function can throw errors.
14940
14944
  */
14941
14945
  startItemCooldown(cooldownCategory: string, tickDuration: number): void;
@@ -16250,7 +16254,6 @@ export class PlayerSpawnAfterEventSignal {
16250
16254
  }
16251
16255
 
16252
16256
  /**
16253
- * @rc
16254
16257
  * Contains information regarding a player starting to swing
16255
16258
  * their arm.
16256
16259
  */
@@ -16279,7 +16282,6 @@ export class PlayerSwingStartAfterEvent {
16279
16282
  }
16280
16283
 
16281
16284
  /**
16282
- * @rc
16283
16285
  * Manages callbacks that are connected to when a player starts
16284
16286
  * to swing their arm (e.g. attacking, using an item,
16285
16287
  * interacting).
@@ -18093,7 +18095,6 @@ export class StructureManager {
18093
18095
  * templates.
18094
18096
  * @param maxDepth
18095
18097
  * The maximum recursion depth for the jigsaw structure.
18096
- * Bounds: [1, 20]
18097
18098
  * @param dimension
18098
18099
  * The dimension to place the jigsaw structure in.
18099
18100
  * @param location
@@ -19354,6 +19355,14 @@ export class WorldAfterEvents {
19354
19355
  *
19355
19356
  */
19356
19357
  readonly entityHitEntity: EntityHitEntityAfterEventSignal;
19358
+ /**
19359
+ * @remarks
19360
+ * This event fires when an entity is hurt (takes damage).
19361
+ *
19362
+ * This property can be read in early-execution mode.
19363
+ *
19364
+ */
19365
+ readonly entityHurt: EntityHurtAfterEventSignal;
19357
19366
  /**
19358
19367
  * @remarks
19359
19368
  * Fires when an entity is loaded.
@@ -19599,7 +19608,6 @@ export class WorldAfterEvents {
19599
19608
  */
19600
19609
  readonly playerSpawn: PlayerSpawnAfterEventSignal;
19601
19610
  /**
19602
- * @rc
19603
19611
  * @remarks
19604
19612
  * This property can be read in early-execution mode.
19605
19613
  *
@@ -21142,7 +21150,6 @@ export interface HotbarEventOptions {
21142
21150
  * The slot indexes to consider. Values should be between 0 and
21143
21151
  * 8, inclusive. If not specified, all slots are considered.
21144
21152
  *
21145
- * Bounds: [0, 8]
21146
21153
  */
21147
21154
  allowedSlots?: number[];
21148
21155
  }
@@ -21180,7 +21187,6 @@ export interface InventoryItemEventOptions {
21180
21187
  * The slot indexes to consider. Values should be positive
21181
21188
  * numbers. If not specified, all slots are considered.
21182
21189
  *
21183
- * Bounds: [0, 1000]
21184
21190
  */
21185
21191
  allowedSlots?: number[];
21186
21192
  /**
@@ -21472,7 +21478,6 @@ export interface PlayerSoundOptions {
21472
21478
  }
21473
21479
 
21474
21480
  /**
21475
- * @rc
21476
21481
  * An interface that is passed into {@link
21477
21482
  * @minecraft/Server.PlayerSwingStartAfterEvent.subscribe} that
21478
21483
  * filters out which events are passed to the provided
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "2.5.0-rc.1.26.10-preview.20",
3
+ "version": "2.5.0",
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.10-preview.20"
17
+ "@minecraft/vanilla-data": ">=1.20.70"
18
18
  },
19
19
  "license": "MIT"
20
20
  }