Options
All
  • Public
  • Public/Protected
  • All
Menu

RawJSONBuilder

📦 Minecraft Raw JSON text builder.

npm version

📖 Documentation

Install 📦

npm i rawjsonbuilder

Usage 🔧

import { text, TextComponent } from "rawjsonbuilder"; // ESM
// OR
const { text, TextComponent } = require("rawjsonbuilder"); // CommonJS

text("Hello World!", "black")
    .toRawString(); // §0Hello World!

const builder = new TextComponent()
    .setText("Hello World!")
    .setBold()
    .addSpace()
    .addExtra(
        text("Nice to meet you!", "red")
    )
    .toRawString(); // §lHello World! §cNice to meet you!

Index

Type aliases

ClickActionUnion

ClickActionUnion: "open_url" | "open_file" | "run_command" | "suggest_command" | "change_page" | "copy_to_clipboard"

ColorUnion

ColorUnion: "black" | "dark_blue" | "dark_green" | "dark_aqua" | "dark_red" | "dark_purple" | "gold" | "gray" | "dark_gray" | "blue" | "green" | "aqua" | "red" | "light_purple" | "yellow" | "white" | "reset"

ComponentsUnion

HoverActionUnion

HoverActionUnion: "show_text" | "show_item" | "show_entity"

RawBaseComponent

RawBaseComponent: Partial<Pick<BaseComponent, "color" | "font" | "bold" | "italic" | "underlined" | "strikethrough" | "obfuscated" | "insertion" | "clickEvent" | "hoverEvent" | "extra">>

RawComponent

RawComponent<C>: RawBaseComponent & C

Type parameters

  • C

RawComponentsUnion

RawJSON

RawKeybindComponent

RawKeybindComponent: RawComponent<Pick<KeybindComponent, "keybind">>

RawNBTComponent

RawNBTComponent: RawComponent<Pick<NBTComponent, "nbt" | "interpret" | "block" | "entity" | "storage">>

RawScoreComponent

RawScoreComponent: RawComponent<Pick<ScoreComponent, "score">>

RawSelectorComponent

RawSelectorComponent: RawComponent<Pick<SelectorComponent, "selector">>

RawTextComponent

RawTextComponent: RawComponent<Pick<TextComponent, "text">>

RawTranslateComponent

RawTranslateComponent: RawComponent<Pick<TranslateComponent, "translate"> & Partial<Pick<TranslateComponent, "with">>>

Variables

Const parser

parser: any = ...

Functions

keybind

nbt

parse

score

selector

text

translate

Legend

  • Constructor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Property
  • Protected method

Generated using TypeDoc