From 5311a07f296f4c803eeda4df4ce78543297ef008 Mon Sep 17 00:00:00 2001 From: set Date: Mon, 18 Aug 2025 23:19:42 +0200 Subject: [PATCH 01/14] fix(deps): add @shikijs/types dependency version ^3.9.2 --- bun.lock | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/bun.lock b/bun.lock index 8e79bc2..9a0706d 100644 --- a/bun.lock +++ b/bun.lock @@ -5,6 +5,7 @@ "name": "thenextlvl-docs", "dependencies": { "@icons-pack/react-simple-icons": "^13.3.0", + "@shikijs/types": "^3.9.2", "fumadocs-core": "15.6.12", "fumadocs-mdx": "11.7.5", "fumadocs-ui": "15.6.12", diff --git a/package.json b/package.json index bf1d468..5e2580c 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@icons-pack/react-simple-icons": "^13.3.0", + "@shikijs/types": "^3.9.2", "fumadocs-core": "15.6.12", "fumadocs-mdx": "11.7.5", "fumadocs-ui": "15.6.12", From 453960295a30e4da6ee5fa99953849a9d9835b88 Mon Sep 17 00:00:00 2001 From: set Date: Mon, 18 Aug 2025 23:19:53 +0200 Subject: [PATCH 02/14] feat: add command color transformer and color definitions for syntax highlighting --- source.config.ts | 20 ++++-- src/lib/command-colors.ts | 52 ++++++++++++++ src/lib/command-transformer.ts | 123 +++++++++++++++++++++++++++++++++ 3 files changed, 191 insertions(+), 4 deletions(-) create mode 100644 src/lib/command-colors.ts create mode 100644 src/lib/command-transformer.ts diff --git a/source.config.ts b/source.config.ts index 1abf7bd..dccb4eb 100644 --- a/source.config.ts +++ b/source.config.ts @@ -1,4 +1,5 @@ -import { defineConfig, defineDocs, frontmatterSchema, metaSchema } from "fumadocs-mdx/config" +import { defineConfig, defineDocs, frontmatterSchema, metaSchema } from "fumadocs-mdx/config"; +import { transformerCommandColor } from "./src/lib/command-transformer"; // You can customise Zod schemas for frontmatter and `meta.json` here // see https://fumadocs.vercel.app/docs/mdx/collections#define-docs @@ -9,10 +10,21 @@ export const docs = defineDocs({ meta: { schema: metaSchema, }, -}) +}); export default defineConfig({ mdxOptions: { - // MDX options + rehypeCodeOptions: { + themes: { + light: "github-light", + dark: "github-dark", + }, + langAlias: { + command: 'text', + }, + transformers: [ + transformerCommandColor(), + ], + }, }, -}) +}); diff --git a/src/lib/command-colors.ts b/src/lib/command-colors.ts new file mode 100644 index 0000000..6c6e21e --- /dev/null +++ b/src/lib/command-colors.ts @@ -0,0 +1,52 @@ +export interface CommandColor { + hsl: string; +} + +/** + * Represents a color used by the command highlighter. + * Currently only HSL is used by the transformer for inline styles. + * + * @example + * ```command + * content + * ``` + */ +export const commandColors: Record = { + green: { + hsl: "hsl(142, 76%, 36%)", + }, + red: { + hsl: "hsl(0, 84%, 60%)", + }, + blue: { + hsl: "hsl(221, 83%, 53%)", + }, + yellow: { + hsl: "hsl(48, 96%, 53%)", + }, + purple: { + hsl: "hsl(262, 83%, 58%)", + }, + orange: { + hsl: "hsl(25, 95%, 53%)", + }, + cyan: { + hsl: "hsl(187, 100%, 42%)", + }, + pink: { + hsl: "hsl(330, 81%, 60%)", + }, + gray: { + hsl: "hsl(215, 16%, 47%)", + }, + white: { + hsl: "hsl(0, 0%, 100%)", + }, + black: { + hsl: "hsl(0, 0%, 0%)", + } +}; + +export function getCommandColor(colorName: string): CommandColor | null { + return commandColors[colorName.toLowerCase()] || null; +} diff --git a/src/lib/command-transformer.ts b/src/lib/command-transformer.ts new file mode 100644 index 0000000..4c91352 --- /dev/null +++ b/src/lib/command-transformer.ts @@ -0,0 +1,123 @@ +import type { ShikiTransformer, ThemedToken } from '@shikijs/types' +import { getCommandColor } from './command-colors' + +interface ColorContentRange { + start: number + end: number + color: string +} + +interface HideRange { + start: number + end: number +} + +interface MetaRanges { + contents: ColorContentRange[] + hides: HideRange[] +} + +function detectRanges(code: string): MetaRanges { + const contents: ColorContentRange[] = [] + const hides: HideRange[] = [] + + const re = /<([A-Za-z]+)>([\s\S]*?)<\/\1>/g + let match: RegExpExecArray | null + while ((match = re.exec(code)) !== null) { + const [full, colorName, inner] = match + const openStart = match.index + const openEnd = openStart + `<${colorName}>`.length + const closeEnd = openStart + full.length + const closeStart = closeEnd - ``.length + hides.push({ start: openStart, end: openEnd }) + hides.push({ start: closeStart, end: closeEnd }) + contents.push({ start: openEnd, end: closeStart, color: colorName }) + } + + return { contents, hides } +} + +function splitTokenAtOffsets(token: ThemedToken, breakpoints: number[]): ThemedToken[] { + if (!breakpoints.length) return [token] + const local = Array.from(new Set(breakpoints.filter(bp => bp > token.offset && bp < token.offset + token.content.length))) + .sort((a, b) => a - b) + + if (!local.length) return [token] + + const result: ThemedToken[] = [] + let last = 0 + for (const bp of local) { + const idx = bp - token.offset + if (idx > last) { + result.push({ ...token, content: token.content.slice(last, idx), offset: token.offset + last }) + } + last = idx + } + if (last < token.content.length) { + result.push({ ...token, content: token.content.slice(last), offset: token.offset + last }) + } + return result +} + +export function transformerCommandColor(): ShikiTransformer { + const map = new WeakMap() + + return { + name: 'color-tags', + preprocess(code) { + const ranges = detectRanges(code) + const metaKey = (this as unknown as { meta?: object }).meta ?? {} + map.set(metaKey, ranges) + return undefined + }, + tokens(lines) { + const metaKey = (this as unknown as { meta?: object }).meta ?? {} + const ranges = map.get(metaKey) + if (!ranges) return lines + + return lines.map((line) => { + if (!line.length) return line + + const start = line[0] + const end = line[line.length - 1] + const lineStart = start.offset + const lineEnd = end.offset + end.content.length + + const bps: number[] = [] + for (const r of [...ranges.hides, ...ranges.contents]) { + if (r.start > lineStart && r.start < lineEnd) bps.push(r.start) + if (r.end > lineStart && r.end < lineEnd) bps.push(r.end) + } + + if (!bps.length) return line + + const splitted = line.flatMap(t => splitTokenAtOffsets(t, bps)) + + const styled: ThemedToken[] = splitted.map(seg => { + const inHide = ranges.hides.some(r => r.start <= seg.offset && seg.offset + seg.content.length <= r.end) + if (inHide) { + return { + ...seg, + htmlStyle: { ...(seg.htmlStyle || {}), display: 'none' }, + } + } + + const contentRange = ranges.contents.find(r => r.start <= seg.offset && seg.offset + seg.content.length <= r.end) + if (contentRange) { + const cfg = getCommandColor(contentRange.color) + if (cfg) { + return { + ...seg, + htmlStyle: { ...(seg.htmlStyle || {}), color: cfg.hsl }, + } + } + } + + return seg + }) + + return styled + }) + }, + } +} From 65fbf971ff94c272268b3acb100c29aa2f8658c9 Mon Sep 17 00:00:00 2001 From: set Date: Fri, 22 Aug 2025 11:36:29 +0200 Subject: [PATCH 03/14] chore: update package manager from yarn to bun@1.2.20 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c551981..6d4393a 100644 --- a/package.json +++ b/package.json @@ -32,5 +32,5 @@ "tailwindcss": "^4.1.12", "typescript": "^5.9.2" }, - "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" + "packageManager": "bun@1.2.20" } \ No newline at end of file From 787dd7c235ea293bd4720662abb6c764b2026146 Mon Sep 17 00:00:00 2001 From: set Date: Fri, 22 Aug 2025 11:36:48 +0200 Subject: [PATCH 04/14] chore(deps): add @shikijs/types dependency version 3.11.0 --- bun.lock | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/bun.lock b/bun.lock index 1f79de7..d614ec0 100644 --- a/bun.lock +++ b/bun.lock @@ -5,6 +5,7 @@ "name": "thenextlvl-docs", "dependencies": { "@icons-pack/react-simple-icons": "^13.7.0", + "@shikijs/types": "^3.11.0", "fumadocs-core": "15.7.0", "fumadocs-mdx": "11.8.0", "fumadocs-ui": "15.7.0", diff --git a/package.json b/package.json index 6d4393a..deba0dd 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@icons-pack/react-simple-icons": "^13.7.0", + "@shikijs/types": "^3.11.0", "fumadocs-core": "15.7.0", "fumadocs-mdx": "11.8.0", "fumadocs-ui": "15.7.0", From 9aa5ac41745a71fc95be76abc69bfaf071835c44 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 22 Aug 2025 16:44:26 +0200 Subject: [PATCH 05/14] fix(docs): update clone command examples for better readability --- content/docs/worlds/manage/clone.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/worlds/manage/clone.mdx b/content/docs/worlds/manage/clone.mdx index 8c15bf2..85201b6 100644 --- a/content/docs/worlds/manage/clone.mdx +++ b/content/docs/worlds/manage/clone.mdx @@ -15,11 +15,11 @@ The `template` option defines whether the cloned world should be regenerated or Example on how to create an exact copy of a world (1:1): ``` -/world clone worlds:my_world my_world_copy +/world clone worlds:my_world my_world_copy ``` Example on how to clone a world's generation settings (no region data, scoreboards, player data, etc.): -``` -/world clone worlds:my_world my_world_copy template +```text +/world clone worlds:my_world my_world_copy template ``` From 045b0ef83ca61c56ef3654cc39b5c6ea27a7b15b Mon Sep 17 00:00:00 2001 From: set Date: Fri, 22 Aug 2025 16:53:15 +0200 Subject: [PATCH 06/14] refactor: optimize token styling logic in transformerCommandColor function --- src/lib/command-transformer.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/lib/command-transformer.ts b/src/lib/command-transformer.ts index 4c91352..1f053a3 100644 --- a/src/lib/command-transformer.ts +++ b/src/lib/command-transformer.ts @@ -93,15 +93,9 @@ export function transformerCommandColor(): ShikiTransformer { const splitted = line.flatMap(t => splitTokenAtOffsets(t, bps)) - const styled: ThemedToken[] = splitted.map(seg => { - const inHide = ranges.hides.some(r => r.start <= seg.offset && seg.offset + seg.content.length <= r.end) - if (inHide) { - return { - ...seg, - htmlStyle: { ...(seg.htmlStyle || {}), display: 'none' }, - } - } - + const styled: ThemedToken[] = splitted.filter(seg => { + return !ranges.hides.some(r => r.start <= seg.offset && seg.offset + seg.content.length <= r.end) + }).map(seg => { const contentRange = ranges.contents.find(r => r.start <= seg.offset && seg.offset + seg.content.length <= r.end) if (contentRange) { const cfg = getCommandColor(contentRange.color) @@ -112,7 +106,6 @@ export function transformerCommandColor(): ShikiTransformer { } } } - return seg }) From c42f8e51c5a156f70b0ad72346ce6e0972e388d6 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 22 Aug 2025 16:53:20 +0200 Subject: [PATCH 07/14] refactor(colors): simplify command color representation and improve formatting --- src/lib/command-colors.ts | 62 +++++++++++----------------------- src/lib/command-transformer.ts | 35 ++++++++++++------- 2 files changed, 43 insertions(+), 54 deletions(-) diff --git a/src/lib/command-colors.ts b/src/lib/command-colors.ts index 6c6e21e..e27b908 100644 --- a/src/lib/command-colors.ts +++ b/src/lib/command-colors.ts @@ -1,52 +1,30 @@ -export interface CommandColor { - hsl: string; -} - /** * Represents a color used by the command highlighter. - * Currently only HSL is used by the transformer for inline styles. * * @example * ```command * content * ``` */ -export const commandColors: Record = { - green: { - hsl: "hsl(142, 76%, 36%)", - }, - red: { - hsl: "hsl(0, 84%, 60%)", - }, - blue: { - hsl: "hsl(221, 83%, 53%)", - }, - yellow: { - hsl: "hsl(48, 96%, 53%)", - }, - purple: { - hsl: "hsl(262, 83%, 58%)", - }, - orange: { - hsl: "hsl(25, 95%, 53%)", - }, - cyan: { - hsl: "hsl(187, 100%, 42%)", - }, - pink: { - hsl: "hsl(330, 81%, 60%)", - }, - gray: { - hsl: "hsl(215, 16%, 47%)", - }, - white: { - hsl: "hsl(0, 0%, 100%)", - }, - black: { - hsl: "hsl(0, 0%, 0%)", - } -}; +export const commandColors: Record = { + black: "#000000", + dark_blue: "#0000aa", + dark_green: "#00aa00", + dark_aqua: "#00aaaa", + dark_red: "#aa0000", + dark_purple: "#aa00aa", + gold: "#ffaa00", + gray: "#aaaaaa", + dark_gray: "#555555", + blue: "#5555ff", + green: "#55ff55", + aqua: "#55ffff", + red: "#ff5555", + light_purple: "#ff55ff", + yellow: "#ffff55", + white: "#ffffff", +} -export function getCommandColor(colorName: string): CommandColor | null { - return commandColors[colorName.toLowerCase()] || null; +export function getCommandColor(colorName: string): string | null { + return commandColors[colorName.toLowerCase()] || null } diff --git a/src/lib/command-transformer.ts b/src/lib/command-transformer.ts index 4c91352..436e591 100644 --- a/src/lib/command-transformer.ts +++ b/src/lib/command-transformer.ts @@ -1,5 +1,5 @@ -import type { ShikiTransformer, ThemedToken } from '@shikijs/types' -import { getCommandColor } from './command-colors' +import type { ShikiTransformer, ThemedToken } from "@shikijs/types" +import { getCommandColor } from "./command-colors" interface ColorContentRange { start: number @@ -39,8 +39,11 @@ function detectRanges(code: string): MetaRanges { function splitTokenAtOffsets(token: ThemedToken, breakpoints: number[]): ThemedToken[] { if (!breakpoints.length) return [token] - const local = Array.from(new Set(breakpoints.filter(bp => bp > token.offset && bp < token.offset + token.content.length))) - .sort((a, b) => a - b) + const local = Array.from( + new Set( + breakpoints.filter((bp) => bp > token.offset && bp < token.offset + token.content.length), + ), + ).sort((a, b) => a - b) if (!local.length) return [token] @@ -49,7 +52,11 @@ function splitTokenAtOffsets(token: ThemedToken, breakpoints: number[]): ThemedT for (const bp of local) { const idx = bp - token.offset if (idx > last) { - result.push({ ...token, content: token.content.slice(last, idx), offset: token.offset + last }) + result.push({ + ...token, + content: token.content.slice(last, idx), + offset: token.offset + last, + }) } last = idx } @@ -63,7 +70,7 @@ export function transformerCommandColor(): ShikiTransformer { const map = new WeakMap() return { - name: 'color-tags', + name: "color-tags", preprocess(code) { const ranges = detectRanges(code) const metaKey = (this as unknown as { meta?: object }).meta ?? {} @@ -91,24 +98,28 @@ export function transformerCommandColor(): ShikiTransformer { if (!bps.length) return line - const splitted = line.flatMap(t => splitTokenAtOffsets(t, bps)) + const splitted = line.flatMap((t) => splitTokenAtOffsets(t, bps)) - const styled: ThemedToken[] = splitted.map(seg => { - const inHide = ranges.hides.some(r => r.start <= seg.offset && seg.offset + seg.content.length <= r.end) + const styled: ThemedToken[] = splitted.map((seg) => { + const inHide = ranges.hides.some( + (r) => r.start <= seg.offset && seg.offset + seg.content.length <= r.end, + ) if (inHide) { return { ...seg, - htmlStyle: { ...(seg.htmlStyle || {}), display: 'none' }, + htmlStyle: { ...(seg.htmlStyle || {}), display: "none" }, } } - const contentRange = ranges.contents.find(r => r.start <= seg.offset && seg.offset + seg.content.length <= r.end) + const contentRange = ranges.contents.find( + (r) => r.start <= seg.offset && seg.offset + seg.content.length <= r.end, + ) if (contentRange) { const cfg = getCommandColor(contentRange.color) if (cfg) { return { ...seg, - htmlStyle: { ...(seg.htmlStyle || {}), color: cfg.hsl }, + htmlStyle: { ...(seg.htmlStyle || {}), color: cfg }, } } } From a4ab741190b30704b7f335a4e5295d06f8406617 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 22 Aug 2025 16:58:06 +0200 Subject: [PATCH 08/14] fix(docs): update example command formatting for clarity and color coding --- content/docs/worlds/manage/create.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/worlds/manage/create.mdx b/content/docs/worlds/manage/create.mdx index 476d42f..26683df 100644 --- a/content/docs/worlds/manage/create.mdx +++ b/content/docs/worlds/manage/create.mdx @@ -93,8 +93,8 @@ Options are specified as `option value` pairs, and can be used in any given orde Creating a normal world with structures disabled, a bonus chest, and a specific seed: -``` -/world create "A cool new world" type normal structures false bonus-chest true seed 123456789 +```text +/world create "A cool new world" type normal structures false bonus-chest true seed 123456789 ``` Creating a nether world with a specificified key: From d13baa5b5b7f3f3d2402e30c781d6874b2d48f6d Mon Sep 17 00:00:00 2001 From: david Date: Fri, 22 Aug 2025 17:04:11 +0200 Subject: [PATCH 09/14] fix(docs): correct code block formatting in clone command examples --- content/docs/worlds/manage/clone.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/worlds/manage/clone.mdx b/content/docs/worlds/manage/clone.mdx index 85201b6..89f8e80 100644 --- a/content/docs/worlds/manage/clone.mdx +++ b/content/docs/worlds/manage/clone.mdx @@ -20,6 +20,6 @@ Example on how to create an exact copy of a world (1:1): Example on how to clone a world's generation settings (no region data, scoreboards, player data, etc.): -```text +``` /world clone worlds:my_world my_world_copy template ``` From 4e2f79f4fd3e0035670c78afb071bc8c70cb056f Mon Sep 17 00:00:00 2001 From: david Date: Fri, 22 Aug 2025 17:04:16 +0200 Subject: [PATCH 10/14] fix(docs): enhance command examples with color coding for better readability --- content/docs/worlds/manage/create.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/docs/worlds/manage/create.mdx b/content/docs/worlds/manage/create.mdx index 26683df..85c5b53 100644 --- a/content/docs/worlds/manage/create.mdx +++ b/content/docs/worlds/manage/create.mdx @@ -17,7 +17,7 @@ If you don't specify any of these options, the default world settings will be us Creating a new world with the default settings: ``` -/world create "My New World" +/world create "My New World" ``` ## Using a world generator plugin @@ -31,7 +31,7 @@ The generator argument takes the name of the plugin that provides the custom chu PlotSquared generation example: ``` -/world create city generator PlotSquared +/world create city generator PlotSquared ``` ## Defining the world type @@ -54,7 +54,7 @@ The following types are available: Amplified world example: ``` -/world create Amplified type amplified +/world create Amplified type amplified ``` ## Using a flat world preset @@ -73,7 +73,7 @@ Check out the [Creating a world preset](/docs/worlds/presets) documentation. Void world example: ``` -/world create "My Void World" preset the-void +/world create "My Void World" preset the-void ``` ## Additional options @@ -93,20 +93,20 @@ Options are specified as `option value` pairs, and can be used in any given orde Creating a normal world with structures disabled, a bonus chest, and a specific seed: -```text +``` /world create "A cool new world" type normal structures false bonus-chest true seed 123456789 ``` Creating a nether world with a specificified key: ``` -/world create "My Nether World" type normal dimension nether key citybuild:farmworld/nether +/world create "My Nether World" type normal dimension nether key citybuild:farmworld/nether ``` To create a default world without any custom options, you can use: ``` -/world create "My Default World" +/world create "My Default World" ``` ## Available Dimensions From 5938541579e91335f563ff91dd67e9e2c7619d25 Mon Sep 17 00:00:00 2001 From: set Date: Fri, 22 Aug 2025 17:07:17 +0200 Subject: [PATCH 11/14] fix(transformer): update regex to support additional color tag formats --- src/lib/command-transformer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/command-transformer.ts b/src/lib/command-transformer.ts index 4e60f87..664dbbd 100644 --- a/src/lib/command-transformer.ts +++ b/src/lib/command-transformer.ts @@ -21,7 +21,7 @@ function detectRanges(code: string): MetaRanges { const contents: ColorContentRange[] = [] const hides: HideRange[] = [] - const re = /<([A-Za-z]+)>([\s\S]*?)<\/\1>/g + const re = /<([A-Za-z_+-]+)>([\s\S]*?)<\/\1>/g let match: RegExpExecArray | null while ((match = re.exec(code)) !== null) { const [full, colorName, inner] = match From cb0e724bd2626df5694bb86a8f3f1ec2583747e5 Mon Sep 17 00:00:00 2001 From: set Date: Fri, 22 Aug 2025 17:15:16 +0200 Subject: [PATCH 12/14] fix(docs): enhance command examples with color tags --- content/docs/characters/manage/actions.mdx | 16 ++++++++-------- content/docs/characters/manage/create.mdx | 4 ++-- content/docs/characters/manage/delete.mdx | 2 +- content/docs/characters/manage/equipment.mdx | 6 +++--- content/docs/characters/manage/skins.mdx | 12 ++++++------ content/docs/characters/manage/tag.mdx | 6 +++--- content/docs/perworlds/manage/add.mdx | 6 +++--- content/docs/perworlds/manage/create.mdx | 2 +- content/docs/perworlds/manage/delete.mdx | 2 +- content/docs/perworlds/manage/options.mdx | 4 ++-- content/docs/perworlds/manage/remove.mdx | 2 +- content/docs/worlds/manage/delete.mdx | 4 ++-- content/docs/worlds/manage/import.mdx | 8 ++++---- content/docs/worlds/manage/links.mdx | 8 ++++---- content/docs/worlds/manage/load-unload.mdx | 4 ++-- 15 files changed, 43 insertions(+), 43 deletions(-) diff --git a/content/docs/characters/manage/actions.mdx b/content/docs/characters/manage/actions.mdx index f3b4b4b..220ea0f 100644 --- a/content/docs/characters/manage/actions.mdx +++ b/content/docs/characters/manage/actions.mdx @@ -54,7 +54,7 @@ Using `` in a parameter will be replaced with the name of the player who To add a greeting action to a character named "Steve", use the following command: ``` -/character action add Steve greet any_click send-message Hello, ! +/character action add Steve greet any_click send-message Hello, ! ``` This action will be triggered on any click and sends `Hello, NonSwag!` if the player's name is NonSwag. @@ -81,7 +81,7 @@ To set a cooldown for an action, use the command: #### Example [!toc] [#cooldown-set-example] ``` -/character action cooldown Steve greet 10s +/character action cooldown Steve greet 10s ``` This sets a cooldown of **10 seconds** for the **greet** action of the character **Steve**. @@ -94,7 +94,7 @@ To view the current cooldown for an action, use the command #### Example [!toc] [#cooldown-view-example] ``` -/character action cooldown Steve greet +/character action cooldown Steve greet ``` --- @@ -112,7 +112,7 @@ To define a permission for an action, use the command #### Example [!toc] [#permission-set-example] ``` -/character action permission Steve greet set warm.welcome.permission +/character action permission Steve greet set warm.welcome.permission ``` ### Remove a Permission @@ -123,7 +123,7 @@ To remove a permission for an action, use the command #### Example [!toc] [#permission-remove-example] ``` -/character action permission Steve greet remove +/character action permission Steve greet remove ``` ### View Current Permission @@ -134,7 +134,7 @@ To view the current permission for an action, use the command #### Example [!toc] [#permission-view-example] ``` -/character action permission Steve greet +/character action permission Steve greet ``` --- @@ -147,7 +147,7 @@ To remove a specific action from a character, use the command ### Example [!toc] [#remove-example] ``` -/character action remove Steve greet +/character action remove Steve greet ``` --- @@ -159,6 +159,6 @@ List all actions configured for a character using `/character action list Steve ``` diff --git a/content/docs/characters/manage/create.mdx b/content/docs/characters/manage/create.mdx index 14a591c..545d94c 100644 --- a/content/docs/characters/manage/create.mdx +++ b/content/docs/characters/manage/create.mdx @@ -12,11 +12,11 @@ If you do not specify a type, the default type is `minecraft:player`. To create a player character named "Steve", you can use the following command: ``` -/character create Steve minecraft:player +/character create Steve minecraft:player ``` To create a zombie character named "Zed", you would use: ``` -/character create Zed minecraft:zombie +/character create Zed minecraft:zombie ``` diff --git a/content/docs/characters/manage/delete.mdx b/content/docs/characters/manage/delete.mdx index efaf90f..ce7562c 100644 --- a/content/docs/characters/manage/delete.mdx +++ b/content/docs/characters/manage/delete.mdx @@ -15,5 +15,5 @@ Deleting a character is permanent and cannot be undone. ## Example [!toc] ``` -/character delete Steve +/character delete Steve ``` diff --git a/content/docs/characters/manage/equipment.mdx b/content/docs/characters/manage/equipment.mdx index 224244e..95a96fc 100644 --- a/content/docs/characters/manage/equipment.mdx +++ b/content/docs/characters/manage/equipment.mdx @@ -21,7 +21,7 @@ To equip an item in a specific slot for a character, use the command: To equip a diamond helmet for a character named "Guardian", use: ``` -/character equipment set Guardian head minecraft:diamond_helmet +/character equipment set Guardian head minecraft:diamond_helmet ``` ## Clearing Equipment @@ -39,7 +39,7 @@ To clear a specific equipment slot for a character, use the command: To clear the chestplate slot for a character named "Warrior": ``` -/character equipment clear Warrior chest +/character equipment clear Warrior chest ``` ### Clear All Equipment @@ -52,7 +52,7 @@ To clear all equipment slots for a character, use the command To clear all equipment for a character named "Mage": ``` -/character equipment clear Mage +/character equipment clear Mage ``` ## Available Equipment Slots diff --git a/content/docs/characters/manage/skins.mdx b/content/docs/characters/manage/skins.mdx index 8b1e4c2..a3177c2 100644 --- a/content/docs/characters/manage/skins.mdx +++ b/content/docs/characters/manage/skins.mdx @@ -32,13 +32,13 @@ you can use the command `/character skin set player [slim]` Classic skins can be applied using the following command: ``` -/character skin set MyCharacter player Notch +/character skin set MyCharacter player Notch ``` To apply a slim skin, just append the `slim` option: ``` -/character skin set MyCharacter player Notch slim +/character skin set MyCharacter player Notch slim ``` ## Applying a Skin from File @@ -59,7 +59,7 @@ If the file is located in the server's main directory, you can use a relative pa To change a character's skin using a file, you can use the following command: ``` -/character skin set MyCharacter file "/home/skins/my_skin.png" +/character skin set MyCharacter file "/home/skins/my_skin.png" ``` ## Applying a Skin from URL @@ -77,7 +77,7 @@ You can change a character's skin using a URL with the command To change a character's skin using a URL, you can use the following command: ``` -/character skin set MyCharacter url "https://example.com/skin.png" +/character skin set MyCharacter url "https://example.com/skin.png" ``` ## Resetting a Skin @@ -85,7 +85,7 @@ To change a character's skin using a URL, you can use the following command: To reset a character's skin to default, you can use the following command: ``` -/character skin reset MyCharacter +/character skin reset MyCharacter ``` This will only reset the skin, not the skin layers. @@ -102,7 +102,7 @@ By default, all layers are shown. You can hide or show each layer individually. To hide a character's cape layer, you can use the following command: ``` -/character skin layer hide cape MyCharacter +/character skin layer hide cape MyCharacter ``` ### Available Skin Layers diff --git a/content/docs/characters/manage/tag.mdx b/content/docs/characters/manage/tag.mdx index f6ca4f0..62c5d2e 100644 --- a/content/docs/characters/manage/tag.mdx +++ b/content/docs/characters/manage/tag.mdx @@ -39,17 +39,17 @@ You can customize your character's nametag using the `/character tag` command. Set the nametag text: ``` -/character tag set text Hello there!Welcome to the game! +/character tag set text Hello there!Welcome to the game! ``` Change the background color to red: ``` -/character tag set background-color red +/character tag set background-color red ``` Reset the scale to default: ``` -/character tag reset scale +/character tag reset scale ``` diff --git a/content/docs/perworlds/manage/add.mdx b/content/docs/perworlds/manage/add.mdx index d5aa1df..c66ffe8 100644 --- a/content/docs/perworlds/manage/add.mdx +++ b/content/docs/perworlds/manage/add.mdx @@ -11,7 +11,7 @@ The `` argument is the key of the world you want to add, and `` is Adding all farmworlds to the group "farmworld": ``` -/world group add farmworld:normal farmworld -/world group add farmworld:nether farmworld -/world group add farmworld:the_end farmworld +/world group add farmworld:normal farmworld +/world group add farmworld:nether farmworld +/world group add farmworld:the_end farmworld ``` diff --git a/content/docs/perworlds/manage/create.mdx b/content/docs/perworlds/manage/create.mdx index 94f8e26..d7e2d72 100644 --- a/content/docs/perworlds/manage/create.mdx +++ b/content/docs/perworlds/manage/create.mdx @@ -11,5 +11,5 @@ The `` argument is the name you want to give to your world group. Creating a world group called "farmworld": ``` -/world group create farmworld +/world group create farmworld ``` diff --git a/content/docs/perworlds/manage/delete.mdx b/content/docs/perworlds/manage/delete.mdx index 830952c..591a7d6 100644 --- a/content/docs/perworlds/manage/delete.mdx +++ b/content/docs/perworlds/manage/delete.mdx @@ -18,5 +18,5 @@ Deleting a group is irreversible. Make sure to back up any important data before ### Example [!toc] ``` -/world group delete farmworld +/world group delete farmworld ``` diff --git a/content/docs/perworlds/manage/options.mdx b/content/docs/perworlds/manage/options.mdx index ac52ac8..944e6c2 100644 --- a/content/docs/perworlds/manage/options.mdx +++ b/content/docs/perworlds/manage/options.mdx @@ -19,13 +19,13 @@ The player state will not change when switching between worlds within the same g To disable a group entirely, you can use the command: ``` -/world group option enabled farmworld false +/world group option enabled farmworld false ``` To query the current value of an option, you can use the command: ``` -/world group option inventory farmworld +/world group option inventory farmworld ``` ## All available options [!toc] diff --git a/content/docs/perworlds/manage/remove.mdx b/content/docs/perworlds/manage/remove.mdx index edcc2f4..7fa5fba 100644 --- a/content/docs/perworlds/manage/remove.mdx +++ b/content/docs/perworlds/manage/remove.mdx @@ -16,5 +16,5 @@ This will remove the specified world from the specified group. ### Example [!toc] ``` -/world group remove farmworld worlds:void +/world group remove farmworld worlds:void ``` diff --git a/content/docs/worlds/manage/delete.mdx b/content/docs/worlds/manage/delete.mdx index b547c81..7ffb532 100644 --- a/content/docs/worlds/manage/delete.mdx +++ b/content/docs/worlds/manage/delete.mdx @@ -26,11 +26,11 @@ Deleting a world is irreversible. Make sure to back up any important data before To simply delete a world, you can use the following command: ``` -/world delete worlds:my_world --confirm +/world delete worlds:my_world --confirm ``` To schedule the deletion of a world, you can use: ``` -/world delete minecraft:overworld --confirm --schedule +/world delete minecraft:overworld --confirm --schedule ``` diff --git a/content/docs/worlds/manage/import.mdx b/content/docs/worlds/manage/import.mdx index 61ca4a8..4881aae 100644 --- a/content/docs/worlds/manage/import.mdx +++ b/content/docs/worlds/manage/import.mdx @@ -21,23 +21,23 @@ Options are specified as `option value` pairs, and can be used in any given orde To import a specific dimension of a world, you can use the following command: ``` -/world import End key worlds:end dimension end +/world import End key worlds:end dimension end ``` To import a world with a specific generator, you can use the following command: ``` -/world import "My World" generator TheGeneratorPlugin +/world import "My World" generator TheGeneratorPlugin ``` To import a world with a different name, you can use: ``` -/world import "My World" name "New World Name" +/world import "My World" name "New World Name" ``` To import a world without any custom options, you can use: ``` -/world import Survival +/world import Survival ``` diff --git a/content/docs/worlds/manage/links.mdx b/content/docs/worlds/manage/links.mdx index 7417c5c..f9dbaba 100644 --- a/content/docs/worlds/manage/links.mdx +++ b/content/docs/worlds/manage/links.mdx @@ -31,13 +31,13 @@ The `` world must be a `Nether` or `End` dimension. Linking an **Overworld** to a **Nether** world: ``` -/world link create farmworld:normal farmworld:nether +/world link create farmworld:normal farmworld:nether ``` Linking an **Overworld** to an **End** world: ``` -/world link create farmworld:normal farmworld:the_end +/world link create farmworld:normal farmworld:the_end ``` ## Removing world links @@ -50,11 +50,11 @@ You can remove a link by using the command `/world link remove farmworld:normal farmworld:nether ``` Removing the link between an **Overworld** and an **End** world: ``` -/world link remove farmworld:normal farmworld:the_end +/world link remove farmworld:normal farmworld:the_end ``` diff --git a/content/docs/worlds/manage/load-unload.mdx b/content/docs/worlds/manage/load-unload.mdx index 7a2f914..b22356c 100644 --- a/content/docs/worlds/manage/load-unload.mdx +++ b/content/docs/worlds/manage/load-unload.mdx @@ -12,7 +12,7 @@ if you want to load a world that is not managed by Worlds, [import](/docs/worlds ### Example [!toc] ``` -/world load MyWorld +/world load MyWorld ``` ## Unloading worlds @@ -24,5 +24,5 @@ If undefined, players will be sent to the default world (usually `minecraft:over ### Example [!toc] ``` -/world unload worlds:my_world worlds:my_fallback_world +/world unload worlds:my_world worlds:my_fallback_world ``` From 14594cfc5082d235c94eb62c7033ec1b6d1f7fc3 Mon Sep 17 00:00:00 2001 From: set Date: Fri, 22 Aug 2025 17:41:21 +0200 Subject: [PATCH 13/14] fix(docs): update link path in documentation page for correct file reference --- src/app/docs/[[...slug]]/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/docs/[[...slug]]/page.tsx b/src/app/docs/[[...slug]]/page.tsx index a988b19..a6ac585 100644 --- a/src/app/docs/[[...slug]]/page.tsx +++ b/src/app/docs/[[...slug]]/page.tsx @@ -26,7 +26,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }> {page.data.description} Date: Fri, 22 Aug 2025 17:50:57 +0200 Subject: [PATCH 14/14] fix(docs): simplify command examples by removing unnecessary parameters for clarity --- content/docs/characters/manage/actions.mdx | 6 +++--- content/docs/characters/manage/skins.mdx | 10 +++++----- content/docs/characters/manage/tag.mdx | 6 +++--- content/docs/perworlds/manage/options.mdx | 4 ++-- content/docs/worlds/manage/delete.mdx | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/content/docs/characters/manage/actions.mdx b/content/docs/characters/manage/actions.mdx index 220ea0f..45810dd 100644 --- a/content/docs/characters/manage/actions.mdx +++ b/content/docs/characters/manage/actions.mdx @@ -54,7 +54,7 @@ Using `` in a parameter will be replaced with the name of the player who To add a greeting action to a character named "Steve", use the following command: ``` -/character action add Steve greet any_click send-message Hello, ! +/character action add Steve greet any_click send-message Hello, ! ``` This action will be triggered on any click and sends `Hello, NonSwag!` if the player's name is NonSwag. @@ -112,7 +112,7 @@ To define a permission for an action, use the command #### Example [!toc] [#permission-set-example] ``` -/character action permission Steve greet set warm.welcome.permission +/character action permission Steve greet set warm.welcome.permission ``` ### Remove a Permission @@ -123,7 +123,7 @@ To remove a permission for an action, use the command #### Example [!toc] [#permission-remove-example] ``` -/character action permission Steve greet remove +/character action permission Steve greet remove ``` ### View Current Permission diff --git a/content/docs/characters/manage/skins.mdx b/content/docs/characters/manage/skins.mdx index a3177c2..a2638a8 100644 --- a/content/docs/characters/manage/skins.mdx +++ b/content/docs/characters/manage/skins.mdx @@ -32,13 +32,13 @@ you can use the command `/character skin set player [slim]` Classic skins can be applied using the following command: ``` -/character skin set MyCharacter player Notch +/character skin set MyCharacter player Notch ``` To apply a slim skin, just append the `slim` option: ``` -/character skin set MyCharacter player Notch slim +/character skin set MyCharacter player Notch slim ``` ## Applying a Skin from File @@ -59,7 +59,7 @@ If the file is located in the server's main directory, you can use a relative pa To change a character's skin using a file, you can use the following command: ``` -/character skin set MyCharacter file "/home/skins/my_skin.png" +/character skin set MyCharacter file "/home/skins/my_skin.png" ``` ## Applying a Skin from URL @@ -77,7 +77,7 @@ You can change a character's skin using a URL with the command To change a character's skin using a URL, you can use the following command: ``` -/character skin set MyCharacter url "https://example.com/skin.png" +/character skin set MyCharacter url "https://example.com/skin.png" ``` ## Resetting a Skin @@ -102,7 +102,7 @@ By default, all layers are shown. You can hide or show each layer individually. To hide a character's cape layer, you can use the following command: ``` -/character skin layer hide cape MyCharacter +/character skin layer hide cape MyCharacter ``` ### Available Skin Layers diff --git a/content/docs/characters/manage/tag.mdx b/content/docs/characters/manage/tag.mdx index 62c5d2e..288e97c 100644 --- a/content/docs/characters/manage/tag.mdx +++ b/content/docs/characters/manage/tag.mdx @@ -39,17 +39,17 @@ You can customize your character's nametag using the `/character tag` command. Set the nametag text: ``` -/character tag set text Hello there!Welcome to the game! +/character tag set Steve text Hello there!Welcome to the game! ``` Change the background color to red: ``` -/character tag set background-color red +/character tag set Steve background-color red ``` Reset the scale to default: ``` -/character tag reset scale +/character tag reset Steve scale ``` diff --git a/content/docs/perworlds/manage/options.mdx b/content/docs/perworlds/manage/options.mdx index 944e6c2..593a0e9 100644 --- a/content/docs/perworlds/manage/options.mdx +++ b/content/docs/perworlds/manage/options.mdx @@ -19,13 +19,13 @@ The player state will not change when switching between worlds within the same g To disable a group entirely, you can use the command: ``` -/world group option enabled farmworld false +/world group option enabled farmworld false ``` To query the current value of an option, you can use the command: ``` -/world group option inventory farmworld +/world group option inventory farmworld ``` ## All available options [!toc] diff --git a/content/docs/worlds/manage/delete.mdx b/content/docs/worlds/manage/delete.mdx index 7ffb532..2865bef 100644 --- a/content/docs/worlds/manage/delete.mdx +++ b/content/docs/worlds/manage/delete.mdx @@ -26,11 +26,11 @@ Deleting a world is irreversible. Make sure to back up any important data before To simply delete a world, you can use the following command: ``` -/world delete worlds:my_world --confirm +/world delete worlds:my_world --confirm ``` To schedule the deletion of a world, you can use: ``` -/world delete minecraft:overworld --confirm --schedule +/world delete minecraft:overworld --confirm --schedule ```