Forge 1.19.4模组添加Placed Feature报错:注册表存在未绑定值
Forge 1.19.4模组开发:新增树木Placed Feature崩溃问题解决
问题场景
开发1.19.4版本Forge模组添加新树木,配置Placed Feature后客户端直接崩溃,报错信息如下:
IllegalStateException: Unbound values in registry ResourceKey[minecraft:root / minecraft:worldgen/placed_feature]: [minecraft:divine_placed]
对应的Placed Feature JSON配置内容:
{ "feature": "pantheonic:divine", "placement": [ { "type": "minecraft:count", "count": { "type": "minecraft:weighted_list", "distribution": [ { "data": 3, "weight": 9 }, { "data": 5, "weight": 1 } ] } }, { "type": "minecraft:in_square" }, { "type": "minecraft:surface_water_depth_filter", "max_water_depth": 0 }, { "type": "minecraft:heightmap", "heightmap": "OCEAN_FLOOR" }, { "type": "minecraft:biome" }, { "type": "minecraft:block_predicate_filter", "predicate": { "type": "minecraft:would_survive", "state": { "Name": "pantheonic:divine_sapling", "Properties": { "stage": "0" } } } } ] }
报错原因
错误里的[minecraft:divine_placed]是核心问题——游戏尝试在minecraft官方命名空间中查找这个Placed Feature,但你的模组命名空间是pantheonic,明显是命名空间不匹配导致的未绑定错误。
大概率是以下两种情况之一:
- 引用该Placed Feature时(比如Biome生成配置、世界生成修改器),误将ID写成
minecraft:divine_placed,而非正确的pantheonic:divine_placed - JSON文件存放路径错误,未放在模组资源包的
data/pantheonic/worldgen/placed_feature/目录下,导致游戏无法识别它属于你的模组命名空间
解决方法
- 修正命名空间引用:
- 检查所有用到这个Placed Feature的配置或代码,把ID统一改为
pantheonic:divine_placed
- 检查所有用到这个Placed Feature的配置或代码,把ID统一改为
- 核对文件路径:
- 确保JSON文件路径为:
src/main/resources/data/pantheonic/worldgen/placed_feature/divine_placed.json - 文件名要与ID后缀一致,比如用
divine_placed作为ID,文件名就必须是divine_placed.json
- 确保JSON文件路径为:
- 检查依赖Feature:
- 确认
pantheonic:divine这个基础Feature已正确注册,其JSON文件放在data/pantheonic/worldgen/feature/目录下
- 确认
- 清理缓存重启:
- 删除
run目录下的cache文件夹,清理Forge运行缓存后再启动游戏
- 删除
内容的提问来源于stack exchange,提问作者RedstoniaYT
相关产品推荐
相关产品推荐

