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 Details

    • register

      static void register(ArmorRenderer renderer, 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(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, ItemStack stack, Model model, 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(MatrixStack matrices, VertexConsumerProvider vertexConsumers, ItemStack stack, LivingEntity entity, EquipmentSlot slot, int light, BipedEntityModel<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()