@minecraft/server 1.4.0-beta.1.20.0-preview.24 → 1.4.0-beta.1.20.10-preview.21
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/index.d.ts +640 -551
- 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.4.0-internal.1.20.
|
|
19
|
+
* "version": "1.4.0-internal.1.20.10-preview.21"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -223,18 +223,6 @@ export enum ItemLockMode {
|
|
|
223
223
|
slot = 'slot',
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
/**
|
|
227
|
-
* @beta
|
|
228
|
-
*/
|
|
229
|
-
export enum MessageSourceType {
|
|
230
|
-
clientScript = 'clientScript',
|
|
231
|
-
commandBlock = 'commandBlock',
|
|
232
|
-
dialogueCommand = 'dialogueCommand',
|
|
233
|
-
entityCommand = 'entityCommand',
|
|
234
|
-
serverCommand = 'serverCommand',
|
|
235
|
-
serverScript = 'serverScript',
|
|
236
|
-
}
|
|
237
|
-
|
|
238
226
|
/**
|
|
239
227
|
* @beta
|
|
240
228
|
* Used for specifying a sort order for how to display an
|
|
@@ -289,6 +277,16 @@ export enum ScoreboardIdentityType {
|
|
|
289
277
|
player = 'player',
|
|
290
278
|
}
|
|
291
279
|
|
|
280
|
+
/**
|
|
281
|
+
* @beta
|
|
282
|
+
*/
|
|
283
|
+
export enum ScriptEventSource {
|
|
284
|
+
block = 'block',
|
|
285
|
+
entity = 'entity',
|
|
286
|
+
npcDialogue = 'npcDialogue',
|
|
287
|
+
server = 'server',
|
|
288
|
+
}
|
|
289
|
+
|
|
292
290
|
/**
|
|
293
291
|
* @beta
|
|
294
292
|
* Represents a side of a sign.
|
|
@@ -356,264 +354,6 @@ export enum WeatherType {
|
|
|
356
354
|
thunder = 'thunder',
|
|
357
355
|
}
|
|
358
356
|
|
|
359
|
-
/**
|
|
360
|
-
* @beta
|
|
361
|
-
* Contains a set of events that are available across the scope
|
|
362
|
-
* of the World.
|
|
363
|
-
*/
|
|
364
|
-
export class AfterEvents {
|
|
365
|
-
protected constructor();
|
|
366
|
-
/**
|
|
367
|
-
* @remarks
|
|
368
|
-
* This event fires for a block that is broken by a player.
|
|
369
|
-
*
|
|
370
|
-
*/
|
|
371
|
-
readonly blockBreak: BlockBreakAfterEventSignal;
|
|
372
|
-
/**
|
|
373
|
-
* @remarks
|
|
374
|
-
* This event fires for each BlockLocation destroyed by an
|
|
375
|
-
* explosion. It is fired after the blocks have already been
|
|
376
|
-
* destroyed.
|
|
377
|
-
*
|
|
378
|
-
*/
|
|
379
|
-
readonly blockExplode: BlockExplodeAfterEventSignal;
|
|
380
|
-
/**
|
|
381
|
-
* @remarks
|
|
382
|
-
* This event fires for a block that is placed by a player.
|
|
383
|
-
*
|
|
384
|
-
*/
|
|
385
|
-
readonly blockPlace: BlockPlaceAfterEventSignal;
|
|
386
|
-
/**
|
|
387
|
-
* @remarks
|
|
388
|
-
* This event fires when a button is pushed.
|
|
389
|
-
*
|
|
390
|
-
*/
|
|
391
|
-
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
392
|
-
/**
|
|
393
|
-
* @remarks
|
|
394
|
-
* This event is triggered after a chat message has been
|
|
395
|
-
* broadcast or sent to players.
|
|
396
|
-
*
|
|
397
|
-
*/
|
|
398
|
-
readonly chatSend: ChatSendAfterEventSignal;
|
|
399
|
-
/**
|
|
400
|
-
* @remarks
|
|
401
|
-
* This event is fired when an entity event has been triggered
|
|
402
|
-
* that will update the component definition state of an
|
|
403
|
-
* entity.
|
|
404
|
-
*
|
|
405
|
-
*/
|
|
406
|
-
readonly dataDrivenEntityTriggerEvent: DataDrivenEntityTriggerAfterEventSignal;
|
|
407
|
-
/**
|
|
408
|
-
* @remarks
|
|
409
|
-
* This event fires when an effect, like poisoning, is added to
|
|
410
|
-
* an entity.
|
|
411
|
-
*
|
|
412
|
-
*/
|
|
413
|
-
readonly effectAdd: EffectAddAfterEventSignal;
|
|
414
|
-
/**
|
|
415
|
-
* @remarks
|
|
416
|
-
* This event fires when an entity dies.
|
|
417
|
-
*
|
|
418
|
-
*/
|
|
419
|
-
readonly entityDie: EntityDieAfterEventSignal;
|
|
420
|
-
/**
|
|
421
|
-
* @remarks
|
|
422
|
-
* This event fires when an entity hits (makes a melee attack)
|
|
423
|
-
* and potentially impacts another entity or block.
|
|
424
|
-
*
|
|
425
|
-
*/
|
|
426
|
-
readonly entityHit: EntityHitAfterEventSignal;
|
|
427
|
-
/**
|
|
428
|
-
* @remarks
|
|
429
|
-
* This event fires when an entity is hurt (takes damage).
|
|
430
|
-
*
|
|
431
|
-
*/
|
|
432
|
-
readonly entityHurt: EntityHurtAfterEventSignal;
|
|
433
|
-
readonly entityRemoved: EntityRemovedAfterEventSignal;
|
|
434
|
-
/**
|
|
435
|
-
* @remarks
|
|
436
|
-
* This event fires when an entity is spawned.
|
|
437
|
-
*
|
|
438
|
-
*/
|
|
439
|
-
readonly entitySpawn: EntitySpawnAfterEventSignal;
|
|
440
|
-
/**
|
|
441
|
-
* @remarks
|
|
442
|
-
* This event is fired after an explosion occurs.
|
|
443
|
-
*
|
|
444
|
-
*/
|
|
445
|
-
readonly explosion: ExplosionAfterEventSignal;
|
|
446
|
-
readonly itemCompleteUse: ItemCompleteUseAfterEventSignal;
|
|
447
|
-
/**
|
|
448
|
-
* @remarks
|
|
449
|
-
* For custom items, this event is triggered when the
|
|
450
|
-
* fundamental set of defined components for the item change.
|
|
451
|
-
* Note that this event is only fired for custom data-driven
|
|
452
|
-
* items.
|
|
453
|
-
*
|
|
454
|
-
*/
|
|
455
|
-
readonly itemDefinitionEvent: ItemDefinitionAfterEventSignal;
|
|
456
|
-
readonly itemReleaseUse: ItemReleaseUseAfterEventSignal;
|
|
457
|
-
readonly itemStartUse: ItemStartUseAfterEventSignal;
|
|
458
|
-
/**
|
|
459
|
-
* @remarks
|
|
460
|
-
* This event fires when a player successfully uses an item or
|
|
461
|
-
* places a block by pressing the Use Item / Place Block
|
|
462
|
-
* button. If multiple blocks are placed, this event will only
|
|
463
|
-
* occur once at the beginning of the block placement. Note:
|
|
464
|
-
* This event cannot be used with Hoe or Axe items.
|
|
465
|
-
*
|
|
466
|
-
*/
|
|
467
|
-
readonly itemStartUseOn: ItemStartUseOnAfterEventSignal;
|
|
468
|
-
readonly itemStopUse: ItemStopUseAfterEventSignal;
|
|
469
|
-
/**
|
|
470
|
-
* @remarks
|
|
471
|
-
* This event fires when a player releases the Use Item / Place
|
|
472
|
-
* Block button after successfully using an item. Note: This
|
|
473
|
-
* event cannot be used with Hoe or Axe items.
|
|
474
|
-
*
|
|
475
|
-
*/
|
|
476
|
-
readonly itemStopUseOn: ItemStopUseOnAfterEventSignal;
|
|
477
|
-
/**
|
|
478
|
-
* @remarks
|
|
479
|
-
* This event fires when an item is successfully used by a
|
|
480
|
-
* player.
|
|
481
|
-
*
|
|
482
|
-
*/
|
|
483
|
-
readonly itemUse: ItemUseAfterEventSignal;
|
|
484
|
-
/**
|
|
485
|
-
* @remarks
|
|
486
|
-
* This event fires when an item is used on a block by a
|
|
487
|
-
* player.
|
|
488
|
-
*
|
|
489
|
-
*/
|
|
490
|
-
readonly itemUseOn: ItemUseOnAfterEventSignal;
|
|
491
|
-
/**
|
|
492
|
-
* @remarks
|
|
493
|
-
* This event fires when a lever activates or is deactivated.
|
|
494
|
-
*
|
|
495
|
-
*/
|
|
496
|
-
readonly leverActivate: LeverActionAfterEventSignal;
|
|
497
|
-
/**
|
|
498
|
-
* @remarks
|
|
499
|
-
* This event is an internal implementation detail, and is
|
|
500
|
-
* otherwise not currently functional.
|
|
501
|
-
*
|
|
502
|
-
*/
|
|
503
|
-
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
504
|
-
/**
|
|
505
|
-
* @remarks
|
|
506
|
-
* This event fires when a piston expands or retracts.
|
|
507
|
-
*
|
|
508
|
-
*/
|
|
509
|
-
readonly pistonActivate: PistonActivateAfterEventSignal;
|
|
510
|
-
/**
|
|
511
|
-
* @remarks
|
|
512
|
-
* This event fires when a player joins a world. See also
|
|
513
|
-
* playerSpawn for another related event you can trap for when
|
|
514
|
-
* a player is spawned the first time within a world.
|
|
515
|
-
*
|
|
516
|
-
*/
|
|
517
|
-
readonly playerJoin: PlayerJoinAfterEventSignal;
|
|
518
|
-
/**
|
|
519
|
-
* @remarks
|
|
520
|
-
* This event fires when a player leaves a world.
|
|
521
|
-
*
|
|
522
|
-
*/
|
|
523
|
-
readonly playerLeave: PlayerLeaveAfterEventSignal;
|
|
524
|
-
/**
|
|
525
|
-
* @remarks
|
|
526
|
-
* This event fires when a player spawns or respawns. Note that
|
|
527
|
-
* an additional flag within this event will tell you whether
|
|
528
|
-
* the player is spawning right after join vs. a respawn.
|
|
529
|
-
*
|
|
530
|
-
*/
|
|
531
|
-
readonly playerSpawn: PlayerSpawnAfterEventSignal;
|
|
532
|
-
/**
|
|
533
|
-
* @remarks
|
|
534
|
-
* This event fires when a projectile hits an entity or block.
|
|
535
|
-
*
|
|
536
|
-
*/
|
|
537
|
-
readonly projectileHit: ProjectileHitAfterEventSignal;
|
|
538
|
-
/**
|
|
539
|
-
* @remarks
|
|
540
|
-
* This event will be triggered when the weather changes within
|
|
541
|
-
* Minecraft.
|
|
542
|
-
*
|
|
543
|
-
*/
|
|
544
|
-
readonly weatherChange: WeatherChangeAfterEventSignal;
|
|
545
|
-
/**
|
|
546
|
-
* @remarks
|
|
547
|
-
* This event fires when the script environment is initialized
|
|
548
|
-
* on a World. In addition, you can register dynamic properties
|
|
549
|
-
* within the scope of a world Initialize event.
|
|
550
|
-
*
|
|
551
|
-
*/
|
|
552
|
-
readonly worldInitialize: WorldInitializeAfterEventSignal;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* @beta
|
|
557
|
-
* A set of events that fire before an actual action occurs. In
|
|
558
|
-
* most cases, you can potentially cancel or modify the
|
|
559
|
-
* impending event. Note that in before events any APIs that
|
|
560
|
-
* modify gameplay state will not function and will throw an
|
|
561
|
-
* error. (e.g., dimension.spawnEntity)
|
|
562
|
-
*/
|
|
563
|
-
export class BeforeEvents {
|
|
564
|
-
protected constructor();
|
|
565
|
-
/**
|
|
566
|
-
* @remarks
|
|
567
|
-
* This event is triggered after a chat message has been
|
|
568
|
-
* broadcast or sent to players.
|
|
569
|
-
*
|
|
570
|
-
*/
|
|
571
|
-
readonly chatSend: ChatSendBeforeEventSignal;
|
|
572
|
-
/**
|
|
573
|
-
* @remarks
|
|
574
|
-
* This event is fired when an entity event has been triggered
|
|
575
|
-
* that will update the component definition state of an
|
|
576
|
-
* entity.
|
|
577
|
-
*
|
|
578
|
-
*/
|
|
579
|
-
readonly dataDrivenEntityTriggerEvent: DataDrivenEntityTriggerBeforeEventSignal;
|
|
580
|
-
/**
|
|
581
|
-
* @remarks
|
|
582
|
-
* This event is fired after an explosion occurs.
|
|
583
|
-
*
|
|
584
|
-
*/
|
|
585
|
-
readonly explosion: ExplosionBeforeEventSignal;
|
|
586
|
-
/**
|
|
587
|
-
* @remarks
|
|
588
|
-
* For custom items, this event is triggered when the
|
|
589
|
-
* fundamental set of defined components for the item change.
|
|
590
|
-
* Note that this event is only fired for custom data-driven
|
|
591
|
-
* items.
|
|
592
|
-
*
|
|
593
|
-
*/
|
|
594
|
-
readonly itemDefinitionEvent: ItemDefinitionBeforeEventSignal;
|
|
595
|
-
/**
|
|
596
|
-
* @remarks
|
|
597
|
-
* This event fires when an item is successfully used by a
|
|
598
|
-
* player.
|
|
599
|
-
*
|
|
600
|
-
*/
|
|
601
|
-
readonly itemUse: ItemUseBeforeEventSignal;
|
|
602
|
-
/**
|
|
603
|
-
* @remarks
|
|
604
|
-
* This event fires when an item is used on a block by a
|
|
605
|
-
* player.
|
|
606
|
-
*
|
|
607
|
-
*/
|
|
608
|
-
readonly itemUseOn: ItemUseOnBeforeEventSignal;
|
|
609
|
-
/**
|
|
610
|
-
* @remarks
|
|
611
|
-
* This event fires when a piston expands or retracts.
|
|
612
|
-
*
|
|
613
|
-
*/
|
|
614
|
-
readonly pistonActivate: PistonActivateBeforeEventSignal;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
357
|
/**
|
|
618
358
|
* @beta
|
|
619
359
|
* Represents a block in a dimension. A block represents a
|
|
@@ -771,15 +511,14 @@ export class Block {
|
|
|
771
511
|
* @throws This function can throw errors.
|
|
772
512
|
* @example check_block_tags.js
|
|
773
513
|
* ```typescript
|
|
774
|
-
*
|
|
775
|
-
*
|
|
776
|
-
* // Fetch the block
|
|
777
|
-
* const block = world.getDimension("overworld").getBlock({ x: 1, y: 2, z: 3 });
|
|
514
|
+
* import { world } from "@minecraft/server";
|
|
778
515
|
*
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
* console.log(`Block is stone: ${block.hasTag("stone")}`);
|
|
516
|
+
* // Fetch the block
|
|
517
|
+
* const block = world.getDimension("overworld").getBlock({ x: 1, y: 2, z: 3 });
|
|
782
518
|
*
|
|
519
|
+
* console.log(`Block is dirt: ${block.hasTag("dirt")}`);
|
|
520
|
+
* console.log(`Block is wood: ${block.hasTag("wood")}`);
|
|
521
|
+
* console.log(`Block is stone: ${block.hasTag("stone")}`);
|
|
783
522
|
* ```
|
|
784
523
|
*/
|
|
785
524
|
hasTag(tag: string): boolean;
|
|
@@ -812,6 +551,10 @@ export class Block {
|
|
|
812
551
|
* @throws This function can throw errors.
|
|
813
552
|
*/
|
|
814
553
|
isSolid(): boolean;
|
|
554
|
+
/**
|
|
555
|
+
* @beta
|
|
556
|
+
*/
|
|
557
|
+
isValid(): boolean;
|
|
815
558
|
/**
|
|
816
559
|
* @remarks
|
|
817
560
|
* Sets the block in the dimension to the state of the
|
|
@@ -1159,16 +902,15 @@ export class BlockPermutation {
|
|
|
1159
902
|
* Returns `true` if the permutation has the tag, else `false`.
|
|
1160
903
|
* @example check_block_tags.js
|
|
1161
904
|
* ```typescript
|
|
1162
|
-
*
|
|
1163
|
-
*
|
|
1164
|
-
* // Fetch the block
|
|
1165
|
-
* const block = world.getDimension("overworld").getBlock({ x: 1, y: 2, z: 3 });
|
|
1166
|
-
* const blockPerm = block.getPermutation();
|
|
905
|
+
* import { world } from "@minecraft/server";
|
|
1167
906
|
*
|
|
1168
|
-
*
|
|
1169
|
-
*
|
|
1170
|
-
*
|
|
907
|
+
* // Fetch the block
|
|
908
|
+
* const block = world.getDimension("overworld").getBlock({ x: 1, y: 2, z: 3 });
|
|
909
|
+
* const blockPerm = block.getPermutation();
|
|
1171
910
|
*
|
|
911
|
+
* console.log(`Block is dirt: ${blockPerm.hasTag("dirt")}`);
|
|
912
|
+
* console.log(`Block is wood: ${blockPerm.hasTag("wood")}`);
|
|
913
|
+
* console.log(`Block is stone: ${blockPerm.hasTag("stone")}`);
|
|
1172
914
|
* ```
|
|
1173
915
|
*/
|
|
1174
916
|
hasTag(tag: string): boolean;
|
|
@@ -1435,27 +1177,27 @@ export class BlockSignComponent extends BlockComponent {
|
|
|
1435
1177
|
* @throws This function can throw errors.
|
|
1436
1178
|
* @example SetRawMessage.ts
|
|
1437
1179
|
* ```typescript
|
|
1438
|
-
*
|
|
1439
|
-
*
|
|
1180
|
+
* const helloWorldMessage: RawMessage = { text: 'Hello World' };
|
|
1181
|
+
* sign.setText(helloWorldMessage);
|
|
1440
1182
|
*
|
|
1441
|
-
*
|
|
1442
|
-
*
|
|
1443
|
-
*
|
|
1183
|
+
* // Sign text will be saved as a RawText
|
|
1184
|
+
* const result: RawText = sign.getRawText();
|
|
1185
|
+
* JSON.stringify(result); // { rawtext: [{ text: 'Hello World' }] };
|
|
1444
1186
|
* ```
|
|
1445
1187
|
* @example SetRawText.ts
|
|
1446
1188
|
* ```typescript
|
|
1447
|
-
*
|
|
1448
|
-
*
|
|
1189
|
+
* const helloWorldText: RawText = { rawtext: [{ text: 'Hello World' }] };
|
|
1190
|
+
* sign.setText(helloWorldText);
|
|
1449
1191
|
*
|
|
1450
|
-
*
|
|
1451
|
-
*
|
|
1452
|
-
*
|
|
1192
|
+
* // There will be no data transformation unlike calling setText with a RawMessage
|
|
1193
|
+
* const result: RawText = sign.getRawText();
|
|
1194
|
+
* JSON.stringify(result); // { rawtext: [{ text: 'Hello World' }] };
|
|
1453
1195
|
* ```
|
|
1454
1196
|
* @example SetString.ts
|
|
1455
1197
|
* ```typescript
|
|
1456
|
-
*
|
|
1457
|
-
*
|
|
1458
|
-
*
|
|
1198
|
+
* // Set sign to say 'Hello'
|
|
1199
|
+
* sign.setText('Hello');
|
|
1200
|
+
* sign.getText(); // 'Hello'
|
|
1459
1201
|
* ```
|
|
1460
1202
|
*/
|
|
1461
1203
|
setText(message: RawMessage | RawText | string, side?: SignSide): void;
|
|
@@ -2240,10 +1982,9 @@ export class Container {
|
|
|
2240
1982
|
* out of bounds.
|
|
2241
1983
|
* @example getItem.ts
|
|
2242
1984
|
* ```typescript
|
|
2243
|
-
*
|
|
2244
|
-
*
|
|
2245
|
-
*
|
|
2246
|
-
*
|
|
1985
|
+
* // Get a copy of the first item in the player's hotbar
|
|
1986
|
+
* const inventory = player.getComponent("inventory") as EntityInventoryComponent;
|
|
1987
|
+
* const itemStack = inventory.container.getItem(0);
|
|
2247
1988
|
* ```
|
|
2248
1989
|
*/
|
|
2249
1990
|
getItem(slot: number): ItemStack | undefined;
|
|
@@ -2261,6 +2002,10 @@ export class Container {
|
|
|
2261
2002
|
* out of bounds.
|
|
2262
2003
|
*/
|
|
2263
2004
|
getSlot(slot: number): ContainerSlot;
|
|
2005
|
+
/**
|
|
2006
|
+
* @beta
|
|
2007
|
+
*/
|
|
2008
|
+
isValid(): boolean;
|
|
2264
2009
|
/**
|
|
2265
2010
|
* @remarks
|
|
2266
2011
|
* Moves an item from one slot to another, potentially across
|
|
@@ -2282,11 +2027,10 @@ export class Container {
|
|
|
2282
2027
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
2283
2028
|
* @example moveItem.ts
|
|
2284
2029
|
* ```typescript
|
|
2285
|
-
*
|
|
2286
|
-
*
|
|
2287
|
-
*
|
|
2288
|
-
*
|
|
2289
|
-
*
|
|
2030
|
+
* // Move an item from the first slot of fromPlayer's inventory to the fifth slot of toPlayer's inventory
|
|
2031
|
+
* const fromInventory = fromPlayer.getComponent('inventory') as EntityInventoryComponent;
|
|
2032
|
+
* const toInventory = toPlayer.getComponent('inventory') as EntityInventoryComponent;
|
|
2033
|
+
* fromInventory.container.moveItem(0, 4, toInventory.container);
|
|
2290
2034
|
* ```
|
|
2291
2035
|
*/
|
|
2292
2036
|
moveItem(fromSlot: number, toSlot: number, toContainer: Container): void;
|
|
@@ -2324,10 +2068,9 @@ export class Container {
|
|
|
2324
2068
|
* invalid or if the `slot` or `otherSlot` are out of bounds.
|
|
2325
2069
|
* @example swapItems.ts
|
|
2326
2070
|
* ```typescript
|
|
2327
|
-
*
|
|
2328
|
-
*
|
|
2329
|
-
*
|
|
2330
|
-
*
|
|
2071
|
+
* // Swaps an item between slots 0 and 4 in the player's inventory
|
|
2072
|
+
* const inventory = fromPlayer.getComponent('inventory') as EntityInventoryComponent;
|
|
2073
|
+
* inventory.container.swapItems(0, 4, inventory);
|
|
2331
2074
|
* ```
|
|
2332
2075
|
*/
|
|
2333
2076
|
swapItems(slot: number, otherSlot: number, otherContainer: Container): void;
|
|
@@ -2349,11 +2092,10 @@ export class Container {
|
|
|
2349
2092
|
* or if the `fromSlot` or `toSlot` indices out of bounds.
|
|
2350
2093
|
* @example transferItem.ts
|
|
2351
2094
|
* ```typescript
|
|
2352
|
-
*
|
|
2353
|
-
*
|
|
2354
|
-
*
|
|
2355
|
-
*
|
|
2356
|
-
*
|
|
2095
|
+
* // Transfer an item from the first slot of fromPlayer's inventory to toPlayer's inventory
|
|
2096
|
+
* const fromInventory = fromPlayer.getComponent('inventory') as EntityInventoryComponent;
|
|
2097
|
+
* const toInventory = toPlayer.getComponent('inventory') as EntityInventoryComponent;
|
|
2098
|
+
* fromInventory.container.transferItem(0, toInventory.container);
|
|
2357
2099
|
* ```
|
|
2358
2100
|
*/
|
|
2359
2101
|
transferItem(fromSlot: number, toContainer: Container): ItemStack;
|
|
@@ -2388,14 +2130,6 @@ export class ContainerSlot {
|
|
|
2388
2130
|
* Throws if the slot's container is invalid.
|
|
2389
2131
|
*/
|
|
2390
2132
|
readonly isStackable: boolean;
|
|
2391
|
-
/**
|
|
2392
|
-
* @remarks
|
|
2393
|
-
* Returns whether the ContainerSlot is valid. The container
|
|
2394
|
-
* slot is valid if the container exists and is loaded, and the
|
|
2395
|
-
* slot index is valid.
|
|
2396
|
-
*
|
|
2397
|
-
*/
|
|
2398
|
-
readonly isValid: boolean;
|
|
2399
2133
|
/**
|
|
2400
2134
|
* @remarks
|
|
2401
2135
|
* Gets or sets whether the item is kept on death.
|
|
@@ -2520,6 +2254,14 @@ export class ContainerSlot {
|
|
|
2520
2254
|
* Throws if the slot's container is invalid.
|
|
2521
2255
|
*/
|
|
2522
2256
|
isStackableWith(itemStack: ItemStack): boolean;
|
|
2257
|
+
/**
|
|
2258
|
+
* @remarks
|
|
2259
|
+
* Returns whether the ContainerSlot is valid. The container
|
|
2260
|
+
* slot is valid if the container exists and is loaded, and the
|
|
2261
|
+
* slot index is valid.
|
|
2262
|
+
*
|
|
2263
|
+
*/
|
|
2264
|
+
isValid(): boolean;
|
|
2523
2265
|
/**
|
|
2524
2266
|
* @remarks
|
|
2525
2267
|
* The list of block types this item can break in Adventure
|
|
@@ -2753,43 +2495,41 @@ export class Dimension {
|
|
|
2753
2495
|
* @throws This function can throw errors.
|
|
2754
2496
|
* @example createExplosion.ts
|
|
2755
2497
|
* ```typescript
|
|
2756
|
-
*
|
|
2498
|
+
* overworld.createExplosion(targetLocation, 10, new mc.ExplosionOptions());
|
|
2757
2499
|
* ```
|
|
2758
2500
|
* @example createFireAndWaterExplosions.ts
|
|
2759
2501
|
* ```typescript
|
|
2760
|
-
*
|
|
2761
|
-
*
|
|
2762
|
-
* const fireExplosionOptions = new mc.ExplosionOptions();
|
|
2502
|
+
* const explosionLoc: mc.Vector3 = { x: targetLocation.x + 0.5, y: targetLocation.y + 0.5, z: targetLocation.z + 0.5 };
|
|
2763
2503
|
*
|
|
2764
|
-
*
|
|
2765
|
-
* fireExplosionOptions.causesFire = true;
|
|
2504
|
+
* const fireExplosionOptions = new mc.ExplosionOptions();
|
|
2766
2505
|
*
|
|
2767
|
-
*
|
|
2768
|
-
*
|
|
2506
|
+
* // Explode with fire
|
|
2507
|
+
* fireExplosionOptions.causesFire = true;
|
|
2769
2508
|
*
|
|
2770
|
-
*
|
|
2771
|
-
*
|
|
2509
|
+
* overworld.createExplosion(explosionLoc, 15, fireExplosionOptions);
|
|
2510
|
+
* const waterExplosionOptions = new mc.ExplosionOptions();
|
|
2772
2511
|
*
|
|
2773
|
-
*
|
|
2512
|
+
* // Explode in water
|
|
2513
|
+
* waterExplosionOptions.allowUnderwater = true;
|
|
2774
2514
|
*
|
|
2775
|
-
*
|
|
2515
|
+
* const belowWaterLoc: mc.Vector3 = { x: targetLocation.x + 3, y: targetLocation.y + 1, z: targetLocation.z + 3 };
|
|
2776
2516
|
*
|
|
2517
|
+
* overworld.createExplosion(belowWaterLoc, 10, waterExplosionOptions);
|
|
2777
2518
|
* ```
|
|
2778
2519
|
* @example createNoBlockExplosion.ts
|
|
2779
2520
|
* ```typescript
|
|
2780
|
-
*
|
|
2521
|
+
* const explosionOptions = new mc.ExplosionOptions();
|
|
2781
2522
|
*
|
|
2782
|
-
*
|
|
2783
|
-
*
|
|
2523
|
+
* // Start by exploding without breaking blocks
|
|
2524
|
+
* explosionOptions.breaksBlocks = false;
|
|
2784
2525
|
*
|
|
2785
|
-
*
|
|
2786
|
-
*
|
|
2787
|
-
*
|
|
2788
|
-
*
|
|
2789
|
-
*
|
|
2790
|
-
*
|
|
2791
|
-
* overworld.createExplosion(explodeNoBlocksLoc, 15, explosionOptions);
|
|
2526
|
+
* const explodeNoBlocksLoc: mc.Vector3 = {
|
|
2527
|
+
* x: Math.floor(targetLocation.x + 1),
|
|
2528
|
+
* y: Math.floor(targetLocation.y + 2),
|
|
2529
|
+
* z: Math.floor(targetLocation.z + 1),
|
|
2530
|
+
* };
|
|
2792
2531
|
*
|
|
2532
|
+
* overworld.createExplosion(explodeNoBlocksLoc, 15, explosionOptions);
|
|
2793
2533
|
* ```
|
|
2794
2534
|
*/
|
|
2795
2535
|
createExplosion(location: Vector3, radius: number, explosionOptions?: ExplosionOptions): void;
|
|
@@ -2856,22 +2596,21 @@ export class Dimension {
|
|
|
2856
2596
|
* @throws This function can throw errors.
|
|
2857
2597
|
* @example testThatEntityIsFeatherItem.ts
|
|
2858
2598
|
* ```typescript
|
|
2859
|
-
*
|
|
2860
|
-
*
|
|
2861
|
-
*
|
|
2862
|
-
*
|
|
2863
|
-
*
|
|
2864
|
-
*
|
|
2865
|
-
*
|
|
2866
|
-
*
|
|
2867
|
-
*
|
|
2868
|
-
*
|
|
2869
|
-
*
|
|
2870
|
-
*
|
|
2871
|
-
*
|
|
2872
|
-
*
|
|
2873
|
-
*
|
|
2874
|
-
*
|
|
2599
|
+
* const query = {
|
|
2600
|
+
* type: "item",
|
|
2601
|
+
* location: targetLocation,
|
|
2602
|
+
* };
|
|
2603
|
+
* const items = overworld.getEntities(query);
|
|
2604
|
+
*
|
|
2605
|
+
* for (const item of items) {
|
|
2606
|
+
* const itemComp = item.getComponent("item") as any;
|
|
2607
|
+
*
|
|
2608
|
+
* if (itemComp) {
|
|
2609
|
+
* if (itemComp.itemStack.id.endsWith("feather")) {
|
|
2610
|
+
* console.log("Success! Found a feather", 1);
|
|
2611
|
+
* }
|
|
2612
|
+
* }
|
|
2613
|
+
* }
|
|
2875
2614
|
* ```
|
|
2876
2615
|
*/
|
|
2877
2616
|
getEntities(options?: EntityQueryOptions): Entity[];
|
|
@@ -2960,41 +2699,40 @@ export class Dimension {
|
|
|
2960
2699
|
* @throws This function can throw errors.
|
|
2961
2700
|
* @example createOldHorse.ts
|
|
2962
2701
|
* ```typescript
|
|
2963
|
-
*
|
|
2964
|
-
*
|
|
2702
|
+
* // create a horse and trigger the 'ageable_grow_up' event, ensuring the horse is created as an adult
|
|
2703
|
+
* overworld.spawnEntity("minecraft:horse<minecraft:ageable_grow_up>", targetLocation);
|
|
2965
2704
|
* ```
|
|
2966
2705
|
* @example quickFoxLazyDog.ts
|
|
2967
2706
|
* ```typescript
|
|
2968
|
-
*
|
|
2969
|
-
*
|
|
2970
|
-
*
|
|
2971
|
-
*
|
|
2972
|
-
*
|
|
2973
|
-
*
|
|
2974
|
-
*
|
|
2975
|
-
*
|
|
2976
|
-
*
|
|
2977
|
-
*
|
|
2978
|
-
*
|
|
2979
|
-
*
|
|
2980
|
-
*
|
|
2981
|
-
*
|
|
2982
|
-
*
|
|
2983
|
-
*
|
|
2984
|
-
*
|
|
2707
|
+
* const fox = overworld.spawnEntity("minecraft:fox", {
|
|
2708
|
+
* x: targetLocation.x + 1,
|
|
2709
|
+
* y: targetLocation.y + 2,
|
|
2710
|
+
* z: targetLocation.z + 3,
|
|
2711
|
+
* });
|
|
2712
|
+
* fox.addEffect(mc.MinecraftEffectTypes.Speed, 10, 20);
|
|
2713
|
+
* log("Created a fox.");
|
|
2714
|
+
*
|
|
2715
|
+
* const wolf = overworld.spawnEntity("minecraft:wolf", {
|
|
2716
|
+
* x: targetLocation.x + 4,
|
|
2717
|
+
* y: targetLocation.y + 2,
|
|
2718
|
+
* z: targetLocation.z + 3,
|
|
2719
|
+
* });
|
|
2720
|
+
* wolf.addEffect(mc.MinecraftEffectTypes.Slowness, 10, 20);
|
|
2721
|
+
* wolf.isSneaking = true;
|
|
2722
|
+
* log("Created a sneaking wolf.", 1);
|
|
2985
2723
|
* ```
|
|
2986
2724
|
* @example trapTick.ts
|
|
2987
2725
|
* ```typescript
|
|
2988
|
-
*
|
|
2726
|
+
* let ticks = 0;
|
|
2989
2727
|
*
|
|
2990
|
-
*
|
|
2991
|
-
*
|
|
2728
|
+
* mc.world.events.tick.subscribe((event: mc.TickEvent) => {
|
|
2729
|
+
* ticks++;
|
|
2992
2730
|
*
|
|
2993
|
-
*
|
|
2994
|
-
*
|
|
2995
|
-
*
|
|
2996
|
-
*
|
|
2997
|
-
*
|
|
2731
|
+
* // Minecraft runs at 20 ticks per second
|
|
2732
|
+
* if (ticks % 1200 === 0) {
|
|
2733
|
+
* overworld.runCommand("say Another minute passes...");
|
|
2734
|
+
* }
|
|
2735
|
+
* });
|
|
2998
2736
|
* ```
|
|
2999
2737
|
*/
|
|
3000
2738
|
spawnEntity(identifier: string, location: Vector3): Entity;
|
|
@@ -3013,25 +2751,24 @@ export class Dimension {
|
|
|
3013
2751
|
* @throws This function can throw errors.
|
|
3014
2752
|
* @example itemStacks.ts
|
|
3015
2753
|
* ```typescript
|
|
3016
|
-
*
|
|
3017
|
-
*
|
|
3018
|
-
*
|
|
3019
|
-
*
|
|
3020
|
-
* const oneEmerald = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 1, 0);
|
|
3021
|
-
* const onePickaxe = new mc.ItemStack(mc.MinecraftItemTypes.diamondPickaxe, 1, 0);
|
|
3022
|
-
* const fiveEmeralds = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 5, 0);
|
|
2754
|
+
* const oneItemLoc: mc.Vector3 = { x: 3, y: 2, z: 1 };
|
|
2755
|
+
* const fiveItemsLoc: mc.Vector3 = { x: 1, y: 2, z: 1 };
|
|
2756
|
+
* const diamondPickaxeLoc: mc.Vector3 = { x: 2, y: 2, z: 4 };
|
|
3023
2757
|
*
|
|
3024
|
-
*
|
|
3025
|
-
*
|
|
3026
|
-
*
|
|
2758
|
+
* const oneEmerald = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 1, 0);
|
|
2759
|
+
* const onePickaxe = new mc.ItemStack(mc.MinecraftItemTypes.diamondPickaxe, 1, 0);
|
|
2760
|
+
* const fiveEmeralds = new mc.ItemStack(mc.MinecraftItemTypes.emerald, 5, 0);
|
|
3027
2761
|
*
|
|
2762
|
+
* overworld.spawnItem(oneEmerald, oneItemLoc);
|
|
2763
|
+
* overworld.spawnItem(fiveEmeralds, fiveItemsLoc);
|
|
2764
|
+
* overworld.spawnItem(onePickaxe, diamondPickaxeLoc);
|
|
3028
2765
|
* ```
|
|
3029
2766
|
* @example spawnItem.ts
|
|
3030
2767
|
* ```typescript
|
|
3031
|
-
*
|
|
2768
|
+
* const featherItem = new mc.ItemStack(mc.MinecraftItemTypes.feather, 1, 0);
|
|
3032
2769
|
*
|
|
3033
|
-
*
|
|
3034
|
-
*
|
|
2770
|
+
* overworld.spawnItem(featherItem, targetLocation);
|
|
2771
|
+
* log("New feather created!");
|
|
3035
2772
|
* ```
|
|
3036
2773
|
*/
|
|
3037
2774
|
spawnItem(itemStack: ItemStack, location: Vector3): Entity;
|
|
@@ -3127,6 +2864,7 @@ export class Effect {
|
|
|
3127
2864
|
* @throws This property can throw when used.
|
|
3128
2865
|
*/
|
|
3129
2866
|
readonly typeId: string;
|
|
2867
|
+
isValid(): boolean;
|
|
3130
2868
|
}
|
|
3131
2869
|
|
|
3132
2870
|
/**
|
|
@@ -3554,7 +3292,7 @@ export class Entity {
|
|
|
3554
3292
|
/**
|
|
3555
3293
|
* @beta
|
|
3556
3294
|
* @remarks
|
|
3557
|
-
* Adds an effect, like poison, to the entity.
|
|
3295
|
+
* Adds or updates an effect, like poison, to the entity.
|
|
3558
3296
|
*
|
|
3559
3297
|
* This function can't be called in read-only mode.
|
|
3560
3298
|
*
|
|
@@ -3568,42 +3306,41 @@ export class Entity {
|
|
|
3568
3306
|
* @param options
|
|
3569
3307
|
* Additional options for the effect.
|
|
3570
3308
|
* @returns
|
|
3571
|
-
* Returns
|
|
3572
|
-
*
|
|
3573
|
-
* ranges
|
|
3309
|
+
* Returns nothing if the effect was added or updated
|
|
3310
|
+
* successfully. This can throw an error if the duration or
|
|
3311
|
+
* amplifier are outside of the valid ranges, or if the effect
|
|
3312
|
+
* does not exist.
|
|
3574
3313
|
* @throws This function can throw errors.
|
|
3575
3314
|
* @example addEffect.js
|
|
3576
3315
|
* ```typescript
|
|
3577
|
-
*
|
|
3578
|
-
*
|
|
3579
|
-
*
|
|
3580
|
-
*
|
|
3581
|
-
*
|
|
3582
|
-
* villager.addEffect(EffectTypes.get('poison'), duration, { amplifier: 1 });
|
|
3316
|
+
* const villagerId = 'minecraft:villager_v2<minecraft:ageable_grow_up>';
|
|
3317
|
+
* const villagerLoc: mc.Vector3 = { x: 1, y: 2, z: 1 };
|
|
3318
|
+
* const villager = test.spawn(villagerId, villagerLoc);
|
|
3319
|
+
* const duration = 20;
|
|
3583
3320
|
*
|
|
3321
|
+
* villager.addEffect(EffectTypes.get('poison'), duration, { amplifier: 1 });
|
|
3584
3322
|
* ```
|
|
3585
3323
|
* @example quickFoxLazyDog.ts
|
|
3586
3324
|
* ```typescript
|
|
3587
|
-
*
|
|
3588
|
-
*
|
|
3589
|
-
*
|
|
3590
|
-
*
|
|
3591
|
-
*
|
|
3592
|
-
*
|
|
3593
|
-
*
|
|
3594
|
-
*
|
|
3595
|
-
*
|
|
3596
|
-
*
|
|
3597
|
-
*
|
|
3598
|
-
*
|
|
3599
|
-
*
|
|
3600
|
-
*
|
|
3601
|
-
*
|
|
3602
|
-
*
|
|
3603
|
-
*
|
|
3325
|
+
* const fox = overworld.spawnEntity('minecraft:fox', {
|
|
3326
|
+
* x: targetLocation.x + 1,
|
|
3327
|
+
* y: targetLocation.y + 2,
|
|
3328
|
+
* z: targetLocation.z + 3,
|
|
3329
|
+
* });
|
|
3330
|
+
* fox.addEffect(mc.MinecraftEffectTypes.Speed, 10, { amplifier: 20 });
|
|
3331
|
+
* log('Created a fox.');
|
|
3332
|
+
*
|
|
3333
|
+
* const wolf = overworld.spawnEntity('minecraft:wolf', {
|
|
3334
|
+
* x: targetLocation.x + 4,
|
|
3335
|
+
* y: targetLocation.y + 2,
|
|
3336
|
+
* z: targetLocation.z + 3,
|
|
3337
|
+
* });
|
|
3338
|
+
* wolf.addEffect(mc.MinecraftEffectTypes.Slowness, 10, { amplifier: 20 });
|
|
3339
|
+
* wolf.isSneaking = true;
|
|
3340
|
+
* log('Created a sneaking wolf.', 1);
|
|
3604
3341
|
* ```
|
|
3605
3342
|
*/
|
|
3606
|
-
addEffect(effectType: EffectType | string, duration: number, options?: EntityEffectOptions):
|
|
3343
|
+
addEffect(effectType: EffectType | string, duration: number, options?: EntityEffectOptions): void;
|
|
3607
3344
|
/**
|
|
3608
3345
|
* @beta
|
|
3609
3346
|
* @remarks
|
|
@@ -3757,13 +3494,15 @@ export class Entity {
|
|
|
3757
3494
|
* @beta
|
|
3758
3495
|
* @remarks
|
|
3759
3496
|
* Returns the effect for the specified EffectType on the
|
|
3760
|
-
* entity,
|
|
3497
|
+
* entity, undefined if the effect is not present, or throws an
|
|
3498
|
+
* error if the effect does not exist.
|
|
3761
3499
|
*
|
|
3762
3500
|
* @param effectType
|
|
3763
3501
|
* The effect identifier.
|
|
3764
3502
|
* @returns
|
|
3765
|
-
* Effect object for the specified effect,
|
|
3766
|
-
* effect is not present
|
|
3503
|
+
* Effect object for the specified effect, undefined if the
|
|
3504
|
+
* effect is not present, or throws an error if the effect does
|
|
3505
|
+
* not exist.
|
|
3767
3506
|
* @throws This function can throw errors.
|
|
3768
3507
|
*/
|
|
3769
3508
|
getEffect(effectType: EffectType | string): Effect | undefined;
|
|
@@ -3921,8 +3660,9 @@ export class Entity {
|
|
|
3921
3660
|
* @param effectType
|
|
3922
3661
|
* The effect identifier.
|
|
3923
3662
|
* @returns
|
|
3924
|
-
* Returns true if the effect has been removed
|
|
3925
|
-
* effect is not present
|
|
3663
|
+
* Returns true if the effect has been removed, false if the
|
|
3664
|
+
* effect is not present, or will throw an error if the effect
|
|
3665
|
+
* does not exist.
|
|
3926
3666
|
* @throws This function can throw errors.
|
|
3927
3667
|
*/
|
|
3928
3668
|
removeEffect(effectType: EffectType | string): boolean;
|
|
@@ -4380,6 +4120,10 @@ export class EntityComponent extends Component {
|
|
|
4380
4120
|
*
|
|
4381
4121
|
*/
|
|
4382
4122
|
readonly entity: Entity;
|
|
4123
|
+
/**
|
|
4124
|
+
* @beta
|
|
4125
|
+
*/
|
|
4126
|
+
isValid(): boolean;
|
|
4383
4127
|
}
|
|
4384
4128
|
|
|
4385
4129
|
/**
|
|
@@ -4603,6 +4347,43 @@ export class EntityHealableComponent extends EntityComponent {
|
|
|
4603
4347
|
getFeedItems(): FeedItem[];
|
|
4604
4348
|
}
|
|
4605
4349
|
|
|
4350
|
+
/**
|
|
4351
|
+
* @beta
|
|
4352
|
+
* Contains information related to an entity when its health
|
|
4353
|
+
* changes. Warning: don't change the health of an entity in
|
|
4354
|
+
* this event, or it will cause an infinite loop!
|
|
4355
|
+
*/
|
|
4356
|
+
export class EntityHealthChangedAfterEvent {
|
|
4357
|
+
protected constructor();
|
|
4358
|
+
/**
|
|
4359
|
+
* @remarks
|
|
4360
|
+
* Entity whose health changed.
|
|
4361
|
+
*
|
|
4362
|
+
*/
|
|
4363
|
+
readonly entity: Entity;
|
|
4364
|
+
/**
|
|
4365
|
+
* @remarks
|
|
4366
|
+
* New health value of the entity.
|
|
4367
|
+
*
|
|
4368
|
+
*/
|
|
4369
|
+
readonly newValue: number;
|
|
4370
|
+
/**
|
|
4371
|
+
* @remarks
|
|
4372
|
+
* Old health value of the entity.
|
|
4373
|
+
*
|
|
4374
|
+
*/
|
|
4375
|
+
readonly oldValue: number;
|
|
4376
|
+
}
|
|
4377
|
+
|
|
4378
|
+
/**
|
|
4379
|
+
* @beta
|
|
4380
|
+
* Manages callbacks that are connected to when the health of
|
|
4381
|
+
* an entity changes.
|
|
4382
|
+
*/
|
|
4383
|
+
export class EntityHealthChangedAfterEventSignal extends IEntityHealthChangedAfterEventSignal {
|
|
4384
|
+
protected constructor();
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4606
4387
|
/**
|
|
4607
4388
|
* @beta
|
|
4608
4389
|
* Defines the health properties of an entity.
|
|
@@ -6402,7 +6183,30 @@ export class IEntityDieAfterEventSignal {
|
|
|
6402
6183
|
*
|
|
6403
6184
|
* @throws This function can throw errors.
|
|
6404
6185
|
*/
|
|
6405
|
-
unsubscribe(callback: (arg: EntityDieAfterEvent) => void): void;
|
|
6186
|
+
unsubscribe(callback: (arg: EntityDieAfterEvent) => void): void;
|
|
6187
|
+
}
|
|
6188
|
+
|
|
6189
|
+
/**
|
|
6190
|
+
* @beta
|
|
6191
|
+
*/
|
|
6192
|
+
export class IEntityHealthChangedAfterEventSignal {
|
|
6193
|
+
protected constructor();
|
|
6194
|
+
/**
|
|
6195
|
+
* @remarks
|
|
6196
|
+
* This function can't be called in read-only mode.
|
|
6197
|
+
*
|
|
6198
|
+
*/
|
|
6199
|
+
subscribe(
|
|
6200
|
+
callback: (arg: EntityHealthChangedAfterEvent) => void,
|
|
6201
|
+
options?: EntityEventOptions,
|
|
6202
|
+
): (arg: EntityHealthChangedAfterEvent) => void;
|
|
6203
|
+
/**
|
|
6204
|
+
* @remarks
|
|
6205
|
+
* This function can't be called in read-only mode.
|
|
6206
|
+
*
|
|
6207
|
+
* @throws This function can throw errors.
|
|
6208
|
+
*/
|
|
6209
|
+
unsubscribe(callback: (arg: EntityHealthChangedAfterEvent) => void): void;
|
|
6406
6210
|
}
|
|
6407
6211
|
|
|
6408
6212
|
/**
|
|
@@ -6939,6 +6743,46 @@ export class IPlayerSpawnAfterEventSignal {
|
|
|
6939
6743
|
unsubscribe(callback: (arg: PlayerSpawnAfterEvent) => void): void;
|
|
6940
6744
|
}
|
|
6941
6745
|
|
|
6746
|
+
/**
|
|
6747
|
+
* @beta
|
|
6748
|
+
*/
|
|
6749
|
+
export class IPressurePlatePopAfterEventSignal {
|
|
6750
|
+
protected constructor();
|
|
6751
|
+
/**
|
|
6752
|
+
* @remarks
|
|
6753
|
+
* This function can't be called in read-only mode.
|
|
6754
|
+
*
|
|
6755
|
+
*/
|
|
6756
|
+
subscribe(callback: (arg: PressurePlatePopAfterEvent) => void): (arg: PressurePlatePopAfterEvent) => void;
|
|
6757
|
+
/**
|
|
6758
|
+
* @remarks
|
|
6759
|
+
* This function can't be called in read-only mode.
|
|
6760
|
+
*
|
|
6761
|
+
* @throws This function can throw errors.
|
|
6762
|
+
*/
|
|
6763
|
+
unsubscribe(callback: (arg: PressurePlatePopAfterEvent) => void): void;
|
|
6764
|
+
}
|
|
6765
|
+
|
|
6766
|
+
/**
|
|
6767
|
+
* @beta
|
|
6768
|
+
*/
|
|
6769
|
+
export class IPressurePlatePushAfterEventSignal {
|
|
6770
|
+
protected constructor();
|
|
6771
|
+
/**
|
|
6772
|
+
* @remarks
|
|
6773
|
+
* This function can't be called in read-only mode.
|
|
6774
|
+
*
|
|
6775
|
+
*/
|
|
6776
|
+
subscribe(callback: (arg: PressurePlatePushAfterEvent) => void): (arg: PressurePlatePushAfterEvent) => void;
|
|
6777
|
+
/**
|
|
6778
|
+
* @remarks
|
|
6779
|
+
* This function can't be called in read-only mode.
|
|
6780
|
+
*
|
|
6781
|
+
* @throws This function can throw errors.
|
|
6782
|
+
*/
|
|
6783
|
+
unsubscribe(callback: (arg: PressurePlatePushAfterEvent) => void): void;
|
|
6784
|
+
}
|
|
6785
|
+
|
|
6942
6786
|
/**
|
|
6943
6787
|
* @beta
|
|
6944
6788
|
* Provides an adaptable interface for callers to subscribe to
|
|
@@ -7009,6 +6853,26 @@ export class IServerMessageAfterEventSignal {
|
|
|
7009
6853
|
unsubscribe(callback: (arg: MessageReceiveAfterEvent) => void): void;
|
|
7010
6854
|
}
|
|
7011
6855
|
|
|
6856
|
+
/**
|
|
6857
|
+
* @beta
|
|
6858
|
+
*/
|
|
6859
|
+
export class ITargetBlockHitAfterEventSignal {
|
|
6860
|
+
protected constructor();
|
|
6861
|
+
/**
|
|
6862
|
+
* @remarks
|
|
6863
|
+
* This function can't be called in read-only mode.
|
|
6864
|
+
*
|
|
6865
|
+
*/
|
|
6866
|
+
subscribe(callback: (arg: TargetBlockHitAfterEvent) => void): (arg: TargetBlockHitAfterEvent) => void;
|
|
6867
|
+
/**
|
|
6868
|
+
* @remarks
|
|
6869
|
+
* This function can't be called in read-only mode.
|
|
6870
|
+
*
|
|
6871
|
+
* @throws This function can throw errors.
|
|
6872
|
+
*/
|
|
6873
|
+
unsubscribe(callback: (arg: TargetBlockHitAfterEvent) => void): void;
|
|
6874
|
+
}
|
|
6875
|
+
|
|
7012
6876
|
/**
|
|
7013
6877
|
* @beta
|
|
7014
6878
|
* Contains information related to a chargeable item completing
|
|
@@ -7052,6 +6916,10 @@ export class ItemCompleteUseAfterEventSignal extends IItemCompleteUseAfterEventS
|
|
|
7052
6916
|
*/
|
|
7053
6917
|
export class ItemComponent extends Component {
|
|
7054
6918
|
protected constructor();
|
|
6919
|
+
/**
|
|
6920
|
+
* @beta
|
|
6921
|
+
*/
|
|
6922
|
+
isValid(): boolean;
|
|
7055
6923
|
}
|
|
7056
6924
|
|
|
7057
6925
|
/**
|
|
@@ -7448,11 +7316,10 @@ export class ItemStack {
|
|
|
7448
7316
|
* stack, undefined is returned.
|
|
7449
7317
|
* @example durability.ts
|
|
7450
7318
|
* ```typescript
|
|
7451
|
-
*
|
|
7452
|
-
*
|
|
7453
|
-
*
|
|
7454
|
-
*
|
|
7455
|
-
*
|
|
7319
|
+
* // Get the maximum durability of a custom sword item
|
|
7320
|
+
* const itemStack = new ItemStack("custom:sword");
|
|
7321
|
+
* const durability = itemStack.getComponent("minecraft:durability") as ItemDurabilityComponent;
|
|
7322
|
+
* const maxDurability = durability.maxDurability;
|
|
7456
7323
|
* ```
|
|
7457
7324
|
*/
|
|
7458
7325
|
getComponent(componentId: string): ItemComponent | undefined;
|
|
@@ -7528,10 +7395,9 @@ export class ItemStack {
|
|
|
7528
7395
|
* Throws if any of the provided block identifiers are invalid.
|
|
7529
7396
|
* @example example.ts
|
|
7530
7397
|
* ```typescript
|
|
7531
|
-
*
|
|
7532
|
-
*
|
|
7533
|
-
*
|
|
7534
|
-
*
|
|
7398
|
+
* // Creates a diamond pickaxe that can destroy cobblestone and obsidian
|
|
7399
|
+
* const specialPickaxe = new ItemStack("minecraft:diamond_pickaxe");
|
|
7400
|
+
* specialPickaxe.setCanDestroy(["minecraft:cobblestone", "minecraft:obsidian"]);
|
|
7535
7401
|
* ```
|
|
7536
7402
|
*/
|
|
7537
7403
|
setCanDestroy(blockIdentifiers?: string[]): void;
|
|
@@ -7549,10 +7415,9 @@ export class ItemStack {
|
|
|
7549
7415
|
* Throws if any of the provided block identifiers are invalid.
|
|
7550
7416
|
* @example example.ts
|
|
7551
7417
|
* ```typescript
|
|
7552
|
-
*
|
|
7553
|
-
*
|
|
7554
|
-
*
|
|
7555
|
-
*
|
|
7418
|
+
* // Creates a gold block that can be placed on grass and dirt
|
|
7419
|
+
* const specialGoldBlock = new ItemStack("minecraft:gold_block");
|
|
7420
|
+
* specialPickaxe.setCanPlaceOn(["minecraft:grass", "minecraft:dirt"]);
|
|
7556
7421
|
* ```
|
|
7557
7422
|
*/
|
|
7558
7423
|
setCanPlaceOn(blockIdentifiers?: string[]): void;
|
|
@@ -7566,10 +7431,9 @@ export class ItemStack {
|
|
|
7566
7431
|
*
|
|
7567
7432
|
* @example multilineLore.ts
|
|
7568
7433
|
* ```typescript
|
|
7569
|
-
*
|
|
7570
|
-
*
|
|
7571
|
-
*
|
|
7572
|
-
*
|
|
7434
|
+
* // Set the lore of an item to multiple lines of text
|
|
7435
|
+
* const itemStack = new ItemStack("minecraft:diamond_sword");
|
|
7436
|
+
* itemStack.setLore(["Line 1", "Line 2", "Line 3"]);
|
|
7573
7437
|
* ```
|
|
7574
7438
|
*/
|
|
7575
7439
|
setLore(loreList?: string[]): void;
|
|
@@ -7932,6 +7796,26 @@ export class ItemUseOnBeforeEventSignal extends IItemUseOnBeforeEventSignal {
|
|
|
7932
7796
|
protected constructor();
|
|
7933
7797
|
}
|
|
7934
7798
|
|
|
7799
|
+
/**
|
|
7800
|
+
* @beta
|
|
7801
|
+
*/
|
|
7802
|
+
export class ITripWireTripAfterEventSignal {
|
|
7803
|
+
protected constructor();
|
|
7804
|
+
/**
|
|
7805
|
+
* @remarks
|
|
7806
|
+
* This function can't be called in read-only mode.
|
|
7807
|
+
*
|
|
7808
|
+
*/
|
|
7809
|
+
subscribe(callback: (arg: TripWireTripAfterEvent) => void): (arg: TripWireTripAfterEvent) => void;
|
|
7810
|
+
/**
|
|
7811
|
+
* @remarks
|
|
7812
|
+
* This function can't be called in read-only mode.
|
|
7813
|
+
*
|
|
7814
|
+
* @throws This function can throw errors.
|
|
7815
|
+
*/
|
|
7816
|
+
unsubscribe(callback: (arg: TripWireTripAfterEvent) => void): void;
|
|
7817
|
+
}
|
|
7818
|
+
|
|
7935
7819
|
/**
|
|
7936
7820
|
* @beta
|
|
7937
7821
|
* An event that fires before the watchdog is about to
|
|
@@ -8039,7 +7923,6 @@ export class MessageReceiveAfterEvent {
|
|
|
8039
7923
|
readonly id: string;
|
|
8040
7924
|
readonly message: string;
|
|
8041
7925
|
readonly player: Player;
|
|
8042
|
-
readonly sourceType: MessageSourceType;
|
|
8043
7926
|
}
|
|
8044
7927
|
|
|
8045
7928
|
/**
|
|
@@ -8327,6 +8210,7 @@ export class MinecraftBlockTypes {
|
|
|
8327
8210
|
*/
|
|
8328
8211
|
static readonly blackCandleCake: BlockType;
|
|
8329
8212
|
static readonly blackCarpet: BlockType;
|
|
8213
|
+
static readonly blackConcrete: BlockType;
|
|
8330
8214
|
/**
|
|
8331
8215
|
* @remarks
|
|
8332
8216
|
* Represents a black glazed terracotta block within Minecraft.
|
|
@@ -8384,6 +8268,7 @@ export class MinecraftBlockTypes {
|
|
|
8384
8268
|
*/
|
|
8385
8269
|
static readonly blueCandleCake: BlockType;
|
|
8386
8270
|
static readonly blueCarpet: BlockType;
|
|
8271
|
+
static readonly blueConcrete: BlockType;
|
|
8387
8272
|
/**
|
|
8388
8273
|
* @remarks
|
|
8389
8274
|
* Represents a blue glazed terracotta block within Minecraft.
|
|
@@ -8448,6 +8333,7 @@ export class MinecraftBlockTypes {
|
|
|
8448
8333
|
*/
|
|
8449
8334
|
static readonly brownCandleCake: BlockType;
|
|
8450
8335
|
static readonly brownCarpet: BlockType;
|
|
8336
|
+
static readonly brownConcrete: BlockType;
|
|
8451
8337
|
/**
|
|
8452
8338
|
* @remarks
|
|
8453
8339
|
* Represents a brown glazed terracotta block within Minecraft.
|
|
@@ -8745,12 +8631,6 @@ export class MinecraftBlockTypes {
|
|
|
8745
8631
|
*
|
|
8746
8632
|
*/
|
|
8747
8633
|
static readonly composter: BlockType;
|
|
8748
|
-
/**
|
|
8749
|
-
* @remarks
|
|
8750
|
-
* Represents a block of concrete powder within Minecraft.
|
|
8751
|
-
*
|
|
8752
|
-
*/
|
|
8753
|
-
static readonly concrete: BlockType;
|
|
8754
8634
|
/**
|
|
8755
8635
|
* @remarks
|
|
8756
8636
|
* Represents a block of concrete powder within Minecraft.
|
|
@@ -8989,6 +8869,7 @@ export class MinecraftBlockTypes {
|
|
|
8989
8869
|
*/
|
|
8990
8870
|
static readonly cyanCandleCake: BlockType;
|
|
8991
8871
|
static readonly cyanCarpet: BlockType;
|
|
8872
|
+
static readonly cyanConcrete: BlockType;
|
|
8992
8873
|
/**
|
|
8993
8874
|
* @remarks
|
|
8994
8875
|
* Represents a block of cyan-colored glazed terracotta within
|
|
@@ -10423,6 +10304,7 @@ export class MinecraftBlockTypes {
|
|
|
10423
10304
|
*/
|
|
10424
10305
|
static readonly grayCandleCake: BlockType;
|
|
10425
10306
|
static readonly grayCarpet: BlockType;
|
|
10307
|
+
static readonly grayConcrete: BlockType;
|
|
10426
10308
|
/**
|
|
10427
10309
|
* @remarks
|
|
10428
10310
|
* Represents a gray-colored block of glazed terracotta within
|
|
@@ -10445,6 +10327,7 @@ export class MinecraftBlockTypes {
|
|
|
10445
10327
|
*/
|
|
10446
10328
|
static readonly greenCandleCake: BlockType;
|
|
10447
10329
|
static readonly greenCarpet: BlockType;
|
|
10330
|
+
static readonly greenConcrete: BlockType;
|
|
10448
10331
|
/**
|
|
10449
10332
|
* @remarks
|
|
10450
10333
|
* Represents a green block of glazed terracotta within
|
|
@@ -10737,6 +10620,7 @@ export class MinecraftBlockTypes {
|
|
|
10737
10620
|
*/
|
|
10738
10621
|
static readonly lightBlueCandleCake: BlockType;
|
|
10739
10622
|
static readonly lightBlueCarpet: BlockType;
|
|
10623
|
+
static readonly lightBlueConcrete: BlockType;
|
|
10740
10624
|
/**
|
|
10741
10625
|
* @remarks
|
|
10742
10626
|
* Represents a light blue block of glazed terracotta within
|
|
@@ -10759,6 +10643,7 @@ export class MinecraftBlockTypes {
|
|
|
10759
10643
|
*/
|
|
10760
10644
|
static readonly lightGrayCandleCake: BlockType;
|
|
10761
10645
|
static readonly lightGrayCarpet: BlockType;
|
|
10646
|
+
static readonly lightGrayConcrete: BlockType;
|
|
10762
10647
|
static readonly lightGrayShulkerBox: BlockType;
|
|
10763
10648
|
static readonly lightGrayWool: BlockType;
|
|
10764
10649
|
/**
|
|
@@ -10786,6 +10671,7 @@ export class MinecraftBlockTypes {
|
|
|
10786
10671
|
*/
|
|
10787
10672
|
static readonly limeCandleCake: BlockType;
|
|
10788
10673
|
static readonly limeCarpet: BlockType;
|
|
10674
|
+
static readonly limeConcrete: BlockType;
|
|
10789
10675
|
/**
|
|
10790
10676
|
* @remarks
|
|
10791
10677
|
* Represents a lime-colored block of glazed terracotta within
|
|
@@ -10862,6 +10748,7 @@ export class MinecraftBlockTypes {
|
|
|
10862
10748
|
*/
|
|
10863
10749
|
static readonly magentaCandleCake: BlockType;
|
|
10864
10750
|
static readonly magentaCarpet: BlockType;
|
|
10751
|
+
static readonly magentaConcrete: BlockType;
|
|
10865
10752
|
/**
|
|
10866
10753
|
* @remarks
|
|
10867
10754
|
* Represents a block of magenta-colored glazed terracotta
|
|
@@ -11080,6 +10967,7 @@ export class MinecraftBlockTypes {
|
|
|
11080
10967
|
*/
|
|
11081
10968
|
static readonly orangeCandleCake: BlockType;
|
|
11082
10969
|
static readonly orangeCarpet: BlockType;
|
|
10970
|
+
static readonly orangeConcrete: BlockType;
|
|
11083
10971
|
/**
|
|
11084
10972
|
* @remarks
|
|
11085
10973
|
* Represents a block of orange-colored glazed terracotta
|
|
@@ -11142,6 +11030,7 @@ export class MinecraftBlockTypes {
|
|
|
11142
11030
|
*/
|
|
11143
11031
|
static readonly pinkCandleCake: BlockType;
|
|
11144
11032
|
static readonly pinkCarpet: BlockType;
|
|
11033
|
+
static readonly pinkConcrete: BlockType;
|
|
11145
11034
|
/**
|
|
11146
11035
|
* @remarks
|
|
11147
11036
|
* Represents a pink-colored block of glazed terracotta within
|
|
@@ -11390,6 +11279,7 @@ export class MinecraftBlockTypes {
|
|
|
11390
11279
|
*/
|
|
11391
11280
|
static readonly purpleCandleCake: BlockType;
|
|
11392
11281
|
static readonly purpleCarpet: BlockType;
|
|
11282
|
+
static readonly purpleConcrete: BlockType;
|
|
11393
11283
|
/**
|
|
11394
11284
|
* @remarks
|
|
11395
11285
|
* Represents a purple-colored block of glazed terracotta
|
|
@@ -11473,6 +11363,7 @@ export class MinecraftBlockTypes {
|
|
|
11473
11363
|
*/
|
|
11474
11364
|
static readonly redCandleCake: BlockType;
|
|
11475
11365
|
static readonly redCarpet: BlockType;
|
|
11366
|
+
static readonly redConcrete: BlockType;
|
|
11476
11367
|
/**
|
|
11477
11368
|
* @remarks
|
|
11478
11369
|
* Represents a red flower within Minecraft.
|
|
@@ -12478,6 +12369,7 @@ export class MinecraftBlockTypes {
|
|
|
12478
12369
|
*/
|
|
12479
12370
|
static readonly whiteCandleCake: BlockType;
|
|
12480
12371
|
static readonly whiteCarpet: BlockType;
|
|
12372
|
+
static readonly whiteConcrete: BlockType;
|
|
12481
12373
|
/**
|
|
12482
12374
|
* @remarks
|
|
12483
12375
|
* Represents a block of white glazed terracotta within
|
|
@@ -12536,6 +12428,7 @@ export class MinecraftBlockTypes {
|
|
|
12536
12428
|
*/
|
|
12537
12429
|
static readonly yellowCandleCake: BlockType;
|
|
12538
12430
|
static readonly yellowCarpet: BlockType;
|
|
12431
|
+
static readonly yellowConcrete: BlockType;
|
|
12539
12432
|
/**
|
|
12540
12433
|
* @remarks
|
|
12541
12434
|
* Represents a yellow flower within Minecraft.
|
|
@@ -12607,7 +12500,6 @@ export class MinecraftDimensionTypes {
|
|
|
12607
12500
|
|
|
12608
12501
|
/**
|
|
12609
12502
|
* @beta
|
|
12610
|
-
* Returns available installed effect types within Minecraft.
|
|
12611
12503
|
*/
|
|
12612
12504
|
export class MinecraftEffectTypes {
|
|
12613
12505
|
protected constructor();
|
|
@@ -13071,6 +12963,7 @@ export class MinecraftItemTypes {
|
|
|
13071
12963
|
*/
|
|
13072
12964
|
static readonly blackCandle: ItemType;
|
|
13073
12965
|
static readonly blackCarpet: ItemType;
|
|
12966
|
+
static readonly blackConcrete: ItemType;
|
|
13074
12967
|
static readonly blackDye: ItemType;
|
|
13075
12968
|
/**
|
|
13076
12969
|
* @remarks
|
|
@@ -13127,6 +13020,7 @@ export class MinecraftItemTypes {
|
|
|
13127
13020
|
*/
|
|
13128
13021
|
static readonly blueCandle: ItemType;
|
|
13129
13022
|
static readonly blueCarpet: ItemType;
|
|
13023
|
+
static readonly blueConcrete: ItemType;
|
|
13130
13024
|
static readonly blueDye: ItemType;
|
|
13131
13025
|
/**
|
|
13132
13026
|
* @remarks
|
|
@@ -13204,6 +13098,7 @@ export class MinecraftItemTypes {
|
|
|
13204
13098
|
*/
|
|
13205
13099
|
static readonly brownCandle: ItemType;
|
|
13206
13100
|
static readonly brownCarpet: ItemType;
|
|
13101
|
+
static readonly brownConcrete: ItemType;
|
|
13207
13102
|
static readonly brownDye: ItemType;
|
|
13208
13103
|
/**
|
|
13209
13104
|
* @remarks
|
|
@@ -13711,6 +13606,7 @@ export class MinecraftItemTypes {
|
|
|
13711
13606
|
*/
|
|
13712
13607
|
static readonly cyanCandle: ItemType;
|
|
13713
13608
|
static readonly cyanCarpet: ItemType;
|
|
13609
|
+
static readonly cyanConcrete: ItemType;
|
|
13714
13610
|
static readonly cyanDye: ItemType;
|
|
13715
13611
|
/**
|
|
13716
13612
|
* @remarks
|
|
@@ -14341,6 +14237,7 @@ export class MinecraftItemTypes {
|
|
|
14341
14237
|
*/
|
|
14342
14238
|
static readonly grayCandle: ItemType;
|
|
14343
14239
|
static readonly grayCarpet: ItemType;
|
|
14240
|
+
static readonly grayConcrete: ItemType;
|
|
14344
14241
|
static readonly grayDye: ItemType;
|
|
14345
14242
|
/**
|
|
14346
14243
|
* @remarks
|
|
@@ -14359,6 +14256,7 @@ export class MinecraftItemTypes {
|
|
|
14359
14256
|
*/
|
|
14360
14257
|
static readonly greenCandle: ItemType;
|
|
14361
14258
|
static readonly greenCarpet: ItemType;
|
|
14259
|
+
static readonly greenConcrete: ItemType;
|
|
14362
14260
|
static readonly greenDye: ItemType;
|
|
14363
14261
|
/**
|
|
14364
14262
|
* @remarks
|
|
@@ -14658,6 +14556,7 @@ export class MinecraftItemTypes {
|
|
|
14658
14556
|
*/
|
|
14659
14557
|
static readonly lightBlueCandle: ItemType;
|
|
14660
14558
|
static readonly lightBlueCarpet: ItemType;
|
|
14559
|
+
static readonly lightBlueConcrete: ItemType;
|
|
14661
14560
|
static readonly lightBlueDye: ItemType;
|
|
14662
14561
|
/**
|
|
14663
14562
|
* @remarks
|
|
@@ -14676,6 +14575,7 @@ export class MinecraftItemTypes {
|
|
|
14676
14575
|
*/
|
|
14677
14576
|
static readonly lightGrayCandle: ItemType;
|
|
14678
14577
|
static readonly lightGrayCarpet: ItemType;
|
|
14578
|
+
static readonly lightGrayConcrete: ItemType;
|
|
14679
14579
|
static readonly lightGrayDye: ItemType;
|
|
14680
14580
|
static readonly lightGrayShulkerBox: ItemType;
|
|
14681
14581
|
static readonly lightGrayWool: ItemType;
|
|
@@ -14701,6 +14601,7 @@ export class MinecraftItemTypes {
|
|
|
14701
14601
|
*/
|
|
14702
14602
|
static readonly limeCandle: ItemType;
|
|
14703
14603
|
static readonly limeCarpet: ItemType;
|
|
14604
|
+
static readonly limeConcrete: ItemType;
|
|
14704
14605
|
static readonly limeDye: ItemType;
|
|
14705
14606
|
/**
|
|
14706
14607
|
* @remarks
|
|
@@ -14755,6 +14656,7 @@ export class MinecraftItemTypes {
|
|
|
14755
14656
|
*/
|
|
14756
14657
|
static readonly magentaCandle: ItemType;
|
|
14757
14658
|
static readonly magentaCarpet: ItemType;
|
|
14659
|
+
static readonly magentaConcrete: ItemType;
|
|
14758
14660
|
static readonly magentaDye: ItemType;
|
|
14759
14661
|
/**
|
|
14760
14662
|
* @remarks
|
|
@@ -15028,6 +14930,7 @@ export class MinecraftItemTypes {
|
|
|
15028
14930
|
*/
|
|
15029
14931
|
static readonly orangeCandle: ItemType;
|
|
15030
14932
|
static readonly orangeCarpet: ItemType;
|
|
14933
|
+
static readonly orangeConcrete: ItemType;
|
|
15031
14934
|
static readonly orangeDye: ItemType;
|
|
15032
14935
|
/**
|
|
15033
14936
|
* @remarks
|
|
@@ -15094,6 +14997,7 @@ export class MinecraftItemTypes {
|
|
|
15094
14997
|
*/
|
|
15095
14998
|
static readonly pinkCandle: ItemType;
|
|
15096
14999
|
static readonly pinkCarpet: ItemType;
|
|
15000
|
+
static readonly pinkConcrete: ItemType;
|
|
15097
15001
|
static readonly pinkDye: ItemType;
|
|
15098
15002
|
/**
|
|
15099
15003
|
* @remarks
|
|
@@ -15310,6 +15214,7 @@ export class MinecraftItemTypes {
|
|
|
15310
15214
|
*/
|
|
15311
15215
|
static readonly purpleCandle: ItemType;
|
|
15312
15216
|
static readonly purpleCarpet: ItemType;
|
|
15217
|
+
static readonly purpleConcrete: ItemType;
|
|
15313
15218
|
static readonly purpleDye: ItemType;
|
|
15314
15219
|
/**
|
|
15315
15220
|
* @remarks
|
|
@@ -15410,6 +15315,7 @@ export class MinecraftItemTypes {
|
|
|
15410
15315
|
*/
|
|
15411
15316
|
static readonly redCandle: ItemType;
|
|
15412
15317
|
static readonly redCarpet: ItemType;
|
|
15318
|
+
static readonly redConcrete: ItemType;
|
|
15413
15319
|
static readonly redDye: ItemType;
|
|
15414
15320
|
/**
|
|
15415
15321
|
* @remarks
|
|
@@ -16393,6 +16299,7 @@ export class MinecraftItemTypes {
|
|
|
16393
16299
|
*/
|
|
16394
16300
|
static readonly whiteCandle: ItemType;
|
|
16395
16301
|
static readonly whiteCarpet: ItemType;
|
|
16302
|
+
static readonly whiteConcrete: ItemType;
|
|
16396
16303
|
static readonly whiteDye: ItemType;
|
|
16397
16304
|
/**
|
|
16398
16305
|
* @remarks
|
|
@@ -16470,6 +16377,7 @@ export class MinecraftItemTypes {
|
|
|
16470
16377
|
*/
|
|
16471
16378
|
static readonly yellowCandle: ItemType;
|
|
16472
16379
|
static readonly yellowCarpet: ItemType;
|
|
16380
|
+
static readonly yellowConcrete: ItemType;
|
|
16473
16381
|
static readonly yellowDye: ItemType;
|
|
16474
16382
|
/**
|
|
16475
16383
|
* @remarks
|
|
@@ -16855,33 +16763,29 @@ export class Player extends Entity {
|
|
|
16855
16763
|
* is provided to `score`.
|
|
16856
16764
|
* @example nestedTranslation.ts
|
|
16857
16765
|
* ```typescript
|
|
16858
|
-
*
|
|
16859
|
-
*
|
|
16860
|
-
*
|
|
16861
|
-
*
|
|
16862
|
-
*
|
|
16863
|
-
*
|
|
16864
|
-
*
|
|
16766
|
+
* // Displays "Apple or Coal"
|
|
16767
|
+
* let rawMessage = {
|
|
16768
|
+
* translate: "accessibility.list.or.two",
|
|
16769
|
+
* with: { rawtext: [{ translate: "item.apple.name" }, { translate: "item.coal.name" }] },
|
|
16770
|
+
* };
|
|
16771
|
+
* player.sendMessage(rawMessage);
|
|
16865
16772
|
* ```
|
|
16866
16773
|
* @example scoreWildcard.ts
|
|
16867
16774
|
* ```typescript
|
|
16868
|
-
*
|
|
16869
|
-
*
|
|
16870
|
-
*
|
|
16871
|
-
*
|
|
16775
|
+
* // Displays the player's score for objective "obj". Each player will see their own score.
|
|
16776
|
+
* const rawMessage = { score: { name: "*", objective: "obj" } };
|
|
16777
|
+
* world.sendMessage(rawMessage);
|
|
16872
16778
|
* ```
|
|
16873
16779
|
* @example simpleString.ts
|
|
16874
16780
|
* ```typescript
|
|
16875
|
-
*
|
|
16876
|
-
*
|
|
16877
|
-
*
|
|
16781
|
+
* // Displays "Hello, world!"
|
|
16782
|
+
* world.sendMessage("Hello, world!");
|
|
16878
16783
|
* ```
|
|
16879
16784
|
* @example translation.ts
|
|
16880
16785
|
* ```typescript
|
|
16881
|
-
*
|
|
16882
|
-
*
|
|
16883
|
-
*
|
|
16884
|
-
*
|
|
16786
|
+
* // Displays "First or Second"
|
|
16787
|
+
* const rawMessage = { translate: "accessibility.list.or.two", with: ["First", "Second"] };
|
|
16788
|
+
* player.sendMessage(rawMessage);
|
|
16885
16789
|
* ```
|
|
16886
16790
|
*/
|
|
16887
16791
|
sendMessage(message: (RawMessage | string)[] | RawMessage | string): void;
|
|
@@ -17055,6 +16959,76 @@ export class PlayerSpawnAfterEventSignal extends IPlayerSpawnAfterEventSignal {
|
|
|
17055
16959
|
protected constructor();
|
|
17056
16960
|
}
|
|
17057
16961
|
|
|
16962
|
+
/**
|
|
16963
|
+
* @beta
|
|
16964
|
+
* Contains information related to changes to a pressure plate
|
|
16965
|
+
* pop.
|
|
16966
|
+
*/
|
|
16967
|
+
export class PressurePlatePopAfterEvent extends BlockEvent {
|
|
16968
|
+
protected constructor();
|
|
16969
|
+
/**
|
|
16970
|
+
* @remarks
|
|
16971
|
+
* The redstone power of the pressure plate before it was
|
|
16972
|
+
* popped.
|
|
16973
|
+
*
|
|
16974
|
+
*/
|
|
16975
|
+
readonly previousRedstonePower: number;
|
|
16976
|
+
/**
|
|
16977
|
+
* @remarks
|
|
16978
|
+
* The redstone power of the pressure plate at the time of the
|
|
16979
|
+
* pop.
|
|
16980
|
+
*
|
|
16981
|
+
*/
|
|
16982
|
+
readonly redstonePower: number;
|
|
16983
|
+
}
|
|
16984
|
+
|
|
16985
|
+
/**
|
|
16986
|
+
* @beta
|
|
16987
|
+
* Manages callbacks that are connected to when a pressure
|
|
16988
|
+
* plate is popped.
|
|
16989
|
+
*/
|
|
16990
|
+
export class PressurePlatePopAfterEventSignal extends IPressurePlatePopAfterEventSignal {
|
|
16991
|
+
protected constructor();
|
|
16992
|
+
}
|
|
16993
|
+
|
|
16994
|
+
/**
|
|
16995
|
+
* @beta
|
|
16996
|
+
* Contains information related to changes to a pressure plate
|
|
16997
|
+
* push.
|
|
16998
|
+
*/
|
|
16999
|
+
export class PressurePlatePushAfterEvent extends BlockEvent {
|
|
17000
|
+
protected constructor();
|
|
17001
|
+
/**
|
|
17002
|
+
* @remarks
|
|
17003
|
+
* The redstone power of the pressure plate before it was
|
|
17004
|
+
* pushed.
|
|
17005
|
+
*
|
|
17006
|
+
*/
|
|
17007
|
+
readonly previousRedstonePower: number;
|
|
17008
|
+
/**
|
|
17009
|
+
* @remarks
|
|
17010
|
+
* The redstone power of the pressure plate at the time of the
|
|
17011
|
+
* push.
|
|
17012
|
+
*
|
|
17013
|
+
*/
|
|
17014
|
+
readonly redstonePower: number;
|
|
17015
|
+
/**
|
|
17016
|
+
* @remarks
|
|
17017
|
+
* Source that triggered the pressure plate push.
|
|
17018
|
+
*
|
|
17019
|
+
*/
|
|
17020
|
+
readonly source: Entity;
|
|
17021
|
+
}
|
|
17022
|
+
|
|
17023
|
+
/**
|
|
17024
|
+
* @beta
|
|
17025
|
+
* Manages callbacks that are connected to when a pressure
|
|
17026
|
+
* plate is pushed.
|
|
17027
|
+
*/
|
|
17028
|
+
export class PressurePlatePushAfterEventSignal extends IPressurePlatePushAfterEventSignal {
|
|
17029
|
+
protected constructor();
|
|
17030
|
+
}
|
|
17031
|
+
|
|
17058
17032
|
/**
|
|
17059
17033
|
* @beta
|
|
17060
17034
|
* Contains information related to a projectile hitting an
|
|
@@ -17302,6 +17276,7 @@ export class ScoreboardIdentity {
|
|
|
17302
17276
|
* @throws This function can throw errors.
|
|
17303
17277
|
*/
|
|
17304
17278
|
getScore(objective: ScoreboardObjective): number;
|
|
17279
|
+
isValid(): boolean;
|
|
17305
17280
|
/**
|
|
17306
17281
|
* @remarks
|
|
17307
17282
|
* Removes this participant from an objective.
|
|
@@ -17374,6 +17349,7 @@ export class ScoreboardObjective {
|
|
|
17374
17349
|
* @throws This function can throw errors.
|
|
17375
17350
|
*/
|
|
17376
17351
|
getScores(): ScoreboardScoreInfo[];
|
|
17352
|
+
isValid(): boolean;
|
|
17377
17353
|
/**
|
|
17378
17354
|
* @remarks
|
|
17379
17355
|
* Removes a participant from this scoreboard objective.
|
|
@@ -17429,15 +17405,7 @@ export class ScoreboardScoreInfo {
|
|
|
17429
17405
|
*/
|
|
17430
17406
|
export class ScreenDisplay {
|
|
17431
17407
|
protected constructor();
|
|
17432
|
-
|
|
17433
|
-
* @remarks
|
|
17434
|
-
* Clears the title and subtitle, if currently displayed.
|
|
17435
|
-
*
|
|
17436
|
-
* This function can't be called in read-only mode.
|
|
17437
|
-
*
|
|
17438
|
-
* @throws This function can throw errors.
|
|
17439
|
-
*/
|
|
17440
|
-
clearTitle(): void;
|
|
17408
|
+
isValid(): boolean;
|
|
17441
17409
|
/**
|
|
17442
17410
|
* @remarks
|
|
17443
17411
|
* Set the action bar text - a piece of text that displays
|
|
@@ -17447,18 +17415,19 @@ export class ScreenDisplay {
|
|
|
17447
17415
|
*
|
|
17448
17416
|
* @throws This function can throw errors.
|
|
17449
17417
|
*/
|
|
17450
|
-
setActionBar(text: string): void;
|
|
17418
|
+
setActionBar(text: (RawMessage | string)[] | RawMessage | string): void;
|
|
17451
17419
|
/**
|
|
17452
17420
|
* @remarks
|
|
17453
17421
|
* Will cause a title to show up on the player's on screen
|
|
17454
|
-
* display.
|
|
17455
|
-
*
|
|
17422
|
+
* display. Will clear the title if set to empty string. You
|
|
17423
|
+
* can optionally specify an additional subtitle as well as
|
|
17424
|
+
* fade in, stay and fade out times.
|
|
17456
17425
|
*
|
|
17457
17426
|
* This function can't be called in read-only mode.
|
|
17458
17427
|
*
|
|
17459
17428
|
* @throws This function can throw errors.
|
|
17460
17429
|
*/
|
|
17461
|
-
setTitle(title: string, options?: TitleDisplayOptions): void;
|
|
17430
|
+
setTitle(title: (RawMessage | string)[] | RawMessage | string, options?: TitleDisplayOptions): void;
|
|
17462
17431
|
/**
|
|
17463
17432
|
* @remarks
|
|
17464
17433
|
* Updates the subtitle if the subtitle was previously
|
|
@@ -17468,7 +17437,7 @@ export class ScreenDisplay {
|
|
|
17468
17437
|
*
|
|
17469
17438
|
* @throws This function can throw errors.
|
|
17470
17439
|
*/
|
|
17471
|
-
updateSubtitle(subtitle: string): void;
|
|
17440
|
+
updateSubtitle(subtitle: (RawMessage | string)[] | RawMessage | string): void;
|
|
17472
17441
|
}
|
|
17473
17442
|
|
|
17474
17443
|
/**
|
|
@@ -17517,7 +17486,7 @@ export class ScriptEventCommandMessageAfterEvent {
|
|
|
17517
17486
|
* Returns the type of source that fired this command.
|
|
17518
17487
|
*
|
|
17519
17488
|
*/
|
|
17520
|
-
readonly sourceType:
|
|
17489
|
+
readonly sourceType: ScriptEventSource;
|
|
17521
17490
|
}
|
|
17522
17491
|
|
|
17523
17492
|
/**
|
|
@@ -17582,19 +17551,19 @@ export class System {
|
|
|
17582
17551
|
protected constructor();
|
|
17583
17552
|
/**
|
|
17584
17553
|
* @beta
|
|
17585
|
-
* @remarks
|
|
17586
|
-
* Represents the current world tick of the server.
|
|
17587
|
-
*
|
|
17588
17554
|
*/
|
|
17589
|
-
readonly
|
|
17555
|
+
readonly afterEvents: SystemAfterEvents;
|
|
17556
|
+
/**
|
|
17557
|
+
* @beta
|
|
17558
|
+
*/
|
|
17559
|
+
readonly beforeEvents: SystemBeforeEvents;
|
|
17590
17560
|
/**
|
|
17591
17561
|
* @beta
|
|
17592
17562
|
* @remarks
|
|
17593
|
-
*
|
|
17594
|
-
* lifecycle of items in the Minecraft system.
|
|
17563
|
+
* Represents the current world tick of the server.
|
|
17595
17564
|
*
|
|
17596
17565
|
*/
|
|
17597
|
-
readonly
|
|
17566
|
+
readonly currentTick: number;
|
|
17598
17567
|
/**
|
|
17599
17568
|
* @beta
|
|
17600
17569
|
* @remarks
|
|
@@ -17651,29 +17620,60 @@ export class System {
|
|
|
17651
17620
|
|
|
17652
17621
|
/**
|
|
17653
17622
|
* @beta
|
|
17654
|
-
* Contains a set of events that are available across the scope
|
|
17655
|
-
* of the Minecraft add-on system.
|
|
17656
17623
|
*/
|
|
17657
|
-
export class
|
|
17624
|
+
export class SystemAfterEvents {
|
|
17625
|
+
protected constructor();
|
|
17626
|
+
readonly scriptEventReceive: ScriptEventCommandMessageAfterEventSignal;
|
|
17627
|
+
}
|
|
17628
|
+
|
|
17629
|
+
/**
|
|
17630
|
+
* @beta
|
|
17631
|
+
*/
|
|
17632
|
+
export class SystemBeforeEvents {
|
|
17633
|
+
protected constructor();
|
|
17634
|
+
readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
|
|
17635
|
+
}
|
|
17636
|
+
|
|
17637
|
+
/**
|
|
17638
|
+
* @beta
|
|
17639
|
+
* Contains information related to changes to a target block
|
|
17640
|
+
* hit.
|
|
17641
|
+
*/
|
|
17642
|
+
export class TargetBlockHitAfterEvent extends BlockEvent {
|
|
17658
17643
|
protected constructor();
|
|
17659
17644
|
/**
|
|
17660
17645
|
* @remarks
|
|
17661
|
-
*
|
|
17662
|
-
* terminates scripting execution due to exceeding a
|
|
17663
|
-
* performance boundary. Depending on the configuration of the
|
|
17664
|
-
* runtime environment, this event can be canceled. For
|
|
17665
|
-
* example, on certain dedicated server environments the
|
|
17666
|
-
* ability to override termination events may be disabled.
|
|
17646
|
+
* The position where the source hit the block.
|
|
17667
17647
|
*
|
|
17668
17648
|
*/
|
|
17669
|
-
readonly
|
|
17649
|
+
readonly hitVector: Vector3;
|
|
17670
17650
|
/**
|
|
17671
17651
|
* @remarks
|
|
17672
|
-
*
|
|
17673
|
-
* player, NPC, or block.
|
|
17652
|
+
* The redstone power before the block is hit.
|
|
17674
17653
|
*
|
|
17675
17654
|
*/
|
|
17676
|
-
readonly
|
|
17655
|
+
readonly previousRedstonePower: number;
|
|
17656
|
+
/**
|
|
17657
|
+
* @remarks
|
|
17658
|
+
* The redstone power at the time the block is hit.
|
|
17659
|
+
*
|
|
17660
|
+
*/
|
|
17661
|
+
readonly redstonePower: number;
|
|
17662
|
+
/**
|
|
17663
|
+
* @remarks
|
|
17664
|
+
* Optional source that hit the target block.
|
|
17665
|
+
*
|
|
17666
|
+
*/
|
|
17667
|
+
readonly source: Entity;
|
|
17668
|
+
}
|
|
17669
|
+
|
|
17670
|
+
/**
|
|
17671
|
+
* @beta
|
|
17672
|
+
* Manages callbacks that are connected to when a target block
|
|
17673
|
+
* is hit.
|
|
17674
|
+
*/
|
|
17675
|
+
export class TargetBlockHitAfterEventSignal extends ITargetBlockHitAfterEventSignal {
|
|
17676
|
+
protected constructor();
|
|
17677
17677
|
}
|
|
17678
17678
|
|
|
17679
17679
|
/**
|
|
@@ -17695,6 +17695,35 @@ export class Trigger {
|
|
|
17695
17695
|
constructor(eventName: string);
|
|
17696
17696
|
}
|
|
17697
17697
|
|
|
17698
|
+
/**
|
|
17699
|
+
* @beta
|
|
17700
|
+
* Contains information related to changes to a trip wire trip.
|
|
17701
|
+
*/
|
|
17702
|
+
export class TripWireTripAfterEvent extends BlockEvent {
|
|
17703
|
+
protected constructor();
|
|
17704
|
+
/**
|
|
17705
|
+
* @remarks
|
|
17706
|
+
* Whether or not the block has redstone power.
|
|
17707
|
+
*
|
|
17708
|
+
*/
|
|
17709
|
+
readonly isPowered: boolean;
|
|
17710
|
+
/**
|
|
17711
|
+
* @remarks
|
|
17712
|
+
* The sources that triggered the trip wire to trip.
|
|
17713
|
+
*
|
|
17714
|
+
*/
|
|
17715
|
+
readonly sources: Entity[];
|
|
17716
|
+
}
|
|
17717
|
+
|
|
17718
|
+
/**
|
|
17719
|
+
* @beta
|
|
17720
|
+
* Manages callbacks that are connected to when a trip wire is
|
|
17721
|
+
* tripped.
|
|
17722
|
+
*/
|
|
17723
|
+
export class TripWireTripAfterEventSignal extends ITripWireTripAfterEventSignal {
|
|
17724
|
+
protected constructor();
|
|
17725
|
+
}
|
|
17726
|
+
|
|
17698
17727
|
/**
|
|
17699
17728
|
* @beta
|
|
17700
17729
|
* Contains a description of a vector.
|
|
@@ -17828,6 +17857,7 @@ export class Vector {
|
|
|
17828
17857
|
* @remarks
|
|
17829
17858
|
* Returns the component-wise division of these vectors.
|
|
17830
17859
|
*
|
|
17860
|
+
* @throws This function can throw errors.
|
|
17831
17861
|
*/
|
|
17832
17862
|
static divide(a: Vector3, b: number | Vector3): Vector;
|
|
17833
17863
|
/**
|
|
@@ -17957,7 +17987,7 @@ export class World {
|
|
|
17957
17987
|
* Event callbacks are executed in read-write mode.
|
|
17958
17988
|
*
|
|
17959
17989
|
*/
|
|
17960
|
-
readonly afterEvents:
|
|
17990
|
+
readonly afterEvents: WorldAfterEvents;
|
|
17961
17991
|
/**
|
|
17962
17992
|
* @beta
|
|
17963
17993
|
* @remarks
|
|
@@ -17967,7 +17997,7 @@ export class World {
|
|
|
17967
17997
|
* Event callbacks are executed in read-only mode.
|
|
17968
17998
|
*
|
|
17969
17999
|
*/
|
|
17970
|
-
readonly beforeEvents:
|
|
18000
|
+
readonly beforeEvents: WorldBeforeEvents;
|
|
17971
18001
|
/**
|
|
17972
18002
|
* @beta
|
|
17973
18003
|
* @remarks
|
|
@@ -18120,33 +18150,29 @@ export class World {
|
|
|
18120
18150
|
* is provided to `score`.
|
|
18121
18151
|
* @example nestedTranslation.ts
|
|
18122
18152
|
* ```typescript
|
|
18123
|
-
*
|
|
18124
|
-
*
|
|
18125
|
-
*
|
|
18126
|
-
*
|
|
18127
|
-
*
|
|
18128
|
-
*
|
|
18129
|
-
*
|
|
18153
|
+
* // Displays "Apple or Coal"
|
|
18154
|
+
* let rawMessage = {
|
|
18155
|
+
* translate: "accessibility.list.or.two",
|
|
18156
|
+
* with: { rawtext: [{ translate: "item.apple.name" }, { translate: "item.coal.name" }] },
|
|
18157
|
+
* };
|
|
18158
|
+
* world.sendMessage(rawMessage);
|
|
18130
18159
|
* ```
|
|
18131
18160
|
* @example scoreWildcard.ts
|
|
18132
18161
|
* ```typescript
|
|
18133
|
-
*
|
|
18134
|
-
*
|
|
18135
|
-
*
|
|
18136
|
-
*
|
|
18162
|
+
* // Displays the player's score for objective "obj". Each player will see their own score.
|
|
18163
|
+
* const rawMessage = { score: { name: "*", objective: "obj" } };
|
|
18164
|
+
* world.sendMessage(rawMessage);
|
|
18137
18165
|
* ```
|
|
18138
18166
|
* @example simpleString.ts
|
|
18139
18167
|
* ```typescript
|
|
18140
|
-
*
|
|
18141
|
-
*
|
|
18142
|
-
*
|
|
18168
|
+
* // Displays "Hello, world!"
|
|
18169
|
+
* world.sendMessage("Hello, world!");
|
|
18143
18170
|
* ```
|
|
18144
18171
|
* @example translation.ts
|
|
18145
18172
|
* ```typescript
|
|
18146
|
-
*
|
|
18147
|
-
*
|
|
18148
|
-
*
|
|
18149
|
-
*
|
|
18173
|
+
* // Displays "First or Second"
|
|
18174
|
+
* const rawMessage = { translate: "accessibility.list.or.two", with: ["First", "Second"] };
|
|
18175
|
+
* world.sendMessage(rawMessage);
|
|
18150
18176
|
* ```
|
|
18151
18177
|
*/
|
|
18152
18178
|
sendMessage(message: (RawMessage | string)[] | RawMessage | string): void;
|
|
@@ -18197,6 +18223,63 @@ export class World {
|
|
|
18197
18223
|
stopMusic(): void;
|
|
18198
18224
|
}
|
|
18199
18225
|
|
|
18226
|
+
/**
|
|
18227
|
+
* @beta
|
|
18228
|
+
*/
|
|
18229
|
+
export class WorldAfterEvents {
|
|
18230
|
+
protected constructor();
|
|
18231
|
+
readonly blockBreak: BlockBreakAfterEventSignal;
|
|
18232
|
+
readonly blockExplode: BlockExplodeAfterEventSignal;
|
|
18233
|
+
readonly blockPlace: BlockPlaceAfterEventSignal;
|
|
18234
|
+
readonly buttonPush: ButtonPushAfterEventSignal;
|
|
18235
|
+
readonly chatSend: ChatSendAfterEventSignal;
|
|
18236
|
+
readonly dataDrivenEntityTriggerEvent: DataDrivenEntityTriggerAfterEventSignal;
|
|
18237
|
+
readonly effectAdd: EffectAddAfterEventSignal;
|
|
18238
|
+
readonly entityDie: EntityDieAfterEventSignal;
|
|
18239
|
+
readonly entityHealthChanged: EntityHealthChangedAfterEventSignal;
|
|
18240
|
+
readonly entityHit: EntityHitAfterEventSignal;
|
|
18241
|
+
readonly entityHurt: EntityHurtAfterEventSignal;
|
|
18242
|
+
readonly entityRemoved: EntityRemovedAfterEventSignal;
|
|
18243
|
+
readonly entitySpawn: EntitySpawnAfterEventSignal;
|
|
18244
|
+
readonly explosion: ExplosionAfterEventSignal;
|
|
18245
|
+
readonly itemCompleteUse: ItemCompleteUseAfterEventSignal;
|
|
18246
|
+
readonly itemDefinitionEvent: ItemDefinitionAfterEventSignal;
|
|
18247
|
+
readonly itemReleaseUse: ItemReleaseUseAfterEventSignal;
|
|
18248
|
+
readonly itemStartUse: ItemStartUseAfterEventSignal;
|
|
18249
|
+
readonly itemStartUseOn: ItemStartUseOnAfterEventSignal;
|
|
18250
|
+
readonly itemStopUse: ItemStopUseAfterEventSignal;
|
|
18251
|
+
readonly itemStopUseOn: ItemStopUseOnAfterEventSignal;
|
|
18252
|
+
readonly itemUse: ItemUseAfterEventSignal;
|
|
18253
|
+
readonly itemUseOn: ItemUseOnAfterEventSignal;
|
|
18254
|
+
readonly leverActivate: LeverActionAfterEventSignal;
|
|
18255
|
+
readonly messageReceive: ServerMessageAfterEventSignal;
|
|
18256
|
+
readonly pistonActivate: PistonActivateAfterEventSignal;
|
|
18257
|
+
readonly playerJoin: PlayerJoinAfterEventSignal;
|
|
18258
|
+
readonly playerLeave: PlayerLeaveAfterEventSignal;
|
|
18259
|
+
readonly playerSpawn: PlayerSpawnAfterEventSignal;
|
|
18260
|
+
readonly pressurePlatePop: PressurePlatePopAfterEventSignal;
|
|
18261
|
+
readonly pressurePlatePush: PressurePlatePushAfterEventSignal;
|
|
18262
|
+
readonly projectileHit: ProjectileHitAfterEventSignal;
|
|
18263
|
+
readonly targetBlockHit: TargetBlockHitAfterEventSignal;
|
|
18264
|
+
readonly tripWireTrip: TripWireTripAfterEventSignal;
|
|
18265
|
+
readonly weatherChange: WeatherChangeAfterEventSignal;
|
|
18266
|
+
readonly worldInitialize: WorldInitializeAfterEventSignal;
|
|
18267
|
+
}
|
|
18268
|
+
|
|
18269
|
+
/**
|
|
18270
|
+
* @beta
|
|
18271
|
+
*/
|
|
18272
|
+
export class WorldBeforeEvents {
|
|
18273
|
+
protected constructor();
|
|
18274
|
+
readonly chatSend: ChatSendBeforeEventSignal;
|
|
18275
|
+
readonly dataDrivenEntityTriggerEvent: DataDrivenEntityTriggerBeforeEventSignal;
|
|
18276
|
+
readonly explosion: ExplosionBeforeEventSignal;
|
|
18277
|
+
readonly itemDefinitionEvent: ItemDefinitionBeforeEventSignal;
|
|
18278
|
+
readonly itemUse: ItemUseBeforeEventSignal;
|
|
18279
|
+
readonly itemUseOn: ItemUseOnBeforeEventSignal;
|
|
18280
|
+
readonly pistonActivate: PistonActivateBeforeEventSignal;
|
|
18281
|
+
}
|
|
18282
|
+
|
|
18200
18283
|
/**
|
|
18201
18284
|
* @beta
|
|
18202
18285
|
* Contains information and methods that can be used at the
|
|
@@ -18214,18 +18297,17 @@ export class WorldInitializeAfterEvent {
|
|
|
18214
18297
|
*
|
|
18215
18298
|
* @example propertyRegistration.js
|
|
18216
18299
|
* ```typescript
|
|
18217
|
-
*
|
|
18218
|
-
*
|
|
18219
|
-
* world.afterEvents.worldInitialize.subscribe((e) => {
|
|
18220
|
-
* let def = new DynamicPropertiesDefinition();
|
|
18300
|
+
* import { DynamicPropertiesDefinition, MinecraftEntityTypes, world } from "@minecraft/server";
|
|
18221
18301
|
*
|
|
18222
|
-
*
|
|
18223
|
-
*
|
|
18224
|
-
* def.defineBoolean("rpgIsHero");
|
|
18302
|
+
* world.afterEvents.worldInitialize.subscribe((e) => {
|
|
18303
|
+
* let def = new DynamicPropertiesDefinition();
|
|
18225
18304
|
*
|
|
18226
|
-
*
|
|
18227
|
-
*
|
|
18305
|
+
* def.defineNumber("rpgStrength");
|
|
18306
|
+
* def.defineString("rpgRole", 16);
|
|
18307
|
+
* def.defineBoolean("rpgIsHero");
|
|
18228
18308
|
*
|
|
18309
|
+
* e.propertyRegistry.registerEntityTypeDynamicProperties(def, MinecraftEntityTypes.skeleton);
|
|
18310
|
+
* });
|
|
18229
18311
|
* ```
|
|
18230
18312
|
*/
|
|
18231
18313
|
readonly propertyRegistry: PropertyRegistry;
|
|
@@ -19087,28 +19169,35 @@ export interface TeleportOptions {
|
|
|
19087
19169
|
export interface TitleDisplayOptions {
|
|
19088
19170
|
/**
|
|
19089
19171
|
* @remarks
|
|
19090
|
-
* Fade-in
|
|
19172
|
+
* Fade-in duration for the title and subtitle, in ticks. There
|
|
19173
|
+
* are 20 ticks per second. Use {@link TicksPerSecond} constant
|
|
19174
|
+
* to convert between ticks and seconds.
|
|
19091
19175
|
*
|
|
19092
19176
|
*/
|
|
19093
|
-
|
|
19177
|
+
fadeInDuration: number;
|
|
19094
19178
|
/**
|
|
19095
19179
|
* @remarks
|
|
19096
|
-
* Fade-out time for the title and subtitle, in
|
|
19180
|
+
* Fade-out time for the title and subtitle, in ticks. There
|
|
19181
|
+
* are 20 ticks per second. Use {@link TicksPerSecond} constant
|
|
19182
|
+
* to convert between ticks and seconds.
|
|
19097
19183
|
*
|
|
19098
19184
|
*/
|
|
19099
|
-
|
|
19185
|
+
fadeOutDuration: number;
|
|
19100
19186
|
/**
|
|
19101
19187
|
* @remarks
|
|
19102
|
-
* Amount of time for the title and subtitle to stay in place
|
|
19188
|
+
* Amount of time for the title and subtitle to stay in place,
|
|
19189
|
+
* in ticks. There are 20 ticks per second. Use {@link
|
|
19190
|
+
* TicksPerSecond} constant to convert between ticks and
|
|
19191
|
+
* seconds.
|
|
19103
19192
|
*
|
|
19104
19193
|
*/
|
|
19105
|
-
|
|
19194
|
+
stayDuration: number;
|
|
19106
19195
|
/**
|
|
19107
19196
|
* @remarks
|
|
19108
19197
|
* Optional subtitle text.
|
|
19109
19198
|
*
|
|
19110
19199
|
*/
|
|
19111
|
-
subtitle?: string;
|
|
19200
|
+
subtitle?: (RawMessage | string)[] | RawMessage | string;
|
|
19112
19201
|
}
|
|
19113
19202
|
|
|
19114
19203
|
/**
|