Making Double Jump Bypass NCP?

Discussion in 'Plugin Development' started by AppleBabies, Feb 17, 2016.

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

    AppleBabies

    Hello all. So I made a cool double jump...yep. Problem is, regular players get sent backwards because of No Cheat Plus. How can I go about surpassing this, I have fooled around with this but have not found any feasible way.

    Thanks!

    PlayerMove.java:
    Code:
    public class PlayerMove implements Listener {
    
        @EventHandler
        public void onPlayerMoveOnGround(PlayerMoveEvent e) {
            Player p = e.getPlayer();
           
            Arena a = ArenaManager.getInstance().getArena(p.getWorld());
           
            if(a == null){
                if(!p.getAllowFlight()){
                    p.setAllowFlight(false);
                }
                return;
            }
           
            if(a.specUtils.isSpectator(p, a)){
                if(!p.getAllowFlight()){
                    p.setAllowFlight(true);
                }
            }
           
            if((p.getLocation().getBlockY() <= -25) && a.getState() != ArenaState.STARTED){
                p.teleport(a.spawnPoint);
            } else if(p.getLocation().getBlockY() <= -25 && a.getState() == ArenaState.STARTED){
                 MessageManager.getInstance().msgArena(a, MessageType.BAD, p.getName() + " was killed by the void...");
                 p.getWorld().strikeLightningEffect(p.getLocation());
                 p.setHealth(20);
                 a.specUtils.addPlayerAsSpectator(p, a);
                 MessageManager.getInstance().msg(p, MessageType.INFO, "You have died, but don't quit! The game will end soon!");
            }
           
             if((p.getGameMode() != GameMode.CREATIVE)
                    && (p.getLocation().subtract(0, 1, 0).getBlock().getType() != Material.AIR)
                    && (!p.isFlying()) && !p.getAllowFlight()) {
                p.setAllowFlight(true);
            }
    
        }
       
       
    }
    PlayerToggleFlight.java:
    Code:
    public class PlayerToggleFlight implements Listener {
    
        @EventHandler
        public void onPlayerToggleFlight(PlayerToggleFlightEvent e) {
            Player p = e.getPlayer();
            if(p.getGameMode() == GameMode.CREATIVE) return;
           
            Arena a = ArenaManager.getInstance().getArena(p.getWorld());
           
            if(a == null) return;
           
            if(p.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.AIR){
                p.setAllowFlight(false);
                e.setCancelled(true);
            }
           
            if(!a.specUtils.isSpectator(p, a)){
            e.setCancelled(true);
           
            if(!(ArenaManager.getInstance().getArena(p).getState() == ArenaState.STARTED)) e.setCancelled(true);
            p.getWorld().playSound(p.getLocation(), Sound.ENDERDRAGON_WINGS, 1, 10);
            p.setVelocity(p.getLocation().getDirection().multiply(1.5).setY(1));
            p.setAllowFlight(false);
            }
        }
       
    }
     
  2. Offline

    Lightspeed

    Ncp can be messed with anytime just try walking on a pyrimid of anvils it will fill admins chat in miliseconds.
    Maybe try to see if theres a method inside ncp to where you can set it in your build path a temporarily stop watching a player then reenable when there double jump is over(Falling back down to the ground).
     
Thread Status:
Not open for further replies.

Share This Page