RockyHawk Wiki
Search…
Hotbar Items
Open a panel from an item in the hotbar
Add this if you want to open your panel with an item in the hotbar. You will need to have item characteristics such as "material:", "name:", "lore:", etc (make sure they are indented as per in the code example below).
You can use the example.yml panel that is generated when there are no panels in the panels folder to copy from.
  • Stationary This is used to determine which slot the item will be in the hotbar. The numbers you can use range from 0-35. If you do not want to permanently place items in the hotbar, remove this. Using 0-8 will place the item in the Hotbar, but using slots 9-35 will place the item inside of the players inventory.
  • Material What type of item would you like, use a material type here.
  • Name The name of the item.
  • Lore The lore the item will have. You can remove this if you do not want a lore.
  • Commands If you add a commands section to the hotbar item, it will no longer automatically open the panel, you will need to simply add a command to open the panel if you want to open it.
1
open-with-item:
2
material: CLOCK
3
name: '&aSurvival Panel'
4
lore:
5
- "&2Open the panel"
6
- "&2to heal yourself and change gamemode to survival."
7
stationary: 4
8
commands:
9
- open= examplePanel
Copied!
If you have something like data initialise using the pre-load-commands in a panel but you need them for the panel hotbar item too, you can add pre-load-commands directly inside this item and they will run just before the item is created.
1
open-with-item:
2
material: CLOCK
3
name: '&aServer Selector'
4
lore:
5
- '&7Your Level is %cp-data-playerLevel%'
6
pre-load-commands:
7
- 'add-data= playerLevel 1'
Copied!
If none of your panels include this feature, code that is not required will not run, which can speed up server timings.
Copy link