Template:Format

From MinecraftOnline
Revision as of 21:14, 23 February 2025 by Crafter Keegan (talk | contribs) (Create template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Syntax

Allows text to be formatted using Minecraft's formatting codes.

Template parameters

ParameterDescriptionTypeStatus
code1

The formatting code or its associated name

Example
d
Stringoptional
text2

The text to be formatted

Example
Silly
Stringrequired

Usage

Type {{Format|d|Silly}} to obtain Silly.

See Minecraft_Wiki_Icon.png formatting codes for a list of valid formatting codes, the source code of this page for some aliases for them, and the notes below for special cases.

Notes

  • The formatting code k, which yields the obfuscated/magical text in-game, is currently represented in this template by using a dingbat font; it is therefore recommended to use a random string of the desired length for the second parameter when this is used, so as to minimize repitition.
  • For bold, strikethrough, underlined, and italic formatting, it is probably still best to respectively use '''bold''', <s>strikethrough</s>, <u>underlined</u>, and ''italic''; they are only included in this template for the sake of completeness.
  • In cases where the contents of the first parameter are invalid or unchanged, this template yields the unformatted text of the second parameter.
  • Where Java Edition and Bedrock Edition yield different results for the same one-character code, the Java Edition variant is prioritized (other options are given to access the Bedrock Edition variants, as desribed below).
  • Most formatting options are most easily accessed by specifying a singular character as the first parameter, as listed on the Minecraft_Wiki_Icon.png formatting codes page on Minecraft Wiki; there are five exceptions to this, however:
    • As an alternative to the formatting code 6, a brown colour based on the one commonly used in the 1981 Color Graphics Adapter, can be accessed by using brown as the first parameter.
    • As another alternative to the formatting code 6, a dark yellow based on the unchanged variant of the above colour, can be accessed using dark_yellow as the first parameter.
    • Since the specific shade of grey produced by the formatting code 7 is different in Java Edition and Bedrock Edition, the one from the latter can be accessed using bedrock_grey as the first parameter.
    • Since the formatting code m is used for strikethrough text in Java Edition and redstone-coloured text in Bedrock Edition, the latter can be accessed using redstone as the first parameter.
    • Since the formatting code n is used for underlined text in Java Edition and copper-coloured text in Bedrock Edition, the latter can be accessed using copper as the first parameter.