Getting Started
Getting started with Deco
Create a Project
What is special about Deco is that it uses exactly the same folder structure as vanilla Minecraft datapacks.
So, you can just copy any of your existing datapacks and use Deco on them. Or create a new one if you want to.
Now, we got a folder structure like this:
.mcfunction files are still valid in Deco, so if you have a .mcfunction in your datapack and don't want to use any Deco features in it, you can just leave it as is.
Then, create a .deco file in the functions folder and start your Deco journey!
First Deco File
Let's create a simple Deco file called gold_touch.deco and put it in the functions folder:
Now, let's write some Deco code in the gold_touch.deco file:
The function of this Deco file is:
- When a player places a stone block, the player will be notified that they have the gold touch.
- Then, the stone block will be replaced with a gold block, by using the
raycastcommand.
Compile
Let's compile the Deco project. Change the directory to the folder where you put the gold_touch_src folder and run the following command:
This will compile the Deco project(gold_touch_src) and create a gold_touch folder in the current directory. You can see some .mcfunction files and advancements files in the gold_touch folder, which are the compiled result of the gold_touch_src project.
Now, you can use the gold_touch datapack in your game. Just put the gold_touch folder in your datapacks folder and experiment with it!
More Info
If you want to know more about Deco, you can check the API Reference.