mojira.dev
MC-267944

Some armor piece enchantments don't work on non-default types of armor

With the new enchantment item tags it is possible to e.g. add #chest_armor, #foot_armor, and #leg_armor to #enchantable/head_armor which makes Aqua Affinity and Respiration usable on all armor pieces which works fine in-game.

Doing something equivalent for #enchantable/leg_armor and #enchantable/foot_armor does however not make Frost Walker, Soul Speed and Swift Sneak work in-game, meaning although the enchantments can be applied to e.g. helmets, they will not have any effect.
The Depth Strider enchantment however does work as expected when made compatible with armor pieces other than boots.

This comes from Enchantment#slots being set to Enchantments#ARMOR_SLOTS for Aqua Affinity, Respiration and Depth Strider, while Frost Walker, Soul Speed and Swift Sneak have this field set to EquipmentSlot#FEET or EquipmentSlot#LEGS respectively.

Setting Enchantment#slots to Enchantments#ARMOR_SLOTS would therefore be awesome for Frost Walker, Soul Speed and Swift Sneak. With default enchantment item tag configurations it will not change any vanilla behavior, but will allow data packs to make these three enchantments usable on all armor pieces just like already is the case for Aqua Affinity, Respiration and Depth Strider.

Also LivingEntity::tryAddSoulSpeed would need to be adjusted if Soul Speed slots are changed, as it specifically checks for the equipped boots item when damaging the item from walking around.

Linked issues

Comments 4

This is kinda similar to MC-137495, the only difference here (which is why I believe this to be valid) is that whether they apply to all armor or only a specific slot for the "slot exclusive" ones is inconsistent, either they should all not function if on the incorrect piece, or all should function, not 50/50.

You do not need the tags to test this BTW, those only control what you may get, not if they function. You can just use a give command with the corresponding enchantments:

/give @s diamond_chestplate{Enchantments:[{id:"aqua_affinity",level:1},{id:"respiration",level:1},{id:"depth_strider",level:1},{id:"frost_walker",level:1},{id:"soul_speed",level:1},{id:"swift_sneak",level:1}]}

Equip the chestplate and notice how aqua affinity, respiration and depth strider properly apply, while frost walker, soul speed and swift sneak do not, despite none of them belonging to chestplates.

If going for the "all should function" approach, it may be wise to remove the specific slot option values for the enchantment slots enum.

Not exclusive to the snapshot, also affects 1.20.4.

This is a feature request. Please leave feedback on feedback.minecraft.net

It's more reporting an inconsistency than a feature request.

I am seeking a review of this bug report. As pointed out by dhranios, it's more of an inconsistency rather than a feature request. It's also worth mentioning that some of these enchantments even affect horse armor, and issues like MC-268934 are deemed valid. The concern here is that armor enchantments introduced before version 1.9 apply to any item in any armor slot, while those introduced in version 1.9 or later only affect their designated item and slot. Older enchantments even work on elytras, pumpkins, and all types of heads.

Fusseel

(Unassigned)

Confirmed

Enchantments

1.20.4, 24w03a

Retrieved