@minecraft/server 2.0.0-beta.1.21.70-preview.20 → 2.0.0-beta.1.21.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 +24 -386
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -48,7 +48,7 @@ export enum AimAssistTargetMode {
48
48
  * function Block.getComponent.
49
49
  */
50
50
  export enum BlockComponentTypes {
51
- FluidContainer = 'minecraft:fluidContainer',
51
+ FluidContainer = 'minecraft:fluid_container',
52
52
  /**
53
53
  * @remarks
54
54
  * Represents the inventory of a block in the world. Used with
@@ -1181,186 +1181,6 @@ export enum EntityInitializationCause {
1181
1181
  Transformed = 'Transformed',
1182
1182
  }
1183
1183
 
1184
- /**
1185
- * @beta
1186
- * An enum containing categories of entity spawning.
1187
- */
1188
- export enum EntitySpawnCategory {
1189
- /**
1190
- * @remarks
1191
- * Mobs that have an ambient spawn.
1192
- *
1193
- */
1194
- Ambient = 'Ambient',
1195
- /**
1196
- * @remarks
1197
- * Specific spawn for axolotls.
1198
- *
1199
- */
1200
- Axolotls = 'Axolotls',
1201
- /**
1202
- * @remarks
1203
- * Creature spawns.
1204
- *
1205
- */
1206
- Creature = 'Creature',
1207
- /**
1208
- * @remarks
1209
- * Miscellaneous spawns ( e.g. Villager, Iron Golem).
1210
- *
1211
- */
1212
- Misc = 'Misc',
1213
- /**
1214
- * @remarks
1215
- * Monster spawns.
1216
- *
1217
- */
1218
- Monster = 'Monster',
1219
- /**
1220
- * @remarks
1221
- * Creatures that spawn underground in the water.
1222
- *
1223
- */
1224
- UndergroundWaterCreature = 'UndergroundWaterCreature',
1225
- /**
1226
- * @remarks
1227
- * Water mobs that have an ambient spawn.
1228
- *
1229
- */
1230
- WaterAmbient = 'WaterAmbient',
1231
- /**
1232
- * @remarks
1233
- * Water creature spawns.
1234
- *
1235
- */
1236
- WaterCreature = 'WaterCreature',
1237
- }
1238
-
1239
- /**
1240
- * @beta
1241
- * An enum containing reasons an entity could be spawned.
1242
- */
1243
- export enum EntitySpawnReason {
1244
- /**
1245
- * @remarks
1246
- * Bred offspring.
1247
- *
1248
- */
1249
- Breeding = 'Breeding',
1250
- /**
1251
- * @remarks
1252
- * Spawned from a bucket (e.g. Fish)
1253
- *
1254
- */
1255
- Bucket = 'Bucket',
1256
- /**
1257
- * @remarks
1258
- * Spawned due to a chunk being generated.
1259
- *
1260
- */
1261
- ChunkGeneration = 'ChunkGeneration',
1262
- /**
1263
- * @remarks
1264
- * Spawned via the /summon command.
1265
- *
1266
- */
1267
- Command = 'Command',
1268
- /**
1269
- * @remarks
1270
- * Mob converted from another mob (e.g. Villager -> Zombie
1271
- * Villager).
1272
- *
1273
- */
1274
- Conversion = 'Conversion',
1275
- /**
1276
- * @remarks
1277
- * Mob transferred from another dimension.
1278
- *
1279
- */
1280
- DimensionTravel = 'DimensionTravel',
1281
- /**
1282
- * @remarks
1283
- * Spawned via dispenser.
1284
- *
1285
- */
1286
- Dispenser = 'Dispenser',
1287
- /**
1288
- * @remarks
1289
- * Mobs spawned due to some in game event.
1290
- *
1291
- */
1292
- Event = 'Event',
1293
- /**
1294
- * @remarks
1295
- * Jockey spawned with the mob they ride (e.g. Chicken jockey).
1296
- *
1297
- */
1298
- Jockey = 'Jockey',
1299
- /**
1300
- * @remarks
1301
- * Mob loaded in from a saved state.
1302
- *
1303
- */
1304
- Load = 'Load',
1305
- /**
1306
- * @remarks
1307
- * Mobs summoned via other mobs (e.g. Vex).
1308
- *
1309
- */
1310
- MobSummoned = 'MobSummoned',
1311
- /**
1312
- * @remarks
1313
- * Natural Mob Spawning.
1314
- *
1315
- */
1316
- Natural = 'Natural',
1317
- /**
1318
- * @remarks
1319
- * Mobs spawned due to a patrol.
1320
- *
1321
- */
1322
- Patrol = 'Patrol',
1323
- /**
1324
- * @remarks
1325
- * Mobs spawned from the reinforcement attribute (e.g.
1326
- * Zombies).
1327
- *
1328
- */
1329
- Reinforcement = 'Reinforcement',
1330
- /**
1331
- * @remarks
1332
- * Spawned from a spawn egg.
1333
- *
1334
- */
1335
- SpawnEgg = 'SpawnEgg',
1336
- /**
1337
- * @remarks
1338
- * Spawner spawns.
1339
- *
1340
- */
1341
- Spawner = 'Spawner',
1342
- /**
1343
- * @remarks
1344
- * Mobs generated specifically within some structure (Nether
1345
- * Fortress, Ocean Monument, Witch Hut, etc).
1346
- *
1347
- */
1348
- Structure = 'Structure',
1349
- /**
1350
- * @remarks
1351
- * Mobs spawned from a Trial Spawner.
1352
- *
1353
- */
1354
- TrialSpawner = 'TrialSpawner',
1355
- /**
1356
- * @remarks
1357
- * Some type of player triggered mob spawn (e.g. Skeleton Horse
1358
- * Traps, Wither, Snow Golem).
1359
- *
1360
- */
1361
- Triggered = 'Triggered',
1362
- }
1363
-
1364
1184
  /**
1365
1185
  * The equipment slot of the mob. This includes armor, offhand
1366
1186
  * and mainhand slots.
@@ -2630,10 +2450,10 @@ export enum WeatherType {
2630
2450
  * @beta
2631
2451
  */
2632
2452
  export type BlockComponentTypeMap = {
2633
- fluidContainer: BlockFluidContainerComponent;
2453
+ fluid_container: BlockFluidContainerComponent;
2634
2454
  inventory: BlockInventoryComponent;
2635
2455
  map_color: BlockMapColorComponent;
2636
- 'minecraft:fluidContainer': BlockFluidContainerComponent;
2456
+ 'minecraft:fluid_container': BlockFluidContainerComponent;
2637
2457
  'minecraft:inventory': BlockInventoryComponent;
2638
2458
  'minecraft:map_color': BlockMapColorComponent;
2639
2459
  'minecraft:piston': BlockPistonComponent;
@@ -4149,7 +3969,7 @@ export class BlockFluidContainerComponent extends BlockComponent {
4149
3969
  *
4150
3970
  */
4151
3971
  fluidColor: RGBA;
4152
- static readonly componentId = 'minecraft:fluidContainer';
3972
+ static readonly componentId = 'minecraft:fluid_container';
4153
3973
  /**
4154
3974
  * @remarks
4155
3975
  * Adds a dye to the fluid. The dye color is combined with any
@@ -10985,98 +10805,6 @@ export class EntitySpawnAfterEventSignal {
10985
10805
  unsubscribe(callback: (arg0: EntitySpawnAfterEvent) => void): void;
10986
10806
  }
10987
10807
 
10988
- /**
10989
- * @beta
10990
- * A container for arguments passed to
10991
- * SpawnRulesRegistry.registerEntitySpawnCallback
10992
- *
10993
- * Required Experiments:
10994
- * - Simplified Spawn Rules
10995
- *
10996
- */
10997
- export class EntitySpawnCallbackArgs {
10998
- private constructor();
10999
- /**
11000
- * @remarks
11001
- * The dimension and location of the spawn.
11002
- *
11003
- */
11004
- readonly dimensionLocation: DimensionLocation;
11005
- /**
11006
- * @remarks
11007
- * The reason for the spawn.
11008
- *
11009
- */
11010
- readonly spawnReason: EntitySpawnReason;
11011
- /**
11012
- * @remarks
11013
- * The entity spawn type.
11014
- *
11015
- */
11016
- readonly spawnType: EntitySpawnType;
11017
- }
11018
-
11019
- /**
11020
- * @beta
11021
- * A container for information relating to an entity spawn
11022
- * event.
11023
- *
11024
- * Required Experiments:
11025
- * - Simplified Spawn Rules
11026
- *
11027
- */
11028
- export class EntitySpawnType {
11029
- private constructor();
11030
- /**
11031
- * @remarks
11032
- * The entity Id.
11033
- *
11034
- */
11035
- readonly entityId: string;
11036
- /**
11037
- * @remarks
11038
- * The height of the entity to spawn.
11039
- *
11040
- */
11041
- readonly height: number;
11042
- /**
11043
- * @remarks
11044
- * Is the entity immune to fire.
11045
- *
11046
- */
11047
- readonly isImmuneFire: boolean;
11048
- /**
11049
- * @remarks
11050
- * Is the entity summonable.
11051
- *
11052
- */
11053
- readonly isSummonable: boolean;
11054
- /**
11055
- * @remarks
11056
- * The category determining the type of spawn.
11057
- *
11058
- */
11059
- readonly spawnCategory: EntitySpawnCategory;
11060
- /**
11061
- * @remarks
11062
- * The width of the entity to spawn.
11063
- *
11064
- */
11065
- readonly width: number;
11066
- /**
11067
- * @remarks
11068
- * Helper to get the AABB for the entity at a given location
11069
- *
11070
- */
11071
- getSpawnAABB(position: Vector3): BoundingBox;
11072
- /**
11073
- * @remarks
11074
- * Is the block being spawned on dangerous.
11075
- *
11076
- */
11077
- isBlockDangerous(block: Block): boolean;
11078
- }
11079
-
11080
10808
  /**
11081
10809
  * Defines the entity's ability to carry items. An entity with
11082
10810
  * a higher strength would have higher potential carry capacity
@@ -13905,37 +13633,6 @@ export class MolangVariableMap {
13905
13633
  setVector3(variableName: string, vector: Vector3): void;
13906
13634
  }
13907
13635
 
13908
- /**
13909
- * @beta
13910
- * A container for arguments passed to
13911
- * SpawnRulesRegistry.registerObstructionCallback
13912
- *
13913
- * Required Experiments:
13914
- * - Simplified Spawn Rules
13915
- *
13916
- */
13917
- export class ObstructionCallbackArgs {
13918
- private constructor();
13919
- /**
13920
- * @remarks
13921
- * The dimension of the spawn.
13922
- *
13923
- */
13924
- readonly dimension: Dimension;
13925
- /**
13926
- * @remarks
13927
- * The entity being checked for obstruction.
13928
- *
13929
- */
13930
- readonly entity: Entity;
13931
- /**
13932
- * @remarks
13933
- * The entity spawn type.
13934
- *
13935
- */
13936
- readonly spawnType: EntitySpawnType;
13937
- }
13938
-
13939
13636
  /**
13940
13637
  * Contains information related to changes to a piston
13941
13638
  * expanding or retracting.
@@ -16906,63 +16603,6 @@ export class ShutdownEvent {
16906
16603
  private constructor();
16907
16604
  }
16908
16605
 
16909
- /**
16910
- * @beta
16911
- * Container for spawn rules APIs. Allows for registering
16912
- * callbacks to extend the spawner system.
16913
- *
16914
- * Required Experiments:
16915
- * - Simplified Spawn Rules
16916
- *
16917
- */
16918
- export class SpawnRulesRegistry {
16919
- private constructor();
16920
- /**
16921
- * @remarks
16922
- * Registers an entity spawn callback to the provided key.
16923
- *
16924
- * This function can't be called in read-only mode.
16925
- *
16926
- * This function can be called in early-execution mode.
16927
- *
16928
- * @param id
16929
- * The Id to associate the callback with.
16930
- * @param callback
16931
- * The callback that will be invoked when a spawner tests for
16932
- * the associated predicate key.
16933
- * @throws This function can throw errors.
16934
- *
16935
- * {@link minecraftcommon.InvalidArgumentError}
16936
- *
16937
- * {@link NamespaceNameError}
16938
- *
16939
- * {@link SpawnRulesInvalidRegistryError}
16940
- */
16941
- registerEntitySpawnCallback(id: string, callback: (arg0: EntitySpawnCallbackArgs) => boolean): void;
16942
- /**
16943
- * @remarks
16944
- * Registers an obstruction callback to the provided key.
16945
- *
16946
- * This function can't be called in read-only mode.
16947
- *
16948
- * This function can be called in early-execution mode.
16949
- *
16950
- * @param id
16951
- * The Id to associate the callback with.
16952
- * @param callback
16953
- * The callback that will be invoked when a spawner tests for
16954
- * the associated predicate key.
16955
- * @throws This function can throw errors.
16956
- *
16957
- * {@link minecraftcommon.InvalidArgumentError}
16958
- *
16959
- * {@link NamespaceNameError}
16960
- *
16961
- * {@link SpawnRulesInvalidRegistryError}
16962
- */
16963
- registerObstructionCallback(id: string, callback: (arg0: ObstructionCallbackArgs) => boolean): void;
16964
- }
16965
-
16966
16606
  /**
16967
16607
  * @beta
16968
16608
  */
@@ -16993,18 +16633,6 @@ export class StartupEvent {
16993
16633
  private constructor();
16994
16634
  readonly blockComponentRegistry: BlockComponentRegistry;
16995
16635
  readonly itemComponentRegistry: ItemComponentRegistry;
16996
- /**
16997
- * @remarks
16998
- * This function can't be called in read-only mode.
16999
- *
17000
- * This function can be called in early-execution mode.
17001
- *
17002
- *
17003
- * Required Experiments:
17004
- * - Simplified Spawn Rules
17005
- *
17006
- */
17007
- getSpawnRulesRegistry(): SpawnRulesRegistry;
17008
16636
  }
17009
16637
 
17010
16638
  /**
@@ -18153,6 +17781,15 @@ export class World {
18153
17781
  * not fixed and will be determined by surrounding blocks.
18154
17782
  */
18155
17783
  getDefaultSpawnLocation(): Vector3;
17784
+ /**
17785
+ * @beta
17786
+ * @remarks
17787
+ * Gets the difficulty from the world.
17788
+ *
17789
+ * @returns
17790
+ * Returns the world difficulty.
17791
+ */
17792
+ getDifficulty(): Difficulty;
18156
17793
  /**
18157
17794
  * @remarks
18158
17795
  * Returns a dimension object.
@@ -18396,6 +18033,17 @@ export class World {
18396
18033
  * {@link LocationOutOfWorldBoundariesError}
18397
18034
  */
18398
18035
  setDefaultSpawnLocation(spawnLocation: Vector3): void;
18036
+ /**
18037
+ * @beta
18038
+ * @remarks
18039
+ * Sets the worlds difficulty.
18040
+ *
18041
+ * This function can't be called in read-only mode.
18042
+ *
18043
+ * @param difficulty
18044
+ * The difficulty we want to set the world to.
18045
+ */
18046
+ setDifficulty(difficulty: Difficulty): void;
18399
18047
  /**
18400
18048
  * @beta
18401
18049
  * @remarks
@@ -21235,16 +20883,6 @@ export class PlaceJigsawError extends Error {
21235
20883
  private constructor();
21236
20884
  }
21237
20885
 
21238
- /**
21239
- * @beta
21240
- * Thrown when the SpawnRulesRegistry is accessed outside of
21241
- * ModuleStartupEvent.
21242
- */
21243
- // @ts-ignore Class inheritance allowed for native defined classes
21244
- export class SpawnRulesInvalidRegistryError extends Error {
21245
- private constructor();
21246
- }
21247
-
21248
20886
  /**
21249
20887
  * Error thrown when the specified area contains one or more
21250
20888
  * unloaded chunks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "2.0.0-beta.1.21.70-preview.20",
3
+ "version": "2.0.0-beta.1.21.70-preview.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -16,7 +16,7 @@
16
16
  "@minecraft/common": "^1.1.0"
17
17
  },
18
18
  "peerDependencies": {
19
- "@minecraft/vanilla-data": ">=2.0.0-beta.1.21.70-preview.20"
19
+ "@minecraft/vanilla-data": ">=1.20.70"
20
20
  },
21
21
  "license": "MIT"
22
22
  }