How to create a reward GUI
Creating a rewards gui is simple, just create a new yml file in the UltraCollections/rewards
folder and use the template provided in this page. With what you've learned from How the GUI system works, you know that you need to define a item icon in the stucture for the item to show up. So follow these steps:
Instructions
Create yml
Fill it with the template
We've defined a "I" in the structure, now go in-game and hold your rewards item and run this command:
/collections setreward <reward_file> <reward_name> <item_icon>
The
reward_file
is the file you just made WITHOUT THE .YML, so a dirt_reward.yml would bedirt_reward
The
reward_name
is just a key lets set it tohelmet
for now.Now the
item_icon
, as we already have anI
in the stucture, lets useI
.Here is your final command:
/collections setreward dirt_reward helmet I
Now the item is added to the config file and in the GUI in-game.
Template
GUI:
title: Dirt Level 2 Rewards
category_name: dirt_level_2
structure:
- '# # # # # # # # #'
- '# # # # # # # # #'
- '# # # # I # # # #'
- '# # # # # # # # #'
- '# # # # # # # # #'
- '# # # # C # # # #'
ingredients:
filler:
gui_item: BLACK_STAINED_GLASS_PANE
item_icon: '#'
item_name: '&f'
item-lore: []
custom_model_data: 1069
close:
gui_item: BARRIER
item_name: '&cClose'
item_icon: C
item-lore: []
actions:
opengui: farming
play_sound:
sound: ENTITY_ITEM_PICKUP
volume: 1.0
pitch: 1.0
Example
GUI:
title: Dirt Level 2 Rewards
category_name: dirt_level_2
structure:
- '# # # # # # # # #'
- '# # # # # # # # #'
- '# # H I L B # # #'
- '# # # # # # # # #'
- '# # # # # # # # #'
- '# # # # C # # # #'
ingredients:
filler:
gui_item: BLACK_STAINED_GLASS_PANE
item_icon: '#'
item_name: '&f'
item-lore: []
custom_model_data: 1069
close:
gui_item: BARRIER
item_name: '&cClose'
item_icon: C
item-lore: []
actions:
opengui: farming
play_sound:
sound: ENTITY_ITEM_PICKUP
volume: 1.0
pitch: 1.0
helmet:
item_name: Helmet
item_icon: H
itemstack:
==: org.bukkit.inventory.ItemStack
v: 2586
type: LEATHER_HELMET
meta:
==: ItemMeta
meta-type: COLORABLE_ARMOR
display-name: '"Dirt Helmet"'
chestplate:
item_name: Chestplate
item_icon: I
itemstack:
==: org.bukkit.inventory.ItemStack
v: 2586
type: LEATHER_CHESTPLATE
meta:
==: ItemMeta
meta-type: COLORABLE_ARMOR
display-name: '"Dirt Chestplate"'
leggings:
item_name: Leggings
item_icon: L
itemstack:
==: org.bukkit.inventory.ItemStack
v: 2586
type: LEATHER_LEGGINGS
meta:
==: ItemMeta
meta-type: COLORABLE_ARMOR
display-name: '"Dirt Pants"'
boots:
item_name: Boots
item_icon: B
itemstack:
==: org.bukkit.inventory.ItemStack
v: 2586
type: LEATHER_BOOTS
meta:
==: ItemMeta
meta-type: COLORABLE_ARMOR
display-name: '"Dirt Boots"'