Light Plus
一款简单插件,为生存模式下的光源方块添加功能
功能
生存模式下的光源方块
- 允许在生存/冒险模式中放置、破坏和拾取光源方块,而不仅限于创造模式。
- 光源等级(0-15)会保存在掉落物或手持物品上,并在放置时恢复。
- 可选自定义物品名称 + 描述,显示当前等级(
config.yml 中的 item: 配置项,使用 MiniMessage 格式,支持 %level% 占位符)。
调整已放置的光源(手持光源物品时)
- 右键点击光源方块:将其等级提高 1 级(超过最大值后会回绕至 0)。
- 潜行并滚动鼠标滚轮注视光源方块:按顺序逐级调高或调低等级(到达 0 或最大值时停止,不会回绕)。
- Shift+右键点击光源方块:在其旁边放置一个同等级的新光源方块。
- 左键点击你正注视的光源方块:可靠地破坏它,即使处于隐身状态也可正常破坏。
- 在创造模式下中键点击(快速选取)光源:获取与该方块等级完全一致的光源物品。
- 上述每种操作均可在
config.yml 的 actions: 部分单独关闭,关闭后将回退到原版行为。
等级限制
- 通过
lightplus.maxlevel.<0-15> 权限节点限制玩家可设置的最高等级(以持有最高权限为准),或者为没有相应权限节点的玩家设置服务器全局上限 limits.default_max_level。
limits.world_max_levels.<world> 可对每个世界分别设置上限;实际生效的限制取两者中较低值。
lightplus.maxlevel.bypass 权限可忽略所有限制。
可选的衰减机制
decay.enabled 使玩家放置的光源方块在 decay.after_seconds 秒后消失——提供无需清理的临时探索照明。
- 待处理的光源会持久化到
decay-data.yml(通过 decay.persist),因此重启后它们仍会继续衰减。
lightplus.decay.exempt 用于放置永久光源。
管理员命令
/lightplus give <player> [level] [amount] 发放带有等级属性的光源物品(支持 Tab 键自动补全)。
反馈
-
设置或更改等级时显示在操作栏的消息(Set to %level% level,可配置)。
-
可配置的渐变聊天前缀(messages.prefix,MiniMessage)自动添加到每条消息;支持使用 %prefix% 令牌手动放置。
-
按语言区分的消息:启用 messages.follow_client_locale 后,玩家会看到来自 messages.locales.<其客户端语言> 的字符串(附带一个 zh_tw 示例),并回退到英文默认值。
-
手持光源物品时,在附近的光源方块周围显示标记粒子效果。
-
可配置的放置、破坏和重新整平音效——支持按键、音量、音调、单个音效静音以及总开关。升级音效的音调会随亮度升高而升高。
合成表
- 所有 16 个光照等级的切石机合成表;输出始终与所选等级匹配。
- 可配置的光源方块形状合成表(自定义形状、材料和结果等级,位于
config.yml)。
- 单独合成光源物品会将其重置为 15 级。
- 玩家加入服务器或执行
/lightplus reload 命令时自动解锁合成表(可配置),并强制执行 lightplus.recipe 权限。
集成
- 土地保护:在玩家无法建造的领地/区域中,放置、移除和调整光块的权限被拦截——支持 WorldGuard、GriefPrevention、GriefDefender、Residence、Towny、Lands、PlotSquared、BentoBox(通过
land_protection.enabled 切换开关)。
- Folia 支持:粒子预览和配方解锁运行在正确的区域/实体调度器上。
- faststats 指标,包括
lights_placed 和 lights_mined。
- Modrinth 启动时检查更新——记录到控制台并在加入时通知持有
lightplus.update 权限的玩家(位于 config.yml 中的 update_check: 配置项,默认为开启的单次切换开关)。
占位符(需要 PlaceholderAPI)
%lightplus_version%、%lightplus_lights_placed%、%lightplus_lights_mined%
%lightplus_update_available%、%lightplus_latest_version%
%lightplus_max_level%、%lightplus_holding_light%、%lightplus_held_level%(玩家)
控制
土地保护
LightPlus 尊重所有涉及光块操作的领地/区域保护插件。
放置和破坏操作已经通过标准的 Bukkit 事件进行,交互路径(等级旋转、Shift 放置、左键移除)会通过模拟的破坏/放置事件进行检查,因此任何取消 BlockBreakEvent / BlockPlaceEvent 事件的插件均可支持:
| 插件 |
检查的权限 |
| WorldGuard |
build 标志 / 区域成员资格 |
| GriefPrevention |
领地建造信任度 |
| GriefDefender |
block-place / block-break 标志 |
| Residence |
build / destroy / place 标志 |
| Towny |
地块的建造/破坏权限 |
| Lands |
BLOCK_PLACE / BLOCK_BREAK 角色 |
| PlotSquared |
地块建造权限 |
| BentoBox (BSkyBlock, AcidIsland, OneBlock, …) |
岛屿的 PLACE_BLOCKS / BREAK_BLOCKS |
其他任何取消 BlockBreakEvent / BlockPlaceEvent 的插件 |
其自身规则 |
设置 land_protection.enabled: false 可禁用这些检查。
WorldGuard 区域标志 —— LightPlus 还注册了一个名为 lightplus-use 的 StateFlag(默认 allow)。执行 /rg flag <region> lightplus-use deny 将阻止该区域内所有的光块操作,无论是否有建造权限,且独立于上述切换开关。需要重启服务器以注册(不支持 /reload)。
音效
每个 LightPlus 音效均在 config.yml 的 sounds 部分定义为 { sound, volume, pitch } 块:
| 条目 |
播放时机 |
place |
将光块放置在另一个光块旁边(Shift+右键) |
break |
破坏/移除光块 |
level_change |
使用右键提升等级(音调随亮度升高) |
level_off |
等级从 15 循环回 0 时 |
sound 接受小写点号分隔的键(如 block.lever.click)、命名空间键或自定义资源包音效。sounds.enabled: false 静音所有音效;空的 sound: "" 仅静音该项。设置会在执行 /lightplus reload 后生效。
占位符
安装 PlaceholderAPI 后,LightPlus 会注册 lightplus 扩展:
| 占位符 |
值 |
%lightplus_version% |
正在运行的插件版本 |
%lightplus_lights_placed% |
自上次启动以来放置的光源块数量(全服统计) |
%lightplus_lights_mined% |
自上次启动以来开采的光源块数量(全服统计) |
%lightplus_update_available% |
true / false |
%lightplus_latest_version% |
Modrinth 上的最新版本(未检查前为空) |
%lightplus_pending_decay% |
当前等待衰减的光源块数量 |
%lightplus_max_level% |
玩家在其世界中可设置的最大等级 |
%lightplus_holding_light% |
true / false |
%lightplus_held_level% |
手中光源物品的等级,若无则为空 |
配置文件
grant_recipes_on_login: true
update_check:
enabled: true
notify_on_join: true
item:
custom_name: true
name: "<gold>Light Block <dark_gray>(<yellow>Level %level%<dark_gray>)"
lore:
- "<gray>右键点击已放置的光源块以提升其等级。"
actions:
adjust_level: true # 右键点击以循环切换等级
place_adjacent: true # Shift+右键点击以在相邻位置放置光源
left_click_break: true # 左键点击注视的光源块以破坏它
pick_block: true # 创造模式下中键点击光源块以获取对应物品
scroll_level: true # 潜行状态下滚动鼠标滚轮以微调等级
limits:
default_max_level: 15 # 没有 lightplus.maxlevel.<n> 权限节点的玩家的等级上限
world_max_levels: {} # 例如 { world_nether: 7 }
decay:
enabled: false # 一段时间后移除玩家放置的光源块
after_seconds: 120
persist: true # 通过 decay-data.yml 在重启后保留数据
land_protection:
enabled: true
sounds:
enabled: true
place: { sound: block.stone.place, volume: 1.0, pitch: 0.8 }
break: { sound: block.stone.break, volume: 1.0, pitch: 0.8 }
level_change: { sound: block.lever.click, volume: 0.8, pitch: 1.8 }
level_off: { sound: block.lever.click, volume: 0.8, pitch: 0.6 }
crafting_recipe:
enabled: true
result_level: 15
items:
A: GLASS
B: GLOWSTONE
recipe:
- 'AAA'
- 'ABA'
- 'AAA'
messages:
prefix: "<gradient:#FDC830:#F37335><bold>LightPlus</bold></gradient> <dark_gray>»</dark_gray> "
action_bar_level_set: "<green>设置为 <yellow>%level%</yellow> 等级"
command_usage: "<red>用法: /lightplus reload | /lightplus give (玩家) [等级] [数量]"
command_no_permission: "<red>你没有权限使用此命令。"
command_reloaded: "<green>LightPlus 配置已重载。"
give_success: "<green>向 <yellow>%player%</yellow> 发放了 <yellow>%amount%</yellow>x 个光源(等级 <yellow>%level%</yellow>)。"
give_received: "<green>你收到了 <yellow>%amount%</yellow>x 个光源(等级 <yellow>%level%</yellow>)。"
player_not_found: "<red>未找到玩家 '%player%'。"
invalid_number: "<red>'%value%' 不是有效的数字。"
生成的 config.yml 包含详细的注释,解释每个选项的作用。
命令
| 命令 |
描述 |
用法 |
权限 |
| /lightplus help |
交互式命令列表(无参数时也会显示)。 |
/lightplus help |
— |
| /lightplus version |
显示版本、服务器信息、Folia 支持情况及检测到的领地保护插件。 |
/lightplus version |
— |
| /lightplus reload |
重载 config.yml。 |
/lightplus reload |
lightplus.reload |
| /lightplus give |
给玩家发放带等级的光源物品。 |
/lightplus give <player> [等级 0-15] [数量 1-64] |
lightplus.give |
别名:/lp。help 和 version 始终可用;子命令仅列出你拥有权限的部分。
权限
| 权限 |
描述 |
默认值 |
| lightplus.use |
LightPlus 所有功能的基础权限。 |
true |
| lightplus.place |
放置存储等级的光源块以及 Shift+右键相邻放置。 |
op |
| lightplus.break |
在生存/冒险模式中破坏光源块(包括左键移除)并收回物品。 |
true |
| lightplus.adjust |
右键点击以循环切换已放置光源块的等级。 |
true |
| lightplus.recipe |
使用并自动获得 LightPlus 的合成配方。 |
op |
| lightplus.reload |
执行 /lightplus reload。 |
op |
| lightplus.give |
执行 /lightplus give。 |
op |
| lightplus.update |
加入服务器时收到“有新版本可用”的通知。 |
op |
| lightplus.decay.exempt |
该玩家放置的光源块永不衰减。 |
op |
| lightplus.maxlevel.<0-15> |
玩家可设置的最高等级;持有的最高节点生效。 |
— |
| lightplus.maxlevel.bypass |
忽略所有光源等级上限。 |
op |

Light Plus
A Simple Plugin that Adds Functions to Light Blocks in Survival
Functions
Light blocks in survival
- Place, break and pick up light blocks in survival/adventure, not just creative.
- The light level (0-15) is stored on the dropped/held item and restored when placed.
- Optional custom item name + lore showing the level (
item: in config.yml, MiniMessage, %level% token).
Adjusting placed lights (hold a light item)
- Right-click a light block: raise its level by 1 (wraps back to 0 past the max).
- Sneak + scroll while looking at a light block: step the level up/down one at a time (stops at 0 and the max, no wrap).
- Shift-right-click a light block: place another light block next to it at the same level.
- Left-click a light block you're looking at: break it reliably, even while invisible.
- Middle-click (pick block) a light in Creative: get a light item at that block's exact level.
- Each of these actions can be turned off individually in
config.yml (actions:), falling back to vanilla.
Level limits
- Cap the brightest level a player can set with
lightplus.maxlevel.<0-15> permission nodes (highest held wins), or a server-wide limits.default_max_level for players without a node.
limits.world_max_levels.<world> caps per world; the effective limit is the lower of the two.
lightplus.maxlevel.bypass ignores all caps.
Optional decay
decay.enabled makes player-placed light blocks disappear after decay.after_seconds — temporary exploration lighting with no cleanup.
- Pending lights persist to
decay-data.yml (decay.persist), so they still decay after a restart.
lightplus.decay.exempt places permanent lights.
Admin
/lightplus give <player> [level] [amount] hands out leveled light items (tab-completed).
Feedback
- Action-bar message when a level is set or changed (
Set to %level% level, configurable).
- Configurable gradient chat prefix (
messages.prefix, MiniMessage) auto-added to every message; %prefix% token for manual placement.
- Per-language messages: with
messages.follow_client_locale, players see strings from messages.locales.<their client language> (ships a zh_tw example), falling back to the English defaults.
- Marker particles around nearby light blocks while holding a light item.
- Configurable sound effects for placing, breaking and re-leveling — sound key, volume, pitch, per-sound mute and a master toggle. The level-up sound rises in pitch with brightness.
Recipes
- Stonecutter recipes for all 16 light levels; the output always matches the selected level.
- Configurable shaped crafting recipe for a light block (custom shape, ingredients and result level in
config.yml).
- Crafting a light item on its own resets it to level 15.
- Recipes are auto-unlocked for players on join and on
/lightplus reload (configurable), with lightplus.recipe permission enforced.
Integrations
- Land protection: placing, removing and adjusting light blocks is blocked in claims/regions the player can't build in — WorldGuard, GriefPrevention, GriefDefender, Residence, Towny, Lands, PlotSquared, BentoBox (toggle with
land_protection.enabled).
- Folia support: particle previews and recipe unlocks run on the correct region/entity schedulers.
- faststats metrics, including
lights_placed and lights_mined.
- Modrinth update check on startup — logs to console and notifies
lightplus.update holders on join (update_check: in config.yml, off by one toggle).
Placeholders (requires PlaceholderAPI)
%lightplus_version%, %lightplus_lights_placed%, %lightplus_lights_mined%
%lightplus_update_available%, %lightplus_latest_version%
%lightplus_max_level%, %lightplus_holding_light%, %lightplus_held_level% (player)
Control
- Every feature is permission-gated.
Land Protection
LightPlus honors land/region protection plugins for every light-block action. Block
place and break already go through standard Bukkit events, and the interaction
paths (level rotation, shift-place, left-click removal) are checked against a simulated
build/break event, so any plugin that cancels block break/place events is supported:
| Plugin |
Checked permission |
| WorldGuard |
build flag / region membership |
| GriefPrevention |
claim build trust |
| GriefDefender |
block-place / block-break flags |
| Residence |
build / destroy / place flags |
| Towny |
build / destroy permission for the plot |
| Lands |
BLOCK_PLACE / BLOCK_BREAK roles |
| PlotSquared |
plot build permission |
| BentoBox (BSkyBlock, AcidIsland, OneBlock, …) |
island PLACE_BLOCKS / BREAK_BLOCKS |
Any other plugin cancelling BlockBreakEvent / BlockPlaceEvent |
its own rules |
Set land_protection.enabled: false to disable these checks.
WorldGuard region flag — LightPlus also registers a lightplus-use StateFlag
(default allow). /rg flag <region> lightplus-use deny blocks every light-block
action in that region regardless of build permission, and independently of the
toggle above. Requires a server restart to register (not /reload).
Sounds
Every LightPlus sound is defined in the sounds section of config.yml as a
{ sound, volume, pitch } block:
| Entry |
When it plays |
place |
placing a light block next to another (shift-right-click) |
break |
breaking / removing a light block |
level_change |
raising the level with right-click (pitch rises with brightness) |
level_off |
the level wrapping past 15 back to 0 |
sound accepts a lower-case dotted key (block.lever.click), a namespaced key,
or a custom resource-pack sound. sounds.enabled: false mutes everything; an
empty sound: "" mutes just that one. Settings apply on /lightplus reload.
Placeholders
With PlaceholderAPI installed, LightPlus registers the lightplus expansion:
| Placeholder |
Value |
%lightplus_version% |
running plugin version |
%lightplus_lights_placed% |
lights placed since last start (server-wide) |
%lightplus_lights_mined% |
lights mined since last start (server-wide) |
%lightplus_update_available% |
true / false |
%lightplus_latest_version% |
latest version on Modrinth (blank until checked) |
%lightplus_pending_decay% |
light blocks currently waiting to decay |
%lightplus_max_level% |
the player's max settable level in their world |
%lightplus_holding_light% |
true / false |
%lightplus_held_level% |
level of the held light item, blank if none |
Config
grant_recipes_on_login: true
update_check:
enabled: true
notify_on_join: true
item:
custom_name: true
name: "<gold>Light Block <dark_gray>(<yellow>Level %level%<dark_gray>)"
lore:
- "<gray>Right-click a placed light to raise its level."
actions:
adjust_level: true # right-click to cycle level
place_adjacent: true # shift-right-click to place a light next to one
left_click_break: true # left-click a looked-at light to break it
pick_block: true # middle-click a light in Creative for a matching item
scroll_level: true # sneak + scroll on a light to step its level
limits:
default_max_level: 15 # cap for players without a lightplus.maxlevel.<n> node
world_max_levels: {} # e.g. { world_nether: 7 }
decay:
enabled: false # remove player-placed lights after a while
after_seconds: 120
persist: true # survive restarts via decay-data.yml
land_protection:
enabled: true
sounds:
enabled: true
place: { sound: block.stone.place, volume: 1.0, pitch: 0.8 }
break: { sound: block.stone.break, volume: 1.0, pitch: 0.8 }
level_change: { sound: block.lever.click, volume: 0.8, pitch: 1.8 }
level_off: { sound: block.lever.click, volume: 0.8, pitch: 0.6 }
crafting_recipe:
enabled: true
result_level: 15
items:
A: GLASS
B: GLOWSTONE
recipe:
- 'AAA'
- 'ABA'
- 'AAA'
messages:
prefix: "<gradient:#FDC830:#F37335><bold>LightPlus</bold></gradient> <dark_gray>»</dark_gray> "
action_bar_level_set: "<green>Set to <yellow>%level%</yellow> level"
command_usage: "<red>Usage: /lightplus reload | /lightplus give (player) [level] [amount]"
command_no_permission: "<red>You do not have permission to use this command."
command_reloaded: "<green>LightPlus config reloaded."
give_success: "<green>Gave <yellow>%amount%</yellow>x light (level <yellow>%level%</yellow>) to <yellow>%player%</yellow>."
give_received: "<green>You received <yellow>%amount%</yellow>x light (level <yellow>%level%</yellow>)."
player_not_found: "<red>Player '%player%' not found."
invalid_number: "<red>'%value%' is not a valid number."
The generated config.yml includes detailed comments explaining every option.
Commands
| Command |
Description |
Usage |
Permission |
| /lightplus help |
Interactive command list (also shown with no arguments). |
/lightplus help |
— |
| /lightplus version |
Version, server, Folia and detected land-protection plugins. |
/lightplus version |
— |
| /lightplus reload |
Reload config.yml. |
/lightplus reload |
lightplus.reload |
| /lightplus give |
Give a player leveled light items. |
/lightplus give <player> [level 0-15] [amount 1-64] |
lightplus.give |
Alias: /lp. help and version are always available; each only lists the sub-commands you have permission for.
Permissions
| Permission |
Description |
Default |
| lightplus.use |
Base permission for all LightPlus features. |
true |
| lightplus.place |
Place stored-level light blocks and shift-right-click adjacent placement. |
op |
| lightplus.break |
Break light blocks in survival/adventure (incl. left-click removal) and get items back. |
true |
| lightplus.adjust |
Right-click to cycle a placed light block's level. |
true |
| lightplus.recipe |
Use and be auto-granted the LightPlus recipes. |
op |
| lightplus.reload |
Run /lightplus reload. |
op |
| lightplus.give |
Run /lightplus give. |
op |
| lightplus.update |
Get the "new version available" notice on join. |
op |
| lightplus.decay.exempt |
Light blocks this player places never decay. |
op |
| lightplus.maxlevel.<0-15> |
Highest level the player may set; the highest node held wins. |
— |
| lightplus.maxlevel.bypass |
Ignore every light-level cap. |
op |

评论 0
登录后参与评分
还没有评论,来抢沙发吧