@minecraft/server 1.1.0-beta.preview.1.19.50.25 → 1.1.0-beta.preview.1.19.60.20

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 +74 -142
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  * ```json
16
16
  * {
17
17
  * "module_name": "@minecraft/server",
18
- * "version": "1.1.0-internal.preview.1.19.50.25"
18
+ * "version": "1.1.0-internal.preview.1.19.60.20"
19
19
  * }
20
20
  * ```
21
21
  *
@@ -984,6 +984,8 @@ export class BlockInventoryComponentContainer extends Container {
984
984
  * @throws This function can throw errors.
985
985
  */
986
986
  addItem(itemStack: ItemStack): void;
987
+ clearAll(): void;
988
+ clearItem(slot: number): void;
987
989
  /**
988
990
  * @remarks
989
991
  * Gets the item stack for the set of items at the specified
@@ -1000,6 +1002,7 @@ export class BlockInventoryComponentContainer extends Container {
1000
1002
  * ```
1001
1003
  */
1002
1004
  getItem(slot: number): ItemStack;
1005
+ getSlot(slot: number): ContainerSlot;
1003
1006
  /**
1004
1007
  * @remarks
1005
1008
  * Sets an item stack within a particular slot.
@@ -1009,7 +1012,7 @@ export class BlockInventoryComponentContainer extends Container {
1009
1012
  * Stack of items to place within the specified slot.
1010
1013
  * @throws This function can throw errors.
1011
1014
  */
1012
- setItem(slot: number, itemStack: ItemStack): void;
1015
+ setItem(slot: number, itemStack?: ItemStack): void;
1013
1016
  /**
1014
1017
  * @remarks
1015
1018
  * Swaps items between two different slots within containers.
@@ -2297,6 +2300,8 @@ export class Container {
2297
2300
  * @throws This function can throw errors.
2298
2301
  */
2299
2302
  addItem(itemStack: ItemStack): void;
2303
+ clearAll(): void;
2304
+ clearItem(slot: number): void;
2300
2305
  /**
2301
2306
  * @remarks
2302
2307
  * Gets the item stack for the set of items at the specified
@@ -2317,6 +2322,7 @@ export class Container {
2317
2322
  * ```
2318
2323
  */
2319
2324
  getItem(slot: number): ItemStack;
2325
+ getSlot(slot: number): ContainerSlot;
2320
2326
  /**
2321
2327
  * @remarks
2322
2328
  * Sets an item stack within a particular slot.
@@ -2326,7 +2332,7 @@ export class Container {
2326
2332
  * Stack of items to place within the specified slot.
2327
2333
  * @throws This function can throw errors.
2328
2334
  */
2329
- setItem(slot: number, itemStack: ItemStack): void;
2335
+ setItem(slot: number, itemStack?: ItemStack): void;
2330
2336
  /**
2331
2337
  * @remarks
2332
2338
  * Swaps items between two different slots within containers.
@@ -2364,6 +2370,19 @@ export class Container {
2364
2370
  */
2365
2371
  transferItem(fromSlot: number, toSlot: number, toContainer: Container): boolean;
2366
2372
  }
2373
+ export class ContainerSlot {
2374
+ protected constructor();
2375
+ amount: number;
2376
+ data: number;
2377
+ readonly isValid: boolean;
2378
+ nameTag?: string;
2379
+ readonly typeId?: string;
2380
+ clearItem(): void;
2381
+ getItem(): ItemStack;
2382
+ getLore(): string[];
2383
+ setItem(itemStack?: ItemStack): void;
2384
+ setLore(loreList: string[]): void;
2385
+ }
2367
2386
  /**
2368
2387
  * Contains information related to firing of a data driven
2369
2388
  * entity event - for example, the minecraft:ageable_grow_up
@@ -2977,11 +2996,7 @@ export class Entity {
2977
2996
  * @throws This property can throw when used.
2978
2997
  */
2979
2998
  readonly velocity: Vector;
2980
- /**
2981
- * Vector of the current view of the entity.
2982
- * @throws This property can throw when used.
2983
- */
2984
- readonly viewVector: Vector;
2999
+ readonly viewDirection: Vector3;
2985
3000
  /**
2986
3001
  * @remarks
2987
3002
  * Adds an effect, like poison, to the entity.
@@ -3030,15 +3045,7 @@ export class Entity {
3030
3045
  * @throws This function can throw errors.
3031
3046
  */
3032
3047
  addTag(tag: string): boolean;
3033
- /**
3034
- * @remarks
3035
- * Gets the first block that intersects with the vector of the
3036
- * view of this entity.
3037
- * @param options
3038
- * Additional options for processing this raycast query.
3039
- * @throws This function can throw errors.
3040
- */
3041
- getBlockFromViewVector(options?: BlockRaycastOptions): Block;
3048
+ getBlockFromViewDirection(options?: BlockRaycastOptions): Block;
3042
3049
  /**
3043
3050
  * @remarks
3044
3051
  * Gets a component (that represents additional capabilities)
@@ -3077,15 +3084,7 @@ export class Entity {
3077
3084
  * @throws This function can throw errors.
3078
3085
  */
3079
3086
  getEffect(effectType: EffectType): Effect;
3080
- /**
3081
- * @remarks
3082
- * Gets the first entity that intersects with the vector of the
3083
- * view of this entity.
3084
- * @param options
3085
- * Additional options for processing this raycast query.
3086
- * @throws This function can throw errors.
3087
- */
3088
- getEntitiesFromViewVector(options?: EntityRaycastOptions): Entity[];
3087
+ getEntitiesFromViewDirection(options?: EntityRaycastOptions): Entity[];
3089
3088
  /**
3090
3089
  * @remarks
3091
3090
  * Returns all tags associated with an entity.
@@ -3438,60 +3437,6 @@ export class EntityColorComponent extends IEntityComponent {
3438
3437
  */
3439
3438
  static readonly componentId = 'minecraft:color';
3440
3439
  }
3441
- /**
3442
- * Contains information related to the creation of a new
3443
- * entity.
3444
- */
3445
- export class EntityCreateEvent {
3446
- protected constructor();
3447
- /**
3448
- * New entity that was created.
3449
- */
3450
- entity: Entity;
3451
- }
3452
- /**
3453
- * Manages callbacks that are connected to when a new entity is
3454
- * created.
3455
- */
3456
- export class EntityCreateEventSignal {
3457
- protected constructor();
3458
- /**
3459
- * @remarks
3460
- * Adds a callback that will be called when a new entity is
3461
- * created.
3462
- * @param callback
3463
- * @example runEntityCreatedEvent.ts
3464
- * ```typescript
3465
- * // register a new function that is called when a new entity is created.
3466
- * const entityCreatedCallback = mc.world.events.entityCreate.subscribe((entityEvent: mc.EntityCreateEvent) => {
3467
- * if (entityEvent && entityEvent.entity) {
3468
- * log("New entity of type '" + +entityEvent.entity + "' created!", 1);
3469
- * } else {
3470
- * log("The entity event didn't work as expected.", -1);
3471
- * }
3472
- * });
3473
- * ```
3474
- */
3475
- subscribe(callback: (arg: EntityCreateEvent) => void): (arg: EntityCreateEvent) => void;
3476
- /**
3477
- * @remarks
3478
- * Removes a callback from being called when a new entity is
3479
- * created.
3480
- * @param callback
3481
- * @throws This function can throw errors.
3482
- * @example unsubscribeEntityCreatedEvent.ts
3483
- * ```typescript
3484
- * if (entityCreatedCallbacks.length > 0) {
3485
- * let callback = entityCreatedCallbacks.pop();
3486
- *
3487
- * if (callback) {
3488
- * mc.world.events.entityCreate.unsubscribe(callback);
3489
- * }
3490
- * }
3491
- * ```
3492
- */
3493
- unsubscribe(callback: (arg: EntityCreateEvent) => void): void;
3494
- }
3495
3440
  /**
3496
3441
  * As part of the Ageable component, represents a set of items
3497
3442
  * that can be fed to an entity and the rate at which that
@@ -5447,6 +5392,15 @@ export class EntitySkinIdComponent extends IEntityComponent {
5447
5392
  */
5448
5393
  static readonly componentId = 'minecraft:skin_id';
5449
5394
  }
5395
+ export class EntitySpawnEvent {
5396
+ protected constructor();
5397
+ entity: Entity;
5398
+ }
5399
+ export class EntitySpawnEventSignal {
5400
+ protected constructor();
5401
+ subscribe(callback: (arg: EntitySpawnEvent) => void): (arg: EntitySpawnEvent) => void;
5402
+ unsubscribe(callback: (arg: EntitySpawnEvent) => void): void;
5403
+ }
5450
5404
  /**
5451
5405
  * Defines the entity's strength to carry items.
5452
5406
  */
@@ -5728,10 +5682,6 @@ export class Events {
5728
5682
  * an entity.
5729
5683
  */
5730
5684
  readonly effectAdd: EffectAddEventSignal;
5731
- /**
5732
- * This event fires when a new entity is created.
5733
- */
5734
- readonly entityCreate: EntityCreateEventSignal;
5735
5685
  /**
5736
5686
  * This event fires when an entity hits (makes a melee attack)
5737
5687
  * and potentially impacts another entity or block.
@@ -5741,6 +5691,7 @@ export class Events {
5741
5691
  * This event fires when an entity is hurt (takes damage).
5742
5692
  */
5743
5693
  readonly entityHurt: EntityHurtEventSignal;
5694
+ readonly entitySpawn: EntitySpawnEventSignal;
5744
5695
  /**
5745
5696
  * This event is fired after an explosion occurs.
5746
5697
  */
@@ -5810,6 +5761,7 @@ export class Events {
5810
5761
  * This event fires when a player leaves a world.
5811
5762
  */
5812
5763
  readonly playerLeave: PlayerLeaveEventSignal;
5764
+ readonly playerSpawn: PlayerSpawnEventSignal;
5813
5765
  /**
5814
5766
  * This event fires when a projectile hits an entity or block.
5815
5767
  */
@@ -6018,6 +5970,8 @@ export class InventoryComponentContainer extends Container {
6018
5970
  * @throws This function can throw errors.
6019
5971
  */
6020
5972
  addItem(itemStack: ItemStack): void;
5973
+ clearAll(): void;
5974
+ clearItem(slot: number): void;
6021
5975
  /**
6022
5976
  * @remarks
6023
5977
  * Gets the item stack for the set of items at the specified
@@ -6034,6 +5988,7 @@ export class InventoryComponentContainer extends Container {
6034
5988
  * ```
6035
5989
  */
6036
5990
  getItem(slot: number): ItemStack;
5991
+ getSlot(slot: number): ContainerSlot;
6037
5992
  /**
6038
5993
  * @remarks
6039
5994
  * Sets an item stack within a particular slot.
@@ -6043,7 +5998,7 @@ export class InventoryComponentContainer extends Container {
6043
5998
  * Stack of items to place within the specified slot.
6044
5999
  * @throws This function can throw errors.
6045
6000
  */
6046
- setItem(slot: number, itemStack: ItemStack): void;
6001
+ setItem(slot: number, itemStack?: ItemStack): void;
6047
6002
  /**
6048
6003
  * @remarks
6049
6004
  * Swaps items between two different slots within containers.
@@ -6928,6 +6883,7 @@ export class MinecraftBlockTypes {
6928
6883
  * Represents a bamboo tree within Minecraft.
6929
6884
  */
6930
6885
  static readonly bamboo: BlockType;
6886
+ static readonly bambooBlock: BlockType;
6931
6887
  static readonly bambooButton: BlockType;
6932
6888
  static readonly bambooDoor: BlockType;
6933
6889
  static readonly bambooDoubleSlab: BlockType;
@@ -9509,6 +9465,7 @@ export class MinecraftBlockTypes {
9509
9465
  * Represents a stripped acacia log within Minecraft.
9510
9466
  */
9511
9467
  static readonly strippedAcaciaLog: BlockType;
9468
+ static readonly strippedBambooBlock: BlockType;
9512
9469
  /**
9513
9470
  * Represents a stripped birch log within Minecraft.
9514
9471
  */
@@ -11059,6 +11016,7 @@ export class MinecraftItemTypes {
11059
11016
  * Minecraft.
11060
11017
  */
11061
11018
  static readonly enderChest: ItemType;
11019
+ static readonly enderDragonSpawnEgg: ItemType;
11062
11020
  static readonly enderEye: ItemType;
11063
11021
  static readonly endermanSpawnEgg: ItemType;
11064
11022
  static readonly endermiteSpawnEgg: ItemType;
@@ -11344,6 +11302,7 @@ export class MinecraftItemTypes {
11344
11302
  * Minecraft.
11345
11303
  */
11346
11304
  static readonly ironDoor: ItemType;
11305
+ static readonly ironGolemSpawnEgg: ItemType;
11347
11306
  static readonly ironHelmet: ItemType;
11348
11307
  static readonly ironHoe: ItemType;
11349
11308
  static readonly ironHorseArmor: ItemType;
@@ -12225,6 +12184,7 @@ export class MinecraftItemTypes {
12225
12184
  */
12226
12185
  static readonly snow: ItemType;
12227
12186
  static readonly snowball: ItemType;
12187
+ static readonly snowGolemSpawnEgg: ItemType;
12228
12188
  /**
12229
12189
  * Represents an item that can place a layer of snow within
12230
12190
  * Minecraft.
@@ -12726,6 +12686,7 @@ export class MinecraftItemTypes {
12726
12686
  */
12727
12687
  static readonly witherRose: ItemType;
12728
12688
  static readonly witherSkeletonSpawnEgg: ItemType;
12689
+ static readonly witherSpawnEgg: ItemType;
12729
12690
  static readonly wolfSpawnEgg: ItemType;
12730
12691
  /**
12731
12692
  * Represents an item that can place a block of wood within
@@ -13003,11 +12964,7 @@ export class Player extends Entity {
13003
12964
  * @throws This property can throw when used.
13004
12965
  */
13005
12966
  readonly velocity: Vector;
13006
- /**
13007
- * Vector of the current view of the player.
13008
- * @throws This property can throw when used.
13009
- */
13010
- readonly viewVector: Vector;
12967
+ readonly viewDirection: Vector3;
13011
12968
  /**
13012
12969
  * @remarks
13013
12970
  * Adds an effect, like poison, to the entity.
@@ -13029,15 +12986,7 @@ export class Player extends Entity {
13029
12986
  * @throws This function can throw errors.
13030
12987
  */
13031
12988
  addTag(tag: string): boolean;
13032
- /**
13033
- * @remarks
13034
- * Gets the first block that intersects with the vector of the
13035
- * view of this entity.
13036
- * @param options
13037
- * Additional options for processing this raycast query.
13038
- * @throws This function can throw errors.
13039
- */
13040
- getBlockFromViewVector(options?: BlockRaycastOptions): Block;
12989
+ getBlockFromViewDirection(options?: BlockRaycastOptions): Block;
13041
12990
  /**
13042
12991
  * @remarks
13043
12992
  * Gets a component (that represents additional capabilities)
@@ -13076,15 +13025,7 @@ export class Player extends Entity {
13076
13025
  * @throws This function can throw errors.
13077
13026
  */
13078
13027
  getEffect(effectType: EffectType): Effect;
13079
- /**
13080
- * @remarks
13081
- * Gets the first entity that intersects with the vector of the
13082
- * view of this entity.
13083
- * @param options
13084
- * Additional options for processing this raycast query.
13085
- * @throws This function can throw errors.
13086
- */
13087
- getEntitiesFromViewVector(options?: EntityRaycastOptions): Entity[];
13028
+ getEntitiesFromViewDirection(options?: EntityRaycastOptions): Entity[];
13088
13029
  /**
13089
13030
  * @remarks
13090
13031
  * Gets the current item cooldown time for a particular
@@ -13246,7 +13187,7 @@ export class Player extends Entity {
13246
13187
  * @param message
13247
13188
  * @throws This function can throw errors.
13248
13189
  */
13249
- tell(message: IRawMessage | string): void;
13190
+ tell(message: RawMessage | string): void;
13250
13191
  /**
13251
13192
  * @remarks
13252
13193
  * Triggers an entity type event. For every entity, a number of
@@ -13287,6 +13228,8 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
13287
13228
  * @throws This function can throw errors.
13288
13229
  */
13289
13230
  addItem(itemStack: ItemStack): void;
13231
+ clearAll(): void;
13232
+ clearItem(slot: number): void;
13290
13233
  /**
13291
13234
  * @remarks
13292
13235
  * Gets the item stack for the set of items at the specified
@@ -13297,6 +13240,7 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
13297
13240
  * @throws This function can throw errors.
13298
13241
  */
13299
13242
  getItem(slot: number): ItemStack;
13243
+ getSlot(slot: number): ContainerSlot;
13300
13244
  /**
13301
13245
  * @remarks
13302
13246
  * Sets an item stack within a particular slot.
@@ -13306,7 +13250,7 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
13306
13250
  * Stack of items to place within the specified slot.
13307
13251
  * @throws This function can throw errors.
13308
13252
  */
13309
- setItem(slot: number, itemStack: ItemStack): void;
13253
+ setItem(slot: number, itemStack?: ItemStack): void;
13310
13254
  /**
13311
13255
  * @remarks
13312
13256
  * Swaps items between two different slots within containers.
@@ -13355,10 +13299,8 @@ export class PlayerIterator implements Iterable<Player> {
13355
13299
  */
13356
13300
  export class PlayerJoinEvent {
13357
13301
  protected constructor();
13358
- /**
13359
- * Player that has joined the world.
13360
- */
13361
- player: Player;
13302
+ readonly playerId: string;
13303
+ readonly playerName: string;
13362
13304
  }
13363
13305
  /**
13364
13306
  * Manages callbacks that are connected to a player joining the
@@ -13388,6 +13330,7 @@ export class PlayerJoinEventSignal {
13388
13330
  */
13389
13331
  export class PlayerLeaveEvent {
13390
13332
  protected constructor();
13333
+ readonly playerId: string;
13391
13334
  /**
13392
13335
  * Player that has left the world.
13393
13336
  */
@@ -13415,6 +13358,16 @@ export class PlayerLeaveEventSignal {
13415
13358
  */
13416
13359
  unsubscribe(callback: (arg: PlayerLeaveEvent) => void): void;
13417
13360
  }
13361
+ export class PlayerSpawnEvent {
13362
+ protected constructor();
13363
+ initialSpawn: boolean;
13364
+ player: Player;
13365
+ }
13366
+ export class PlayerSpawnEventSignal {
13367
+ protected constructor();
13368
+ subscribe(callback: (arg: PlayerSpawnEvent) => void): (arg: PlayerSpawnEvent) => void;
13369
+ unsubscribe(callback: (arg: PlayerSpawnEvent) => void): void;
13370
+ }
13418
13371
  /**
13419
13372
  * Contains information related to a projectile hitting an
13420
13373
  * entity or block.
@@ -14163,7 +14116,7 @@ export class World {
14163
14116
  * @param message
14164
14117
  * @throws This function can throw errors.
14165
14118
  */
14166
- say(message: IRawMessage | string): void;
14119
+ say(message: RawMessage | string): void;
14167
14120
  /**
14168
14121
  * @remarks
14169
14122
  * Sets a specified property to a value.
@@ -14492,33 +14445,6 @@ export interface ExplosionOptions {
14492
14445
  */
14493
14446
  source?: Entity;
14494
14447
  }
14495
- /**
14496
- * An interface that describes the signature of a message that
14497
- * is passed into a say/tell API request.
14498
- */
14499
- // tslint:disable-next-line:interface-name
14500
- export interface IRawMessage {
14501
- /**
14502
- * A list of text objects used to build a message.
14503
- */
14504
- rawtext?: IRawMessage[] | string[];
14505
- /**
14506
- * Contains plain text to display directly. Only valid when
14507
- * used as a sub member in a parent _rawtext_ or _with_ member.
14508
- */
14509
- text?: string;
14510
- /**
14511
- * Contains a resource pack translation identifier that can be
14512
- * used to translate text in the player's selected language.
14513
- */
14514
- translate?: string;
14515
- /**
14516
- * A list of text object arguments that can be used to fill
14517
- * values in the _translate_ text. Ignored when _translate_ is
14518
- * not present.
14519
- */
14520
- with?: IRawMessage[] | string[];
14521
- }
14522
14448
  /**
14523
14449
  * Additional configuration options for {@link
14524
14450
  * World.playMusic}/{@link World.queueMusic} methods.
@@ -14537,6 +14463,12 @@ export interface MusicOptions {
14537
14463
  */
14538
14464
  volume?: number;
14539
14465
  }
14466
+ export interface RawMessage {
14467
+ rawtext?: RawMessage[] | string[];
14468
+ text?: string;
14469
+ translate?: string;
14470
+ with?: RawMessage[] | string[];
14471
+ }
14540
14472
  /**
14541
14473
  * Contains additional options for how a scoreboard should be
14542
14474
  * displayed within its display slot.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.1.0-beta.preview.1.19.50.25",
3
+ "version": "1.1.0-beta.preview.1.19.60.20",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {