how can i stop player if they move by a certain blocks

Discussion in 'Plugin Development' started by Gyul, Feb 19, 2020.

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

    Gyul

    Location loc = player.getLocation();
    Vector unitVector = new Vector(player.getLocation().getDirection().getX(), player.getLocation().getDirection().getY(), player.getLocation().getDirection().getZ());
    unitVector = unitVector.normalize();player.setVelocity(unitVector.multiply(tmp));
    if(player.getLocation().distance(loc)>(move_d)-1.0){
    Vector zero_vec = new Vector(0,0,0);player.setVelocity(zero_vec);
    }

    code is like this.. but it didn't work
    move_d and tmp is parameter
    how can i fix it?
     
  2. Offline

    Kars

  3. Offline

    Gyul

    I want to push the player out at a certain speed by a certain block with command.
    should i handle playerMoveEvent to do so?
     
  4. Offline

    Kars

    @Gyul you said you wanted to stop a player from moving in the title. Moving a player at a different speed is a different story and one with which i have no experience.
     
  5. Offline

    bowlerguy66

    @Gyul Can you explain what you want to happen in more detail?
     
Thread Status:
Not open for further replies.

Share This Page