Jump to content

[1.6.4]Entity become invisible after a method is called.


Recommended Posts

Hello ! I have a little problem, and I'd like if someone was able to help me with it.


Basically, I have an entity that acts like a boomerang. It goes well for the first half : I throw it, it goes in the direction it should be going, and whenever it hits the limit distance, or collide, it becomes invisible.


I guess this comes from the "returnToOwner();" method, since whenever it is called, the entity get invisible.



Here are my codes :




Item class :



Entity class :



Render class :



Also, if I remove the line if(!par2World.isRemote) in my Item class, I see a bug :

When I throw the item, I see it two times, and when it collides / must return to me, one gets invisible, and the other stays visible. However, the one I see working well is just a render, and it does not make the action, while the semi-working one breaks the crate etc...


I really can't find out what the problem is. Thanks for the help you can give me.

Link to comment
Share on other sites

One observation is that the way you have this written it will call return to owner every tick after it reaches the timer.  Might be on purpose, but can't tell.


My guess at your problem is that ther is no owner.


You need to ad some log points in the code and watch for certain parts if the code to happen.  That will find it.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Making it return to the owner is simply so it knows where to go every tick.


What happens is that when it gets to the point of returning, it determines the position it is going to go.

However, if the owner move, it will still go to the point the owner was when it started returning.


I'm simply updating the place it's going to every tick.


Also, I checked, there is an owner.

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.

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.


  • Create New...

Important Information

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