minecraft-datapack-language 15.4.5__py3-none-any.whl → 15.4.7__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 +1019 -189
- minecraft_datapack_language/cli_help.py +7 -8
- minecraft_datapack_language/cli_new.py +26 -95
- minecraft_datapack_language/utils.py +0 -15
- {minecraft_datapack_language-15.4.5.dist-info → minecraft_datapack_language-15.4.7.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.4.5.dist-info → minecraft_datapack_language-15.4.7.dist-info}/RECORD +11 -11
- {minecraft_datapack_language-15.4.5.dist-info → minecraft_datapack_language-15.4.7.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.4.5.dist-info → minecraft_datapack_language-15.4.7.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.4.5.dist-info → minecraft_datapack_language-15.4.7.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.4.5.dist-info → minecraft_datapack_language-15.4.7.dist-info}/top_level.txt +0 -0
@@ -290,11 +290,11 @@ def show_new_help():
|
|
290
290
|
|
291
291
|
print_info("The new command creates:")
|
292
292
|
print_bullet("project_name/ directory")
|
293
|
-
print_bullet("
|
293
|
+
print_bullet("main.mdl - Main MDL source file with basic hello world example")
|
294
294
|
print_bullet("README.md - Project documentation template")
|
295
295
|
print_bullet("Proper pack.mcmeta configuration")
|
296
|
-
print_bullet("
|
297
|
-
print_bullet("
|
296
|
+
print_bullet("Simple function structure (main function with on_load hook)")
|
297
|
+
print_bullet("Clean, working example that demonstrates basic MDL syntax")
|
298
298
|
print()
|
299
299
|
|
300
300
|
print_section("Examples")
|
@@ -316,11 +316,10 @@ def show_new_help():
|
|
316
316
|
print()
|
317
317
|
|
318
318
|
print_info("New projects include:")
|
319
|
-
print_bullet("
|
320
|
-
print_bullet("
|
321
|
-
print_bullet("
|
322
|
-
print_bullet("
|
323
|
-
print_bullet("Basic command structure")
|
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")
|
324
323
|
print()
|
325
324
|
|
326
325
|
print_success("Project created! Start editing the .mdl file and use 'mdl build' to compile.")
|
@@ -78,79 +78,16 @@ def create_new_project(project_name: str, pack_name: str = None, pack_format: in
|
|
78
78
|
|
79
79
|
|
80
80
|
def _generate_mdl_template(project_name: str, pack_name: str, pack_format: int) -> str:
|
81
|
-
"""Generate the template
|
82
|
-
return f'''pack "{pack_name}" "
|
83
|
-
namespace "{
|
81
|
+
"""Generate the MDL template content."""
|
82
|
+
return f'''pack "{pack_name}" "A simple hello world datapack" {pack_format};
|
83
|
+
namespace "{project_name}";
|
84
84
|
|
85
|
-
// Example variables
|
86
|
-
var num score = 0;
|
87
|
-
var num lives = 3;
|
88
|
-
|
89
|
-
// Main function - this runs when called
|
90
85
|
function "main" {{
|
91
|
-
say Hello
|
92
|
-
|
93
|
-
// Set initial values
|
94
|
-
score = 10;
|
95
|
-
lives = 3;
|
96
|
-
|
97
|
-
// Display current values
|
98
|
-
say Score: $score$;
|
99
|
-
say Lives: $lives$;
|
100
|
-
|
101
|
-
// Example conditional statement
|
102
|
-
if "$score$ > 5" {{
|
103
|
-
say Great score!;
|
104
|
-
}} else {{
|
105
|
-
say Keep trying!;
|
106
|
-
}};
|
107
|
-
|
108
|
-
// Example while loop
|
109
|
-
while "$lives$ > 0" {{
|
110
|
-
say You have $lives$ lives remaining;
|
111
|
-
lives = lives - 1;
|
112
|
-
}};
|
113
|
-
|
114
|
-
say Game over!;
|
115
|
-
}}
|
116
|
-
|
117
|
-
// Init function - this runs when the datapack loads
|
118
|
-
function "init" {{
|
119
|
-
say [GAME] {pack_name} loaded successfully!;
|
120
|
-
say Type: /function {project_name}:main;
|
121
|
-
}}
|
122
|
-
|
123
|
-
// Tick function - this runs every tick (20 times per second)
|
124
|
-
function "tick" {{
|
125
|
-
// Add your tick logic here
|
126
|
-
// Be careful with performance!
|
86
|
+
say Hello, Minecraft!;
|
87
|
+
tellraw @a {{"text":"Welcome to my datapack!","color":"green"}};
|
127
88
|
}}
|
128
89
|
|
129
|
-
|
130
|
-
function "greet_player" {{
|
131
|
-
say Welcome to {pack_name}!;
|
132
|
-
say Have fun playing!;
|
133
|
-
}}
|
134
|
-
|
135
|
-
// Raw Minecraft commands example
|
136
|
-
$!raw
|
137
|
-
# You can use raw Minecraft commands here
|
138
|
-
# These are passed through directly to the output
|
139
|
-
# Useful for complex commands or commands not yet supported by MDL
|
140
|
-
tellraw @a {{"text":"Raw command example","color":"gold"}}
|
141
|
-
raw!$
|
142
|
-
|
143
|
-
// Example recipe (optional)
|
144
|
-
// recipe "diamond_sword" "diamond_sword.json";
|
145
|
-
|
146
|
-
// Example loot table (optional)
|
147
|
-
// loot_table "chest_loot" "chest_loot.json";
|
148
|
-
|
149
|
-
// Example advancement (optional)
|
150
|
-
// advancement "first_diamond" "first_diamond.json";
|
151
|
-
|
152
|
-
// Hook the init function to run when the datapack loads
|
153
|
-
on_load "{project_name}:init";
|
90
|
+
on_load "{project_name}:main";
|
154
91
|
'''
|
155
92
|
|
156
93
|
|
@@ -162,14 +99,14 @@ A Minecraft datapack created with MDL (Minecraft Datapack Language).
|
|
162
99
|
|
163
100
|
## [GAME] About
|
164
101
|
|
165
|
-
This datapack was generated using the MDL CLI tool. MDL is a simplified language for creating Minecraft datapacks with
|
102
|
+
This datapack was generated using the MDL CLI tool. MDL is a simplified language for creating Minecraft datapacks with clean, readable syntax.
|
166
103
|
|
167
104
|
## [DIR] Project Structure
|
168
105
|
|
169
106
|
```
|
170
107
|
{project_name}/
|
171
108
|
├── README.md # This file
|
172
|
-
└── main.mdl # Main MDL source file
|
109
|
+
└── main.mdl # Main MDL source file with basic hello world example
|
173
110
|
```
|
174
111
|
|
175
112
|
## [NEXT] Getting Started
|
@@ -183,19 +120,19 @@ This datapack was generated using the MDL CLI tool. MDL is a simplified language
|
|
183
120
|
|
184
121
|
1. **Build the project:**
|
185
122
|
```bash
|
186
|
-
mdl build --mdl
|
123
|
+
mdl build --mdl main.mdl -o dist
|
187
124
|
```
|
188
125
|
|
189
126
|
2. **Check for errors:**
|
190
127
|
```bash
|
191
|
-
mdl check
|
128
|
+
mdl check main.mdl
|
192
129
|
```
|
193
130
|
|
194
131
|
3. **Install in Minecraft:**
|
195
132
|
- Copy the `dist` folder to your world's `datapacks` directory
|
196
133
|
- Or use the `--wrapper` option to create a zip file:
|
197
134
|
```bash
|
198
|
-
mdl build --mdl
|
135
|
+
mdl build --mdl main.mdl -o dist --wrapper {project_name}
|
199
136
|
```
|
200
137
|
|
201
138
|
### Using the Datapack
|
@@ -208,37 +145,31 @@ This datapack was generated using the MDL CLI tool. MDL is a simplified language
|
|
208
145
|
|
209
146
|
### Editing the Code
|
210
147
|
|
211
|
-
Open `
|
148
|
+
Open `main.mdl` in your favorite text editor. The file contains:
|
212
149
|
|
213
150
|
- **Pack declaration** - Datapack metadata
|
214
|
-
- **
|
151
|
+
- **Namespace** - Datapack namespace for organization
|
215
152
|
- **Functions** - The main logic of your datapack
|
216
|
-
- **
|
217
|
-
- **Raw commands** - Direct Minecraft commands when needed
|
153
|
+
- **on_load hook** - Automatically runs when the datapack loads
|
218
154
|
|
219
155
|
### Key Features
|
220
156
|
|
221
|
-
- **
|
222
|
-
- **
|
223
|
-
- **
|
224
|
-
- **
|
225
|
-
- **Variable substitution**: Use `$variable$` in commands to insert values
|
157
|
+
- **Functions**: Define reusable code blocks with `function "name" {{ ... }}`
|
158
|
+
- **Basic commands**: Use `say` and `tellraw` for player communication
|
159
|
+
- **Automatic loading**: The `on_load` hook runs your main function automatically
|
160
|
+
- **Clean syntax**: Simple, readable MDL syntax that compiles to Minecraft commands
|
226
161
|
|
227
162
|
### Example Code
|
228
163
|
|
229
164
|
```mdl
|
230
|
-
//
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
say "Your score is: $score$"
|
235
|
-
|
236
|
-
// Conditional logic
|
237
|
-
if (score > 5) {{
|
238
|
-
say "Great job!"
|
239
|
-
}} else {{
|
240
|
-
say "Keep trying!"
|
165
|
+
// Define a function
|
166
|
+
function "main" {{
|
167
|
+
say Hello, Minecraft!;
|
168
|
+
tellraw @a {{"text":"Welcome!","color":"green"}};
|
241
169
|
}}
|
170
|
+
|
171
|
+
// Hook it to run when loaded
|
172
|
+
on_load "{project_name}:main";
|
242
173
|
```
|
243
174
|
|
244
175
|
## [INFO] Resources
|
@@ -258,7 +189,7 @@ if (score > 5) {{
|
|
258
189
|
- Check that the file has a `.mdl` extension
|
259
190
|
|
260
191
|
2. **Syntax errors**
|
261
|
-
- Use `mdl check
|
192
|
+
- Use `mdl check main.mdl` to find and fix errors
|
262
193
|
- Check the error messages for line numbers and suggestions
|
263
194
|
|
264
195
|
3. **Datapack not loading**
|
@@ -21,18 +21,3 @@ def ns_path(namespace: str, path: str) -> str:
|
|
21
21
|
if path.startswith("/"):
|
22
22
|
path = path[1:]
|
23
23
|
return f"{namespace}/{path}"
|
24
|
-
|
25
|
-
def find_mdl_files(directory: Path) -> list[Path]:
|
26
|
-
"""Find all .mdl files in a directory recursively.
|
27
|
-
|
28
|
-
Args:
|
29
|
-
directory: Directory to search in
|
30
|
-
|
31
|
-
Returns:
|
32
|
-
List of Path objects for .mdl files
|
33
|
-
"""
|
34
|
-
mdl_files = []
|
35
|
-
for item in directory.rglob("*.mdl"):
|
36
|
-
if item.is_file():
|
37
|
-
mdl_files.append(item)
|
38
|
-
return sorted(mdl_files)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version: 15.4.
|
3
|
+
Version: 15.4.7
|
4
4
|
Summary: Compile JavaScript-style MDL language or Python API into a Minecraft datapack (1.21+ ready). Features variables, control flow, error handling, and VS Code extension.
|
5
5
|
Project-URL: Homepage, https://www.mcmdl.com
|
6
6
|
Project-URL: Documentation, https://www.mcmdl.com/docs
|
{minecraft_datapack_language-15.4.5.dist-info → minecraft_datapack_language-15.4.7.dist-info}/RECORD
RENAMED
@@ -1,12 +1,12 @@
|
|
1
1
|
minecraft_datapack_language/__init__.py,sha256=i-qCchbe5b2Fshgc6yCU9mddOLs2UBt9SAcLqfUIrT0,606
|
2
|
-
minecraft_datapack_language/_version.py,sha256=
|
2
|
+
minecraft_datapack_language/_version.py,sha256=SIXKzGXg_ZDjpdiyLe3C99MU-0N6v8GJBEqcqIzfHEs,706
|
3
3
|
minecraft_datapack_language/ast_nodes.py,sha256=pgjI2Nlap3ixFPgWqGSkqncG9zB91h5BKgRjtcJqMew,2118
|
4
4
|
minecraft_datapack_language/cli.py,sha256=p5A_tEEXugN2NhQFbbgfwi4FxbWYD91RWeKR_A3Vuec,6263
|
5
|
-
minecraft_datapack_language/cli_build.py,sha256=
|
5
|
+
minecraft_datapack_language/cli_build.py,sha256=HvrQdINx8EmF4OW6IZCx_S6Rs4NZQ-eB1PSlcDMnCmA,47939
|
6
6
|
minecraft_datapack_language/cli_check.py,sha256=bPq9gHsxQ1CIiftkrAtRCifWkVAyjp5c8Oay2NNQ1qs,6277
|
7
7
|
minecraft_datapack_language/cli_colors.py,sha256=Ims0KbdYpsiwoqv96Y_g89uOB5l1qdETm_P51rkljfk,7884
|
8
|
-
minecraft_datapack_language/cli_help.py,sha256=
|
9
|
-
minecraft_datapack_language/cli_new.py,sha256=
|
8
|
+
minecraft_datapack_language/cli_help.py,sha256=z7PTqkrRYOFhfqe7CLdaF68kEAO5R1iP0j45b_36bEw,13196
|
9
|
+
minecraft_datapack_language/cli_new.py,sha256=3K6gHCYwmOTXysicSWJNsjU1YXyz2xa5IGjoOtj1CKc,6489
|
10
10
|
minecraft_datapack_language/cli_utils.py,sha256=nl22j96vpCW0XRMpD_zjwamnMU4e4LXEjACsnwiFGzs,9931
|
11
11
|
minecraft_datapack_language/dir_map.py,sha256=HmxFkuvWGkzHF8o_GFb4BpuMCRc6QMw8UbmcAI8JVdY,1788
|
12
12
|
minecraft_datapack_language/expression_processor.py,sha256=GN6cuRNvgI8TrV6YnEHrA9P0X-ACTT7rCBh4WlOPjSI,20140
|
@@ -16,10 +16,10 @@ minecraft_datapack_language/mdl_lexer_js.py,sha256=VvbhKm727khdSAABxa03hoIIA7H3h
|
|
16
16
|
minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYaLDcGNRAl-RAI,17253
|
17
17
|
minecraft_datapack_language/mdl_parser_js.py,sha256=SQzc67pKls3NVnQaT0xIILGqpZYAmcZn78TQ0KIM4TE,40216
|
18
18
|
minecraft_datapack_language/pack.py,sha256=nYiXQ3jgJlDfc4m-65f7C2LFhDRioaUU_XVy6Na4SJI,34625
|
19
|
-
minecraft_datapack_language/utils.py,sha256=
|
20
|
-
minecraft_datapack_language-15.4.
|
21
|
-
minecraft_datapack_language-15.4.
|
22
|
-
minecraft_datapack_language-15.4.
|
23
|
-
minecraft_datapack_language-15.4.
|
24
|
-
minecraft_datapack_language-15.4.
|
25
|
-
minecraft_datapack_language-15.4.
|
19
|
+
minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
|
20
|
+
minecraft_datapack_language-15.4.7.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
21
|
+
minecraft_datapack_language-15.4.7.dist-info/METADATA,sha256=Y1SE5p89bmmGEXZK674BS73GdhoYCCm9YAYtT0yYPdc,35229
|
22
|
+
minecraft_datapack_language-15.4.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
minecraft_datapack_language-15.4.7.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
24
|
+
minecraft_datapack_language-15.4.7.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
25
|
+
minecraft_datapack_language-15.4.7.dist-info/RECORD,,
|
{minecraft_datapack_language-15.4.5.dist-info → minecraft_datapack_language-15.4.7.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|