I've added a custom arrow to my mod, and everything seems to be working fine...except that when I shoot it, it twists around strangely in mid-air. Sometimes it even starts to fly backwards.
I'm extending all the appropriate "arrow" classes, and I haven't touched any of the code that handles how the arrow moves, so I don't understand why it's behaving so strangely.... any thoughts?
After more testing, it seems that the arrow isn't actually flying backwards.
Instead, the arrow APPEARS to hit something in mid-air and fall to the ground, except that the entity must actually continue flying correctly, because I can still hit mobs after the arrow looks like it has fallen to the ground.
Also, if I shoot the arrow at a wall, it looks like the arrow stops and falls to the ground, then half a second later it reappears stuck into the wall where it should be.
Does anyone know what this behavior means? Someone please respond, all my thread asking for help go unanswered...
That sounds like an issue between client and server. You're seeing what's happening on the client (the arrow drops to the floor) but on the server it flies fine, which is explains everything that's happening.
That sounds like an issue between client and server. You're seeing what's happening on the client (the arrow drops to the floor) but on the server it flies fine, which is explains everything that's happening.
I've registered the arrow entity the same way I register all my entities, with EntityRegistry.registerModEntity() called during preInit() on both client and server and RenderingRegistry.registerEntityRenderingHandler() called on the client side during preInit()....
This works fine for my mobs, so why is it causing a client/server issue for the arrow entity?
Wait a minute, that's all your code for the arrow class? I thought there's supposed to be wayyy more code. Also would you mind posting which minecraft version you are using. If you are using 1.10.2 I can definetly help.
Hi all,
I've added a custom arrow to my mod, and everything seems to be working fine...except that when I shoot it, it twists around strangely in mid-air. Sometimes it even starts to fly backwards.
I'm extending all the appropriate "arrow" classes, and I haven't touched any of the code that handles how the arrow moves, so I don't understand why it's behaving so strangely.... any thoughts?
Here is my code:
https://pastebin.com/KnYX5XS9
After more testing, it seems that the arrow isn't actually flying backwards.
Instead, the arrow APPEARS to hit something in mid-air and fall to the ground, except that the entity must actually continue flying correctly, because I can still hit mobs after the arrow looks like it has fallen to the ground.
Also, if I shoot the arrow at a wall, it looks like the arrow stops and falls to the ground, then half a second later it reappears stuck into the wall where it should be.
Does anyone know what this behavior means? Someone please respond, all my thread asking for help go unanswered...
That sounds like an issue between client and server. You're seeing what's happening on the client (the arrow drops to the floor) but on the server it flies fine, which is explains everything that's happening.
I've registered the arrow entity the same way I register all my entities, with EntityRegistry.registerModEntity() called during preInit() on both client and server and RenderingRegistry.registerEntityRenderingHandler() called on the client side during preInit()....
This works fine for my mobs, so why is it causing a client/server issue for the arrow entity?
Maybe it's how you spawn it?
Wait a minute, that's all your code for the arrow class? I thought there's supposed to be wayyy more code. Also would you mind posting which minecraft version you are using. If you are using 1.10.2 I can definetly help.
Don't forget they've extended EntityArrow, so most of the logic is already in the super class.
@Bright_Spark Good point, I missed that, but they still never actually spawn the entity in the world.
We won't know that unless they show their bow class...
Ahem...
Bright_Spark has a point...
It's being shot by a regular bow, so it's spawned the same way as any arrow.