@minecraft/server 2.3.0-beta.1.21.110-preview.22 → 2.3.0-beta.1.21.110-preview.23

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 -125
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -171,7 +171,6 @@ export enum ButtonState {
171
171
  }
172
172
 
173
173
  /**
174
- * @rc
175
174
  * The required permission level to execute the custom command.
176
175
  */
177
176
  export enum CommandPermissionLevel {
@@ -302,7 +301,6 @@ export enum ContainerRulesErrorReason {
302
301
  }
303
302
 
304
303
  /**
305
- * @rc
306
304
  * Reason why custom command registration failed.
307
305
  */
308
306
  export enum CustomCommandErrorReason {
@@ -356,7 +354,6 @@ export enum CustomCommandErrorReason {
356
354
  }
357
355
 
358
356
  /**
359
- * @rc
360
357
  * The types of paramaters accepted by a custom command.
361
358
  */
362
359
  export enum CustomCommandParamType {
@@ -430,7 +427,6 @@ export enum CustomCommandParamType {
430
427
  }
431
428
 
432
429
  /**
433
- * @rc
434
430
  * Who executed the command.
435
431
  */
436
432
  export enum CustomCommandSource {
@@ -455,9 +451,6 @@ export enum CustomCommandSource {
455
451
  Server = 'Server',
456
452
  }
457
453
 
458
- /**
459
- * @rc
460
- */
461
454
  export enum CustomCommandStatus {
462
455
  Success = 0,
463
456
  Failure = 1,
@@ -1086,7 +1079,6 @@ export enum EntityComponentTypes {
1086
1079
  */
1087
1080
  OnFire = 'minecraft:onfire',
1088
1081
  /**
1089
- * @rc
1090
1082
  * @remarks
1091
1083
  * Use this component to read the exhaustion of a player. This
1092
1084
  * is only available on players.
@@ -1094,7 +1086,6 @@ export enum EntityComponentTypes {
1094
1086
  */
1095
1087
  Exhaustion = 'minecraft:player.exhaustion',
1096
1088
  /**
1097
- * @rc
1098
1089
  * @remarks
1099
1090
  * Use this component to read the hunger of a player. This is
1100
1091
  * only available on players.
@@ -1102,7 +1093,6 @@ export enum EntityComponentTypes {
1102
1093
  */
1103
1094
  Hunger = 'minecraft:player.hunger',
1104
1095
  /**
1105
- * @rc
1106
1096
  * @remarks
1107
1097
  * Use this component to read the saturation of a player. This
1108
1098
  * is only available on players.
@@ -2462,7 +2452,6 @@ export enum PlatformType {
2462
2452
  }
2463
2453
 
2464
2454
  /**
2465
- * @rc
2466
2455
  * Specifies the player inventory type.
2467
2456
  */
2468
2457
  export enum PlayerInventoryType {
@@ -2481,7 +2470,6 @@ export enum PlayerInventoryType {
2481
2470
  }
2482
2471
 
2483
2472
  /**
2484
- * @rc
2485
2473
  * The player permission level.
2486
2474
  */
2487
2475
  export enum PlayerPermissionLevel {
@@ -3584,7 +3572,6 @@ export class Block {
3584
3572
  */
3585
3573
  readonly isWaterlogged: boolean;
3586
3574
  /**
3587
- * @rc
3588
3575
  * @remarks
3589
3576
  * Key for the localization of this block's name used in .lang
3590
3577
  * files.
@@ -3821,6 +3808,23 @@ export class Block {
3821
3808
  * {@link LocationOutOfWorldBoundariesError}
3822
3809
  */
3823
3810
  getItemStack(amount?: number, withData?: boolean): ItemStack | undefined;
3811
+ /**
3812
+ * @beta
3813
+ * @remarks
3814
+ * Returns the total brightness level of light shining on a
3815
+ * certain block.
3816
+ *
3817
+ * This function can't be called in read-only mode.
3818
+ *
3819
+ * @returns
3820
+ * The brightness level on the block.
3821
+ * @throws This function can throw errors.
3822
+ *
3823
+ * {@link minecraftcommon.InvalidArgumentError}
3824
+ *
3825
+ * {@link LocationInUnloadedChunkError}
3826
+ */
3827
+ getLightLevel(): number;
3824
3828
  /**
3825
3829
  * @beta
3826
3830
  * @throws This function can throw errors.
@@ -3844,6 +3848,23 @@ export class Block {
3844
3848
  * {@link LocationOutOfWorldBoundariesError}
3845
3849
  */
3846
3850
  getRedstonePower(): number | undefined;
3851
+ /**
3852
+ * @beta
3853
+ * @remarks
3854
+ * Returns the brightness level of light shining from the sky
3855
+ * on a certain block.
3856
+ *
3857
+ * This function can't be called in read-only mode.
3858
+ *
3859
+ * @returns
3860
+ * The brightness level on the block.
3861
+ * @throws This function can throw errors.
3862
+ *
3863
+ * {@link minecraftcommon.InvalidArgumentError}
3864
+ *
3865
+ * {@link LocationInUnloadedChunkError}
3866
+ */
3867
+ getSkyLightLevel(): number;
3847
3868
  /**
3848
3869
  * @remarks
3849
3870
  * Returns a set of tags for a block.
@@ -6328,7 +6349,6 @@ export class Container {
6328
6349
  */
6329
6350
  clearAll(): void;
6330
6351
  /**
6331
- * @rc
6332
6352
  * @remarks
6333
6353
  * Attempts to find an item inside the container
6334
6354
  *
@@ -6340,7 +6360,6 @@ export class Container {
6340
6360
  */
6341
6361
  contains(itemStack: ItemStack): boolean;
6342
6362
  /**
6343
- * @rc
6344
6363
  * @remarks
6345
6364
  * Find the index of the first instance of an item inside the
6346
6365
  * container
@@ -6353,7 +6372,6 @@ export class Container {
6353
6372
  */
6354
6373
  find(itemStack: ItemStack): number | undefined;
6355
6374
  /**
6356
- * @rc
6357
6375
  * @remarks
6358
6376
  * Find the index of the last instance of an item inside the
6359
6377
  * container
@@ -6366,7 +6384,6 @@ export class Container {
6366
6384
  */
6367
6385
  findLast(itemStack: ItemStack): number | undefined;
6368
6386
  /**
6369
- * @rc
6370
6387
  * @remarks
6371
6388
  * Finds the index of the first empty slot inside the container
6372
6389
  *
@@ -6376,7 +6393,6 @@ export class Container {
6376
6393
  */
6377
6394
  firstEmptySlot(): number | undefined;
6378
6395
  /**
6379
- * @rc
6380
6396
  * @remarks
6381
6397
  * Finds the index of the first item inside the container
6382
6398
  *
@@ -6979,7 +6995,6 @@ export class ContainerSlot {
6979
6995
  }
6980
6996
 
6981
6997
  /**
6982
- * @rc
6983
6998
  * Details about the origins of the command.
6984
6999
  */
6985
7000
  export class CustomCommandOrigin {
@@ -7014,7 +7029,6 @@ export class CustomCommandOrigin {
7014
7029
  }
7015
7030
 
7016
7031
  /**
7017
- * @rc
7018
7032
  * Provides the functionality for registering custom commands.
7019
7033
  */
7020
7034
  export class CustomCommandRegistry {
@@ -7157,7 +7171,6 @@ export class Dimension {
7157
7171
  */
7158
7172
  readonly id: string;
7159
7173
  /**
7160
- * @rc
7161
7174
  * @remarks
7162
7175
  * Key for the localization of a dimension's name used by
7163
7176
  * language files.
@@ -8359,7 +8372,6 @@ export class Entity {
8359
8372
  */
8360
8373
  readonly isValid: boolean;
8361
8374
  /**
8362
- * @rc
8363
8375
  * @remarks
8364
8376
  * Key for the localization of this entity's name used in .lang
8365
8377
  * files.
@@ -9876,7 +9888,6 @@ export class EntityDieAfterEventSignal {
9876
9888
  export class EntityEquippableComponent extends EntityComponent {
9877
9889
  private constructor();
9878
9890
  /**
9879
- * @rc
9880
9891
  * @remarks
9881
9892
  * Returns the total Armor level of the owner.
9882
9893
  *
@@ -9886,7 +9897,6 @@ export class EntityEquippableComponent extends EntityComponent {
9886
9897
  */
9887
9898
  readonly totalArmor: number;
9888
9899
  /**
9889
- * @rc
9890
9900
  * @remarks
9891
9901
  * Returns the total Toughness level of the owner.
9892
9902
  *
@@ -9937,7 +9947,6 @@ export class EntityEquippableComponent extends EntityComponent {
9937
9947
  }
9938
9948
 
9939
9949
  /**
9940
- * @rc
9941
9950
  * Defines the interactions with this entity for Exhaustion.
9942
9951
  * Wraps the `minecraft.player.exhaustion` attribute.
9943
9952
  */
@@ -10235,7 +10244,6 @@ export class EntityHitEntityAfterEventSignal {
10235
10244
  }
10236
10245
 
10237
10246
  /**
10238
- * @rc
10239
10247
  * Defines the interactions with this entity for hunger. Wraps
10240
10248
  * the `minecraft.player.hunger` attribute.
10241
10249
  */
@@ -11603,7 +11611,6 @@ export class EntityRidingComponent extends EntityComponent {
11603
11611
  }
11604
11612
 
11605
11613
  /**
11606
- * @rc
11607
11614
  * Defines the interactions with this entity for Saturation.
11608
11615
  * Wraps the `minecraft.player.saturation` attribute.
11609
11616
  */
@@ -13448,25 +13455,26 @@ export class ItemPotionComponent extends ItemComponent {
13448
13455
  private constructor();
13449
13456
  /**
13450
13457
  * @remarks
13451
- * The PotionEffectType associated with the potion item.
13458
+ * The PotionDeliveryType associated with the potion item.
13452
13459
  *
13453
13460
  * @throws This property can throw when used.
13454
- */
13455
- readonly potionEffectType: PotionEffectType;
13456
- /**
13457
- * @remarks
13458
- * The PotionLiquidType associated with the potion item.
13459
13461
  *
13460
- * @throws This property can throw when used.
13462
+ * {@link minecraftcommon.EngineError}
13463
+ *
13464
+ * {@link Error}
13461
13465
  */
13462
- readonly potionLiquidType: PotionLiquidType;
13466
+ readonly potionDeliveryType: PotionDeliveryType;
13463
13467
  /**
13464
13468
  * @remarks
13465
- * The PotionModifierType associated with the potion item.
13469
+ * The PotionEffectType associated with the potion item.
13466
13470
  *
13467
13471
  * @throws This property can throw when used.
13472
+ *
13473
+ * {@link minecraftcommon.EngineError}
13474
+ *
13475
+ * {@link Error}
13468
13476
  */
13469
- readonly potionModifierType: PotionModifierType;
13477
+ readonly potionEffectType: PotionEffectType;
13470
13478
  static readonly componentId = 'minecraft:potion';
13471
13479
  }
13472
13480
 
@@ -13631,7 +13639,6 @@ export class ItemStack {
13631
13639
  */
13632
13640
  keepOnDeath: boolean;
13633
13641
  /**
13634
- * @rc
13635
13642
  * @remarks
13636
13643
  * Key for the localization of this items's name used in .lang
13637
13644
  * files.
@@ -14050,16 +14057,6 @@ export class ItemStack {
14050
14057
  * ```
14051
14058
  */
14052
14059
  setLore(loreList?: (RawMessage | string)[]): void;
14053
- /**
14054
- * @beta
14055
- * @remarks
14056
- * Helper function for creating potion items.
14057
- *
14058
- * This function can't be called in read-only mode.
14059
- *
14060
- * @throws This function can throw errors.
14061
- */
14062
- static createPotion(options: PotionOptions): ItemStack;
14063
14060
  }
14064
14061
 
14065
14062
  /**
@@ -14986,7 +14983,6 @@ export class Player extends Entity {
14986
14983
  */
14987
14984
  readonly clientSystemInfo: ClientSystemInfo;
14988
14985
  /**
14989
- * @rc
14990
14986
  * @remarks
14991
14987
  * This property can't be edited in read-only mode.
14992
14988
  *
@@ -15069,7 +15065,6 @@ export class Player extends Entity {
15069
15065
  */
15070
15066
  readonly onScreenDisplay: ScreenDisplay;
15071
15067
  /**
15072
- * @rc
15073
15068
  * @throws This property can throw when used.
15074
15069
  *
15075
15070
  * {@link InvalidEntityError}
@@ -16016,7 +16011,6 @@ export class PlayerGameModeChangeBeforeEventSignal {
16016
16011
  }
16017
16012
 
16018
16013
  /**
16019
- * @rc
16020
16014
  * Contains information regarding an event after changing the
16021
16015
  * selected hotbar slot for a player.
16022
16016
  */
@@ -16049,7 +16043,6 @@ export class PlayerHotbarSelectedSlotChangeAfterEvent {
16049
16043
  }
16050
16044
 
16051
16045
  /**
16052
- * @rc
16053
16046
  * Manages callbacks that are connected after a player selected
16054
16047
  * hotbar slot is changed.
16055
16048
  */
@@ -16531,7 +16524,6 @@ export class PlayerInteractWithEntityBeforeEventSignal {
16531
16524
  }
16532
16525
 
16533
16526
  /**
16534
- * @rc
16535
16527
  * Contains information regarding an event after a player's
16536
16528
  * inventory item changes.
16537
16529
  */
@@ -16570,7 +16562,6 @@ export class PlayerInventoryItemChangeAfterEvent {
16570
16562
  }
16571
16563
 
16572
16564
  /**
16573
- * @rc
16574
16565
  * Manages callbacks that are connected after a player's
16575
16566
  * inventory item is changed.
16576
16567
  */
@@ -16934,41 +16925,65 @@ export class PlayerSpawnAfterEventSignal {
16934
16925
 
16935
16926
  /**
16936
16927
  * @beta
16937
- * Represents a type of potion effect - like healing or leaping
16938
- * - that can be used with PotionOptions.
16939
- */
16940
- export class PotionEffectType {
16941
- private constructor();
16942
- readonly id: string;
16943
- }
16944
-
16945
- /**
16946
- * @beta
16947
- * Represents a type of potion liquid - like splash, or
16948
- * lingering - that can be used with PotionOptions.
16928
+ * Represents how the potion effect is delivered.
16949
16929
  */
16950
- export class PotionLiquidType {
16930
+ export class PotionDeliveryType {
16951
16931
  private constructor();
16952
16932
  readonly id: string;
16953
16933
  }
16954
16934
 
16955
16935
  /**
16956
16936
  * @beta
16957
- * Represents a type of potion modifier - like strong, or long
16958
- * - that can be used with PotionOptions.
16937
+ * Represents a type of potion effect - like healing or
16938
+ * leaping.
16959
16939
  */
16960
- export class PotionModifierType {
16940
+ export class PotionEffectType {
16961
16941
  private constructor();
16942
+ /**
16943
+ * @remarks
16944
+ * Duration of the effect when applied to an entity in ticks.
16945
+ * Undefined means the effect does not expire.
16946
+ *
16947
+ * @throws This property can throw when used.
16948
+ *
16949
+ * {@link minecraftcommon.EngineError}
16950
+ */
16951
+ readonly durationTicks?: number;
16962
16952
  readonly id: string;
16963
16953
  }
16964
16954
 
16965
16955
  /**
16966
16956
  * @beta
16967
- * Used for accessing all potion effects, liquids, and
16968
- * modifiers currently available for use within the world.
16957
+ * Used for accessing all potion effect types, delivery types,
16958
+ * and creating potions.
16969
16959
  */
16970
16960
  export class Potions {
16971
16961
  private constructor();
16962
+ /**
16963
+ * @remarks
16964
+ * Retrieves handles for all registered potion delivery types.
16965
+ *
16966
+ * @returns
16967
+ * Array of all registered delivery type handles.
16968
+ */
16969
+ static getAllDeliveryTypes(): PotionDeliveryType[];
16970
+ /**
16971
+ * @remarks
16972
+ * Retrieves all type handle for all registered potion effects.
16973
+ *
16974
+ * @returns
16975
+ * Array of all registered effect type handles.
16976
+ */
16977
+ static getAllEffectTypes(): PotionEffectType[];
16978
+ /**
16979
+ * @remarks
16980
+ * Retrieves a type handle for a specified potion delivery id.
16981
+ *
16982
+ * @returns
16983
+ * A type handle wrapping the valid delivery id, or undefined
16984
+ * for an invalid delivery id.
16985
+ */
16986
+ static getDeliveryType(potionDeliveryId: string): PotionDeliveryType | undefined;
16972
16987
  /**
16973
16988
  * @remarks
16974
16989
  * Retrieves a type handle for a specified potion effect id.
@@ -16980,25 +16995,23 @@ export class Potions {
16980
16995
  * A type handle wrapping the valid effect id, or undefined for
16981
16996
  * an invalid effect id.
16982
16997
  */
16983
- static getPotionEffectType(potionEffectId: string): PotionEffectType | undefined;
16998
+ static getEffectType(potionEffectId: string): PotionEffectType | undefined;
16984
16999
  /**
16985
17000
  * @remarks
16986
- * Retrieves a type handle for a specified potion liquid id.
17001
+ * Creates a potion given an effect and delivery type.
16987
17002
  *
16988
- * @returns
16989
- * A type handle wrapping the valid liquid id, or undefined for
16990
- * an invalid liquid id.
16991
- */
16992
- static getPotionLiquidType(potionLiquidId: string): PotionLiquidType | undefined;
16993
- /**
16994
- * @remarks
16995
- * Retrieves a type handle for a specified potion modifier id.
17003
+ * @throws This function can throw errors.
16996
17004
  *
16997
- * @returns
16998
- * A type handle wrapping the valid modifier id, or undefined
16999
- * for an invalid modifier id.
17005
+ * {@link minecraftcommon.EngineError}
17006
+ *
17007
+ * {@link InvalidPotionDeliveryTypeError}
17008
+ *
17009
+ * {@link InvalidPotionEffectTypeError}
17000
17010
  */
17001
- static getPotionModifierType(potionModifierId: string): PotionModifierType | undefined;
17011
+ static resolve<
17012
+ T extends string = minecraftvanilladata.MinecraftPotionEffectTypes,
17013
+ U extends string = minecraftvanilladata.MinecraftPotionDeliveryTypes,
17014
+ >(potionEffectType: PotionEffectType | T, potionDeliveryType: PotionDeliveryType | U): ItemStack;
17002
17015
  }
17003
17016
 
17004
17017
  /**
@@ -18056,7 +18069,6 @@ export class StartupEvent {
18056
18069
  */
18057
18070
  readonly blockComponentRegistry: BlockComponentRegistry;
18058
18071
  /**
18059
- * @rc
18060
18072
  * @remarks
18061
18073
  * This property can be read in early-execution mode.
18062
18074
  *
@@ -19912,7 +19924,6 @@ export class WorldAfterEvents {
19912
19924
  */
19913
19925
  readonly playerGameModeChange: PlayerGameModeChangeAfterEventSignal;
19914
19926
  /**
19915
- * @rc
19916
19927
  * @remarks
19917
19928
  * This event fires when a player's selected slot changes.
19918
19929
  *
@@ -19953,7 +19964,6 @@ export class WorldAfterEvents {
19953
19964
  */
19954
19965
  readonly playerInteractWithEntity: PlayerInteractWithEntityAfterEventSignal;
19955
19966
  /**
19956
- * @rc
19957
19967
  * @remarks
19958
19968
  * This event fires when an item gets added or removed to the
19959
19969
  * player's inventory.
@@ -20699,7 +20709,6 @@ export interface ContainerRules {
20699
20709
  }
20700
20710
 
20701
20711
  /**
20702
- * @rc
20703
20712
  * Define the custom command, including name, permissions, and
20704
20713
  * parameters.
20705
20714
  */
@@ -20744,7 +20753,6 @@ export interface CustomCommand {
20744
20753
  }
20745
20754
 
20746
20755
  /**
20747
- * @rc
20748
20756
  * Definition for each parameter expected by the custom
20749
20757
  * command.
20750
20758
  */
@@ -20773,7 +20781,6 @@ export interface CustomCommandParameter {
20773
20781
  }
20774
20782
 
20775
20783
  /**
20776
- * @rc
20777
20784
  * Interface returned from custom command callback function.
20778
20785
  */
20779
20786
  export interface CustomCommandResult {
@@ -21583,7 +21590,6 @@ export interface GreaterThanOrEqualsComparison {
21583
21590
  }
21584
21591
 
21585
21592
  /**
21586
- * @rc
21587
21593
  * Contains additional filtering options for hotbar events.
21588
21594
  */
21589
21595
  export interface HotbarEventOptions {
@@ -21620,7 +21626,6 @@ export interface InputEventOptions {
21620
21626
  }
21621
21627
 
21622
21628
  /**
21623
- * @rc
21624
21629
  * Contains additional filtering options for inventory item
21625
21630
  * events.
21626
21631
  */
@@ -21954,35 +21959,6 @@ export interface PlayerSoundOptions {
21954
21959
  volume?: number;
21955
21960
  }
21956
21961
 
21957
- /**
21958
- * @beta
21959
- * Options for use in creating potions. See
21960
- * ItemStack.createPotion.
21961
- */
21962
- export interface PotionOptions {
21963
- /**
21964
- * @remarks
21965
- * The type of potion effect to create. See
21966
- * @minecraft/vanilla-data.MinecraftPotionEffectTypes.
21967
- *
21968
- */
21969
- effect: PotionEffectType | string;
21970
- /**
21971
- * @remarks
21972
- * Optional potion liquid, defaults to 'Regular'. See
21973
- * @minecraft/vanilla-data.MinecraftPotionLiquidTypes.
21974
- *
21975
- */
21976
- liquid?: PotionLiquidType | string;
21977
- /**
21978
- * @remarks
21979
- * Optional potion modifier, defaults to 'Normal'. See
21980
- * @minecraft/vanilla-data.MinecraftPotionModifierTypes.
21981
- *
21982
- */
21983
- modifier?: PotionModifierType | string;
21984
- }
21985
-
21986
21962
  /**
21987
21963
  * Optional arguments for
21988
21964
  * @minecraft/server.EntityProjectileComponent.shoot.
@@ -22658,7 +22634,6 @@ export class ContainerRulesError extends Error {
22658
22634
  }
22659
22635
 
22660
22636
  /**
22661
- * @rc
22662
22637
  * Error object thrown when CustomCommandRegistry errors occur.
22663
22638
  */
22664
22639
  // @ts-ignore Class inheritance allowed for native defined classes
@@ -22711,7 +22686,6 @@ export class EntitySpawnError extends Error {
22711
22686
  }
22712
22687
 
22713
22688
  /**
22714
- * @rc
22715
22689
  * The container is invalid. This can occur if the container is
22716
22690
  * missing or deleted.
22717
22691
  */
@@ -22777,6 +22751,22 @@ export class InvalidIteratorError extends Error {
22777
22751
  private constructor();
22778
22752
  }
22779
22753
 
22754
+ /**
22755
+ * @beta
22756
+ */
22757
+ // @ts-ignore Class inheritance allowed for native defined classes
22758
+ export class InvalidPotionDeliveryTypeError extends Error {
22759
+ private constructor();
22760
+ }
22761
+
22762
+ /**
22763
+ * @beta
22764
+ */
22765
+ // @ts-ignore Class inheritance allowed for native defined classes
22766
+ export class InvalidPotionEffectTypeError extends Error {
22767
+ private constructor();
22768
+ }
22769
+
22780
22770
  /**
22781
22771
  * Thrown when a Structure is invalid. A structure becomes
22782
22772
  * invalid when it is deleted.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "2.3.0-beta.1.21.110-preview.22",
3
+ "version": "2.3.0-beta.1.21.110-preview.23",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "peerDependencies": {
16
16
  "@minecraft/common": "^1.2.0",
17
- "@minecraft/vanilla-data": ">=1.20.70 || 1.21.110-preview.22"
17
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.21.110-preview.23"
18
18
  },
19
19
  "license": "MIT"
20
20
  }