Started by
BMAgamer
on
Topic category: Help with Minecraft modding (Java Edition)
I want to make a simple entity that shoots hostile mobs. I am using procedures for this since I want to sync it with geckolib.
Right now, I have made the entity shoot an invisible projectile that deals no damage at the mob, in order to target and look at them. Then, I have it so that if the entity is targetting a mob, it will shoot my custom projectile every 60 ticks. Only issue, is that it keeps shooting the projectile in the same direction the mob was originally at, and it doesn't follow the mob.
How can I fix this, in other words, how can I make it so the entity shoots hostile mobs using projectile procedures.
just make an entity tick procedure for that entity, and if their attack target is no equal to null entity, then make them look at the coordinates of the attack target, and then make their projectiles go in the direction the entity is facing by setting the projectile's yaw and pitch to that of the entity.
P.S, just make sure to put this procedure in the "living tick" trigger of the entity.