How do i when coding, make the text displayed go down a line?

Discussion in 'Plugin Development' started by SilverOlympus, Sep 30, 2014.

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

    SilverOlympus

    So i am coding a plugin that will display a players IP, UUID, and Ping... How do i get the messages for each to do down a line? Ex:

    (Players) UUID: qwfgerq-254534e-da
    (Players) IP: 192.168.1.1
    (Players) Ping: 1337

    instead of just being Ex:

    (Players) UUID: qwfgerq-254534e-da (Players) IP: 192.168.1.1 (Players) Ping: 1337
     
  2. Offline

    Skionz

  3. Offline

    SilverOlympus

    Skionz


    ??

    Code:java
    1. + "Searching for player...."
    2. + "Found player: " + args[0]
    3. + "'s UUID: " + ChatColor.RED
    4. + player.getUniqueId() + ChatColor.GRAY
    5. + "" + ChatColor.ITALIC + args[0]
    6. + "'s IP address: " + ChatColor.RED
    7. + player.getAddress());


    If i just add a \n in the code it gives me an error
     
  4. Offline

    Infuzion

    SilverOlympus Put \n inside the quotations.
    1. + "Searching for player.... \n
    2. + "Found player: " + args[0]
    3. + "'s UUID: " + ChatColor.RED
    4. + player.getUniqueId() + ChatColor.GRAY
    5. + "" + ChatColor.ITALIC + args[0]
    6. + "'s IP address: " + ChatColor.RED
    7. + player.getAddress());
     
  5. Offline

    SilverOlympus

    Infuzion

    Thanks! Also how do i make something to to the middle of the chat?
     
  6. Offline

    Skionz

    SilverOlympus Math maybe? Ive looked into the before and it seems different texture packs have different sizes or something so its basically impossible.
     
  7. Offline

    Infuzion

    SilverOlympus
    Users can adjust the width of their chat, so it would be close to impossible without somehow getting this width and as Skionz said texture packs can have different fonts.
     
Thread Status:
Not open for further replies.

Share This Page