This has nothing to do with this class. Your problem comes from the registry. You should have a line of code similar to this one:
EntityRegistry.registerModEntity(EntitySpear .class, "EntitySpear", 1, AceCraft.instance, 64, 20, true);
64 is the range at which Minecraft will send tracking updates
20 is the frequency of tracking updates
Those values are taken directly from the vanilla snowball and should work with every projectile-based entity.
This has nothing to do with this class. Your problem comes from the registry. You should have a line of code similar to this one:
EntityRegistry.registerModEntity(EntitySpear .class, "EntitySpear", 1, AceCraft.instance, 64, 20, true);
64 is the range at which Minecraft will send tracking updates
20 is the frequency of tracking updates
Those values are taken directly from the vanilla snowball and should work with every projectile-based entity.
Oh wow I usually put the freq to 2. I thought that it meant tick/update making it update every 2 ticks.
EDIT: I changed it to 20 and now I don't even see the projectile.
Alright, looks like the problem was caused because I was using my own variables for speed instead of the predefined motion variables. Can anyone explain to me why this happens? I looked around the Entity code and found nothing that could cause this.
Also could anyone tell me what's the best frequency to set when registering my entity. What is it measured in? (e.g. updates/tick)
I'm creating a custom projectile entity and everything seems to work, however the entity stutters a lot when moving.
https://pastebin.com/iUWQJELe
This has nothing to do with this class. Your problem comes from the registry. You should have a line of code similar to this one:
EntityRegistry.registerModEntity(EntitySpear .class, "EntitySpear", 1, AceCraft.instance, 64, 20, true);
64 is the range at which Minecraft will send tracking updates
20 is the frequency of tracking updates
Those values are taken directly from the vanilla snowball and should work with every projectile-based entity.
Oh wow I usually put the freq to 2. I thought that it meant tick/update making it update every 2 ticks.
EDIT: I changed it to 20 and now I don't even see the projectile.
well, it's updates per second actually, so 20 means update every tick...
Well looks like it isn't because now I can see the projectile in approximately 1-2 seconds after the shot if it hasn't been removed already.
Alright, looks like the problem was caused because I was using my own variables for speed instead of the predefined motion variables. Can anyone explain to me why this happens? I looked around the Entity code and found nothing that could cause this.
Also could anyone tell me what's the best frequency to set when registering my entity. What is it measured in? (e.g. updates/tick)