@minecraft/server 1.10.0-beta.1.20.70-preview.21 → 1.10.0-beta.1.20.70-preview.22

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 +177 -160
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  * ```json
16
16
  * {
17
17
  * "module_name": "@minecraft/server",
18
- * "version": "1.7.0"
18
+ * "version": "1.8.0"
19
19
  * }
20
20
  * ```
21
21
  *
@@ -804,34 +804,29 @@ export enum EquipmentSlot {
804
804
  }
805
805
 
806
806
  /**
807
- * @beta
808
807
  * Represents the type of fluid for use within a fluid
809
808
  * containing block, like a cauldron.
810
809
  */
811
810
  export enum FluidType {
812
811
  /**
813
- * @beta
814
812
  * @remarks
815
813
  * Represents lava as a type of fluid.
816
814
  *
817
815
  */
818
816
  Lava = 'Lava',
819
817
  /**
820
- * @beta
821
818
  * @remarks
822
819
  * Represents a potion as a type of fluid.
823
820
  *
824
821
  */
825
822
  Potion = 'Potion',
826
823
  /**
827
- * @beta
828
824
  * @remarks
829
825
  * Represents powder snow as a type of fluid.
830
826
  *
831
827
  */
832
828
  PowderSnow = 'PowderSnow',
833
829
  /**
834
- * @beta
835
830
  * @remarks
836
831
  * Represents water as a type of fluida.
837
832
  *
@@ -886,6 +881,47 @@ export enum GameMode {
886
881
  survival = 'survival',
887
882
  }
888
883
 
884
+ /**
885
+ * @beta
886
+ */
887
+ export enum GameRule {
888
+ CommandBlockOutput = 'commandBlockOutput',
889
+ CommandBlocksEnabled = 'commandBlocksEnabled',
890
+ DoDayLightCycle = 'doDayLightCycle',
891
+ DoEntityDrops = 'doEntityDrops',
892
+ DoFireTick = 'doFireTick',
893
+ DoImmediateRespawn = 'doImmediateRespawn',
894
+ DoInsomnia = 'doInsomnia',
895
+ DoLimitedCrafting = 'doLimitedCrafting',
896
+ DoMobLoot = 'doMobLoot',
897
+ DoMobSpawning = 'doMobSpawning',
898
+ DoTileDrops = 'doTileDrops',
899
+ DoWeatherCycle = 'doWeatherCycle',
900
+ DrowningDamage = 'drowningDamage',
901
+ FallDamage = 'fallDamage',
902
+ FireDamage = 'fireDamage',
903
+ FreezeDamage = 'freezeDamage',
904
+ FunctionCommandLimit = 'functionCommandLimit',
905
+ KeepInventory = 'keepInventory',
906
+ MaxCommandChainLength = 'maxCommandChainLength',
907
+ MobGriefing = 'mobGriefing',
908
+ NaturalRegeneration = 'naturalRegeneration',
909
+ PlayersSleepingPercentage = 'playersSleepingPercentage',
910
+ ProjectilesCanBreakBlocks = 'projectilesCanBreakBlocks',
911
+ Pvp = 'pvp',
912
+ RandomTickSpeed = 'randomTickSpeed',
913
+ RecipesUnlock = 'recipesUnlock',
914
+ RespawnBlocksExplode = 'respawnBlocksExplode',
915
+ SendCommandFeedback = 'sendCommandFeedback',
916
+ ShowBorderEffect = 'showBorderEffect',
917
+ ShowCoordinates = 'showCoordinates',
918
+ ShowDeathMessages = 'showDeathMessages',
919
+ ShowRecipeMessages = 'showRecipeMessages',
920
+ ShowTags = 'showTags',
921
+ SpawnRadius = 'spawnRadius',
922
+ TntExplodes = 'tntExplodes',
923
+ }
924
+
889
925
  /**
890
926
  * @beta
891
927
  */
@@ -1136,6 +1172,26 @@ export enum SignSide {
1136
1172
  Front = 'Front',
1137
1173
  }
1138
1174
 
1175
+ /**
1176
+ * @beta
1177
+ */
1178
+ export enum StructureMirrorAxis {
1179
+ None = 'None',
1180
+ X = 'X',
1181
+ XZ = 'XZ',
1182
+ Z = 'Z',
1183
+ }
1184
+
1185
+ /**
1186
+ * @beta
1187
+ */
1188
+ export enum StructureRotation {
1189
+ None = 'None',
1190
+ Rotate180 = 'Rotate180',
1191
+ Rotate270 = 'Rotate270',
1192
+ Rotate90 = 'Rotate90',
1193
+ }
1194
+
1139
1195
  /**
1140
1196
  * Provides numeric values for common periods in the Minecraft
1141
1197
  * day.
@@ -1688,7 +1744,6 @@ export class Block {
1688
1744
  */
1689
1745
  getRedstonePower(): number | undefined;
1690
1746
  /**
1691
- * @beta
1692
1747
  * @remarks
1693
1748
  * Returns a set of tags for a block.
1694
1749
  *
@@ -1702,7 +1757,6 @@ export class Block {
1702
1757
  */
1703
1758
  getTags(): string[];
1704
1759
  /**
1705
- * @beta
1706
1760
  * @remarks
1707
1761
  * Checks to see if the permutation of this block has a
1708
1762
  * specific tag.
@@ -2149,7 +2203,6 @@ export class BlockPermutation {
2149
2203
  */
2150
2204
  getItemStack(amount?: number): ItemStack | undefined;
2151
2205
  /**
2152
- * @beta
2153
2206
  * @remarks
2154
2207
  * Gets a state for the permutation.
2155
2208
  *
@@ -2199,7 +2252,6 @@ export class BlockPermutation {
2199
2252
  */
2200
2253
  matches(blockName: string, states?: Record<string, boolean | number | string>): boolean;
2201
2254
  /**
2202
- * @beta
2203
2255
  * @remarks
2204
2256
  * Returns a derived BlockPermutation with a specific property
2205
2257
  * set.
@@ -2566,7 +2618,6 @@ export class BlockStateType {
2566
2618
  }
2567
2619
 
2568
2620
  /**
2569
- * @beta
2570
2621
  * The type (or template) of a block. Does not contain
2571
2622
  * permutation data (state) other than the type of block it
2572
2623
  * represents. This type was introduced as of version
@@ -3947,7 +3998,6 @@ export class ContainerSlot {
3947
3998
  }
3948
3999
 
3949
4000
  /**
3950
- * @beta
3951
4001
  * Contains information related to firing of a data driven
3952
4002
  * entity event - for example, the minecraft:ageable_grow_up
3953
4003
  * event on a chicken.
@@ -3976,7 +4026,6 @@ export class DataDrivenEntityTriggerAfterEvent {
3976
4026
  }
3977
4027
 
3978
4028
  /**
3979
- * @beta
3980
4029
  * Contains event registration related to firing of a data
3981
4030
  * driven entity event - for example, the
3982
4031
  * minecraft:ageable_grow_up event on a chicken.
@@ -4639,7 +4688,6 @@ export class Effect {
4639
4688
  }
4640
4689
 
4641
4690
  /**
4642
- * @beta
4643
4691
  * Contains information related to changes to an effect - like
4644
4692
  * poison - being added to an entity.
4645
4693
  */
@@ -4660,7 +4708,6 @@ export class EffectAddAfterEvent {
4660
4708
  }
4661
4709
 
4662
4710
  /**
4663
- * @beta
4664
4711
  * Manages callbacks that are connected to when an effect is
4665
4712
  * added to an entity.
4666
4713
  */
@@ -4691,7 +4738,6 @@ export class EffectAddAfterEventSignal {
4691
4738
  }
4692
4739
 
4693
4740
  /**
4694
- * @beta
4695
4741
  * Contains information related to changes to an effect - like
4696
4742
  * poison - being added to an entity.
4697
4743
  */
@@ -4724,7 +4770,6 @@ export class EffectAddBeforeEvent {
4724
4770
  }
4725
4771
 
4726
4772
  /**
4727
- * @beta
4728
4773
  * Manages callbacks that are connected to when an effect is
4729
4774
  * added to an entity.
4730
4775
  */
@@ -8254,6 +8299,35 @@ export class FluidContainer {
8254
8299
  static readonly minFillLevel = 0;
8255
8300
  }
8256
8301
 
8302
+ /**
8303
+ * @beta
8304
+ */
8305
+ export class GameRuleChangeAfterEvent {
8306
+ private constructor();
8307
+ readonly rule: GameRule;
8308
+ readonly value: boolean | number;
8309
+ }
8310
+
8311
+ /**
8312
+ * @beta
8313
+ */
8314
+ export class GameRuleChangeAfterEventSignal {
8315
+ private constructor();
8316
+ /**
8317
+ * @remarks
8318
+ * This function can't be called in read-only mode.
8319
+ *
8320
+ */
8321
+ subscribe(callback: (arg: GameRuleChangeAfterEvent) => void): (arg: GameRuleChangeAfterEvent) => void;
8322
+ /**
8323
+ * @remarks
8324
+ * This function can't be called in read-only mode.
8325
+ *
8326
+ * @throws This function can throw errors.
8327
+ */
8328
+ unsubscribe(callback: (arg: GameRuleChangeAfterEvent) => void): void;
8329
+ }
8330
+
8257
8331
  /**
8258
8332
  * @beta
8259
8333
  */
@@ -8716,112 +8790,6 @@ export class ItemCooldownComponent extends ItemComponent {
8716
8790
  startCooldown(player: Player): void;
8717
8791
  }
8718
8792
 
8719
- /**
8720
- * @beta
8721
- * Manages callbacks that are connected to an item's definition
8722
- * and components changing.
8723
- */
8724
- export class ItemDefinitionAfterEventSignal {
8725
- private constructor();
8726
- /**
8727
- * @remarks
8728
- * Adds a callback that will be called when an item's
8729
- * definition and components change.
8730
- *
8731
- * This function can't be called in read-only mode.
8732
- *
8733
- */
8734
- subscribe(
8735
- callback: (arg: ItemDefinitionTriggeredAfterEvent) => void,
8736
- ): (arg: ItemDefinitionTriggeredAfterEvent) => void;
8737
- /**
8738
- * @remarks
8739
- * Removes a callback from being called when an item's
8740
- * definition and components change.
8741
- *
8742
- * This function can't be called in read-only mode.
8743
- *
8744
- * @throws This function can throw errors.
8745
- */
8746
- unsubscribe(callback: (arg: ItemDefinitionTriggeredAfterEvent) => void): void;
8747
- }
8748
-
8749
- /**
8750
- * @beta
8751
- * Manages callbacks that are connected to an item's definition
8752
- * and components changing.
8753
- */
8754
- export class ItemDefinitionBeforeEventSignal {
8755
- private constructor();
8756
- /**
8757
- * @remarks
8758
- * Adds a callback that will be called when an item's
8759
- * definition and components change.
8760
- *
8761
- * This function can't be called in read-only mode.
8762
- *
8763
- */
8764
- subscribe(
8765
- callback: (arg: ItemDefinitionTriggeredBeforeEvent) => void,
8766
- ): (arg: ItemDefinitionTriggeredBeforeEvent) => void;
8767
- /**
8768
- * @remarks
8769
- * Removes a callback from being called when an item's
8770
- * definition and components change.
8771
- *
8772
- * This function can't be called in read-only mode.
8773
- *
8774
- * @throws This function can throw errors.
8775
- */
8776
- unsubscribe(callback: (arg: ItemDefinitionTriggeredBeforeEvent) => void): void;
8777
- }
8778
-
8779
- /**
8780
- * @beta
8781
- * Contains information related to a custom item having a data
8782
- * definition change being triggered.
8783
- */
8784
- export class ItemDefinitionTriggeredAfterEvent {
8785
- private constructor();
8786
- /**
8787
- * @remarks
8788
- * Name of the data-driven item event that is triggering this
8789
- * change.
8790
- *
8791
- */
8792
- readonly eventName: string;
8793
- /**
8794
- * @remarks
8795
- * Related item stack that the definitional change has been
8796
- * triggered upon.
8797
- *
8798
- */
8799
- itemStack: ItemStack;
8800
- /**
8801
- * @remarks
8802
- * Returns the source entity that triggered this item event.
8803
- *
8804
- */
8805
- readonly source?: Player;
8806
- }
8807
-
8808
- /**
8809
- * @beta
8810
- * Contains information related to a triggering of a custom
8811
- * item definition change.
8812
- */
8813
- // @ts-ignore Class inheritance allowed for native defined classes
8814
- export class ItemDefinitionTriggeredBeforeEvent extends ItemDefinitionTriggeredAfterEvent {
8815
- private constructor();
8816
- /**
8817
- * @remarks
8818
- * If set to true, will cancel the application of this item
8819
- * definition change.
8820
- *
8821
- */
8822
- cancel: boolean;
8823
- }
8824
-
8825
8793
  /**
8826
8794
  * @beta
8827
8795
  * When present on an item, this item can take damage in the
@@ -9480,20 +9448,6 @@ export class ItemStack {
9480
9448
  * ```
9481
9449
  */
9482
9450
  setLore(loreList?: string[]): void;
9483
- /**
9484
- * @beta
9485
- * @remarks
9486
- * Triggers an item type event. For custom items, a number of
9487
- * events are defined in an items' definition for key item
9488
- * behaviors.
9489
- *
9490
- * This function can't be called in read-only mode.
9491
- *
9492
- * @param eventName
9493
- * Name of the item type event to trigger. If a namespace is
9494
- * not specified, minecraft: is assumed.
9495
- */
9496
- triggerEvent(eventName: string): void;
9497
9451
  }
9498
9452
 
9499
9453
  /**
@@ -10350,6 +10304,11 @@ export class Player extends Entity {
10350
10304
  * Throws if the item is not a food item.
10351
10305
  */
10352
10306
  eatItem(itemStack: ItemStack): void;
10307
+ /**
10308
+ * @beta
10309
+ * @throws This function can throw errors.
10310
+ */
10311
+ getGameMode(): GameMode;
10353
10312
  /**
10354
10313
  * @beta
10355
10314
  * @remarks
@@ -10523,6 +10482,14 @@ export class Player extends Entity {
10523
10482
  * ```
10524
10483
  */
10525
10484
  sendMessage(message: (RawMessage | string)[] | RawMessage | string): void;
10485
+ /**
10486
+ * @beta
10487
+ * @remarks
10488
+ * This function can't be called in read-only mode.
10489
+ *
10490
+ * @throws This function can throw errors.
10491
+ */
10492
+ setGameMode(gameMode?: GameMode): void;
10526
10493
  /**
10527
10494
  * @beta
10528
10495
  * @remarks
@@ -10811,6 +10778,67 @@ export class PlayerDimensionChangeAfterEventSignal {
10811
10778
  unsubscribe(callback: (arg: PlayerDimensionChangeAfterEvent) => void): void;
10812
10779
  }
10813
10780
 
10781
+ /**
10782
+ * @beta
10783
+ */
10784
+ export class PlayerGameModeChangeAfterEvent {
10785
+ private constructor();
10786
+ readonly fromGameMode: GameMode;
10787
+ readonly player: Player;
10788
+ readonly toGameMode: GameMode;
10789
+ }
10790
+
10791
+ /**
10792
+ * @beta
10793
+ */
10794
+ export class PlayerGameModeChangeAfterEventSignal {
10795
+ private constructor();
10796
+ /**
10797
+ * @remarks
10798
+ * This function can't be called in read-only mode.
10799
+ *
10800
+ */
10801
+ subscribe(callback: (arg: PlayerGameModeChangeAfterEvent) => void): (arg: PlayerGameModeChangeAfterEvent) => void;
10802
+ /**
10803
+ * @remarks
10804
+ * This function can't be called in read-only mode.
10805
+ *
10806
+ * @throws This function can throw errors.
10807
+ */
10808
+ unsubscribe(callback: (arg: PlayerGameModeChangeAfterEvent) => void): void;
10809
+ }
10810
+
10811
+ /**
10812
+ * @beta
10813
+ */
10814
+ export class PlayerGameModeChangeBeforeEvent {
10815
+ private constructor();
10816
+ cancel: boolean;
10817
+ readonly fromGameMode: GameMode;
10818
+ readonly player: Player;
10819
+ toGameMode: GameMode;
10820
+ }
10821
+
10822
+ /**
10823
+ * @beta
10824
+ */
10825
+ export class PlayerGameModeChangeBeforeEventSignal {
10826
+ private constructor();
10827
+ /**
10828
+ * @remarks
10829
+ * This function can't be called in read-only mode.
10830
+ *
10831
+ */
10832
+ subscribe(callback: (arg: PlayerGameModeChangeBeforeEvent) => void): (arg: PlayerGameModeChangeBeforeEvent) => void;
10833
+ /**
10834
+ * @remarks
10835
+ * This function can't be called in read-only mode.
10836
+ *
10837
+ * @throws This function can throw errors.
10838
+ */
10839
+ unsubscribe(callback: (arg: PlayerGameModeChangeBeforeEvent) => void): void;
10840
+ }
10841
+
10814
10842
  /**
10815
10843
  * Contains information regarding an event after a player
10816
10844
  * interacts with a block.
@@ -13180,7 +13208,6 @@ export class WorldAfterEvents {
13180
13208
  */
13181
13209
  readonly chatSend: ChatSendAfterEventSignal;
13182
13210
  /**
13183
- * @beta
13184
13211
  * @remarks
13185
13212
  * This event is fired when an entity event has been triggered
13186
13213
  * that will update the component definition state of an
@@ -13255,21 +13282,15 @@ export class WorldAfterEvents {
13255
13282
  */
13256
13283
  readonly explosion: ExplosionAfterEventSignal;
13257
13284
  /**
13258
- * @remarks
13259
- * This event fires when a chargeable item completes charging.
13260
- *
13285
+ * @beta
13261
13286
  */
13262
- readonly itemCompleteUse: ItemCompleteUseAfterEventSignal;
13287
+ readonly gameRuleChange: GameRuleChangeAfterEventSignal;
13263
13288
  /**
13264
- * @beta
13265
13289
  * @remarks
13266
- * For custom items, this event is triggered when the
13267
- * fundamental set of defined components for the item change.
13268
- * Note that this event is only fired for custom data-driven
13269
- * items.
13290
+ * This event fires when a chargeable item completes charging.
13270
13291
  *
13271
13292
  */
13272
- readonly itemDefinitionEvent: ItemDefinitionAfterEventSignal;
13293
+ readonly itemCompleteUse: ItemCompleteUseAfterEventSignal;
13273
13294
  /**
13274
13295
  * @remarks
13275
13296
  * This event fires when a chargeable item is released from
@@ -13354,6 +13375,10 @@ export class WorldAfterEvents {
13354
13375
  *
13355
13376
  */
13356
13377
  readonly playerDimensionChange: PlayerDimensionChangeAfterEventSignal;
13378
+ /**
13379
+ * @beta
13380
+ */
13381
+ readonly playerGameModeChange: PlayerGameModeChangeAfterEventSignal;
13357
13382
  /**
13358
13383
  * @beta
13359
13384
  * @remarks
@@ -13501,16 +13526,6 @@ export class WorldBeforeEvents {
13501
13526
  *
13502
13527
  */
13503
13528
  readonly explosion: ExplosionBeforeEventSignal;
13504
- /**
13505
- * @beta
13506
- * @remarks
13507
- * For custom items, this event is triggered when the
13508
- * fundamental set of defined components for the item change.
13509
- * Note that this event is only fired for custom data-driven
13510
- * items.
13511
- *
13512
- */
13513
- readonly itemDefinitionEvent: ItemDefinitionBeforeEventSignal;
13514
13529
  /**
13515
13530
  * @remarks
13516
13531
  * This event fires when an item is successfully used by a
@@ -13531,6 +13546,10 @@ export class WorldBeforeEvents {
13531
13546
  *
13532
13547
  */
13533
13548
  readonly playerBreakBlock: PlayerBreakBlockBeforeEventSignal;
13549
+ /**
13550
+ * @beta
13551
+ */
13552
+ readonly playerGameModeChange: PlayerGameModeChangeBeforeEventSignal;
13534
13553
  /**
13535
13554
  * @beta
13536
13555
  * @remarks
@@ -13901,7 +13920,6 @@ export interface CompoundBlockVolumeItem {
13901
13920
  }
13902
13921
 
13903
13922
  /**
13904
- * @beta
13905
13923
  * Contains a set of updates to the component definition state
13906
13924
  * of an entity.
13907
13925
  */
@@ -14044,7 +14062,6 @@ export interface EntityDamageSource {
14044
14062
  }
14045
14063
 
14046
14064
  /**
14047
- * @beta
14048
14065
  * Specifies additional filters that are used in registering a
14049
14066
  * data driven trigger event for entities.
14050
14067
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.10.0-beta.1.20.70-preview.21",
3
+ "version": "1.10.0-beta.1.20.70-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {