DoubleJump for 1.8

This project is abandoned and its default file will likely not work with the most recent version of Minecraft. Whether this project is out of date or its author has marked it as abandoned, this project is no longer maintained.

Hello everyone ! Today I present you my plugin is Double Jump. For those who want to change the sentences, etc ... here is the piece of code allowing you to achieve the plugin.

The code

    public void onEnable() {
            getServer().getPluginManager().registerEvents(this, this);
    }
    @EventHandler
    public void onPlayerToggleFlight(PlayerToggleFlightEvent event) {
    		Player p = event.getPlayer();
            Player player = event.getPlayer();
            p.playSound(p.getLocation(), Sound.FIREWORK_LAUNCH, 50, -10);
            if(player.getGameMode()==GameMode.CREATIVE)
                    return;
            event.setCancelled(true);
            player.setAllowFlight(false);
            player.setFlying(false);
            player.setVelocity(player.getLocation().getDirection().multiply(1.5).setY(1));
    }

    @EventHandler
    public void onPlayerMove(PlayerMoveEvent event) {
            Player player = event.getPlayer();
            if ((player.getGameMode()!=GameMode.CREATIVE)&&(player.getLocation().subtract(0, 1, 0).getBlock().getType()!=Material.AIR)&&(!player.isFlying()&& player.hasPermission("doublejump.use"))) {
                    player.setAllowFlight(true);
            }else {
                    player.setAllowFlight(false);
            }
    }
}

Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    95261
  • Created
    Sep 26, 2015
  • Last Released File
    Sep 26, 2015
  • Total Downloads
    529
  • License

Categories

Members

Recent Files

Bukkit