Skip to content

Commit ae40a6c

Browse files
committed
fix(docs): extraction of demo book step is easy to miss
1 parent dcd1a98 commit ae40a6c

5 files changed

Lines changed: 58 additions & 53 deletions

File tree

docs/getting-started/step-by-step-with-datapack/step-by-step-with-datapack.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 10
44

55
# Step by Step Guide for a Book via Datapack
66

7-
This page will guide you through a reasonably easy way to create a book _without_ datagen.
7+
This section will guide you through a reasonably easy way to create a book _without_ datagen.
88
It uses the [Demo Book](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books) modonomicon provides as a starting point.
99

1010
:::tip
@@ -17,18 +17,4 @@ If you run into any issues or have any questions, join our Discord: **https://ds
1717

1818
It is not recommended to manually create books. It is much more convenient and error-free to use [datagen](../step-by-step-with-datagen/). JSON is not a great format for text editing, and can be annoying to properly format text.
1919

20-
:::
21-
22-
23-
The best approach is to create a datapack from the demo book, and then modify and extend it to your needs. This saves you a lot of time and effort in manually creating a valid file structure for your book.
24-
25-
:::tip
26-
27-
If you are already well-versed with datapacks you can look at the demo book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books)** and the demo multiblocks used by the book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/multiblocks)** and simply download the individual files you want to use as a reference.
28-
29-
:::
30-
31-
First, download the modonomicon source code, as it contains the demo book:
32-
1. Start by visiting https://github.com/klikli-dev/modonomicon
33-
2. Find the green "Code" button and click it. Then click "Download ZIP" at the bottom of the dropdown menu.
34-
3. Extract the ZIP file to a location of your choice.
20+
:::
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
---
2-
sidebar_position: 10
2+
sidebar_position: 5
33
---
44

5-
# Step 1: Set up an empty datapack
5+
# Step 1: Download and extract demo content
66

7-
1. Set up a folder structure as required by minecraft: https://minecraft.wiki/w/Data_pack#Folder_structure.
8-
1. You do not need to create all the subfolders of the `data` folder, you can keep `data` empty in the first step.
9-
10-
2. Now create a folder for your namespace. Usually your namespace is your mod id or modpack id (e.g. the modpack name in all lowercase with no spaces) (See also https://minecraft.wiki/w/Resource_location#Namespaces)
7+
The best approach to creating a book as a datapack (as opposed to [datagen](../step-by-step-with-datagen/)) is to create a datapack from the demo book, and then modify and extend it to your needs. This saves you a lot of time and effort in manually creating a valid file structure for your book.
118

12-
3. In your namespace folder, create a folder `/modonomicon/`.
9+
First, download the modonomicon source code, as it contains the demo book:
10+
1. Start by visiting https://github.com/klikli-dev/modonomicon
11+
2. Find the green "Code" button and click it. Then click "Download ZIP" at the bottom of the dropdown menu.
12+
3. Extract the ZIP file to a location of your choice.
13+
4. Remember where you extracted the files, you will need them in a future step.
1314

14-
4. In the `/modonomicon/` folder, create a folder `/books/` and `/multiblocks/`:
15-
:::info
16-
If you do not plan on having any multiblocks or multiblock pages, you can skip the `/multiblocks/` folder.
17-
:::
15+
:::tip
16+
17+
If you are already well-versed with datapacks you can look at the demo book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books)** and the demo multiblocks used by the book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/multiblocks)** and simply download the individual files you want to use as a reference.
18+
19+
:::
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
---
2-
sidebar_position: 20
2+
sidebar_position: 10
33
---
44

5-
# Step 2: Copy demo content into your datapack
5+
# Step 2: Set up an empty datapack
66

7+
1. Set up a folder structure as required by minecraft: https://minecraft.wiki/w/Data_pack#Folder_structure.
8+
1. You do not need to create all the subfolders of the `data` folder, you can keep `data` empty in the first step.
9+
10+
2. Now create a folder for your namespace. Usually your namespace is your mod id or modpack id (e.g. the modpack name in all lowercase with no spaces) (See also https://minecraft.wiki/w/Resource_location#Namespaces)
711

8-
1. In your file explorer go to the folder you extracted and then into `<extracted_folder>\neo\src\generated\resources\data\modonomicon\modonomicon\books\`.
12+
3. In your namespace folder, create a folder `/modonomicon/`.
913

10-
2. Copy the `demo` folder (or if you want to make a leaflet, the `demo_leaflet` folder) and paste it in your datapack's `/modonomicon/books/` folder.
11-
12-
3. In your file explorer go to the folder you extracted and then into `<extracted_folder>\neo\src\generated\resources\data\modonomicon\modonomicon\multiblocks\`.
13-
14-
4. Copy all `.json` files and paste them in your datapack's `/modonomicon/multiblocks/` folder.
15-
:::info
16-
If you do not plan on having any multiblocks or multiblock pages, you can skip copying the contents of the `/multiblocks/` folder.
17-
:::
18-
19-
5. If you **did not** set up multiblocks, go into your datapack folder `<your datapack>/data/<your namespace>/modonomicon/books/demo/entries/features/` and **delete** the `multiblock.json` file.
14+
4. In the `/modonomicon/` folder, create a folder `/books/` and `/multiblocks/`:
2015
:::info
21-
If you do not delete that file, this multiblock entry will look for the multiblocks in the `/multiblocks/` folder and will throw an error if it does not find them.
22-
:::
16+
If you do not plan on having any multiblocks or multiblock pages, you can skip the `/multiblocks/` folder.
17+
:::
Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
---
2-
sidebar_position: 30
2+
sidebar_position: 20
33
---
44

5-
# Step 3: Test and extend the Demo Book
5+
# Step 3: Copy demo content into your datapack
66

7-
You can now test your datapack in game. An item named `book.modonomicon.demo.name` should be available in the Modonomicon creative tab and JEI/REI/EMI.
87

9-
When you first open the book, it will not have proper texts instead it will have contents like `book.modonomicon.demo.features.spotlight.description`.
10-
11-
Both the weird book name and weird content texts happen because the demo book uses the minecraft translation system. You can either create a resource pack with a language file (you can copy individual lines or the entire file from https://github.com/klikli-dev/modonomicon/blob/version/1.21.1/neo/src/generated/resources/assets/modonomicon/lang/en_us.json), or you can directly type your desired text in the json files.
8+
1. In your file explorer go to the folder you extracted and then into `<extracted_folder>\neo\src\generated\resources\data\modonomicon\modonomicon\books\`.
129

13-
:::tip
14-
It is recommended to use the translation system, otherwise it is impossible for others to translate your book.
15-
:::
10+
2. Copy the `demo` folder (or if you want to make a leaflet, the `demo_leaflet` folder) and paste it in your datapack's `/modonomicon/books/` folder.
1611

17-
**You can now edit the demo book to your liking to make your own book**.
18-
Reference the [Basics](../../basics/) and [Advanced](../../advanced/) sections to learn about the valid JSON keys and structures.
12+
3. In your file explorer go to the folder you extracted and then into `<extracted_folder>\neo\src\generated\resources\data\modonomicon\modonomicon\multiblocks\`.
13+
14+
4. Copy all `.json` files and paste them in your datapack's `/modonomicon/multiblocks/` folder.
15+
:::info
16+
If you do not plan on having any multiblocks or multiblock pages, you can skip copying the contents of the `/multiblocks/` folder.
17+
:::
18+
19+
5. If you **did not** set up multiblocks, go into your datapack folder `<your datapack>/data/<your namespace>/modonomicon/books/demo/entries/features/` and **delete** the `multiblock.json` file.
20+
:::info
21+
If you do not delete that file, this multiblock entry will look for the multiblocks in the `/multiblocks/` folder and will throw an error if it does not find them.
22+
:::
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
sidebar_position: 30
3+
---
4+
5+
# Step 4: Test and extend the demo book
6+
7+
You can now test your datapack in game. An item named `book.modonomicon.demo.name` should be available in the Modonomicon creative tab and JEI/REI/EMI.
8+
9+
When you first open the book, it will not have proper texts instead it will have contents like `book.modonomicon.demo.features.spotlight.description`.
10+
11+
Both the weird book name and weird content texts happen because the demo book uses the minecraft translation system. You can either create a resource pack with a language file (you can copy individual lines or the entire file from https://github.com/klikli-dev/modonomicon/blob/version/1.21.1/neo/src/generated/resources/assets/modonomicon/lang/en_us.json), or you can directly type your desired text in the json files.
12+
13+
:::tip
14+
It is recommended to use the translation system, otherwise it is impossible for others to translate your book.
15+
:::
16+
17+
**You can now edit the demo book to your liking to make your own book**.
18+
Reference the [Basics](../../basics/) and [Advanced](../../advanced/) sections to learn about the valid JSON keys and structures.

0 commit comments

Comments
 (0)