@FunctionalInterface @Environment(value=CLIENT) public interface LivingEntityFeatureRendererRegistrationCallback
feature renderers
for a living entity renderer
are registered.
Feature renderers are typically used for rendering additional objects on an entity, such as armor, an elytra or Deadmau5's ears
.
This callback lets developers add additional feature renderers for use in entity rendering.
Listeners should filter out the specific entity renderer they want to hook into, usually through instanceof
checks or filtering by entity type.
Once listeners find a suitable entity renderer, they should register their feature renderer via the registration helper.
For example, to register a feature renderer for a player model, the example below may used:
LivingEntityFeatureRendererRegistrationCallback.EVENT.register((entityType, entityRenderer, registrationHelper) -> { if (entityRenderer instanceof PlayerEntityModel) { registrationHelper.register(new MyFeatureRenderer((PlayerEntityModel) entityRenderer)); } });
Modifier and Type | Interface and Description |
---|---|
static interface |
LivingEntityFeatureRendererRegistrationCallback.RegistrationHelper
A delegate object used to help register feature renderers for an entity renderer.
|
Modifier and Type | Field and Description |
---|---|
static Event<LivingEntityFeatureRendererRegistrationCallback> |
EVENT |
Modifier and Type | Method and Description |
---|---|
void |
registerRenderers(net.minecraft.entity.EntityType<? extends net.minecraft.entity.LivingEntity> entityType,
net.minecraft.client.render.entity.LivingEntityRenderer<?,?> entityRenderer,
LivingEntityFeatureRendererRegistrationCallback.RegistrationHelper registrationHelper)
Called when feature renderers may be registered.
|
static final Event<LivingEntityFeatureRendererRegistrationCallback> EVENT
void registerRenderers(net.minecraft.entity.EntityType<? extends net.minecraft.entity.LivingEntity> entityType, net.minecraft.client.render.entity.LivingEntityRenderer<?,?> entityRenderer, LivingEntityFeatureRendererRegistrationCallback.RegistrationHelper registrationHelper)
entityType
- the entity type of the rendererentityRenderer
- the entity renderer