Issue with Velocity

Discussion in 'Spigot Plugin Development' started by Justin393, Nov 10, 2015.

  1. So basically, I'm trying to assign a velocity to a player to make them reach Y400 so I can take them to "Space"
    but I'm having issues with achieving a velocity strong enough to launch a player that far. So far they all are the same force, and the player never makes it past y 120ish. Here's the current code and some past trials.

    Code (Text):
    @Sub(permission = "minecraftplanetearth.emerald", description = "Launch into space", allowConsole = false)
        public void launch(CallInfo call) {
            final Player p = call.getPlayer();

            Vector v = new Vector(0, 100, 0);
            v.normalize().multiply(8);                             //Just multiplying the vector wasn't achieving the desired strength so I tried repeatedly adding it to the player with a for loop, still didn't have the desired affect
            p.setAllowFlight(true);
            for (int x = 0; x < 8; x++) {                        
                p.setVelocity(v);
            }
         
            new BukkitRunnable() {
                @Override
                public void run() {
                    p.setAllowFlight(false);
                }
            }.runTaskLater(core, 5L);

        }
    *Note, I'm not the most experience in Velocities/Vectors and try to avoid them whenever possible, so excuse me if it's a dumb simple mistake.
     
  2. remove the #normalize()