Jump to content

Problem with custom arrow


Recommended Posts

I have been creating a custom arrow and I have managed to solve just about everything except one weird piece of behavior and maybe someone here can help me.  I have copied the arrow code and sorted the custom texture bits out.


When the arrow is shot it behaves as expected, renders correctly and so forth unless the range of the shot is under about 4 blocks, then the arrow renders either next to the character or about 2 blocks out from the target though the arrow is in the correct place (as determined by going and picking it up) just not rendered right.


Is this an issue with the below code or should I be looking elsewhere?


Register code
  EntityRegistry.registerGlobalEntityID(Entitybolt.class, "MagicBolt",EntityRegistry.findGlobalUniqueEntityId());
  EntityRegistry.registerModEntity(Entitybolt.class, "MagicBolt", EntityRegistry.findGlobalUniqueEntityId(), this, 41, 3, true);




From Entitybolt.java

    public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
        this.setPosition(par1, par3, par5);
        this.setRotation(par7, par8);


Link to comment
Share on other sites

You are registering your entity twice.

EntityRegistry.registerGlobalEntityID(Entitybolt.class, "MagicBolt",EntityRegistry.findGlobalUniqueEntityId());

Remove this part. And chose a number instead of using EntityRegistry.findGlobalUniqueEntityId().

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.

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.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.