跳到主要内容

图标系统

GeyserMenu 支持三种类型的图标:Java 版物品 ID、基岩版材质路径和 URL 图标。

基础用法

1. Java 版物品 ID

使用 Java 版的物品 ID,插件会自动转换为对应的基岩版材质路径:

items:
- text: "传送菜单"
icon: "compass"
icon_type: "java" # 使用 Java 版物品 ID

2. 基岩版材质路径

直接使用基岩版的材质路径:

items:
- text: "商店菜单"
icon: "textures/items/diamond"
icon_type: "bedrock" # 使用基岩版材质路径

3. URL 图标

从网络 URL 加载图标:

items:
- text: "自定义按钮"
icon: "https://example.com/icon.png"
icon_type: "url" # 使用 URL 图标
注意

URL 图标需要在 config.yml 中启用 icons.allow_url: true,并且默认只允许 HTTPS 链接。

使用资源包图标

你可以通过基岩版资源包添加自定义图标:

  1. 创建资源包目录结构:
my_resource_pack/
├── manifest.json
├── pack_icon.png
└── textures/
└── gui/
└── icons/
├── my_icon1.png
└── my_icon2.png
  1. 在菜单中使用自定义图标:
items:
- text: "自定义按钮"
icon: "textures/gui/icons/my_icon1"
icon_type: "bedrock"
  1. 将资源包应用到基岩版客户端:
    • 在基岩版客户端导入资源包
    • 或通过服务器自动分发资源包

图标映射配置

在 config.yml 中配置 Java 版到基岩版的材质映射:

icons:
# 默认图标
default: "textures/items/paper"

# 是否允许URL图标
allow_url: true

# URL图标设置
url:
https-only: true
max-length: 256
allowed-domains: []

# 图标类型映射
mappings:
grass_block: "textures/blocks/grass_side"
diamond: "textures/items/diamond"
compass: "textures/items/compass_item"

内置图标映射列表

方块类

Java ID基岩版路径
grass_blocktextures/blocks/grass_side
stonetextures/blocks/stone
dirttextures/blocks/dirt
cobblestonetextures/blocks/cobblestone
oak_logtextures/blocks/log_oak
oak_plankstextures/blocks/planks_oak
sandtextures/blocks/sand
graveltextures/blocks/gravel
gold_blocktextures/blocks/gold_block
iron_blocktextures/blocks/iron_block
diamond_blocktextures/blocks/diamond_block
emerald_blocktextures/blocks/emerald_block
netherite_blocktextures/blocks/netherite_block
redstone_blocktextures/blocks/redstone_block
lapis_blocktextures/blocks/lapis_block
coal_blocktextures/blocks/coal_block
quartz_blocktextures/blocks/quartz_block
obsidiantextures/blocks/obsidian
glasstextures/blocks/glass
tnttextures/blocks/tnt_side
icetextures/blocks/ice
glowstonetextures/blocks/glowstone
netherracktextures/blocks/netherrack
soul_sandtextures/blocks/soul_sand
end_stonetextures/blocks/end_stone

武器类

Java ID基岩版路径
diamond_swordtextures/items/diamond_sword
iron_swordtextures/items/iron_sword
stone_swordtextures/items/stone_sword
wood_swordtextures/items/wood_sword
golden_swordtextures/items/gold_sword
netherite_swordtextures/items/netherite_sword
bowtextures/items/bow_standby
crossbowtextures/items/crossbow_standby
tridenttextures/items/trident
arrowtextures/items/arrow
shieldtextures/items/shield

工具类

Java ID基岩版路径
diamond_pickaxetextures/items/diamond_pickaxe
iron_pickaxetextures/items/iron_pickaxe
stone_pickaxetextures/items/stone_pickaxe
diamond_axetextures/items/diamond_axe
iron_axetextures/items/iron_axe
diamond_shoveltextures/items/diamond_shovel
iron_shoveltextures/items/iron_shovel
diamond_hoetextures/items/diamond_hoe
fishing_rodtextures/items/fishing_rod_uncast
flint_and_steeltextures/items/flint_and_steel
compasstextures/items/compass_item
clocktextures/items/clock_item
spyglasstextures/items/spyglass

防具类

Java ID基岩版路径
diamond_helmettextures/items/diamond_helmet
diamond_chestplatetextures/items/diamond_chestplate
diamond_leggingstextures/items/diamond_leggings
diamond_bootstextures/items/diamond_boots
iron_helmettextures/items/iron_helmet
iron_chestplatetextures/items/iron_chestplate
golden_helmettextures/items/gold_helmet
netherite_helmettextures/items/netherite_helmet
turtle_helmettextures/items/turtle_helmet
elytratextures/items/elytra

食物类

Java ID基岩版路径
appletextures/items/apple
golden_appletextures/items/apple_golden
breadtextures/items/bread
cooked_beeftextures/items/beef_cooked
cooked_porkchoptextures/items/porkchop_cooked
cooked_chickentextures/items/chicken_cooked
cooked_codtextures/items/fish_cooked
carrottextures/items/carrot
golden_carrottextures/items/carrot_golden
potatotextures/items/potato
baked_potatotextures/items/potato_baked
cookietextures/items/cookie
caketextures/items/cake
pumpkin_pietextures/items/pumpkin_pie

矿物类

Java ID基岩版路径
diamondtextures/items/diamond
emeraldtextures/items/emerald
gold_ingottextures/items/gold_ingot
iron_ingottextures/items/iron_ingot
copper_ingottextures/items/copper_ingot
netherite_ingottextures/items/netherite_ingot
coaltextures/items/coal
charcoaltextures/items/charcoal
redstonetextures/items/redstone_dust
quartztextures/items/quartz
amethyst_shardtextures/items/amethyst_shard

特殊物品类

Java ID基岩版路径
nether_startextures/items/nether_star
beacontextures/items/beacon
ender_pearltextures/items/ender_pearl
ender_eyetextures/items/ender_eye
blaze_rodtextures/items/blaze_rod
ghast_teartextures/items/ghast_tear
slime_balltextures/items/slimeball
enchanted_booktextures/items/book_enchanted
booktextures/items/book_normal
name_tagtextures/items/name_tag
saddletextures/items/saddle
leadtextures/items/lead
bonetextures/items/bone
stringtextures/items/string
feathertextures/items/feather
gunpowdertextures/items/gunpowder
leathertextures/items/leather

药水类

Java ID基岩版路径
potiontextures/items/potion_bottle_drinkable
splash_potiontextures/items/potion_bottle_splash
lingering_potiontextures/items/potion_bottle_lingering
experience_bottletextures/items/bottle_o_enchanting
glass_bottletextures/items/glass_bottle

红石类

Java ID基岩版路径
redstone_torchtextures/blocks/redstone_torch_on
levertextures/blocks/lever
stone_buttontextures/blocks/stone_button
repeatertextures/items/repeater
comparatortextures/items/comparator
observertextures/blocks/observer_front
hoppertextures/blocks/hopper_front
droppertextures/blocks/dropper_front_horizontal
dispensertextures/blocks/dispenser_front_horizontal
pistontextures/blocks/piston_side
sticky_pistontextures/blocks/piston_side_sticky

装饰类

Java ID基岩版路径
chesttextures/blocks/chest_front
trapped_chesttextures/blocks/chest_trapped_front
barreltextures/blocks/barrel_side
shulker_boxtextures/blocks/shulker_box_top
crafting_tabletextures/blocks/crafting_table_top
furnacetextures/blocks/furnace_front_on
blast_furnacetextures/blocks/blast_furnace_front_on
smokertextures/blocks/smoker_front_on
anviltextures/blocks/anvil_base
grindstonetextures/blocks/grindstone_side
stonecuttertextures/blocks/stonecutter_top
loomtextures/blocks/loom_top
smithing_tabletextures/blocks/smithing_table_top
lecterntextures/blocks/lectern_top
belltextures/blocks/bell_side
lanterntextures/blocks/lantern
campfiretextures/blocks/campfire_log

交通工具类

Java ID基岩版路径
minecarttextures/items/minecart_normal
chest_minecarttextures/items/minecart_chest
furnace_minecarttextures/items/minecart_furnace
railtextures/blocks/rail_normal
powered_railtextures/blocks/rail_golden
detector_railtextures/blocks/rail_detector
boattextures/items/boat_oak
oak_boattextures/items/boat_oak

染料类

Java ID基岩版路径
white_dyetextures/items/dye_powder_white
orange_dyetextures/items/dye_powder_orange
magenta_dyetextures/items/dye_powder_magenta
light_blue_dyetextures/items/dye_powder_light_blue
yellow_dyetextures/items/dye_powder_yellow
lime_dyetextures/items/dye_powder_lime
pink_dyetextures/items/dye_powder_pink
gray_dyetextures/items/dye_powder_gray
cyan_dyetextures/items/dye_powder_cyan
purple_dyetextures/items/dye_powder_purple
blue_dyetextures/items/dye_powder_blue
brown_dyetextures/items/dye_powder_brown
green_dyetextures/items/dye_powder_green
red_dyetextures/items/dye_powder_red
black_dyetextures/items/dye_powder_black

最佳实践

  1. 使用资源包时:

    • 图片尺寸建议为 32x32 或 64x64
    • 使用 PNG 格式,支持透明度
    • 文件名使用小写字母和下划线
    • 路径使用 textures/gui/icons/ 前缀
  2. 选择图标类型:

    • 如果使用 Java 版物品,选择 icon_type: "java"
    • 如果使用自定义图标,选择 icon_type: "bedrock"
    • 如果使用网络图标,选择 icon_type: "url"
  3. URL 图标注意事项:

    • 确保使用 HTTPS 协议
    • 图片大小不宜过大
    • 考虑使用 CDN 加速加载
提示
  • 自定义图标必须通过基岩版资源包加载
  • 资源包可以在服务器或客户端加载
  • 图标路径区分大小写
  • 可以在 config.yml 中添加自定义映射
注意
  • 如果图标路径无效,将使用默认图标
  • 资源包需要符合基岩版的格式要求
  • 建议测试所有图标是否正常显示
  • URL 图标需要网络连接才能显示