Class EntityRenderersEvent.AddLayers

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.EntityRenderersEvent
net.neoforged.neoforge.client.event.EntityRenderersEvent.AddLayers
All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent
Enclosing class:
EntityRenderersEvent

public static class EntityRenderersEvent.AddLayers extends EntityRenderersEvent
Fired for registering entity renderer layers at the appropriate time, after the entity and player renderers maps have been created.

This event is not cancellable, and does not

invalid reference
have a result
.

This event is fired on the mod-specific event bus, only on the logical client.

  • Field Details

  • Constructor Details

  • Method Details

    • getSkins

      public Set<PlayerSkin.Model> getSkins()
      Returns the set of player skin names which have a renderer.

      Minecraft provides two default skin names: default for the regular player model and slim for the slim player model.

      Returns:
      the set of player skin names which have a renderer
    • getSkin

      @Nullable public <R extends EntityRenderer<? extends Player>> R getSkin(PlayerSkin.Model skinModel)
      Returns a player skin renderer for the given skin name.
      Type Parameters:
      R - the type of the skin renderer, usually PlayerRenderer
      Parameters:
      skinModel - the skin model to get the renderer for
      Returns:
      the skin renderer, or null if no renderer is registered for that skin name
      See Also:
    • getEntityTypes

      public Set<EntityType<?>> getEntityTypes()
      Returns the set of entity types which have a renderer.
      Returns:
      the set of entity types which have a renderer
    • getRenderer

      @Nullable public <T extends Entity, R extends EntityRenderer<T>> R getRenderer(EntityType<? extends T> entityType)
      Returns an entity renderer for the given entity type. Note that the returned renderer may not be a LivingEntityRenderer.
      Type Parameters:
      T - the type of entity the renderer is for
      R - the type of the renderer
      Parameters:
      entityType - the entity type to return a renderer for
      Returns:
      the renderer, or null if no renderer is registered for that entity type
    • getEntityModels

      public EntityModelSet getEntityModels()
      Returns the set of entity models.
      Returns:
      the set of entity models
    • getContext

      public EntityRendererProvider.Context getContext()
      Returns the context for the entity renderer provider.
      Returns:
      the context for the entity renderer provider