📖
zAuctionHouse
DiscordGroupeZServeur Minecraft Vote
  • â„šī¸Informations
    • 🍾Getting started
    • 🔌Installing zAuctionHouse
    • ❓Why i need zMenu ?
  • Configurations
    • 🏤Official Configurations
    • Multi servers
    • 🚉Statistics
    • 📔Commands and Permissions
    • đŸĒ§PlaceHolders
    • âšī¸Buttons
    • 💲Economy
    • 🎊Convert
    • 🔍Search / Filter
    • Messages
    • 💱Prices
    • 👨‍đŸ’ŧWhitelist
    • 🛑Blacklist
    • 🚖Tax
    • Categories
    • 🇨đŸ‡ĩItem Translation
  • đŸ—ƒī¸Plugins files
    • Config.yml
    • 💲Economies.yml
    • Inventories
    • Patterns
    • Blacklist.yml
    • Prices.yml
    • Taxs.yml
    • Whitelist.yml
  • Development Portal
    • â„šī¸Informations
    • 🌆Events
    • đŸŦCustom storage
    • Filter
    • 🛑Blacklist
    • 💸Custom economy
  • 👴Old Configurations
    • Items
    • Buttons
    • Placeholder buttons
Powered by GitBook
On this page
  • Example:
  • Example potion:
  • Example player head:
  • Add player HEAD
  • Head Database
  • EpicHead
  • Now let's move on to the explanation of each element
  • Developer - Loading and saving an itemtack

Was this helpful?

  1. Old Configurations

Items

This page is valid for all plugins using the template developed by maxlego08 and using the loader system for itemstacks.

PreviousOld ConfigurationsNextButtons

Last updated 6 months ago

Was this helpful?

Example:

Here is an example of an item in a yml file:

item:
  material: 3
  data: 0
  durability: 0
  amount: 1
  glow: true
  lore:
    - "line"
    - "&cred line"
    - "&fwhite line"
  name: "&eMy awesome name"
  enchants:
    - PROTECTION_ENVIRONMENTAL,4
  flags:
    - HIDE_ENCHANTS

Example :

test2:
  item:
    material: POTION
    potion: "SPEED"
    splash: true
    extended: true
    level: 1
  type: NONE
  slot: 33

Example player head:

test3:
  item:
    material: PLAYER_HEAD
    url: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTM2ZTk0ZjZjMzRhMzU0NjVmY2U0YTkwZjJlMjU5NzYzODllYjk3MDlhMTIyNzM1NzRmZjcwZmQ0ZGFhNjg1MiJ9fX0="
  type: NONE
  slot: 34

Add player HEAD

You have to add HEAD in the item name to be able to display the head of the player who opened the GUI.

Example:

item:
    material: PLAYER_HEAD
    name: "HEAD&a%player_name%"

If you are below version 1.13 you have to do

item:
  material: SKULL_ITEM
  data: 3
  name: "HEAD&a%player_name%"

Head Database

item:
  material: hdb:<head id>
type: NONE
slot: 0

EpicHead

item:
  material: eh:<head id>
type: NONE
slot: 0

Now let's move on to the explanation of each element

  • material

  • data

The item data works only for versions lower than 1.13, the default value is 0.

  • amount

The number of items (from 1 to 64), the default value is 1.

  • durability

Allows you to change the durability of items, works only for armor and other items that use durability, the default value is 0.

  • name

Allows you to change the name of the item, by default the name is null.

  • glow

Allows to add an enchantment to the item and to add the HIDE_ENCHANTS flag

  • lore

Allows to change a lore of the item, by default the lore is null.

  • enchants

  • flags

  • modelID

Allows you to put a custom model data on an item

Developer - Loading and saving an itemtack

//Create class
ItemStackLoader loader = new ItemStackLoader();

//Load your confirguration
YamlConfiguration configuration = plugin.getConfig();

//You have to put a . at the end of your path to load the item.
String path = "item.";

//Load ItemStack
ItemStack itemStack = loader.load(configuration, path);

//Save ItemStack
loader.save(itemStack, configuration, path);

You can put the item ID for versions lower than 1.13 and you can put the material name for higher versions. List of materials:

Allows you to add enchantments, you have to put the name of the enchantment then the level of the enchantment, like this: ENCHANT,ENCHANT_LEVEL List of enchantments available:

This option is available for servers greater than or equal to the 1.8. List of flags:

To save and load an item you will have to use the class

👴
potion
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemFlag.html
ItemStackLoader