How Do I Fix This Vector?

Discussion in 'Plugin Development' started by jbman223, Mar 30, 2013.

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

    jbman223

    Code:java
    1.  
    2. import java.util.logging.Logger;
    3.  
    4. import org.bukkit.Bukkit;
    5. import org.bukkit.Location;
    6. import org.bukkit.event.EventHandler;
    7. import org.bukkit.event.Listener;
    8. import org.bukkit.event.player.PlayerJoinEvent;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class test extends JavaPlugin implements Listener {
    12.  
    13. private Logger log = Logger.getLogger("Minecraft");
    14.  
    15. @Override
    16. public void onEnable () {
    17. getConfig().options().copyDefaults(true);
    18. saveConfig();
    19. registerEvents();
    20. }
    21.  
    22. @EventHandler
    23. public void onJoin(PlayerJoinEvent e) {
    24. e.getPlayer().teleport(new Location(e.getPlayer().getLocation().getWorld(),0, 200, 0));
    25. e.getPlayer().setVelocity(e.getPlayer().getVelocity().setY(-3000));
    26. }
    27.  
    28. @Override
    29. public void onDisable () {
    30. }
    31.  
    32. private void registerEvents() {
    33. this.getServer().getPluginManager().registerEvents(this, this);
    34. }
    35.  
    36. }
    37.  


    How can I make it so that the vector makes the player fall "slowly" like a parachute or feather falling?
     
  2. Offline

    ZeusAllMighty11

    You'd have to set their velocity every few ticks I believe ?
     
  3. Offline

    Scyntrus

    Would that not make the player go superspeed downwards? I think you should use playermoveevent and keep on setting their y speed slower.
     
  4. Offline

    LucasEmanuel

    jbman223
    Multiply the velocity by something between 0 and 1 instead.

    You should also note that the X, Y and Z coordinates in the vector have pretty much nothing to do with the X, Y and Z coordinates in the world.
     
Thread Status:
Not open for further replies.

Share This Page