DHP is splitted into two parts: the JSON part and the MCF part. While the former provides supports for all JSON files in a datapack (like advancements, recipes, predicates, loot tables, and tags), the latter provides supports for mcfunction files. The introduction you are reading right now is for the MCF part.
Alternatively, press Ctrl + P and execute
Note: DHP has a minimum version requirement of VSCode
Please use the root folder of your datapack (where the
Moreover, DHP fully supports VSCode's multi-root workspace feature. Every root which contains a
You can access any content of any root as long as they are in the same workspace. The order of the roots in your workspace will affect the priority of these datapacks in DHP. The root at the beginning will be loaded at first, and the root at the end will be loaded at last, which means that the earlier the root is, the lower priority in DHP it has. This is exactly how Minecraft loads datapacks and decide which one overrides another one if a file has the same namespaced ID and is in the same category. For example, if your multi-root workspace looks like this:
And then you use
If you try to execute these commands in Minecraft, you can also noticed that the function in Datapack B is executed.
By acting like this, DHP ensures that the order it handling datapacks is consistent with Minecraft.
Note: you can drag and put the root folders in VSCode to sort them, and DHP will update the priority of them in DHP accordingly, which is really handy.
Multiple Language Support
DHP supports multiple languages. Currently these languages are available:
If you'd like to help us translate this project into other languages, it would be really appreciated! See CONTRIBUTING.md for more information!
All command arguments should be colored semantically. You can see #308 for a detailed list of all semantic token types and modifiers used by DHP if you are interested in.
Unfortunately, the semantic coloring API of VSCode is still in proposed stage, thus we cannot use it in production environment. All the screenshots below are taken in development mode.
You can get hints about the arguments of commands while typing.
The extension can compute completions as you typing commands. Completions will automatically show if you commit one of these characters:
DHP can provide completions for simple commands:
For more complex NBT tags, with the help from mc-nbt-paths contributed by MrYurihi, Levertion and Bassab03:
And also NBT paths:
DHP provides some helpful code snippets. See VSCode's official docs to learn more about code snippets. Both DHP and VSCode allow you to custom your code snippets, and they use exactly the same syntax because DHP is based on VSCode. For mcfunction files, code snippets added by DHP will be shown in the completions list only when the cursor is at the beginning of a command, however snippets added by VSCode's
You can use
DHP provides real-time diagnostics about your commands. It can show syntax errors as Minecraft does, and even give your more detailed warnings.
You can use comments (
Alternatively, you can use different amount of hash symbols followed by at least one white space to create different levels of folding ranges:
This feature is finished by using the proposed API, which is only accessible in development environment.
Call hierarchies are a great way to navigate through functions. You can get all the callers/callees of a function, function tag, or an advancement reward by using this feature. The default hotkey of this feature is
DHP will display colors for
This is WIP.
DHP shows user-defined documentation when you hover on specific arguments, e.g. on function namespaced IDs, tags, teams, etc.
Resolving Namespaced IDs
You can navigate to advancements, loot tables, functions, predicates, and all kinds of tags by Ctrl-clicking on their namespaced IDs.
You can goto the definitions of objectives, entities, tags, teams, bossbars, and data storages in the workspace by Ctrl-clicking on their names.
You can find all the references of objectives, entities, tags, teams, bossbars, data storages, advancements, functions, loot tables, predicates, recipes, and all kinds of datapack tags in the workspace by pressing Shift + F12 or other configured key.
You can rename entities, tags, teams, bossbars, data storages, advancements, functions, loot tables, predicates, recipes, and all kinds of datapack tags by pressing F2 or other configured key on their names.
All the references of the same symbol in the whole workspace will be renamed.
WARNING: your input can be accidentally corrupted by using this feature. Use it at your own risk. You can use the Rename Preview operation provided by VSCode to make sure that nothing is broken before actually renaming.
Additionally, if you rename a namespaced ID with file definition (e.g. the ID for advancement, function, loot table, predicate, recipe or tag), the corresponding file in the workspace will be renamed/moved too.
However, renaming a file in a workspace manually will not update the namespaced IDs of it, and may cause problems with the cache.
Formatting and Linting
You can format the current function by pressing Shift + Alt + F or other configured hotkey.
There are several linting rules you can set in the configuration settings.
WARNING: your input can be accidentally lost by using this feature. Use it at your own risk. This feature is disabled by default. You can enable this feature by changing the
Press Ctrl +
DHP uses cache to accelerate the process of renaming, finding references/definitions, document links, etc. However, the cache may become outdated because of various reasons, which could lead to strange behaviors. You can use the
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind are welcome!
Maintains mcdata, a repository that stores the latest data generated by Minecraft's data generator. DHP downloads data from this repository to provide version-specific completions for blocks and registries. See #333 for more details.
Maintains mc-nbtdoc, a repository that stores "machine and human readable documentation for all of Minecraft's in game NBT data". DHP downloads genetated JSON files from this repository to provide completions and validations for version-specific NBT data. See #332 for more details.
Provides Tabula, a lightweight localization tool which is used by DHP to help translate
Designed the DHP's icon and the banner showed on top of this page.
Localization for 🇩🇪 German (
Localization for 🇫🇷 French (
Localization for 🇮🇹 Italian (
Localization for 🇯🇵 Japanese (
Localization for 🇨🇳 Simplified Chinese (
SPGoding used to receive financial supports, but there are no ways to sponsor spg anymore.