Greetings everyone!
I want all of my particles to follow the player viewport and not be created in world space. I'm kinda new to Minecraft modding so i don't know if this would be a hard task to achieve.
All i have for now is a simple method that spawns particles in a helix infront of the player in world space.
Vector3d lookVector = player.getLookVec().normalize();
final double pitch = (player.getPitch(1) + 90.0F) * 0.017453292F;
final double yaw = -player.getYaw(1) * 0.017453292F;
double x = radius * Math.cos(tickCount / 3D);
double z = radius * Math.sin(tickCount / 3D);
Vector3d vec = new Vector3d(x, 0, z);
vec = Util.rotateAroundAxisX(vec, pitch);
vec = Util.rotateAroundAxisY(vec, yaw);
player.world.addParticle(ParticleTypes.FLAME, player.getPosX() + vec.getX() + lookVector.getX(), player.getPosY() + vec.getY() + lookVector.getY() + player.getEyeHeight(), player.getPosZ() + vec.getZ() + lookVector.getZ(), 0, 0, 0);