GhostBlocks 插件
- 一个 Minecraft 插件,用于创建幽灵方块——即可见但没有碰撞箱的方块。
功能特性
? 核心功能
- 幽灵方块:创建可见但无碰撞/击打箱的方块
- 分类 GUI:具有 4 个类别(建筑、自然、红石、装饰)的组织化方块选择界面
- 分页系统:可在每个类别的多页方块中导航
- 幽灵方块清除器:特殊的工具,通过注视并右键点击来移除幽灵方块
- 自动保存系统:幽灵方块在服务器重启和重载后保持不变
?️ 技术特性
- 使用禁用重力和衰减的下落物实体
- 并发数据结构以确保线程安全操作
- 基于 YAML 的持久化存储
- 基于位置的幽灵方块映射以实现高效查找
- 改进的幽灵方块清除机制,支持视线检测
- 分类且分页的 GUI 系统
- 用于维护和调试的管理员命令
安装
- 下载插件 JAR 文件
- 将其放入服务器的
plugins/目录中 - 重启服务器
- 插件将自动创建
ghostblocks.yml配置文件
荣誉提及
命令
| 命令 | 描述 | 权限 |
|---|---|---|
/ghostblocks |
打开幽灵方块 GUI | ghostblocks.use |
/ghostblocks help |
显示帮助信息 | ghostblocks.use |
/ghostblocks count |
显示幽灵方块数量 | ghostblocks.use |
/ghostblocks manage |
打开幽灵方块管理 GUI | ghostblocks.use |
/ghostblocks remover |
获取幽灵方块清除器工具 | ghostblocks.use |
/ghostblocks reload |
重载插件 | ghostblocks.admin |
/ghostblocks cleanup |
清理无效的幽灵方块 | ghostblocks.admin |
别名: /gb, /ghost
权限
ghostblocks.use- 允许使用插件(默认:true)ghostblocks.admin- 允许管理功能(默认:op)
使用方法
-
获取幽灵方块:
- 使用
/ghostblocks打开分类 GUI - 点击类别按钮(建筑、自然、红石、装饰)以切换类别
- 使用上一页/下一页按钮浏览页面
- 点击任意方块以获取该方块的幽灵方块物品
- 点击“幽灵方块清除器”以获取清除工具
- 使用
-
放置幽灵方块:
- 像普通方块一样放置幽灵方块物品
- 它们会自动变为幽灵方块(可见但无击打箱)
-
移除幽灵方块:
- 手持幽灵方块清除器(棍子)并注视幽灵方块
- 在注视幽灵方块时右键点击即可移除它
- 工具将在你的视线范围内找到幽灵方块
方块类别
?️ 建筑方块
- 石头变体(圆石、石砖等)
- 深板岩变体(深板岩、粗制深板岩等)
- 砂岩变体(砂岩、红砂岩等)
- 黑石变体(黑石、磨光黑石等)
- 海晶石变体及更多
? 自然方块
- 所有木材类型(橡木、云杉木、白桦木、丛林木、金合欢木、深色橡木、红树木、樱花木、竹子)
- 去皮木材变体
- 地面方块(泥土、草方块、灰化土、菌丝体等)
- 冰块(冰、密实冰、蓝冰)
- 天然石头(方解石、凝灰岩、滴水石块)
⚡ 红石方块
- 红石组件(红石块、侦测器、发射器等)
- 所有氧化状态的铜块
- 功能性方块(熔炉、工作台、锻造台等)
- 机械方块(活塞、粘性活塞等)
? 装饰方块
- 所有混凝土颜色和混凝土粉末
- 所有陶瓦颜色和 glazed terracotta(烧制陶瓦)
- 下界方块(下界岩、下界砖等)
- 末地方块(末地石、紫珀块等)
- 珍贵方块(钻石块、金块等)
- 特殊方块(紫水晶、幽匿、远古残骸等)
技术细节
幽灵方块实现
- 幽灵方块通过使用 FallingBlock 实体实现
- 设置的属性:
gravity=false(重力关闭)、dropItem=false(不掉落物品)、hurtEntities=false(不伤害实体) - 定位在方块中心,偏移 0.5 以实现完美对齐
- 通过 YAML 存储在服务器重启后保持持久性
数据存储
- 幽灵方块保存在
plugins/GhostBlocks/ghostblocks.yml中 - 服务器关闭时自动保存
- 服务器启动时自动加载
- 包含世界名称、坐标、材质和唯一 ID
性能考量
- 使用 ConcurrentHashMap 进行线程安全操作
- 基于位置的索引实现 O(1) 复杂度的幽灵方块查找
- 清理系统用于移除无效的幽灵方块
- 对服务器性能影响极小
要求
- Java 17 或更高版本
- Paper 1.20.6 API 或更高版本
配置
插件会在插件目录中自动创建一个 ghostblocks.yml 文件。该文件存储所有幽灵方块数据,不应手动编辑。
故障排除
常见问题
- 幽灵方块未持久化:检查插件是否对插件目录有写入权限
- 幽灵方块显示为普通方块:确保你使用的是 Paper 1.20.4 而非 Bukkit/Spigot
- 无法移除幽灵方块:确保你直接注视着幽灵方块并使用幽灵方块清除器工具
- 构建错误:确保已安装 Java 17+ 和 Maven 3.6+
- GUI 无法打开:检查你是否拥有
ghostblocks.use权限
调试命令
- 使用
/ghostblocks count查看加载了多少个幽灵方块 - 使用
/ghostblocks cleanup移除任何无效的幽灵方块 - 检查服务器控制台是否有错误消息
支持
如有问题、建议或贡献:
- 查看上面的故障排除部分
- 查看服务器控制台中的错误消息
- 创建包含有关问题详细信息的 Issue
许可证
本项目根据 MIT 许可证发布。详细信息请参阅 LICENSE 文件。
版本历史
v1.0.0
- 首次发布
- 幽灵方块核心功能
- 包含 4 个分类(建筑、自然、红石、装饰)的分类 GUI 系统
- 便于导航的分页系统
- 改进了基于视线检测的幽灵方块移除工具
- 自动保存系统
- 管理员命令
- 涵盖所有分类的 200+ 种方块类型
v2.0.0
- GUI 增强:选择方块时 GUI 保持打开状态,提升用户体验
- 玩家现在可以选择多个方块而无需重新打开 GUI
- 其他 GUI 交互(移除工具、导航)照常工作
v3.0.0
- 逻辑修复:幽灵方块不再出现故障或随时间衰减。
- 新自动保存系统:每 10 tick(0.5 秒),插件会自动将所有幽灵方块数据保存到插件文件夹内的专用文件中。
- 方块衰减问题已解决:过去某些方块会无故消失,现已修复。
v3.5.0
- 现有幽灵方块的 GUI 管理。
- 新的 GUI 改进。
- 新增游戏内命令。
- 线程安全的数据结构。
- 新 (APDC) 系统 | 自动玩家数据清理。
v4.0.0
- TPS 优化。
- 多线程系统。
- 新增方块。
v5.0.0
- TPS 优化
- 异步保存
- 细微调整 | GUI
- 新增方块
v6.0.0
- GUI 增强
- 新增方块
- 支持 RGB 颜色(Minimessage API)
- 修复了以下错误:
- 玻璃方块不可用
- 损坏的幽灵方块随机消失
- 管理器 GUI 无法从自身界面中移除方块
GhostBlocks Plugin
- A Minecraft plugin that creates ghost blocks - blocks that are visible but doesn't have a hitbox.
Features
? Core Functionality
- Ghost Blocks: Create blocks that are visible but have no collision/hitbox
- Categorized GUI: Organized block selection with 4 categories (Building, Nature, Redstone, Decoration)
- Pagination System: Navigate through multiple pages of blocks in each category
- Ghost Block Remover: Special tool to remove ghost blocks by looking at them and right-clicking
- Auto-Save System: Ghost blocks persist across server restarts and reloads
?️ Technical Features
- Uses FallingBlock entities with disabled gravity and decay
- Concurrent data structures for thread-safe operations
- YAML-based persistence storage
- Location-based ghost block mapping for efficient lookups
- Improved ghost block removal with line-of-sight detection
- Categorized and paginated GUI system
- Admin commands for maintenance and debugging
Installation
- Download the plugin JAR file
- Place it in your server's
plugins/directory - Restart your server
- The plugin will create a
ghostblocks.ymlconfiguration file automatically
Honorable Mention
Commands
| Command | Description | Permission |
|---|---|---|
/ghostblocks |
Open the ghost blocks GUI | ghostblocks.use |
/ghostblocks help |
Show help information | ghostblocks.use |
/ghostblocks count |
Show number of ghost blocks | ghostblocks.use |
/ghostblocks manage |
Open the ghost block management GUI | ghostblocks.use |
/ghostblocks remover |
Get the ghost block remover tool | ghostblocks.use |
/ghostblocks reload |
Reload the plugin | ghostblocks.admin |
/ghostblocks cleanup |
Clean up invalid ghost blocks | ghostblocks.admin |
Aliases: /gb, /ghost
Permissions
ghostblocks.use- Allows using the plugin (default: true)ghostblocks.admin- Allows administrative functions (default: op)
How to Use
-
Getting Ghost Blocks:
- Use
/ghostblocksto open the categorized GUI - Click on category buttons (Building, Nature, Redstone, Decoration) to switch categories
- Use Previous/Next Page buttons to navigate through pages
- Click on any block to get it as a ghost block item
- Click on the "Ghost Block Remover" to get the removal tool
- Use
-
Placing Ghost Blocks:
- Place ghost block items like normal blocks
- They will automatically become ghost blocks (visible but no hitbox)
-
Removing Ghost Blocks:
- Hold the Ghost Block Remover (stick) and look at a ghost block
- Right-click while looking at the ghost block to remove it
- The tool will find ghost blocks within your line of sight
Block Categories
?️ Building Blocks
- Stone variants (Stone, Cobblestone, Stone Bricks, etc.)
- Deepslate variants (Deepslate, Cobbled Deepslate, etc.)
- Sandstone variants (Sandstone, Red Sandstone, etc.)
- Blackstone variants (Blackstone, Polished Blackstone, etc.)
- Prismarine variants and more
? Nature Blocks
- All wood types (Oak, Spruce, Birch, Jungle, Acacia, Dark Oak, Mangrove, Cherry, Bamboo)
- Stripped wood variants
- Ground blocks (Dirt, Grass, Podzol, Mycelium, etc.)
- Ice blocks (Ice, Packed Ice, Blue Ice)
- Natural stone (Calcite, Tuff, Dripstone Block)
⚡ Redstone Blocks
- Redstone components (Redstone Block, Observer, Dispenser, etc.)
- Copper blocks in all oxidation states
- Functional blocks (Furnace, Crafting Table, Smithing Table, etc.)
- Mechanical blocks (Piston, Sticky Piston, etc.)
? Decoration Blocks
- All concrete colors and concrete powder
- All terracotta colors and glazed terracotta
- Nether blocks (Netherrack, Nether Bricks, etc.)
- End blocks (End Stone, Purpur Block, etc.)
- Precious blocks (Diamond Block, Gold Block, etc.)
- Special blocks (Amethyst, Sculk, Ancient Debris, etc.)
Technical Details
Ghost Block Implementation
- Ghost blocks are implemented using FallingBlock entities
- Properties set:
gravity=false,dropItem=false,hurtEntities=false - Positioned at block center with 0.5 offset for perfect alignment
- Persistent across server restarts via YAML storage
Data Storage
- Ghost blocks are saved to
plugins/GhostBlocks/ghostblocks.yml - Automatic save on server shutdown
- Automatic load on server startup
- Includes world name, coordinates, material, and unique ID
Performance Considerations
- Uses ConcurrentHashMap for thread-safe operations
- Location-based indexing for O(1) ghost block lookups
- Cleanup system to remove invalid ghost blocks
- Minimal impact on server performance
Requirements
- Java 17 or higher
- Paper 1.20.6 API or higher
Configuration
The plugin automatically creates a ghostblocks.yml file in the plugin directory. This file stores all ghost block data and should not be manually edited.
Troubleshooting
Common Issues
- Ghost blocks not persisting: Check that the plugin has write permissions to the plugin directory
- Ghost blocks appearing as normal blocks: Ensure you're using Paper 1.20.4 and not Bukkit/Spigot
- Can't remove ghost blocks: Make sure you're looking directly at the ghost block and using the Ghost Block Remover tool
- Build errors: Ensure you have Java 17+ and Maven 3.6+ installed
- GUI not opening: Check that you have the
ghostblocks.usepermission
Debug Commands
- Use
/ghostblocks countto see how many ghost blocks are loaded - Use
/ghostblocks cleanupto remove any invalid ghost blocks - Check the server console for any error messages
Support
For issues, suggestions, or contributions:
- Check the troubleshooting section above
- Review the server console for error messages
- Create an issue with detailed information about the problem
License
This project is released under the MIT License. See the LICENSE file for details.
Version History
v1.0.0
- Initial release
- Core ghost block functionality
- Categorized GUI system with 4 categories (Building, Nature, Redstone, Decoration)
- Pagination system for easy navigation
- Improved ghost block remover with line-of-sight detection
- Auto-save system
- Admin commands
- 200+ block types across all categories
v2.0.0
- GUI Enhancement: GUI now stays open when selecting blocks for improved user experience
- Players can now select multiple blocks without reopening the GUI
- Other GUI interactions (remover tool, navigation) work as before
v3.0.0
- Logic Fix: Ghostblocks no longer glitches or decay over time.
- New Auto-Save system: now, every 10ticks (0.5s) the plugin automatically saves all ghostblocks data into a dedicated file inside the plugin folder.
- Block decay resolved: over time, some blocks vanished for nothing, now it's fixed.
v3.5.0
- GUI management for existed ghostblocks.
- New GUI Improvement.
- New Commands in-game.
- Thread-safe data structures.
- New (APDC) System | Auto Player Data Cleanup.
v4.0.0
- TPS Optimization.
- Multi-Thread System.
- New Blocks addition.
v5.0.0
- TPS Optimization
- Async Saving
- Tiny adjusments | GUI
- New Blocks added
v6.0.0
- GUI Enhancements
- New Blocks added
- RGB Color supported (Minimessage API)
- Bugs fixed:
- Glass Blocks unavailable
- Corrumpted GhostBlocks vanishing randomly
- Manager GUI couldn't remove blocks from the GUI itself
下载 GhostBlocks Remastered
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 GhostBlocks Remastered
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 GhostBlocks Remastered
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 GhostBlocks Remastered
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 GhostBlocks Remastered
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 GhostBlocks Remastered
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 GhostBlocks Remastered
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
v6.0.0
- 用户界面增强
- 新增方块
- 支持 RGB 颜色(通过 Minimessage API)
- 修复的 Bug:
- 玻璃方块不可用
- 损坏的 GhostBlocks 随机消失
- 管理界面的 GUI 无法从自身移除方块
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
自定义你的Minecraft头像!
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
评论 0
登录后参与评分
还没有评论,来抢沙发吧