Jump to content

[1.7.10]Change player model and making the size in one block


f1rSt1kChannel

Recommended Posts

You have 2 options:

1. You can override the mapping done by the RenderManager by registering a new renderliving class to the EntityPlayer.

2. There is an event, RenderLivingEvent.Pre,  that cancels the doRender method in RenderLiving classes. Allowing you to render a new renderliving class for that entity. by calling the doRender method again during the event.

 

Small example :

private final RenderPlayer2 renderPlayer = new RenderPlayer2();
@SubscribeEvent
void overrideRenderPlayer(RenderLivingEvent.Pre event) {
if (event.entity instanceof EntityPlayer) {
event.setCanceled(true);
renderPlayer.doRender(/* what ever parameters */);
}
}

Link to comment
Share on other sites

So many bumps.

 

Well, a quick look through some classes revealed the following:

 

Entity.class has the following method:

 

protected void setSize(float parwidth, float parheight)

 

and EntityPlayerMP has this method:

 

    /**
     * Returns the default eye height of the player
     * @return player default eye height
     */
    @Override
    public float getDefaultEyeHeight()
    {
        return 1.62F;
    }

 

setsize sets the boundingbox. So you can set the size and height of the player there

the default eye height method sets, well, the default eye height and is used in the item class and in

the EntityPlayer class. The EntityPlayer class also has a variable called Eyeheight.

 

So while I didn't really look deeply into it I think those two functions are a decent start to set the eyeheight and boundingbox. As for the model, I think that the best method is as ShaneCraft mentioned, adding your own render class.

 

I hope this gives you enough information to get a good start on it and stop bumping.

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.