Player Interface
All you need to know about the player interface file.
Since version 1.2.1, it is possible to fully customize the interface of player quests.
In this interface you must specify the size and name of the inventory and the position of the quest items and the player's head.
For all other boxes you can place any item you like.
There are three types of objects:
FILL
➜ An item that has no action. For this type, you only need to specify the material and the slot of the item.PLAYER_COMMAND
➜ Which will perform the commands on click as a player. For this type, you must specify a name, a description, a slot and a list of commands.CONSOLE_COMMAND
➜ Like the previous one, but the commands will be done by the console.CLOSE
➜ The click will close the interface.
Placeholders
For interface items of type CLOSE
, PLAYER_COMMAND
or CONSOLE_COMMAND
, you can put in the lore some placeholders.
To do that, you just have to add the line use_placeholders: true
in your quest configuration, at the same offset of the interface item type. Be carefull to not put it in the menu item section!
1:
type: PLAYER_COMMAND
use_placeholders: true
item:
material: IRON_BLOCK
name: "&cSay hello"
lore:
- "Total: %odailyquests_total%"
slot: 53
commands:
- "say hello"
You can also put placeholders on the player head in the same way:
player_head:
enabled: true
use_placeholders: true
item_description:
- "%player_name%"
Custom Model Data
In the player interface, you can specify a custom model data for the player's head and for different items.
For the player head, you need to add the
custom_model_data
parameter.For any other item, you need to add it in the
material
field, as the following example.
For example:
player_head:
enabled: true
slot: 5
custom_model_data: 1245 # custom model data for player heads
item_name: "&bYour quests"
item_description:
- "&eCompleted quests : &b%achieved%&e/&63"
- "&eNext draw in : &c%drawIn%"
items:
1:
type: PLAYER_COMMAND
item:
material: "custommodeldata:REDSTONE:1234" # custom model data for command items
name: "&cBack"
lore:
- "&eGo back to menu."
slot: 19
commands:
- "menu"
Oraxen & ItemsAdder items
You can specify for the menu item or in the required items an item from Oraxen or ItemsAdder. It's really simple, you just need to add oraxen:
or itemsadder:
before the name of the item.
For ItemsAdder, you also need to specify the namespace before the name of the item, like the example below. Finally, you also need to set use_itemsadder
to true
in the configuration file.
menu_item: "oraxen:my_item"
menu_item: "itemsadder:namespace:my_item"
required_item: "oraxen:my_item"
required_item: "itemsadder:namespace:my_item"
Don't forget to enclose the item names in inverted commas ("..."
), otherwise the file will be formatted incorrectly and the plugin will crash!
Custom head textures
You can also use custom head textures, from this website.
You just need to add a texture
field in the item
section. The value to put here is the Minecraft-URL
at the bottom of the head page. Be sure to use the Minecraft-URL
and NOT the Value
that is just before!
The syntax is the same as for Oraxen and ItemsAdder items.
// from https://minecraft-heads.com/custom-heads/decoration/60568-coin
menu_item: "customhead:ebda5f31937b2ff755271d97f01be84d52a407b36ca77451856162ac6cfbb34f"
required_item: "customhead:ebda5f31937b2ff755271d97f01be84d52a407b36ca77451856162ac6cfbb34f"
Multiple slots
If you want to set the same item on several slots, for a custom GUI for example, you can do it by creating a list of slots, like this:
quests: # set the position of quests items
1:
- 12
- 13
- 14
2: 21
3: 30
Here, the quest number 1 will be displayed on slots 12, 13 and 14.
It also works with the player head:
player_head:
enabled: true
slot:
- 8
- 17
Switch from version 1.3.6 to 2.0
If you upgrade from version 1.3.6 to version 2.0 of the plugin, you need to make some changes to get the player interface working.
As it is now possible to choose the number of daily quests, the first_quest_slot
, second_quest_slot
and third_quest_slot
elements no longer exist.
To set the position of quest items, there is now a quests
section, above the items
section. You must specify the quest number, followed by the position in the interface (which starts at 0).
For example, the following configuration...
# set the position of quests items
first_quest_slot: 12
second_quest_slot: 14
third_quest_slot: 16
Will become...
quests: # set the position of quests items
1: 12
2: 14
3: 16
To see the rendering in a whole file, you can look at the file just below.
Last updated