Posted April 24, 201411 yr 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 : https://github.com/Gugu42/RatchetAndClankMod/blob/master/com/gugu42/rcmod/items/ItemOmniWrench3000.java Entity class : https://github.com/Gugu42/RatchetAndClankMod/blob/master/com/gugu42/rcmod/entity/projectiles/EntityWrenchThrown.java Render class : https://github.com/Gugu42/RatchetAndClankMod/blob/master/com/gugu42/rcmod/render/RenderThrownWrench.java 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.
April 24, 201411 yr 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
April 24, 201411 yr Author 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.
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.