ArmorGroup
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import mods.armoreablemobs.ArmorGroup;Static Methods
A powerful method to override the armor of a mob depending on which block they are standing on.
// ArmorGroup.overrideExistingArmor(type as EntityType<Entity>, map as IItemStack[EquipmentSlot], state as BlockState)
ArmorGroup.overrideExistingArmor(<entitytype:minecraft:zombie>, {<constant:minecraft:equipmentslot:chest> : <item:minecraft:netherite_chestplate>, <constant:minecraft:equipmentslot:mainhand> : <item:minecraft:netherite_sword>}, <blockstate:minecraft:sand>);| Parameter | Type | Description | 
|---|---|---|
| Parametertype | TypeEntityType<Entity> | DescriptionThe EntityType<T> to Override | 
| Parametermap | TypeIItemStack[EquipmentSlot] | DescriptionThe Associative Array, as EquipmentSlot[IItemStack]that will be used as the entities armor. If anEquipmentSlot is empty, it won’t override what’s there. | 
| Parameterstate | TypeBlockState | DescriptionThe BlockState to override the armor if the aforementioned EntityType<T> spawns on top of. | 
Constructors
new ArmorGroup(name as string) as ArmorGroup| Parameter | Type | Description | 
|---|---|---|
| Parametername | Typestring | DescriptionThe display name of the group to create. | 
Casters
| Result Type | Is Implicit | 
|---|---|
| Result Typestring | Is Implicittrue | 
Methods
Returns the AssociativeArray that corresponds to the internal EquipmentSlot[IItemStack]
Returns: The internal map as EquipmentSlot[IItemStack]
Return Type: ItemStack[EquipmentSlot]
// ArmorGroup.getEquipment() as ItemStack[EquipmentSlot]
myArmorGroup.getEquipment();Gets the name of the ArmorGroup
Returns: The name of the group as a string.
Return Type: string
// ArmorGroup.getName() as string
myArmorGroup.getName();Gets the ItemStack the group will give in a selected slot. Can be null. Would be the same as using ArmorGroup#getEquipment() and passing the EquipmentSlot as a key.
Returns: The ItemStack at the selected location. Can be null.
Return Type: ItemStack
// ArmorGroup.getStackinSlot(slot as EquipmentSlot) as ItemStack
myArmorGroup.getStackinSlot(<constant:minecraft:equipmentslot:head>);| Parameter | Type | 
|---|---|
| Parameterslot | TypeEquipmentSlot | 
Gets the weight of the ArmorGroup
Returns: The weight of the group as a double.
Return Type: double
// ArmorGroup.getWeight() as double
myArmorGroup.getWeight();Links a slot to the ItemStack the entity will get when spawning. Accepts all EquipmentSlot types.
Returns: The ArmorGroup that has been modified.
Return Type: ArmorGroup
// ArmorGroup.inSlot(slot as EquipmentSlot, stack as IItemStack) as ArmorGroup
myArmorGroup.inSlot(<constant:minecraft:equipmentslot:feet>, <item:minecraft:iron_boots>);| Parameter | Type | Description | 
|---|---|---|
| Parameterslot | TypeEquipmentSlot | DescriptionThe slot at which the ItemStack will be placed | 
| Parameterstack | TypeIItemStack | DescriptionThe IItemStack to give to the Entity. | 
Registers the ArmorGroup.
// ArmorGroup.register(type as EntityType<Entity>)
myArmorGroup.register(<entitytype:minecraft:zombie>);| Parameter | Type | Description | 
|---|---|---|
| Parametertype | TypeEntityType<Entity> | DescriptionThe entity at which the ArmorGroup will be applied on spawn. | 
Sets the weight at which the armor group can spawn. The chance a group has to spawn on an entity is determined using a pseudo random number and the total weight of ArmorGroups that entity can have.
Returns: The ArmorGroup that has been modified.
Return Type: ArmorGroup
// ArmorGroup.setWeight(weight as double) as ArmorGroup
myArmorGroup.setWeight(3.0);| Parameter | Type | Description | 
|---|---|---|
| Parameterweight | Typedouble | DescriptionThe weight at which the ArmorGroup will spawn on the entity type. |