Helix to player vector

Discussion in 'Plugin Development' started by TheSwell, Jul 21, 2024.

Thread Status:
Not open for further replies.
  1. Offline

    TheSwell

    Hello everyone! I need help to make a helix with direction player look. Like shoot
     
  2. Offline

    KarimAKL

  3. Offline

    TheSwell

    Code:
       private void flamey(Player player) {
            Location l = player.getLocation();
            Vector vector = new Vector();
            double radius = Math.PI;
            double maxHeight = 10;
            for(int i1 = 0; i1 < 1; i1++) {
                for(Double y = player.getEyeLocation().getY(); y >= 20; y += 0.06) {
               double x = 2 *  Math.cos(y) * 0.8; // Basically it is saying 3 * Math.cosine and sine, to make a helix around eachother.
               double z = 2 * Math.sin(y) * 0.4;  
          
            net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles("flame",
                                ((float) (l.getX() + x)),
                                ((float) (l.getY() + y)),
                                ((float) (l.getZ() + z)),
                                0, 0, 0, 0, 1);
          
          
          
            ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
        }
        }
        }
       
     
  4. Offline

    KarimAKL

    From what I can tell, the loop condition would either be always true or always false. The condition is for y to be above or equal to 20, then you increase it at every iteration.
    If nothing showing up wasn't your problem, please do elaborate.
     
Thread Status:
Not open for further replies.

Share This Page