DoubleJump for 1.8
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); } } }
Seems a lot like TheBCBroz code for this plugin, nice work but I wouldn't recommend them, use someone like pogostick29dev
I like the idea :) Not original, but some people lack the ability to make a simple plugin like this.
Best of luck with your plugin, and keep up the great work :D Looks good