Jump to content

[1.10.2] RenderPlayerEvent


Silly511

Recommended Posts

I am trying to render something on the player using RenderPlayerEvent, but I don't know what stage to use. In 1.7.10 I used RenderPlayerEvent.Specials.Pre, but now RenderPlayerEvent.Specials is deprecated. I tried to use RenderPlayerEvent.Pre but that rendered it all weird. What do I do? Heres my code:

 

@SubscribeEvent
public void onRenderPlayer(RenderPlayerEvent.Specials.Pre event) {
	Minecraft mc = Minecraft.getMinecraft();
	Tessellator tessellator = Tessellator.getInstance();
	VertexBuffer vertexbuffer = tessellator.getBuffer();
	GlStateManager.pushMatrix();

	GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GlStateManager.enableBlend();
	mc.renderEngine.bindTexture(wingsTexture);

	GlStateManager.disableLighting();
	Minecraft.getMinecraft().entityRenderer.disableLightmap();
	GlStateManager.depthMask(true);
	ColorHelper.setRainbowColor();

	GlStateManager.translate(0, 0.5, 0);
	vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
	vertexbuffer.pos(-2, -0.666666, 0.2).tex(0, 0).endVertex();
	vertexbuffer.pos(-2, 0.666666, 0.2).tex(0, 1).endVertex();
	vertexbuffer.pos(2, 0.666666, 0.2).tex(1, 1).endVertex();
	vertexbuffer.pos(2, -0.666666, 0.2).tex(1, 0).endVertex();
	tessellator.draw();

	Minecraft.getMinecraft().entityRenderer.enableLightmap();
	GlStateManager.popMatrix();
}

Link to comment
Share on other sites

You'd have to add a new

LayerRenderer

to the

RenderPlayer

and render it in there. I haven't used this yet, so I can't help you further with that.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.