Help with special characters. ♥

Discussion in 'Plugin Development' started by Krizeh, Jul 27, 2014.

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

    Krizeh

    How would one implement special characters into their code.
    For example how would I send a player a message that included the character:
     
  2. Offline

    ResultStatic

    Krizeh player.sendMessage("");
     
  3. Woah, would that appear in chat as a heart? And is there a list of all the icons you can have in minecraft?
     
  4. Offline

    yupie_123

  5. Offline

    xize

    Just a advise use the unicode rather than the full symbol it could cause problems when things aren't utf-8.

    just do something like \uhexcodeOfSmilley in a string or even better as a char with ' ' quotes, also in charmap in windows you can find working characters not all smilley characters work from wikipedia since some need a charset update in java or it does not exist in minecraft
     
  6. Offline

    desht

    Not strictly a list, but if you take the client JAR file and extract it, you'll have a directory called font; in there are a whole bunch of glyph files, e.g. glyph_27.png. The "27" in that filename is the first two (hex) digits of the Unicode character number [1]. The heart symbol, for example, is \u2764 (note there are other heart symbols too, e.g. \u2661 & \u2665), so if you load glyph_27.png into an image viewer, you should see the heart symbol in there. And you can use the "\u2764" sequence in any String in your Java code to get the heart.

    Support for Unicode characters in Minecraft is reasonably comprehensive, and sites like http://file-format.info and http://unicode-table.com are useful to look up symbols.

    [1] Yeah, I know there are Unicode characters with more than four hex digits, but Minecraft doesn't support any of those right now.
     
    AdamQpzm likes this.
Thread Status:
Not open for further replies.

Share This Page