There are several environment settings provided by DHP for mcfunction files, which are put under the datapack.env.* config section.

List of Options

cmdVersion

The command syntax version for this project.

Available options

dataSource

The download source of the completion data.

Available options

  • "GitHub": (Default) Download those data from raw.githubusercontent.com.
  • "码云": Download those data from gitee.com. You can choose this if raw.githubusercontent.com is blocked in your country/region.

dataVersion

The completion data version for this project. This option affects completions for namespaced IDs (like entity IDs, block IDs, etc), NBT tags, and NBT paths.

Available options

defaultVisibility

Specify the default visibility for resources. See also Access Modifiers.

Available options

  • "public": (Default) Public.
  • "internal": Internal.
  • "private": Private.
  • (Object) Simulates a @within modifier.
    • type: The type of files that can access this resource. Can be one of the file types or "*".
    • pattern: A namespaced ID pattern. See Access Modifiers for more information.
  • (Array) Simulates a series of @within modifiers.
    • (Object) Using the same format as the above object.

dependsOnVanilla

Whether this datapack depends on the vanilla datapack or not. If this option is enabled, completions for the corresponding data of the vanilla datapack will be provided.

Available options

  • true: (Default) Enable.
  • false: Disable.

detectionDepth

The language server detects recursively to see if there is a pack.mcmeta file and a data folder so that it can tell if a folder is a data pack. By changing the value of this config, you can alter the data pack detection depth of the language server. Note that higher values require more time to check and might reduce the performance.

By setting a value greater than or equal to 1, you can open the .minecraft/saves/<save name>/datapacks folder directly in your editor and enjoy editing all data packs within it instead of having all data packs added to the workspace manually.

Available options

  • Any integer. Defaults to 1.

exclude

Files that should be excluded from validation. Each string in this array will be interpreted as a glob pattern to test the relative file paths from the root of the datapack.

Example

{
    "datapack.env.exclude": [
        "data/spgoding/functions/generated/**/*.mcfunction"
    ]
}

This will make the language server not validate any mcfunction files under the data/spgoding/functions/generated/ directory.

include

Files that should be included from validation. Each string in this array will be interpreted as a glob pattern to test the relative file paths from the root of the datapack.

This option takes priority over exclude.

Example

{
    "datapack.env.exclude": [
        "data/spgoding/functions/generated/**/*.mcfunction"
    ],
    "datapack.env.include": [
        "data/spgoding/functions/generated/special.mcfunction"
    ]
}

This will make the language server not validate any mcfunction files under the data/spgoding/functions/generated/ directory, except data/spgoding/functions/generated/special.mcfunction.

jsonVersion

The version of the JSON schemas. Only major versions are available.

Available options

language

The language in which the texts provided by the language server should be.

Available Options

  • "Default": (Default) Use the same language as VS Code uses.
  • code: Use the specific language.

permissionLevel

The permission level for mcfunction files in this projects. Should be lower than or equal to the function-permission-level defined in your server.properties.

Available Options

  • 2: (Default) Use permission level 2.
  • 1: Use permission level 1.
  • 3: Use permission level 3.
  • 4: Use permission level 4.

History

Version Description
1.1.0 Added version and permissionLevel.
1.13.5 Added dataVersion.
2.0.0 Added dataSource, dependsOnVanilla, exclude, and include. Renamed version to cmdVersion.
2.1.0 Added language.
3.0.0 Added defaultVisibility, detectionDepth, and jsonVersion.