minecraft-datapack-language 15.4.28__py3-none-any.whl → 15.4.30__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/__init__.py +23 -2
- minecraft_datapack_language/_version.py +2 -2
- minecraft_datapack_language/ast_nodes.py +87 -59
- minecraft_datapack_language/cli.py +276 -139
- minecraft_datapack_language/mdl_compiler.py +470 -0
- minecraft_datapack_language/mdl_errors.py +14 -0
- minecraft_datapack_language/mdl_lexer.py +624 -0
- minecraft_datapack_language/mdl_parser.py +573 -0
- minecraft_datapack_language-15.4.30.dist-info/METADATA +266 -0
- minecraft_datapack_language-15.4.30.dist-info/RECORD +17 -0
- minecraft_datapack_language/cli_build.py +0 -1292
- minecraft_datapack_language/cli_check.py +0 -155
- minecraft_datapack_language/cli_colors.py +0 -264
- minecraft_datapack_language/cli_help.py +0 -508
- minecraft_datapack_language/cli_new.py +0 -300
- minecraft_datapack_language/cli_utils.py +0 -276
- minecraft_datapack_language/expression_processor.py +0 -352
- minecraft_datapack_language/linter.py +0 -409
- minecraft_datapack_language/mdl_lexer_js.py +0 -754
- minecraft_datapack_language/mdl_parser_js.py +0 -1049
- minecraft_datapack_language/pack.py +0 -758
- minecraft_datapack_language-15.4.28.dist-info/METADATA +0 -1274
- minecraft_datapack_language-15.4.28.dist-info/RECORD +0 -25
- {minecraft_datapack_language-15.4.28.dist-info → minecraft_datapack_language-15.4.30.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.4.28.dist-info → minecraft_datapack_language-15.4.30.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.4.28.dist-info → minecraft_datapack_language-15.4.30.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.4.28.dist-info → minecraft_datapack_language-15.4.30.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,266 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: minecraft-datapack-language
|
3
|
+
Version: 15.4.30
|
4
|
+
Summary: Compile MDL language with explicit scoping into a Minecraft datapack (1.21+ ready). Features variables, control flow, error handling, and VS Code extension.
|
5
|
+
Project-URL: Homepage, https://www.mcmdl.com
|
6
|
+
Project-URL: Documentation, https://www.mcmdl.com/docs
|
7
|
+
Project-URL: Repository, https://github.com/aaron777collins/MinecraftDatapackLanguage
|
8
|
+
Project-URL: Bug Tracker, https://github.com/aaron777collins/MinecraftDatapackLanguage/issues
|
9
|
+
Project-URL: VS Code Extension, https://marketplace.visualstudio.com/items?itemName=mdl.minecraft-datapack-language
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
12
|
+
Classifier: Operating System :: OS Independent
|
13
|
+
Requires-Python: >=3.9
|
14
|
+
Description-Content-Type: text/markdown
|
15
|
+
License-File: LICENSE
|
16
|
+
Requires-Dist: mecha>=0.99.0
|
17
|
+
Provides-Extra: dev
|
18
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
19
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
20
|
+
Dynamic: license-file
|
21
|
+
|
22
|
+
# <img src="https://github.com/aaron777collins/MinecraftDatapackLanguage/raw/main/icons/icon-128.png" width="32" height="32" alt="MDL Icon"> Minecraft Datapack Language (MDL)
|
23
|
+
|
24
|
+
A **modern, scope-aware language** that lets you write Minecraft datapacks with **explicit scoping, variables, control structures, and expressions** that actually work.
|
25
|
+
|
26
|
+
📖 **[View Full Documentation](https://www.mcmdl.com/)** - Complete guides, examples, and API reference
|
27
|
+
📦 **[View on PyPI](https://pypi.org/project/minecraft-datapack-language/)** - Download and install from PyPI
|
28
|
+
🔧 **[VS Code Extension](https://marketplace.visualstudio.com/items?itemName=mdl.minecraft-datapack-language)** - Syntax highlighting, IntelliSense, and snippets
|
29
|
+
|
30
|
+

|
31
|
+

|
32
|
+

|
33
|
+

|
34
|
+

|
35
|
+
|
36
|
+
## 🎯 **MODERN** MDL Language with Explicit Scoping
|
37
|
+
|
38
|
+
**MDL uses a modern, scope-aware language format** with **explicit scoping, control structures, variables, and expressions**:
|
39
|
+
|
40
|
+
### ✨ **MODERN** Features
|
41
|
+
- **🎯 Explicit scoping** with angle brackets `<@s>`, `<@a[team=red]>` for all operations
|
42
|
+
- **📝 Modern comments** using `//` and `/* */`
|
43
|
+
- **🔢 Number variables** with `var num` type (stored in scoreboards)
|
44
|
+
- **🔄 Full control structures** including `if/else`, `while` loops
|
45
|
+
- **💲 Variable substitution** with `$variable<scope>$` syntax
|
46
|
+
- **🧮 Expressions** with arithmetic operations (`+`, `-`, `*`, `/`)
|
47
|
+
- **📦 Namespace system** for modular code organization
|
48
|
+
- **🏷️ Tag system** for all datapack resources (recipes, loot tables, advancements, etc.)
|
49
|
+
- **🎨 VS Code extension** with full IntelliSense and snippets
|
50
|
+
- **🧪 Comprehensive testing** with E2E validation
|
51
|
+
- **📚 Extensive documentation** with examples for every feature
|
52
|
+
|
53
|
+
### 🏗️ Core Features
|
54
|
+
- ✅ **Modern pack format 15** by default for latest Minecraft features
|
55
|
+
- ✅ **Explicit scoping** - every variable operation specifies its scope
|
56
|
+
- ✅ **Real control structures** - `if/else`, `while` loops
|
57
|
+
- ✅ **Number variables** stored in scoreboards with `$variable<scope>$` substitution
|
58
|
+
- ✅ **Expressions** with arithmetic operations and variable substitution
|
59
|
+
- ✅ **Multi-file projects** with automatic merging and dependency resolution
|
60
|
+
- ✅ **Variable optimization** - automatic load function generation for initialization
|
61
|
+
- ✅ **Selector optimization** - proper `@a` usage for system commands
|
62
|
+
- ✅ **Easy hooks** into `minecraft:tick` and `minecraft:load` via function tags
|
63
|
+
- ✅ **Tag support** for `recipe`, `loot_table`, `advancement`, `item_modifier`, `predicate`, and `structure`
|
64
|
+
- ✅ **Raw blocks** for direct Minecraft command injection
|
65
|
+
- ✅ **Say commands** that auto-convert to `tellraw` with JSON formatting
|
66
|
+
|
67
|
+
> **Note**: Version 1.0+ uses **pack_format 15** by default for the modern MDL syntax.
|
68
|
+
|
69
|
+
---
|
70
|
+
|
71
|
+
## 🚀 Install
|
72
|
+
|
73
|
+
### Option A — from PyPI (recommended for users)
|
74
|
+
Global, isolated CLI via **pipx**:
|
75
|
+
```bash
|
76
|
+
python3 -m pip install --user pipx
|
77
|
+
python3 -m pipx ensurepath # reopen terminal
|
78
|
+
pipx install minecraft-datapack-language
|
79
|
+
|
80
|
+
mdl --help
|
81
|
+
```
|
82
|
+
|
83
|
+
Virtualenv (if you prefer):
|
84
|
+
```bash
|
85
|
+
python3 -m venv .venv
|
86
|
+
source .venv/bin/activate # Windows: .\.venv\Scripts\Activate.ps1
|
87
|
+
pip install minecraft-datapack-language
|
88
|
+
```
|
89
|
+
|
90
|
+
### Option B — from source (for contributors)
|
91
|
+
```bash
|
92
|
+
# inside the repo
|
93
|
+
python -m pip install -e .
|
94
|
+
```
|
95
|
+
|
96
|
+
---
|
97
|
+
|
98
|
+
## 🔄 Update
|
99
|
+
|
100
|
+
- **pipx**: `pipx upgrade minecraft-datapack-language`
|
101
|
+
- **pip (venv)**: `pip install -U minecraft-datapack-language`
|
102
|
+
- Pin a version: `pipx install "minecraft-datapack-language==<version>"` (replace `<version>` with desired version)
|
103
|
+
|
104
|
+
---
|
105
|
+
|
106
|
+
## 💻 CLI
|
107
|
+
|
108
|
+
### Modern MDL (v1.0+)
|
109
|
+
```bash
|
110
|
+
# Build MDL files
|
111
|
+
mdl build --mdl my_pack/mypack.mdl -o dist --wrapper mypack
|
112
|
+
mdl check my_pack/mypack.mdl
|
113
|
+
|
114
|
+
# Validate generated mcfunction files
|
115
|
+
mdl check my_pack/mypack.mdl
|
116
|
+
|
117
|
+
# Multi-file projects
|
118
|
+
mdl build --mdl my_pack/ -o dist # Build entire directory
|
119
|
+
mdl build --mdl "file1.mdl file2.mdl" -o dist # Build specific files
|
120
|
+
|
121
|
+
# Create new projects
|
122
|
+
mdl new my_awesome_pack
|
123
|
+
```
|
124
|
+
|
125
|
+
### Quick Start
|
126
|
+
```bash
|
127
|
+
# Create a new project
|
128
|
+
mdl new my_first_pack
|
129
|
+
|
130
|
+
# Build it
|
131
|
+
cd my_first_pack
|
132
|
+
mdl build --mdl main.mdl -o dist
|
133
|
+
|
134
|
+
# Check for errors
|
135
|
+
mdl check main.mdl
|
136
|
+
```
|
137
|
+
|
138
|
+
---
|
139
|
+
|
140
|
+
## 📝 Language Examples
|
141
|
+
|
142
|
+
### Basic Structure
|
143
|
+
```mdl
|
144
|
+
pack "MyPack" "My awesome datapack" 15;
|
145
|
+
namespace "game";
|
146
|
+
|
147
|
+
var num player_score<@s> = 0;
|
148
|
+
var num team_score<@a[team=red]> = 0;
|
149
|
+
|
150
|
+
function game:start<@s> {
|
151
|
+
player_score<@s> = 100;
|
152
|
+
say "Welcome! Your score is $player_score<@s>$";
|
153
|
+
}
|
154
|
+
|
155
|
+
on_load game:start<@s>;
|
156
|
+
```
|
157
|
+
|
158
|
+
### Control Structures
|
159
|
+
```mdl
|
160
|
+
function game:check_score<@s> {
|
161
|
+
if $player_score<@s>$ > 10 {
|
162
|
+
say "Great score!";
|
163
|
+
player_score<@s> = $player_score<@s>$ + 5;
|
164
|
+
} else {
|
165
|
+
say "Keep trying!";
|
166
|
+
}
|
167
|
+
|
168
|
+
while $player_score<@s>$ < 100 {
|
169
|
+
player_score<@s> = $player_score<@s>$ + 1;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
```
|
173
|
+
|
174
|
+
### Tags and Resources
|
175
|
+
```mdl
|
176
|
+
// Recipe tags
|
177
|
+
tag recipe "diamond_sword" "recipes/diamond_sword.json";
|
178
|
+
tag loot_table "epic_loot" "loot_tables/epic_loot.json";
|
179
|
+
tag advancement "first_spell" "advancements/first_spell.json";
|
180
|
+
|
181
|
+
// Item modifiers and predicates
|
182
|
+
tag item_modifier "enchanted_tool" "item_modifiers/enchanted_tool.json";
|
183
|
+
tag predicate "has_mana" "predicates/has_mana.json";
|
184
|
+
tag structure "wizard_tower" "structures/wizard_tower.json";
|
185
|
+
```
|
186
|
+
|
187
|
+
### Raw Blocks and Say Commands
|
188
|
+
```mdl
|
189
|
+
function game:special_effect<@s> {
|
190
|
+
$!raw
|
191
|
+
execute as @s run particle minecraft:explosion ~ ~ ~ 1 1 1 0 10
|
192
|
+
execute as @s run playsound minecraft:entity.player.levelup player @s ~ ~ ~ 1 1
|
193
|
+
raw!$
|
194
|
+
|
195
|
+
say "Special effect triggered! Score: $player_score<@s>$";
|
196
|
+
}
|
197
|
+
```
|
198
|
+
|
199
|
+
---
|
200
|
+
|
201
|
+
## 🔧 Development
|
202
|
+
|
203
|
+
### Building from Source
|
204
|
+
```bash
|
205
|
+
git clone https://github.com/aaron777collins/MinecraftDatapackLanguage.git
|
206
|
+
cd MinecraftDatapackLanguage
|
207
|
+
python -m pip install -e .
|
208
|
+
```
|
209
|
+
|
210
|
+
### Running Tests
|
211
|
+
```bash
|
212
|
+
# Run all tests
|
213
|
+
python -m pytest
|
214
|
+
|
215
|
+
# Run specific test file
|
216
|
+
python -m pytest test_comprehensive_end_to_end.py
|
217
|
+
|
218
|
+
# Run with coverage
|
219
|
+
python -m pytest --cov=minecraft_datapack_language
|
220
|
+
```
|
221
|
+
|
222
|
+
### Building the Extension
|
223
|
+
```bash
|
224
|
+
cd vscode-extension
|
225
|
+
npm install
|
226
|
+
npm run compile
|
227
|
+
```
|
228
|
+
|
229
|
+
---
|
230
|
+
|
231
|
+
## 📚 Documentation
|
232
|
+
|
233
|
+
- **[Language Reference](docs/_docs/language-reference.md)** - Complete language specification
|
234
|
+
- **[VS Code Extension](vscode-extension/README.md)** - Extension documentation
|
235
|
+
- **[Examples](examples/)** - Sample projects and code snippets
|
236
|
+
|
237
|
+
---
|
238
|
+
|
239
|
+
## 🤝 Contributing
|
240
|
+
|
241
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
242
|
+
|
243
|
+
### Development Setup
|
244
|
+
1. Fork the repository
|
245
|
+
2. Create a feature branch
|
246
|
+
3. Make your changes
|
247
|
+
4. Add tests for new functionality
|
248
|
+
5. Submit a pull request
|
249
|
+
|
250
|
+
---
|
251
|
+
|
252
|
+
## 📄 License
|
253
|
+
|
254
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
255
|
+
|
256
|
+
---
|
257
|
+
|
258
|
+
## 🙏 Acknowledgments
|
259
|
+
|
260
|
+
- Minecraft community for inspiration
|
261
|
+
- Contributors and testers
|
262
|
+
- VS Code team for the excellent extension API
|
263
|
+
|
264
|
+
---
|
265
|
+
|
266
|
+
**Happy coding with MDL! 🎮**
|
@@ -0,0 +1,17 @@
|
|
1
|
+
minecraft_datapack_language/__init__.py,sha256=YoTmZWZVH6POAVYMvOTEBKdC-cxQsWi2VomSWZDgYFw,1158
|
2
|
+
minecraft_datapack_language/_version.py,sha256=RNZhwzYxN2eHj_5xQ53YZcxK_zAZYSM3MZOH61TI9KQ,708
|
3
|
+
minecraft_datapack_language/ast_nodes.py,sha256=nbWrRz137MGMRpmnq8QkXNzrtlaCgyPEknytbkrS_M8,3899
|
4
|
+
minecraft_datapack_language/cli.py,sha256=dy1KBDULHpaHYYzNfL42EuhOAB5_GTfSVt7_bMImSno,9000
|
5
|
+
minecraft_datapack_language/dir_map.py,sha256=HmxFkuvWGkzHF8o_GFb4BpuMCRc6QMw8UbmcAI8JVdY,1788
|
6
|
+
minecraft_datapack_language/mdl_compiler.py,sha256=GQv2CD29aj8vxhqRczTn_2JjNn6hiHQ4XoU2qh-s1n4,20429
|
7
|
+
minecraft_datapack_language/mdl_errors.py,sha256=r0Gu3KhoX1YLPAVW_iO7Q_fPgaf_Dv9tOGSOdKNSzmw,16114
|
8
|
+
minecraft_datapack_language/mdl_lexer.py,sha256=CjbEUpuuF4eU_ucA_WIhw6wSMcHGk2BchtQ0bLAGvwg,22033
|
9
|
+
minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYaLDcGNRAl-RAI,17253
|
10
|
+
minecraft_datapack_language/mdl_parser.py,sha256=aQPKcmATM9BOMzO7vCXmMdxU1qjOJNLCSAKJopu5h3g,23429
|
11
|
+
minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
|
12
|
+
minecraft_datapack_language-15.4.30.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
13
|
+
minecraft_datapack_language-15.4.30.dist-info/METADATA,sha256=H6Y7lVMRongNa0nvQPE8xUEaIt7h1WLyp92hlsg1doo,8475
|
14
|
+
minecraft_datapack_language-15.4.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
15
|
+
minecraft_datapack_language-15.4.30.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
16
|
+
minecraft_datapack_language-15.4.30.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
17
|
+
minecraft_datapack_language-15.4.30.dist-info/RECORD,,
|