Solved SuperJump [Need Help]

Discussion in 'Plugin Development' started by Josh014, Sep 22, 2013.

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

    Josh014

    Hey,

    I'm making a SuperJump plugin for a friend but it is really buggy...
    Code:
    Code:java
    1.  
    2. @EventHandler
    3. public void onSuperJump(PlayerMoveEvent event){
    4. Player player = event.getPlayer();
    5. if(player instanceof Player){
    6. if(!player.getGameMode().equals(GameMode.CREATIVE)){
    7. if(player.getLocation().subtract(0, 2, 0).getBlock().getType() != Material.AIR){
    8. if(player.isFlying() == true){
    9. player.setAllowFlight(false);
    10. player.setVelocity(player.getLocation().getDirection().multiply(2));
    11. player.setVelocity(new Vector(player.getVelocity().getX(), 1.1, player.getVelocity().getZ()));
    12. }
    13. }
    14. if(player.isFlying() == false){
    15. player.setAllowFlight(true);
    16. }
    17. }
    18. }
    19. }
    20.  

    It works but... it is kinda buggy because if a player tries to fly in the air the player lands on the ground and bounces of the ground again. Is there a way to solve it?

    Nvm I solved it by my self.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  2. It would be great if you would post your solution
     
Thread Status:
Not open for further replies.

Share This Page