Home - Maxlego08/zShop-API GitHub Wiki

Welcome to the zShop-API wiki!

Get ShopManager and InventoryManager


@Override
public void onEnable() {

	ShopManager manager = getProvider(ShopManager.class);
	InventoryManager inventoryManager = getProvider(InventoryManager.class);
}

protected <T> T getProvider(Class<T> classz) {
	RegisteredServiceProvider<T> provider = getServer().getServicesManager().getRegistration(classz);
	if (provider == null)
		return null;
	return provider.getProvider() != null ? (T) provider.getProvider() : null;
}

Commands

You have the command /zpl reload to reload the plugin.

Add player HEAD

First, you need to read this to understand how to add items.

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

Example:

test:
  item:
    material: PLAYER_HEAD
    name: "HEAD&a%player_name%"
    glow: true
    lore:
      - "&7Click to access the mobs"
  type: NONE
  slot: 31
  action: SUPERIOR
  placeHolder: "%statistic_mine_block%"
  value: 45
  else:
    type: NONE
    item:
      material: REDSTONE
      name: "&cVous n'avez pas la permission !"
      lore:
        - "&7Vous avez &f%statistic_mine_block% &7sur &345&7."

If you are below version 1.13 you have to do

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

Errors messages:

| Message: Unable to navigate to the (your inventory name) inventory, please contact an administrator to correct the problem. | How to solve: A button of type inventory trying to access an inventory that does not have the type DEFAULT.

Do you still have questions ?

You can come on discord: https://discord.gg/BuRreMD

Get ItemButton

inventoriesManager.getItemButton(itemStack)