Walk faster on join, not working?

Discussion in 'Plugin Development' started by infopaste, Dec 26, 2013.

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

    infopaste

    When a player joins the sever I want there speed to be set to walk faster, I dont understand why the following code doesn't work:

    Code:
        @EventHandler
        public void onJoin(PlayerJoinEvent e) {
            Player player = e.getPlayer();
     
            player.setWalkSpeed((float) 0.6);
           
            player.teleport(player.getWorld().getSpawnLocation());
        }
     
  2. Offline

    LarsNitro

    Make sure your plugin is enabled successfully, and that the event is registered.
     
    CraftedShack likes this.
  3. Offline

    Badeye

    I had problems with that aswell (setWalkSpeed). You could just apply a potion effect to the player, like this:

    Code:java
    1. p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 99999999, 1), true);
     
  4. Offline

    jusjus112

    infopaste
    The walkSpeed setting to 0.6 is too fast, i think you must try 0.2 or 0.3
    For me work this method fine.
     
Thread Status:
Not open for further replies.

Share This Page