@minecraft/server 1.1.0-beta.preview.1.19.60.22 → 1.1.0-beta.release.1.19.50
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.
- package/README.md +0 -2
- package/index.d.ts +142 -98
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Contains many types related to manipulating a Minecraft world, including entities, blocks, dimensions, and more.
|
|
4
4
|
|
|
5
|
-
## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
|
|
6
|
-
|
|
7
5
|
See full documentation for this module here:
|
|
8
6
|
|
|
9
7
|
https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/@minecraft/server/@minecraft/server
|
package/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* ```json
|
|
16
16
|
* {
|
|
17
17
|
* "module_name": "@minecraft/server",
|
|
18
|
-
* "version": "1.
|
|
18
|
+
* "version": "1.0.0"
|
|
19
19
|
* }
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
@@ -162,8 +162,6 @@ export enum GameMode {
|
|
|
162
162
|
}
|
|
163
163
|
export enum MessageSourceType {
|
|
164
164
|
clientScript = 'clientScript',
|
|
165
|
-
commandBlock = 'commandBlock',
|
|
166
|
-
dialogueCommand = 'dialogueCommand',
|
|
167
165
|
entityCommand = 'entityCommand',
|
|
168
166
|
serverCommand = 'serverCommand',
|
|
169
167
|
serverScript = 'serverScript',
|
|
@@ -698,7 +696,6 @@ export class Block {
|
|
|
698
696
|
* @throws This function can throw errors.
|
|
699
697
|
*/
|
|
700
698
|
getComponent(componentName: string): any;
|
|
701
|
-
getRedstonePower(): number;
|
|
702
699
|
/**
|
|
703
700
|
* @returns
|
|
704
701
|
* The list of tags that the block has.
|
|
@@ -987,8 +984,6 @@ export class BlockInventoryComponentContainer extends Container {
|
|
|
987
984
|
* @throws This function can throw errors.
|
|
988
985
|
*/
|
|
989
986
|
addItem(itemStack: ItemStack): void;
|
|
990
|
-
clearAll(): void;
|
|
991
|
-
clearItem(slot: number): void;
|
|
992
987
|
/**
|
|
993
988
|
* @remarks
|
|
994
989
|
* Gets the item stack for the set of items at the specified
|
|
@@ -1005,7 +1000,6 @@ export class BlockInventoryComponentContainer extends Container {
|
|
|
1005
1000
|
* ```
|
|
1006
1001
|
*/
|
|
1007
1002
|
getItem(slot: number): ItemStack;
|
|
1008
|
-
getSlot(slot: number): ContainerSlot;
|
|
1009
1003
|
/**
|
|
1010
1004
|
* @remarks
|
|
1011
1005
|
* Sets an item stack within a particular slot.
|
|
@@ -1015,7 +1009,7 @@ export class BlockInventoryComponentContainer extends Container {
|
|
|
1015
1009
|
* Stack of items to place within the specified slot.
|
|
1016
1010
|
* @throws This function can throw errors.
|
|
1017
1011
|
*/
|
|
1018
|
-
setItem(slot: number, itemStack
|
|
1012
|
+
setItem(slot: number, itemStack: ItemStack): void;
|
|
1019
1013
|
/**
|
|
1020
1014
|
* @remarks
|
|
1021
1015
|
* Swaps items between two different slots within containers.
|
|
@@ -2303,8 +2297,6 @@ export class Container {
|
|
|
2303
2297
|
* @throws This function can throw errors.
|
|
2304
2298
|
*/
|
|
2305
2299
|
addItem(itemStack: ItemStack): void;
|
|
2306
|
-
clearAll(): void;
|
|
2307
|
-
clearItem(slot: number): void;
|
|
2308
2300
|
/**
|
|
2309
2301
|
* @remarks
|
|
2310
2302
|
* Gets the item stack for the set of items at the specified
|
|
@@ -2325,7 +2317,6 @@ export class Container {
|
|
|
2325
2317
|
* ```
|
|
2326
2318
|
*/
|
|
2327
2319
|
getItem(slot: number): ItemStack;
|
|
2328
|
-
getSlot(slot: number): ContainerSlot;
|
|
2329
2320
|
/**
|
|
2330
2321
|
* @remarks
|
|
2331
2322
|
* Sets an item stack within a particular slot.
|
|
@@ -2335,7 +2326,7 @@ export class Container {
|
|
|
2335
2326
|
* Stack of items to place within the specified slot.
|
|
2336
2327
|
* @throws This function can throw errors.
|
|
2337
2328
|
*/
|
|
2338
|
-
setItem(slot: number, itemStack
|
|
2329
|
+
setItem(slot: number, itemStack: ItemStack): void;
|
|
2339
2330
|
/**
|
|
2340
2331
|
* @remarks
|
|
2341
2332
|
* Swaps items between two different slots within containers.
|
|
@@ -2373,19 +2364,6 @@ export class Container {
|
|
|
2373
2364
|
*/
|
|
2374
2365
|
transferItem(fromSlot: number, toSlot: number, toContainer: Container): boolean;
|
|
2375
2366
|
}
|
|
2376
|
-
export class ContainerSlot {
|
|
2377
|
-
protected constructor();
|
|
2378
|
-
amount: number;
|
|
2379
|
-
data: number;
|
|
2380
|
-
readonly isValid: boolean;
|
|
2381
|
-
nameTag?: string;
|
|
2382
|
-
readonly typeId?: string;
|
|
2383
|
-
clearItem(): void;
|
|
2384
|
-
getItem(): ItemStack;
|
|
2385
|
-
getLore(): string[];
|
|
2386
|
-
setItem(itemStack?: ItemStack): void;
|
|
2387
|
-
setLore(loreList: string[]): void;
|
|
2388
|
-
}
|
|
2389
2367
|
/**
|
|
2390
2368
|
* Contains information related to firing of a data driven
|
|
2391
2369
|
* entity event - for example, the minecraft:ageable_grow_up
|
|
@@ -2999,7 +2977,11 @@ export class Entity {
|
|
|
2999
2977
|
* @throws This property can throw when used.
|
|
3000
2978
|
*/
|
|
3001
2979
|
readonly velocity: Vector;
|
|
3002
|
-
|
|
2980
|
+
/**
|
|
2981
|
+
* Vector of the current view of the entity.
|
|
2982
|
+
* @throws This property can throw when used.
|
|
2983
|
+
*/
|
|
2984
|
+
readonly viewVector: Vector;
|
|
3003
2985
|
/**
|
|
3004
2986
|
* @remarks
|
|
3005
2987
|
* Adds an effect, like poison, to the entity.
|
|
@@ -3048,7 +3030,15 @@ export class Entity {
|
|
|
3048
3030
|
* @throws This function can throw errors.
|
|
3049
3031
|
*/
|
|
3050
3032
|
addTag(tag: string): boolean;
|
|
3051
|
-
|
|
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;
|
|
3052
3042
|
/**
|
|
3053
3043
|
* @remarks
|
|
3054
3044
|
* Gets a component (that represents additional capabilities)
|
|
@@ -3087,7 +3077,15 @@ export class Entity {
|
|
|
3087
3077
|
* @throws This function can throw errors.
|
|
3088
3078
|
*/
|
|
3089
3079
|
getEffect(effectType: EffectType): Effect;
|
|
3090
|
-
|
|
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[];
|
|
3091
3089
|
/**
|
|
3092
3090
|
* @remarks
|
|
3093
3091
|
* Returns all tags associated with an entity.
|
|
@@ -3440,6 +3438,60 @@ export class EntityColorComponent extends IEntityComponent {
|
|
|
3440
3438
|
*/
|
|
3441
3439
|
static readonly componentId = 'minecraft:color';
|
|
3442
3440
|
}
|
|
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
|
+
}
|
|
3443
3495
|
/**
|
|
3444
3496
|
* As part of the Ageable component, represents a set of items
|
|
3445
3497
|
* that can be fed to an entity and the rate at which that
|
|
@@ -5395,15 +5447,6 @@ export class EntitySkinIdComponent extends IEntityComponent {
|
|
|
5395
5447
|
*/
|
|
5396
5448
|
static readonly componentId = 'minecraft:skin_id';
|
|
5397
5449
|
}
|
|
5398
|
-
export class EntitySpawnEvent {
|
|
5399
|
-
protected constructor();
|
|
5400
|
-
entity: Entity;
|
|
5401
|
-
}
|
|
5402
|
-
export class EntitySpawnEventSignal {
|
|
5403
|
-
protected constructor();
|
|
5404
|
-
subscribe(callback: (arg: EntitySpawnEvent) => void): (arg: EntitySpawnEvent) => void;
|
|
5405
|
-
unsubscribe(callback: (arg: EntitySpawnEvent) => void): void;
|
|
5406
|
-
}
|
|
5407
5450
|
/**
|
|
5408
5451
|
* Defines the entity's strength to carry items.
|
|
5409
5452
|
*/
|
|
@@ -5685,6 +5728,10 @@ export class Events {
|
|
|
5685
5728
|
* an entity.
|
|
5686
5729
|
*/
|
|
5687
5730
|
readonly effectAdd: EffectAddEventSignal;
|
|
5731
|
+
/**
|
|
5732
|
+
* This event fires when a new entity is created.
|
|
5733
|
+
*/
|
|
5734
|
+
readonly entityCreate: EntityCreateEventSignal;
|
|
5688
5735
|
/**
|
|
5689
5736
|
* This event fires when an entity hits (makes a melee attack)
|
|
5690
5737
|
* and potentially impacts another entity or block.
|
|
@@ -5694,7 +5741,6 @@ export class Events {
|
|
|
5694
5741
|
* This event fires when an entity is hurt (takes damage).
|
|
5695
5742
|
*/
|
|
5696
5743
|
readonly entityHurt: EntityHurtEventSignal;
|
|
5697
|
-
readonly entitySpawn: EntitySpawnEventSignal;
|
|
5698
5744
|
/**
|
|
5699
5745
|
* This event is fired after an explosion occurs.
|
|
5700
5746
|
*/
|
|
@@ -5764,7 +5810,6 @@ export class Events {
|
|
|
5764
5810
|
* This event fires when a player leaves a world.
|
|
5765
5811
|
*/
|
|
5766
5812
|
readonly playerLeave: PlayerLeaveEventSignal;
|
|
5767
|
-
readonly playerSpawn: PlayerSpawnEventSignal;
|
|
5768
5813
|
/**
|
|
5769
5814
|
* This event fires when a projectile hits an entity or block.
|
|
5770
5815
|
*/
|
|
@@ -5973,8 +6018,6 @@ export class InventoryComponentContainer extends Container {
|
|
|
5973
6018
|
* @throws This function can throw errors.
|
|
5974
6019
|
*/
|
|
5975
6020
|
addItem(itemStack: ItemStack): void;
|
|
5976
|
-
clearAll(): void;
|
|
5977
|
-
clearItem(slot: number): void;
|
|
5978
6021
|
/**
|
|
5979
6022
|
* @remarks
|
|
5980
6023
|
* Gets the item stack for the set of items at the specified
|
|
@@ -5991,7 +6034,6 @@ export class InventoryComponentContainer extends Container {
|
|
|
5991
6034
|
* ```
|
|
5992
6035
|
*/
|
|
5993
6036
|
getItem(slot: number): ItemStack;
|
|
5994
|
-
getSlot(slot: number): ContainerSlot;
|
|
5995
6037
|
/**
|
|
5996
6038
|
* @remarks
|
|
5997
6039
|
* Sets an item stack within a particular slot.
|
|
@@ -6001,7 +6043,7 @@ export class InventoryComponentContainer extends Container {
|
|
|
6001
6043
|
* Stack of items to place within the specified slot.
|
|
6002
6044
|
* @throws This function can throw errors.
|
|
6003
6045
|
*/
|
|
6004
|
-
setItem(slot: number, itemStack
|
|
6046
|
+
setItem(slot: number, itemStack: ItemStack): void;
|
|
6005
6047
|
/**
|
|
6006
6048
|
* @remarks
|
|
6007
6049
|
* Swaps items between two different slots within containers.
|
|
@@ -6886,7 +6928,6 @@ export class MinecraftBlockTypes {
|
|
|
6886
6928
|
* Represents a bamboo tree within Minecraft.
|
|
6887
6929
|
*/
|
|
6888
6930
|
static readonly bamboo: BlockType;
|
|
6889
|
-
static readonly bambooBlock: BlockType;
|
|
6890
6931
|
static readonly bambooButton: BlockType;
|
|
6891
6932
|
static readonly bambooDoor: BlockType;
|
|
6892
6933
|
static readonly bambooDoubleSlab: BlockType;
|
|
@@ -9468,7 +9509,6 @@ export class MinecraftBlockTypes {
|
|
|
9468
9509
|
* Represents a stripped acacia log within Minecraft.
|
|
9469
9510
|
*/
|
|
9470
9511
|
static readonly strippedAcaciaLog: BlockType;
|
|
9471
|
-
static readonly strippedBambooBlock: BlockType;
|
|
9472
9512
|
/**
|
|
9473
9513
|
* Represents a stripped birch log within Minecraft.
|
|
9474
9514
|
*/
|
|
@@ -11019,7 +11059,6 @@ export class MinecraftItemTypes {
|
|
|
11019
11059
|
* Minecraft.
|
|
11020
11060
|
*/
|
|
11021
11061
|
static readonly enderChest: ItemType;
|
|
11022
|
-
static readonly enderDragonSpawnEgg: ItemType;
|
|
11023
11062
|
static readonly enderEye: ItemType;
|
|
11024
11063
|
static readonly endermanSpawnEgg: ItemType;
|
|
11025
11064
|
static readonly endermiteSpawnEgg: ItemType;
|
|
@@ -11305,7 +11344,6 @@ export class MinecraftItemTypes {
|
|
|
11305
11344
|
* Minecraft.
|
|
11306
11345
|
*/
|
|
11307
11346
|
static readonly ironDoor: ItemType;
|
|
11308
|
-
static readonly ironGolemSpawnEgg: ItemType;
|
|
11309
11347
|
static readonly ironHelmet: ItemType;
|
|
11310
11348
|
static readonly ironHoe: ItemType;
|
|
11311
11349
|
static readonly ironHorseArmor: ItemType;
|
|
@@ -12187,7 +12225,6 @@ export class MinecraftItemTypes {
|
|
|
12187
12225
|
*/
|
|
12188
12226
|
static readonly snow: ItemType;
|
|
12189
12227
|
static readonly snowball: ItemType;
|
|
12190
|
-
static readonly snowGolemSpawnEgg: ItemType;
|
|
12191
12228
|
/**
|
|
12192
12229
|
* Represents an item that can place a layer of snow within
|
|
12193
12230
|
* Minecraft.
|
|
@@ -12689,7 +12726,6 @@ export class MinecraftItemTypes {
|
|
|
12689
12726
|
*/
|
|
12690
12727
|
static readonly witherRose: ItemType;
|
|
12691
12728
|
static readonly witherSkeletonSpawnEgg: ItemType;
|
|
12692
|
-
static readonly witherSpawnEgg: ItemType;
|
|
12693
12729
|
static readonly wolfSpawnEgg: ItemType;
|
|
12694
12730
|
/**
|
|
12695
12731
|
* Represents an item that can place a block of wood within
|
|
@@ -12967,7 +13003,11 @@ export class Player extends Entity {
|
|
|
12967
13003
|
* @throws This property can throw when used.
|
|
12968
13004
|
*/
|
|
12969
13005
|
readonly velocity: Vector;
|
|
12970
|
-
|
|
13006
|
+
/**
|
|
13007
|
+
* Vector of the current view of the player.
|
|
13008
|
+
* @throws This property can throw when used.
|
|
13009
|
+
*/
|
|
13010
|
+
readonly viewVector: Vector;
|
|
12971
13011
|
/**
|
|
12972
13012
|
* @remarks
|
|
12973
13013
|
* Adds an effect, like poison, to the entity.
|
|
@@ -12989,7 +13029,15 @@ export class Player extends Entity {
|
|
|
12989
13029
|
* @throws This function can throw errors.
|
|
12990
13030
|
*/
|
|
12991
13031
|
addTag(tag: string): boolean;
|
|
12992
|
-
|
|
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;
|
|
12993
13041
|
/**
|
|
12994
13042
|
* @remarks
|
|
12995
13043
|
* Gets a component (that represents additional capabilities)
|
|
@@ -13028,7 +13076,15 @@ export class Player extends Entity {
|
|
|
13028
13076
|
* @throws This function can throw errors.
|
|
13029
13077
|
*/
|
|
13030
13078
|
getEffect(effectType: EffectType): Effect;
|
|
13031
|
-
|
|
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[];
|
|
13032
13088
|
/**
|
|
13033
13089
|
* @remarks
|
|
13034
13090
|
* Gets the current item cooldown time for a particular
|
|
@@ -13190,7 +13246,7 @@ export class Player extends Entity {
|
|
|
13190
13246
|
* @param message
|
|
13191
13247
|
* @throws This function can throw errors.
|
|
13192
13248
|
*/
|
|
13193
|
-
tell(message:
|
|
13249
|
+
tell(message: IRawMessage | string): void;
|
|
13194
13250
|
/**
|
|
13195
13251
|
* @remarks
|
|
13196
13252
|
* Triggers an entity type event. For every entity, a number of
|
|
@@ -13231,8 +13287,6 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
|
|
|
13231
13287
|
* @throws This function can throw errors.
|
|
13232
13288
|
*/
|
|
13233
13289
|
addItem(itemStack: ItemStack): void;
|
|
13234
|
-
clearAll(): void;
|
|
13235
|
-
clearItem(slot: number): void;
|
|
13236
13290
|
/**
|
|
13237
13291
|
* @remarks
|
|
13238
13292
|
* Gets the item stack for the set of items at the specified
|
|
@@ -13243,7 +13297,6 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
|
|
|
13243
13297
|
* @throws This function can throw errors.
|
|
13244
13298
|
*/
|
|
13245
13299
|
getItem(slot: number): ItemStack;
|
|
13246
|
-
getSlot(slot: number): ContainerSlot;
|
|
13247
13300
|
/**
|
|
13248
13301
|
* @remarks
|
|
13249
13302
|
* Sets an item stack within a particular slot.
|
|
@@ -13253,7 +13306,7 @@ export class PlayerInventoryComponentContainer extends InventoryComponentContain
|
|
|
13253
13306
|
* Stack of items to place within the specified slot.
|
|
13254
13307
|
* @throws This function can throw errors.
|
|
13255
13308
|
*/
|
|
13256
|
-
setItem(slot: number, itemStack
|
|
13309
|
+
setItem(slot: number, itemStack: ItemStack): void;
|
|
13257
13310
|
/**
|
|
13258
13311
|
* @remarks
|
|
13259
13312
|
* Swaps items between two different slots within containers.
|
|
@@ -13302,8 +13355,10 @@ export class PlayerIterator implements Iterable<Player> {
|
|
|
13302
13355
|
*/
|
|
13303
13356
|
export class PlayerJoinEvent {
|
|
13304
13357
|
protected constructor();
|
|
13305
|
-
|
|
13306
|
-
|
|
13358
|
+
/**
|
|
13359
|
+
* Player that has joined the world.
|
|
13360
|
+
*/
|
|
13361
|
+
player: Player;
|
|
13307
13362
|
}
|
|
13308
13363
|
/**
|
|
13309
13364
|
* Manages callbacks that are connected to a player joining the
|
|
@@ -13333,7 +13388,6 @@ export class PlayerJoinEventSignal {
|
|
|
13333
13388
|
*/
|
|
13334
13389
|
export class PlayerLeaveEvent {
|
|
13335
13390
|
protected constructor();
|
|
13336
|
-
readonly playerId: string;
|
|
13337
13391
|
/**
|
|
13338
13392
|
* Player that has left the world.
|
|
13339
13393
|
*/
|
|
@@ -13361,16 +13415,6 @@ export class PlayerLeaveEventSignal {
|
|
|
13361
13415
|
*/
|
|
13362
13416
|
unsubscribe(callback: (arg: PlayerLeaveEvent) => void): void;
|
|
13363
13417
|
}
|
|
13364
|
-
export class PlayerSpawnEvent {
|
|
13365
|
-
protected constructor();
|
|
13366
|
-
initialSpawn: boolean;
|
|
13367
|
-
player: Player;
|
|
13368
|
-
}
|
|
13369
|
-
export class PlayerSpawnEventSignal {
|
|
13370
|
-
protected constructor();
|
|
13371
|
-
subscribe(callback: (arg: PlayerSpawnEvent) => void): (arg: PlayerSpawnEvent) => void;
|
|
13372
|
-
unsubscribe(callback: (arg: PlayerSpawnEvent) => void): void;
|
|
13373
|
-
}
|
|
13374
13418
|
/**
|
|
13375
13419
|
* Contains information related to a projectile hitting an
|
|
13376
13420
|
* entity or block.
|
|
@@ -13640,23 +13684,6 @@ export class ScreenDisplay {
|
|
|
13640
13684
|
*/
|
|
13641
13685
|
updateSubtitle(subtitle: string): void;
|
|
13642
13686
|
}
|
|
13643
|
-
export class ScriptEventCommandMessageSignal {
|
|
13644
|
-
protected constructor();
|
|
13645
|
-
subscribe(
|
|
13646
|
-
callback: (arg: ScriptScriptCommandMessageEvent) => void,
|
|
13647
|
-
options?: ScriptEventMessageFilterOptions,
|
|
13648
|
-
): (arg: ScriptScriptCommandMessageEvent) => void;
|
|
13649
|
-
unsubscribe(callback: (arg: ScriptScriptCommandMessageEvent) => void): void;
|
|
13650
|
-
}
|
|
13651
|
-
export class ScriptScriptCommandMessageEvent {
|
|
13652
|
-
protected constructor();
|
|
13653
|
-
readonly id: string;
|
|
13654
|
-
readonly initiator: Entity;
|
|
13655
|
-
readonly message: string;
|
|
13656
|
-
readonly sourceBlock: Block;
|
|
13657
|
-
readonly sourceEntity: Entity;
|
|
13658
|
-
readonly sourceType: MessageSourceType;
|
|
13659
|
-
}
|
|
13660
13687
|
/**
|
|
13661
13688
|
* Describes a particular seating position on this rideable
|
|
13662
13689
|
* entity.
|
|
@@ -13802,7 +13829,6 @@ export class SystemEvents {
|
|
|
13802
13829
|
* ability to override termination events may be disabled.
|
|
13803
13830
|
*/
|
|
13804
13831
|
readonly beforeWatchdogTerminate: BeforeWatchdogTerminateEventSignal;
|
|
13805
|
-
readonly scriptEventReceive: ScriptEventCommandMessageSignal;
|
|
13806
13832
|
}
|
|
13807
13833
|
/**
|
|
13808
13834
|
* An event for handling updates, that fires 20 times every
|
|
@@ -14137,7 +14163,7 @@ export class World {
|
|
|
14137
14163
|
* @param message
|
|
14138
14164
|
* @throws This function can throw errors.
|
|
14139
14165
|
*/
|
|
14140
|
-
say(message:
|
|
14166
|
+
say(message: IRawMessage | string): void;
|
|
14141
14167
|
/**
|
|
14142
14168
|
* @remarks
|
|
14143
14169
|
* Sets a specified property to a value.
|
|
@@ -14466,6 +14492,33 @@ export interface ExplosionOptions {
|
|
|
14466
14492
|
*/
|
|
14467
14493
|
source?: Entity;
|
|
14468
14494
|
}
|
|
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
|
+
}
|
|
14469
14522
|
/**
|
|
14470
14523
|
* Additional configuration options for {@link
|
|
14471
14524
|
* World.playMusic}/{@link World.queueMusic} methods.
|
|
@@ -14484,12 +14537,6 @@ export interface MusicOptions {
|
|
|
14484
14537
|
*/
|
|
14485
14538
|
volume?: number;
|
|
14486
14539
|
}
|
|
14487
|
-
export interface RawMessage {
|
|
14488
|
-
rawtext?: RawMessage[] | string[];
|
|
14489
|
-
text?: string;
|
|
14490
|
-
translate?: string;
|
|
14491
|
-
with?: RawMessage[] | string[];
|
|
14492
|
-
}
|
|
14493
14540
|
/**
|
|
14494
14541
|
* Contains additional options for how a scoreboard should be
|
|
14495
14542
|
* displayed within its display slot.
|
|
@@ -14504,9 +14551,6 @@ export interface ScoreboardObjectiveDisplayOptions {
|
|
|
14504
14551
|
*/
|
|
14505
14552
|
sortOrder?: ObjectiveSortOrder;
|
|
14506
14553
|
}
|
|
14507
|
-
export interface ScriptEventMessageFilterOptions {
|
|
14508
|
-
namespaces: string[];
|
|
14509
|
-
}
|
|
14510
14554
|
/**
|
|
14511
14555
|
* Additional configuration options for the {@link
|
|
14512
14556
|
* Player.playSound}/{@link World.playSound} method.
|