Dimension Separator
此模组旨在控制不同维度中可出现的内容。
已在 Minecraft 1.20.1 和 Forge 47.1.3+ 上测试通过。
功能介绍
我曾想创建一个 RP(角色扮演)服务器,出于背景故事设定,希望禁止在主世界中使用所有“魔法”内容,但我发现很难在自定义维度保留这些结构的同时阻止它们出现在主世界中。
因此,我尝试制作了这个模组来辅助实现这一目标。
目前仍处于测试阶段,但你可以使用一个简单的 JSON 配置文件来告诉模组具体希望在哪个维度允许哪些内容出现。
对于每个维度,你可以通过黑名单或白名单方式按模组命名空间进行屏蔽:
- 世界生成特性(矿石、植物、结构等)
- 生物生成
- 战利品表(宝箱、生物掉落物等)
- 物品使用(右键点击方块、空中或使用于实体)
- 结构生成
配置说明
配置文件位于 config/dimensionseparator.json。~~~~
以下是一个示例:
{
"dimensions": {
"minecraft:overworld": {
"mode": "blacklist",
"bypassLevel": 2,
"namespaces": ["ars_nouveau", "iceandfire"],
"blacklistedIds": ["minecraft:zombie"],
"whitelistedIds": ["ars_nouveau:bookwyrm_familiar"],
"features": true,
"mobs": true,
"loot": true,
"items": true,
"structures": true
}
}
}
字段说明
| 字段 |
类型 |
描述 |
mode |
string |
"blacklist" 表示屏蔽列出的模组;"whitelist" 表示仅允许列出的模组 |
bypassLevel |
int |
允许 /summon 召唤被屏蔽实体的最低操作员等级(-1 或缺失 = 无绕过权限) |
namespaces |
string array |
根据 mode 设置要屏蔽或允许的模组 ID |
blacklistedIds |
string array |
始终被屏蔽的特定 ID,不受 mode 影响(例如 "minecraft:zombie") |
whitelistedIds |
string array |
始终被允许的特定 ID,不受 mode 影响(例如 "ars_nouveau:bookwyrm_familiar") |
features |
boolean |
屏蔽来自列出模组的世界生成特性(矿石、植物等) |
mobs |
boolean |
屏蔽来自列出模组的生物生成 |
loot |
boolean |
屏蔽来自列出模组的战利品表(宝箱、生物掉落物等) |
items |
boolean |
屏蔽来自列出模组的物品使用(右键点击) |
structures |
boolean |
屏蔽来自列出模组的结构生成 |
将某个类别设置为 false 即可禁用对该类别的屏蔽,即使该模组命名空间已被列入列表。
已知限制
- 对已屏蔽结构使用
/locate 将无限期搜索且无结果。这是原版 Minecraft 在维度中不存在匹配结构时的默认行为。
- 客户端按键绑定(例如使用自定义按键打开模组 GUI)不会被屏蔽——仅覆盖右键交互操作。实际上,在无法与该维度互动的情况下打开界面是无害的。
- 通过自定义按键绑定进行的物品使用 是客户端行为,服务端无法拦截。
兼容性
此模组使用 Mixins 和事件处理器,应与大多数 Forge 模组兼容。如果遇到冲突,请提交 Issue。
问题与贡献
发现 Bug 或有建议?请在 GitHub 上提交 Issue。
Dimension Separator
This mod is created to separate what can appear in wich dimension.
Tested on Minecraft 1.20.1 with Forge 47.1.3+.
What does it do?
I wanted to make a RP server where all the "magic" was forbiden in the overworld for lore purposes but I struggled to prevent some structures to appear in the overworld while still be in my custom dimension.
So I tried to create a mod to help me just do that.
It's still in testing but you can use a simple json config to tell the mod what exactly you want to let appear in wich dimension.
For each dimension, you can blacklist or whitelist mod namespaces to block:
- World generation features (ores, plants, structures...)
- Mob spawning
- Loot tables (chests, mob drops...)
- Item usage (right-click on blocks, in the air, or on entities)
- Structure generation
Configuration
The config file is located at config/dimensionseparator.json.~~~~
Here is an example :
{
"dimensions": {
"minecraft:overworld": {
"mode": "blacklist",
"bypassLevel": 2,
"namespaces": ["ars_nouveau", "iceandfire"],
"blacklistedIds": ["minecraft:zombie"],
"whitelistedIds": ["ars_nouveau:bookwyrm_familiar"],
"features": true,
"mobs": true,
"loot": true,
"items": true,
"structures": true
}
}
}
Fields
| Field |
Type |
Description |
mode |
string |
"blacklist" to block listed mods, "whitelist" to allow only listed mods |
bypassLevel |
int |
Minimum operator level allowed to /summon blocked entities (-1 or absent = no bypass) |
namespaces |
string array |
Mod IDs to block or allow depending on mode |
blacklistedIds |
string array |
Specific IDs always blocked, regardless of mode (e.g. "minecraft:zombie") |
whitelistedIds |
string array |
Specific IDs always allowed, regardless of mode (e.g. "ars_nouveau:bookwyrm_familiar") |
features |
boolean |
Block world generation features (ores, plants...) from listed mods |
mobs |
boolean |
Block mob spawning from listed mods |
loot |
boolean |
Block loot tables from listed mods (chests, mob drops...) |
items |
boolean |
Block item usage (right-click) from listed mods |
structures |
boolean |
Block structure generation from listed mods |
Setting a category to false disables blocking for that category, even if the namespace is listed.
Known Limitations
/locate on a blocked structure will search indefinitely without result. This is vanilla Minecraft behavior when no matching structure exists in the dimension.
- Client-side keybinds (e.g. opening a mod's GUI with a custom key) are not blocked — only right-click interactions are covered. In practice, opening an interface without being able to interact with the dimension is harmless.
- Item usage via custom keybinds is client-side and cannot be intercepted server-side.
Compatibility
This mod uses Mixins and event handlers and should be compatible with most Forge mods. If you encounter a conflict, please open an issue.
Issues & Contributions
Found a bug or have a suggestion? Open an issue on GitHub.
评论 0
登录后参与评分
还没有评论,来抢沙发吧