Idk about rendering projectile in 1.9 as the method I knew was deprecated but the class the rendering method uses is RenderingRegistry, oh and try RenderingRegistry#loadEntityRenderers.
In your item's constructor, you would have the damage float that the Item would do, and
Class<? extends EntityThrowable> entity
so you can choose the projectile that your Item will throw.
Now, for the projectile. This part is a lot easier to do. All you really have to do is create a Class that extends EntityThrowable, and set the damage float like you did in the Item constructor, so you don't end up with a crash.
I'm sure this is a little bit different in 1.9. I know that ItemCameraTransforms is deprecated in 1.8.9, so I assume it's changed to something else in 1.9.
Guys! Here's a little tip: Projectile rendering is the exact same as normal entity rendering! You can search how to implement a custom renderer for a normal entity. Than simply apply it to the projectile.
Rollback Post to RevisionRollBack
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
LapisSea is correct guys! Now if you want a cheeky way to render your projectile, you could make the projectile perpendicular to the player view when it is spawned, but not have it changed after that.
I've been searching for a while, but nothing really has what I'm looking for. Could you tell me some good projectile tutorials?
What about this?
http://www.minecraftforge.net/wiki/Tutorials/Basic_Shooter_Item_-_Blaster_Rifle
I'll try. I'll tell you if it helps.
Okay, I have a projectile and everything, but unfortunately it didn't have anything about rendering. Thanks though!
Here, it is for 1.7 but I'm sure it'll work on 1.9 as well.
Hello!
The only problem is that almost every tutorial uses RenderSnowball instead of showing how to do rendering...
That's because most projectiles just use the items' textures instead of a model.
I know, but in some cases you just can't or it'll look weird/incomplete. Throwing stars/knives for example..
I'm actually trying to do something like a throwing star.
Me, too.
But after hours and hours of time spent looking for some advanced tutorials I only found this one or outdated ones that weren't working.
Idk about rendering projectile in 1.9 as the method I knew was deprecated but the class the rendering method uses is RenderingRegistry, oh and try RenderingRegistry#loadEntityRenderers.
I've got it almost working (1.8.9), but the Entity texture is a white cube instead of a textured plate.
Could you show your code? "Gun" item, entity, rendering and entity registering code
If you want it to be something like a throwing star, you'd create an Item that extends your mod's item class, and override the
method, similar to something like this:
In your item's constructor, you would have the damage float that the Item would do, and
so you can choose the projectile that your Item will throw.
Now, for the projectile. This part is a lot easier to do. All you really have to do is create a Class that extends EntityThrowable, and set the damage float like you did in the Item constructor, so you don't end up with a crash.
The extra fancy stuff like spawnParticle and playAuxSFX on impact is optional.
Once you create your item, the constructor should look something like something this:
Now, for the rendering:
You'll want to create a class that extends Render. This is the class that will render the projectile as a 2D item, like a snowball. I'm sure
I'm sure this is a little bit different in 1.9. I know that ItemCameraTransforms is deprecated in 1.8.9, so I assume it's changed to something else in 1.9.
Guys! Here's a little tip: Projectile rendering is the exact same as normal entity rendering! You can search how to implement a custom renderer for a normal entity. Than simply apply it to the projectile.
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
LapisSea is correct guys! Now if you want a cheeky way to render your projectile, you could make the projectile perpendicular to the player view when it is spawned, but not have it changed after that.
That is exactly what I am trying to say!
You could copy the zombie renderer and bind it to the projectile for all i know and bam! You have a flying rombie!
Not doing mc modding that much anymore because I am making a full blown game that does not have limitations that mc has. (rip Magiology for now)
I may come back if MC fixes it's rendering pipeline.
I know but I need a Renderer that can take an Item texture and have it render the Entity 3D (not 2D) i. e. a sword that is thrown.
All I get are white, texture-less cubes
Here's my code.
Your resourcelocation has to have your modid if not Minecraft will call the texture from "minecraft:<name of texture>".
That's fine, it's meant to use that texture. But, the problem is that it doesn't use any texture for rendering.