Skip to content

Markdown Syntax

hp-1e edited this page Dec 3, 2026 · 2 revisions

Markdown & Media Syntax

Language: English | 中文

Embedding External Documents

Add a standalone reference line inside any FTB Quests description:

{quest_markdown:example.md}
{quest_markdown:chapters/chapter1/intro.md}

Multi-Language Fallback

When enableLanguageFallback = true (default), requesting guide.md on a zh_cn client resolves in this order:

  1. <docsDirectory>/zh_cn/guide.md
  2. <docsDirectory>/guide.md

Relative paths are strictly sandboxed inside <docsDirectory> to prevent directory traversal outside the configured folder.


Supported Markdown Features

Element Syntax Example Notes
Headings # H1 .. ###### H6 Scaled bold headings with underline dividers for H1 / H2
Emphasis **bold**, *italic*, ***bold italic***, ~~strike~~ Uses dedicated bold TrueType face when available
Inline Code `config/quest_markdown-common.toml` Rendered with monospace font inside bordered pill boxes
Color Codes &6Gold &aGreen &bAqua Compatible with Minecraft / FTB & formatting codes
Blockquotes > Tip: edit in VS Code and reload! Rendered with a left accent bar and subtle backdrop
Lists & Checklists - item, 1. step, - [x] done, - [ ] todo Supports nested indentation
Code Blocks ```java ... ``` Monospace block with language badge
Tables Standard GFM pipe tables (:---, :---:, ---:) Automatic column width balancing and alignment
Horizontal Rule --- or *** Full-width subtle divider
Links [Visit GitHub](https://github.com/...) Clickable links with hover highlight

Images, Resource-Pack Textures & Animated GIFs

Use standard Markdown image syntax ![Caption](source):

1. Local Images & GIFs in docs/ (Multiplayer Synced)

Place .png, .jpg, .jpeg, .gif, or .drawio.png files inside config/quest_markdown/docs/. Relative paths are resolved from the current .md file's folder first (supporting ../ parent segments), then from the docs/ root:

![Diagram](images/crafting_tree.png)
![Animation](../demo_anim.gif)

In multiplayer, clients automatically fetch local images and GIFs from the server on demand and cache them by file modification timestamp (respecting maxAssetBytes).

2. Resource-Pack Textures (Static & GIF)

Reference Minecraft or mod resource-pack assets directly by namespace or assets/ path:

![Diamond Block](assets/minecraft/textures/block/diamond_block.png)
![Custom Texture](minecraft:textures/item/nether_star.png)
![Short Path](minecraft:block/emerald_block)

3. Item Icons

Render any registered item icon inline as an image block:

![Diamond Pickaxe](item:minecraft:diamond_pickaxe)

Animated GIF Playback

Multi-frame GIFs (from either docs/ or resource packs) are decoded with full transparency, per-frame delay, and GIF disposal handling, then played smoothly inside the quest panel.


Embedding Native FTB Quests Description Elements (```ftb)

Wrap any native FTB Quests description lines inside a ```ftb (aliases: ```ftbq, ```ftbquests) fenced block to reuse FTB Quests' own parser and native widgets (QuestDescriptionField and ImageComponentWidget) directly inside Markdown — preserving 100% identical appearance, hover tooltips, click actions, and compatibility with other FTB Quests addons (such as FTB Quest Enhance):

```ftb
{"text":"[Jump to Quest]","color":"gold","bold":true,"clickEvent":{"action":"change_page","value":"1111111111111111"},"hoverEvent":{"action":"show_text","contents":"Open target quest"}}
[
  {"text":"Multi-line JSON: ","color":"gray"},
  {
    "text":"[Hover Diamond Sword & Copy]",
    "color":"aqua",
    "underlined":true,
    "clickEvent":{"action":"copy_to_clipboard","value":"/say hello"},
    "hoverEvent":{"action":"show_item","contents":{"id":"minecraft:diamond_sword","count":1}}
  }
]
{image:minecraft:textures/item/nether_star.png width:32 height:32 align:center click_action:open_quest:1111111111111111}
&eNative &aFTB &bcolor codes &rand translation keys
```
  • One entry per line (paste straight from FTB Quests descriptions), plus automatic merging for pretty-printed multi-line JSON objects/arrays.
  • Supports all native features: Raw JSON clickEvent (change_page, open_url, run_command, suggest_command, copy_to_clipboard) and hoverEvent (show_text, show_item, show_entity), {image:...} with click actions, {text:...}, translation keys, & formatting codes, and addon extensions registered on QuestDescriptionField / ImageComponentWidget.
  • Edit-mode safety: Embedded native widgets are read-only in edit mode so right-clicking or double-clicking them never overwrites the {quest_markdown:...} line in the quest.
  • Note on {@pagebreak}: FTB page breaks are pre-indexed on the quest's top-level description list; to split Markdown across pages, use separate {quest_markdown:page1.md} / {@pagebreak} / {quest_markdown:page2.md} lines in the quest description.