@minecraft/server 1.9.0-beta.1.20.60-preview.21 → 1.9.0-beta.1.20.60-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 +290 -361
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  * ```json
16
16
  * {
17
17
  * "module_name": "@minecraft/server",
18
- * "version": "1.6.0"
18
+ * "version": "1.7.0"
19
19
  * }
20
20
  * ```
21
21
  *
@@ -35,6 +35,16 @@ export enum BlockComponentTypes {
35
35
  WaterContainer = 'minecraft:waterContainer',
36
36
  }
37
37
 
38
+ /**
39
+ * @beta
40
+ */
41
+ export enum BlockPistonState {
42
+ Expanded = 'Expanded',
43
+ Expanding = 'Expanding',
44
+ Retracted = 'Retracted',
45
+ Retracting = 'Retracting',
46
+ }
47
+
38
48
  /**
39
49
  * @beta
40
50
  * Description of the resulting intersection test on two
@@ -429,6 +439,7 @@ export enum EntityComponentTypes {
429
439
  NavigationWalk = 'minecraft:navigation.walk',
430
440
  Npc = 'minecraft:npc',
431
441
  OnFire = 'minecraft:onfire',
442
+ Projectile = 'minecraft:projectile',
432
443
  PushThrough = 'minecraft:push_through',
433
444
  Rideable = 'minecraft:rideable',
434
445
  Riding = 'minecraft:riding',
@@ -854,7 +865,7 @@ export enum GameMode {
854
865
  export enum ItemComponentTypes {
855
866
  Cooldown = 'minecraft:cooldown',
856
867
  Durability = 'minecraft:durability',
857
- Enchants = 'minecraft:enchantments',
868
+ Enchantable = 'minecraft:enchantable',
858
869
  Food = 'minecraft:food',
859
870
  }
860
871
 
@@ -1256,6 +1267,7 @@ export type EntityComponentTypeMap = {
1256
1267
  'minecraft:navigation.walk': EntityNavigationWalkComponent;
1257
1268
  'minecraft:npc': EntityNpcComponent;
1258
1269
  'minecraft:onfire': EntityOnFireComponent;
1270
+ 'minecraft:projectile': EntityProjectileComponent;
1259
1271
  'minecraft:push_through': EntityPushThroughComponent;
1260
1272
  'minecraft:rideable': EntityRideableComponent;
1261
1273
  'minecraft:riding': EntityRidingComponent;
@@ -1285,6 +1297,7 @@ export type EntityComponentTypeMap = {
1285
1297
  'navigation.walk': EntityNavigationWalkComponent;
1286
1298
  npc: EntityNpcComponent;
1287
1299
  onfire: EntityOnFireComponent;
1300
+ projectile: EntityProjectileComponent;
1288
1301
  push_through: EntityPushThroughComponent;
1289
1302
  rideable: EntityRideableComponent;
1290
1303
  riding: EntityRidingComponent;
@@ -1304,11 +1317,11 @@ export type EntityComponentTypeMap = {
1304
1317
  export type ItemComponentTypeMap = {
1305
1318
  cooldown: ItemCooldownComponent;
1306
1319
  durability: ItemDurabilityComponent;
1307
- enchantments: ItemEnchantsComponent;
1320
+ enchantable: ItemEnchantableComponent;
1308
1321
  food: ItemFoodComponent;
1309
1322
  'minecraft:cooldown': ItemCooldownComponent;
1310
1323
  'minecraft:durability': ItemDurabilityComponent;
1311
- 'minecraft:enchantments': ItemEnchantsComponent;
1324
+ 'minecraft:enchantable': ItemEnchantableComponent;
1312
1325
  'minecraft:food': ItemFoodComponent;
1313
1326
  };
1314
1327
 
@@ -1437,7 +1450,6 @@ export class Block {
1437
1450
  */
1438
1451
  readonly z: number;
1439
1452
  /**
1440
- * @beta
1441
1453
  * @remarks
1442
1454
  * Returns the {@link Block} above this block (positive in the
1443
1455
  * Y direction).
@@ -1452,7 +1464,6 @@ export class Block {
1452
1464
  */
1453
1465
  above(steps?: number): Block | undefined;
1454
1466
  /**
1455
- * @beta
1456
1467
  * @remarks
1457
1468
  * Returns the {@link Block} below this block (negative in the
1458
1469
  * Y direction).
@@ -1467,7 +1478,6 @@ export class Block {
1467
1478
  */
1468
1479
  below(steps?: number): Block | undefined;
1469
1480
  /**
1470
- * @beta
1471
1481
  * @remarks
1472
1482
  * Returns the {@link @minecraft/server.Location} of the center
1473
1483
  * of this block on the X and Z axis.
@@ -1499,7 +1509,6 @@ export class Block {
1499
1509
  */
1500
1510
  canPlace(blockToPlace: BlockPermutation | BlockType | string, faceToPlaceOn?: Direction): boolean;
1501
1511
  /**
1502
- * @beta
1503
1512
  * @remarks
1504
1513
  * Returns the {@link @minecraft/server.Location} of the center
1505
1514
  * of this block on the X, Y, and Z axis.
@@ -1507,7 +1516,6 @@ export class Block {
1507
1516
  */
1508
1517
  center(): Vector3;
1509
1518
  /**
1510
- * @beta
1511
1519
  * @remarks
1512
1520
  * Returns the {@link Block} to the east of this block
1513
1521
  * (positive in the X direction).
@@ -1633,7 +1641,6 @@ export class Block {
1633
1641
  */
1634
1642
  isValid(): boolean;
1635
1643
  /**
1636
- * @beta
1637
1644
  * @remarks
1638
1645
  * Returns the {@link Block} to the north of this block
1639
1646
  * (negative in the Z direction).
@@ -1648,7 +1655,6 @@ export class Block {
1648
1655
  */
1649
1656
  north(steps?: number): Block | undefined;
1650
1657
  /**
1651
- * @beta
1652
1658
  * @remarks
1653
1659
  * Returns a block at an offset relative vector to this block.
1654
1660
  *
@@ -1703,7 +1709,6 @@ export class Block {
1703
1709
  */
1704
1710
  setType(blockType: BlockType | string): void;
1705
1711
  /**
1706
- * @beta
1707
1712
  * @remarks
1708
1713
  * Returns the {@link Block} to the south of this block
1709
1714
  * (positive in the Z direction).
@@ -1739,7 +1744,6 @@ export class Block {
1739
1744
  */
1740
1745
  trySetPermutation(permutation: BlockPermutation): boolean;
1741
1746
  /**
1742
- * @beta
1743
1747
  * @remarks
1744
1748
  * Returns the {@link Block} to the west of this block
1745
1749
  * (negative in the X direction).
@@ -2143,20 +2147,6 @@ export class BlockPermutation {
2143
2147
  // @ts-ignore Class inheritance allowed for native defined classes
2144
2148
  export class BlockPistonComponent extends BlockComponent {
2145
2149
  private constructor();
2146
- /**
2147
- * @remarks
2148
- * Whether the piston is fully expanded.
2149
- *
2150
- * @throws This property can throw when used.
2151
- */
2152
- readonly isExpanded: boolean;
2153
- /**
2154
- * @remarks
2155
- * Whether the piston is in the process of expanding.
2156
- *
2157
- * @throws This property can throw when used.
2158
- */
2159
- readonly isExpanding: boolean;
2160
2150
  /**
2161
2151
  * @remarks
2162
2152
  * Whether the piston is in the process of expanding or
@@ -2166,19 +2156,9 @@ export class BlockPistonComponent extends BlockComponent {
2166
2156
  */
2167
2157
  readonly isMoving: boolean;
2168
2158
  /**
2169
- * @remarks
2170
- * Whether the piston is fully retracted.
2171
- *
2172
2159
  * @throws This property can throw when used.
2173
2160
  */
2174
- readonly isRetracted: boolean;
2175
- /**
2176
- * @remarks
2177
- * Whether the piston is in the process of retracting.
2178
- *
2179
- * @throws This property can throw when used.
2180
- */
2181
- readonly isRetracting: boolean;
2161
+ readonly state: BlockPistonState;
2182
2162
  static readonly componentId = 'minecraft:piston';
2183
2163
  /**
2184
2164
  * @remarks
@@ -2187,7 +2167,11 @@ export class BlockPistonComponent extends BlockComponent {
2187
2167
  *
2188
2168
  * @throws This function can throw errors.
2189
2169
  */
2190
- getAttachedBlocks(): Vector3[];
2170
+ getAttachedBlocks(): Block[];
2171
+ /**
2172
+ * @throws This function can throw errors.
2173
+ */
2174
+ getAttachedBlocksLocations(): Vector3[];
2191
2175
  }
2192
2176
 
2193
2177
  /**
@@ -2367,7 +2351,7 @@ export class BlockSignComponent extends BlockComponent {
2367
2351
  *
2368
2352
  * @throws This function can throw errors.
2369
2353
  */
2370
- setWaxed(): void;
2354
+ setWaxed(waxed: boolean): void;
2371
2355
  }
2372
2356
 
2373
2357
  /**
@@ -2436,12 +2420,14 @@ export class BlockStateType {
2436
2420
  export class BlockType {
2437
2421
  private constructor();
2438
2422
  /**
2423
+ * @beta
2439
2424
  * @remarks
2440
2425
  * Represents whether this type of block can be waterlogged.
2441
2426
  *
2442
2427
  */
2443
2428
  readonly canBeWaterlogged: boolean;
2444
2429
  /**
2430
+ * @beta
2445
2431
  * @remarks
2446
2432
  * Block type name - for example, `minecraft:acacia_stairs`.
2447
2433
  *
@@ -3562,6 +3548,22 @@ export class ContainerSlot {
3562
3548
  * Throws if the slot's container is invalid.
3563
3549
  */
3564
3550
  readonly typeId?: string;
3551
+ /**
3552
+ * @throws This function can throw errors.
3553
+ */
3554
+ clearDynamicProperties(): void;
3555
+ /**
3556
+ * @throws This function can throw errors.
3557
+ */
3558
+ getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
3559
+ /**
3560
+ * @throws This function can throw errors.
3561
+ */
3562
+ getDynamicPropertyIds(): string[];
3563
+ /**
3564
+ * @throws This function can throw errors.
3565
+ */
3566
+ getDynamicPropertyTotalByteCount(): number;
3565
3567
  /**
3566
3568
  * @remarks
3567
3569
  * Creates an exact copy of the item stack, including any
@@ -3663,6 +3665,10 @@ export class ContainerSlot {
3663
3665
  * any of the provided block identifiers are invalid.
3664
3666
  */
3665
3667
  setCanPlaceOn(blockIdentifiers?: string[]): void;
3668
+ /**
3669
+ * @throws This function can throw errors.
3670
+ */
3671
+ setDynamicProperty(identifier: string, value?: boolean | number | string | Vector3): void;
3666
3672
  /**
3667
3673
  * @remarks
3668
3674
  * Sets the given ItemStack in the slot, replacing any existing
@@ -3835,7 +3841,6 @@ export class DataDrivenEntityTriggerBeforeEventSignal {
3835
3841
  export class Dimension {
3836
3842
  private constructor();
3837
3843
  /**
3838
- * @beta
3839
3844
  * @remarks
3840
3845
  * Height range of the dimension.
3841
3846
  *
@@ -4522,150 +4527,6 @@ export class EffectTypes {
4522
4527
  static getAll(): EffectType[];
4523
4528
  }
4524
4529
 
4525
- /**
4526
- * @beta
4527
- * This class represents a specific leveled enchantment that is
4528
- * applied to an item.
4529
- */
4530
- export class Enchantment {
4531
- /**
4532
- * @remarks
4533
- * The level of this enchantment instance.
4534
- *
4535
- * This property can't be edited in read-only mode.
4536
- *
4537
- */
4538
- level: number;
4539
- /**
4540
- * @remarks
4541
- * The enchantment type of this instance.
4542
- *
4543
- */
4544
- readonly 'type': EnchantmentType;
4545
- /**
4546
- * @remarks
4547
- * Creates a new particular type of enchantment configuration.
4548
- *
4549
- * @param enchantmentType
4550
- * Type of the enchantment.
4551
- * @param level
4552
- * Level of the enchantment.
4553
- * @throws This function can throw errors.
4554
- */
4555
- constructor(enchantmentType: EnchantmentType | string, level?: number);
4556
- }
4557
-
4558
- /**
4559
- * @beta
4560
- * This class represents a collection of enchantments that can
4561
- * be applied to an item.
4562
- */
4563
- export class EnchantmentList implements Iterable<Enchantment> {
4564
- /**
4565
- * @remarks
4566
- * The item slot/type that this collection is applied to.
4567
- *
4568
- */
4569
- readonly slot: number;
4570
- /**
4571
- * @remarks
4572
- * Creates a new EnchantmentList.
4573
- *
4574
- */
4575
- constructor(enchantmentSlot: number);
4576
- /**
4577
- * @remarks
4578
- * This function can't be called in read-only mode.
4579
- *
4580
- */
4581
- [Symbol.iterator](): Iterator<Enchantment>;
4582
- /**
4583
- * @remarks
4584
- * Attempts to add the enchantment to this collection. Returns
4585
- * true if successful.
4586
- *
4587
- * This function can't be called in read-only mode.
4588
- *
4589
- */
4590
- addEnchantment(enchantment: Enchantment): boolean;
4591
- /**
4592
- * @remarks
4593
- * Returns whether or not the provided EnchantmentInstance can
4594
- * be added to this collection.
4595
- *
4596
- * This function can't be called in read-only mode.
4597
- *
4598
- */
4599
- canAddEnchantment(enchantment: Enchantment): boolean;
4600
- /**
4601
- * @remarks
4602
- * Returns an enchantment associated with a type.
4603
- *
4604
- * This function can't be called in read-only mode.
4605
- *
4606
- * @throws This function can throw errors.
4607
- */
4608
- getEnchantment(enchantmentType: EnchantmentType | string): Enchantment | undefined;
4609
- /**
4610
- * @remarks
4611
- * If this collection has an EnchantmentInstance with type,
4612
- * returns the level of the enchantment. Returns 0 if not
4613
- * present.
4614
- *
4615
- * @throws This function can throw errors.
4616
- */
4617
- hasEnchantment(enchantmentType: EnchantmentType | string): number;
4618
- /**
4619
- * @remarks
4620
- * This function can't be called in read-only mode.
4621
- *
4622
- */
4623
- next(): IteratorResult<Enchantment>;
4624
- /**
4625
- * @remarks
4626
- * Removes an EnchantmentInstance with type from this
4627
- * collection if present.
4628
- *
4629
- * This function can't be called in read-only mode.
4630
- *
4631
- * @throws This function can throw errors.
4632
- */
4633
- removeEnchantment(enchantmentType: EnchantmentType | string): void;
4634
- }
4635
-
4636
- /**
4637
- * @beta
4638
- * This enum represents the item slot or type that an
4639
- * enchantment can be applied to.
4640
- */
4641
- export class EnchantmentSlot {
4642
- private constructor();
4643
- static readonly all = -1;
4644
- static readonly armorFeet = 4;
4645
- static readonly armorHead = 1;
4646
- static readonly armorLegs = 8;
4647
- static readonly armorTorso = 2;
4648
- static readonly axe = 512;
4649
- static readonly bow = 32;
4650
- static readonly carrotStick = 8192;
4651
- static readonly cosmeticHead = 262144;
4652
- static readonly crossbow = 65536;
4653
- static readonly elytra = 16384;
4654
- static readonly fishingRod = 4096;
4655
- static readonly flintsteel = 256;
4656
- static readonly gArmor = 15;
4657
- static readonly gDigging = 3648;
4658
- static readonly gTool = 131520;
4659
- static readonly hoe = 64;
4660
- static readonly none = 0;
4661
- static readonly pickaxe = 1024;
4662
- static readonly shears = 128;
4663
- static readonly shield = 131072;
4664
- static readonly shovel = 2048;
4665
- static readonly spear = 32768;
4666
- static readonly sword = 16;
4667
- }
4668
-
4669
4530
  /**
4670
4531
  * @beta
4671
4532
  * Contains information on a type of enchantment.
@@ -4911,7 +4772,7 @@ export class Entity {
4911
4772
  * log("Created a sneaking wolf.", 1);
4912
4773
  * ```
4913
4774
  */
4914
- addEffect(effectType: EffectType | string, duration: number, options?: EntityEffectOptions): void;
4775
+ addEffect(effectType: EffectType | string, duration: number, options?: EntityEffectOptions): Effect | undefined;
4915
4776
  /**
4916
4777
  * @remarks
4917
4778
  * Adds a specified tag to an entity.
@@ -5035,7 +4896,6 @@ export class Entity {
5035
4896
  */
5036
4897
  applyKnockback(directionX: number, directionZ: number, horizontalStrength: number, verticalStrength: number): void;
5037
4898
  /**
5038
- * @beta
5039
4899
  * @remarks
5040
4900
  * Clears all dynamic properties that have been set on this
5041
4901
  * entity.
@@ -5145,7 +5005,6 @@ export class Entity {
5145
5005
  */
5146
5006
  getComponents(): EntityComponent[];
5147
5007
  /**
5148
- * @beta
5149
5008
  * @remarks
5150
5009
  * Returns a property value.
5151
5010
  *
@@ -5158,7 +5017,6 @@ export class Entity {
5158
5017
  */
5159
5018
  getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
5160
5019
  /**
5161
- * @beta
5162
5020
  * @remarks
5163
5021
  * Returns the available set of dynamic property identifiers
5164
5022
  * that have been used on this entity.
@@ -5169,7 +5027,6 @@ export class Entity {
5169
5027
  */
5170
5028
  getDynamicPropertyIds(): string[];
5171
5029
  /**
5172
- * @beta
5173
5030
  * @remarks
5174
5031
  * Returns the total size, in bytes, of all the dynamic
5175
5032
  * properties that are currently stored for this entity. This
@@ -5358,7 +5215,6 @@ export class Entity {
5358
5215
  */
5359
5216
  kill(): boolean;
5360
5217
  /**
5361
- * @beta
5362
5218
  * @remarks
5363
5219
  * Matches the entity against the passed in options. Uses the
5364
5220
  * location of the entity for matching if the location is not
@@ -5386,7 +5242,6 @@ export class Entity {
5386
5242
  */
5387
5243
  playAnimation(animationName: string, options?: PlayAnimationOptions): void;
5388
5244
  /**
5389
- * @beta
5390
5245
  * @remarks
5391
5246
  * Immediately removes the entity from the world. The removed
5392
5247
  * entity will not perform a death animation or drop loot upon
@@ -5483,7 +5338,6 @@ export class Entity {
5483
5338
  */
5484
5339
  runCommandAsync(commandString: string): Promise<CommandResult>;
5485
5340
  /**
5486
- * @beta
5487
5341
  * @remarks
5488
5342
  * Sets a specified property to a value.
5489
5343
  *
@@ -7223,6 +7077,106 @@ export class EntityOnFireComponent extends EntityComponent {
7223
7077
  static readonly componentId = 'minecraft:onfire';
7224
7078
  }
7225
7079
 
7080
+ /**
7081
+ * @beta
7082
+ */
7083
+ // @ts-ignore Class inheritance allowed for native defined classes
7084
+ export class EntityProjectileComponent extends EntityComponent {
7085
+ private constructor();
7086
+ /**
7087
+ * @remarks
7088
+ * This property can't be edited in read-only mode.
7089
+ *
7090
+ */
7091
+ airInertia: number;
7092
+ /**
7093
+ * @remarks
7094
+ * This property can't be edited in read-only mode.
7095
+ *
7096
+ */
7097
+ catchFireOnHurt: boolean;
7098
+ /**
7099
+ * @remarks
7100
+ * This property can't be edited in read-only mode.
7101
+ *
7102
+ */
7103
+ critParticlesOnProjectileHurt: boolean;
7104
+ /**
7105
+ * @remarks
7106
+ * This property can't be edited in read-only mode.
7107
+ *
7108
+ */
7109
+ destroyOnProjectileHurt: boolean;
7110
+ /**
7111
+ * @remarks
7112
+ * This property can't be edited in read-only mode.
7113
+ *
7114
+ */
7115
+ gravity: number;
7116
+ /**
7117
+ * @remarks
7118
+ * This property can't be edited in read-only mode.
7119
+ *
7120
+ */
7121
+ hitEntitySound?: string;
7122
+ /**
7123
+ * @remarks
7124
+ * This property can't be edited in read-only mode.
7125
+ *
7126
+ */
7127
+ hitGroundSound?: string;
7128
+ /**
7129
+ * @remarks
7130
+ * This property can't be edited in read-only mode.
7131
+ *
7132
+ */
7133
+ hitParticle?: string;
7134
+ /**
7135
+ * @remarks
7136
+ * This property can't be edited in read-only mode.
7137
+ *
7138
+ */
7139
+ lightningStrikeOnHit: boolean;
7140
+ /**
7141
+ * @remarks
7142
+ * This property can't be edited in read-only mode.
7143
+ *
7144
+ */
7145
+ liquidInertia: number;
7146
+ /**
7147
+ * @remarks
7148
+ * This property can't be edited in read-only mode.
7149
+ *
7150
+ */
7151
+ onFireTime: number;
7152
+ /**
7153
+ * @remarks
7154
+ * This property can't be edited in read-only mode.
7155
+ *
7156
+ */
7157
+ owner?: Entity;
7158
+ /**
7159
+ * @remarks
7160
+ * This property can't be edited in read-only mode.
7161
+ *
7162
+ */
7163
+ shouldBounceOnHit: boolean;
7164
+ /**
7165
+ * @remarks
7166
+ * This property can't be edited in read-only mode.
7167
+ *
7168
+ */
7169
+ stopOnHit: boolean;
7170
+ static readonly componentId = 'minecraft:projectile';
7171
+ /**
7172
+ * @remarks
7173
+ * This function can't be called in read-only mode.
7174
+ *
7175
+ * @throws This function can throw errors.
7176
+ */
7177
+ shoot(velocity: Vector3, options?: ProjectileShootOptions): void;
7178
+ }
7179
+
7226
7180
  /**
7227
7181
  * Sets the distance through which the entity can push through.
7228
7182
  */
@@ -7744,7 +7698,6 @@ export class EntityWantsJockeyComponent extends EntityComponent {
7744
7698
  }
7745
7699
 
7746
7700
  /**
7747
- * @beta
7748
7701
  * Contains information regarding an explosion that has
7749
7702
  * happened.
7750
7703
  */
@@ -7771,7 +7724,6 @@ export class ExplosionAfterEvent {
7771
7724
  }
7772
7725
 
7773
7726
  /**
7774
- * @beta
7775
7727
  * Manages callbacks that are connected to when an explosion
7776
7728
  * occurs.
7777
7729
  */
@@ -7799,7 +7751,6 @@ export class ExplosionAfterEventSignal {
7799
7751
  }
7800
7752
 
7801
7753
  /**
7802
- * @beta
7803
7754
  * Contains information regarding an explosion that has
7804
7755
  * happened.
7805
7756
  */
@@ -7824,7 +7775,6 @@ export class ExplosionBeforeEvent extends ExplosionAfterEvent {
7824
7775
  }
7825
7776
 
7826
7777
  /**
7827
- * @beta
7828
7778
  * Manages callbacks that are connected to before an explosion
7829
7779
  * occurs.
7830
7780
  */
@@ -8325,32 +8275,83 @@ export class ItemDurabilityComponent extends ItemComponent {
8325
8275
 
8326
8276
  /**
8327
8277
  * @beta
8328
- * When present on an item, this item has applied enchantment
8329
- * effects. Note that this component only applies to
8330
- * data-driven items.
8331
8278
  */
8332
8279
  // @ts-ignore Class inheritance allowed for native defined classes
8333
- export class ItemEnchantsComponent extends ItemComponent {
8280
+ export class ItemEnchantableComponent extends ItemComponent {
8334
8281
  private constructor();
8282
+ static readonly componentId = 'minecraft:enchantable';
8335
8283
  /**
8336
8284
  * @remarks
8337
- * Returns a collection of the enchantments applied to this
8338
- * item stack.
8285
+ * This function can't be called in read-only mode.
8339
8286
  *
8340
- * This property can't be edited in read-only mode.
8287
+ * @throws This function can throw errors.
8288
+ *
8289
+ * {@link EnchantmentLevelOutOfBoundsError}
8341
8290
  *
8291
+ * {@link EnchantmentTypeNotCompatibleError}
8292
+ *
8293
+ * {@link EnchantmentTypeUnknownIdError}
8294
+ *
8295
+ * {@link Error}
8342
8296
  */
8343
- enchantments: EnchantmentList;
8344
- static readonly componentId = 'minecraft:enchantments';
8297
+ addEnchantment(enchantment: Enchantment): void;
8345
8298
  /**
8346
8299
  * @remarks
8347
- * Removes all enchantments applied to this item stack.
8300
+ * This function can't be called in read-only mode.
8301
+ *
8302
+ * @throws This function can throw errors.
8303
+ *
8304
+ * {@link EnchantmentLevelOutOfBoundsError}
8348
8305
  *
8306
+ * {@link EnchantmentTypeNotCompatibleError}
8307
+ *
8308
+ * {@link EnchantmentTypeUnknownIdError}
8309
+ *
8310
+ * {@link Error}
8311
+ */
8312
+ addEnchantments(enchantments: Enchantment[]): void;
8313
+ /**
8314
+ * @throws This function can throw errors.
8315
+ *
8316
+ * {@link EnchantmentLevelOutOfBoundsError}
8317
+ *
8318
+ * {@link EnchantmentTypeUnknownIdError}
8319
+ */
8320
+ canAddEnchantment(enchantment: Enchantment): boolean;
8321
+ /**
8322
+ * @throws This function can throw errors.
8323
+ *
8324
+ * {@link EnchantmentTypeUnknownIdError}
8325
+ */
8326
+ getEnchantment(enchantmentType: EnchantmentType | string): Enchantment | undefined;
8327
+ /**
8328
+ * @throws This function can throw errors.
8329
+ */
8330
+ getEnchantments(): Enchantment[];
8331
+ /**
8332
+ * @throws This function can throw errors.
8333
+ *
8334
+ * {@link EnchantmentTypeUnknownIdError}
8335
+ */
8336
+ hasEnchantment(enchantmentType: EnchantmentType | string): boolean;
8337
+ /**
8338
+ * @remarks
8349
8339
  * This function can't be called in read-only mode.
8350
8340
  *
8351
8341
  * @throws This function can throw errors.
8352
8342
  */
8353
8343
  removeAllEnchantments(): void;
8344
+ /**
8345
+ * @remarks
8346
+ * This function can't be called in read-only mode.
8347
+ *
8348
+ * @throws This function can throw errors.
8349
+ *
8350
+ * {@link EnchantmentTypeUnknownIdError}
8351
+ *
8352
+ * {@link Error}
8353
+ */
8354
+ removeEnchantment(enchantmentType: EnchantmentType | string): void;
8354
8355
  }
8355
8356
 
8356
8357
  /**
@@ -8547,6 +8548,10 @@ export class ItemStack {
8547
8548
  * the range of 1-255.
8548
8549
  */
8549
8550
  constructor(itemType: ItemType | string, amount?: number);
8551
+ /**
8552
+ * @beta
8553
+ */
8554
+ clearDynamicProperties(): void;
8550
8555
  /**
8551
8556
  * @remarks
8552
8557
  * Creates an exact copy of the item stack, including any
@@ -8603,6 +8608,18 @@ export class ItemStack {
8603
8608
  *
8604
8609
  */
8605
8610
  getComponents(): ItemComponent[];
8611
+ /**
8612
+ * @beta
8613
+ */
8614
+ getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
8615
+ /**
8616
+ * @beta
8617
+ */
8618
+ getDynamicPropertyIds(): string[];
8619
+ /**
8620
+ * @beta
8621
+ */
8622
+ getDynamicPropertyTotalByteCount(): number;
8606
8623
  /**
8607
8624
  * @remarks
8608
8625
  * Returns the lore value - a secondary display string - for an
@@ -8698,6 +8715,11 @@ export class ItemStack {
8698
8715
  * ```
8699
8716
  */
8700
8717
  setCanPlaceOn(blockIdentifiers?: string[]): void;
8718
+ /**
8719
+ * @beta
8720
+ * @throws This function can throw errors.
8721
+ */
8722
+ setDynamicProperty(identifier: string, value?: boolean | number | string | Vector3): void;
8701
8723
  /**
8702
8724
  * @remarks
8703
8725
  * Sets the lore value - a secondary display string - for an
@@ -9384,29 +9406,6 @@ export class MolangVariableMap {
9384
9406
  setVector3(variableName: string, vector: Vector3): void;
9385
9407
  }
9386
9408
 
9387
- /**
9388
- * @beta
9389
- * Contains data resulting from a navigation operation,
9390
- * including whether the navigation is possible and the path of
9391
- * navigation.
9392
- */
9393
- export class NavigationResult {
9394
- private constructor();
9395
- /**
9396
- * @remarks
9397
- * Whether the navigation result contains a full path,
9398
- * including to the requested destination.
9399
- *
9400
- */
9401
- readonly isFullPath: boolean;
9402
- /**
9403
- * @remarks
9404
- * A set of block locations that comprise the navigation route.
9405
- *
9406
- */
9407
- getPath(): Vector3[];
9408
- }
9409
-
9410
9409
  /**
9411
9410
  * @beta
9412
9411
  * Contains information related to changes to a piston
@@ -9505,107 +9504,6 @@ export class PistonActivateAfterEventSignal {
9505
9504
  unsubscribe(callback: (arg: PistonActivateAfterEvent) => void): void;
9506
9505
  }
9507
9506
 
9508
- /**
9509
- * @beta
9510
- * Contains information related to changes before a piston
9511
- * expands or retracts.
9512
- */
9513
- // @ts-ignore Class inheritance allowed for native defined classes
9514
- export class PistonActivateBeforeEvent extends BlockEvent {
9515
- private constructor();
9516
- /**
9517
- * @remarks
9518
- * If this is set to true within an event handler, the piston
9519
- * activation is canceled.
9520
- *
9521
- */
9522
- cancel: boolean;
9523
- /**
9524
- * @remarks
9525
- * True if the piston is the process of expanding.
9526
- *
9527
- */
9528
- readonly isExpanding: boolean;
9529
- /**
9530
- * @remarks
9531
- * Contains additional properties and details of the piston.
9532
- *
9533
- */
9534
- readonly piston: BlockPistonComponent;
9535
- }
9536
-
9537
- /**
9538
- * @beta
9539
- * Manages callbacks that are connected to an event that fires
9540
- * before a piston is activated.
9541
- */
9542
- export class PistonActivateBeforeEventSignal {
9543
- private constructor();
9544
- /**
9545
- * @remarks
9546
- * Adds a callback that will be called before a piston expands
9547
- * or retracts.
9548
- *
9549
- * This function can't be called in read-only mode.
9550
- *
9551
- * @example pistonBeforeEvent.ts
9552
- * ```typescript
9553
- * // set up a couple of piston blocks
9554
- * let piston = overworld.getBlock(targetLocation);
9555
- * let button = overworld.getBlock({ x: targetLocation.x, y: targetLocation.y + 1, z: targetLocation.z });
9556
- *
9557
- * if (piston === undefined || button === undefined) {
9558
- * log("Could not find block at location.");
9559
- * return -1;
9560
- * }
9561
- *
9562
- * piston.setPermutation(mc.BlockPermutation.resolve('piston').withState('facing_direction', 3));
9563
- * button.setPermutation(mc.BlockPermutation.resolve('acacia_button').withState('facing_direction', 1));
9564
- *
9565
- * const uncanceledPistonLoc = {
9566
- * x: Math.floor(targetLocation.x) + 2,
9567
- * y: Math.floor(targetLocation.y),
9568
- * z: Math.floor(targetLocation.z) + 2,
9569
- * };
9570
- *
9571
- * // this is our control.
9572
- * let uncanceledPiston = overworld.getBlock(uncanceledPistonLoc);
9573
- * let uncanceledButton = overworld.getBlock({
9574
- * x: uncanceledPistonLoc.x,
9575
- * y: uncanceledPistonLoc.y + 1,
9576
- * z: uncanceledPistonLoc.z,
9577
- * });
9578
- *
9579
- * if (uncanceledPiston === undefined || uncanceledButton === undefined) {
9580
- * log("Could not find block at location.");
9581
- * return -1;
9582
- * }
9583
- *
9584
- * uncanceledPiston.setPermutation(mc.BlockPermutation.resolve('piston').withState('facing_direction', 3));
9585
- * uncanceledButton.setPermutation(mc.BlockPermutation.resolve('acacia_button').withState('facing_direction', 1));
9586
- *
9587
- * mc.world.beforeEvents.pistonActivate.subscribe((pistonEvent: mc.PistonActivateBeforeEvent) => {
9588
- * let eventLoc = pistonEvent.piston.block.location;
9589
- * if (eventLoc.x === targetLocation.x && eventLoc.y === targetLocation.y && eventLoc.z === targetLocation.z) {
9590
- * log("Cancelling piston event");
9591
- * pistonEvent.cancel = true;
9592
- * }
9593
- * });
9594
- * ```
9595
- */
9596
- subscribe(callback: (arg: PistonActivateBeforeEvent) => void): (arg: PistonActivateBeforeEvent) => void;
9597
- /**
9598
- * @remarks
9599
- * Removes a callback from being called before a piston expands
9600
- * or retracts.
9601
- *
9602
- * This function can't be called in read-only mode.
9603
- *
9604
- * @throws This function can throw errors.
9605
- */
9606
- unsubscribe(callback: (arg: PistonActivateBeforeEvent) => void): void;
9607
- }
9608
-
9609
9507
  /**
9610
9508
  * Represents a player within the world.
9611
9509
  */
@@ -9725,6 +9623,14 @@ export class Player extends Entity {
9725
9623
  * @throws This function can throw errors.
9726
9624
  */
9727
9625
  addLevels(amount: number): number;
9626
+ /**
9627
+ * @beta
9628
+ * @remarks
9629
+ * This function can't be called in read-only mode.
9630
+ *
9631
+ * @throws This function can throw errors.
9632
+ */
9633
+ eatItem(itemStack: ItemStack): void;
9728
9634
  /**
9729
9635
  * @beta
9730
9636
  * @remarks
@@ -10187,7 +10093,6 @@ export class PlayerDimensionChangeAfterEventSignal {
10187
10093
  }
10188
10094
 
10189
10095
  /**
10190
- * @beta
10191
10096
  * Contains information regarding an event after a player
10192
10097
  * interacts with a block.
10193
10098
  */
@@ -10228,7 +10133,6 @@ export class PlayerInteractWithBlockAfterEvent {
10228
10133
  }
10229
10134
 
10230
10135
  /**
10231
- * @beta
10232
10136
  * Manages callbacks that are connected to after a player
10233
10137
  * interacts with a block.
10234
10138
  */
@@ -10258,7 +10162,6 @@ export class PlayerInteractWithBlockAfterEventSignal {
10258
10162
  }
10259
10163
 
10260
10164
  /**
10261
- * @beta
10262
10165
  * Contains information regarding an event before a player
10263
10166
  * interacts with a block.
10264
10167
  */
@@ -10305,7 +10208,6 @@ export class PlayerInteractWithBlockBeforeEvent {
10305
10208
  }
10306
10209
 
10307
10210
  /**
10308
- * @beta
10309
10211
  * Manages callbacks that are connected to before a player
10310
10212
  * interacts with a block.
10311
10213
  */
@@ -10335,7 +10237,6 @@ export class PlayerInteractWithBlockBeforeEventSignal {
10335
10237
  }
10336
10238
 
10337
10239
  /**
10338
- * @beta
10339
10240
  * Contains information regarding an event after a player
10340
10241
  * interacts with an entity.
10341
10242
  */
@@ -10363,7 +10264,6 @@ export class PlayerInteractWithEntityAfterEvent {
10363
10264
  }
10364
10265
 
10365
10266
  /**
10366
- * @beta
10367
10267
  * Manages callbacks that are connected to after a player
10368
10268
  * interacts with an entity.
10369
10269
  */
@@ -10393,7 +10293,6 @@ export class PlayerInteractWithEntityAfterEventSignal {
10393
10293
  }
10394
10294
 
10395
10295
  /**
10396
- * @beta
10397
10296
  * Contains information regarding an event before a player
10398
10297
  * interacts with an entity.
10399
10298
  */
@@ -10427,7 +10326,6 @@ export class PlayerInteractWithEntityBeforeEvent {
10427
10326
  }
10428
10327
 
10429
10328
  /**
10430
- * @beta
10431
10329
  * Manages callbacks that are connected to before a player
10432
10330
  * interacts with an entity.
10433
10331
  */
@@ -10543,17 +10441,11 @@ export class PlayerLeaveAfterEventSignal extends IPlayerLeaveAfterEventSignal {
10543
10441
  private constructor();
10544
10442
  }
10545
10443
 
10546
- /**
10547
- * @beta
10548
- */
10549
10444
  export class PlayerLeaveBeforeEvent {
10550
10445
  private constructor();
10551
10446
  readonly player: Player;
10552
10447
  }
10553
10448
 
10554
- /**
10555
- * @beta
10556
- */
10557
10449
  export class PlayerLeaveBeforeEventSignal {
10558
10450
  private constructor();
10559
10451
  /**
@@ -10984,7 +10876,7 @@ export class Scoreboard {
10984
10876
  *
10985
10877
  * @throws This function can throw errors.
10986
10878
  */
10987
- addObjective(objectiveId: string, displayName: string): ScoreboardObjective;
10879
+ addObjective(objectiveId: string, displayName?: string): ScoreboardObjective;
10988
10880
  /**
10989
10881
  * @remarks
10990
10882
  * Clears the objective that occupies a display slot.
@@ -12028,7 +11920,6 @@ export class World {
12028
11920
  */
12029
11921
  broadcastClientMessage(id: string, value: string): void;
12030
11922
  /**
12031
- * @beta
12032
11923
  * @remarks
12033
11924
  * Clears the set of dynamic properties declared for this
12034
11925
  * behavior pack within the world.
@@ -12081,7 +11972,6 @@ export class World {
12081
11972
  */
12082
11973
  getDimension(dimensionId: string): Dimension;
12083
11974
  /**
12084
- * @beta
12085
11975
  * @remarks
12086
11976
  * Returns a property value.
12087
11977
  *
@@ -12148,7 +12038,6 @@ export class World {
12148
12038
  */
12149
12039
  getDynamicProperty(identifier: string): boolean | number | string | Vector3 | undefined;
12150
12040
  /**
12151
- * @beta
12152
12041
  * @remarks
12153
12042
  * Gets a set of dynamic property identifiers that have been
12154
12043
  * set in this world.
@@ -12158,7 +12047,6 @@ export class World {
12158
12047
  */
12159
12048
  getDynamicPropertyIds(): string[];
12160
12049
  /**
12161
- * @beta
12162
12050
  * @remarks
12163
12051
  * Gets the total byte count of dynamic properties. This could
12164
12052
  * potentially be used for your own analytics to ensure you're
@@ -12167,7 +12055,6 @@ export class World {
12167
12055
  */
12168
12056
  getDynamicPropertyTotalByteCount(): number;
12169
12057
  /**
12170
- * @beta
12171
12058
  * @remarks
12172
12059
  * Returns an entity based on the provided id.
12173
12060
  *
@@ -12360,7 +12247,6 @@ export class World {
12360
12247
  */
12361
12248
  setDefaultSpawnLocation(spawnLocation: Vector3): void;
12362
12249
  /**
12363
- * @beta
12364
12250
  * @remarks
12365
12251
  * Sets a specified property to a value.
12366
12252
  *
@@ -12823,13 +12709,6 @@ export class WorldBeforeEvents {
12823
12709
  *
12824
12710
  */
12825
12711
  readonly itemUseOn: ItemUseOnBeforeEventSignal;
12826
- /**
12827
- * @beta
12828
- * @remarks
12829
- * This event fires when a piston expands or retracts.
12830
- *
12831
- */
12832
- readonly pistonActivate: PistonActivateBeforeEventSignal;
12833
12712
  /**
12834
12713
  * @remarks
12835
12714
  * This event fires before a block is broken by a player.
@@ -12851,7 +12730,6 @@ export class WorldBeforeEvents {
12851
12730
  */
12852
12731
  readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
12853
12732
  /**
12854
- * @beta
12855
12733
  * @remarks
12856
12734
  * Fires when a player leaves the game.
12857
12735
  *
@@ -13288,6 +13166,26 @@ export interface DimensionLocation {
13288
13166
  z: number;
13289
13167
  }
13290
13168
 
13169
+ /**
13170
+ * @beta
13171
+ * This class represents a specific leveled enchantment that is
13172
+ * applied to an item.
13173
+ */
13174
+ export interface Enchantment {
13175
+ /**
13176
+ * @remarks
13177
+ * The level of this enchantment instance.
13178
+ *
13179
+ */
13180
+ level: number;
13181
+ /**
13182
+ * @remarks
13183
+ * The enchantment type of this instance.
13184
+ *
13185
+ */
13186
+ type: EnchantmentType | string;
13187
+ }
13188
+
13291
13189
  /**
13292
13190
  * Additional options for when damage has been applied via a
13293
13191
  * projectile.
@@ -13749,6 +13647,7 @@ export interface PlayAnimationOptions {
13749
13647
  *
13750
13648
  */
13751
13649
  nextState?: string;
13650
+ players?: string[];
13752
13651
  /**
13753
13652
  * @remarks
13754
13653
  * Specifies a Molang expression for when this animation should
@@ -13783,6 +13682,13 @@ export interface PlayerSoundOptions {
13783
13682
  volume?: number;
13784
13683
  }
13785
13684
 
13685
+ /**
13686
+ * @beta
13687
+ */
13688
+ export interface ProjectileShootOptions {
13689
+ uncertainty?: number;
13690
+ }
13691
+
13786
13692
  /**
13787
13693
  * Defines a JSON structure that is used for more flexible.
13788
13694
  */
@@ -14077,6 +13983,30 @@ export class CommandError extends Error {
14077
13983
  private constructor();
14078
13984
  }
14079
13985
 
13986
+ /**
13987
+ * @beta
13988
+ */
13989
+ // @ts-ignore Class inheritance allowed for native defined classes
13990
+ export class EnchantmentLevelOutOfBoundsError extends Error {
13991
+ private constructor();
13992
+ }
13993
+
13994
+ /**
13995
+ * @beta
13996
+ */
13997
+ // @ts-ignore Class inheritance allowed for native defined classes
13998
+ export class EnchantmentTypeNotCompatibleError extends Error {
13999
+ private constructor();
14000
+ }
14001
+
14002
+ /**
14003
+ * @beta
14004
+ */
14005
+ // @ts-ignore Class inheritance allowed for native defined classes
14006
+ export class EnchantmentTypeUnknownIdError extends Error {
14007
+ private constructor();
14008
+ }
14009
+
14080
14010
  // @ts-ignore Class inheritance allowed for native defined classes
14081
14011
  export class LocationInUnloadedChunkError extends Error {
14082
14012
  private constructor();
@@ -14098,7 +14028,6 @@ export const MoonPhaseCount = 8;
14098
14028
  */
14099
14029
  export const TicksPerDay = 24000;
14100
14030
  /**
14101
- * @beta
14102
14031
  * @remarks
14103
14032
  * How many times the server ticks per second of real time.
14104
14033
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.9.0-beta.1.20.60-preview.21",
3
+ "version": "1.9.0-beta.1.20.60-preview.23",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/common": "^1.1.0-rc.1.20.60-preview.21"
16
+ "@minecraft/common": "^1.1.0"
17
17
  },
18
18
  "license": "MIT"
19
19
  }