Closed 347180440 closed 10 months ago
list:
inspect-prefix: '{"extra":[{"hov'
replace-regex: '{"color":"#31b0e8","text":"([a-z0-9]+)§f[。|.]"}' # (中文) '{"color":"#31b0e8","text":"([a-z0-9]+)§f\。"}'
replace-to: '{"color":"#31b0e8","hoverEvent":{"action":"show_text","contents":{"extra":[{"translate":"TranslatedName"},{"text":" §o§7点击复制§r"},{"text":"\n§8minecraft:ItemName"}],"text":""}},"clickEvent":{"action":"copy_to_clipboard","value":"ItemName"},"extra":[{"translate":"TranslatedName"},{"text":" §8ItemName"}],"text":""}'
更新到最新版本, 并让插件自动生成配置即可
list:
检查消息长度是否小于此值
检查消息是否以此字符串开头
inspect-prefix: '{"extra":[{"hov'
替换, 使用正则表达式匹配
replace-regex: '{"color":"#31b0e8","text":"([a-z0-9]+)§f[。|.]"}' # (中文) '{"color":"#31b0e8","text":"([a-z0-9]+)§f\。"}'
替换为
replace-to: '{"color":"#31b0e8","hoverEvent":{"action":"show_text","contents":{"extra":[{"translate":"TranslatedName"},{"text":" §o§7点击复制§r"},{"text":"\n§8minecraft:ItemName"}],"text":""}},"clickEvent":{"action":"copy_to_clipboard","value":"ItemName"},"extra":[{"translate":"TranslatedName"},{"text":" §8ItemName"}],"text":""}'
ItemName = 正则匹配到的实体/物品/方块名
__ItemType_show__ = 提供给 JSON hoverEvent 使用的物品类型 show_entity, show_item(block)
TranslatedName = 转换后用于翻译的名称 "entity.minecraft.allay"
{"translate":"TranslatedName"}