NoobGuard
NoobGuard 是一款仅服务端的 Minecraft NeoForge 模组(1.21.x),旨在为特定玩家提供“和平模式”,使他们在独处或与其他受保护玩家在一起时,能够探索世界并与之互动,而无需面对敌对生物。这对于偏好较低挑战性体验的玩家或未成年玩家尤其有用。
功能
- 受保护玩家:当受保护玩家独处或仅与其他受保护玩家在一起时,防止敌对生物攻击或伤害他们。
- 敌对实体管理:
- 防止敌对生物锁定或伤害受保护玩家。
- 如果配置允许,防止敌对生物在受保护玩家附近生成。
- 提供选项:允许被模组杀死的敌对生物掉落战利品,或者直接移除它们而不掉落任何物品。
- 可配置的独处距离:设置一个以玩家为中心的可配置距离(方块数),定义玩家远离其他非受保护玩家的距离,从而触发和平模式。
安装
- 安装 Minecraft NeoForge。
- 下载 NoobGuard 模组文件。
- 将 NoobGuard 模组文件放入 Minecraft 目录下的
mods 文件夹中。
- 在 Minecraft 服务器目录的
config 文件夹中,你会找到配置文件 noobguard-common.toml。
使用方法
- 安装完成后,启动游戏。
- 在
noobguard-common.toml 配置文件中添加受保护玩家的 UUID,或者如果支持,通过游戏内的配置界面进行编辑。
配置选项
NoobGuard 提供以下可自定义选项:
- preventSpawning:布尔值(默认为
false)。设置为 true 以防止敌对实体在受保护玩家附近生成。
- dropLoot:布尔值(默认为
false)。设置为 true 以启用被模组移除的敌对生物掉落战利品。
- aloneDistance:整数(默认为
32 个方块)。定义检查其他玩家是否存在于受保护玩家周围的距离范围。
- guarded-users:需要保护的玩家的 UUID 列表。只有这些玩家会受到敌对实体的保护。
示例配置
在 noobguard.toml 中:
preventSpawning = true
dropLoot = true
aloneDistance = 40
guarded-users = ["uuid1", "uuid2", "uuid3"]
请将 uuid1、uuid2 和 uuid3 替换为你希望保护的玩家的实际 UUID。
事件
NoobGuard 利用以下事件:
- LivingChangeTargetEvent:当和平模式激活时,防止敌对生物锁定受保护玩家。
- EnderManAngerEvent:阻止末影人锁定受保护玩家。
- FinalizeSpawnEvent:防止敌对生物在受保护玩家附近生成。
- LivingIncomingDamageEvent:取消来自敌对实体对受保护玩家的 incoming 伤害。
日志记录
NoobGuard 会在 DEBUG 级别下记录目标和防止、实体移除以及生成防止等操作和事件,以便于调试和监控。
许可证
本项目采用 MIT 许可证。详情请参阅 LICENSE 文件。
NoobGuard
NoobGuard is a server-side only Minecraft NeoForge mod (1.21.x) designed to provide a "peace mode" for specific players, allowing them to explore and interact with the world without facing hostile mobs when they are alone or in the presence of other "guarded" players. This is especially useful for players who prefer a less challenging experience or for younger players.
Features
- Guarded Players: Prevents hostile mobs from targeting or damaging specific players when they are alone or only in the company of other guarded players.
- Hostile Entity Management:
- Prevents hostile mobs from targeting or damaging guarded players.
- Prevents hostile mobs from spawning near guarded players if configured.
- Allows the option to drop loot from hostile mobs killed by the plugin, or simply removes them without loot.
- Configurable Alone Distance: Set a configurable distance in blocks around a player, defining how far they need to be from other non-guarded players to trigger peace mode.
Installation
- Install Minecraft NeoForge.
- Download the NoobGuard mod file.
- Place the NoobGuard mod file into the
mods folder of your Minecraft directory.
- You will find the configuration file
noobguard-common.toml in the config folder of your Minecraft Server directory.
Usage
- After installation, launch the game.
- Add the UUIDs of guarded players in the
noobguard-common.toml config file, or edit via the config screen in-game if supported.
Configuration Options
NoobGuard offers the following customizable options:
- preventSpawning: Boolean (
false by default). Set to true to prevent hostile entities from spawning near guarded players.
- dropLoot: Boolean (
false by default). Set to true to enable loot drops from hostile mobs removed by the mod.
- aloneDistance: Integer (default is
32 blocks). Defines the distance around a guarded player to check for other players.
- guarded-users: A list of UUIDs for players who should be protected. Only these players will be shielded from hostile entities.
Example Configuration
In noobguard.toml:
preventSpawning = true
dropLoot = true
aloneDistance = 40
guarded-users = ["uuid1", "uuid2", "uuid3"]
Replace uuid1, uuid2, and uuid3 with the actual UUIDs of the players you wish to guard.
Events
NoobGuard leverages the following events:
- LivingChangeTargetEvent: Prevents hostile mobs from targeting guarded players when peace mode is active.
- EnderManAngerEvent: Stops Enderman from targeting guarded players.
- FinalizeSpawnEvent: Prevents hostile mob spawning near guarded players.
- LivingIncomingDamageEvent: Cancels incoming damage to guarded players from hostile entities.
Logging
NoobGuard logs actions and events such as target prevention, entity removal, and spawn prevention for debugging and monitoring purposes under the DEBUG level.
License
This project is licensed under the MIT License. See LICENSE for details.
评论 0
登录后参与评分
还没有评论,来抢沙发吧