Jump to content

Recommended Posts

Posted

So, I made a bow for my mod and used "this.setFull3D();" in the constructor to make it render in 3d, but the offset seems to be off.

width=800 height=449https://lh3.googleusercontent.com/JfBd59Gq_0ML6qYQmjeVlz2VZD35jWjsdK54AZt1PXyAOk5EkY7XHph2VisVcAesgloMTOv7jMDt3II=w1256-h817[/img]

 

The textures should be fine because all I did was edit the colors of the vanilla bow in paint.net.

Does anyone have a solution?

Here is the vanilla bow for comparison:

 

width=800 height=449https://lh3.googleusercontent.com/NmVAXlRtvEo2l43A2N8EPTyDvoABZbEnWpuQHCXth8zcnyXmanrjvywWyTBjQXJSxIjBmBidsFT6TiU=w1256-h817[/img]

Posted

Ok, now that we can seethe problems, show us the item render code if you are pre-1.8 or item JSON for 1.8.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Posted

Ok, now that we can seethe problems, show us the item render code if you are pre-1.8 or item JSON for 1.8.

 

I'm in minecraft 1.7.10 and I am merely using "this.setFull3D();" in my bow constructor.

Posted

I think the problem is that when I use "this.setFull3D();" It is rendering the bow in hand like a sword istead of like a bow. Is there a way to change the hold type or something?

Posted

Bow rendering is handled specially by Minecraft, so if you want your bow to render in the same fashion, you need to create a custom render class that copies what Minecraft does.

 

Look at the item rendering class and search for bow, then create an IItemRenderer for your item.

 

Do I have to call that class the proxies or something? Thank you by the way!

Posted

If you search for IItemRenderer or 'Minecraft custom item rendering' in Google or something, you are bound to come up with some tutorials on how to use them.

 

You do need to register the renderer for your Item class in the ClientProxy (or at least called from there):

MinecraftForgeClient.registerItemRenderer(YourMod.yourItem, new RenderYourItem());

Posted

If you search for IItemRenderer or 'Minecraft custom item rendering' in Google or something, you are bound to come up with some tutorials on how to use them.

 

You do need to register the renderer for your Item class in the ClientProxy (or at least called from there):

MinecraftForgeClient.registerItemRenderer(YourMod.yourItem, new RenderYourItem());

 

So this is what I have so far:

 

public class RenderItem implements IItemRenderer {

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type)
{
	switch(type){
	case EQUIPPED:
		return true;
	default:
		return false;
	}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
	return false;
}

@Override
public void renderItem(ItemRenderType type, ItemStack itemStack, Object... data) {
	switch(type){
	case EQUIPPED:
		GL11.glPushMatrix();

                        	//I don't know what to put here...

		GL11.glPopMatrix();
	default:
		break;
	}
}

}

 

I'm sorry, i'm new to rendering.

Posted

Bow rendering is handled specially by Minecraft, so if you want your bow to render in the same fashion, you need to create a custom render class that copies what Minecraft does.

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/

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.