Disable falling of the player.

Discussion in 'Spigot Plugin Development' started by Ivasik, Apr 18, 2017.

  1. Hi, how to disable drop player? I need to ban not only its movement(I know how to do), but to keep it in place, even if beneath his feet there is no block.

    P.s. also wanted to know(if you have Intellij idea, you can continue to read) how to build the plug-in time on the server? Because when I build, idea says that the file cannot be deleted because in use by another process.
     
  2. At the moment there is such a code, but its disadvantage is that you cannot rotate the camera.
    Code (Text):
    if (player.getFallDistance() != 0)
    {
          player.setGliding(true);
          e.setCancelled(true);
    }
     
  3. Solved!
    Code (Text):
    if (e.getFrom().getX() != e.getTo().getX() || e.getFrom().getY() != e.getTo().getY() || e.getFrom().getZ() != e.getTo().getZ())
                {
                    Location loc = e.getFrom();
                    e.getPlayer().teleport(loc.setDirection(e.getTo().getDirection()));
                }
    Last problem:
    also wanted to know(if you have Intellij idea, you can continue to read) how to build the plug-in time on the server? Because when I build, idea says that the file cannot be deleted because in use by another process.
     
  4. You can continuously teleport the player into the air on a timer task.

    EDIT:nvm u solved it
     
    • Like Like x 1
  5. I use eclipse, it allows me to overwrite the plugin while on the server then I simply reload on the console. I only use intelliJ when deving on GWT or android.
    I'm currently deving an eclipse plugin built for plugin devs so devs can hot-swap code into the server vm. It would launch MC and the server at once with the plugin loaded when you click run.
     
  6. Hrm, weird. I created the mod in intellij using the forge api, and so the replacement worked as it should. I'll try to look then the implementation of forge, but I don't think it'll help me.
     
  7. cant you also on player move event do a time loop that will check if the player moved -Y and the cancel the movement and start a timer for like ~2 sec and then check if the player is moving again?