Mod Compatibility - andrew0030/SwampierSwamps GitHub Wiki
โ General Compatibility
Swampier Swamps is designed to be compatible with most mods. Since it primarily adds new features to the swamp biome rather than modifying existing ones, it should work seamlessly alongside other mods. Even if another mod changes aspects of the swamp, Swampier Swamps will still inject its additional content without conflict.
The only potential issue arises with swamp trees. ๐ณ
โ ๏ธ Swamp Trees and Potential Conflicts
Swampier Swamps introduces swamp vines, which are vines that can grow into water. To implement these, the mod replaces the vanilla swamp trees with a modified version that includes swamp vines.
If another mod modifies the default swamp trees (e.g. changing their shape) then only one modโs version of the trees will take effect, potentially leading to conflicts where one modโs changes overwrite the otherโs.
๐ ๏ธ Resolving Conflicts via Datapacks
Fortunately, most modern mods handle world generation in a data-driven way. This means that conflicts between Swampier Swamps and another mod modifying swamp trees can often be resolved using a datapack.
By examining the world generation files of Swampier Swamps and the conflicting mod, you can create a custom datapack that merges both modsโ features, for example, allowing custom-shaped trees with swamp vines.
๐ง Example: Combining Swampier Swamps and Terralith Trees
This setup will be a bit more complex than Modifying Frog Biomes. If you are unfamiliar with creating datapacks, refer to Creating a Data Pack for basic instructions.
๐ Finding the Swampier Swamps JSON
For this example, we will combine Terralith trees with swamp vines. The relevant file in Swampier Swamps is located at:
data/minecraft/worldgen/configured_feature/swamp_oak.json
๐ Note: Since we are replacing a vanilla feature, notice how the path is targeting
minecraft:
instead ofswampier_swamps:
.
๐ฑ Understanding Vine Placement
Inside this JSON file, you will find the vanilla swamp_oak
feature. What we are after is the vine placement.
๐น Vanilla Vine Placement
In vanilla Minecraft, vines are placed using this configuration:
"decorators": [
{
"type": "minecraft:leave_vine",
"probability": 0.25
}
],
๐น Swampier Swamps Vine Placement
Swampier Swamps replaces vanilla vines with swamp vines, modifying the configuration as follows:
"decorators": [
{
"type": "swampier_swamps:leave_swamp_vine",
"probability": 0.25,
"length": 4
}
],
๐ Note: The
length
property is a unique addition from Swampier Swamps. It allows for customizing vine length, with values between 1 and 8. Taller trees, like Bald Cypress, use a length of8
for longer vines.
๐ Locating the Terralith Tree Feature JSONs
To add swamp vines to Terralith trees, we first need to find all the relevant tree feature JSON files.
Based on which mod version is used, the number of files and their location may vary, at the time of writing this I found the following files:
1. data/terralith/worldgen/configured_feature/swamp/ice/small/swamp_small.json
2. data/terralith/worldgen/configured_feature/swamp/ice/small/swamp_special_small.json
3. data/terralith/worldgen/configured_feature/swamp/orchid/small/swamp_small.json
4. data/terralith/worldgen/configured_feature/swamp/orchid/small/swamp_special_small.json
5. data/terralith/worldgen/configured_feature/swamp/orchid/tiny/swamp_special_tiny.json
6. data/terralith/worldgen/configured_feature/swamp/vanilla/mid/swamp_mid.json
7. data/terralith/worldgen/configured_feature/swamp/vanilla/mid/swamp_special_mid.json
8. data/terralith/worldgen/configured_feature/swamp/vanilla/small/swamp_small.json
9. data/terralith/worldgen/configured_feature/swamp/vanilla/small/swamp_special_small.json
10. data/terralith/worldgen/configured_feature/swamp/vanilla/tall/swamp_giant_tall.json
11. data/terralith/worldgen/configured_feature/swamp/vanilla/tall/swamp_special_tall.json
12. data/terralith/worldgen/configured_feature/swamp/vanilla/tall/swamp_tall.json
13. data/terralith/worldgen/configured_feature/swamp/vanilla/tall/swamp_willow.json
14. data/terralith/worldgen/configured_feature/swamp/vanilla/tiny/swamp_special_tiny.json
๐ Note: Finding the JSON files can be a tedious process, but they are usually located in a logical directory based on their function. The number of files you need to modify depends on how many trees you want to update.
๐ Modifying the Terralith Tree JSONs
Just like with the vanilla swamp_oak
feature, all we need to do is locate where these Terralith trees use the vine decorator and replace it with the Swampier Swamps vine decorator.
For each tree JSON, look for a section similar to this:
"decorators": [
{
"type": "minecraft:leave_vine",
"probability": 0.25
}
],
Replace it with:
"decorators": [
{
"type": "swampier_swamps:leave_swamp_vine",
"probability": 0.25,
"length": 4
}
],
This will allow Terralith trees to generate with swamp vines, ensuring full compatibility between the two mods.
๐ญ Closing Thoughts
In this example, we added swamp vines to Terralith's custom trees. However, this method is not limited to Terralith, you can apply the same approach to any mod that modifies swamp trees.
The key takeaway is understanding how tree features are defined in a modโs configured_feature
JSON files and replacing the standard minecraft:leave_vine
decorator with swampier_swamps:leave_swamp_vine
. Once you locate the right files, the process is straightforward.
Rather than following these steps exactly, use this guide as a framework to analyze different mods and adapt swamp vines to any custom tree generation. With some experimentation and tweaking, you can integrate the swamp vines into most mods.