Module Structureο
Creating Modulesο
Any directory within data/modular_mc that contains a _map.ts file becomes a module. The _map.ts file defines how the moduleβs files should be processed and where they should be exported.
Basic Module Structureο
Example below creates a module called my_entity that contains files related to a zombie entity.
π data/modular_mc/
π my_entity/
βοΈ _map.ts # Required - defines the module
π zombie.behavior.json
π zombie.geo.json
πΌοΈ zombie.entity.png
π zombie_attack.animation.json
Modules can have any structure you want. Subdirectories are allowed for better organization.
Nested Modulesο
You can put modules inside other modules. This way a big module can have smaller parts that still can be easily exported to other projects.
π data/modular_mc/
π magic/ # Parent module (module A)
βοΈ _map.ts
π projectile.ts # Shared script used by submodules
π fireball/ # Nested module (module B)
βοΈ _map.ts
π fireball.entity.json
π fireball.geo.json
πΌοΈ fireball.entity.png
π magic_missile/ # Nested module (module C)
βοΈ _map.ts
π magic_missile.particle.json
π magic_missile.ts
Each directory with a _map.ts file is processed as an independent module, regardless of nesting level.
Module Processing Orderο
Modules are processed in alphabetical order based on their full path. With the structure above, the processing order would be:
magic/magic/fireball/magic/magic_missile/
This consistent ordering ensures predictable behavior when multiple modules might affect the same output files.