simplified-mojang-jsons 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -21
- package/README.md +174 -174
- package/dist/index.js.map +1 -1
- package/dist/types/behaviors/ManifestTemplate.d.ts +2 -2
- package/dist/types/behaviors/ManifestTemplate.d.ts.map +1 -1
- package/package.json +78 -78
- package/scripts/exporttojson.ts +365 -365
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 HaJuegos
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 HaJuegos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
# 🛠️ Simplified Mojang JSONs
|
|
2
|
-
|
|
3
|
-
> [!WARNING]
|
|
4
|
-
> ⚠️ **WORK IN PROGRESS!** ⚠️
|
|
5
|
-
> This repository is constantly evolving and undergoing active updates, so some features or simplified methods may be missing or not yet implemented. Please keep this in mind when using it!
|
|
6
|
-
|
|
7
|
-
> [!WARNING]
|
|
8
|
-
> 🌐 **COMMENTS IN SPANISH!** 🌐
|
|
9
|
-
> All code comments in this repository are written in **Spanish** and I do not plan to translate them. Identifiers, documentation and public API names are in English.
|
|
10
|
-
|
|
11
|
-
A lightweight tool to mass-modify and update vanilla JSON files with automated/manual TypeScript export. Say goodbye to tedious bulk updates when vanilla changes break your custom setup—and hello to a cleaner, smarter way to script JSON addons.
|
|
12
|
-
|
|
13
|
-
## Install:
|
|
14
|
-
|
|
15
|
-
Just run this in your project root:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install simplified-mojang-jsons@latest
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
or via pnpm:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
pnpm add simplified-mojang-jsons@latest
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Build Setup:
|
|
30
|
-
|
|
31
|
-
To start writing your JSON templates in TypeScript, you need to copy the base generator script into your project.
|
|
32
|
-
|
|
33
|
-
Add these scripts to your `package.json`:
|
|
34
|
-
|
|
35
|
-
```json
|
|
36
|
-
"scripts": {
|
|
37
|
-
"setup:export": "node -e \"const fs = require('fs'); const path = require('path'); const src = require.resolve('simplified-mojang-jsons/exporttojson'); const dest = path.join('scripts', 'generatejsons.ts'); fs.mkdirSync(path.dirname(dest), { recursive: true }); fs.copyFileSync(src, dest); console.log('✅ Export script copied to scripts/generatejsons.ts!');\"",
|
|
38
|
-
"export:json": "tsx scripts/generatejsons.ts"
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Then, run the setup command once in your terminal:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
npm run setup:export
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
or via pnpm:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
pnpm setup:export
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
This will automatically create a `scripts/generatejsons.ts` file in your project structure.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
### How to Use
|
|
59
|
-
|
|
60
|
-
1. Place your TypeScript template files inside your designated **input folder** (by default, the script looks in a `test/` folder or you can adjust it inside your copied `generatejsons.ts`).
|
|
61
|
-
2. Run the export command to compile your TS code and instantly output clean, formatted vanilla JSON files:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
npm run export:json
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
or via pnpm:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
pnpm export:json
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Available Modules & Components
|
|
76
|
-
|
|
77
|
-
The API is split up into several handy modules, components, and pre-made templates to fit whatever your development workflow needs. Here is what's currently available out of the box:
|
|
78
|
-
|
|
79
|
-
> [!NOTE]
|
|
80
|
-
> **⚠️ Vanilla Templates Notice:** Some pre-made vanilla templates might not be 100% valid or fully functional out of the box in the game due to Minecraft updates or internal structure shifts. Feel free to modify them once they are exported into their final format or tweak them directly in your code!
|
|
81
|
-
|
|
82
|
-
> [!NOTE]
|
|
83
|
-
> The wrapped modules might not have _every_ single edge case fully mapped out just yet. I'll be adding the rest and keeping things updated to make your dev experience as smooth as possible.
|
|
84
|
-
|
|
85
|
-
### 1. Custom Builders (`create...`)
|
|
86
|
-
|
|
87
|
-
Functions designed to programmatically build, structure, and customize your behavior pack JSONs using TypeScript type support and OOP:
|
|
88
|
-
|
|
89
|
-
```ts
|
|
90
|
-
import {
|
|
91
|
-
// BP Manifest
|
|
92
|
-
createBPManifest,
|
|
93
|
-
|
|
94
|
-
// BP Stuff's
|
|
95
|
-
createBPAnimController,
|
|
96
|
-
createBPBiome,
|
|
97
|
-
createBPBlock,
|
|
98
|
-
createBPDialogue,
|
|
99
|
-
createBPDimension,
|
|
100
|
-
createBPEntity,
|
|
101
|
-
createBPFeature,
|
|
102
|
-
createBPFeatureRule,
|
|
103
|
-
createBPItemCatalog,
|
|
104
|
-
createBPItem,
|
|
105
|
-
createBPLootTable,
|
|
106
|
-
createBPRecipe,
|
|
107
|
-
createBPSpawnRule,
|
|
108
|
-
createBPTrading,
|
|
109
|
-
} from "simplified-mojang-jsons";
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### 2. Root Components (`...Components`)
|
|
113
|
-
|
|
114
|
-
Modular configurations and property wrappers to fine-tune specific behavior features:
|
|
115
|
-
|
|
116
|
-
- **`BPBiomeComponents`**: Manage biome-specific components like fog, lighting, and sound settings.
|
|
117
|
-
- **`BPBlockComponents`**: Handle block traits, collision boxes, creative categories, and component definitions.
|
|
118
|
-
- **`BPDimensionComponents`**: Configure custom dimension behaviors and environment rules.
|
|
119
|
-
- **`BPEntityComponents`**: Set up entity components such as movement, component groups, and event triggers.
|
|
120
|
-
- **`BPItemComponents`**: Define custom item behaviors, hand actions, and attributes.
|
|
121
|
-
- **`BPSpawnRuleComponents`**: Adjust spawning conditions, mob caps, and herd rules.
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
import {
|
|
125
|
-
BPBiomeComponents,
|
|
126
|
-
BPBlockComponents,
|
|
127
|
-
BPDimensionComponents,
|
|
128
|
-
BPEntityComponents,
|
|
129
|
-
BPItemComponents,
|
|
130
|
-
BPSpawnRuleComponents,
|
|
131
|
-
} from "simplified-mojang-jsons";
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### 3. Pre-made Templates (`...Templates`)
|
|
135
|
-
|
|
136
|
-
Ready-to-use base vanilla templates that you can quickly override, modify, and export:
|
|
137
|
-
|
|
138
|
-
- **`BPBiomeTemplates`**: Base vanilla biome configurations.
|
|
139
|
-
- **`BPEntityTemplates`**: Base vanilla entity files ready for modification.
|
|
140
|
-
- **`BPFeatureTemplates` & `BPFeatureRuleTemplates`**: World generation and feature rule blueprints.
|
|
141
|
-
- **`BPLootTableTemplates`**: Standard loot tables for blocks, entities, and fishing.
|
|
142
|
-
- **`BPRecipeTemplates`**: Crafting and smelting recipe templates.
|
|
143
|
-
- **`BPSpawnRuleTemplates`**: Default mob spawn rules.
|
|
144
|
-
- **`BPTradingTemplates`**: Villager and wandering trader trade offers.
|
|
145
|
-
|
|
146
|
-
```ts
|
|
147
|
-
import {
|
|
148
|
-
BPBiomeTemplates,
|
|
149
|
-
BPEntityTemplates,
|
|
150
|
-
BPFeatureTemplates,
|
|
151
|
-
BPFeatureRuleTemplates,
|
|
152
|
-
BPLootTableTemplates,
|
|
153
|
-
BPRecipeTemplates,
|
|
154
|
-
BPSpawnRuleTemplates,
|
|
155
|
-
BPTradingTemplates,
|
|
156
|
-
} from "simplified-mojang-jsons";
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
## Contributing
|
|
160
|
-
|
|
161
|
-
Got an idea, found a bug, or want to add support for missing vanilla JSON schemas or components? Contributions are more than welcome!
|
|
162
|
-
|
|
163
|
-
- **Getting Started:** Please check out our [Contributing Guide](.github/CONTRIBUTING.md) before opening a pull request.
|
|
164
|
-
- **Community Guidelines:** Be kind and respectful. See our [Code of Conduct](.github/CODE_OF_CONDUCT.md).
|
|
165
|
-
- **Security:** To report a security vulnerability, please follow the steps in our [Security Policy](.github/SECURITY.md).
|
|
166
|
-
- **Releases:** Check what's new in each update in the [Changelog](.github/CHANGELOG.md).
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## Author & License
|
|
171
|
-
|
|
172
|
-
Developed by **[HaJuegos](https://github.com/HaJuegos)**.
|
|
173
|
-
|
|
174
|
-
This project is licensed under the **[MIT License](LICENSE.md)** — free to use, modify, and distribute in your own Minecraft Bedrock projects.
|
|
1
|
+
# 🛠️ Simplified Mojang JSONs
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
> ⚠️ **WORK IN PROGRESS!** ⚠️
|
|
5
|
+
> This repository is constantly evolving and undergoing active updates, so some features or simplified methods may be missing or not yet implemented. Please keep this in mind when using it!
|
|
6
|
+
|
|
7
|
+
> [!WARNING]
|
|
8
|
+
> 🌐 **COMMENTS IN SPANISH!** 🌐
|
|
9
|
+
> All code comments in this repository are written in **Spanish** and I do not plan to translate them. Identifiers, documentation and public API names are in English.
|
|
10
|
+
|
|
11
|
+
A lightweight tool to mass-modify and update vanilla JSON files with automated/manual TypeScript export. Say goodbye to tedious bulk updates when vanilla changes break your custom setup—and hello to a cleaner, smarter way to script JSON addons.
|
|
12
|
+
|
|
13
|
+
## Install:
|
|
14
|
+
|
|
15
|
+
Just run this in your project root:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install simplified-mojang-jsons@latest
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
or via pnpm:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm add simplified-mojang-jsons@latest
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Build Setup:
|
|
30
|
+
|
|
31
|
+
To start writing your JSON templates in TypeScript, you need to copy the base generator script into your project.
|
|
32
|
+
|
|
33
|
+
Add these scripts to your `package.json`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
"scripts": {
|
|
37
|
+
"setup:export": "node -e \"const fs = require('fs'); const path = require('path'); const src = require.resolve('simplified-mojang-jsons/exporttojson'); const dest = path.join('scripts', 'generatejsons.ts'); fs.mkdirSync(path.dirname(dest), { recursive: true }); fs.copyFileSync(src, dest); console.log('✅ Export script copied to scripts/generatejsons.ts!');\"",
|
|
38
|
+
"export:json": "tsx scripts/generatejsons.ts"
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Then, run the setup command once in your terminal:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm run setup:export
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
or via pnpm:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm setup:export
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
This will automatically create a `scripts/generatejsons.ts` file in your project structure.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### How to Use
|
|
59
|
+
|
|
60
|
+
1. Place your TypeScript template files inside your designated **input folder** (by default, the script looks in a `test/` folder or you can adjust it inside your copied `generatejsons.ts`).
|
|
61
|
+
2. Run the export command to compile your TS code and instantly output clean, formatted vanilla JSON files:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm run export:json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
or via pnpm:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pnpm export:json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Available Modules & Components
|
|
76
|
+
|
|
77
|
+
The API is split up into several handy modules, components, and pre-made templates to fit whatever your development workflow needs. Here is what's currently available out of the box:
|
|
78
|
+
|
|
79
|
+
> [!NOTE]
|
|
80
|
+
> **⚠️ Vanilla Templates Notice:** Some pre-made vanilla templates might not be 100% valid or fully functional out of the box in the game due to Minecraft updates or internal structure shifts. Feel free to modify them once they are exported into their final format or tweak them directly in your code!
|
|
81
|
+
|
|
82
|
+
> [!NOTE]
|
|
83
|
+
> The wrapped modules might not have _every_ single edge case fully mapped out just yet. I'll be adding the rest and keeping things updated to make your dev experience as smooth as possible.
|
|
84
|
+
|
|
85
|
+
### 1. Custom Builders (`create...`)
|
|
86
|
+
|
|
87
|
+
Functions designed to programmatically build, structure, and customize your behavior pack JSONs using TypeScript type support and OOP:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import {
|
|
91
|
+
// BP Manifest
|
|
92
|
+
createBPManifest,
|
|
93
|
+
|
|
94
|
+
// BP Stuff's
|
|
95
|
+
createBPAnimController,
|
|
96
|
+
createBPBiome,
|
|
97
|
+
createBPBlock,
|
|
98
|
+
createBPDialogue,
|
|
99
|
+
createBPDimension,
|
|
100
|
+
createBPEntity,
|
|
101
|
+
createBPFeature,
|
|
102
|
+
createBPFeatureRule,
|
|
103
|
+
createBPItemCatalog,
|
|
104
|
+
createBPItem,
|
|
105
|
+
createBPLootTable,
|
|
106
|
+
createBPRecipe,
|
|
107
|
+
createBPSpawnRule,
|
|
108
|
+
createBPTrading,
|
|
109
|
+
} from "simplified-mojang-jsons";
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 2. Root Components (`...Components`)
|
|
113
|
+
|
|
114
|
+
Modular configurations and property wrappers to fine-tune specific behavior features:
|
|
115
|
+
|
|
116
|
+
- **`BPBiomeComponents`**: Manage biome-specific components like fog, lighting, and sound settings.
|
|
117
|
+
- **`BPBlockComponents`**: Handle block traits, collision boxes, creative categories, and component definitions.
|
|
118
|
+
- **`BPDimensionComponents`**: Configure custom dimension behaviors and environment rules.
|
|
119
|
+
- **`BPEntityComponents`**: Set up entity components such as movement, component groups, and event triggers.
|
|
120
|
+
- **`BPItemComponents`**: Define custom item behaviors, hand actions, and attributes.
|
|
121
|
+
- **`BPSpawnRuleComponents`**: Adjust spawning conditions, mob caps, and herd rules.
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
import {
|
|
125
|
+
BPBiomeComponents,
|
|
126
|
+
BPBlockComponents,
|
|
127
|
+
BPDimensionComponents,
|
|
128
|
+
BPEntityComponents,
|
|
129
|
+
BPItemComponents,
|
|
130
|
+
BPSpawnRuleComponents,
|
|
131
|
+
} from "simplified-mojang-jsons";
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 3. Pre-made Templates (`...Templates`)
|
|
135
|
+
|
|
136
|
+
Ready-to-use base vanilla templates that you can quickly override, modify, and export:
|
|
137
|
+
|
|
138
|
+
- **`BPBiomeTemplates`**: Base vanilla biome configurations.
|
|
139
|
+
- **`BPEntityTemplates`**: Base vanilla entity files ready for modification.
|
|
140
|
+
- **`BPFeatureTemplates` & `BPFeatureRuleTemplates`**: World generation and feature rule blueprints.
|
|
141
|
+
- **`BPLootTableTemplates`**: Standard loot tables for blocks, entities, and fishing.
|
|
142
|
+
- **`BPRecipeTemplates`**: Crafting and smelting recipe templates.
|
|
143
|
+
- **`BPSpawnRuleTemplates`**: Default mob spawn rules.
|
|
144
|
+
- **`BPTradingTemplates`**: Villager and wandering trader trade offers.
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
import {
|
|
148
|
+
BPBiomeTemplates,
|
|
149
|
+
BPEntityTemplates,
|
|
150
|
+
BPFeatureTemplates,
|
|
151
|
+
BPFeatureRuleTemplates,
|
|
152
|
+
BPLootTableTemplates,
|
|
153
|
+
BPRecipeTemplates,
|
|
154
|
+
BPSpawnRuleTemplates,
|
|
155
|
+
BPTradingTemplates,
|
|
156
|
+
} from "simplified-mojang-jsons";
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Contributing
|
|
160
|
+
|
|
161
|
+
Got an idea, found a bug, or want to add support for missing vanilla JSON schemas or components? Contributions are more than welcome!
|
|
162
|
+
|
|
163
|
+
- **Getting Started:** Please check out our [Contributing Guide](.github/CONTRIBUTING.md) before opening a pull request.
|
|
164
|
+
- **Community Guidelines:** Be kind and respectful. See our [Code of Conduct](.github/CODE_OF_CONDUCT.md).
|
|
165
|
+
- **Security:** To report a security vulnerability, please follow the steps in our [Security Policy](.github/SECURITY.md).
|
|
166
|
+
- **Releases:** Check what's new in each update in the [Changelog](.github/CHANGELOG.md).
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Author & License
|
|
171
|
+
|
|
172
|
+
Developed by **[HaJuegos](https://github.com/HaJuegos)**.
|
|
173
|
+
|
|
174
|
+
This project is licensed under the **[MIT License](LICENSE.md)** — free to use, modify, and distribute in your own Minecraft Bedrock projects.
|