@minecraft/server 1.1.0-beta.1.19.70-preview.20 → 1.1.0-beta.1.19.70-preview.22

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 +77 -128
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * ```json
17
17
  * {
18
18
  * "module_name": "@minecraft/server",
19
- * "version": "1.1.0-internal.1.19.70-preview.20"
19
+ * "version": "1.1.0-internal.1.19.70-preview.22"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -181,6 +181,11 @@ export enum GameMode {
181
181
  */
182
182
  survival = 'survival',
183
183
  }
184
+ export enum ItemLockMode {
185
+ inventory = 'inventory',
186
+ none = 'none',
187
+ slot = 'slot',
188
+ }
184
189
  export enum MessageSourceType {
185
190
  clientScript = 'clientScript',
186
191
  commandBlock = 'commandBlock',
@@ -377,16 +382,12 @@ export class BeforeExplosionEvent {
377
382
  * Dimension where the explosion has occurred.
378
383
  */
379
384
  readonly dimension: Dimension;
380
- /**
381
- * A collection of blocks impacted by this explosion event.
382
- * Note that this property can be updated to change the set of
383
- * blocks impacted.
384
- */
385
- impactedBlocks: Vector3[];
386
385
  /**
387
386
  * Optional source of the explosion.
388
387
  */
389
388
  readonly source: Entity;
389
+ getImpactedBlocks(): Vector3[];
390
+ setImpactedBlocks(blocks: Vector3[]): void;
390
391
  }
391
392
  /**
392
393
  * @beta
@@ -513,10 +514,6 @@ export class BeforeItemUseOnEvent {
513
514
  * The face of the block that an item is being used on.
514
515
  */
515
516
  readonly blockFace: Direction;
516
- /**
517
- * Location of the block being impacted.
518
- */
519
- readonly blockLocation: Vector3;
520
517
  /**
521
518
  * If set to true, this will cancel the item use behavior.
522
519
  */
@@ -539,6 +536,7 @@ export class BeforeItemUseOnEvent {
539
536
  * Returns the source entity that triggered this item event.
540
537
  */
541
538
  readonly source: Entity;
539
+ getBlockLocation(): Vector3;
542
540
  }
543
541
  /**
544
542
  * @beta
@@ -987,10 +985,6 @@ export class BlockInventoryComponent extends BlockComponent {
987
985
  * @throws This property can throw when used.
988
986
  */
989
987
  readonly container: BlockInventoryComponentContainer;
990
- /**
991
- * Coordinates of the specified block.
992
- */
993
- readonly location: Vector3;
994
988
  /**
995
989
  * Identifier of this component. Should always be
996
990
  * minecraft:inventory.
@@ -1128,10 +1122,6 @@ export class BlockLavaContainerComponent extends BlockComponent {
1128
1122
  * FluidContainer.maxFillLevel (6).
1129
1123
  */
1130
1124
  fillLevel: number;
1131
- /**
1132
- * Source location of the block.
1133
- */
1134
- readonly location: Vector3;
1135
1125
  /**
1136
1126
  * Identifier of this component. Should always be
1137
1127
  * minecraft:lavaContainer.
@@ -1214,12 +1204,6 @@ export class BlockPermutation {
1214
1204
  */
1215
1205
  export class BlockPistonComponent extends BlockComponent {
1216
1206
  protected constructor();
1217
- /**
1218
- * A set of locations for blocks that are impacted by the
1219
- * activation of this piston.
1220
- * @throws This property can throw when used.
1221
- */
1222
- readonly attachedBlocks: Vector3[];
1223
1207
  /**
1224
1208
  * Whether the piston is fully expanded.
1225
1209
  * @throws This property can throw when used.
@@ -1246,10 +1230,6 @@ export class BlockPistonComponent extends BlockComponent {
1246
1230
  * @throws This property can throw when used.
1247
1231
  */
1248
1232
  readonly isRetracting: boolean;
1249
- /**
1250
- * Source location of the block.
1251
- */
1252
- readonly location: Vector3;
1253
1233
  /**
1254
1234
  * Identifier of this component.
1255
1235
  */
@@ -1258,6 +1238,7 @@ export class BlockPistonComponent extends BlockComponent {
1258
1238
  * Identifier of this component.
1259
1239
  */
1260
1240
  static readonly componentId = 'minecraft:piston';
1241
+ getAttachedBlocks(): Vector3[];
1261
1242
  }
1262
1243
  /**
1263
1244
  * @beta
@@ -1316,10 +1297,6 @@ export class BlockPotionContainerComponent extends BlockComponent {
1316
1297
  * FluidContainer.maxFillLevel (6).
1317
1298
  */
1318
1299
  fillLevel: number;
1319
- /**
1320
- * Source location of the block.
1321
- */
1322
- readonly location: Vector3;
1323
1300
  /**
1324
1301
  * Identifier of this component. Should always be
1325
1302
  * minecraft:potionContainer.
@@ -1951,10 +1928,6 @@ export class BlockProperties {
1951
1928
  */
1952
1929
  export class BlockRecordPlayerComponent extends BlockComponent {
1953
1930
  protected constructor();
1954
- /**
1955
- * Location of this record-playing block.
1956
- */
1957
- readonly location: Vector3;
1958
1931
  /**
1959
1932
  * Identifier of this component. Should always be
1960
1933
  * minecraft:recordPlayer.
@@ -1993,10 +1966,6 @@ export class BlockRecordPlayerComponent extends BlockComponent {
1993
1966
  */
1994
1967
  export class BlockSignComponent extends BlockComponent {
1995
1968
  protected constructor();
1996
- /**
1997
- * Location of the sign.
1998
- */
1999
- readonly location: Vector3;
2000
1969
  /**
2001
1970
  * Text of the sign
2002
1971
  * @throws This property can throw when used.
@@ -2026,10 +1995,6 @@ export class BlockSnowContainerComponent extends BlockComponent {
2026
1995
  * FluidContainer.maxFillLevel (6).
2027
1996
  */
2028
1997
  fillLevel: number;
2029
- /**
2030
- * Source location of the block.
2031
- */
2032
- readonly location: Vector3;
2033
1998
  /**
2034
1999
  * Identifier of this component. Should always be
2035
2000
  * minecraft:snowContainer.
@@ -2081,10 +2046,6 @@ export class BlockWaterContainerComponent extends BlockComponent {
2081
2046
  * FluidContainer.maxFillLevel (6).
2082
2047
  */
2083
2048
  fillLevel: number;
2084
- /**
2085
- * Source location of the block.
2086
- */
2087
- readonly location: Vector3;
2088
2049
  /**
2089
2050
  * Identifier of this component. Should always be
2090
2051
  * minecraft:waterContainer.
@@ -2373,29 +2334,28 @@ export class ContainerSlot {
2373
2334
  * Modifier value for the item type stored within the slot.
2374
2335
  */
2375
2336
  data: number;
2337
+ readonly isStackable: boolean;
2376
2338
  /**
2377
2339
  * If true, the state of this container slot is still valid
2378
2340
  * (e.g., the underlying block or entity for this container
2379
2341
  * slot still exists.)
2380
2342
  */
2381
2343
  readonly isValid: boolean;
2344
+ keepOnDeath: boolean;
2345
+ lockMode: ItemLockMode;
2346
+ readonly maxAmount: number;
2382
2347
  /**
2383
2348
  * Returns a name tag for the container slot.
2384
2349
  */
2385
2350
  nameTag?: string;
2351
+ readonly 'type': ItemType;
2386
2352
  /**
2387
2353
  * Returns a string identifier of the type if item stored in
2388
2354
  * this slot.
2389
2355
  * @throws This property can throw when used.
2390
2356
  */
2391
2357
  readonly typeId?: string;
2392
- /**
2393
- * @remarks
2394
- * Empties the item stored at the specified slot.
2395
- * @throws This function can throw errors.
2396
- */
2397
- clearItem(): void;
2398
- clearLore(): void;
2358
+ clone(): ItemStack;
2399
2359
  /**
2400
2360
  * @remarks
2401
2361
  * Returns the item stored within the container.
@@ -2409,6 +2369,9 @@ export class ContainerSlot {
2409
2369
  * @throws This function can throw errors.
2410
2370
  */
2411
2371
  getLore(): string[];
2372
+ isStackableWith(itemStack: ItemStack): boolean;
2373
+ setCanDestroy(blockIdentifiers?: string[]): void;
2374
+ setCanPlaceOn(blockIdentifiers?: string[]): void;
2412
2375
  /**
2413
2376
  * @remarks
2414
2377
  * Sets the item within the slot to a new value.
@@ -3024,12 +2987,6 @@ export class Entity {
3024
2987
  * @throws This property can throw when used.
3025
2988
  */
3026
2989
  readonly dimension: Dimension;
3027
- /**
3028
- * @beta
3029
- * Location of the center of the head component of the entity.
3030
- * @throws This property can throw when used.
3031
- */
3032
- readonly headLocation: Vector3;
3033
2990
  /**
3034
2991
  * Unique identifier of the entity. This identifier is intended
3035
2992
  * to be consistent across loads of a world instance. No
@@ -3130,6 +3087,9 @@ export class Entity {
3130
3087
  */
3131
3088
  addTag(tag: string): boolean;
3132
3089
  applyDamage(amount: number, source?: EntityDamageSource): boolean;
3090
+ applyImpulse(vector: Vector3): void;
3091
+ applyKnockback(directionX: number, directionZ: number, horizontalStrength: number, verticalStrength: number): void;
3092
+ clearVelocity(): void;
3133
3093
  extinguishFire(useEffects?: boolean): boolean;
3134
3094
  /**
3135
3095
  * @beta
@@ -3192,6 +3152,7 @@ export class Entity {
3192
3152
  * @throws This function can throw errors.
3193
3153
  */
3194
3154
  getEntitiesFromViewDirection(options?: EntityRaycastOptions): Entity[];
3155
+ getHeadLocation(): Vector3;
3195
3156
  getRotation(): XYRotation;
3196
3157
  /**
3197
3158
  * @beta
@@ -3229,6 +3190,7 @@ export class Entity {
3229
3190
  * @throws This function can throw errors.
3230
3191
  */
3231
3192
  kill(): void;
3193
+ playAnimation(animationName: string, options?: PlayAnimationOptions): void;
3232
3194
  /**
3233
3195
  * @beta
3234
3196
  * @remarks
@@ -3280,15 +3242,6 @@ export class Entity {
3280
3242
  * @throws This function can throw errors.
3281
3243
  */
3282
3244
  setRotation(degreesX: number, degreesY: number): void;
3283
- /**
3284
- * @beta
3285
- * @remarks
3286
- * Sets a velocity for the entity to move with.
3287
- * @param velocity
3288
- * X/Y/Z components of the velocity.
3289
- * @throws This function can throw errors.
3290
- */
3291
- setVelocity(velocity: Vector3): void;
3292
3245
  /**
3293
3246
  * @beta
3294
3247
  * @remarks
@@ -5977,14 +5930,11 @@ export class ExplosionEvent {
5977
5930
  * Dimension where the explosion has occurred.
5978
5931
  */
5979
5932
  readonly dimension: Dimension;
5980
- /**
5981
- * A collection of blocks impacted by this explosion event.
5982
- */
5983
- readonly impactedBlocks: Vector3[];
5984
5933
  /**
5985
5934
  * Optional source of the explosion.
5986
5935
  */
5987
5936
  readonly source: Entity;
5937
+ getImpactedBlocks(): Vector3[];
5988
5938
  }
5989
5939
  /**
5990
5940
  * @beta
@@ -6535,14 +6485,15 @@ export class ItemStack {
6535
6485
  * 0 and 64.
6536
6486
  */
6537
6487
  amount: number;
6538
- /**
6539
- * A data value used to configure alternate states of the item.
6540
- */
6541
- data: number;
6488
+ readonly isStackable: boolean;
6489
+ keepOnDeath: boolean;
6490
+ lockMode: ItemLockMode;
6491
+ readonly maxAmount: number;
6542
6492
  /**
6543
6493
  * Given name of this stack of items.
6544
6494
  */
6545
6495
  nameTag?: string;
6496
+ readonly 'type': ItemType;
6546
6497
  /**
6547
6498
  * Identifier of the type of items for the stack. If a
6548
6499
  * namespace is not specified, 'minecraft:' is assumed.
@@ -6560,12 +6511,10 @@ export class ItemStack {
6560
6511
  * @param amount
6561
6512
  * Number of items to place in the stack, between 1 and 64.
6562
6513
  * Note that certain items can only have one item in the stack.
6563
- * @param data
6564
- * Optional data value used for creating the item, or 0 if no
6565
- * data value is specified.
6514
+ * @throws This function can throw errors.
6566
6515
  */
6567
- constructor(itemType: ItemType, amount?: number, data?: number);
6568
- clearLore(): void;
6516
+ constructor(itemType: ItemType | string, amount?: number);
6517
+ clone(): ItemStack;
6569
6518
  /**
6570
6519
  * @remarks
6571
6520
  * Gets a component (that represents additional capabilities)
@@ -6599,6 +6548,9 @@ export class ItemStack {
6599
6548
  * is assumed.
6600
6549
  */
6601
6550
  hasComponent(componentId: string): boolean;
6551
+ isStackableWith(itemStack: ItemStack): boolean;
6552
+ setCanDestroy(blockIdentifiers?: string[]): void;
6553
+ setCanPlaceOn(blockIdentifiers?: string[]): void;
6602
6554
  /**
6603
6555
  * @remarks
6604
6556
  * Sets the lore value - a secondary display string - for an
@@ -6672,15 +6624,6 @@ export class ItemStartUseOnEvent {
6672
6624
  * The face of the block that an item is being used on.
6673
6625
  */
6674
6626
  readonly blockFace: Direction;
6675
- /**
6676
- * Location of the block being impacted.
6677
- */
6678
- readonly blockLocation: Vector3;
6679
- /**
6680
- * Location of the resulting build block position. Useful for
6681
- * determining where a block was placed.
6682
- */
6683
- readonly buildBlockLocation: Vector3;
6684
6627
  /**
6685
6628
  * The impacted item stack that is starting to be used.
6686
6629
  */
@@ -6689,6 +6632,8 @@ export class ItemStartUseOnEvent {
6689
6632
  * Returns the source entity that triggered this item event.
6690
6633
  */
6691
6634
  readonly source: Entity;
6635
+ getBlockLocation(): Vector3;
6636
+ getBuildBlockLocation(): Vector3;
6692
6637
  }
6693
6638
  /**
6694
6639
  * @beta
@@ -6766,10 +6711,6 @@ export class ItemStopChargeEventSignal {
6766
6711
  */
6767
6712
  export class ItemStopUseOnEvent {
6768
6713
  protected constructor();
6769
- /**
6770
- * Location of the block being impacted.
6771
- */
6772
- readonly blockLocation: Vector3;
6773
6714
  /**
6774
6715
  * The impacted item stack that is being used on a block.
6775
6716
  */
@@ -6778,6 +6719,7 @@ export class ItemStopUseOnEvent {
6778
6719
  * Returns the source entity that triggered this item event.
6779
6720
  */
6780
6721
  readonly source: Entity;
6722
+ getBlockLocation(): Vector3;
6781
6723
  }
6782
6724
  /**
6783
6725
  * @beta
@@ -6889,10 +6831,6 @@ export class ItemUseOnEvent {
6889
6831
  * The face of the block that an item is being used on.
6890
6832
  */
6891
6833
  readonly blockFace: Direction;
6892
- /**
6893
- * Location of the block being impacted.
6894
- */
6895
- readonly blockLocation: Vector3;
6896
6834
  /**
6897
6835
  * X coordinate of the item-use impact location on the face of
6898
6836
  * the target block.
@@ -6911,6 +6849,7 @@ export class ItemUseOnEvent {
6911
6849
  * Returns the source entity that triggered this item event.
6912
6850
  */
6913
6851
  readonly source: Entity;
6852
+ getBlockLocation(): Vector3;
6914
6853
  }
6915
6854
  /**
6916
6855
  * @beta
@@ -12993,24 +12932,36 @@ export class MinecraftItemTypes {
12993
12932
  export class MolangVariableMap {
12994
12933
  /**
12995
12934
  * @remarks
12996
- * Sets a Molang rendering/animation variable with the value of
12997
- * a Red/Green/Blue color.
12935
+ * Adds the following variables to Molang:
12936
+ * - `<variable_name>.r` - Red color value [0-1]
12937
+ * - `<variable_name>.g` - Green color value [0-1]
12938
+ * - `<variable_name>.b` - Blue color value [0-1]
12998
12939
  * @param variableName
12999
12940
  * @param color
13000
12941
  */
13001
12942
  setColorRGB(variableName: string, color: Color): MolangVariableMap;
13002
12943
  /**
13003
12944
  * @remarks
13004
- * Sets a Molang rendering/animation variable with the value of
13005
- * a Red/Green/Blue color + Alpha (transparency) value.
12945
+ * Adds the following variables to Molang:
12946
+ * - `<variable_name>.r` - Red color value [0-1]
12947
+ * - `<variable_name>.g` - Green color value [0-1]
12948
+ * - `<variable_name>.b` - Blue color value [0-1]
12949
+ * - `<variable_name>.a` - Alpha (transparency) color value
12950
+ * [0-1]
13006
12951
  * @param variableName
13007
12952
  * @param color
13008
12953
  */
13009
12954
  setColorRGBA(variableName: string, color: Color): MolangVariableMap;
13010
12955
  /**
13011
12956
  * @remarks
13012
- * Sets the speed and direction for a Molang (rendering and
13013
- * animation) variable.
12957
+ * Adds the following variables to Molang:
12958
+ * - `<variable_name>.speed` - Speed number provided
12959
+ * - `<variable_name>.direction_x` - X value from the {@link
12960
+ * Vector3} provided
12961
+ * - `<variable_name>.direction_y` - Y value from the {@link
12962
+ * Vector3} provided
12963
+ * - `<variable_name>.direction_z` - Z value from the {@link
12964
+ * Vector3} provided
13014
12965
  * @param variableName
13015
12966
  * @param speed
13016
12967
  * @param direction
@@ -13018,8 +12969,13 @@ export class MolangVariableMap {
13018
12969
  setSpeedAndDirection(variableName: string, speed: number, direction: Vector): MolangVariableMap;
13019
12970
  /**
13020
12971
  * @remarks
13021
- * Sets a vector value for a Molang (rendering and animation)
13022
- * variable.
12972
+ * Adds the following variables to Molang:
12973
+ * - `<variable_name>.x` - X value from the {@link Vector3}
12974
+ * provided
12975
+ * - `<variable_name>.y` - Y value from the {@link Vector3}
12976
+ * provided
12977
+ * - `<variable_name>.z` - Z value from the {@link Vector3}
12978
+ * provided
13023
12979
  * @param variableName
13024
12980
  * @param vector
13025
12981
  */
@@ -13038,10 +12994,7 @@ export class NavigationResult {
13038
12994
  * including to the requested destination.
13039
12995
  */
13040
12996
  readonly isFullPath: boolean;
13041
- /**
13042
- * A set of block locations that comprise the navigation route.
13043
- */
13044
- readonly path: Vector3[];
12997
+ getPath(): Vector3[];
13045
12998
  }
13046
12999
  /**
13047
13000
  * @beta
@@ -13121,12 +13074,6 @@ export class Player extends Entity {
13121
13074
  * @throws This property can throw when used.
13122
13075
  */
13123
13076
  readonly dimension: Dimension;
13124
- /**
13125
- * @beta
13126
- * Location of the center of the head component of the player.
13127
- * @throws This property can throw when used.
13128
- */
13129
- readonly headLocation: Vector3;
13130
13077
  /**
13131
13078
  * Unique identifier of the player. This identifier is intended
13132
13079
  * to be consistent across loads of a world instance. No
@@ -13218,7 +13165,10 @@ export class Player extends Entity {
13218
13165
  */
13219
13166
  addTag(tag: string): boolean;
13220
13167
  applyDamage(amount: number, source?: EntityDamageSource): boolean;
13168
+ applyImpulse(vector: Vector3): void;
13169
+ applyKnockback(directionX: number, directionZ: number, horizontalStrength: number, verticalStrength: number): void;
13221
13170
  clearSpawn(): void;
13171
+ clearVelocity(): void;
13222
13172
  extinguishFire(useEffects?: boolean): boolean;
13223
13173
  /**
13224
13174
  * @beta
@@ -13281,6 +13231,7 @@ export class Player extends Entity {
13281
13231
  * @throws This function can throw errors.
13282
13232
  */
13283
13233
  getEntitiesFromViewDirection(options?: EntityRaycastOptions): Entity[];
13234
+ getHeadLocation(): Vector3;
13284
13235
  /**
13285
13236
  * @beta
13286
13237
  * @remarks
@@ -13338,6 +13289,7 @@ export class Player extends Entity {
13338
13289
  * @throws This function can throw errors.
13339
13290
  */
13340
13291
  kill(): void;
13292
+ playAnimation(animationName: string, options?: PlayAnimationOptions): void;
13341
13293
  /**
13342
13294
  * @beta
13343
13295
  * @remarks
@@ -13422,15 +13374,6 @@ export class Player extends Entity {
13422
13374
  */
13423
13375
  setRotation(degreesX: number, degreesY: number): void;
13424
13376
  setSpawn(spawnPosition: Vector3, spawnDimension: Dimension): void;
13425
- /**
13426
- * @beta
13427
- * @remarks
13428
- * Sets a velocity for the entity to move with.
13429
- * @param velocity
13430
- * X/Y/Z components of the velocity.
13431
- * @throws This function can throw errors.
13432
- */
13433
- setVelocity(velocity: Vector3): void;
13434
13377
  /**
13435
13378
  * @beta
13436
13379
  * @remarks
@@ -14975,6 +14918,12 @@ export interface NumberRange {
14975
14918
  */
14976
14919
  min: number;
14977
14920
  }
14921
+ export interface PlayAnimationOptions {
14922
+ blendOutTime?: number;
14923
+ controller?: string;
14924
+ nextState?: string;
14925
+ stopExpression?: string;
14926
+ }
14978
14927
  export interface RawMessage {
14979
14928
  rawtext?: (RawMessage | string)[];
14980
14929
  score?: RawMessageScore;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.1.0-beta.1.19.70-preview.20",
3
+ "version": "1.1.0-beta.1.19.70-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {