Interface ArmorRenderer

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Environment(CLIENT) @FunctionalInterface public interface ArmorRenderer
Armor renderers render worn armor items with custom code. They may be used to render armor with special models or effects.

The renderers are registered with register(ArmorRenderer, ItemConvertible...).

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    register(ArmorRenderer renderer, net.minecraft.item.ItemConvertible... items)
    Registers the armor renderer for the specified items.
    void
    render(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.render.VertexConsumerProvider vertexConsumers, net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity entity, net.minecraft.entity.EquipmentSlot slot, int light, net.minecraft.client.render.entity.model.BipedEntityModel<net.minecraft.entity.LivingEntity> contextModel)
    Renders an armor part.
    static void
    renderPart(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.render.VertexConsumerProvider vertexConsumers, int light, net.minecraft.item.ItemStack stack, net.minecraft.client.model.Model model, net.minecraft.util.Identifier texture)
    Helper method for rendering a specific armor model, comes after setting visibility.
  • Method Details

    • register

      static void register(ArmorRenderer renderer, net.minecraft.item.ItemConvertible... items)
      Registers the armor renderer for the specified items.
      Parameters:
      renderer - the renderer
      items - the items
      Throws:
      IllegalArgumentException - if an item already has a registered armor renderer
      NullPointerException - if either an item or the renderer is null
    • renderPart

      static void renderPart(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.render.VertexConsumerProvider vertexConsumers, int light, net.minecraft.item.ItemStack stack, net.minecraft.client.model.Model model, net.minecraft.util.Identifier texture)
      Helper method for rendering a specific armor model, comes after setting visibility.

      This primarily handles applying glint and the correct RenderLayer

      Parameters:
      matrices - the matrix stack
      vertexConsumers - the vertex consumer provider
      light - packed lightmap coordinates
      stack - the item stack of the armor item
      model - the model to be rendered
      texture - the texture to be applied
    • render

      void render(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.render.VertexConsumerProvider vertexConsumers, net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity entity, net.minecraft.entity.EquipmentSlot slot, int light, net.minecraft.client.render.entity.model.BipedEntityModel<net.minecraft.entity.LivingEntity> contextModel)
      Renders an armor part.
      Parameters:
      matrices - the matrix stack
      vertexConsumers - the vertex consumer provider
      stack - the item stack of the armor item
      entity - the entity wearing the armor item
      slot - the equipment slot in which the armor stack is worn
      light - packed lightmap coordinates
      contextModel - the model provided by FeatureRenderer.getContextModel()