
Swift Harvest Datapack, Crops Replant Themselves
Auto replant for farming: break a grown crop and it sows itself again from one seed of the drop. Wheat, carrots, potatoes, beetroot and nether wart. Server-side datapack - no mod, nothing for players to install.
2.0.0+26.2
Compatibility
Changes
Complete rewrite. Version 1.0 did not work at all.
The old version's folder was called funktions and its files ended in .mcfunktion; Minecraft only reads function/ and .mcfunction. It had no function tags, so nothing would have started even with the right names, and its tool check used an NBT path called Dimensions that does not exist. A test server reported Unknown function harvest:tick.
What changed about the idea, and why
The original promise was right-click harvesting. That is not possible in a datapack. A datapack can only react to events the game reports, and right-clicking a crop in vanilla does nothing at all, so nothing is reported. Verified on a real 26.2 server with a real mouse click against every candidate advancement trigger (item_used_on_block, any_block_use, default_block_use): placing a torch on stone fires two of them, right-clicking ripe wheat fires none. That is why every "right click harvest" project on Modrinth is a mod.
2.0.0 hooks the moment that is reported - the harvest itself:
- Break a grown crop and it is replanted immediately
- Exactly one item from the drop is used; you keep the rest
- Wheat, carrots, potatoes, beetroot and nether wart
- Any tool or bare hands; Fortune still works normally
- No farm scanning and no per-player raycast - the pack only looks at dropped items, so an idle server does no work
Tested on real servers on 1.21.11, 26.1.2, 26.2 and 26.3 pre-2, every crop checked individually, including that the seed count goes down by exactly one.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:CBzwU7AJ:2STSwFtm"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:CBzwU7AJ:2STSwFtm"
}
