NoSwim
NoSwim 是一款专为活动主办者和服务器管理员设计的 Minecraft 插件。它阻止玩家自由游泳,确保在游戏内活动期间拥有更可控的体验。在以下场景中,此工具有效防止游泳带来的不公平优势或干扰活动流程,例如障碍赛道、生存挑战,或是禁止玩家离开的岛屿。
功能
- 控制玩家在其中的行为(所有设置均可在配置文件中调整):
- 最小水深:通过设置最小水深来防止在深水中游泳。
- 玩家伤害:可选择让玩家进入深水时受到中毒或溺水伤害。
- 下压力:控制玩家在深水中的下沉速度。
- 水下呼吸豁免:拥有水下呼吸效果的玩家不受下沉影响。
- 水上建筑限制:防止玩家在受限水域上方进行建造。(尚未完全开发)
命令
该插件支持以下命令:
/noswim enable:启用 NoSwim 插件的行为(防止在深水中游泳)。
/noswim disable:禁用 NoSwim 插件的行为。
/noswim reload:从 config.yml 重新加载插件配置。
权限
noswim.admin:允许玩家使用 /noswim 命令(用于启用、禁用和重新加载插件)。
noswim.bypass:允许玩家绕过下沉机制,并能在深水中游泳。
配置选项
config.yml 文件允许你自定义插件的行为。以下是可用的配置设置:
# NoSwim Configuration File - Version 0.1-BETA-B1
# It is highly recommend to regenerate the config file after downloading a new version.
# To regenerate the config file: delete this config file and restart the server.
# Minimum water height (depth) to activate the sinking effect
min-water-height: 2 # Number
# Exempt players with the Water Breathing effect
water-breath-exemption: true # Options: true, false
# Damage options: poison, drowning, or none
player-damage:
enabled: false # Options: true, false
type: poison # Options: poison, drowning, none
damage-interval: 40 # Ticks (20 ticks = 1 second)
# Sinking effect
downforce:
enabled: true # Toggle sinking effect on/off | Options: true, false
amount: 0.25 # Default sinking speed (0.1 is slower, 0.5 is faster)
# [BETA] Allow building above water
# This feature is still in development and contains bugs,
# players can easily bypass this restriction.
# It is recommended to let players build above water until the bugs are fixed.
allow-building-above-water: true # Options: true, false (Default: true)
配置变量说明:
-
min-water-height:定义触发下沉效果所需的最小水深。低于此高度的水域不会触发下沉效果。
-
water-breath-exemption:如果设置为 true,拥有水下呼吸效果的玩家将不受下沉行为的影响。
-
player-damage:
enabled:设置为 true 以启用玩家伤害效果(如中毒或溺水)。
type:决定施加的伤害类型。可选值为 poison(中毒)、drowning(溺水)或 none(无)。
damage-interval:定义每次施加伤害之间的间隔时间(单位:刻)。
-
downforce:
enabled:控制下沉效果是否激活。如果设置为 false,玩家将保持漂浮状态。
amount:决定玩家下沉的速度。数值越接近 0,下沉越慢;数值越高,下沉越快。
-
allow-building-above-water:允许或阻止玩家在水面上方进行建造。此功能仍在开发中,玩家可能轻易绕过此限制。建议在未来更新修复相关 bug 之前暂时保持允许水上建造。
故障排除
- 玩家在深水中没有下沉:请确保
min-water-height 设置正确,并且 downforce 值已正确配置。
- 伤害未生效:请验证配置文件中的
player-damage 设置是否为 true,并且指定了有效的伤害类型(poison 或 drowning)。
- 玩家仍可在上方建造:这是因为插件仅检查放置方块下方的一格是否有水。因此,我建议暂时保持允许水上建造的功能。这将在后续版本中修复,届时我将找到更好的实现方式来进行检测。
贡献
欢迎 fork 本插件并提交拉取请求,如果你希望贡献新功能或修复。我们非常欢迎你的贡献!
许可证
NoSwim 采用 MIT 许可证。有关详细信息,请参阅 LICENSE 文件。
NoSwim
NoSwim is a Minecraft plugin made for event hosts and server administrators. It prevents players from swimming freely, ensuring a more controlled experience during in-game events. This utility is especially useful in scenarios where swimming could give players an unfair advantage or disrupt the flow of an event, such as in obstacle courses, survival challenges, or an island where players are not allowed to go out of.
Features
- Control Player Behavior in Water (All configurable in the config):
- Min Water Height: Prevent swimming in deep water by setting a minimum water depth.
- Player Damage: Option to apply poison or drowning damage when players enter deep water.
- Downforce: Control the sinking speed when players are in deep water.
- Water Breathing Exemption: Exempt players with the Water Breathing effect from sinking.
- Building Restrictions Above Water: Prevent players from building above water areas that are restricted. (Not fully developed yet)
Commands
The plugin supports the following commands:
/noswim enable: Enables the NoSwim plugin's behavior (prevents swimming in deep water).
/noswim disable: Disables the NoSwim plugin's behavior.
/noswim reload: Reloads the plugin configuration from the config.yml.
Permissions
noswim.admin: Allows players to use the /noswim command (for enabling, disabling, and reloading the plugin).
noswim.bypass: Allows players to bypass the sinking mechanic and swim in deep water.
Configuration Options
The config.yml file allows you to customize the plugin's behavior. Below are the available configuration settings:
# NoSwim Configuration File - Version 0.1-BETA-B1
# It is highly recommend to regenerate the config file after downloading a new version.
# To regenerate the config file: delete this config file and restart the server.
# Minimum water height (depth) to activate the sinking effect
min-water-height: 2 # Number
# Exempt players with the Water Breathing effect
water-breath-exemption: true # Options: true, false
# Damage options: poison, drowning, or none
player-damage:
enabled: false # Options: true, false
type: poison # Options: poison, drowning, none
damage-interval: 40 # Ticks (20 ticks = 1 second)
# Sinking effect
downforce:
enabled: true # Toggle sinking effect on/off | Options: true, false
amount: 0.25 # Default sinking speed (0.1 is slower, 0.5 is faster)
# [BETA] Allow building above water
# This feature is still in development and contains bugs,
# players can easily bypass this restriction.
# It is recommended to let players build above water until the bugs are fixed.
allow-building-above-water: true # Options: true, false (Default: true)
Configuration Variables:
-
min-water-height: Defines the minimum height of water required for the sinking effect to be triggered. Players in water less than this height won’t experience the sinking effect.
-
water-breath-exemption: If set to true, players with the Water Breathing effect won’t be affected by the sinking behavior.
-
player-damage:
enabled: Set to true to enable player damage effects (e.g., poisoning or drowning).
type: Determines the type of damage inflicted. Options are poison, drowning, or none.
damage-interval: Defines the interval (in ticks) between each damage application.
-
downforce:
enabled: Controls whether the sinking effect is active. If set to false, the player will float.
amount: Determines the rate at which players sink. Values closer to 0 make players sink slower, and higher values make them sink faster.
-
allow-building-above-water: Allows or blocks players from building above water. This feature is still in development, and players can bypass the restriction. Use with caution until future updates.
Troubleshooting
- Players are not sinking in deep water: Make sure the
min-water-height is set correctly and that the downforce value is configured correctly.
- Damage isn't applied: Verify that the
player-damage setting in the config is set to true and that a valid damage type (poison or drowning) is specified.
- Players can still build above water: This is because the plugin only checks for water one block under the placed block. That's why I recommend to keep building above waters enabled for now. This will be fixed in later versions, when I figure out a good way to implement a check for this.
Contribution
Feel free to fork this plugin and submit pull requests if you'd like to contribute new features or fixes. Contributions are always welcome!
License
NoSwim is licensed under the MIT License. See the LICENSE file for more details.
评论 0
登录后参与评分
还没有评论,来抢沙发吧