Class EntityRenderersEvent.CreateSkullModels

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

public static class EntityRenderersEvent.CreateSkullModels extends EntityRenderersEvent
Fired for registering additional skull models.

This event is not cancellable, and does not have a result.

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

  • Field Details

    • skullModels

      private final Map<net.minecraft.world.level.block.SkullBlock.Type,Function<net.minecraft.client.model.geom.EntityModelSet,net.minecraft.client.model.SkullModelBase>> skullModels
  • Constructor Details

    • CreateSkullModels

      @Internal public CreateSkullModels(Map<net.minecraft.world.level.block.SkullBlock.Type,Function<net.minecraft.client.model.geom.EntityModelSet,net.minecraft.client.model.SkullModelBase>> skullModels)
  • Method Details

    • registerSkullModel

      public void registerSkullModel(net.minecraft.world.level.block.SkullBlock.Type type, net.minecraft.client.model.geom.ModelLayerLocation layerLocation)
      Registers a SkullModel for a skull block with the given SkullBlock.Type.
      Parameters:
      type - a unique skull type; an exception will be thrown if multiple mods register models for the same type or a mod tries to register a model for a vanilla type
      layerLocation - the key that identifies the LayerDefinition used by the model
    • registerSkullModel

      public void registerSkullModel(net.minecraft.world.level.block.SkullBlock.Type type, net.minecraft.client.model.geom.ModelLayerLocation layerLocation, Function<net.minecraft.client.model.geom.ModelPart,net.minecraft.client.model.SkullModelBase> factory)
      Registers the entity model for a skull block with the given SkullBlock.Type.
      Parameters:
      type - a unique skull type; an exception will be thrown if multiple mods register models for the same type or a mod tries to register a model for a vanilla type
      layerLocation - the key that identifies the LayerDefinition used by the model
      factory - the factory to create the skull model instance, taking in the root ModelPart and returning the model.
    • registerSkullModel

      public void registerSkullModel(net.minecraft.world.level.block.SkullBlock.Type type, Function<net.minecraft.client.model.geom.EntityModelSet,net.minecraft.client.model.SkullModelBase> factory)
      Registers the entity model for a skull block with the given SkullBlock.Type.
      Parameters:
      type - a unique skull type; an exception will be thrown if multiple mods register models for the same type or a mod tries to register a model for a vanilla type
      factory - the factory to create the skull model instance. A typical implementation will simply bake a model using EntityModelSet.bakeLayer(ModelLayerLocation) and pass it to the constructor for SkullModel