Pages » Sunlight » Modules » Gui
Commands
Command | Aliases | Description | Player only | Permission(s) |
---|---|---|---|---|
/gui [id] (player) | - | Open specified GUI. | Yes | sunlight.gui.cmd.gui sunlight.gui.cmd.gui.others |
Permissions
Permission | Description |
---|---|
sunlight.gui.gui.[id] | Allows to use GUI with specified id. |
GUI Sample
# GUI Title
title: '&bSample GUI'
# GUI Size.
size: 27
# When true, player will need a permission to use this GUI.
permission-required: true
# GUI Command aliases.
aliases:
- 'menu'
content:
# Your Custom Items.
custom-items:
# Item Display section.
# This section may contain multiple different formats that can be changed depends on certain conditions.
# So you can display different items for different players.
display:
# Display identifier. Must be unique.
# Use default identifier for default item that will be showed in any case if no other displays are available.
default:
# Display priority. Higher numbers will override.
priority: 1
# Display permission. Set to empty for no permission requirements.
permission: 'sunlight.item.1'
# Item options.
material: 'LEATHER_CHESTPLATE:0:1'
name: '&e&lCustom Items'
lore:
- '&7You can put any item in GUI'
- '&7with many options, such as:'
- '&6» &eName'
- '&6» &eLore'
- '&6» &eEnchant Glow'
- '&6» &eLeather and Potion Color'
- '&6» &eSkull Texture'
- '&6» &eHide Item Flags'
- '&6» &eUnbrekable'
# [Optional] Custom item model data from resourcepack.
model-data: 123
# [Optional] Item amount.
amount: 1
# [Optional] Item durability value.
durability: 10
# [Optional]
# Custom head texture. For player heads only.
# Some textures can be find here: https://minecraft-heads.com/
skull-hash: ''
# [Optional]
# Adds random enchantment to make item glow.
enchanted: false
# [Optional]
# Item color for Leather armor and Potions.
# Syntax: R,G,B. -1 will define random color (0-255).
color: 255,255,255
# [Optional]
# Makes item unbreakable.
unbreakable: false
# [Optional]
# Item Flags. Use '*' to apply all flags.
# All flags you can find - HERE -
item-flags:
- HIDE_ATTRIBUTES
- HIDE_ENCHANTS
# Custom Display Conditions.
conditions: []
# Item slots. You can provide multiple slots with a comma.
slots: '11'
# Custom Actions executed when item is clicked.
clicks: {}
conditions:
display:
default:
priority: 1
material: 'REDSTONE:0:1'
name: '&c&lCustom Conditions'
lore:
- '&eYou can define &ccustom conditions &eto'
- '&edisplay or hide specified items in the GUI.'
- '&eThese conditions can also be used on item click.'
- '&7'
- '&eSee, how changes this item, when'
- '&eyou have &c<100$ &eand when &c>100$&e!'
- ''
- '&eNow you have: &c$%vault_eco_balance_formatted%'
enchanted: true
conditions:
- '[VAULT_BALANCE] ~amount: <100;'
custom-1:
priority: 2
material: 'GLOWSTONE_DUST:0:1'
name: '&e&lCustom Conditions'
lore:
- '&eYou can define &ccustom conditions &eto'
- '&edisplay or hide specified items in the GUI.'
- '&eThese conditions can also be used on item click.'
- '&7'
- '&eSee, how changes this item, when'
- '&eyou have &c<100$ &eand when &c>100$&e!'
- ''
- '&eNow you have: &c$%vault_eco_balance_formatted%'
enchanted: true
conditions:
- '[VAULT_BALANCE] ~amount: >100;'
slots: '13'
clicks:
LEFT:
actions:
example:
target-selectors:
self:
- '[SELF]'
conditions:
list:
- '[VAULT_BALANCE] ~amount: >100; ~target: self;'
actions-on-fail: lower100
action-executors:
- '[MESSAGE] ~message: &aYou have more than 100$!; ~target: self;'
lower100:
target-selectors:
self:
- '[SELF]'
conditions:
list:
- '[VAULT_BALANCE] ~amount: <100; ~target: self;'
actions-on-fail: null
action-executors:
- '[MESSAGE] ~message: &cYou have lower than 100$!; ~target: self;'
actions-sample:
display:
default:
priority: 1
material: 'COMMAND_BLOCK:0:1'
name: '&d&lCustom Actions'
lore:
- '&fYou can execute &dcustom actions &fwhen player'
- '&fclick an item in GUI. Actions are fully custom'
- '&fso you can do whatever you want!'
- '&7'
- '&fTry to click this item by &ddifferent'
- '&fmouse keys including &dShift &fkey.'
enchanted: true
conditions: []
slots: '15'
clicks:
LEFT:
actions:
example:
target-selectors:
self:
- '[SELF]'
conditions: {}
action-executors:
- '[MESSAGE] ~message: &dLeft Click!; ~target: self;'
RIGHT:
actions:
example:
target-selectors:
self:
- '[SELF]'
conditions: {}
action-executors:
- '[MESSAGE] ~message: &dRight Click!; ~target: self;'
SHIFT_LEFT:
actions:
example:
target-selectors:
self:
- '[SELF]'
conditions: {}
action-executors:
- '[MESSAGE] ~message: &dShift-Left Click!; ~target: self;'
SHIFT_RIGHT:
actions:
example:
target-selectors:
self:
- '[SELF]'
conditions: {}
action-executors:
- '[MESSAGE] ~message: &dShift-Right Click!; ~target: self;'
MIDDLE:
actions:
example:
target-selectors:
self:
- '[SELF]'
conditions: {}
action-executors:
- '[MESSAGE] ~message: &dMiddle Click!; ~target: self;'
Information
Empty Block