@minecraft/server 1.5.0-rc.1.20.30-preview.21 → 1.5.0-rc.1.20.30-preview.24

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 (3) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +110 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,4 +6,4 @@ Contains many types related to manipulating a Minecraft world, including entitie
6
6
 
7
7
  See full documentation for this module here:
8
8
 
9
- https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/@minecraft/server/@minecraft/server
9
+ https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/minecraft-server
package/index.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  * ```json
17
17
  * {
18
18
  * "module_name": "@minecraft/server",
19
- * "version": "1.6.0-internal.1.20.30-preview.21"
19
+ * "version": "1.6.0-internal.1.20.30-preview.24"
20
20
  * }
21
21
  * ```
22
22
  *
@@ -116,6 +116,62 @@ export enum EntityDamageCause {
116
116
  wither = 'wither',
117
117
  }
118
118
 
119
+ /**
120
+ * @beta
121
+ * The equipment slot of the mob. This includes armor, offhand
122
+ * and mainhand slots.
123
+ */
124
+ export enum EquipmentSlot {
125
+ /**
126
+ * @beta
127
+ * @remarks
128
+ * The chest slot. This slot is used to hold items such as
129
+ * Chestplate or Elytra.
130
+ *
131
+ */
132
+ Chest = 'Chest',
133
+ /**
134
+ * @beta
135
+ * @remarks
136
+ * The feet slot. This slot is used to hold items such as
137
+ * Boots.
138
+ *
139
+ */
140
+ Feet = 'Feet',
141
+ /**
142
+ * @beta
143
+ * @remarks
144
+ * The head slot. This slot is used to hold items such as
145
+ * Helmets or Carved Pumpkins.
146
+ *
147
+ */
148
+ Head = 'Head',
149
+ /**
150
+ * @beta
151
+ * @remarks
152
+ * The legs slot. This slot is used to hold items such as
153
+ * Leggings.
154
+ *
155
+ */
156
+ Legs = 'Legs',
157
+ /**
158
+ * @beta
159
+ * @remarks
160
+ * The mainhand slot. For players, the mainhand slot refers to
161
+ * the currently active hotbar slot.
162
+ *
163
+ */
164
+ Mainhand = 'Mainhand',
165
+ /**
166
+ * @beta
167
+ * @remarks
168
+ * The offhand slot. This slot is used to hold items such as
169
+ * shields and maps.
170
+ *
171
+ */
172
+ Offhand = 'Offhand',
173
+ }
174
+
119
175
  /**
120
176
  * @beta
121
177
  * Represents a game mode for the current world experience.
@@ -1204,13 +1260,13 @@ export class Entity {
1204
1260
  * @beta
1205
1261
  * @remarks
1206
1262
  * Returns a scoreboard identity that represents this entity.
1263
+ * Will remain valid when the entity is killed.
1207
1264
  *
1208
- * @throws This property can throw when used.
1209
1265
  */
1210
1266
  readonly scoreboardIdentity?: ScoreboardIdentity;
1211
1267
  /**
1212
1268
  * @remarks
1213
- * Unique identifier of the type of the entity - for example,
1269
+ * Identifier of the type of the entity - for example,
1214
1270
  * 'minecraft:skeleton'. This property is accessible even if
1215
1271
  * {@link Entity.isValid} is false.
1216
1272
  *
@@ -1982,6 +2038,44 @@ export class EntityDieAfterEventSignal {
1982
2038
  unsubscribe(callback: (arg: EntityDieAfterEvent) => void): void;
1983
2039
  }
1984
2040
 
2041
+ /**
2042
+ * @beta
2043
+ * Provides access to a mob's equipment slots. This component
2044
+ * exists for all mob entities.
2045
+ */
2046
+ // @ts-ignore Class inheritance allowed for native defined classes
2047
+ export class EntityEquippableComponent extends EntityComponent {
2048
+ private constructor();
2049
+ static readonly componentId = 'minecraft:equippable';
2050
+ /**
2051
+ * @remarks
2052
+ * Gets the equipped item for the given EquipmentSlot.
2053
+ *
2054
+ * This function can't be called in read-only mode.
2055
+ *
2056
+ * @param equipmentSlot
2057
+ * The equipment slot. e.g. "head", "chest", "offhand"
2058
+ * @returns
2059
+ * Returns the item equipped to the given EquipmentSlot. If
2060
+ * empty, returns undefined.
2061
+ * @throws This function can throw errors.
2062
+ */
2063
+ getEquipment(equipmentSlot: EquipmentSlot): ItemStack | undefined;
2064
+ /**
2065
+ * @remarks
2066
+ * Replaces the item in the given EquipmentSlot.
2067
+ *
2068
+ * This function can't be called in read-only mode.
2069
+ *
2070
+ * @param equipmentSlot
2071
+ * The equipment slot. e.g. "head", "chest", "offhand".
2072
+ * @param itemStack
2073
+ * The item to equip. If undefined, clears the slot.
2074
+ * @throws This function can throw errors.
2075
+ */
2076
+ setEquipment(equipmentSlot: EquipmentSlot, itemStack?: ItemStack): boolean;
2077
+ }
2078
+
1985
2079
  /**
1986
2080
  * @beta
1987
2081
  * When added, this component signifies that this entity
@@ -4332,12 +4426,16 @@ export class Scoreboard {
4332
4426
  *
4333
4427
  * This function can't be called in read-only mode.
4334
4428
  *
4429
+ * @returns
4430
+ * Returns the previous `ScoreboardObjective` set at the
4431
+ * display slot, if no objective was previously set it returns
4432
+ * `undefined`.
4335
4433
  * @throws This function can throw errors.
4336
4434
  */
4337
4435
  setObjectiveAtDisplaySlot(
4338
4436
  displaySlotId: DisplaySlotId,
4339
4437
  objectiveDisplaySetting: ScoreboardObjectiveDisplayOptions,
4340
- ): ScoreboardObjective;
4438
+ ): ScoreboardObjective | undefined;
4341
4439
  }
4342
4440
 
4343
4441
  /**
@@ -4371,7 +4469,7 @@ export class ScoreboardIdentity {
4371
4469
  *
4372
4470
  * @throws This function can throw errors.
4373
4471
  */
4374
- getEntity(): Entity;
4472
+ getEntity(): Entity | undefined;
4375
4473
  isValid(): boolean;
4376
4474
  }
4377
4475
 
@@ -5920,6 +6018,13 @@ export interface RawMessage {
5920
6018
  *
5921
6019
  */
5922
6020
  translate?: string;
6021
+ /**
6022
+ * @remarks
6023
+ * Arguments for the translation token. Can be either an array
6024
+ * of strings or RawMessage containing an array of raw text
6025
+ * objects.
6026
+ *
6027
+ */
5923
6028
  with?: string[] | RawMessage;
5924
6029
  }
5925
6030
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.5.0-rc.1.20.30-preview.21",
3
+ "version": "1.5.0-rc.1.20.30-preview.24",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {