CobbleOre Generator - Fabric 1.21.1
一款适用于 Minecraft 1.21.1 的 Fabric 模组,让圆石生成器能够生成矿石!基于 OffsetMods538 的原始模组改编。
功能
- 25% 几率生成矿石:当生成圆石时,有 25% 的几率将其替换为矿石
- 完全可配置:JSON 配置文件让你可以控制哪些方块会生成及其权重
- 支持模组添加的矿石:兼容任何添加了矿石的模组——只需将它们添加到配置中即可!
- 默认平衡:内置所有原版矿石的合理默认权重
工作原理
当熔岩和水相互作用在生成器中产生圆石时,此模组有 25% 的几率根据你配置文件中定义的加权概率,将生成的圆石替换为随机矿石。
配置
配置文件位于 .minecraft/config/cog.json
默认配置
模组自带以下默认矿石权重:
| 矿石 |
权重 |
稀有度 |
| 煤(两种变体) |
各 30 |
常见 |
| 铁(两种变体) |
各 25 |
常见 |
| 铜(两种变体) |
各 20 |
常见 |
| 红石(两种变体) |
各 15 |
不常见 |
| 青金石(两种变体) |
各 12 |
不常见 |
| 金(两种变体) |
各 10 |
不常见 |
| 钻石(两种变体) |
各 3 |
稀有 |
| 绿宝石(两种变体) |
各 2 |
极稀有 |
配置格式
配置文件使用简单的基于权重的系统。权重越高 = 越常见。
{
"generatableBlocks": {
"minecraft:cobblestone": 30,
"minecraft:diamond_ore": 3,
"minecraft:emerald_ore": 2
}
}
权重示例:
- 2 个方块,权重均为 1 = 50/50 的几率
- 方块 A 权重 30,方块 B 权重 1 = 约 97% vs 约 3%
添加模组添加的矿石
只需在配置中添加方块 ID 和权重:
{
"generatableBlocks": {
"minecraft:diamond_ore": 3,
"create:zinc_ore": 15,
"thermal:silver_ore": 10,
"mekanism:osmium_ore": 12
}
}
有趣的配置
混乱模式 - 生成任意方块:
{
"generatableBlocks": {
"minecraft:diamond_block": 1,
"minecraft:tnt": 1,
"minecraft:cake": 10
}
}
简单模式 - 更高价值的矿石:
{
"generatableBlocks": {
"minecraft:diamond_ore": 30,
"minecraft:emerald_ore": 20,
"minecraft:gold_ore": 50
}
}
安装
对于玩家:
- 为 Minecraft 1.21.1 安装 Fabric Loader
- 下载适用于 1.21.1 的 Fabric API
- 将 Fabric API 和本模组的
.jar 文件放入 .minecraft/mods 文件夹
- 使用 Fabric 配置文件启动 Minecraft
- (可选)编辑位于
.minecraft/config/cog.json 的配置文件
对于开发者:
首次设置
构建之前,你需要设置 Gradle wrapper:
选项 1:使用下载脚本(最简单)
# Linux/Mac
chmod +x download-wrapper.sh
./download-wrapper.sh
# Windows
download-wrapper.bat
选项 2:如果你已安装 Gradle
gradle wrapper
选项 3:手动下载
从以下地址下载 gradle-wrapper.jar:
将其放置在:gradle/wrapper/gradle-wrapper.jar
构建模组
一旦 wrapper 设置完成:
# Linux/Mac
./gradlew build
# Windows
gradlew.bat build
编译后的 .jar 文件将位于 build/libs/ 目录中
要求
- Minecraft 1.21.1
- Fabric Loader 0.16.0 或更高版本
- Fabric API 0.102.0+1.21.1 或更高版本
- Java 21 或更高版本
兼容性
此模组应与大多数其他模组兼容。它仅修改圆石生成行为,并使用 mixins 挂钩到流体交互中。
常见问题
问:这能用于模组添加的矿石吗?
答:可以!只需将它们与方块 ID 和所需的权重一起添加到配置文件中。
问:我可以让它生成除矿石以外的方块吗?
答:当然可以!你可以在配置中使用任何方块 ID。想要蛋糕生成器?尽管去试吧!
问:矿石没有生成!
答:确保你有一个正确的圆石生成器(熔岩 + 水生成圆石)。石头生成器无法工作。另外请记住,只有 25% 的几率。
问:我可以改变 25% 的几率吗?
答:百分比是硬编码在模组中的,但你可以通过配置文件中的权重来调整相对频率。
问:这在服务器上能用吗?
答:可以!就像安装任何其他 Fabric 模组一样将其安装在服务器上即可。
致谢
许可证
本模组遵循 MIT 许可证提供。
链接
CobbleOre Generator - Fabric 1.21.1
A Minecraft Fabric mod for version 1.21.1 that makes cobblestone generators generate ores! Based on the original mod by OffsetMods538.
Features
- 25% Chance for Ores: When cobblestone is generated, there's a 25% chance it becomes an ore instead
- Fully Configurable: JSON config file lets you control which blocks spawn and their weights
- Modded Support: Works with any mod that adds ores - just add them to the config!
- Balanced by Default: Comes with sensible default weights for all vanilla ores
How It Works
When lava and water interact to create cobblestone in a generator, this mod has a 25% chance to replace that cobblestone with a random ore based on weighted probabilities defined in your config file.
Configuration
The config file is located at .minecraft/config/cog.json
Default Configuration
The mod comes with these default ore weights:
| Ore |
Weight |
Rarity |
| Coal (both variants) |
30 each |
Common |
| Iron (both variants) |
25 each |
Common |
| Copper (both variants) |
20 each |
Common |
| Redstone (both variants) |
15 each |
Uncommon |
| Lapis (both variants) |
12 each |
Uncommon |
| Gold (both variants) |
10 each |
Uncommon |
| Diamond (both variants) |
3 each |
Rare |
| Emerald (both variants) |
2 each |
Very Rare |
Config Format
The config uses a simple weight-based system. Higher weight = more common.
{
"generatableBlocks": {
"minecraft:cobblestone": 30,
"minecraft:diamond_ore": 3,
"minecraft:emerald_ore": 2
}
}
Weight Examples:
- 2 blocks with weight 1 each = 50/50 chance
- Block A with weight 30, Block B with weight 1 = ~97% vs ~3%
Adding Modded Ores
Just add the block ID and weight to the config:
{
"generatableBlocks": {
"minecraft:diamond_ore": 3,
"create:zinc_ore": 15,
"thermal:silver_ore": 10,
"mekanism:osmium_ore": 12
}
}
Fun Configurations
Chaos Mode - Generate ANY block:
{
"generatableBlocks": {
"minecraft:diamond_block": 1,
"minecraft:tnt": 1,
"minecraft:cake": 10
}
}
Easy Mode - More valuable ores:
{
"generatableBlocks": {
"minecraft:diamond_ore": 30,
"minecraft:emerald_ore": 20,
"minecraft:gold_ore": 50
}
}
Installation
For Players:
- Install Fabric Loader for Minecraft 1.21.1
- Download Fabric API for 1.21.1
- Place both Fabric API and this mod's
.jar file in your .minecraft/mods folder
- Launch Minecraft with the Fabric profile
- (Optional) Edit the config at
.minecraft/config/cog.json
For Developers:
First Time Setup
Before building, you need to set up the Gradle wrapper:
Option 1: Using the download script (easiest)
# Linux/Mac
chmod +x download-wrapper.sh
./download-wrapper.sh
# Windows
download-wrapper.bat
Option 2: If you have Gradle installed
gradle wrapper
Option 3: Manual download
Download gradle-wrapper.jar from:
Place it in: gradle/wrapper/gradle-wrapper.jar
Building the Mod
Once the wrapper is set up:
# Linux/Mac
./gradlew build
# Windows
gradlew.bat build
The compiled .jar file will be located in build/libs/
Requirements
- Minecraft 1.21.1
- Fabric Loader 0.16.0 or higher
- Fabric API 0.102.0+1.21.1 or higher
- Java 21 or higher
Compatibility
This mod should be compatible with most other mods. It only modifies the cobblestone generation behavior and uses mixins to hook into fluid interactions.
FAQ
Q: Does this work with modded ores?
A: Yes! Just add them to the config file with their block ID and desired weight.
Q: Can I make it generate blocks other than ores?
A: Absolutely! You can use any block ID in the config. Want cake generators? Go for it!
Q: The ores aren't generating!
A: Make sure you have a proper cobblestone generator (lava + water creating cobblestone). Stone generators won't work. Also remember it's only a 25% chance.
Q: Can I change the 25% chance?
A: The percentage is hardcoded in the mod, but you can adjust the relative frequencies using weights in the config.
Q: Will this work on servers?
A: Yes! Just install it on the server like any other Fabric mod.
Credits
- Original concept and mod by OffsetMods538
- Adapted for Minecraft 1.21.1
License
This mod is available under the MIT license.
Links
- Original mod:
- Original Modrinth page:
评论 0
登录后参与评分
还没有评论,来抢沙发吧