Hook for MobEntity.getPreferredEquipmentSlot
Juuxel opened this issue ยท 4 comments
Currently there's no way to provide a custom preferred equipment slot for non-armor items, such as blocks that can be worn as helmets.
I think I did have a mixin for this in the past on hooking into that, but I didn't get it in a condition to be exposeable via api.
This would be pretty easy to do with a callback design like these:
Option A: Registered with an Item
instance
public interface EquipmentSlotProvider {
EquipmentSlot getPreferredEquipmentSlot(ItemStack stack);
}
Option B: Global callback (this one seems a bit weird honestly)
public interface EquipmentSlotCallback {
// present optional = use that value, empty optional = continue
Optional<EquipmentSlot> getPreferredEquipmentSlot(ItemStack stack);
}
Maybe a FabricItemSettings
could have that provider as a setting? Of course this doesn't let you manipulate vanilla items though.