@minecraft/server 1.5.0-rc.1.20.30-preview.21 → 1.5.0-rc.1.20.30-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 +88 -4
  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.6.0-internal.1.20.30-preview.21"
19
+ * "version": "1.6.0-internal.1.20.30-preview.22"
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,14 @@ 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
1265
  * @throws This property can throw when used.
1209
1266
  */
1210
1267
  readonly scoreboardIdentity?: ScoreboardIdentity;
1211
1268
  /**
1212
1269
  * @remarks
1213
- * Unique identifier of the type of the entity - for example,
1270
+ * Identifier of the type of the entity - for example,
1214
1271
  * 'minecraft:skeleton'. This property is accessible even if
1215
1272
  * {@link Entity.isValid} is false.
1216
1273
  *
@@ -1982,6 +2039,29 @@ export class EntityDieAfterEventSignal {
1982
2039
  unsubscribe(callback: (arg: EntityDieAfterEvent) => void): void;
1983
2040
  }
1984
2041
 
2042
+ /**
2043
+ * @beta
2044
+ */
2045
+ // @ts-ignore Class inheritance allowed for native defined classes
2046
+ export class EntityEquippableComponent extends EntityComponent {
2047
+ private constructor();
2048
+ static readonly componentId = 'minecraft:equippable';
2049
+ /**
2050
+ * @remarks
2051
+ * This function can't be called in read-only mode.
2052
+ *
2053
+ * @throws This function can throw errors.
2054
+ */
2055
+ getEquipment(equipmentSlot: EquipmentSlot): ItemStack | undefined;
2056
+ /**
2057
+ * @remarks
2058
+ * This function can't be called in read-only mode.
2059
+ *
2060
+ * @throws This function can throw errors.
2061
+ */
2062
+ setEquipment(equipmentSlot: EquipmentSlot, itemStack?: ItemStack): boolean;
2063
+ }
2064
+
1985
2065
  /**
1986
2066
  * @beta
1987
2067
  * When added, this component signifies that this entity
@@ -4332,12 +4412,16 @@ export class Scoreboard {
4332
4412
  *
4333
4413
  * This function can't be called in read-only mode.
4334
4414
  *
4415
+ * @returns
4416
+ * Returns the previous `ScoreboardObjective` set at the
4417
+ * display slot, if no objective was previously set it returns
4418
+ * `undefined`.
4335
4419
  * @throws This function can throw errors.
4336
4420
  */
4337
4421
  setObjectiveAtDisplaySlot(
4338
4422
  displaySlotId: DisplaySlotId,
4339
4423
  objectiveDisplaySetting: ScoreboardObjectiveDisplayOptions,
4340
- ): ScoreboardObjective;
4424
+ ): ScoreboardObjective | undefined;
4341
4425
  }
4342
4426
 
4343
4427
  /**
@@ -4371,7 +4455,7 @@ export class ScoreboardIdentity {
4371
4455
  *
4372
4456
  * @throws This function can throw errors.
4373
4457
  */
4374
- getEntity(): Entity;
4458
+ getEntity(): Entity | undefined;
4375
4459
  isValid(): boolean;
4376
4460
  }
4377
4461
 
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.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {