@FunctionalInterface public interface EquipmentSlotProvider
Equipment slot providers can be set with FabricItemSettings.equipmentSlot(EquipmentSlotProvider)
.
Note that items extending ArmorItem
don't need to use this
as there's ArmorItem.getSlotType()
.
Modifier and Type | Method and Description |
---|---|
net.minecraft.entity.EquipmentSlot |
getPreferredEquipmentSlot(net.minecraft.item.ItemStack stack)
Gets the preferred equipment slot for an item stack.
|
net.minecraft.entity.EquipmentSlot getPreferredEquipmentSlot(net.minecraft.item.ItemStack stack)
If there is no preferred armor equipment slot for the stack,
EquipmentSlot.MAINHAND
can be returned.
stack
- the item stack