Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Colour codes


  • Please log in to reply
27 replies to this topic

#1

SteGriff
    SteGriff

    Retired Staff

  • Retired Staff
  • 2540 posts
  • Location: Southport, UK
  • Minecraft: SteGriff

Posted 07 December 2009 - 08:06 PM

SeanNanoware tried to inform me today that I could, from console, put an ampersand followed by a number to set text colour without any added server software or custom wizzardry.

When I tried what he suggested; "say Something&1" command in console, everyone got a "The game broke" error.

What's the truth about this function?
~SteGriff
Minecrafting since July '09.

Register or log in to remove.

#2

SeanNanoware

Posted 07 December 2009 - 08:09 PM

If I type
This is &a BLUE!
The client gets blue text after the &a.

Colours:
&a &b &c &d &e &f &1 &2 &3 &4 &5 &6 &7 &8 &9 &0
Posted Image

#3

SteGriff
    SteGriff

    Retired Staff

  • Retired Staff
  • 2540 posts
  • Location: Southport, UK
  • Minecraft: SteGriff

Posted 07 December 2009 - 08:11 PM

Quote

If I type
This is &a BLUE!
The client gets blue text after the &a.

Colours:
&a &b &c &d &e &f &1 &2 &3 &4 &5 &6 &7 &8 &9 &0
After the say command, that is?
~SteGriff
Minecrafting since July '09.

#4

SeanNanoware

Posted 07 December 2009 - 08:13 PM

yea
/say This is &a blue!

(I think &a is blue.)
Posted Image

#5

Ulrich200

Posted 07 December 2009 - 08:20 PM

Just using &1-9 or &a-f won't work.
You have to place a ÿ in front of it.

ex. (from cMss)
server.say(chr(255) + "&4 this is red")
chr(255) = ÿ
Minecraft Name: KakashiSuno

I'm known as Kakashi, Kaka, KS, and the Coal Ninja =)

#6

SteGriff
    SteGriff

    Retired Staff

  • Retired Staff
  • 2540 posts
  • Location: Southport, UK
  • Minecraft: SteGriff

Posted 07 December 2009 - 08:28 PM

I'm not using cMss or anything. Just dexter's backup tool.
~SteGriff
Minecrafting since July '09.

#7

SeanNanoware

Posted 07 December 2009 - 08:36 PM

Quote

Just using &1-9 or &a-f won't work.
You have to place a ÿ in front of it.

ex. (from cMss)
server.say(chr(255) + "&4 this is red")
chr(255) = ÿ
I don't have to do that. sing the defaut server works fine
Posted Image

#8

Ulrich200

Posted 07 December 2009 - 08:47 PM

I guess cMss just blocks it without chr(255).
Minecraft Name: KakashiSuno

I'm known as Kakashi, Kaka, KS, and the Coal Ninja =)

#9

chariot
    chariot

    Redstone Miner

  • Members
  • 516 posts

Posted 07 December 2009 - 08:55 PM

With the default server, the first character in a /say command cannot be a different color. With the script I run, I try to give the text some kind of wrapper, like "[&cthis is red&e]" would make both the [ and ] yellow, but the text inside it would be red. The first character is always yellow by default, and I don't think you can change it.

And there are a few ways you can get "the game broke!" from this, mostly just by sending &&&&&& or &a&b&c with no text to go with it.

This image (borrowed from WoM) shows all available colors:
Posted Image

#10

calzoneman

Posted 07 December 2009 - 09:26 PM

The reason it says "The game broke" is that you cannot have a color code at the end of a string being printed.
Ex: "&cHello There!&f" will break the game, "&cHello There!" will not.
Posted Image
[bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf]

#11

SteGriff
    SteGriff

    Retired Staff

  • Retired Staff
  • 2540 posts
  • Location: Southport, UK
  • Minecraft: SteGriff

Posted 07 December 2009 - 09:43 PM

Got it now guys, thanks.
This feature should be documented.
~SteGriff
Minecrafting since July '09.

#12

Zuriki
    Zuriki

    Forum/Wiki Sponsor

  • Curse Premium
  • 5317 posts
  • Location: The Netherlands
  • Minecraft: gdscei

Posted 07 December 2009 - 11:37 PM

I find colours don't appear unless I put a dot prior to the code:

say .&xWhatever


#13

chariot
    chariot

    Redstone Miner

  • Members
  • 516 posts

Posted 07 December 2009 - 11:59 PM

Quote

I find colours don't appear unless I put a dot prior to the code:

say .&xWhatever
Should work the same with any other character.

#14

SeanNanoware

Posted 07 December 2009 - 11:59 PM

Actually it can be any letter
ninjad
Posted Image

#15

mail2345
    mail2345

    Void Walker

  • Members
  • 1529 posts

Posted 08 December 2009 - 12:43 AM

Yes, that's why there is the chr(255). chr(255) is invisible to the client.
EDIT:
Like chr(255) + "&fNotch: Why hello there."
I disagree with you, therefore you are wrong.
Quality of output = Skill * Effort

#16

aeomin
    aeomin

    Zombie Killer

  • Members
  • 213 posts

Posted 08 December 2009 - 04:57 AM

Something strange about this packet is that, if the default text color is yellow then you have to put a character in front, but if the text is white then you don't have to.
However, official server only allows send yellow one(/say)...

#17

ATM
    ATM

    Tree Puncher

  • Members
  • 20 posts

Posted 11 December 2009 - 01:18 AM

Yeah its like &1-9 and &a-g i think

#18

LG_Legacy
    LG_Legacy

    Glowstone Miner

  • Members
  • 3718 posts

Posted 11 December 2009 - 01:34 AM

Oh look: viewtopic.php?pid=45874#p45874
#Minecraft ChanOp
#MinecraftHelp ChanOp
#SMP Channel Founder/Owner
#Archives ChanOp

#19

calzoneman

Posted 11 December 2009 - 03:09 AM

Quote

Yeah its like &1-9 and &a-g i think
it starts at &0 and ends at &f I believe (hex digits)
Posted Image
[bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf] [bookshelf]

#20

chariot
    chariot

    Redstone Miner

  • Members
  • 516 posts

Posted 11 December 2009 - 04:24 AM

Look at the freakin picture I posted.