Blindness

Discussion in 'Spigot Plugin Development' started by snickyboy, May 27, 2017.

  1. Hello! I have a quick, easy to code plugin idea. Unfortunately, I don't know how to code :(, but if someone could do that for me, that would be great! I was wondering if someone could make a plugin where the FIRST time a player joins the server, they have blindness for 5 seconds. That's all.

    Thanks!
    Benny
     
  2. this forum section is not a place to post / hire someone.
    Try this section.
     
    • Agree Agree x 1
  3. to answer your question in a simple code line:

    Code (Text):

    @EventHandler
    public void joinedFirst(PlayerJoinEvent e){
    Player player = e.getPlayer();
    if(!(player.hasPlayedBefore()){ // check if the player hasn't played before -> is new
    player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,(5*20),1)); // give player blindness effect for 5 seconds
    }
    }
     
     
  4. Sorry but I don't know how to do this XD