配置参考
本文档详细介绍了 CustomScreenMenu 插件的各项配置选项,包括主配置文件(config.yml)、文本显示配置(text.yml)和命令配置(commands.yml)。通过合理配置这些文件,您可以完全自定义插件的行为和外观。
主配置文件
config.yml 包含插件核心设置,控制全局行为
文本显示配置
text.yml 控制菜单中的文本显示元素和动画
命令配置
commands.yml 定义允许在菜单中使用的命令
config.yml 配置详解
主配置文件包含插件的核心设置:
version: "1.3.5" # 不要修改
Debug: false
# 是否开启南瓜头
use-pumpkin-overlay: false
# 是否以玩家当前所在位置/朝向作为菜单相机坐标
# true -> 忽略菜单 yml 里的 camera-position,用玩家当前脚下
# false -> 使用菜单 yml 里写死的坐标(原有逻辑)
use-player-location: false
# 是否设置自定义的玩家结束菜单的朝向
exit-camera:
yaw: 0.0
pitch: 0.0
# 生物生成限制配置
creature-spawn-limits:
enabled: false # 是否启用生物生成限制
radius: 10 # 以菜单为中心的禁止生物生成的半径(方块)
# 摄像机视角方块检测配置
camera-block-check:
enabled: true
radius: 1 # 以玩家为中心的检测半径(方块)
# 按钮访问控制配置
button-access-control:
# 需要登录才能点击的按钮标识配置
login-required:
# 在按钮名称中包含的标识文本
name-tags:
- "[需要登录]"
- "[LOGIN_REQUIRED]"
# 在按钮键名中包含的标识文本
key-tags:
- "login_required"
- "需要登录"
# 防止重复注册的按钮标识配置
no-duplicate-registration:
# 在按钮名称中包含的标识文本
name-tags:
- "[防止重复注册]"
- "[NO_DUPLICATE_REG]"
# 在按钮键名中包含的标识文本
key-tags:
- "no_duplicate_reg"
- "防止重复注册"
messages:
prefix: '&f[&eCustomScreenMenu&f] '
command_blocked: '&c固定视角下无法使用命令!'
sound:
name: 'music.menu'
volume: 1
pitch: 1
# 循环音效
loop:
# 是否开启
enabled: true
# 每隔多少秒播放一次
duration: 30
# 加入游戏就执行菜单
join-run:
enabled: false
# 延迟多少秒执行
delay: 3
# 执行的菜单
menu: 'test'
commands:
- "[console] say 欢迎玩家 %player% 加入游戏!"
- "[player] msg %player% 欢迎来到服务器!"
- "[op] gamemode survival %player%"
cursor-item:
material: 'ARROW'
custom-model-data: 0
scale: 0.5
# 自定义光标大小
size:
x: 1.0
y: 1.0
z: 1.0
# 最大3个X轴 已经为屏幕横向可容纳最大
max-x: 2
# 最大1.5个Y轴 已经为屏幕纵向可容纳最大
max-y: 3
x: 0.0 # X轴偏移
y: 0.0 # Y轴偏移
z-offset: 0.0 # 光标Z轴偏移量
# 光标移动范围限制
movement-range:
# 启用自定义光标移动范围限制
enabled: false
# 光标在X轴上的最小和最大位置
x:
min: -2.0
max: 2.0
# 光标在Y轴上的最小和最大位置
y:
min: -3.0
max: 3.0
# 光标默认位置
default-position:
# 启用自定义光标默认位置
enabled: false
# 光标默认的X和Y坐标
x: 0.0
y: 0.0
text.yml 配置详解
文本显示配置文件控制菜单中的文本显示元素:
version: "1.2.3"
text-displays:
welcome-message:
menus:
- "lobby"
- "main"
content: "&a欢迎来到服务器!"
scale: 1.5
position:
x: 0
y: 3
z: -5
tilt:
x: 0
y: 0
z: 0
animation:
type: "rotate" # rotate, up-down, left-right
speed: 2.0
spacing: 0.5
duration: 100 # 持续时间(秒)
alignment: "center" # left, center, right
rules:
menus:
- "lobby"
content:
- "&e服务器规则:"
- "&71. 禁止作弊"
- "&72. 尊重他人"
scale: 1.2
position:
x: 2
y: 1
z: -3
animation:
type: "up-down"
speed: 1.5
spacing: 0.3
duration: 60
alignment: "left"
commands.yml 配置详解
命令配置文件定义允许在菜单中使用的命令:
# 允许在摄像机模式下使用的命令(不需要斜杠)
allowed-commands:
- "help"
- "spawn"
- "warp"
- "cmenu stop"
- "cursormenu stop"
详细配置说明
主配置文件 (config.yml)
| 配置项 | 说明 | 默认值 |
|---|---|---|
| Debug | 是否开启调试模式,用于输出详细日志 | false |
| use-pumpkin-overlay | 是否开启南瓜头遮罩效果,增强沉浸感 | false |
| use-player-location | 是否使用玩家当前位置作为菜单摄像机位置 | false |
| creature-spawn-limits.enabled | 是否启用生物生成限制,防止菜单区域生成生物 | false |
| creature-spawn-limits.radius | 以菜单为中心的禁止生物生成的半径(方块) | 10 |
| camera-block-check.enabled | 是否启用摄像机视角方块检测,防止穿墙 | true |
| camera-block-check.radius | 以玩家为中心的检测半径(方块) | 1 |
| sound.loop.enabled | 是否开启循环音效 | true |
| sound.loop.duration | 每隔多少秒播放一次音效 | 30 |
| cursor-item.material | 光标物品材质 | 'ARROW' |
| cursor-item.max-x | 光标在X轴上的最大移动范围 | 2 |
| cursor-item.max-y | 光标在Y轴上的最大移动范围 | 3 |
| cursor-item.movement-range.enabled | 是否启用自定义光标移动范围限制 | false |
| cursor-item.default-position.enabled | 是否启用自定义光标默认位置 | false |
文本显示配置 (text.yml)
| 配置项 | 说明 |
|---|---|
| text-displays.[name].menus | 指定在哪些菜单中显示该文本 |
| text-displays.[name].content | 文本内容,支持颜色代码 |
| text-displays.[name].scale | 文本缩放比例 |
| text-displays.[name].position | 文本在菜单中的位置(x, y, z) |
| text-displays.[name].animation.type | 动画类型(rotate, up-down, left-right) |
| text-displays.[name].alignment | 文本对齐方式(left, center, right) |
命令配置 (commands.yml)
| 配置项 | 说明 |
|---|---|
| allowed-commands | 允许在摄像机模式下使用的命令列表 |
Configuration Reference
This document details all configuration options for the CustomScreenMenu plugin, including the main configuration file (config.yml), text display configuration (text.yml), and command configuration (commands.yml). By properly configuring these files, you can fully customize the plugin's behavior and appearance.
Main Configuration
config.yml contains core plugin settings that control global behavior
Text Display Configuration
text.yml controls text display elements and animations in menus
Command Configuration
commands.yml defines commands allowed in menus
config.yml Detailed Configuration
The main configuration file contains the core settings of the plugin:
version: "1.3.5" # Do not modify
Debug: false
# Whether to enable pumpkin overlay
use-pumpkin-overlay: false
# Whether to use the player's current location/direction as the menu camera coordinates
# true -> Ignore camera-position in menu yml, use player's current position
# false -> Use hardcoded coordinates in menu yml (original logic)
use-player-location: false
# Whether to set a custom player exit menu orientation
exit-camera:
yaw: 0.0
pitch: 0.0
# Creature spawn restriction configuration
creature-spawn-limits:
enabled: false # Whether to enable creature spawn restrictions
radius: 10 # Radius around menu where creature spawning is prohibited (blocks)
# Camera view block detection configuration
camera-block-check:
enabled: true
radius: 1 # Detection radius centered on player (blocks)
# Button access control configuration
button-access-control:
# Configuration for buttons requiring login to click
login-required:
# Tag text included in button names
name-tags:
- "[需要登录]"
- "[LOGIN_REQUIRED]"
# Tag text included in button keys
key-tags:
- "login_required"
- "需要登录"
# Configuration for buttons preventing duplicate registration
no-duplicate-registration:
# Tag text included in button names
name-tags:
- "[防止重复注册]"
- "[NO_DUPLICATE_REG]"
# Tag text included in button keys
key-tags:
- "no_duplicate_reg"
- "防止重复注册"
messages:
prefix: '&f[&eCustomScreenMenu&f] '
command_blocked: '&cCannot use commands in fixed view!'
sound:
name: 'music.menu'
volume: 1
pitch: 1
# Loop sound effect
loop:
# Whether to enable
enabled: true
# Play interval in seconds
duration: 30
# Execute menu on join
join-run:
enabled: false
# Delay in seconds before execution
delay: 3
# Menu to execute
menu: 'test'
commands:
- "[console] say Welcome player %player% to the game!"
- "[player] msg %player% Welcome to the server!"
- "[op] gamemode survival %player%"
cursor-item:
material: 'ARROW'
custom-model-data: 0
scale: 0.5
# Custom cursor size
size:
x: 1.0
y: 1.0
z: 1.0
# Maximum 3 on X-axis, already the maximum horizontally accommodated
max-x: 2
# Maximum 1.5 on Y-axis, already the maximum vertically accommodated
max-y: 3
x: 0.0 # X-axis offset
y: 0.0 # Y-axis offset
z-offset: 0.0 # Cursor Z-axis offset
# Cursor movement range limitation
movement-range:
# Enable custom cursor movement range limitation
enabled: false
# Minimum and maximum cursor positions on X-axis
x:
min: -2.0
max: 2.0
# Minimum and maximum cursor positions on Y-axis
y:
min: -3.0
max: 3.0
# Cursor default position
default-position:
# Enable custom cursor default position
enabled: false
# Default X and Y coordinates of cursor
x: 0.0
y: 0.0
text.yml Detailed Configuration
The text display configuration file controls text display elements in menus:
version: "1.2.3"
text-displays:
welcome-message:
menus:
- "lobby"
- "main"
content: "&aWelcome to the server!"
scale: 1.5
position:
x: 0
y: 3
z: -5
tilt:
x: 0
y: 0
z: 0
animation:
type: "rotate" # rotate, up-down, left-right
speed: 2.0
spacing: 0.5
duration: 100 # Duration (seconds)
alignment: "center" # left, center, right
rules:
menus:
- "lobby"
content:
- "&eServer Rules:"
- "&71. No cheating"
- "&72. Respect others"
scale: 1.2
position:
x: 2
y: 1
z: -3
animation:
type: "up-down"
speed: 1.5
spacing: 0.3
duration: 60
alignment: "left"
commands.yml Detailed Configuration
The command configuration file defines commands allowed in menus:
# Commands allowed in camera mode (no slash needed)
allowed-commands:
- "help"
- "spawn"
- "warp"
- "cmenu stop"
- "cursormenu stop"
Detailed Configuration Explanation
Main Configuration (config.yml)
| Configuration Item | Description | Default Value |
|---|---|---|
| Debug | Whether to enable debug mode for detailed logging | false |
| use-pumpkin-overlay | Whether to enable pumpkin overlay effect for immersion | false |
| use-player-location | Whether to use player's current location as menu camera position | false |
| creature-spawn-limits.enabled | Whether to enable creature spawn restrictions to prevent spawning in menu area | false |
| creature-spawn-limits.radius | Radius around menu where creature spawning is prohibited (blocks) | 10 |
| camera-block-check.enabled | Whether to enable camera view block detection to prevent clipping | true |
| camera-block-check.radius | Detection radius centered on player (blocks) | 1 |
| sound.loop.enabled | Whether to enable loop sound effect | true |
| sound.loop.duration | Interval in seconds between sound effects | 30 |
| cursor-item.material | Cursor item material | 'ARROW' |
| cursor-item.max-x | Maximum cursor movement range on X-axis | 2 |
| cursor-item.max-y | Maximum cursor movement range on Y-axis | 3 |
| cursor-item.movement-range.enabled | Whether to enable custom cursor movement range limitation | false |
| cursor-item.default-position.enabled | Whether to enable custom cursor default position | false |
Text Display Configuration (text.yml)
| Configuration Item | Description |
|---|---|
| text-displays.[name].menus | Specify which menus to display this text in |
| text-displays.[name].content | Text content, supports color codes |
| text-displays.[name].scale | Text scale ratio |
| text-displays.[name].position | Text position in menu (x, y, z) |
| text-displays.[name].animation.type | Animation type (rotate, up-down, left-right) |
| text-displays.[name].alignment | Text alignment (left, center, right) |
Command Configuration (commands.yml)
| Configuration Item | Description |
|---|---|
| allowed-commands | List of commands allowed in camera mode |