DisableInteraction
PluginMIT

DisableInteraction

Disable specified block interactions through whitelist and blacklist.

23
Downloads
0
Followers
3 months ago
Updated
📦
1
Versions

📖About DisableInteraction

DisableInteraction Plugin / 禁用交互插件

Minecraft Version Paper API License

A Minecraft Paper plugin for disabling right-click interactions with specific blocks.
一个用于禁用特定方块右键交互的Minecraft Paper插件。


Features / 功能特性

Configuration System / 配置系统

  • Whitelist/Blacklist modes - Switch between allowing only listed blocks or blocking listed blocks
    白名单/黑名单模式 - 切换仅允许列表中方块或阻止列表中方块
  • Customizable messages - Set custom notification messages with color codes
    可自定义消息 - 使用颜色代码设置自定义提示消息
  • Message toggle - Enable/disable notification messages completely
    消息开关 - 完全启用/禁用提示消息
  • Dynamic block list - Manage block list through commands, no config editing required
    动态方块列表 - 通过命令管理方块列表,无需编辑配置文件

Command System / 命令系统

  • Complete command set for managing block interactions
    完整的管理方块交互命令集
  • Tab completion support for block IDs and commands
    支持方块ID和命令的Tab补全
  • Handheld block detection when no block ID specified
    未指定方块ID时检测手持方块

Permission System / 权限系统

  • Admin permissions for managing the plugin
    用于管理插件的管理员权限
  • Bypass permission to ignore interaction restrictions
    绕过交互限制的权限

Installation / 安装

Requirements / 要求

  • Minecraft Server 1.21+
    Minecraft服务器 1.21+
  • Paper/Spigot API 1.21.11+
    Paper/Spigot API 1.21.11+

Steps / 步骤

  1. Download the latest DisableInteraction-1.0-SNAPSHOT.jar from the build/libs folder
    build/libs 文件夹下载最新的 DisableInteraction-1.0-SNAPSHOT.jar
  2. Place the JAR file in your server's plugins folder
    将JAR文件放入服务器的 plugins 文件夹
  3. Restart or reload your server (/reload or /plugman reload DisableInteraction)
    重启或重载服务器(/reload/plugman reload DisableInteraction
  4. The plugin will generate a default configuration file at plugins/DisableInteraction/config.yml
    插件将在 plugins/DisableInteraction/config.yml 生成默认配置文件

Configuration / 配置

Default Configuration File / 默认配置文件

# DisableInteraction Plugin Configuration File
# DisableInteraction 插件配置文件

# Mode settings: "whitelist" or "blacklist" (default: blacklist)
# 模式设置:"whitelist" 或 "blacklist"(默认:blacklist)
mode: "blacklist"

# Message settings (supports color codes using & symbol)
# 消息设置(支持使用&符号的颜色代码)
messages:
  # Enable/disable notification messages (true/false)
  # 启用/禁用提示消息(true/false)
  enabled: true
  
  # Message for blacklist mode
  # 黑名单模式下的提示消息
  blacklist: "&c这个方块已被禁用交互。"
  
  # Message for whitelist mode
  # 白名单模式下的提示消息
  whitelist: "&c只有白名单中的方块可以交互。"

# Block list (Block IDs in uppercase, e.g., OAK_DOOR, STONE_BUTTON, CHEST)
# 方块列表(大写方块ID,例如:OAK_DOOR, STONE_BUTTON, CHEST)
# Blacklist mode: Blocks in this list cannot be interacted with
# Whitelist mode: Only blocks in this list can be interacted with
# Note: Default list is empty, add blocks using commands
# 黑名单模式:列表中的方块无法交互
# 白名单模式:只有列表中的方块可以交互
# 注意:默认列表为空,使用命令添加方块
blocks: []

Configuration Reload / 配置重载

Use /disableinteraction reload to reload the configuration without restarting the server.
使用 /disableinteraction reload 重载配置而无需重启服务器。


Commands / 命令

Main Command / 主命令

/disableinteraction [subcommand]

Subcommands / 子命令

Mode Management / 模式管理

Command / 命令 Description / 描述 Permission / 权限
/disableinteraction whitelist Switch to whitelist mode (only listed blocks can be interacted with)
切换到白名单模式(只有列表中的方块可以交互)
disableinteraction.admin
/disableinteraction blacklist Switch to blacklist mode (listed blocks cannot be interacted with)
切换到黑名单模式(列表中的方块无法交互)
disableinteraction.admin

Block Management / 方块管理

Command / 命令 Description / 描述 Permission / 权限
/disableinteraction add [blockID] Add a block to the list (uses held block if no ID specified)
添加方块到列表(未指定ID时使用手持方块)
disableinteraction.admin
/disableinteraction remove [blockID] Remove a block from the list (uses held block if no ID specified)
从列表移除方块(未指定ID时使用手持方块)
disableinteraction.admin
/disableinteraction list [page] View the current block list with pagination
查看当前方块列表(分页显示)
disableinteraction.admin

Utility Commands / 实用命令

Command / 命令 Description / 描述 Permission / 权限
/disableinteraction reload Reload the configuration file
重新加载配置文件
disableinteraction.admin
/disableinteraction (no args) Show command help
显示命令帮助
None

Examples / 示例

# Add blocks to the list
# 添加方块到列表
/disableinteraction add OAK_DOOR
/disableinteraction add CHEST
/disableinteraction add  # Uses held block

# Remove blocks from the list
# 从列表移除方块
/disableinteraction remove STONE_BUTTON

# View block list
# 查看方块列表
/disableinteraction list
/disableinteraction list 2  # Page 2

# Switch modes
# 切换模式
/disableinteraction whitelist
/disableinteraction blacklist

# Reload configuration
# 重新加载配置
/disableinteraction reload

Permissions / 权限

Permission Node / 权限节点 Description / 描述 Default / 默认
disableinteraction.admin Allows use of all management commands
允许使用所有管理命令
op
disableinteraction.bypass Allows bypassing interaction restrictions
允许绕过交互限制
op

Permission Examples / 权限示例

# Give a player admin permissions
# 给予玩家管理员权限
/luckperms user <player> permission set disableinteraction.admin true

# Give a player bypass permissions
# 给予玩家绕过权限
/luckperms user <player> permission set disableinteraction.bypass true

# Give a group admin permissions
# 给予组管理员权限
/luckperms group <group> permission set disableinteraction.admin true

How It Works / 工作原理

Interaction Logic / 交互逻辑

  1. Blacklist Mode / 黑名单模式:

    • Blocks in the list: ❌ Interaction blocked
    • Blocks not in the list: ✅ Interaction allowed
    • 列表中的方块:❌ 交互被阻止
    • 不在列表中的方块:✅ 交互允许
  2. Whitelist Mode / 白名单模式:

    • Blocks in the list: ✅ Interaction allowed
    • Blocks not in the list: ❌ Interaction blocked
    • 列表中的方块:✅ 交互允许
    • 不在列表中的方块:❌ 交互被阻止

Message System / 消息系统

  • When messages.enabled: true: Players receive configured messages when interaction is blocked
    messages.enabled: true:交互被阻止时玩家收到配置的消息
  • When messages.enabled: false: Interaction is silently blocked without messages
    messages.enabled: false:交互被静默阻止,不显示消息
  • Messages support Minecraft color codes using & symbol (e.g., &c for red, &a for green)
    消息支持使用 & 符号的Minecraft颜色代码(例如:&c 红色,&a 绿色)

Bypass Permission / 绕过权限

Players with disableinteraction.bypass permission can interact with all blocks regardless of configuration.
拥有 disableinteraction.bypass 权限的玩家可以无视配置与所有方块交互。


Development / 开发

Building from Source / 从源码构建

# Clone the repository
# 克隆仓库
git clone <repository-url>
cd DisableInteraction

# Build the plugin
# 构建插件
./gradlew build

# The JAR file will be in build/libs/
# JAR文件将在 build/libs/ 目录中

Project Structure / 项目结构

src/main/java/com/lorshancraft/disableInteraction/
├── DisableInteraction.java      # Main plugin class / 主插件类
├── ConfigManager.java           # Configuration management / 配置管理
├── InteractionListener.java     # Event listener for interactions / 交互事件监听器
└── CommandHandler.java          # Command implementation / 命令实现

src/main/resources/
├── plugin.yml                   # Plugin metadata / 插件元数据
└── config.yml                   # Default configuration / 默认配置

Dependencies / 依赖

  • Paper API 1.21.11-R0.1-SNAPSHOT
  • Java 21+

Troubleshooting / 故障排除

Common Issues / 常见问题

Issue / 问题 Solution / 解决方案
Plugin doesn't load / 插件未加载 Check server logs for errors, ensure you're using Paper 1.21+
检查服务器日志中的错误,确保使用 Paper 1.21+
Commands don't work / 命令不工作 Check permission nodes, ensure command is registered in plugin.yml
检查权限节点,确保命令在plugin.yml中注册
Configuration doesn't apply / 配置不生效 Use /disableinteraction reload or restart server
使用 /disableinteraction reload 或重启服务器
Invalid block IDs / 无效的方块ID Use correct Material enum names (e.g., OAK_DOOR, STONE_BUTTON)
使用正确的Material枚举名称(例如:OAK_DOOR, STONE_BUTTON
No notification messages / 没有提示消息 Check messages.enabled in config.yml
检查config.yml中的 messages.enabled

Debugging / 调试

Enable debug mode in server logs:
在服务器日志中启用调试模式:

# In server.properties or paper-world-defaults.yml
# 在 server.properties 或 paper-world-defaults.yml 中
debug: true

Check plugin logs after loading:
加载后检查插件日志:

# The plugin logs its status on startup
# 插件在启动时会记录其状态
[DisableInteraction] Plugin enabled
[DisableInteraction] Current mode: blacklist
[DisableInteraction] Loaded blocks: 5

Changelog / 更新日志

v1.0-SNAPSHOT

  • Initial release with whitelist/blacklist modes
    初始版本,包含白名单/黑名单模式
  • Dynamic block management through commands
    通过命令动态管理方块
  • Customizable messages with toggle
    可自定义消息及开关
  • Complete permission system
    完整的权限系统
  • Tab completion for commands and block IDs
    命令和方块ID的Tab补全

License / 许可证

This project is licensed under the MIT License - see the LICENSE file for details.
本项目基于 MIT 许可证 - 详见 LICENSE 文件。


Support / 支持

For issues, feature requests, or questions:
问题、功能请求或疑问:

  1. Check the GitHub Issues
    查看 GitHub Issues
  2. Join our Discord server
    加入我们的Discord服务器
  3. Contact the developer directly
    直接联系开发者

Credits / 致谢

  • Developed by LorShanCraft Development Team
    由 LorShanCraft 开发团队开发
  • Built with Paper API
    基于 Paper API 构建
  • Inspired by community needs for block interaction management
    受社区对方块交互管理需求的启发

Last Updated: 2026-03-16
最后更新:2026年3月16日