Jump to content

Rendering a 3D item as a throwable item


Thornack

Recommended Posts

I added EntityRegistry.registerModEntity(EntityBall.class, "Ball", 49, this, 80, 3, true); to the main mod class and now it renders while thrown but its really weird. When I go to 0,0,0 it throws normally but when I move away from that location ( when I move up the balls trajectory is towards the sky in an arc. If I move the character left the balls trajectory is towards the right and if I move right the balls trajectory is left. and If I turn the character the trajectory its all weird.

Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

Sorry I haven't been responding, I have been busy.

I added EntityRegistry.registerModEntity(EntityBall.class, "Ball", 49, this, 80, 3, true); to the main mod class and now it renders while thrown but its really weird. When I go to 0,0,0 it throws normally but when I move away from that location ( when I move up the balls trajectory is towards the sky in an arc. If I move the character left the balls trajectory is towards the right and if I move right the balls trajectory is left. and If I turn the character the trajectory its all weird.

 

Did you change

 	       if (!par2World.isRemote)
       {
           par2World.spawnEntityInWorld(new EntityBall(par2World));
       }

to

	       if (!par2World.isRemote)
       {
           par2World.spawnEntityInWorld(new EntityBall(par2World,par3EntityPlayer));
       }

 

To fix your inventory problem, in you itemrenderer change

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

to

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

 

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.