From a197a3ca8d958bce1ef45ad62fb9d01f051d1f1d Mon Sep 17 00:00:00 2001 From: vLuckyyy Date: Wed, 16 Jul 2025 21:24:54 +0200 Subject: [PATCH 1/2] Edit Commands docs. --- .../eternalcore/commands/disable-commands.mdx | 58 ++++++++++++++ .../eternalcore/commands/edit-commands.mdx | 75 +++++++++++++++++++ lib/sidebar-structure.ts | 8 ++ 3 files changed, 141 insertions(+) create mode 100644 content/docs/eternalcore/commands/disable-commands.mdx create mode 100644 content/docs/eternalcore/commands/edit-commands.mdx diff --git a/content/docs/eternalcore/commands/disable-commands.mdx b/content/docs/eternalcore/commands/disable-commands.mdx new file mode 100644 index 00000000..045e4484 --- /dev/null +++ b/content/docs/eternalcore/commands/disable-commands.mdx @@ -0,0 +1,58 @@ +--- +title: Disabling Commands +description: Learn how to disable specific commands in EternalCore or other EternalCode plugins using the `commands.yml` file. +--- + +## ❌ Disable Commands in EternalCore + +EternalCore (and most EternalCode plugins) allows you to disable specific commands using the `commands.yml` configuration file. + +import { AlertBox } from "../../../components/ui/alert-box"; + + + You must **restart the server** after making any changes to this file. Reload is not enough. + + + +--- + +## 🗂️ Location of the file + +```text +/plugins/EternalCore/commands.yml +``` + +--- + +## 🚫 How to disable a command + +To disable a specific command — for example, `/rtp` — you need to add a section like this in `commands.yml`: + +```yaml +rtp: + name: [] + enabled: false + aliases: [] + permissions: [] + subCommands: [] +``` + +📌 In this case, `rtp` is the **original command name**, not an alias. + +--- + +## ⚠️ Warnings and Tips + +* ❗ **Do not use an alias.** You must use the original command name exactly as it is defined by the plugin. +* 🔁 Changes require a **server restart** to take effect. +* ✅ You can safely disable *any* built-in command if you want to replace it with your own or just remove access. + +--- + +## 📄 Find all available commands + + + A full list of EternalCore permissions and commands is available here: + https://www.eternalcode.pl/docs/eternalcore/features/permissions + + diff --git a/content/docs/eternalcore/commands/edit-commands.mdx b/content/docs/eternalcore/commands/edit-commands.mdx new file mode 100644 index 00000000..a0f77bb2 --- /dev/null +++ b/content/docs/eternalcore/commands/edit-commands.mdx @@ -0,0 +1,75 @@ +--- +title: Edit Commands +description: Learn how to rename commands, change aliases and permissions, and customize subcommands in EternalCore using commands.yml. +--- + +## ✏️ Edit Commands in EternalCore + +EternalCore allows you to fully customize command names, aliases, permissions, and subcommands through the `commands.yml` file. + + + You must restart the server after making any changes to this file. Reload is not enough. + + +--- + +## 🗂️ Location of the file + +```text +/plugins/EternalCore/commands.yml +``` + +--- + +## 🧩 What can be changed? + +You can modify: + +* Command name (e.g. `/eternalcore` → `/eternal-core`) +* Aliases (e.g. `/ec`, `/eternal`) +* Required permissions +* Subcommands (name, aliases, permissions, or disable entirely) + +--- + +## 🔧 Example configuration + +```yaml +commands: + eternalcore: + name: "eternal-core" + enabled: true + aliases: + - "eternal" + permissions: + - "eternalcore.eternalcore" + subCommands: + reload: + name: "reload" + enabled: true + aliases: + - "rl" + permissions: + - "eternalcore.reload" +``` + +--- + +## ✅ Result of this configuration + +* `/eternalcore` becomes `/eternal-core` +* New alias `/eternal` is added +* The `/eternal-core reload` command can now also be run using `/eternal-core rl` +* Both commands require custom permissions + +--- + +## 🛑 Disable a subcommand (optional) + +You can also disable a specific subcommand by setting: + +```yaml +enabled: false +``` + +inside the subcommand section. diff --git a/lib/sidebar-structure.ts b/lib/sidebar-structure.ts index d56d6ee0..741af35b 100644 --- a/lib/sidebar-structure.ts +++ b/lib/sidebar-structure.ts @@ -20,6 +20,14 @@ export const docsStructure: DocItem[] = [ { title: "Homes", path: "/docs/eternalcore/features/homes" }, ], }, + { + title: "Commands", + path: "/docs/eternalcore/commands", + children: [ + { title: "Disable commands", path: "/docs/eternalcore/commands/disable-commands" }, + { title: "Edit commands", path: "/docs/eternalcore/commands/edit-commands" }, + ], + }, { title: "FAQ", path: "/docs/eternalcore/faq" }, { title: "Placeholders", path: "/docs/eternalcore/placeholders" }, { title: "Developer API", path: "/docs/eternalcore/using-api" }, From 353ed45ff64649b1750f2342ff51660d758a4566 Mon Sep 17 00:00:00 2001 From: vLuckyyy Date: Wed, 16 Jul 2025 21:26:32 +0200 Subject: [PATCH 2/2] Improve yaml. --- .../docs/eternalcore/commands/edit-commands.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/docs/eternalcore/commands/edit-commands.mdx b/content/docs/eternalcore/commands/edit-commands.mdx index a0f77bb2..030e9b11 100644 --- a/content/docs/eternalcore/commands/edit-commands.mdx +++ b/content/docs/eternalcore/commands/edit-commands.mdx @@ -37,20 +37,20 @@ You can modify: ```yaml commands: eternalcore: - name: "eternal-core" + name: "eternal-core" # this is the new main command name enabled: true aliases: - - "eternal" + - "eternal" # list of new aliases for the main command permissions: - - "eternalcore.eternalcore" + - "eternalcore.eternalcore" # permission required to use the main command subCommands: - reload: - name: "reload" + reload: # this must match the name of the subcommand you want to edit + name: "reload" # this is the new subcommand name (keep the same if unchanged) enabled: true aliases: - - "rl" + - "rl" # list of new aliases for the subcommand permissions: - - "eternalcore.reload" + - "eternalcore.reload" # permission required to use the subcommand ``` ---