minecraft-datapack-language 15.4.0__py3-none-any.whl → 15.4.2__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 +181 -1025
- minecraft_datapack_language/cli_colors.py +264 -0
- minecraft_datapack_language/cli_help.py +371 -404
- minecraft_datapack_language/mdl_errors.py +112 -117
- {minecraft_datapack_language-15.4.0.dist-info → minecraft_datapack_language-15.4.2.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.4.0.dist-info → minecraft_datapack_language-15.4.2.dist-info}/RECORD +11 -10
- {minecraft_datapack_language-15.4.0.dist-info → minecraft_datapack_language-15.4.2.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.4.0.dist-info → minecraft_datapack_language-15.4.2.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.4.0.dist-info → minecraft_datapack_language-15.4.2.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.4.0.dist-info → minecraft_datapack_language-15.4.2.dist-info}/top_level.txt +0 -0
@@ -2,6 +2,12 @@
|
|
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, print_command, print_option, color
|
9
|
+
)
|
10
|
+
|
5
11
|
|
6
12
|
def show_main_help():
|
7
13
|
"""Display the main help message for the MDL CLI."""
|
@@ -11,421 +17,382 @@ def show_main_help():
|
|
11
17
|
except ImportError:
|
12
18
|
version = "unknown"
|
13
19
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
MDL is a simplified language for creating Minecraft datapacks with variables,
|
19
|
-
|
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
|
-
|
20
|
+
print_header(f"MDL (Minecraft Datapack Language) CLI - v{version}")
|
21
|
+
print_separator()
|
22
|
+
print()
|
23
|
+
|
24
|
+
print_info("MDL is a simplified language for creating Minecraft datapacks with variables, control structures, and easy syntax. This CLI tool compiles MDL files into standard Minecraft datapacks.")
|
25
|
+
print()
|
26
|
+
|
27
|
+
print_section("Available Commands")
|
28
|
+
print()
|
29
|
+
|
30
|
+
print_command("build")
|
31
|
+
print_info(" - Compile MDL files into a Minecraft datapack")
|
32
|
+
print()
|
33
|
+
|
34
|
+
print_command("check")
|
35
|
+
print_info(" - Validate MDL files for syntax and semantic errors")
|
36
|
+
print()
|
37
|
+
|
38
|
+
print_command("new")
|
39
|
+
print_info(" - Create a new MDL project with template files")
|
40
|
+
print()
|
41
|
+
|
42
|
+
print_section("Detailed Help")
|
43
|
+
print()
|
44
|
+
|
45
|
+
print_info("For detailed information about any command, use:")
|
46
|
+
print_code(" mdl <command> --help")
|
47
|
+
print()
|
48
|
+
|
49
|
+
print_info("Examples:")
|
50
|
+
print_code(" mdl build --help")
|
51
|
+
print_info(" - Show build command options")
|
52
|
+
print_code(" mdl check --help")
|
53
|
+
print_info(" - Show check command options")
|
54
|
+
print_code(" mdl new --help")
|
55
|
+
print_info(" - Show new project options")
|
56
|
+
print()
|
57
|
+
|
58
|
+
print_section("Quick Start")
|
59
|
+
print()
|
60
|
+
|
61
|
+
print_bullet("1. Create a new project:")
|
62
|
+
print_code(" mdl new my_project")
|
63
|
+
print()
|
64
|
+
|
65
|
+
print_bullet("2. Build your datapack:")
|
66
|
+
print_code(" mdl build --mdl my_project.mdl -o dist")
|
67
|
+
print()
|
68
|
+
|
69
|
+
print_bullet("3. Check for errors:")
|
70
|
+
print_code(" mdl check my_project.mdl")
|
71
|
+
print()
|
72
|
+
|
73
|
+
print_section("Documentation")
|
74
|
+
print()
|
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")
|
70
93
|
|
71
94
|
|
72
95
|
def show_build_help():
|
73
96
|
"""Display detailed help for the build command."""
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
The build command compiles MDL files into standard Minecraft datapacks that can
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
mdl build --mdl <input> -o <output> [options]
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
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
|
-
output
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
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
|
-
""")
|
97
|
+
print_title("MDL Build Command - Compile MDL Files to Minecraft Datapacks")
|
98
|
+
print_separator()
|
99
|
+
print()
|
100
|
+
|
101
|
+
print_info("The build command compiles MDL files into standard Minecraft datapacks that can be loaded directly into Minecraft.")
|
102
|
+
print()
|
103
|
+
|
104
|
+
print_section("Usage")
|
105
|
+
print()
|
106
|
+
|
107
|
+
print_code(" mdl build --mdl <input> -o <output> [options]")
|
108
|
+
print()
|
109
|
+
|
110
|
+
print_section("Arguments")
|
111
|
+
print()
|
112
|
+
|
113
|
+
print_option("--mdl, -m <input>")
|
114
|
+
print_info(" Input MDL file or directory containing .mdl files")
|
115
|
+
print_info(" Examples: --mdl project.mdl, --mdl src/, --mdl .")
|
116
|
+
print()
|
117
|
+
|
118
|
+
print_option("-o, --output <output>")
|
119
|
+
print_info(" Output directory for the generated datapack")
|
120
|
+
print_info(" Example: -o dist, -o build/my_pack")
|
121
|
+
print()
|
122
|
+
|
123
|
+
print_section("Options")
|
124
|
+
print()
|
125
|
+
|
126
|
+
print_option("--verbose, -v")
|
127
|
+
print_info(" Enable verbose output with detailed build information")
|
128
|
+
print_info(" Shows file parsing, function generation, and progress")
|
129
|
+
print()
|
130
|
+
|
131
|
+
print_option("--pack-format <number>")
|
132
|
+
print_info(" Override the pack format number (default: 82)")
|
133
|
+
print_info(" Higher numbers support newer Minecraft versions")
|
134
|
+
print()
|
135
|
+
|
136
|
+
print_option("--wrapper <name>")
|
137
|
+
print_info(" Create a zip file with the specified name")
|
138
|
+
print_info(" Example: --wrapper my_pack.zip")
|
139
|
+
print()
|
140
|
+
|
141
|
+
print_option("--ignore-warnings")
|
142
|
+
print_info(" Suppress warning messages during build")
|
143
|
+
print_info(" Only errors will be shown")
|
144
|
+
print()
|
145
|
+
|
146
|
+
print_section("Examples")
|
147
|
+
print()
|
148
|
+
|
149
|
+
print_code(" mdl build --mdl my_project.mdl -o dist")
|
150
|
+
print_info(" Build a single MDL file to dist/ directory")
|
151
|
+
print()
|
152
|
+
|
153
|
+
print_code(" mdl build --mdl src/ -o build/ --verbose")
|
154
|
+
print_info(" Build all MDL files in src/ to build/ with verbose output")
|
155
|
+
print()
|
156
|
+
|
157
|
+
print_code(" mdl build --mdl . -o output --wrapper my_pack.zip")
|
158
|
+
print_info(" Build current directory and create zip file")
|
159
|
+
print()
|
160
|
+
|
161
|
+
print_section("Output Structure")
|
162
|
+
print()
|
163
|
+
|
164
|
+
print_info("The build command generates a standard Minecraft datapack structure:")
|
165
|
+
print_bullet("pack.mcmeta - Pack metadata and format information")
|
166
|
+
print_bullet("data/ - Contains all generated functions and resources")
|
167
|
+
print_bullet("data/<namespace>/function/ - Generated .mcfunction files")
|
168
|
+
print_bullet("data/minecraft/tags/function/ - Function tags for load/tick")
|
169
|
+
print()
|
170
|
+
|
171
|
+
print_success("Build completed successfully! Your datapack is ready to use in Minecraft.")
|
169
172
|
|
170
173
|
|
171
174
|
def show_check_help():
|
172
175
|
"""Display detailed help for the check command."""
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
The check command validates MDL files for syntax errors, semantic issues, and
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
mdl check <input> [options]
|
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
|
-
• 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
|
-
""")
|
176
|
+
print_title("MDL Check Command - Validate MDL Files")
|
177
|
+
print_separator()
|
178
|
+
print()
|
179
|
+
|
180
|
+
print_info("The check command validates MDL files for syntax errors, semantic issues, and potential problems before building.")
|
181
|
+
print()
|
182
|
+
|
183
|
+
print_section("Usage")
|
184
|
+
print()
|
185
|
+
|
186
|
+
print_code(" mdl check <input> [options]")
|
187
|
+
print()
|
188
|
+
|
189
|
+
print_section("Arguments")
|
190
|
+
print()
|
191
|
+
|
192
|
+
print_option("<input>")
|
193
|
+
print_info(" Input MDL file or directory to check")
|
194
|
+
print_info(" Examples: project.mdl, src/, .")
|
195
|
+
print()
|
196
|
+
|
197
|
+
print_section("Options")
|
198
|
+
print()
|
199
|
+
|
200
|
+
print_option("--verbose, -v")
|
201
|
+
print_info(" Enable verbose output with detailed validation information")
|
202
|
+
print_info(" Shows parsing steps, variable analysis, and scope checking")
|
203
|
+
print()
|
204
|
+
|
205
|
+
print_option("--ignore-warnings")
|
206
|
+
print_info(" Suppress warning messages during check")
|
207
|
+
print_info(" Only errors will be shown")
|
208
|
+
print()
|
209
|
+
|
210
|
+
print_section("What Gets Checked")
|
211
|
+
print()
|
212
|
+
|
213
|
+
print_info("The check command validates:")
|
214
|
+
print_bullet("Syntax correctness (proper MDL grammar)")
|
215
|
+
print_bullet("Variable declarations and usage")
|
216
|
+
print_bullet("Scope boundaries and function calls")
|
217
|
+
print_bullet("Control structure validity")
|
218
|
+
print_bullet("Resource file references")
|
219
|
+
print_bullet("Pack configuration")
|
220
|
+
print()
|
221
|
+
|
222
|
+
print_section("Examples")
|
223
|
+
print()
|
224
|
+
|
225
|
+
print_code(" mdl check my_project.mdl")
|
226
|
+
print_info(" Check a single MDL file")
|
227
|
+
print()
|
228
|
+
|
229
|
+
print_code(" mdl check src/ --verbose")
|
230
|
+
print_info(" Check all MDL files in src/ with detailed output")
|
231
|
+
print()
|
232
|
+
|
233
|
+
print_code(" mdl check . --ignore-warnings")
|
234
|
+
print_info(" Check current directory, showing only errors")
|
235
|
+
print()
|
236
|
+
|
237
|
+
print_section("Output")
|
238
|
+
print()
|
239
|
+
|
240
|
+
print_info("Check results show:")
|
241
|
+
print_bullet("✓ Valid files with no issues")
|
242
|
+
print_bullet("⚠ Warning messages for potential problems")
|
243
|
+
print_bullet("✗ Error messages for issues that must be fixed")
|
244
|
+
print_bullet("File locations and line numbers for all issues")
|
245
|
+
print_bullet("Helpful suggestions for fixing problems")
|
246
|
+
print()
|
247
|
+
|
248
|
+
print_success("Use check before build to catch issues early!")
|
290
249
|
|
291
250
|
|
292
251
|
def show_new_help():
|
293
252
|
"""Display detailed help for the new command."""
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
The new command creates a new MDL project with template files and proper
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
mdl new <project_name> [options]
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
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
|
-
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
|
-
=============
|
253
|
+
print_title("MDL New Command - Create New MDL Projects")
|
254
|
+
print_separator()
|
255
|
+
print()
|
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_option("<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_option("--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_option("--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("project_name.mdl - Main MDL source file")
|
294
|
+
print_bullet("README.md - Project documentation template")
|
295
|
+
print_bullet("Proper pack.mcmeta configuration")
|
296
|
+
print_bullet("Basic function structure (load, main, tick)")
|
297
|
+
print_bullet("Example variable and command usage")
|
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("load function - Runs when datapack is loaded")
|
320
|
+
print_bullet("main function - Main game logic")
|
321
|
+
print_bullet("tick function - Runs every game tick")
|
322
|
+
print_bullet("Example variables and scoreboard setup")
|
323
|
+
print_bullet("Basic command structure")
|
324
|
+
print()
|
325
|
+
|
326
|
+
print_success("Project created! Start editing the .mdl file and use 'mdl build' to compile.")
|
425
327
|
|
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
328
|
|
430
|
-
|
431
|
-
"""
|
329
|
+
def show_error_help():
|
330
|
+
"""Display help for common errors and troubleshooting."""
|
331
|
+
print_title("MDL Error Help - Troubleshooting Common Issues")
|
332
|
+
print_separator()
|
333
|
+
print()
|
334
|
+
|
335
|
+
print_info("This section helps you resolve common MDL compilation and runtime errors.")
|
336
|
+
print()
|
337
|
+
|
338
|
+
print_section("Common Syntax Errors")
|
339
|
+
print()
|
340
|
+
|
341
|
+
print_warning("Missing semicolon")
|
342
|
+
print_info(" Ensure all commands end with semicolons")
|
343
|
+
print_code(" tellraw @a \"Hello\" // Missing semicolon")
|
344
|
+
print_code(" tellraw @a \"Hello\"; // Correct")
|
345
|
+
print()
|
346
|
+
|
347
|
+
print_warning("Invalid variable syntax")
|
348
|
+
print_info(" Variables must start with $ and use valid characters")
|
349
|
+
print_code(" $playerScore // Correct")
|
350
|
+
print_code(" playerScore // Missing $")
|
351
|
+
print_code(" $player-score // Invalid character")
|
352
|
+
print()
|
353
|
+
|
354
|
+
print_warning("Scope mismatch")
|
355
|
+
print_info(" Ensure all scopes are properly closed")
|
356
|
+
print_code(" if $condition$ {")
|
357
|
+
print_code(" tellraw @a \"True\";")
|
358
|
+
print_code(" } // Missing closing brace")
|
359
|
+
print()
|
360
|
+
|
361
|
+
print_section("Build Errors")
|
362
|
+
print()
|
363
|
+
|
364
|
+
print_warning("File not found")
|
365
|
+
print_info(" Check that the input file/directory exists")
|
366
|
+
print_info(" Use absolute paths or verify relative paths")
|
367
|
+
print()
|
368
|
+
|
369
|
+
print_warning("Permission denied")
|
370
|
+
print_info(" Ensure you have write access to the output directory")
|
371
|
+
print_info(" Try running as administrator or change output location")
|
372
|
+
print()
|
373
|
+
|
374
|
+
print_section("Runtime Errors")
|
375
|
+
print()
|
376
|
+
|
377
|
+
print_warning("Function not found")
|
378
|
+
print_info(" Check that all referenced functions exist")
|
379
|
+
print_info(" Verify function names match exactly (case-sensitive)")
|
380
|
+
print()
|
381
|
+
|
382
|
+
print_warning("Scoreboard not found")
|
383
|
+
print_info(" Ensure scoreboards are created before use")
|
384
|
+
print_info(" Use scoreboard objectives add <name> <criteria>")
|
385
|
+
print()
|
386
|
+
|
387
|
+
print_section("Getting Help")
|
388
|
+
print()
|
389
|
+
|
390
|
+
print_info("If you're still having issues:")
|
391
|
+
print_bullet("Check the error message carefully for file and line numbers")
|
392
|
+
print_bullet("Use --verbose flag for more detailed output")
|
393
|
+
print_bullet("Verify your MDL syntax against the language reference")
|
394
|
+
print_bullet("Check the examples for correct usage patterns")
|
395
|
+
print_bullet("Report bugs with detailed error information")
|
396
|
+
print()
|
397
|
+
|
398
|
+
print_success("Most errors can be resolved by checking syntax and following the error suggestions!")
|