A mixin project is a specialized project type that allows you to combine reusable code components or libraries with your scripts or mods. This feature is especially useful when you have code that can be shared across multiple projects, such as utility functions or common classes.

When to Use a Mixin Project

How to Create a Mixin Project

Mixin projects use the "MDK Mixin (MDK2)" template. You can create them via:

After creating a mixin project, you can add it to the Hub using "Add Existing Project".

How Mixin Projects Work

During the build process, code from the mixin project is merged into the main script or mod. This gives you access to all the methods and classes defined in the mixin without duplicating the code. Since mixins are designed for reuse, they keep your projects modular and prevent unnecessary repetition.

Tip

When using a mixin with programmable block scripts, you may need to add the mixin's namespace to the namespaces setting in your script's mdk.ini file. See the Project Configuration Guide for details.