-
Notifications
You must be signed in to change notification settings - Fork 0
Model Part Utilities
SashaKYotoz edited this page Jun 9, 2026
·
1 revision
Adjuvant utility class for ModelPart operations.
Captures the first model part which contains cuboid with exact same part size.
if (this.getParentModel() instanceof IModelPartsAccessor accessor && !accessor.getAllModelParts().isEmpty()) {
poseStack.pushPose();
ModelPart modelPart = ModelPartUtils.getPart(getSizedPart(), accessor.getAllModelParts());
if (modelPart != null && !modelPart.isEmpty())
renderModelPartOverlay(modelPart, poseStack, vertexConsumerProvider, i, livingEntity);
poseStack.popPose();
}List of model parts can be obtained by calling accessor.getAllModelParts() from IModelPartsAccessor instance.
Captures the first model part which contains child with exact same name.
if (this.getParentModel() instanceof IModelPartsAccessor accessor && !accessor.getAllModelParts().isEmpty()) {
poseStack.pushPose();
ModelPart modelPart = ModelPartUtils.getPart("head", accessor.getAllModelParts());
if (modelPart != null && !modelPart.isEmpty())
renderModelPartOverlay(modelPart, poseStack, vertexConsumerProvider, i, livingEntity);
poseStack.popPose();
}Captures a random model part from the model parts list.
Method is reimplementation from PlayerModel.
if (this.getParentModel() instanceof IModelPartsAccessor accessor && !accessor.getAllModelParts().isEmpty()) {
poseStack.pushPose();
ModelPart modelPart = ModelPartUtils.getRandomPart(accessor.getAllModelParts(), random);
if (modelPart != null && !modelPart.isEmpty())
renderModelPartOverlay(modelPart, poseStack, vertexConsumerProvider, i, livingEntity);
poseStack.popPose();
}Optional<ModelPart> findPartByName(String name);
Optional<ModelPart> findPartBySize(float x, float y, float z);
Map<String, ModelPart> getChildren();An extension of ModelPart for gathering model parts by given properties.
List<ModelPart> getAllModelParts();An accessor for ModelPart to obtain all model parts contained in EntityModel.