[HELP]setVelocity - moved too quickly

Discussion in 'Plugin Development' started by Raldo94, Aug 11, 2012.

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

    Raldo94

    I have ben having this issue recently.
    Ok im trying to "shoot" an player up in the air, But i have gooten this warning in the console, This worked before.

    Code:
    raldo94 moved too quickly! 0.0,0.0,0.0 (0.0, 47.86476986468508, 0.0)


    Here is the Code snipp:
    Code:
    Vector up = new Vector(0, 50, 0);
    player.setVelocity(up);
    This only happends if i set the value high.
     
  2. Offline

    whitehooder

    There are plugins that disable the moved too quickly kick. You may just let this plugin depend on that one. If you want to include this into your plugin you should ask for source code or something. If you cant find anything yourself I may possibly put up some code to disable the moved too quickly event.
     
  3. Offline

    whitehooder

    I have reproduced this plugin. Source included in jar.
    Edit: Well, what can I say. It works, but still spams the log with the moved too quickly messages ;) You are probably able to remove these though. Did not make this for release, just to show you ;)
     

    Attached Files:

    • Fly.zip
      File size:
      2.3 KB
      Views:
      192
  4. Offline

    mattbrw08

    whats the name of the plugin that stops the "player moved too quickly" im having a lot of problems with the same issue in trying to jump high and it pulling the player back down to the ground
     
  5. Offline

    whitehooder

    I don't remember, sorry. But I've made my own version of your plugin (not released ;))
    Download it here: Fly.jar
    Code:
    Code:
    import java.util.logging.Handler;
    import java.util.logging.Logger;
     
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerKickEvent;
    import org.bukkit.event.server.ServerEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.util.Vector;
     
    public class fly extends JavaPlugin implements Listener {
        @Override
        public void onEnable() {
            getCommand("fly").setExecutor(this);
        }
     
        public void onDisable() {};
     
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
            Player player = null;
            if (sender instanceof Player) {
                player = (Player)sender;
            }
         
            if(cmd.getName().equalsIgnoreCase("fly") && player != null) {
                Vector up = new Vector(0, 50, 0);
                player.setVelocity(up);
                return true;
            }
            return false;
        }
     
        @EventHandler(priority = EventPriority.NORMAL)
        public void onKick(PlayerKickEvent event) {
            if (event.getReason().toLowerCase().contains("moved") && event.getReason().toLowerCase().contains("quickly") && event.getReason().toLowerCase().contains("too") ) {
                event.setReason(null);
                event.setLeaveMessage(null);
                event.setCancelled(true);
            }
        }
    }
    
    ^^^
    As you see I did not find any proper way to do it, but.. This works!
    Checking in the kick event what the message is and check if it contains moved too quickly. The event.setReason and setleavemessage is to prevent it from spamming the console with moved too quickly! messages ;)
     
  6. Offline

    mattbrw08

    wow looks cool man, thanks for the fly.jar.. i through it in tho and players still are being pulled back down to earth when jumping at a fast speed and the [warning] player moved too quickly message is still coming up. Also for whatever reason, when someone falls from a high point it activates the player moved too quickly! again and safely pulls the player down to earth with no fall damage. It seriously a problem for our server but sucks that it cant be removed :(
     
  7. Offline

    whitehooder

    how many moved too quickly messages is there? If 1, I designed it that way ;)
    The pulling however are not occuring at mine. Maybe you will need to toggle flight to true in server configs, or else its another plugin thats doing it.
     
  8. Offline

    mattbrw08

    I think the reason it may not be working for me is that im not using the same what he called "vector" jump. im using a spell from MagicSpells plugin called leap that pushes the player at a configurable height velocity and horizontal velocity. I have it set so it is 45 vertical velocity (the jump) and i think 20 horizontal. by the time you do they leap twice the "player moved too quickly " comes in and drops the player back down to ground giving the [warning]
     
  9. Offline

    devilquak

Thread Status:
Not open for further replies.

Share This Page