让每位玩家选择敌对生物如何对待自己——而不会改变服务器上其他玩家的体验。
Selective Peaceful Mobs 是一款可配置的 NeoForge 模组,适用于 Minecraft 1.21.1。启用和平模式(peaceful mobs)的玩家在被攻击前不会被敌对生物注意。其他玩家可以关闭此功能,同时以正常的原版敌意进行游戏。
特性
- 针对每个玩家的和平生物行为。
- 为每位玩家提供按维度(dimension)和按生物类型(mob-type)的选择。
- 一个主开关,当处于 OFF 状态时会覆盖所有范围(scoped)设置。
- 独立的服务器开关,用于允许或禁用每个切换功能。
- 和平模式玩家与普通敌意玩家可以在同一服务器上共同游戏。
- 当和平模式玩家攻击敌对生物时,该生物会暂时进行反击。
- 直接攻击和玩家发射的投射物都会触发反击。
- 可选的同类群体仇恨(group aggro),在可配置半径内生效。
- 玩家的选择会在跨维度、重新连接和服务器重启后保留。
- 玩家可以管理自己的设置;操作员可以管理其他玩家的设置。
- 可为尚未选择设置的玩家配置服务器默认值。
- 可配置始终敌对的生物列表。
- 自动支持大多数被归类为敌对怪物(hostile monsters)的原版及模组生物。
- 不添加任何方块、物品、配方或自定义网络数据包。
工作原理
| 玩家设置 |
结果 |
| 和平 ON |
当维度和生物设置为 ON 时,除非受到挑衅,否则敌对生物会忽略该玩家。 |
| 和平 OFF |
敌对生物对该玩家的行为恢复正常。 |
| 无保存的选择 |
使用服务器配置的默认值。 |
未指定的维度和生物选择默认为 ON。任一范围内的 OFF 选择将禁用保护;主开关设为 OFF 将在所有地方禁用保护。重新开启主开关将恢复已保存的范围设置的效果。生物选择应用于某个生物类型在所有维度中的表现,而不是单个生物实体。
当受保护的玩家攻击敌对生物时,该生物会根据配置的挑衅时间锁定并攻击该玩家。如果启用了群体仇恨,附近相同类型的生物也会进行反击。一旦挑衅时间结束,这些生物将恢复忽略该玩家。
末影龙(Ender Dragon)、监守者(Warden)和凋灵(Wither)默认始终敌对。服务器所有者可以修改此列表。
玩家命令
/peacefulmobs on
/peacefulmobs off
/peacefulmobs status
/peacefulmobs reset
/peacefulmobs dimension <dimension_id> <on|off|status|reset>
/peacefulmobs mob <entity_id> <on|off|status|reset>
on 启用你的主设置,并应用维度和生物选择。
off 为你恢复正常的生物敌意。
status 显示你的主设置值、ON/OFF 状态的维度,以及仅你明确保存的 ON 生物选择。默认值和维度切换不会填充生物列表;保护规则仍然适用。
reset 将你的主设置重置为服务器默认值,但不会删除范围设置。
- 范围
reset 移除该维度或生物选择,使其恢复为 ON。
回复使用简短标签,例如 minecraft:the_nether: OFF。ON 显示为绿色,OFF 显示为红色。启用的生物列表仅包含明确保存的 ON 选择;为空时显示 None。
例如,/peacefulmobs dimension minecraft:the_nether off 在下界(Nether)中恢复正常敌意,而 /peacefulmobs mob minecraft:creeper off 则对所有维度中的苦力怕(creepers)生效。ID 支持 Tab 补全,包括已加载的模组维度和注册的实体类型。
操作员命令
这些命令需要原版权限等级 2 或更高:
/peacefulmobs set <player> <true|false>
/peacefulmobs check <player>
/peacefulmobs reset <player>
/peacefulmobs dimension <dimension_id> <on|off|status|reset> <player>
/peacefulmobs mob <entity_id> <on|off|status|reset> <player>
配置
生成的配置文件位于:
config/selective-peaceful-mobs-server.toml
从 pre-1.0.0 版本升级时,请在服务器停止运行时,将 selectivepeacefulmobs-server.toml 中任何自定义的值复制到新文件中。
服务器所有者可以配置:
- 是否默认启用和平行为。
- 是否启用并保存单个玩家的选择。
- 主开关、维度切换和生物切换功能是否分别可用(针对玩家和操作员)。
- 挑衅持续时间,范围为 1 到 3,600 秒。
- 同类群体仇恨。
- 群体仇恨半径,范围为 1 到 128 格。
- 是否始终忽略创造模式和旁观模式玩家。
- 保持对受保护玩家敌对的生物列表。
默认值:
[general]
defaultPeaceful = true
rememberPlayerChoice = true
allowMasterToggle = true
allowDimensionToggle = true
allowMobToggle = true
provokedTimeSeconds = 30
groupAggro = true
groupAggroRadius = 16
ignoreCreativeAndSpectator = true
[alwayshostilemobs]
mobs = ["minecraft:ender_dragon", "minecraft:warden", "minecraft:wither"]
被禁用的功能会忽略其保存的选择而不将其删除。当 allowMasterToggle=false 时,defaultPeaceful 提供主设置值;启用的范围设置仍然适用。rememberPlayerChoice=false 禁用所有选择更改,仅使用服务器默认值。编辑配置后请重启服务器。现有的 1.0.0 玩家选择会自动保留。
安装与要求
- 使用 Java 21 运行服务器,并在 21.1 系列中安装带有 NeoForge 21.1.231 或更高版本的 Minecraft 1.21.1。
- 将
selective-peaceful-mobs-1.21.1-1.1.0.jar 放入服务器的 mods 文件夹中,替换旧版本。
- 启动服务器,并根据需要调整生成的配置文件。
该模组设计为服务端安装。它不添加任何客户端内容或自定义网络数据包,因此预计玩家不需要安装此模组。整合包作者仍应使用其确切的客户端和服务端整合包进行验证。
兼容性
该模组通过 Minecraft 的标准敌对生物分类来识别敌对生物,并通过正常的战斗目标路径筛选玩家。这涵盖了大多数原版生物和常规的模组敌对生物。
一些高度自定义的模组生物可能使用绕过正常目标锁定的攻击逻辑。如果遇到这种情况,请将其加入兼容性测试,并通过项目支持渠道报告,同时提供整合包及受影响生物的详细信息。
常见问题
这会改变世界难度或阻止敌对生物生成吗?
不会。它仅改变敌对生物允许锁定的玩家范围;不改变难度或生成规则。
和平模式与非和平模式玩家能一起游玩吗?
可以。设置是按玩家独立评估的,因此一个生物可以忽略某个玩家而锁定另一个玩家。
和平模式玩家还能与生物战斗吗?
可以。攻击敌对生物会暂时激怒它,从而保留风险与反击机制。
管理员能否强制为其他玩家设置选项?
可以。管理员可以使用上述管理命令来设置、查看或重置其他玩家的选择。
它对模组生物有效吗?
对于使用 Minecraft 标准敌对分类和目标系统的绝大多数模组生物,它应能自动生效。具有完全自定义攻击逻辑的生物可能需要额外的兼容性适配。
Let every player choose how hostile mobs treat them—without changing the experience for everyone else on the server.
Selective Peaceful Mobs is a configurable NeoForge mod for Minecraft 1.21.1. Players with peaceful mobs enabled are ignored by hostile mobs until they attack. Other players can leave the feature off and continue playing with normal vanilla hostility at the same time.
Features
- Per-player peaceful mob behavior.
- Per-dimension and per-mob-type choices for every player.
- A master toggle that overrides all scoped choices when OFF.
- Independent server switches to allow or disable each toggle ability.
- Peaceful and normal-hostility players can play together on the same server.
- Hostile mobs temporarily retaliate when a peaceful player attacks them.
- Direct attacks and player-fired projectiles trigger retaliation.
- Optional same-type group aggro within a configurable radius.
- Player choices persist across dimensions, reconnects, and server restarts.
- Players can manage their own setting; operators can manage other players.
- Configurable server default for players who have not chosen a setting.
- Configurable always-hostile mob list.
- Automatic support for most vanilla and modded mobs classified as hostile monsters.
- No blocks, items, recipes, or custom network payloads.
How it works
| Player setting |
Result |
| Peaceful ON |
Hostile mobs ignore the player when dimension and mob choices are ON, unless provoked. |
| Peaceful OFF |
Hostile mobs behave normally toward the player. |
| No saved choice |
The server's configured default is used. |
Unspecified dimension and mob choices default to ON. An OFF choice in either scope disables protection; master OFF disables it everywhere. Turning the master back ON restores the effect of saved scoped choices. Mob choices apply to a mob type across dimensions, rather than an individual creature.
When a protected player attacks a hostile mob, that mob can target the player for the configured provocation time. If group aggro is enabled, nearby mobs of the same type can retaliate too. Once provocation expires, the mobs return to ignoring that player.
The Ender Dragon, Warden, and Wither are always hostile by default. Server owners can change this list.
Player commands
/peacefulmobs on
/peacefulmobs off
/peacefulmobs status
/peacefulmobs reset
/peacefulmobs dimension <dimension_id> <on|off|status|reset>
/peacefulmobs mob <entity_id> <on|off|status|reset>
on enables your master setting, with dimension and mob choices applied.
off restores normal mob hostility for you.
status shows your master value, dimensions with ON/OFF, and only your explicitly saved ON mob choices. Defaults and dimension toggles do not populate the mob list; protection rules still apply.
reset returns your master setting to the server default without erasing scoped choices.
- Scoped
reset removes that dimension or mob choice, returning it to ON.
Replies use short labels such as minecraft:the_nether: OFF. ON is green and OFF is red. The enabled-mob list contains only explicitly saved ON choices; it shows None when empty.
For example, /peacefulmobs dimension minecraft:the_nether off restores normal hostility in the Nether, and /peacefulmobs mob minecraft:creeper off does so for creepers in every dimension. IDs support tab completion, including loaded modded dimensions and registered entity types.
Operator commands
These commands require vanilla permission level 2 or higher:
/peacefulmobs set <player> <true|false>
/peacefulmobs check <player>
/peacefulmobs reset <player>
/peacefulmobs dimension <dimension_id> <on|off|status|reset> <player>
/peacefulmobs mob <entity_id> <on|off|status|reset> <player>
Configuration
The generated configuration file is:
config/selective-peaceful-mobs-server.toml
When upgrading from a pre-1.0.0 build, copy any customized values from selectivepeacefulmobs-server.toml into the new file while the server is stopped.
Server owners can configure:
- Whether peaceful behavior is enabled by default.
- Whether individual player choices are enabled and saved.
- Whether master, dimension, and mob toggle abilities are individually available (for players and operators).
- Provocation duration, from 1 to 3,600 seconds.
- Same-type group aggro.
- Group aggro radius, from 1 to 128 blocks.
- Whether creative and spectator players are always ignored.
- The list of mobs that remain hostile to protected players.
Default values:
[general]
defaultPeaceful = true
rememberPlayerChoice = true
allowMasterToggle = true
allowDimensionToggle = true
allowMobToggle = true
provokedTimeSeconds = 30
groupAggro = true
groupAggroRadius = 16
ignoreCreativeAndSpectator = true
[alwayshostilemobs]
mobs = ["minecraft:ender_dragon", "minecraft:warden", "minecraft:wither"]
Disabled abilities ignore their saved choices without deleting them. With allowMasterToggle=false, defaultPeaceful supplies the master value; enabled scoped choices still apply. rememberPlayerChoice=false disables all choice changes and uses only the server default. Restart after editing configuration. Existing 1.0.0 player choices are preserved automatically.
Installation and requirements
- Run the server with Java 21 and install Minecraft 1.21.1 with NeoForge 21.1.231 or newer in the 21.1 line.
- Place
selective-peaceful-mobs-1.21.1-1.1.0.jar in the server's mods folder, replacing the previous version.
- Start the server and adjust the generated configuration if desired.
The mod is designed for server-side installation. It adds no client content or custom network packets, so players are not expected to need the mod installed. Modpack authors should still verify this with their exact client and server pack.
Compatibility
The mod recognizes hostile mobs through Minecraft's standard hostile-mob classifications and filters players through normal combat targeting paths. This covers most vanilla mobs and conventional modded hostile mobs.
Some highly customized modded mobs may use attack logic that bypasses normal targeting. If one does, add it to your compatibility testing and report it through the project's support channel with the modpack and affected mob details.
Frequently asked questions
Does this change the world's difficulty or stop hostile mobs from spawning?
No. It changes which players hostile mobs are allowed to target; it does not change the difficulty or spawning rules.
Can peaceful and non-peaceful players play together?
Yes. The setting is evaluated per player, so a mob can ignore one player and target another.
Can peaceful players still fight mobs?
Yes. Attacking a hostile mob temporarily provokes it, preserving risk and retaliation.
Can operators force a setting for another player?
Yes. Operators can set, inspect, or reset another player's choice with the admin commands above.
Does it work with modded mobs?
It should work automatically with most modded mobs that use Minecraft's normal hostile classifications and targeting systems. Mobs with fully custom attack logic may require compatibility work.
评论 0
登录后参与评分
还没有评论,来抢沙发吧