@minecraft/server 1.1.0-beta.preview.1.19.50.24 → 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 +101 -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.24"
18
+ * "version": "1.1.0-internal.preview.1.19.60.20"
19
19
  * }
20
20
  * ```
21
21
  *
@@ -666,6 +666,21 @@ export class Block {
666
666
  * Z coordinate of the block.
667
667
  */
668
668
  readonly z: number;
669
+ /**
670
+ * @remarks
671
+ * Checks to see whether it is valid to place the specified
672
+ * block type or block permutation, on a specified face on this
673
+ * block
674
+ * @param blockToPlace
675
+ * Block type or block permutation to check placement for.
676
+ * @param faceToPlaceOn
677
+ * Optional specific face of this block to check placement
678
+ * against.
679
+ * @returns
680
+ * Returns `true` if the block type or permutation can be
681
+ * placed on this block, else `false`.
682
+ * @throws This function can throw errors.
683
+ */
669
684
  canPlace(blockToPlace: BlockPermutation | BlockType, faceToPlaceOn?: Direction): boolean;
670
685
  /**
671
686
  * @remarks
@@ -730,6 +745,18 @@ export class Block {
730
745
  * @throws This function can throw errors.
731
746
  */
732
747
  setType(blockType: BlockType): void;
748
+ /**
749
+ * @remarks
750
+ * Tries to set the block in the dimension to the state of the
751
+ * permutation by first checking if the placement is valid.
752
+ * @param permutation
753
+ * Permutation that contains a set of property states for the
754
+ * Block.
755
+ * @returns
756
+ * Returns `true` if the block permutation data was
757
+ * successfully set, else `false`.
758
+ * @throws This function can throw errors.
759
+ */
733
760
  trySetPermutation(permutation: BlockPermutation): boolean;
734
761
  }
735
762
  /**
@@ -957,6 +984,8 @@ export class BlockInventoryComponentContainer extends Container {
957
984
  * @throws This function can throw errors.
958
985
  */
959
986
  addItem(itemStack: ItemStack): void;
987
+ clearAll(): void;
988
+ clearItem(slot: number): void;
960
989
  /**
961
990
  * @remarks
962
991
  * Gets the item stack for the set of items at the specified
@@ -973,6 +1002,7 @@ export class BlockInventoryComponentContainer extends Container {
973
1002
  * ```
974
1003
  */
975
1004
  getItem(slot: number): ItemStack;
1005
+ getSlot(slot: number): ContainerSlot;
976
1006
  /**
977
1007
  * @remarks
978
1008
  * Sets an item stack within a particular slot.
@@ -982,7 +1012,7 @@ export class BlockInventoryComponentContainer extends Container {
982
1012
  * Stack of items to place within the specified slot.
983
1013
  * @throws This function can throw errors.
984
1014
  */
985
- setItem(slot: number, itemStack: ItemStack): void;
1015
+ setItem(slot: number, itemStack?: ItemStack): void;
986
1016
  /**
987
1017
  * @remarks
988
1018
  * Swaps items between two different slots within containers.
@@ -2270,6 +2300,8 @@ export class Container {
2270
2300
  * @throws This function can throw errors.
2271
2301
  */
2272
2302
  addItem(itemStack: ItemStack): void;
2303
+ clearAll(): void;
2304
+ clearItem(slot: number): void;
2273
2305
  /**
2274
2306
  * @remarks
2275
2307
  * Gets the item stack for the set of items at the specified
@@ -2290,6 +2322,7 @@ export class Container {
2290
2322
  * ```
2291
2323
  */
2292
2324
  getItem(slot: number): ItemStack;
2325
+ getSlot(slot: number): ContainerSlot;
2293
2326
  /**
2294
2327
  * @remarks
2295
2328
  * Sets an item stack within a particular slot.
@@ -2299,7 +2332,7 @@ export class Container {
2299
2332
  * Stack of items to place within the specified slot.
2300
2333
  * @throws This function can throw errors.
2301
2334
  */
2302
- setItem(slot: number, itemStack: ItemStack): void;
2335
+ setItem(slot: number, itemStack?: ItemStack): void;
2303
2336
  /**
2304
2337
  * @remarks
2305
2338
  * Swaps items between two different slots within containers.
@@ -2337,6 +2370,19 @@ export class Container {
2337
2370
  */
2338
2371
  transferItem(fromSlot: number, toSlot: number, toContainer: Container): boolean;
2339
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
+ }
2340
2386
  /**
2341
2387
  * Contains information related to firing of a data driven
2342
2388
  * entity event - for example, the minecraft:ageable_grow_up
@@ -2950,11 +2996,7 @@ export class Entity {
2950
2996
  * @throws This property can throw when used.
2951
2997
  */
2952
2998
  readonly velocity: Vector;
2953
- /**
2954
- * Vector of the current view of the entity.
2955
- * @throws This property can throw when used.
2956
- */
2957
- readonly viewVector: Vector;
2999
+ readonly viewDirection: Vector3;
2958
3000
  /**
2959
3001
  * @remarks
2960
3002
  * Adds an effect, like poison, to the entity.
@@ -3003,15 +3045,7 @@ export class Entity {
3003
3045
  * @throws This function can throw errors.
3004
3046
  */
3005
3047
  addTag(tag: string): boolean;
3006
- /**
3007
- * @remarks
3008
- * Gets the first block that intersects with the vector of the
3009
- * view of this entity.
3010
- * @param options
3011
- * Additional options for processing this raycast query.
3012
- * @throws This function can throw errors.
3013
- */
3014
- getBlockFromViewVector(options?: BlockRaycastOptions): Block;
3048
+ getBlockFromViewDirection(options?: BlockRaycastOptions): Block;
3015
3049
  /**
3016
3050
  * @remarks
3017
3051
  * Gets a component (that represents additional capabilities)
@@ -3050,15 +3084,7 @@ export class Entity {
3050
3084
  * @throws This function can throw errors.
3051
3085
  */
3052
3086
  getEffect(effectType: EffectType): Effect;
3053
- /**
3054
- * @remarks
3055
- * Gets the first entity that intersects with the vector of the
3056
- * view of this entity.
3057
- * @param options
3058
- * Additional options for processing this raycast query.
3059
- * @throws This function can throw errors.
3060
- */
3061
- getEntitiesFromViewVector(options?: EntityRaycastOptions): Entity[];
3087
+ getEntitiesFromViewDirection(options?: EntityRaycastOptions): Entity[];
3062
3088
  /**
3063
3089
  * @remarks
3064
3090
  * Returns all tags associated with an entity.
@@ -3411,60 +3437,6 @@ export class EntityColorComponent extends IEntityComponent {
3411
3437
  */
3412
3438
  static readonly componentId = 'minecraft:color';
3413
3439
  }
3414
- /**
3415
- * Contains information related to the creation of a new
3416
- * entity.
3417
- */
3418
- export class EntityCreateEvent {
3419
- protected constructor();
3420
- /**
3421
- * New entity that was created.
3422
- */
3423
- entity: Entity;
3424
- }
3425
- /**
3426
- * Manages callbacks that are connected to when a new entity is
3427
- * created.
3428
- */
3429
- export class EntityCreateEventSignal {
3430
- protected constructor();
3431
- /**
3432
- * @remarks
3433
- * Adds a callback that will be called when a new entity is
3434
- * created.
3435
- * @param callback
3436
- * @example runEntityCreatedEvent.ts
3437
- * ```typescript
3438
- * // register a new function that is called when a new entity is created.
3439
- * const entityCreatedCallback = mc.world.events.entityCreate.subscribe((entityEvent: mc.EntityCreateEvent) => {
3440
- * if (entityEvent && entityEvent.entity) {
3441
- * log("New entity of type '" + +entityEvent.entity + "' created!", 1);
3442
- * } else {
3443
- * log("The entity event didn't work as expected.", -1);
3444
- * }
3445
- * });
3446
- * ```
3447
- */
3448
- subscribe(callback: (arg: EntityCreateEvent) => void): (arg: EntityCreateEvent) => void;
3449
- /**
3450
- * @remarks
3451
- * Removes a callback from being called when a new entity is
3452
- * created.
3453
- * @param callback
3454
- * @throws This function can throw errors.
3455
- * @example unsubscribeEntityCreatedEvent.ts
3456
- * ```typescript
3457
- * if (entityCreatedCallbacks.length > 0) {
3458
- * let callback = entityCreatedCallbacks.pop();
3459
- *
3460
- * if (callback) {
3461
- * mc.world.events.entityCreate.unsubscribe(callback);
3462
- * }
3463
- * }
3464
- * ```
3465
- */
3466
- unsubscribe(callback: (arg: EntityCreateEvent) => void): void;
3467
- }
3468
3440
  /**
3469
3441
  * As part of the Ageable component, represents a set of items
3470
3442
  * that can be fed to an entity and the rate at which that
@@ -5420,6 +5392,15 @@ export class EntitySkinIdComponent extends IEntityComponent {
5420
5392
  */
5421
5393
  static readonly componentId = 'minecraft:skin_id';
5422
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
+ }
5423
5404
  /**
5424
5405
  * Defines the entity's strength to carry items.
5425
5406
  */
@@ -5701,10 +5682,6 @@ export class Events {
5701
5682
  * an entity.
5702
5683
  */
5703
5684
  readonly effectAdd: EffectAddEventSignal;
5704
- /**
5705
- * This event fires when a new entity is created.
5706
- */
5707
- readonly entityCreate: EntityCreateEventSignal;
5708
5685
  /**
5709
5686
  * This event fires when an entity hits (makes a melee attack)
5710
5687
  * and potentially impacts another entity or block.
@@ -5714,6 +5691,7 @@ export class Events {
5714
5691
  * This event fires when an entity is hurt (takes damage).
5715
5692
  */
5716
5693
  readonly entityHurt: EntityHurtEventSignal;
5694
+ readonly entitySpawn: EntitySpawnEventSignal;
5717
5695
  /**
5718
5696
  * This event is fired after an explosion occurs.
5719
5697
  */
@@ -5783,6 +5761,7 @@ export class Events {
5783
5761
  * This event fires when a player leaves a world.
5784
5762
  */
5785
5763
  readonly playerLeave: PlayerLeaveEventSignal;
5764
+ readonly playerSpawn: PlayerSpawnEventSignal;
5786
5765
  /**
5787
5766
  * This event fires when a projectile hits an entity or block.
5788
5767
  */
@@ -5991,6 +5970,8 @@ export class InventoryComponentContainer extends Container {
5991
5970
  * @throws This function can throw errors.
5992
5971
  */
5993
5972
  addItem(itemStack: ItemStack): void;
5973
+ clearAll(): void;
5974
+ clearItem(slot: number): void;
5994
5975
  /**
5995
5976
  * @remarks
5996
5977
  * Gets the item stack for the set of items at the specified
@@ -6007,6 +5988,7 @@ export class InventoryComponentContainer extends Container {
6007
5988
  * ```
6008
5989
  */
6009
5990
  getItem(slot: number): ItemStack;
5991
+ getSlot(slot: number): ContainerSlot;
6010
5992
  /**
6011
5993
  * @remarks
6012
5994
  * Sets an item stack within a particular slot.
@@ -6016,7 +5998,7 @@ export class InventoryComponentContainer extends Container {
6016
5998
  * Stack of items to place within the specified slot.
6017
5999
  * @throws This function can throw errors.
6018
6000
  */
6019
- setItem(slot: number, itemStack: ItemStack): void;
6001
+ setItem(slot: number, itemStack?: ItemStack): void;
6020
6002
  /**
6021
6003
  * @remarks
6022
6004
  * Swaps items between two different slots within containers.
@@ -6901,6 +6883,7 @@ export class MinecraftBlockTypes {
6901
6883
  * Represents a bamboo tree within Minecraft.
6902
6884
  */
6903
6885
  static readonly bamboo: BlockType;
6886
+ static readonly bambooBlock: BlockType;
6904
6887
  static readonly bambooButton: BlockType;
6905
6888
  static readonly bambooDoor: BlockType;
6906
6889
  static readonly bambooDoubleSlab: BlockType;
@@ -9482,6 +9465,7 @@ export class MinecraftBlockTypes {
9482
9465
  * Represents a stripped acacia log within Minecraft.
9483
9466
  */
9484
9467
  static readonly strippedAcaciaLog: BlockType;
9468
+ static readonly strippedBambooBlock: BlockType;
9485
9469
  /**
9486
9470
  * Represents a stripped birch log within Minecraft.
9487
9471
  */
@@ -11032,6 +11016,7 @@ export class MinecraftItemTypes {
11032
11016
  * Minecraft.
11033
11017
  */
11034
11018
  static readonly enderChest: ItemType;
11019
+ static readonly enderDragonSpawnEgg: ItemType;
11035
11020
  static readonly enderEye: ItemType;
11036
11021
  static readonly endermanSpawnEgg: ItemType;
11037
11022
  static readonly endermiteSpawnEgg: ItemType;
@@ -11317,6 +11302,7 @@ export class MinecraftItemTypes {
11317
11302
  * Minecraft.
11318
11303
  */
11319
11304
  static readonly ironDoor: ItemType;
11305
+ static readonly ironGolemSpawnEgg: ItemType;
11320
11306
  static readonly ironHelmet: ItemType;
11321
11307
  static readonly ironHoe: ItemType;
11322
11308
  static readonly ironHorseArmor: ItemType;
@@ -12198,6 +12184,7 @@ export class MinecraftItemTypes {
12198
12184
  */
12199
12185
  static readonly snow: ItemType;
12200
12186
  static readonly snowball: ItemType;
12187
+ static readonly snowGolemSpawnEgg: ItemType;
12201
12188
  /**
12202
12189
  * Represents an item that can place a layer of snow within
12203
12190
  * Minecraft.
@@ -12699,6 +12686,7 @@ export class MinecraftItemTypes {
12699
12686
  */
12700
12687
  static readonly witherRose: ItemType;
12701
12688
  static readonly witherSkeletonSpawnEgg: ItemType;
12689
+ static readonly witherSpawnEgg: ItemType;
12702
12690
  static readonly wolfSpawnEgg: ItemType;
12703
12691
  /**
12704
12692
  * Represents an item that can place a block of wood within
@@ -12976,11 +12964,7 @@ export class Player extends Entity {
12976
12964
  * @throws This property can throw when used.
12977
12965
  */
12978
12966
  readonly velocity: Vector;
12979
- /**
12980
- * Vector of the current view of the player.
12981
- * @throws This property can throw when used.
12982
- */
12983
- readonly viewVector: Vector;
12967
+ readonly viewDirection: Vector3;
12984
12968
  /**
12985
12969
  * @remarks
12986
12970
  * Adds an effect, like poison, to the entity.
@@ -13002,15 +12986,7 @@ export class Player extends Entity {
13002
12986
  * @throws This function can throw errors.
13003
12987
  */
13004
12988
  addTag(tag: string): boolean;
13005
- /**
13006
- * @remarks
13007
- * Gets the first block that intersects with the vector of the
13008
- * view of this entity.
13009
- * @param options
13010
- * Additional options for processing this raycast query.
13011
- * @throws This function can throw errors.
13012
- */
13013
- getBlockFromViewVector(options?: BlockRaycastOptions): Block;
12989
+ getBlockFromViewDirection(options?: BlockRaycastOptions): Block;
13014
12990
  /**
13015
12991
  * @remarks
13016
12992
  * Gets a component (that represents additional capabilities)
@@ -13049,15 +13025,7 @@ export class Player extends Entity {
13049
13025
  * @throws This function can throw errors.
13050
13026
  */
13051
13027
  getEffect(effectType: EffectType): Effect;
13052
- /**
13053
- * @remarks
13054
- * Gets the first entity that intersects with the vector of the
13055
- * view of this entity.
13056
- * @param options
13057
- * Additional options for processing this raycast query.
13058
- * @throws This function can throw errors.
13059
- */
13060
- getEntitiesFromViewVector(options?: EntityRaycastOptions): Entity[];
13028
+ getEntitiesFromViewDirection(options?: EntityRaycastOptions): Entity[];
13061
13029
  /**
13062
13030
  * @remarks
13063
13031
  * Gets the current item cooldown time for a particular
@@ -13219,7 +13187,7 @@ export class Player extends Entity {
13219
13187
  * @param message
13220
13188
  * @throws This function can throw errors.
13221
13189
  */
13222
- tell(message: IRawMessage | string): void;
13190
+ tell(message: RawMessage | string): void;
13223
13191
  /**
13224
13192
  * @remarks
13225
13193
  * Triggers an entity type event. For every entity, a number of
@@ -13260,6 +13228,8 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
13260
13228
  * @throws This function can throw errors.
13261
13229
  */
13262
13230
  addItem(itemStack: ItemStack): void;
13231
+ clearAll(): void;
13232
+ clearItem(slot: number): void;
13263
13233
  /**
13264
13234
  * @remarks
13265
13235
  * Gets the item stack for the set of items at the specified
@@ -13270,6 +13240,7 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
13270
13240
  * @throws This function can throw errors.
13271
13241
  */
13272
13242
  getItem(slot: number): ItemStack;
13243
+ getSlot(slot: number): ContainerSlot;
13273
13244
  /**
13274
13245
  * @remarks
13275
13246
  * Sets an item stack within a particular slot.
@@ -13279,7 +13250,7 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
13279
13250
  * Stack of items to place within the specified slot.
13280
13251
  * @throws This function can throw errors.
13281
13252
  */
13282
- setItem(slot: number, itemStack: ItemStack): void;
13253
+ setItem(slot: number, itemStack?: ItemStack): void;
13283
13254
  /**
13284
13255
  * @remarks
13285
13256
  * Swaps items between two different slots within containers.
@@ -13328,10 +13299,8 @@ export class PlayerIterator implements Iterable<Player> {
13328
13299
  */
13329
13300
  export class PlayerJoinEvent {
13330
13301
  protected constructor();
13331
- /**
13332
- * Player that has joined the world.
13333
- */
13334
- player: Player;
13302
+ readonly playerId: string;
13303
+ readonly playerName: string;
13335
13304
  }
13336
13305
  /**
13337
13306
  * Manages callbacks that are connected to a player joining the
@@ -13361,6 +13330,7 @@ export class PlayerJoinEventSignal {
13361
13330
  */
13362
13331
  export class PlayerLeaveEvent {
13363
13332
  protected constructor();
13333
+ readonly playerId: string;
13364
13334
  /**
13365
13335
  * Player that has left the world.
13366
13336
  */
@@ -13388,6 +13358,16 @@ export class PlayerLeaveEventSignal {
13388
13358
  */
13389
13359
  unsubscribe(callback: (arg: PlayerLeaveEvent) => void): void;
13390
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
+ }
13391
13371
  /**
13392
13372
  * Contains information related to a projectile hitting an
13393
13373
  * entity or block.
@@ -14136,7 +14116,7 @@ export class World {
14136
14116
  * @param message
14137
14117
  * @throws This function can throw errors.
14138
14118
  */
14139
- say(message: IRawMessage | string): void;
14119
+ say(message: RawMessage | string): void;
14140
14120
  /**
14141
14121
  * @remarks
14142
14122
  * Sets a specified property to a value.
@@ -14465,33 +14445,6 @@ export interface ExplosionOptions {
14465
14445
  */
14466
14446
  source?: Entity;
14467
14447
  }
14468
- /**
14469
- * An interface that describes the signature of a message that
14470
- * is passed into a say/tell API request.
14471
- */
14472
- // tslint:disable-next-line:interface-name
14473
- export interface IRawMessage {
14474
- /**
14475
- * A list of text objects used to build a message.
14476
- */
14477
- rawtext?: IRawMessage[] | string[];
14478
- /**
14479
- * Contains plain text to display directly. Only valid when
14480
- * used as a sub member in a parent _rawtext_ or _with_ member.
14481
- */
14482
- text?: string;
14483
- /**
14484
- * Contains a resource pack translation identifier that can be
14485
- * used to translate text in the player's selected language.
14486
- */
14487
- translate?: string;
14488
- /**
14489
- * A list of text object arguments that can be used to fill
14490
- * values in the _translate_ text. Ignored when _translate_ is
14491
- * not present.
14492
- */
14493
- with?: IRawMessage[] | string[];
14494
- }
14495
14448
  /**
14496
14449
  * Additional configuration options for {@link
14497
14450
  * World.playMusic}/{@link World.queueMusic} methods.
@@ -14510,6 +14463,12 @@ export interface MusicOptions {
14510
14463
  */
14511
14464
  volume?: number;
14512
14465
  }
14466
+ export interface RawMessage {
14467
+ rawtext?: RawMessage[] | string[];
14468
+ text?: string;
14469
+ translate?: string;
14470
+ with?: RawMessage[] | string[];
14471
+ }
14513
14472
  /**
14514
14473
  * Contains additional options for how a scoreboard should be
14515
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.24",
3
+ "version": "1.1.0-beta.preview.1.19.60.20",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {