Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import net.minecraftforge.fml.common.gameevent.TickEvent

object AutoArmor : Module(
name = "AutoArmor",
description = "Automatically equips armour",
description = "Automatically equips armor",
category = Category.COMBAT,
modulePriority = 500
) {
private val allowElytra by setting("Allow Elytra", false, description = "If activated it will not replace an equipped elytra with a chestplate")

init {
safeListener<TickEvent.ClientTickEvent> {
// store slots and values of best armor pieces, initialize with currently equipped armor
Expand All @@ -37,8 +39,8 @@ object AutoArmor : Module(

val armorType = item.armorType.index

// Skip if item is chestplate and we have elytra equipped
if (armorType == 2 && player.inventory.armorInventory[2].item == Items.ELYTRA) continue
// Skip if allowElytra is activated, item is chestplate, and we have elytra equipped
if (allowElytra && armorType == 2 && player.inventory.armorInventory[2].item == Items.ELYTRA) continue
val armorValue = getArmorValue(itemStack)

if (armorValue > bestArmors[armorType].second) {
Expand Down