Jump to content

Recommended Posts

Posted

How would I go about creating a projectile that uses the entity that shot it's model? It's supposed to be like a "spirit projection" type thing where the user projects themselves as a projectile. What would be the best way to do this?

Posted

Just guessing from past work, so you need to dig through minecraft code to ensure I'm right.

 

Make a custom EntityFX that uses a player model.  On spawn you can grab the skin of the current player and assign it to the entity. 

 

All that is left after that is just to set the velocity and the time before it despawns.  Look at the entityarrow code for that.

 

If you want to go a step further with the render code, you could make it to where it can fade.  Not at home so I can't provide an example, but I've made a translucent bow before.

 

For a really cool effect you could change the opacity the further it travels for a nice fade effect.

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

Make a custom EntityFX that uses a player model.  On spawn you can grab the skin of the current player and assign it to the entity. 

 

I think most EntityFX are rendered in a model-less way, using render effect method and texture.  I think you should just use regular entity for this (yes with a player model associated).

 

In terms of when the entity is created and when the skin texture is "grabbed" can be done in many ways, and sort of depends on how common this effect will be.  If it is an effect of a rare item, I would probably just create the entity instance at the time of use and it could "die" as it fades away.  If all the players in a multiplayer game are going to be doing this frequently, maybe it would make sense to have permanent entities already ready to go.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

Is there anywhere in the code base where it stores what entity uses what model without me going through and doing it manually? I'm probably going to try to get the model/texture when the entity is created and render it from that.

Posted

Is there anywhere in the code base where it stores what entity uses what model without me going through and doing it manually? I'm probably going to try to get the model/texture when the entity is created and render it from that.

 

Well, are you only doing this for the player?  The player model should be ModelBiped.

 

Generally, I expect the render registry probably can be queried.  The loadEntityRenderers() method in RenderingRegistry class looks like maybe it does something like that. 

 

However, now that I think about it, it may be tricky to have an entity fully copy the player because you'd also want their armor and maybe any items and effects.

 

So I think instead you'll want to somehow actually invoke the regular Player (or other entity) render a second time but with an offset and maybe some transparency.  Again, I'm not certain but I think you could maybe listen for the render event and then invoke it again (but you'd have to have a flag that lets you know whether you've rendered or not already to avoid an infinite loop of renders).

 

Not sure you know what I mean, but I think doing this as a render rather than as a copied entity may be easier.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

Ok, here is what you are going to need:

        this.getDataWatcher().addObject(25,entity.getEntityId());

        this.worldObj.getEntityByID(this.getDataWatcher().getWatchableObjectInt(25));

        RenderManager.instance.func_147939_a(Entity entity, double x, double y, double z, float rot1, float rot2, boolean visible)

I don't know the exact uses of all the parameters in RenderManager.instance.func_147939_a, so I'll leave that to you :)

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.