ItemFrameController
一个适用于 Minecraft 1.16 - 26.3 的 Paper、Spigot 和 Bukkit 插件,用于控制选定世界中的物品展示框交互。它阻止玩家旋转、放置物品、破坏物品展示框,以及阻止非创造模式玩家放置新的物品展示框。同时也会阻止实体破坏物品展示框。
简介
ItemFrameController 为服务器管理员提供了对特定世界中物品展示框的精细控制权。它非常适合用于保护博物馆建筑、冒险地图、自定义枢纽或任何需要保持物品展示框状态固定的区域。
该插件仅在 restricted-worlds 列出的世界中生效。在这些世界中,非创造模式玩家无法旋转物品展示框、向其中放置物品、破坏它们或放置新的物品展示框。实体也无法损坏物品展示框。创造模式玩家不受所有限制,因此建造者仍可正常工作。
本插件没有命令也没有权限节点。安装后,插件会监听物品展示框相关事件并自动应用配置规则。每个被阻止的操作都可以向玩家发送一条可配置的消息。
功能
- 当非创造模式玩家在受限世界中潜行并右键点击物品展示框时,阻止其旋转。
- 当非创造模式玩家在未潜行的情况下右键点击时,阻止其向物品展示框中放置物品。
- 阻止非创造模式玩家破坏物品展示框。消息通过
messages.knocking-by-player 进行配置。
- 阻止实体损坏物品展示框。如果是由玩家导致的伤害,他们将收到
messages.knocking-by-entity 消息。
- 阻止非创造模式玩家在受限世界中放置新的物品展示框。消息设置在
messages.placing-frames 中。
- 所有规则仅应用于
restricted-worlds 中列出的世界。其他世界不受影响。
- 为每个被阻止的操作发送可配置的消息。消息以纯文本形式发送,因此请使用
§ 来表示颜色代码。
- 无外部依赖。
安装
- 下载 ItemFrameController
1.0.0 JAR 文件。
- 将 JAR 文件放入服务器的
plugins 文件夹中。
- 重启服务器或使用插件管理器加载该插件。
- 编辑
plugins/ItemFrameControllerPlugin/config.yml 以匹配你的服务器设置。
无需额外设置。该插件不定义命令或权限,因此在服务器加载后即可立即生效。
用法
该插件没有命令。安装后,它将自动强制执行配置的规则。
受限世界中的非创造模式玩家无法旋转物品展示框、向其放置物品、破坏它们或放置新框架。实体无法损坏物品展示框。创造模式玩家绕过所有限制。要更改受保护的世界,请编辑 config.yml 中的 restricted-worlds。
配置
插件会生成 plugins/ItemFrameControllerPlugin/config.yml。默认文件包含以下内容:
restricted-worlds:
- world
- custom_world
prevent-rotation: true
prevent-placing-items: true
prevent-knocking-by-player: true
prevent-knocking-by-entity: true
prevent-placing-frames: true
messages:
rotation: "§cYou cannot rotate item frames in this world!"
placing-items: "§cYou cannot place items into item frames here!"
knocking-by-player: "§cYou cannot break item frames here!"
knocking-by-entity: "§cEntities cannot destroy item frames here!"
placing-frames: "§cYou cannot place item frames in this world!"
restricted-worlds 列出了插件应用限制的世界名称。世界名称区分大小写,必须与服务器世界文件夹名称匹配。prevent-rotation 阻止潜行玩家旋转物品展示框。prevent-placing-items 阻止向物品展示框中放置物品。prevent-knocking-by-player 阻止玩家破坏物品展示框。prevent-knocking-by-entity 阻止实体损坏物品展示框。prevent-placing-frames 阻止放置新的物品展示框。
messages 部分定义了操作被阻止时发送的文本。消息按原样发送,因此请使用 § 后跟颜色代码进行格式化。可以将任何消息设置为空字符串以不发送任何内容,尽管该操作仍会被取消。
兼容性
- Minecraft: 1.16 - 26.3
- Platform: Paper, Spigot, Bukkit
- Java: 服务器平台支持的任何版本;不需要特定的 Java 版本
已知与其他插件或库没有不兼容问题。
技术栈
- 语言:Java
- 平台 API:Bukkit, Spigot, Paper
- 构建:标准插件 JAR
- 关键依赖:无
许可证
本项目根据 GNU General Public License v3.0 分发。
ItemFrameController
A Paper, Spigot, and Bukkit plugin for Minecraft 1.16 - 26.3 that controls item frame interactions in selected worlds. It blocks rotation, item placement, breaking by players, breaking by entities, and frame placement for non-creative players.
What is it
ItemFrameController gives server administrators fine-grained control over item frames in specific worlds. It is useful for protecting museum builds, adventure maps, custom hubs, or any area where item frames must stay in a fixed state.
The plugin works only in worlds listed in restricted-worlds. In those worlds, non-creative players cannot rotate item frames, place items into them, break them, or place new frames. Entities also cannot damage item frames. Creative players bypass all restrictions, so builders can still work normally.
There are no commands and no permission nodes. After installation, the plugin listens to item frame events and applies the configured rules automatically. Every blocked action can send a configurable message to the player.
Features
- Blocks item frame rotation when a non-creative player sneaks and right-clicks a frame in a restricted world.
- Blocks placing items into item frames when a non-creative player right-clicks without sneaking.
- Blocks non-creative players from breaking item frames. The message is configurable through
messages.knocking-by-player.
- Blocks entities from damaging item frames. If a player causes the damage, they receive
messages.knocking-by-entity.
- Blocks placing new item frames in restricted worlds for non-creative players. The message is set in
messages.placing-frames.
- Applies all rules only to worlds listed in
restricted-worlds. Other worlds remain unaffected.
- Sends configurable messages for each blocked action. Messages are sent as plain text, so use
§ for color codes.
- Has no external dependencies.
Installation
- Download the ItemFrameController
1.0.0 JAR.
- Place the JAR in your server's
plugins folder.
- Restart the server or load the plugin with a plugin manager.
- Edit
plugins/ItemFrameControllerPlugin/config.yml to match your server.
No additional setup is required. The plugin does not define commands or permissions, so it works immediately after the server loads it.
Usage
The plugin has no commands. After installation, it enforces the configured rules automatically.
Non-creative players in restricted worlds cannot rotate item frames, place items into them, break them, or place new frames. Entities cannot damage item frames. Creative players bypass all restrictions. To change which worlds are protected, edit restricted-worlds in config.yml.
Configuration
The plugin generates plugins/ItemFrameControllerPlugin/config.yml. The default file contains:
restricted-worlds:
- world
- custom_world
prevent-rotation: true
prevent-placing-items: true
prevent-knocking-by-player: true
prevent-knocking-by-entity: true
prevent-placing-frames: true
messages:
rotation: "§cYou cannot rotate item frames in this world!"
placing-items: "§cYou cannot place items into item frames here!"
knocking-by-player: "§cYou cannot break item frames here!"
knocking-by-entity: "§cEntities cannot destroy item frames here!"
placing-frames: "§cYou cannot place item frames in this world!"
restricted-worlds lists world names where the plugin applies restrictions. World names are case-sensitive and must match the server's world folder names. prevent-rotation blocks sneaking players from rotating item frames. prevent-placing-items blocks placing items into item frames. prevent-knocking-by-player blocks players from breaking item frames. prevent-knocking-by-entity blocks entities from damaging item frames. prevent-placing-frames blocks placing new item frames.
The messages section defines the text sent when an action is blocked. Messages are sent as-is, so use § followed by a color code for formatting. Set any message to an empty string to send nothing, though the action is still cancelled.
Compatibility
- Minecraft: 1.16 - 26.3
- Platform: Paper, Spigot, Bukkit
- Java: any version supported by the server platform; no specific Java version is required
No known incompatibilities with other plugins or libraries.
Technologies
- Language: Java
- Platform API: Bukkit, Spigot, Paper
- Build: standard plugin JAR
- Key dependencies: none
License
This project is distributed under the GNU General Public License v3.0.
评论 0
登录后参与评分
还没有评论,来抢沙发吧