SimplePrefixes

一款旨在允许玩家选择简单前缀并在聊天中使用的插件!
依赖
特性

- 玩家友好的图形用户界面,用于选择昵称。
- 不与其他任何插件直接交互。
- 该插件使用并持有占位符中的前缀,不会影响权限组 / 元数据。
- 支持 PlaceholderAPI 占位符。
- 支持 Mini-Message 格式。
- 支持多种类型的要求:
PERMISSION、STATISTIC、ADVANCEMENT、COMPARE_INT
占位符、命令与权限
%simpleprefixes_prefix%
前缀占位符。请在你的聊天插件中使用此占位符。
用法示例:%sp_prefix% %player_displayname% » {message}
%simpleprefixes_prefix_legacy%
前缀占位符。在 config.yml / prefixes.yml 中仍采用 Mini-Message 格式,但会将格式转换为旧版格式(&a / §a 而不是 <green>)以兼容其他插件。当你需要以旧版方式显示内容时(例如配合 TAB 插件),请使用此项。
这将自动移除 <hover> 和 <click> 标签。
/sp gui
打开一个生成的 GUI,按前缀 ID 组织前缀列表。
/sp reset
重置你的前缀。
/sp set <prefix-id>
设置你的前缀。
/sp reload
重新加载插件。
配置
saving-type: "file"
mysql:
ip: "localhost:3306"
name: prefixes
user: username1
pass: badpassword!
default-prefix: "<white>[<gray>Player</gray>]</white> "
prefix-menu-name: "<bold>Prefix Menu</bold>"
header:
name: "<aqua>Click to Reset Your Prefix</aqua>"
lore: []
material: ENDER_EYE
count: 1
custom-model-data: null
配置设置
| 设置项 |
描述 |
有效值 |
| saving-type |
此插件应使用哪种保存系统? |
PDC, FILE, MYSQL |
| mysql |
MySQL 连接设置 |
有效的 SQL 连接信息 |
| default-prefix |
默认前缀,支持占位符。 |
字符串 |
| prefix-menu-name |
前缀菜单的名称。 |
字符串 |
| header |
头部项目配置部分 |
见下文 |
保存类型
以下是当前实现的保存类型……
持久数据容器 (PDC)
插件会将当前装备的前缀 ID 保存在玩家自身身上。
这会导致玩家在离线时无法访问该前缀。
这最初是用于插件的初步测试,但如果你出于某些原因不喜欢文件系统,也可以使用此选项。
YML 文件 (FILE)
插件会将所有玩家的前缀 ID 保存到与配置文件一起存储的配置 YML 文件中。
这使得前缀在玩家离线时仍然可用,但每当玩家的前缀发生更改时,
插件都会进行保存。
这是默认选项。
头部配置
前缀菜单的头部可以通过多种方式配置。
header:
name: "<aqua>点击重置你的前缀</aqua>"
lore: []
material: ENDER_EYE
count: 1
custom-model-data: null
名称
这是一个表示物品名称的字符串。
默认为 "点击重置你的前缀"。
支持 Mini-Message 和占位符。
描述
这是一个表示每行描述的字符串列表。
默认为空列表。
支持 Mini-Message 和占位符。
材质
这是一个字符串,代表来自 Paper Material Enum 的材质枚举类型。
无效或缺失的值将默认为 ENDER_EYE(末影之眼)。
数量
这是一个表示物品堆叠数量的字符串或整数。
无效或缺失的值将默认为 1。请勿设置为 0。
只要占位符能转换为整数表示,就支持占位符。
自定义模型数据
这是一个表示自定义模型数据的整数。
无效或缺失的值将保持物品不变。
创建前缀
前缀存储在 prefixes.yml 文件中,这是默认设置。
#####
# Prefixes.yml
# ---
# 有关如何使用此配置的说明,请参阅自述文件:https://github.com/Simplexity-Development/SimplePrefixes
#####
#absorption:
# display-name: "<yellow>Absorption"
# description:
# - "<yellow><bold>趣味事实:"
# - "<white> 这是我曾在测试中使用的前缀!"
# - "<white> 它同样支持 PlaceholderAPI!"
# prefix: "<white>[<yellow>Absorption: %player_absorption%</yellow>]</white>"
# verify-always: true
# requirements:
# - "compare_int %player_absorption% > 0"
permitted:
display-name: "<green>The Permitted"
description:
- "<aqua>你拥有运行此命令的权限!"
prefix: "<white>[<green>Permitted</green>]</white>"
requirements:
- "permission simpleprefix.permitted"
undying:
display-name: "<red>The Undying"
description:
- "<gray>死亡在追逐你..."
- "<gray>而你成功逃脱了..."
prefix: "<white>[<red>Undying</red>]</white>"
verify-always: true
requirements:
- "statistic DEATHS == 0"
wither_hunter:
display-name: "<black>The Wither Hunter"
description:
- "你能读得清这段文字吗?"
prefix: "<white>[<black>Wither Hunter</black>]</white>"
show-when-locked: false
requirements:
- "advancement minecraft:nether/summon_wither"
custom_model_data:
display-name: "<aqua>Bucket Mobs!</aqua>"
description:
- "如果你安装了 SimpleBucketMobs' resource pack"
- "那么这个末影人桶就是其中之一!"
prefix: "<white>[<aqua>Simple Bucket Mobs</aqua>]</white>"
item:
material: BUCKET
count: 2
custom-model-data: 22000
custom_layout:
display-name: "<green>Fancy Layouts!</green>"
description:
- "在使用自定义布局时,此配置选项实际上会被忽略。"
prefix: "<white>[<green>LAYOUTS</green>]</white>"
layout:
- "<blue>Prefix ID:</blue> <prefix_id>"
- "它看起来像这样:<prefix>"
- "<gray> → 我偷偷加在这里,多奇怪啊!"
- "<yellow>Unlock State:<yellow> <unlocked>"
- "<blue>Line 1 Description"
- "Line 2 Description"
- "<red>Line 3 Description"
- " "
- "<green>Hi I wanted to skip another line."
前缀 ID [必填]
这是前缀 ID。每个前缀都通过此值进行唯一标识。
这意味着你不能拥有两个相同的前缀 ID。
显示名称 (display-name) [必填]
这是前缀的显示名称。它是前缀的正式名称。
支持来自 PlaceholderAPI 的占位符。
前缀 (prefix) [必填]
这是将在 %sp_prefix% / %sp_prefix_legacy% 处显示的字符串形式的前缀。
支持来自 PlaceholderAPI 的占位符。
描述 (description)
这是一个字符串列表。每个字符串将在 GUI 的描述部分成为新的一行。
支持来自 PlaceholderAPI 的占位符。
物品 (item)
这是定义你的物品堆叠的方式。
material 定义物品的材质。无效或缺失时默认为 NAME_TAG(名称标签)。Paper Material Enum
count 更改堆叠大小(即堆叠中的物品数量)。无效或缺失时默认为 1。
custom-model-data 更改自定义模型数据,用于资源包。无效或缺失时保持物品不变。
如果缺少此部分,物品堆叠将默认为单个名称标签。
锁定后显示 (show-when-locked)
如果此项为 true,当未满足要求时,前缀将不会在菜单中显示。
此项默认为 true。
始终验证 (verify-always)
每次 PAPI 请求玩家的前缀时都会检查要求。
如果检查失败,玩家将清除其前缀。
此项默认为 false。
布局(layout)
这是一个字符串列表。每个字符串将成为物品描述中的一行新文本。
如果提供了该字段且不为空,它将覆盖前缀物品的默认布局。
每个物品都将拥有其独特的布局。
布局占位符:
<prefix_id> - 在 prefixes.yml 中列出的前缀 ID。
<prefix> - 前缀本身。
<unlocked> - “已解锁 / 未解锁”文本。
默认值为 [](空列表)。
前缀的最小配置
# 一个 ID 为 "example-prefix" 的前缀...
example-prefix:
display-name: "The Example Prefix"
prefix: "<white>[<rainbow>Example</rainbow>]</white> "
前缀要求
要求是装备该前缀时必须满足的条件。
这些要求有多种形式,将在下文进行说明。
注意
格式不正确或会产生错误的要求将被忽略。
无法保证失败的要求也不会被检查。
要检查玩家权限,玩家必须在线,
因此当玩家离线时,这些检查会被忽略。
verify-always 将在每次请求玩家前缀时执行要求检查。
如果要求检查失败,保存的前缀将被清除。
权限
格式:permission <权限节点> [false]
<permission.node> 表示玩家可能拥有的一个权限。
[false] 是可选的,必须提供以反转结果。
这意味着如果权限是 example.permission,则玩家不得拥有此权限。
示例: permission example.permission(玩家拥有权限 example.permission)
示例: permission example.permission false(玩家不拥有权限 example.permission)
统计信息
格式:statistic <statistic> <operator> <value>
<statistic> 是来自 此页面 的枚举值。
它代表玩家拥有的某项统计信息。
<operator> 是一个比较运算符。
有效的运算符包括 >, <, >=, <=, ==, !=
<value> 是一个整数,可与该统计信息进行比较。
示例: statistic ANIMALS_BRED >= 100(玩家已繁殖了 100 只或更多动物)。
进度
格式:advancement <namespace:advancement> [false]
<namespace:advancement> 是一个表示进度的命名空间键(Namespaced Key)。
你可以在 此页面 找到原版进度。
这代表玩家可以获得的某项进度。Minecraft 进度使用 minecraft 命名空间。
[false] 是可选参数,必须提供以反转结果。
这意味着如果进度是 minecraft:nether/summon_wither,则玩家不得拥有该进度。
示例: advancement minecraft:nether/summon_wither(玩家拥有 Minecraft 召唤凋灵进度)。
示例: advancement minecraft:nether/summon_wither false(玩家不拥有 Minecraft 召唤凋灵进度)。
整数比较
格式:compare_int <placeholder> <operator> <value>
<placeholder> 可以是任何能返回有效整数的 PlaceholderAPI 占位符。
<operator> 是一个比较运算符。
有效的运算符包括 >, <, >=, <=, ==, !=
<value> 是一个整数,可与该占位符进行比较。
示例: compare_int %player_absorption% > 0(玩家的吸收值大于 0)。
未实现
开发中功能 (WIP)
- 特殊可配置图标(例如:玩家头颅)
- 字符串比较、需求检查
- “正在直播”直播功能实现
SimplePrefixes

A plugin aiming to allow for simple player-selected prefixes that can be used in chat!
Requirements
Features

- Player friendly GUI for selecting nicknames.
- Does not interact with any other plugins directly.
- The plugin uses and hold prefixes in a placeholder, it will not affect permission groups / meta.
- Supports PlaceholderAPI Placeholders.
- Supports Mini-Message formatting.
- Supports multiple types of requirements:
PERMISSION, STATISTIC, ADVANCEMENT, COMPARE_INT
Placeholders, Commands, and Permissions
%simpleprefixes_prefix%
Placeholder for the prefix. Use this in your chat plugin.
Example Usage: %sp_prefix% %player_displayname% » {message}
%simpleprefixes_prefix_legacy%
Placeholder for the prefix. Still takes Mini-Message format in config.yml / prefixes.yml but converts the format to legacy (&a / §a instead of <green>) for other plugins. This is when you need the legacy way to display stuff, like with TAB Plugin.
This will automatically strip <hover> and <click> tags.
/sp gui
Opens a generated GUI that organizes the prefixes by prefix-id.
/sp reset
Resets your prefix.
/sp set <prefix-id>
Sets your prefix.
/sp reload
Reloads the plugin.
Configuration
saving-type: "file"
mysql:
ip: "localhost:3306"
name: prefixes
user: username1
pass: badpassword!
default-prefix: "<white>[<gray>Player</gray>]</white> "
prefix-menu-name: "<bold>Prefix Menu</bold>"
header:
name: "<aqua>Click to Reset Your Prefix</aqua>"
lore: []
material: ENDER_EYE
count: 1
custom-model-data: null
Configuration Settings
| Setting |
Description |
Valid Values |
| saving-type |
What type of saving system should this use? |
PDC, FILE, MYSQL |
| mysql |
MySQL Connection Settings |
Valid SQL Connection Info |
| default-prefix |
Fallback prefix, supports Placeholders. |
String |
| prefix-menu-name |
The name of the prefix menu. |
String |
| header |
Section for Header Item Configuration |
See Below |
Saving Types
These are the current implementations of the saving types...
PersistentDataContainer (PDC)
The plugin will save the prefix ID of the currently equipped prefix on the Player themselves.
This makes the prefix inaccessible while they are offline.
This was primarily used for initial testing of the plugin but if you don't like file systems for some reason, there.
YML File (FILE)
The plugin will save the prefix IDs of all players to a configuration YML file stored alongside the config.
This allows for the prefix to be available while they are offline, but any time a player's prefix is changed,
the plugin saves the prefix.
This is default.
Header Configuration
The prefix menu header is configurable in multiple ways.
header:
name: "<aqua>Click to Reset Your Prefix</aqua>"
lore: []
material: ENDER_EYE
count: 1
custom-model-data: null
Name
This is a String representing the item's name.
Defaults to "Click to Reset Your Prefix".
Mini-Message and Placeholders are supported.
Lore
This is a list of Strings representing each lore line.
Defaults to an empty list.
Mini-Message and Placeholders are supported.
Material
This is a String representing the Material Enumerated Type from Paper Material Enum
Invalid or missing values defaults to ENDER_EYE (Eye of Ender).
Count
This is a String / Integer representing the item stack quantity.
Invalid or missing values defaults to 1. Do not set to 0.
Placeholders are supported, so long as they become an int representation.
Custom Model Data
This is an integer that represents the custom model data.
Invalid or missing value leaves the item unchanged.
Creating Prefixes
Prefixes are stored in the prefixes.yml file, this is the default.
#####
# Prefixes.yml
# ---
# For information on how to use this config, see the readme: https://github.com/Simplexity-Development/SimplePrefixes
#####
#absorption:
# display-name: "<yellow>Absorption"
# description:
# - "<yellow><bold>FUN FACT:"
# - "<white> This was a prefix I used during testing!"
# - "<white> This also supports PlaceholderAPI!"
# prefix: "<white>[<yellow>Absorption: %player_absorption%</yellow>]</white>"
# verify-always: true
# requirements:
# - "compare_int %player_absorption% > 0"
permitted:
display-name: "<green>The Permitted"
description:
- "<aqua>You do have permission to run this command!"
prefix: "<white>[<green>Permitted</green>]</white>"
requirements:
- "permission simpleprefix.permitted"
undying:
display-name: "<red>The Undying"
description:
- "<gray>Death hunts you..."
- "<gray>You evade it..."
prefix: "<white>[<red>Undying</red>]</white>"
verify-always: true
requirements:
- "statistic DEATHS == 0"
wither_hunter:
display-name: "<black>The Wither Hunter"
description:
- "Can you even read that text?"
prefix: "<white>[<black>Wither Hunter</black>]</white>"
show-when-locked: false
requirements:
- "advancement minecraft:nether/summon_wither"
custom_model_data:
display-name: "<aqua>Bucket Mobs!</aqua>"
description:
- "If you have SimpleBucketMobs' resource pack"
- "then this is an Enderman Bucket!"
prefix: "<white>[<aqua>Simple Bucket Mobs</aqua>]</white>"
item:
material: BUCKET
count: 2
custom-model-data: 22000
custom_layout:
display-name: "<green>Fancy Layouts!</green>"
description:
- "This configuration option is effectively ignored with custom layouts."
prefix: "<white>[<green>LAYOUTS</green>]</white>"
layout:
- "<blue>Prefix ID:</blue> <prefix_id>"
- "It looks like this: <prefix>"
- "<gray> → I snuck this in here, how weird!"
- "<yellow>Unlock State:<yellow> <unlocked>"
- "<blue>Line 1 Description"
- "Line 2 Description"
- "<red>Line 3 Description"
- " "
- "<green>Hi I wanted to skip another line."
Prefix ID [Required]
This is the Prefix ID. Every prefix is uniquely identified by this value.
This does mean you cannot have two of the same Prefix IDs.
Display Name (display-name) [Required]
This is the Display Name of the prefix. It is the formal name of the prefix.
Supports Placeholders from PlaceholderAPI.
Prefix (prefix) [Required]
This is the String representation of the prefix that will be displayed in place of %sp_prefix% / %sp_prefix_legacy%.
Supports Placeholders from PlaceholderAPI.
Description (description)
This is a list of strings. Each string will be a new line in the description part of the GUI.
Supports Placeholders from PlaceholderAPI.
Item (item)
This is a way to define your item stacks.
material defines the material of the item. Invalid or missing defaults to NAME_TAG. Paper Material Enum
count changes the stack size (the number of items in the stack). Invalid or missing defaults to 1.
custom-model-data changes the custom model data, used for Resource Packs. Invalid or missing leaves the item unchanged.
If this section is missing, the itemstack is defaulted to a single name tag.
Show When Locked (show-when-locked)
If this is true, the prefix will not show in the menu if the requirements are not met.
This defaults to true.
Verify Always (verify-always)
Checks the requirements each time the player's prefix is requested by PAPI.
If the check fails, the player's prefix is cleared.
This defaults to false.
Layout (layout)
This is a list of strings. Each string will be a new line in the item's lore.
If this is provided and is not empty, this will overwrite the default layout of the prefix item.
Each item will have their own unique layout.
Layout Placeholders:
<prefix_id> - The prefix's ID as listed in prefixes.yml.
<prefix> - The prefix itself.
<unlocked> - The Unlocked / Locked text.
This defaults to [] (Empty List).
Minimum Configuration for a Prefix
# A prefix with the ID "example-prefix"...
example-prefix:
display-name: "The Example Prefix"
prefix: "<white>[<rainbow>Example</rainbow>]</white> "
Prefix Requirements
Requirements are conditions that must be held true in order to equip the prefix.
These requirements come in multiple forms that will be explained here.
Note
Requirements that are incorrectly formatted or produce errors are ignored.
Requirements that cannot guarantee failure will not be checked either.
To check player permissions, the player has to be online,
so while the player is offline, these checks are ignored.
verify-always will make the requirements check every time the player's prefix is requested.
If the requirement check fails, the prefix saved is cleared.
Permission
Format: permission <permission.node> [false]
<permission.node> represents a permission the player may have.
[false] is optional and must be provided to invert the result.
This means if the permission is example.permission, the player must NOT have this permission.
Example: permission example.permission (Player has permission example.permission)
Example: permission example.permission false (Player does not have permission example.permission)
Statistic
Format: statistic <statistic> <operator> <value>
<statistic> is an enum value from this page.
This represents some statistic the player has.
<operator> is a comparison operator.
Valid operators are >, <, >=, <=, ==, !=
<value> is an integer and can be compared to the statistic.
Example: statistic ANIMALS_BRED >= 100 (Player has bred 100 or more animals).
Advancement
Format: advancement <namespace:advancement> [false]
<namespace:advancement> is a Namespaced Key representing an Advancement.
You can find vanilla advancements on this page.
This represents some advancement the player can earn. Minecraft Advancements use the minecraft namespace.
[false] is optional and must be provided to invert the result.
This means that if the advancement is minecraft:nether/summon_wither, the player must not have this advancement.
Example: advancement minecraft:nether/summon_wither (Player has the Minecraft Summon Wither advancement).
Example: advancement minecraft:nether/summon_wither false (Player does not have the Minecraft Summon Wither advancement).
Compare Int
Format: compare_int <placeholder> <operator> <value>
<placeholder> is any PlaceholderAPI placeholder that can return a valid integer.
<operator> is a comparison operator.
Valid operators are >, <, >=, <=, ==, !=
<value> is an integer and can be compared to the placeholder.
Example: compare_int %player_absorption% > 0 (Player has absorption value greater than 0).
Unimplemented
- Compare String, Case Sensitive
- Compare String, Case Insensitive
WIP Features
- Special Configurable Icons (ie: Player Heads)
- Compare String, Requirement Checks
- "Live Now" Livestreaming Implementation
评论 0
登录后参与评分
还没有评论,来抢沙发吧