Started by
Warlerys
on
Topic category: Help with Minecraft modding (Java Edition)
Hello, i need help :c
im making a turrets mod, the issue is when i created a Sniper Turret, their shoots aren't accuracy when shoots for medium and long distances to enemies.
i tried all...
There's literally nothing you can do about it. accuracy isn't configurable.
What you could do though is having the entity shoot a projectile when it sets its attack target, reply if you wanna try so I explain it to you
I have actually figured out a way to make more accurate projectiles, but it is basically using a procedure to override the entire entity attacking system. I will try to remember to make a tutorial about it at some point.
hello again, too late, i fixed it! but don't worry, thanks for all :D
How did you fix it?
Sorry, I was going to create a forum post with a procedure template that allows accurate ranged attacks, but I wasn't able to figure out how to upload files on a forum post without using a third-party hosting service, which I don't really feel safe using.
The general system that I made for accurate attacks was to have the ranged entity run a procedure every second or two.
That procedure would, if the ranged entity was targeting something for attack, get the coordinates of the attack target, then make the ranged entity face that direction and fire a projectile with 0 inaccuracy value, using the procedure block for an entity to shoot a projectile.
The difficult part was the ranging system, so that the ranged entity will look higher up the further away the target is.
A possible workaround would be to just have the projectile shoot with a lot of power, otherwise you need to do a lot of calculations, I basically just experimented with different values until it worked.
I hope this helps you to make your own ranged attack system.
Yeah thank you very much, I still have a question though: how do you make the entity run the procedure every few seconds? I think that could be done with the "entity sets attack target" through "wait" procedure blocks, making it shoot that way.
My projectile has a lot of power so ranging system is not a problem.
Also there is no way of uploading files through MCreator Forum Posts, I tried to in past, but it is not possible.
I advise you make the forum post anyway and find a way to upload those files somewhere, because this is a very important issue and a procedure template is very needed.
The timer is done through an nbt number tag. I check on every entity update tick to see if tag is greater than a number(I use 30), and if it is, I use an advanced procedure block to call the attacking procedure, then I reset the tag to 0. If the tag is less than 30, I increase the tag by 1.
Oh, so you use NBT tags, kinda the skeleton key for complex procedures.
Thank you, I hope you make that forum post because many people struggle with the shooting system.