Interface LivingEntityFeatureRendererRegistrationCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Called when
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 be used:
LivingEntityFeatureRendererRegistrationCallback.EVENT.register((entityType, entityRenderer, registrationHelper) -> { if (entityRenderer instanceof PlayerEntityModel) { registrationHelper.register(new MyFeatureRenderer((PlayerEntityModel) entityRenderer)); } });
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A delegate object used to help register feature renderers for an entity renderer. -
Field Summary
Modifier and TypeFieldDescriptionstatic final Event<LivingEntityFeatureRendererRegistrationCallback>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
registerRenderers
(EntityType<? extends LivingEntity> entityType, LivingEntityRenderer<?, ?> entityRenderer, LivingEntityFeatureRendererRegistrationCallback.RegistrationHelper registrationHelper, EntityRendererFactory.Context context) Called when feature renderers may be registered.
-
Field Details
-
EVENT
-
-
Method Details
-
registerRenderers
void registerRenderers(EntityType<? extends LivingEntity> entityType, LivingEntityRenderer<?, ?> entityRenderer, LivingEntityFeatureRendererRegistrationCallback.RegistrationHelper registrationHelper, EntityRendererFactory.Context context) Called when feature renderers may be registered.- Parameters:
entityType
- the entity type of the rendererentityRenderer
- the entity renderer
-