Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add commands yml documentation #233

Merged
merged 17 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/sidebar.paper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
import type {SidebarsConfig} from "@docusaurus/plugin-content-docs";
456dev marked this conversation as resolved.
Show resolved Hide resolved

const paper: SidebarsConfig = {
primary: [
Expand Down Expand Up @@ -58,6 +58,7 @@ const paper: SidebarsConfig = {
"admin/reference/configuration/global-configuration",
"admin/reference/configuration/world-configuration",
"admin/reference/configuration/server-properties",
"admin/reference/configuration/commands-configuration",
],
},
"admin/reference/system-properties",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
slug: /reference/commands-configuration
456dev marked this conversation as resolved.
Show resolved Hide resolved
---

# Commands Configuration

import React from 'react';
import Config from '@site/src/components/Config';

:::info

The below YAML shows you the structure and default values for `commands.yml`.

Click on a leaf node to view the description for that setting.

:::

<Config data={`
command-block-overrides:
default: '[<command to override>]'
description: 'What commands to use the vanilla versions in command blocks, instead of bukkit or plugin provided versions.
456dev marked this conversation as resolved.
Show resolved Hide resolved
Useful in adventure maps, that expect to use the minecraft versions of commands in command blocks.

Use the literal ''*'' to always use the vanilla version in command blocks.

By default, no commands are overridden.'
ignore-vanilla-permissions:
default: 'false'
description: 'Whether to use vanilla permission levels when executing commands.'
aliases:
'<alias name>':
default: '[<commands to run>]'
description: 'A List of Strings which are target commands.
Alternatively, a String, which is a single target command.
456dev marked this conversation as resolved.
Show resolved Hide resolved

A target command is a command that is run, when the alias is run.

Replacements:

- ''\`$sender\`'' is replaced with the command sender''s name (Added by paper).
456dev marked this conversation as resolved.
Show resolved Hide resolved

- \`$<n>\` is replaced by the n''th argument, 1-indexed.

- \`$$<n>\` is replaced by the n''th argument, 1-indexed, failing if the n''th argument is not present.

- \`$<n>-\` is replaced by the n''th argument and everything that follows, 1-indexed.

- \`$$<n>-\` is replaced by the n''th argument and everything that follows, 1-indexed, failing if the n''th argument is not present.


Each alias registered cannot be (easily) be overridden by a plugin.'
456dev marked this conversation as resolved.
Show resolved Hide resolved
icanhasbukkit:
default: '[version $1-]'
description: 'A built-in alias. Set aliases to an empty list ([]) to persistently remove.'
`}/>
2 changes: 1 addition & 1 deletion src/components/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default function Config({ data, separator = ': ' }) {
let ymlData = yaml.load(data);
return (
<div>
<pre>{renderYamlData(ymlData, '', true, separator)}</pre>
<pre style={{ fontVariantLigatures: "no-contextual" }}>{renderYamlData(ymlData, '', true, separator)}</pre>
456dev marked this conversation as resolved.
Show resolved Hide resolved
<div style={{ display: 'none' }}>{data}</div>
</div>
);
Expand Down