Creating and Customizing a Menu
Creating a menu in PlayerProfile is a creative process. You can control every aspect of the display to create a unique profile for your server's players. All menu files are located in the plugins/PlayerProfile/menus/ folder.
The Basics: title-states, layout and icons
Each menu file consists of key parts: the title configuration (title and title-states), layout, and icons.
title&title-states: Sets the default menu name and allows changing the title dynamically depending on conditions.layout: This is the visual representation of your menu. You "draw" the inventory using characters. Each character is a reference to an icon.icons: Here you describe what each character from thelayoutis: what item, what name, and what actions it performs.
Simple Example:
# menus/default.yml
title: 'Player Profile %owner%'
# Optional: Dynamic titles based on conditions
title-states:
owner_title:
conditions:
- 'is_owner'
title: '&aYour Profile'
admin_title:
conditions:
- 'is_viewer'
- 'has permission: playerprofile.admin'
title: '&cAdmin View: %owner%'
rows: 3
layout:
- '######### '
- '#p#h#c#l#b'
- '#########'
icons:
'#': # Description for the '#' character
material: BLACK_STAINED_GLASS_PANE
display: ' '
'p': # Description for the 'p' character
type: STATUS
# ... and so onIcon Description (icons)
Each character in the icons section can have many parameters.
Basic Item Parameters
| Parameter | Type | Description |
|---|---|---|
material | string | The material of the item from Minecraft (e.g., DIAMOND_SWORD). |
item-adder | string | (Integration) The ID of the item from ItemsAdder (e.g., my_items:cool_sword). Replaces material. |
nexo | string | (Integration) The ID of the item from Nexo. Replaces material. |
craft-engine | string | (Integration) The ID of the item from CraftEngine (e.g., namespace:id). Replaces material. |
item-model | string | Sets the item component model (1.20.5+ / 1.21) via namespace key (e.g., custom:cool_sword). |
display | string | The name of the item. Supports & color codes and placeholders. |
lore | list of strings | The description of the item. Each string is a new element in the list. |
custom-model-data | number | Sets the CustomModelData for the item. |
glow | true/false | If true, the item will glow (enchantment effect). |
unbreakable | true/false | If true, the item will be unbreakable. |
texture | string | URL or Base64 texture for a player head. Only used if material is PLAYER_HEAD. |
Custom Glyphs / Fonts
The plugin supports custom font images in titles, displays, and lore. For CraftEngine, you can use <image:namespace:id> or :namespace:id:. For Nexo/ItemsAdder, use their standard placeholder formats (like :glyph_name:).
Functional Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | Key parameter! Defines the slot type. For example, HELMET will automatically show the player's helmet, and STATUS will show their status. More on types... |
actions | list of strings | A list of actions that will be executed when the item is clicked. More on actions... |
permission | string | The permission a player must have to see this item. If they don't have the permission, the slot will be empty. |
action-executor | string | Who can execute the action: OWNER (only the profile owner), VIEWER (only the one viewing), BOTH (both). Defaults to BOTH. |
States & Conditions (states & conditions)
This is the most powerful feature of the plugin. It allows a single character (icons) to look and behave differently based on conditions.
Imagine an icon 's'. You can make it so that:
- If the profile is being viewed by the owner,
's'will appear as "Settings". - If the profile is being viewed by an administrator,
's'will appear as "Admin Tools". - In all other cases, the
's'slot will be empty.
How it works?
Inside an icon's description, you create a states section. Within states, you list several states (state1, state2, etc.). Each state is essentially a complete item description with its own material, display, and actions.
The plugin checks the states in order (from top to bottom). The first state whose conditions are all met will be displayed.
If a state has no conditions, it will always be triggered (if reached).
List of available conditions (conditions)
| Condition | Description |
|---|---|
is_owner | true if the person viewing the profile is its owner. |
is_viewer | true if the viewer is not the owner. |
has permission: <permission> | true if the viewer has the specified permission (e.g., playerprofile.admin). |
lacks permission: <permission> | true if the viewer does not have the specified permission. |
placeholder '...' ... '...' | (PAPI) Compares the value of a placeholder. Placeholders are parsed from the perspective of the profile owner. |
Operators for placeholders:
equalsor==(equal to)notequalsor!=(not equal to)contains(contains text)is_greater_thanor>(greater than, for numbers)is_less_thanor<(less than)is_greater_or_equalor>=(greater than or equal to)is_less_or_equalor<=(less than or equal to)
Full example of an icon with states
Let's create an s icon (settings) that will be different for the owner, an admin, and a regular player.
# ...inside icons:
's':
type: DEFAULT # Default type
states:
# --- State 1: for the profile owner ---
state1:
conditions: # Condition:
- 'is_owner'
material: COMPARATOR
display: '&a⚙ Profile Settings'
lore:
- '&7Click to change'
- '&7your profile settings.'
actions:
- 'player: profile-settings' # Opens another menu (example)
# --- State 2: for an admin viewing another profile ---
state2:
conditions: # Conditions (both must be met):
- 'is_viewer'
- 'has permission: playerprofile.admin'
material: REDSTONE
display: '&c⚙ Admin Tools'
lore:
- '&7Manage player %owner%''s profile.'
actions:
- 'player: profile-admin %owner%' # Opens the admin menu (example)
# --- State 3: Empty slot for everyone else ---
# This state has no conditions, so it will trigger
# if state1 and state2 did not meet their conditions.
state3:
material: AIRImportant!
The order of states matters! Always place more specific conditions (e.g., for an admin) above more general ones.