@minecraft/server 1.4.0-beta.1.20.10-preview.20 → 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.
Files changed (2) hide show
  1. package/index.d.ts +115 -315
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * ```json
17
17
  * {
18
18
  * "module_name": "@minecraft/server",
19
- * "version": "1.4.0-internal.1.20.10-preview.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,269 +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
- readonly entityHealthChanged: EntityHealthChangedAfterEventSignal;
421
- /**
422
- * @remarks
423
- * This event fires when an entity hits (makes a melee attack)
424
- * and potentially impacts another entity or block.
425
- *
426
- */
427
- readonly entityHit: EntityHitAfterEventSignal;
428
- /**
429
- * @remarks
430
- * This event fires when an entity is hurt (takes damage).
431
- *
432
- */
433
- readonly entityHurt: EntityHurtAfterEventSignal;
434
- readonly entityRemoved: EntityRemovedAfterEventSignal;
435
- /**
436
- * @remarks
437
- * This event fires when an entity is spawned.
438
- *
439
- */
440
- readonly entitySpawn: EntitySpawnAfterEventSignal;
441
- /**
442
- * @remarks
443
- * This event is fired after an explosion occurs.
444
- *
445
- */
446
- readonly explosion: ExplosionAfterEventSignal;
447
- readonly itemCompleteUse: ItemCompleteUseAfterEventSignal;
448
- /**
449
- * @remarks
450
- * For custom items, this event is triggered when the
451
- * fundamental set of defined components for the item change.
452
- * Note that this event is only fired for custom data-driven
453
- * items.
454
- *
455
- */
456
- readonly itemDefinitionEvent: ItemDefinitionAfterEventSignal;
457
- readonly itemReleaseUse: ItemReleaseUseAfterEventSignal;
458
- readonly itemStartUse: ItemStartUseAfterEventSignal;
459
- /**
460
- * @remarks
461
- * This event fires when a player successfully uses an item or
462
- * places a block by pressing the Use Item / Place Block
463
- * button. If multiple blocks are placed, this event will only
464
- * occur once at the beginning of the block placement. Note:
465
- * This event cannot be used with Hoe or Axe items.
466
- *
467
- */
468
- readonly itemStartUseOn: ItemStartUseOnAfterEventSignal;
469
- readonly itemStopUse: ItemStopUseAfterEventSignal;
470
- /**
471
- * @remarks
472
- * This event fires when a player releases the Use Item / Place
473
- * Block button after successfully using an item. Note: This
474
- * event cannot be used with Hoe or Axe items.
475
- *
476
- */
477
- readonly itemStopUseOn: ItemStopUseOnAfterEventSignal;
478
- /**
479
- * @remarks
480
- * This event fires when an item is successfully used by a
481
- * player.
482
- *
483
- */
484
- readonly itemUse: ItemUseAfterEventSignal;
485
- /**
486
- * @remarks
487
- * This event fires when an item is used on a block by a
488
- * player.
489
- *
490
- */
491
- readonly itemUseOn: ItemUseOnAfterEventSignal;
492
- /**
493
- * @remarks
494
- * This event fires when a lever activates or is deactivated.
495
- *
496
- */
497
- readonly leverActivate: LeverActionAfterEventSignal;
498
- /**
499
- * @remarks
500
- * This event is an internal implementation detail, and is
501
- * otherwise not currently functional.
502
- *
503
- */
504
- readonly messageReceive: ServerMessageAfterEventSignal;
505
- /**
506
- * @remarks
507
- * This event fires when a piston expands or retracts.
508
- *
509
- */
510
- readonly pistonActivate: PistonActivateAfterEventSignal;
511
- /**
512
- * @remarks
513
- * This event fires when a player joins a world. See also
514
- * playerSpawn for another related event you can trap for when
515
- * a player is spawned the first time within a world.
516
- *
517
- */
518
- readonly playerJoin: PlayerJoinAfterEventSignal;
519
- /**
520
- * @remarks
521
- * This event fires when a player leaves a world.
522
- *
523
- */
524
- readonly playerLeave: PlayerLeaveAfterEventSignal;
525
- /**
526
- * @remarks
527
- * This event fires when a player spawns or respawns. Note that
528
- * an additional flag within this event will tell you whether
529
- * the player is spawning right after join vs. a respawn.
530
- *
531
- */
532
- readonly playerSpawn: PlayerSpawnAfterEventSignal;
533
- readonly pressurePlatePop: PressurePlatePopAfterEventSignal;
534
- readonly pressurePlatePush: PressurePlatePushAfterEventSignal;
535
- /**
536
- * @remarks
537
- * This event fires when a projectile hits an entity or block.
538
- *
539
- */
540
- readonly projectileHit: ProjectileHitAfterEventSignal;
541
- readonly targetBlockHit: TargetBlockHitAfterEventSignal;
542
- readonly tripWireTrip: TripWireTripAfterEventSignal;
543
- /**
544
- * @remarks
545
- * This event will be triggered when the weather changes within
546
- * Minecraft.
547
- *
548
- */
549
- readonly weatherChange: WeatherChangeAfterEventSignal;
550
- /**
551
- * @remarks
552
- * This event fires when the script environment is initialized
553
- * on a World. In addition, you can register dynamic properties
554
- * within the scope of a world Initialize event.
555
- *
556
- */
557
- readonly worldInitialize: WorldInitializeAfterEventSignal;
558
- }
559
-
560
- /**
561
- * @beta
562
- * A set of events that fire before an actual action occurs. In
563
- * most cases, you can potentially cancel or modify the
564
- * impending event. Note that in before events any APIs that
565
- * modify gameplay state will not function and will throw an
566
- * error. (e.g., dimension.spawnEntity)
567
- */
568
- export class BeforeEvents {
569
- protected constructor();
570
- /**
571
- * @remarks
572
- * This event is triggered after a chat message has been
573
- * broadcast or sent to players.
574
- *
575
- */
576
- readonly chatSend: ChatSendBeforeEventSignal;
577
- /**
578
- * @remarks
579
- * This event is fired when an entity event has been triggered
580
- * that will update the component definition state of an
581
- * entity.
582
- *
583
- */
584
- readonly dataDrivenEntityTriggerEvent: DataDrivenEntityTriggerBeforeEventSignal;
585
- /**
586
- * @remarks
587
- * This event is fired after an explosion occurs.
588
- *
589
- */
590
- readonly explosion: ExplosionBeforeEventSignal;
591
- /**
592
- * @remarks
593
- * For custom items, this event is triggered when the
594
- * fundamental set of defined components for the item change.
595
- * Note that this event is only fired for custom data-driven
596
- * items.
597
- *
598
- */
599
- readonly itemDefinitionEvent: ItemDefinitionBeforeEventSignal;
600
- /**
601
- * @remarks
602
- * This event fires when an item is successfully used by a
603
- * player.
604
- *
605
- */
606
- readonly itemUse: ItemUseBeforeEventSignal;
607
- /**
608
- * @remarks
609
- * This event fires when an item is used on a block by a
610
- * player.
611
- *
612
- */
613
- readonly itemUseOn: ItemUseOnBeforeEventSignal;
614
- /**
615
- * @remarks
616
- * This event fires when a piston expands or retracts.
617
- *
618
- */
619
- readonly pistonActivate: PistonActivateBeforeEventSignal;
620
- }
621
-
622
357
  /**
623
358
  * @beta
624
359
  * Represents a block in a dimension. A block represents a
@@ -816,6 +551,10 @@ export class Block {
816
551
  * @throws This function can throw errors.
817
552
  */
818
553
  isSolid(): boolean;
554
+ /**
555
+ * @beta
556
+ */
557
+ isValid(): boolean;
819
558
  /**
820
559
  * @remarks
821
560
  * Sets the block in the dimension to the state of the
@@ -2263,6 +2002,10 @@ export class Container {
2263
2002
  * out of bounds.
2264
2003
  */
2265
2004
  getSlot(slot: number): ContainerSlot;
2005
+ /**
2006
+ * @beta
2007
+ */
2008
+ isValid(): boolean;
2266
2009
  /**
2267
2010
  * @remarks
2268
2011
  * Moves an item from one slot to another, potentially across
@@ -2387,14 +2130,6 @@ export class ContainerSlot {
2387
2130
  * Throws if the slot's container is invalid.
2388
2131
  */
2389
2132
  readonly isStackable: boolean;
2390
- /**
2391
- * @remarks
2392
- * Returns whether the ContainerSlot is valid. The container
2393
- * slot is valid if the container exists and is loaded, and the
2394
- * slot index is valid.
2395
- *
2396
- */
2397
- readonly isValid: boolean;
2398
2133
  /**
2399
2134
  * @remarks
2400
2135
  * Gets or sets whether the item is kept on death.
@@ -2519,6 +2254,14 @@ export class ContainerSlot {
2519
2254
  * Throws if the slot's container is invalid.
2520
2255
  */
2521
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;
2522
2265
  /**
2523
2266
  * @remarks
2524
2267
  * The list of block types this item can break in Adventure
@@ -3121,6 +2864,7 @@ export class Effect {
3121
2864
  * @throws This property can throw when used.
3122
2865
  */
3123
2866
  readonly typeId: string;
2867
+ isValid(): boolean;
3124
2868
  }
3125
2869
 
3126
2870
  /**
@@ -4376,6 +4120,10 @@ export class EntityComponent extends Component {
4376
4120
  *
4377
4121
  */
4378
4122
  readonly entity: Entity;
4123
+ /**
4124
+ * @beta
4125
+ */
4126
+ isValid(): boolean;
4379
4127
  }
4380
4128
 
4381
4129
  /**
@@ -7168,6 +6916,10 @@ export class ItemCompleteUseAfterEventSignal extends IItemCompleteUseAfterEventS
7168
6916
  */
7169
6917
  export class ItemComponent extends Component {
7170
6918
  protected constructor();
6919
+ /**
6920
+ * @beta
6921
+ */
6922
+ isValid(): boolean;
7171
6923
  }
7172
6924
 
7173
6925
  /**
@@ -8171,7 +7923,6 @@ export class MessageReceiveAfterEvent {
8171
7923
  readonly id: string;
8172
7924
  readonly message: string;
8173
7925
  readonly player: Player;
8174
- readonly sourceType: MessageSourceType;
8175
7926
  }
8176
7927
 
8177
7928
  /**
@@ -17525,6 +17276,7 @@ export class ScoreboardIdentity {
17525
17276
  * @throws This function can throw errors.
17526
17277
  */
17527
17278
  getScore(objective: ScoreboardObjective): number;
17279
+ isValid(): boolean;
17528
17280
  /**
17529
17281
  * @remarks
17530
17282
  * Removes this participant from an objective.
@@ -17597,6 +17349,7 @@ export class ScoreboardObjective {
17597
17349
  * @throws This function can throw errors.
17598
17350
  */
17599
17351
  getScores(): ScoreboardScoreInfo[];
17352
+ isValid(): boolean;
17600
17353
  /**
17601
17354
  * @remarks
17602
17355
  * Removes a participant from this scoreboard objective.
@@ -17652,6 +17405,7 @@ export class ScoreboardScoreInfo {
17652
17405
  */
17653
17406
  export class ScreenDisplay {
17654
17407
  protected constructor();
17408
+ isValid(): boolean;
17655
17409
  /**
17656
17410
  * @remarks
17657
17411
  * Set the action bar text - a piece of text that displays
@@ -17732,7 +17486,7 @@ export class ScriptEventCommandMessageAfterEvent {
17732
17486
  * Returns the type of source that fired this command.
17733
17487
  *
17734
17488
  */
17735
- readonly sourceType: MessageSourceType;
17489
+ readonly sourceType: ScriptEventSource;
17736
17490
  }
17737
17491
 
17738
17492
  /**
@@ -17797,19 +17551,19 @@ export class System {
17797
17551
  protected constructor();
17798
17552
  /**
17799
17553
  * @beta
17800
- * @remarks
17801
- * Represents the current world tick of the server.
17802
- *
17803
17554
  */
17804
- readonly currentTick: number;
17555
+ readonly afterEvents: SystemAfterEvents;
17556
+ /**
17557
+ * @beta
17558
+ */
17559
+ readonly beforeEvents: SystemBeforeEvents;
17805
17560
  /**
17806
17561
  * @beta
17807
17562
  * @remarks
17808
- * Contains a set of events that are applicable for the
17809
- * lifecycle of items in the Minecraft system.
17563
+ * Represents the current world tick of the server.
17810
17564
  *
17811
17565
  */
17812
- readonly events: SystemEvents;
17566
+ readonly currentTick: number;
17813
17567
  /**
17814
17568
  * @beta
17815
17569
  * @remarks
@@ -17866,31 +17620,20 @@ export class System {
17866
17620
 
17867
17621
  /**
17868
17622
  * @beta
17869
- * Contains a set of events that are available across the scope
17870
- * of the Minecraft add-on system.
17871
17623
  */
17872
- export class SystemEvents {
17624
+ export class SystemAfterEvents {
17873
17625
  protected constructor();
17874
- /**
17875
- * @remarks
17876
- * This event fires before a the performance watchdog
17877
- * terminates scripting execution due to exceeding a
17878
- * performance boundary. Depending on the configuration of the
17879
- * runtime environment, this event can be canceled. For
17880
- * example, on certain dedicated server environments the
17881
- * ability to override termination events may be disabled.
17882
- *
17883
- */
17884
- readonly beforeWatchdogTerminate: WatchdogTerminateBeforeEventSignal;
17885
- /**
17886
- * @remarks
17887
- * This event fires if a /scriptevent command is invoked by a
17888
- * player, NPC, or block.
17889
- *
17890
- */
17891
17626
  readonly scriptEventReceive: ScriptEventCommandMessageAfterEventSignal;
17892
17627
  }
17893
17628
 
17629
+ /**
17630
+ * @beta
17631
+ */
17632
+ export class SystemBeforeEvents {
17633
+ protected constructor();
17634
+ readonly watchdogTerminate: WatchdogTerminateBeforeEventSignal;
17635
+ }
17636
+
17894
17637
  /**
17895
17638
  * @beta
17896
17639
  * Contains information related to changes to a target block
@@ -18244,7 +17987,7 @@ export class World {
18244
17987
  * Event callbacks are executed in read-write mode.
18245
17988
  *
18246
17989
  */
18247
- readonly afterEvents: AfterEvents;
17990
+ readonly afterEvents: WorldAfterEvents;
18248
17991
  /**
18249
17992
  * @beta
18250
17993
  * @remarks
@@ -18254,7 +17997,7 @@ export class World {
18254
17997
  * Event callbacks are executed in read-only mode.
18255
17998
  *
18256
17999
  */
18257
- readonly beforeEvents: BeforeEvents;
18000
+ readonly beforeEvents: WorldBeforeEvents;
18258
18001
  /**
18259
18002
  * @beta
18260
18003
  * @remarks
@@ -18480,6 +18223,63 @@ export class World {
18480
18223
  stopMusic(): void;
18481
18224
  }
18482
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
+
18483
18283
  /**
18484
18284
  * @beta
18485
18285
  * Contains information and methods that can be used at the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.4.0-beta.1.20.10-preview.20",
3
+ "version": "1.4.0-beta.1.20.10-preview.21",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {