Jump to content

Change Vanilla mobs size?


Insane96MCP

Recommended Posts

So, I managed to mess up with RenderLivingEvent

 


@SubscribeEvent
public static void EventRenderLivingPre(RenderLivingEvent.Pre<EntityLivingBase> event) {
  if (event.getEntity() instanceof EntityZombie) {
  	GL11.glPushMatrix();
  	GL11.glScalef(2.0f, 2.0f, 2.0f);
  }
}

@SubscribeEvent
public static void EventRenderLivingPost(RenderLivingEvent.Post<EntityLivingBase> event) {
  if (event.getEntity() instanceof EntityZombie) {
  	GL11.glPopMatrix();
  }
}

But I'm obiviously doing something wrong
2018-01-07_17_58_37.png.35a7b03949867b464d6d5d2dcfe31a94.png

But as I'm writing I'm thinking that to do what I want to do, I have to replace the RendererZombie (or whatever mob) with mine and change size there.

Edited by Insane96MCP
Link to comment
Share on other sites

9 minutes ago, Insane96MCP said:

So, I managed to mess up with RenderLivingEvent

 



@SubscribeEvent
public static void EventRenderLivingPre(RenderLivingEvent.Pre<EntityLivingBase> event) {
  if (event.getEntity() instanceof EntityZombie) {
  	GL11.glPushMatrix();
  	GL11.glScalef(2.0f, 2.0f, 2.0f);
  }
}

@SubscribeEvent
public static void EventRenderLivingPost(RenderLivingEvent.Post<EntityLivingBase> event) {
  if (event.getEntity() instanceof EntityZombie) {
  	GL11.glPopMatrix();
  }
}

But I'm obiviously doing something wrong
2018-01-07_17_58_37.png.35a7b03949867b464d6d5d2dcfe31a94.png

But as I'm writing I'm thinking that to do what I want to do, I have to replace the RendererZombie (or whatever mob) with mine and change size there.

Scale using GL changes the position/origin as well. So you need to sort that out. You also need to update it's serverside bounding box.

 

Use https://www.programcreek.com/java-api-examples/index.php?class=org.lwjgl.opengl.GL11&method=glTranslatef for changing position.

Edited by TheAwesomeGem
Link to comment
Share on other sites

2 minutes ago, TheAwesomeGem said:

Scale using GL changes the position/origin as well. So you need to sort that out. You also need to update it's serverside bounding box.

 

Use https://www.programcreek.com/java-api-examples/index.php?class=org.lwjgl.opengl.GL11&method=glTranslatef for changing position.

But the mob is not bigger ... and when seen from above it disapears
2018-01-07_18_10_32.png.923aae314b46e62fd0dc2e8cb8375cae.png

Link to comment
Share on other sites

12 minutes ago, Insane96MCP said:

But the mob is not bigger ... and when seen from above it disapears
2018-01-07_18_10_32.png.923aae314b46e62fd0dc2e8cb8375cae.png

Are you changing it on clientside or serverside? 

 

Also use GLStateManager and not the raw GL calls.

 

Edit: Look at RenderGiantZombie as an example.

Edited by TheAwesomeGem
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.

Announcements



×
×
  • Create New...

Important Information

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