How do I detect if a Players score equals to 1

Discussion in 'Plugin Development' started by Maxmelee, Jan 11, 2023.

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

    Maxmelee

    public final class Abilities extends JavaPlugin implements Listener {

    @Overridepublic void onEnable() {
    getServer().getPluginManager().registerEvents(this,this);}
    @EventHandlerpublic void when(PlayerJoinEvent event) {
    event.setJoinMessage("l,");}
    @EventHandlerpublic void onMove(PlayerMoveEvent e) {
    Player p = e.getPlayer();Scoreboard board = p.getScoreboard();Objective obj = board.getObjective("dash");Location loc = p.getLocation();Vector vector = loc.getDirection();Score score = obj.getScore("p"); if (score.equals(1)) {
    p.setVelocity(vector.multiply(3));}
    }
    }
    upload_2023-1-11_18-44-40.png
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Maxmelee Is this a request for help or a tutorial?
     
  3. Offline

    Maxmelee

    A request for help
    sorry I Forgot to type ? and sorry if not giving enough info
    this is my first time trying to make a plugin and i'm trying to edit the player velocity when the score of the player in the scoreboard named "dash" is 1
    the velocity does work I just don't really know how to make the scoreboard or if the equals is actually the problem
     
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    Maxmelee

    thanks but can I multiply Vector Y or Vector X or do I just use setX
    and how do I close a thread or does it close automatically
     
  6. Offline

    timtower Administrator Administrator Moderator

    @Maxmelee Might be able to multiply the entire thing in one go.
    And the thread will close automatically.
     
  7. Offline

    Maxmelee

    im asking if I can multiply Vector Y separately then the entire Vector
     
  8. Offline

    timtower Administrator Administrator Moderator

    @Maxmelee Then take it out, multiply, put it back in
     
  9. Offline

    Maxmelee

    I meant than my bad
     
Thread Status:
Not open for further replies.

Share This Page