Solved Multiple lines in a kick message

Discussion in 'Spigot Plugin Development' started by ZevoGaems, Apr 14, 2017.

  1. I have a ban plugin I am making that checks on join if a player has a certain permission (not including ops) and if they have that it kicks them. So if they have the permissions it kicks them right, but I want the kick message to have multiple lines so how would I do that?
     
  2. Use \n in the String
     
  3. Can you please elaborate on that because, I am kind of new to javascript and I don't know what you mean by that.
     
    • Useful Useful x 1
  4. For starters, Java is not Javascript. They're two entirely different languages.
    And \n is an escape code representation of the newline character.
    You can read more about the escape codes usable in Strings and chars at https://docs.oracle.com/javase/tutorial/java/data/characters.html
     
  5. Something like this
    p.kick(ChatColor.RED + "You have been kicked!" + "\n" + "This is the second line!" + "\n" + "This is the third line!");
     
    • Like Like x 1
  6. Okay, lot of mistakes in one sentence:
    A) This is Java, JavaScript is absolutely different to Java
    B) I'll not spoon-feed you, but basically you have to do the following steps:
    1. Create a class that implements Listener
    2. Create a method with the @EventHandler tag that has as argument AsyncPlayerPreLoginEvent
    3. If player has no permission or is not op then kick him using the event methods
     
  7. It has errors lol, he should use the AsyncPlayerPreLoginEvent that don't import a Player option (it has the e.getUniqueId() and e.getName())
     
  8. I know how to do the events I am just asking how to create multiple lines cause I didn't know xD
     
  9. Ok then, if it worked mark the thread as solved :)