A Fabric mod for Minecraft 26.3 that lets you scoop up (almost) any mob — passive or hostile — into a single bucket and pour it back out wherever you like. Inspired by JustDoom/VillagerInABucket, but generalised to work on every creature instead of just villagers.
Unlike the original (which uses a per-entity mixin for villagers, wandering traders and zombie villagers), this mod hooks the generic item/entity interaction methods, so it works on anything that lives — cows, horses, creepers, villagers, axolotls, zombies, you name it — with no mixins at all.
It captures any LivingEntity (every mob, plus armor stands). It does not catch
non-living entities such as boats, minecarts, item frames or dropped items.
Shapeless: 1 bucket + 1 ender pearl → 1 Mob Bucket (reusable forever — one bucket is
all you ever need). You can also get it from the Tools & Utilities creative tab or with
/give @s mobbucket:mob_bucket.
To change the recipe, edit
src/main/resources/data/mobbucket/recipe/mob_bucket.json and rebuild.
| Component | Version |
|---|---|
| Minecraft | 26.3 |
| Fabric Loader | ≥ 0.19.5 |
| Fabric API | any (0.161.0+26.3 tested) |
| Java | 25 |
The project uses the Gradle wrapper, so you don't need Gradle installed — only a Java 25 JDK.
On Gentoo you likely have it at /opt/openjdk-bin-25:
JAVA_HOME=/opt/openjdk-bin-25 ./gradlew build
The finished mod jar is written to build/libs/mobbucket-1.0.0.jar
(ignore the -sources.jar).
.minecraft/mods/ folder (or a server's mods/):
mobbucket-1.0.0.jar/give @s mobbucket:mob_bucket.JAVA_HOME=/opt/openjdk-bin-25 ./gradlew runClient # single-player client
JAVA_HOME=/opt/openjdk-bin-25 ./gradlew runServer # dedicated server
Everything lives in two small classes:
MobBucketMod — registers the mob_bucket item and adds it to the creative tab.MobBucketItem — the behaviour:
interactLivingEntity(...) captures the entity. The entity is serialised with the
26.3 ValueOutput API (TagValueOutput.createWithContext(...) → entity.save(...))
and the resulting NBT is stored in the stack's CUSTOM_DATA component under
CapturedEntity. The entity is then discard()ed.useOn(...) rebuilds the entity from that NBT
(EntityType.by(input).flatMap(type -> EntityType.create(type, input, level, BUCKET))),
snaps it to the clicked block face, adds it to the world, and clears the component.No capture/release state is stored anywhere except on the item stack itself, so filled buckets survive being dropped, put in chests, traded, etc.
interactLivingEntity from entity instanceof Player to
!(entity instanceof net.minecraft.world.entity.animal.Animal).MIT — see LICENSE.