problems with transparent entity texture

Started by Heroi4k on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
problems with transparent entity texture

Hi all!
I have a problem with the transparent entity texture.
I made one part of the texture transparent, but in the game it is not transparent at all...
can you tell me how to fix this?

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
  public class…
Fri, 01/12/2024 - 01:07

 



public class PlaceholderRenderer extends MobRenderer<PlaceholderEntity, ModelPlaceholder<PlaceholderEntity>> {
    public PlaceholderRenderer(EntityRendererProvider.Context context) {
        super(context, new ModelPlaceholder(context.bakeLayer(ModelPlaceholder.LAYER_LOCATION)), 0.5f);
        this.addLayer(new RenderLayer<PlaceholderEntity, ModelPlaceholder<PlaceholderEntity>>(this) {
            final ResourceLocation LAYER_TEXTURE = new ResourceLocation("modname:textures/entities/entitytexture.png");

            @Override
            public void render(PoseStack poseStack, MultiBufferSource bufferSource, int light, PlaceholderEntity entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
                VertexConsumer vertexConsumer = bufferSource.getBuffer(RenderType.entityTranslucent(LAYER_TEXTURE));
                this.getParentModel().renderToBuffer(poseStack, vertexConsumer, light, LivingEntityRenderer.getOverlayCoords(entity, 0), 1, 1, 1, 1);
            }
        });
    }

    @Override
    public ResourceLocation getTextureLocation(PlaceholderEntity entity) {
        return new ResourceLocation("modname:textures/entities/entitytexture.png");
    }
}
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Cool it wasnt letting me…
Fri, 01/12/2024 - 01:09

Cool it wasnt letting me post so heres the explanation. I was having trouble with the default generated entity renderer code not allowing translucency. I eventually ended up with this and it works. So just lock your renderer code. Put this in there. And make all the placeholder names your entity.