The Cosmetics Rendering API allows mod developers to control whether Essential cosmetics are hidden when custom armor items are equipped.
Overview
By default, Essential hides cosmetics on body parts when armor is equipped. This prevents visual conflicts between armor models and cosmetic items like hats, wings, or clothing.
However, some custom armor items (like decorative accessories) may want cosmetics to remain visible. The RenderCosmetic interface provides this capability.
How it works
When armor is equipped:
- Essential checks if the item implements
RenderCosmetic
- If it does, cosmetics continue to render on that body part
- If it doesn’t, cosmetics are hidden as normal
Implementation
Simply implement the RenderCosmetic marker interface on your armor item:
import gg.essential.api.cosmetics.RenderCosmetic
import net.minecraft.item.ItemArmor
class DecorativeHat : ItemArmor(
material,
renderIndex,
armorType
), RenderCosmetic {
// Your item implementation
}
import gg.essential.api.cosmetics.RenderCosmetic;
import net.minecraft.item.ItemArmor;
public class DecorativeHat extends ItemArmor implements RenderCosmetic {
public DecorativeHat(ArmorMaterial material, int renderIndex, int armorType) {
super(material, renderIndex, armorType);
}
// Your item implementation
}
Use cases
Decorative items
Items that are purely cosmetic and don’t have bulky models:
class PartyHat : ItemArmor(
DECORATIVE_MATERIAL,
0,
EntityEquipmentSlot.HEAD
), RenderCosmetic {
// Small decorative hat that won't conflict with cosmetics
}
Transparent armor
Armor with transparent or minimal models:
class GlassArmor : ItemArmor(
GLASS_MATERIAL,
0,
armorType
), RenderCosmetic {
// Transparent armor that allows cosmetics to show through
}
Accessory items
Items worn as accessories rather than protective gear:
class BraceletItem : ItemArmor(
ACCESSORY_MATERIAL,
0,
EntityEquipmentSlot.FEET // Using feet slot for accessories
), RenderCosmetic {
// Bracelet that doesn't interfere with cosmetics
}
Body part reference
Essential hides cosmetics on specific body parts based on armor slot:
| Armor Slot | Body Parts Hidden |
|---|
| HEAD | Head, face cosmetics |
| CHEST | Torso, back cosmetics (wings, capes) |
| LEGS | Leg cosmetics |
| FEET | Foot cosmetics |
Implementing RenderCosmetic prevents hiding cosmetics for that slot.
Complete example
import gg.essential.api.cosmetics.RenderCosmetic
import net.minecraft.creativetab.CreativeTabs
import net.minecraft.inventory.EntityEquipmentSlot
import net.minecraft.item.ItemArmor
/**
* A decorative crown that allows Essential cosmetics to remain visible.
*/
class CrownItem : ItemArmor(
ArmorMaterial.GOLD,
0,
EntityEquipmentSlot.HEAD
), RenderCosmetic {
init {
setCreativeTab(CreativeTabs.COMBAT)
setUnlocalizedName("crown")
setRegistryName("crown")
}
override fun getArmorTexture(
stack: ItemStack,
entity: Entity,
slot: EntityEquipmentSlot,
type: String?
): String {
return "mymod:textures/models/armor/crown.png"
}
}
import gg.essential.api.cosmetics.RenderCosmetic;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.Entity;
/**
* A decorative crown that allows Essential cosmetics to remain visible.
*/
public class CrownItem extends ItemArmor implements RenderCosmetic {
public CrownItem() {
super(ArmorMaterial.GOLD, 0, EntityEquipmentSlot.HEAD);
setCreativeTab(CreativeTabs.COMBAT);
setUnlocalizedName("crown");
setRegistryName("crown");
}
@Override
public String getArmorTexture(
ItemStack stack,
Entity entity,
EntityEquipmentSlot slot,
String type
) {
return "mymod:textures/models/armor/crown.png";
}
}
Testing
- Equip your custom armor item
- Verify Essential cosmetics remain visible
- Test with different cosmetic types (hats, wings, etc.)
- Ensure there are no visual conflicts
Best practices
Only implement RenderCosmetic on items with minimal or non-conflicting models. Bulky armor should hide cosmetics to prevent visual glitches.
This interface only affects Essential’s cosmetic system. Other rendering behavior is unchanged.
Test your armor with various Essential cosmetics to ensure there are no clipping or z-fighting issues.
Users can override this behavior in Essential settings with hideCosmeticsWhenServerOverridesSkin if a server changes their skin.