Add unpredictable variety to your automated builds. The Create Shuffle Filter is a lightweight mod that provides a new "Shuffle Filter" item which, when used in Create deployers on contrabtions, enables a randomnes when placing blocks. (Like the shuffle mod for players). It brings 2 modes, weighted (based on stack quantity) and normal "random" (where each item gets the same probability). The Filter works like a normal List filter everywhere else! The weighted mode = ignore nbt data, and random mode = compare nbt data in these cases.
- Randomness where you want it: choose equally between matching types or use weighted selection based on stack counts.
- No need to bring in those block mixups per hand, your contrabtion can build it now!
- Small and focused: a single item and a small behaviour mixin — no heavy UI or complex config required.
- Fully compatible with Create mod and addons.
- New item: Shuffle Filter (registers as
createshufflefilter:shuffle_filter) - Enables shuffle mode on Create deployers on contraptions, works as normal list filter in all other cases.
- Two selection modes (equal or weighted) inferred from filter component data
- Place the built mod jar into your
mods/folder for a NeoForged/Forge 1.21.1 environment. - Run Minecraft with Create (recommended version: Create v6.0.6-98) and the mod loader declared in
gradle.properties.
- This repository uses Gradle with the NeoForged/ModDevGradle setup.
- Common commands (from project root on Windows PowerShell):
./gradlew --refresh-dependencies; ./gradlew build- Java 17+ (as required by Minecraft / NeoForged tooling)
- NeoForged modloader (tooling and mod container integration)
- Create mod integration (CreateRegistrate and Create APIs)
- SpongePowered Mixin for behaviour injection
- Registrate for item registration
Files of interest (high level):
-
src/main/java/com/agent772/createshufflefilter/CreateShuffleFilter.java- Registers the mod, the
Shuffle Filteritem using Create'sCreateRegistrate, and hooks registrate to the mod event bus.
- Registers the mod, the
-
src/main/java/com/agent772/createshufflefilter/mixins/MixinDeployerMovementBehaviour.java- A Mixin targeting
DeployerMovementBehaviour.tryGrabbingItemto intercept deployer pick logic when a Shuffle Filter is present. - When a shuffle filter is detected, it scans the contraption inventory for items that match the filter predicate, collects unique candidates by full item + components (NBT-aware), and picks one at random.
- For the modes, the ignore NBT data option is hijacked.
- Two selection modes:
- Equal mode: each unique matching item type has equal chance.
- Weighted mode: selection is weighted by the number of stacks of each type in the contraption storage.
- Uses Create's
ItemHelper.extractto take a single item from storage and places it in the deployer's fake player's main hand.
- A Mixin targeting
- Unique candidate detection: items are compared using
ItemStack.isSameItemSameComponentsto ensure NBT/components are respected when collecting candidates. - Mode toggle: The mixin reads the filter item components to detect Create's
filter_items_respect_nbtvalue — the implementation interpretstrueas "equal mode" andfalseas "weighted mode". - Safety: server-side only behaviour and several null checks to avoid interfering with vanilla or Create logic when the filter isn't a Shuffle Filter.
- Logo:
bin/main/shufflefilters_logo.png - Example registration:
CreateShuffleFilter.SHUFFLE_FILTERinCreateShuffleFilter.java
- Pull requests welcome.
- Ensure consistency with Create and NeoForged mapping/licensing where required.
This project is licensed under the MIT License. See the LICENSE file for details.
Author: Agent772
- NeoForged Discord and Create modding communities are great places to get help and feedback.
