Class MinecraftString<T>

Type Parameters

  • T extends string

    Raw string to be parsed.

Hierarchy

  • MinecraftString

Constructors

  • Construct a Minecraft string from a string of text, can include color and style codes.

    Type Parameters

    • T extends string

    Parameters

    • text: `§f§r${T}`

      The text to parse.

    • unsafe: boolean = false

      Test the length against the Java string limit instead of Minecraft's.

    Returns MinecraftString<T>

Properties

raw: `§f§r${T}`
segments: SimpleMinecraftString<string, ColorObj, SegmentOptions<ColorObj, TsegmentOptions<ColorObj>>>[] = []

The segments of the Minecraft string.

text: string

Clean stripped coloring & styling codes text

colorRegex: RegExp = ...
javaStringLimit: 2147483647 = 2_147_483_647
mcStringLimit: 262144 = 262_144
regex: RegExp = ...

Regular expression to match Minecraft color & style codes.

styleMap: {
    k: "obfuscated";
    l: "bold";
    m: "strikethrough";
    n: "underlined";
    o: "italic";
    r: "reset";
} = ...

Object containing the style codes and their corresponding style.

Type declaration

  • Readonly k: "obfuscated"
  • Readonly l: "bold"
  • Readonly m: "strikethrough"
  • Readonly n: "underlined"
  • Readonly o: "italic"
  • Readonly r: "reset"
styleRegex: RegExp = ...

Accessors

Methods

  • Export the Minecraft string to a list of simple Minecraft strings.

    Returns

    Vanilla Minecraft text with the given formatting.

    Type Parameters

    • T extends boolean = false

    Parameters

    • nbt: T = ...

    Returns RawMCString<T, string[]>

Generated using TypeDoc