minecraft-datapack-language 15.4.8__py3-none-any.whl → 15.4.9__py3-none-any.whl
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.
- minecraft_datapack_language/_version.py +2 -2
- minecraft_datapack_language/cli_build.py +11 -11
- minecraft_datapack_language/cli_help.py +404 -370
- minecraft_datapack_language/cli_new.py +129 -41
- minecraft_datapack_language/mdl_errors.py +227 -139
- {minecraft_datapack_language-15.4.8.dist-info → minecraft_datapack_language-15.4.9.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.4.8.dist-info → minecraft_datapack_language-15.4.9.dist-info}/RECORD +11 -11
- {minecraft_datapack_language-15.4.8.dist-info → minecraft_datapack_language-15.4.9.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.4.8.dist-info → minecraft_datapack_language-15.4.9.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.4.8.dist-info → minecraft_datapack_language-15.4.9.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.4.8.dist-info → minecraft_datapack_language-15.4.9.dist-info}/top_level.txt +0 -0
@@ -2,12 +2,6 @@
|
|
2
2
|
CLI Help System - Comprehensive help documentation for MDL CLI
|
3
3
|
"""
|
4
4
|
|
5
|
-
from .cli_colors import (
|
6
|
-
print_header, print_title, print_section, print_separator,
|
7
|
-
print_success, print_warning, print_info, print_bullet,
|
8
|
-
print_code, color
|
9
|
-
)
|
10
|
-
|
11
5
|
|
12
6
|
def show_main_help():
|
13
7
|
"""Display the main help message for the MDL CLI."""
|
@@ -17,381 +11,421 @@ def show_main_help():
|
|
17
11
|
except ImportError:
|
18
12
|
version = "unknown"
|
19
13
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
print_bullet("Language Reference: https://www.mcmdl.com/docs/language-reference")
|
77
|
-
print_bullet("CLI Reference: https://www.mcmdl.com/docs/cli-reference")
|
78
|
-
print_bullet("Examples: https://www.mcmdl.com/docs/examples")
|
79
|
-
print()
|
80
|
-
|
81
|
-
print_section("Error Reporting")
|
82
|
-
print()
|
83
|
-
|
84
|
-
print_info("MDL provides detailed error messages with:")
|
85
|
-
print_bullet("Exact file location (line, column)")
|
86
|
-
print_bullet("Context lines showing the problematic code")
|
87
|
-
print_bullet("Helpful suggestions for fixing issues")
|
88
|
-
print_bullet("Multiple error collection and reporting")
|
89
|
-
print()
|
90
|
-
|
91
|
-
print_info("For support and bug reports, visit:")
|
92
|
-
print_code("https://github.com/aaron777collins/MinecraftDatapackLanguage")
|
14
|
+
print(f"""
|
15
|
+
[GAME] MDL (Minecraft Datapack Language) CLI - v{version}
|
16
|
+
====================================================
|
17
|
+
|
18
|
+
MDL is a simplified language for creating Minecraft datapacks with variables,
|
19
|
+
control structures, and easy syntax. This CLI tool compiles MDL files into
|
20
|
+
standard Minecraft datapacks.
|
21
|
+
|
22
|
+
[CMD] Available Commands:
|
23
|
+
=====================
|
24
|
+
|
25
|
+
[BUILD] build - Compile MDL files into a Minecraft datapack
|
26
|
+
[CHECK] check - Validate MDL files for syntax and semantic errors
|
27
|
+
[NEW] new - Create a new MDL project with template files
|
28
|
+
|
29
|
+
[DOC] Detailed Help:
|
30
|
+
================
|
31
|
+
|
32
|
+
For detailed information about any command, use:
|
33
|
+
mdl <command> --help
|
34
|
+
|
35
|
+
Examples:
|
36
|
+
mdl build --help - Show build command options
|
37
|
+
mdl check --help - Show check command options
|
38
|
+
mdl new --help - Show new project options
|
39
|
+
|
40
|
+
[NEXT] Quick Start:
|
41
|
+
==============
|
42
|
+
|
43
|
+
1. Create a new project:
|
44
|
+
mdl new my_project
|
45
|
+
|
46
|
+
2. Build your datapack:
|
47
|
+
mdl build --mdl my_project.mdl -o dist
|
48
|
+
|
49
|
+
3. Check for errors:
|
50
|
+
mdl check my_project.mdl
|
51
|
+
|
52
|
+
[INFO] Documentation:
|
53
|
+
================
|
54
|
+
|
55
|
+
• Language Reference: https://www.mcmdl.com/docs/language-reference
|
56
|
+
• CLI Reference: https://www.mcmdl.com/docs/cli-reference
|
57
|
+
• Examples: https://www.mcmdl.com/docs/examples
|
58
|
+
|
59
|
+
🐛 Error Reporting:
|
60
|
+
==================
|
61
|
+
|
62
|
+
MDL provides detailed error messages with:
|
63
|
+
• Exact file location (line, column)
|
64
|
+
• Context lines showing the problematic code
|
65
|
+
• Helpful suggestions for fixing issues
|
66
|
+
• Multiple error collection and reporting
|
67
|
+
|
68
|
+
For support and bug reports, visit: https://github.com/aaron777collins/MinecraftDatapackLanguage
|
69
|
+
""")
|
93
70
|
|
94
71
|
|
95
72
|
def show_build_help():
|
96
73
|
"""Display detailed help for the build command."""
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
74
|
+
print("""
|
75
|
+
[BUILD] MDL Build Command - Compile MDL Files to Minecraft Datapacks
|
76
|
+
===============================================================
|
77
|
+
|
78
|
+
The build command compiles MDL files into standard Minecraft datapacks that can
|
79
|
+
be loaded directly into Minecraft.
|
80
|
+
|
81
|
+
[CMD] Usage:
|
82
|
+
========
|
83
|
+
|
84
|
+
mdl build --mdl <input> -o <output> [options]
|
85
|
+
|
86
|
+
[DIR] Arguments:
|
87
|
+
============
|
88
|
+
|
89
|
+
--mdl, -m <input> Input MDL file or directory containing .mdl files
|
90
|
+
Examples: --mdl project.mdl, --mdl src/, --mdl .
|
91
|
+
|
92
|
+
-o, --output <output> Output directory for the generated datapack
|
93
|
+
Example: -o dist, -o build/my_pack
|
94
|
+
|
95
|
+
[OPT] Options:
|
96
|
+
==========
|
97
|
+
|
98
|
+
--verbose, -v Enable verbose output with detailed build information
|
99
|
+
Shows file parsing, function generation, and progress
|
100
|
+
|
101
|
+
--pack-format <num> Override the pack format number in pack.mcmeta
|
102
|
+
Default: 82 (Minecraft 1.20+)
|
103
|
+
Example: --pack-format 15 (for older versions)
|
104
|
+
|
105
|
+
--wrapper <name> Create a zip file with the specified name
|
106
|
+
Example: --wrapper my_awesome_pack
|
107
|
+
|
108
|
+
--ignore-warnings Suppress warning messages during build
|
109
|
+
Only show errors, hide all warnings
|
110
|
+
|
111
|
+
[EX] Examples:
|
112
|
+
===========
|
113
|
+
|
114
|
+
1. Build a single MDL file:
|
115
|
+
mdl build --mdl hello_world.mdl -o dist
|
116
|
+
|
117
|
+
2. Build all MDL files in a directory:
|
118
|
+
mdl build --mdl src/ -o build/my_pack
|
119
|
+
|
120
|
+
3. Build current directory with verbose output:
|
121
|
+
mdl build --mdl . -o dist --verbose
|
122
|
+
|
123
|
+
4. Build with custom pack format and zip wrapper:
|
124
|
+
mdl build --mdl project.mdl -o dist --pack-format 15 --wrapper my_pack
|
125
|
+
|
126
|
+
5. Build multiple files in a directory:
|
127
|
+
mdl build --mdl examples/ -o output --verbose
|
128
|
+
|
129
|
+
[OUT] Output Structure:
|
130
|
+
===================
|
131
|
+
|
132
|
+
The build command creates a standard Minecraft datapack structure:
|
133
|
+
|
134
|
+
output/
|
135
|
+
├── pack.mcmeta # Datapack metadata
|
136
|
+
└── data/
|
137
|
+
├── <namespace>/ # Your datapack namespace
|
138
|
+
│ └── function/ # Generated functions
|
139
|
+
│ ├── load.mcfunction
|
140
|
+
│ └── *.mcfunction
|
141
|
+
└── minecraft/
|
142
|
+
└── tags/
|
143
|
+
└── function/ # Load/tick tags
|
144
|
+
├── load.json
|
145
|
+
└── tick.json
|
146
|
+
|
147
|
+
[FEAT] Features:
|
148
|
+
===========
|
149
|
+
|
150
|
+
• Multi-file compilation - Merge multiple .mdl files into one datapack
|
151
|
+
• Variable system - Automatic scoreboard objective creation
|
152
|
+
• Control structures - If/else statements and while loops
|
153
|
+
• Function calls - Call other functions within your datapack
|
154
|
+
• Raw commands - Use native Minecraft commands with $variable$ substitution
|
155
|
+
• Error handling - Detailed error reporting with suggestions
|
156
|
+
• Progress tracking - Verbose mode shows build progress
|
157
|
+
|
158
|
+
[CHECK] Error Handling:
|
159
|
+
=================
|
160
|
+
|
161
|
+
The build command provides comprehensive error reporting:
|
162
|
+
• Syntax errors with exact line and column numbers
|
163
|
+
• Context lines showing the problematic code
|
164
|
+
• Helpful suggestions for fixing issues
|
165
|
+
• Multiple error collection (won't stop on first error)
|
166
|
+
|
167
|
+
For more information, visit: https://www.mcmdl.com/docs/cli-reference#build
|
168
|
+
""")
|
172
169
|
|
173
170
|
|
174
171
|
def show_check_help():
|
175
172
|
"""Display detailed help for the check command."""
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
173
|
+
print("""
|
174
|
+
[CHECK] MDL Check Command - Validate MDL Files for Errors
|
175
|
+
====================================================
|
176
|
+
|
177
|
+
The check command validates MDL files for syntax errors, semantic issues, and
|
178
|
+
potential problems without generating any output files.
|
179
|
+
|
180
|
+
[CMD] Usage:
|
181
|
+
========
|
182
|
+
|
183
|
+
mdl check <input> [options]
|
184
|
+
|
185
|
+
[DIR] Arguments:
|
186
|
+
============
|
187
|
+
|
188
|
+
<input> Input MDL file or directory containing .mdl files
|
189
|
+
Examples: project.mdl, src/, .
|
190
|
+
|
191
|
+
[OPT] Options:
|
192
|
+
==========
|
193
|
+
|
194
|
+
--verbose, -v Enable verbose output with detailed validation information
|
195
|
+
Shows parsing steps, token analysis, and detailed error context
|
196
|
+
|
197
|
+
--ignore-warnings Suppress warning messages during check
|
198
|
+
Only show errors, hide all warnings
|
199
|
+
|
200
|
+
[EX] Examples:
|
201
|
+
===========
|
202
|
+
|
203
|
+
1. Check a single MDL file:
|
204
|
+
mdl check hello_world.mdl
|
205
|
+
|
206
|
+
2. Check all MDL files in a directory:
|
207
|
+
mdl check src/
|
208
|
+
|
209
|
+
3. Check current directory with verbose output:
|
210
|
+
mdl check . --verbose
|
211
|
+
|
212
|
+
4. Check multiple files:
|
213
|
+
mdl check examples/ --verbose
|
214
|
+
|
215
|
+
[CHECK] Validation Types:
|
216
|
+
===================
|
217
|
+
|
218
|
+
The check command performs comprehensive validation:
|
219
|
+
|
220
|
+
[EX] Syntax Validation:
|
221
|
+
• Lexical analysis - Token recognition and validation
|
222
|
+
• Parsing - AST construction and syntax structure
|
223
|
+
• Grammar validation - Language rule compliance
|
224
|
+
|
225
|
+
[OPT] Semantic Validation:
|
226
|
+
• Variable declarations - Proper variable naming and scope
|
227
|
+
• Function definitions - Valid function signatures
|
228
|
+
• Control structures - Proper if/else and while loop syntax
|
229
|
+
• Command validation - Minecraft command syntax checking
|
230
|
+
|
231
|
+
[WARN] Error Detection:
|
232
|
+
• Missing semicolons and braces
|
233
|
+
• Invalid variable names or references
|
234
|
+
• Unclosed strings and comments
|
235
|
+
• Malformed control structures
|
236
|
+
• Invalid selector syntax
|
237
|
+
• Undefined function calls
|
238
|
+
|
239
|
+
[REP] Error Reporting:
|
240
|
+
==================
|
241
|
+
|
242
|
+
The check command provides detailed error information:
|
243
|
+
|
244
|
+
[FEAT] Error Details:
|
245
|
+
• File path and exact location (line, column)
|
246
|
+
• Error type and description
|
247
|
+
• Context lines showing the problematic code
|
248
|
+
• Helpful suggestions for fixing issues
|
249
|
+
|
250
|
+
[CMD] Error Types:
|
251
|
+
• MDLSyntaxError - Basic syntax violations
|
252
|
+
• MDLLexerError - Token recognition issues
|
253
|
+
• MDLParserError - Parsing and structure problems
|
254
|
+
• MDLValidationError - Semantic validation failures
|
255
|
+
• MDLFileError - File access and I/O issues
|
256
|
+
|
257
|
+
[TIP] Example Error Output:
|
258
|
+
========================
|
259
|
+
|
260
|
+
Error 1: MDLSyntaxError in test.mdl:15:8
|
261
|
+
Missing closing brace for if statement
|
262
|
+
Context:
|
263
|
+
13: if (score > 10) {
|
264
|
+
14: say "High score!"
|
265
|
+
15: score = 0
|
266
|
+
16: }
|
267
|
+
|
268
|
+
Suggestion: Add closing brace '}' after line 15
|
269
|
+
|
270
|
+
[CHECK] Advanced Features:
|
271
|
+
====================
|
272
|
+
|
273
|
+
• Multi-file validation - Check entire projects at once
|
274
|
+
• Directory support - Recursively check all .mdl files
|
275
|
+
• Error collection - Report all errors, not just the first one
|
276
|
+
• Context preservation - Show surrounding code for better debugging
|
277
|
+
• Suggestion system - Provide helpful fix recommendations
|
278
|
+
|
279
|
+
[NEXT] Integration:
|
280
|
+
==============
|
281
|
+
|
282
|
+
The check command is perfect for:
|
283
|
+
• CI/CD pipelines - Automated validation
|
284
|
+
• Development workflows - Pre-commit checks
|
285
|
+
• Learning MDL - Understand syntax requirements
|
286
|
+
• Debugging - Identify and fix issues quickly
|
287
|
+
|
288
|
+
For more information, visit: https://www.mcmdl.com/docs/cli-reference#check
|
289
|
+
""")
|
249
290
|
|
250
291
|
|
251
292
|
def show_new_help():
|
252
293
|
"""Display detailed help for the new command."""
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
print_info("The new command creates a new MDL project with template files and proper structure.")
|
258
|
-
print()
|
259
|
-
|
260
|
-
print_section("Usage")
|
261
|
-
print()
|
262
|
-
|
263
|
-
print_code(" mdl new <project_name> [options]")
|
264
|
-
print()
|
265
|
-
|
266
|
-
print_section("Arguments")
|
267
|
-
print()
|
268
|
-
|
269
|
-
print_code("<project_name>")
|
270
|
-
print_info(" Name for the new project (will create project_name/ directory)")
|
271
|
-
print_info(" Examples: my_datapack, adventure_pack, minigame")
|
272
|
-
print()
|
273
|
-
|
274
|
-
print_section("Options")
|
275
|
-
print()
|
276
|
-
|
277
|
-
print_code("--pack-name <name>")
|
278
|
-
print_info(" Custom pack name (default: same as project name)")
|
279
|
-
print_info(" This appears in the pack.mcmeta file")
|
280
|
-
print()
|
281
|
-
|
282
|
-
print_code("--pack-format <number>")
|
283
|
-
print_info(" Pack format number (default: 82)")
|
284
|
-
print_info(" Higher numbers support newer Minecraft versions")
|
285
|
-
print_info(" Common values: 15 (1.17+), 26 (1.18+), 82 (1.20+)")
|
286
|
-
print()
|
287
|
-
|
288
|
-
print_section("What Gets Created")
|
289
|
-
print()
|
290
|
-
|
291
|
-
print_info("The new command creates:")
|
292
|
-
print_bullet("project_name/ directory")
|
293
|
-
print_bullet("main.mdl - Main MDL source file with basic hello world example")
|
294
|
-
print_bullet("README.md - Project documentation template")
|
295
|
-
print_bullet("Proper pack.mcmeta configuration")
|
296
|
-
print_bullet("Simple function structure (main function with on_load hook)")
|
297
|
-
print_bullet("Clean, working example that demonstrates basic MDL syntax")
|
298
|
-
print()
|
299
|
-
|
300
|
-
print_section("Examples")
|
301
|
-
print()
|
302
|
-
|
303
|
-
print_code(" mdl new my_datapack")
|
304
|
-
print_info(" Create a basic project with default settings")
|
305
|
-
print()
|
306
|
-
|
307
|
-
print_code(" mdl new adventure_pack --pack-name \"Adventure Pack\"")
|
308
|
-
print_info(" Create project with custom pack name")
|
309
|
-
print()
|
310
|
-
|
311
|
-
print_code(" mdl new minigame --pack-format 26")
|
312
|
-
print_info(" Create project targeting Minecraft 1.18+")
|
313
|
-
print()
|
314
|
-
|
315
|
-
print_section("Project Structure")
|
316
|
-
print()
|
317
|
-
|
318
|
-
print_info("New projects include:")
|
319
|
-
print_bullet("main function - Simple hello world example")
|
320
|
-
print_bullet("on_load hook - Automatically runs the main function when loaded")
|
321
|
-
print_bullet("Clean, minimal code that compiles and works immediately")
|
322
|
-
print_bullet("Proper pack declaration and namespace setup")
|
323
|
-
print()
|
324
|
-
|
325
|
-
print_success("Project created! Start editing the .mdl file and use 'mdl build' to compile.")
|
294
|
+
print("""
|
295
|
+
[NEW] MDL New Command - Create New MDL Projects
|
296
|
+
============================================
|
326
297
|
|
298
|
+
The new command creates a new MDL project with template files and proper
|
299
|
+
structure to get you started quickly.
|
327
300
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
301
|
+
[CMD] Usage:
|
302
|
+
========
|
303
|
+
|
304
|
+
mdl new <project_name> [options]
|
305
|
+
|
306
|
+
[DIR] Arguments:
|
307
|
+
============
|
308
|
+
|
309
|
+
<project_name> Name for your new MDL project
|
310
|
+
This will be used for the project directory and pack name
|
311
|
+
Example: my_awesome_pack, hello_world, magic_system
|
312
|
+
|
313
|
+
[OPT] Options:
|
314
|
+
==========
|
315
|
+
|
316
|
+
--pack-name <name> Custom name for the datapack (defaults to project name)
|
317
|
+
This appears in the pack.mcmeta description
|
318
|
+
Example: --pack-name "My Awesome Magic Pack"
|
319
|
+
|
320
|
+
--pack-format <num> Pack format number for Minecraft version compatibility
|
321
|
+
Default: 82 (Minecraft 1.20+)
|
322
|
+
Example: --pack-format 15 (for older versions)
|
323
|
+
|
324
|
+
[EX] Examples:
|
325
|
+
===========
|
326
|
+
|
327
|
+
1. Create a basic project:
|
328
|
+
mdl new hello_world
|
329
|
+
|
330
|
+
2. Create project with custom pack name:
|
331
|
+
mdl new magic_system --pack-name "Epic Magic Pack"
|
332
|
+
|
333
|
+
3. Create project for older Minecraft version:
|
334
|
+
mdl new retro_pack --pack-format 15
|
335
|
+
|
336
|
+
4. Create project with all custom options:
|
337
|
+
mdl new my_project --pack-name "My Project" --pack-format 82
|
338
|
+
|
339
|
+
[OUT] Generated Structure:
|
340
|
+
======================
|
341
|
+
|
342
|
+
The new command creates a complete project structure:
|
343
|
+
|
344
|
+
<project_name>/
|
345
|
+
├── README.md # Project documentation
|
346
|
+
└── <project_name>.mdl # Main MDL file with template code
|
347
|
+
|
348
|
+
[FILE] Template Content:
|
349
|
+
===================
|
350
|
+
|
351
|
+
The generated MDL file includes:
|
352
|
+
|
353
|
+
[CMD] Pack Declaration:
|
354
|
+
```mdl
|
355
|
+
pack {
|
356
|
+
name: "project_name"
|
357
|
+
format: 82
|
358
|
+
description: "Generated by MDL CLI"
|
359
|
+
}
|
360
|
+
```
|
361
|
+
|
362
|
+
[OPT] Example Functions:
|
363
|
+
```mdl
|
364
|
+
function main {
|
365
|
+
say "Hello from MDL!"
|
366
|
+
|
367
|
+
// Variable example
|
368
|
+
score = 10
|
369
|
+
say "Score: $score$"
|
370
|
+
|
371
|
+
// Conditional example
|
372
|
+
if (score > 5) {
|
373
|
+
say "High score!"
|
374
|
+
} else {
|
375
|
+
say "Try again!"
|
376
|
+
}
|
377
|
+
}
|
378
|
+
|
379
|
+
function load {
|
380
|
+
// This function runs when the datapack loads
|
381
|
+
say "Datapack loaded successfully!"
|
382
|
+
}
|
383
|
+
```
|
384
|
+
|
385
|
+
[FEAT] Features:
|
386
|
+
===========
|
387
|
+
|
388
|
+
• Complete project setup - Ready-to-use structure
|
389
|
+
• Template code - Working examples to learn from
|
390
|
+
• Proper pack metadata - Correct pack.mcmeta configuration
|
391
|
+
• Documentation - README with usage instructions
|
392
|
+
• Best practices - Follows MDL conventions
|
393
|
+
|
394
|
+
[NEXT] Getting Started:
|
395
|
+
==================
|
396
|
+
|
397
|
+
After creating a new project:
|
398
|
+
|
399
|
+
1. Navigate to the project directory:
|
400
|
+
cd <project_name>
|
401
|
+
|
402
|
+
2. Edit the MDL file:
|
403
|
+
# Edit <project_name>.mdl with your code
|
404
|
+
|
405
|
+
3. Build the datapack:
|
406
|
+
mdl build --mdl <project_name>.mdl -o dist
|
407
|
+
|
408
|
+
4. Check for errors:
|
409
|
+
mdl check <project_name>.mdl
|
410
|
+
|
411
|
+
5. Load in Minecraft:
|
412
|
+
# Copy the dist folder to your world's datapacks directory
|
413
|
+
|
414
|
+
[TIP] Tips:
|
415
|
+
========
|
416
|
+
|
417
|
+
• Use descriptive project names - They become your namespace
|
418
|
+
• Start with the template code - It demonstrates key MDL features
|
419
|
+
• Check your code regularly - Use `mdl check` during development
|
420
|
+
• Use version control - Git is great for tracking changes
|
421
|
+
• Read the documentation - Learn about all available features
|
422
|
+
|
423
|
+
[INFO] Next Steps:
|
424
|
+
=============
|
425
|
+
|
426
|
+
• Language Reference: https://www.mcmdl.com/docs/language-reference
|
427
|
+
• Examples: https://www.mcmdl.com/docs/examples
|
428
|
+
• CLI Reference: https://www.mcmdl.com/docs/cli-reference
|
429
|
+
|
430
|
+
For more information, visit: https://www.mcmdl.com/docs/cli-reference#new
|
431
|
+
""")
|