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.
Static Methods
A powerful method to override the armor of a mob depending on which block they are standing on.
Return Type: void
Parameter | Type | Description | Optional | DefaultValue |
---|---|---|---|---|
Parameter type | Type EntityType | Description The EntityType<T> to Override | Optional false | DefaultValue |
Parameter map | Type IItemStack[EquipmentSlot] | Description The Associative Array, as EquipmentSlot[IItemStack] that will be used as the entities armor. If an EquipmentSlot is empty, it won’t override what’s there. | Optional false | DefaultValue |
Parameter state | Type BlockState | Description The BlockState to override the armor if the aforementioned EntityType<T> spawns on top of. | Optional true | DefaultValue |
Constructors
Parameter | Type | Description |
---|---|---|
Parameter name | Type string | Description The display name of the group to create. |
Casters
Result type | Is Implicit |
---|---|
Result type string | Is Implicit true |
Methods
Will only work on Forge. Gates the ArmorGroup from being given unless there’s a player nearby with ALL of the stages in the Group.
Returns: The ArmorGroup itself.
Return Type: ArmorGroup
Parameter | Type | Description |
---|---|---|
Parameter stages | Type string[] | Description The list of stages necessary for the ArmorGroup to be given. |
Returns the AssociativeArray that corresponds to the internal EquipmentSlot[IItemStack]
Returns: The internal map as EquipmentSlot[IItemStack]
Return Type: ItemStack[EquipmentSlot]
Gets the name of the ArmorGroup
Returns: The name of the group as a string.
Return Type: string
Gets the ItemStack the group will give in a selected slot. Can be null. Would be the same as using ArmorGroup#getMap() and passing the EquipmentSlot as a key.
Returns: The ItemStack at the selected location. Can be null.
Return Type: ItemStack
Parameter | Type | Description |
---|---|---|
Parameter slot | Type EquipmentSlot | Description No Description Provided |
Returns the names of the stages required to unlock this group. Will be empty on Fabric.
Returns: The list of stages
Return Type: stdlib.List<string>
Gets the weight of the ArmorGroup
Returns: The weight of the group as a double.
Return Type: double
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
Parameter | Type | Description |
---|---|---|
Parameter slot | Type EquipmentSlot | Description The slot at which the ItemStack will be placed |
Parameter stack | Type IItemStack | Description The IItemStack to give to the Entity. |
Registers the ArmorGroup.
Return Type: void
Parameter | Type | Description |
---|---|---|
Parameter type | Type EntityType | Description The 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
Parameter | Type | Description |
---|---|---|
Parameter weight | Type double | Description The weight at which the ArmorGroup will spawn on the entity type. |