### Shop Item Configuration Example Source: https://wiki.gpplugins.com/economyshopgui/basics/commands Example YAML structure for an item within a shop section. ```yaml blocks: '23': #Index automatically generated and added to the end of the shop section's items material: iron_block buy: 20 sell: 2 ``` -------------------------------- ### YAML File Structure Example Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/about-yaml-yml-files This example demonstrates the basic structure of a YAML file for shop configuration, illustrating indentation levels, key-value pairs, lists, and comments. ```yaml #Shops file example: #The first level in a YAML file will have ZERO spaces before it ####The shop section CANNOT HAVE SPACES in it, but can use _ underscores. ####The shop section MUST MATCH EXACTLY with what you have defined in the sections.yml for it. Armor: #The next level has TWO SPACES before it. These lines are sub-parts of the defined value above (Armor) ####(shops.yml specifc) Note: ESGUI does not require the following value to be numerical. you can use words and most characters. ####This is the that will be used with the /shopedit command. ####It is reccomended to use numbers in 1.12 and lower, ####1.13+ has command-tab-complete that can assist in filling out the command, and naming your items here can be helpfull in this case. '1': #options are another level below the index/item, and have an additional two spaces fro mthe above line. #This line has FOUR SPACES before it. material: GRASS_BLOCK #There must be a space immediately after the : , Then a SINGLE SPACE, followed by the defined value. #Double quotes around the value are only required for values with special characters and spaces #still at FOUR SPACES as these options are more values for item '1' buy: 20 #### setting the value to a NEGATIVE number in either buy or sell will disable that option 'item cannot be bought/sold' sell: -1 lore: #in this case we are expecting lines of text, so we MUST enclose them with double-quotes "" #if you want to use double-quotes IN your line of text, you MUST 'Escape' it by printing it TWICE. (must still start and end with double-quotes) ####Minecraft chat color codes are supported - "example lore" - "&c""Second"" line of lore" enchantments: #another list-foramt is an array. mainly used for enchantments in ESGUI. #it uses the Enchantment_name immediately followed by a : and again immediately followed by the enchantment level - EFFICIENCY:5 - FORTUNE:3 ``` -------------------------------- ### Rotating Shop Configuration Example Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Example of a complete shops file for a rotating shop, demonstrating the structure for configuring items with display chances. ```yaml # Unlike regular shops, the items of a rotating shops are configured as below # Since this shop has 24 items in total, but only 6 display slots, ``` -------------------------------- ### Example Section Configuration Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/sections.yml A comprehensive example of a section configuration file for EconomyShopGUI, including enabling the section, setting its slot, title, visibility, economy type, and GUI behavior. ```yaml # This is an example section file which is only a reference for how section configs should be created in /sections/.yml # The file name defines the shop internal name and needs to match the filename for the section inside the shops folder # Example: # /sections/Food.yml -> /shops/Food.yml # /sections/Workstations.yml -> /shops/Workstations.yml # # If this does not match, an example section will be created with name '.yml', so make sure it matches! # Defines whether this section should be loaded at all enable: true # The slot of the section item inside the main shop screen slot: 5 # This is a required option # The title of the shop different from the shop name title: "&c&lExample_Shop" # Defaults to the item name if empty # Whether this shop section can be seen and accessed via the main shop # If a section is hidden, it will be only accessible through the direct shop command (/shop ) hidden: false # Whether this shop is a subsection, # subsections will be hidden from the main menu and cannot be opened via commands sub-section: false # Makes this section a simple display item to decorate the main shop GUI # Display items won't have a section linked and nothing will happen when a player clicks it inside the main shop GUI, # neither will this section be accessible via /shop display-item: true # The economy used within this section, this is the same format as the config.yml uses # See a list of all available economy types here: https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml#economy-provider economy: "ITEM:material:EMERALD name:&a&lGems" # If click commands are used within this section, should we close the shop after the click commands have been executed? # If disabled with click commands, the shop will open like normal while click commands are being executed in the background. close-menu: false ``` -------------------------------- ### Buy Screen Configuration Example Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml This example demonstrates the configuration for a buy screen menu, including items for adjusting quantities, confirming transactions, displaying selected items, and navigation actions. It also shows how to fill empty slots with specific glass pane materials. ```yaml # Buy screen buy-screen: menu-size: 6 items: 1: material: magenta_stained_glass_pane name: '%translations-min-thirty-two%' stack-size: 32 action: REMOVE32 slot: 29 2: material: magenta_stained_glass_pane name: '%translations-min-sixteen%' stack-size: 16 action: REMOVE16 slot: 20 3: material: magenta_stained_glass_pane name: '%translations-min-one%' action: REMOVE1 slot: 21 4: material: light_blue_stained_glass_pane name: '%translations-plus-one%' action: ADD1 slot: 23 5: material: light_blue_stained_glass_pane name: '%translations-plus-sixteen%' stack-size: 16 action: ADD16 slot: 24 6: material: light_blue_stained_glass_pane name: '%translations-plus-thirty-two%' stack-size: 32 action: ADD32 slot: 33 7: material: ender_pearl name: '%translations-buy%' lore: - '%translations-transaction-screen-total-price%' action: CONFIRM_TRANSACTION slot: 13 type: CONFIRM 8: slot: 31 type: SELECTED_ITEM lore: - 'ยง5x %amount%' 9: material: STRUCTURE_VOID name: '%translations-buy-stacks%' slot: 39 action: OPEN_BUY_STACKS 10: material: BARRIER name: '&cAbort' slot: 41 action: BACK # Fill items FillGrayTopLeftCorner: material: GRAY_STAINED_GLASS_PANE name: ' ' slot: 0-3,9,18 FillOrangeTopLeftCorner: material: ORANGE_STAINED_GLASS_PANE name: ' ' slot: 10 FillGrayTopRightCorner: material: GRAY_STAINED_GLASS_PANE name: ' ' slot: 6-9,17,26 FillOrangeTopRightCorner: material: ORANGE_STAINED_GLASS_PANE name: ' ' slot: 16 FillGrayBottemRightCorner: material: GRAY_STAINED_GLASS_PANE name: ' ' slot: 51-54,44,35 FillOrangeBottemRightCorner: material: ORANGE_STAINED_GLASS_PANE name: ' ' slot: 43 FillGrayBottomLeftCorner: material: GRAY_STAINED_GLASS_PANE name: ' ' slot: 45-48,27,36 FillOrangeBottemLeftCorner: material: ORANGE_STAINED_GLASS_PANE name: ' ' slot: 37 ``` -------------------------------- ### EconomyShopGUI Potion Item Configuration Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Example YAML configuration for setting up potions as shop items in EconomyShopGUI. Demonstrates basic and custom potion setups. ```yaml pages: pages1: items: 1: #a common craftable vanilla potion: material: POTION displayname: "Potion of Fire Resistance" buy: 11.9 sell: 2.98 potiontypes: - fire_resistance 2: #example of 'custom' potion: full list NOT Reccomended for survival servers!! material: POTION displayname: "&bSuperman Potion" name: "&bSuperman Potion" buy: 5000 sell: 50 potiontypes: - long_fire_resistance - long_night_vision - long_leaping - long_regeneration - long_strength - long_swiftness - long_water_breathing ``` -------------------------------- ### Example Item Material Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Specifies the material type for an item. ```yml material:ARROW ``` -------------------------------- ### Basic API Method Call Example Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Once the API is integrated, you can call its methods directly. This example shows a placeholder for calling a method named 'someMethod'. ```java EconomyShopGUIHook.someMethod(); ``` -------------------------------- ### Example Instrument Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Specifies the sound played by a goat horn. ```yml instrument:ADMIRE ``` -------------------------------- ### Example English Language File Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/languages This snippet shows a sample structure for the English language configuration file. Settings are generally self-explanatory. ```yaml settings: language: en currency_format: "#,###.##" locale: en_US # Messages # These are the messages that will be displayed to the player. # You can use color codes and placeholders here. # Example: &cThis is a red message! # Example: %player_name% joined the game! # General messages prefix: "&6[&eEconomyShopGUI&6]" no_permission: "&cYou do not have permission to use this command." player_only: "&cThis command can only be used by players." # Shop messages shop_title: "&lShop Menu" no_items_in_shop: "&cThis shop is currently empty." # Item messages item_added: "&a%item_name% &7added to your shop." item_removed: "&c%item_name% &7removed from your shop." # Economy messages not_enough_money: "&cYou do not have enough money to buy this item." successfully_bought: "&aYou have successfully bought %item_name% for %price%." successfully_sold: "&aYou have successfully sold %item_name% for %price%." # Other messages error_occurred: "&cAn error occurred. Please check the console." ``` -------------------------------- ### Querying Documentation via HTTP GET Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/about-yaml-yml-files You can dynamically query this documentation by performing an HTTP GET request to the current page URL with the 'ask' query parameter. This is useful for retrieving specific information or clarifications not explicitly present on the page. ```http GET https://wiki.gpplugins.com/economyshopgui/file-configuration/about-yaml-yml-files.md?ask= ``` -------------------------------- ### Example Item Name Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Sets a custom name for an item, supporting chat and hex colors. ```yml name:&9&lCustom coin ``` -------------------------------- ### Basic Shop Item Configuration Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml A simple shop item requires material, buy price, and sell price. This example shows how to configure two pages with different items. ```yaml pages: page1: # The page index gui-rows: 6 # Amount in rows (1 row is 9 slots) title: " &8<=== &aExample page &c1 &8===> " items: 1: # The item index (can be anything, not just numbers) material: milk_bucket buy: 20 sell: 2 page2: # The page index gui-rows: 2 # Amount in rows (1 row is 9 slots) title: " &8<=== &aExample page &c2 &8===> " # Per page title items: 1: # The item index (can be anything, not just numbers) material: gold_ingot buy: 9000 sell: 2800 ``` -------------------------------- ### SubSection Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Example configuration for a subsection. Key properties include 'enable', 'item' material, and 'sub-section: true' to identify it as a subsection. ```yaml enable: true item: material: OAK_LOG displayname: Wood slot: 4 sub-section: true ``` -------------------------------- ### Example Item ID Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Demonstrates how to assign an ID to an item, which is used for setting the currency's singular and plural forms. ```yml id:Bullets ``` -------------------------------- ### Item with Enchantment Configuration Example Source: https://wiki.gpplugins.com/economyshopgui/basics/commands YAML configuration for an item that includes enchantments. ```yaml tools: '12': material: iron_pickaxe buy: 300 sell: 30 enchantments: - efficiency:3 ``` -------------------------------- ### Shop Configuration with Subsections Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Example shop configuration linking items in the 'Blocks' section to their respective subsections ('Wood', 'Stone', 'Glass'). This defines the items available for purchase and their associated sections. ```yaml pages: page1: items: 1: material: OAK_PLANKS displayname: Wood Blocks buy: -1.0 sell: -1.0 section: Wood 2: material: COBBLESTONE displayname: Stone Blocks buy: -1.0 sell: -1.0 section: Stone 3: material: GLASS displayname: Glass Blocks buy: -1.0 sell: -1.0 section: Glass ``` -------------------------------- ### Shops.yml Spacing Example Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/about-yaml-yml-files Demonstrates the required indentation for pages, page numbers, GUI rows, items, and item properties in shops.yml files. ```yaml pages: #No spaces for the page declaration page1: #Two spaces for the page number gui-rows: 6 #Four spaces for the gui-rows item declaration items: '1': #Six spaces for the items themselves material: BOOKSHELF #Eight spaces for the items properties buy: 119.12 sell: 29.78 '2': material: HAY_BLOCK buy: 47.25 sell: 11.82 #Etc, and so on... ``` -------------------------------- ### Example Components Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Specifies raw component data for items in Minecraft 1.20.5+. Refer to the NBT converter for updates. ```yml components:{"minecraft:consumable":{},"minecraft:food":{nutrition:5,saturation:7.0f}} ``` -------------------------------- ### Rotating Shop Settings Example Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/sections.yml Configure the interval or frequency for item rotation, whether items can repeat, if broadcasts are enabled, and GUI page settings like rows and display slots. ```yaml shop-type: ROTATING rotating-shop-settings: #interval: 12h 30m 15s frequency: 0 0/30 * * * ? can-repeat: true broadcast: false # The different pages inside this section pages: page1: gui-rows: 3 display-slots: - 12 - 16 page2: gui-rows: 3 display-slots: - 10 - 14 ``` -------------------------------- ### Example Item Lore Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Defines the lore for an item, supporting chat and hex colors. Use '\n' for new lines. ```yml lore:This is a custom message &cYou can use &4&lcustom &ccolors aswell! ``` -------------------------------- ### Shop File Structure and Item Example Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Illustrates the basic structure of a shop configuration file, including page definitions, item indexing, and key-value pairs for item properties like material, name, price, and lore. This format is essential for defining shop contents. ```yaml ###### code formatting reference names: ###### pages: : items: : : #Single value key : #List-format must support multiple values. (lore, enchants, etc..) - - ###### example: ###### pages: page1: gui-rows: 6 title: "&dCustom title for this page" items: item1: material: PAPER name: "Egyptian Papyrus" buy: 6 sell: 2 lore: - "Papyrus from ancinet Egypt" ``` -------------------------------- ### Item with Multiple Enchantments Example Source: https://wiki.gpplugins.com/economyshopgui/basics/commands YAML configuration for an item with several enchantments listed. ```yaml tools: '12': material: iron_pickaxe buy: 300 sell: 30 enchantments: - efficiency:3 - fortune:2 - unbreaking:5 ``` -------------------------------- ### Example NBTData Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Sets raw NBT data for an item, such as damage or hide flags. ```yml NBTData:{Damage:50,HideFlags:127} ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/languages Use this method to ask questions about the documentation dynamically. Append the 'ask' query parameter with your question to the current page URL. The response will contain a direct answer and relevant excerpts. ```http GET https://wiki.gpplugins.com/economyshopgui/file-configuration/languages.md?ask= ``` -------------------------------- ### Example Skull Owner Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Sets the owner of a player head item. ```yml skullowner:Notch ``` -------------------------------- ### Example Enchantments Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Applies enchantments to an item. Multiple enchantments are separated by commas, with optional levels. ```yml enchantments:SHARPNESS:5,EFFICIENCY:5,MENDING,ecoenchants:BLAST_MINING:3,advancedenchants:STRIKE:2,excelentenchants:BLAST_MINING:3 ``` -------------------------------- ### Sections.yml Spacing Example Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/about-yaml-yml-files Illustrates the correct spacing for 'material', 'mode', and 'name' properties within sections.yml files. ```yaml enable: true slot: 19 title: '' hidden: false sub-section: false display-item: false fill-item: material: AIR nav-bar: mode: INHERIT item: material: GRASS_BLOCK displayname: '&2&lBlocks' name: '&2&lBlocks' ``` -------------------------------- ### Example Potion Types Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Adds potion effects to an item. Multiple effects are separated by commas. ```yml potiontypes:FIRE_RESISTANCE,STRONG_HARMING,LONG_INVISIBILITY ``` -------------------------------- ### Item Requirements Examples Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Demonstrates various conditions that must be met for a player to interact with a shop item. These include having specific items, permissions, levels, playtime, being in a certain region, or meeting placeholder conditions. ```yaml pages: pages1: items: 9: material: SPAWNER spawner-type: BLAZE displaylore: - "&aA advanced spawner only experienced players can use" buy: 1000000 sell: 250000 slot: 13 requirements: - "QUEST::firstAdventurer" # Requires the player to complete the 'firstAdventurer' quest - "TIME::22:00-06:00" # Requires the world time to be between 10PM and 6AM - "LEVEL::35" # Requires a minimum level of 35 - "REGION::warp_shop" # Requires the player to be insidee the shop warp - "ITEM::material:tripwire_hook components:{'minecraft:custom_data':{SecretKey:1}}" # Requires the Secret Key to buy/sell this shop item - "PLAYTIME::15m" # Requires a minimum playtime of 15 minutes - 'PERMISSION::!essentials.fly' # Checks if the player doesn't already have the 'essentials.fly' permission node - 'PLACEHOLDER::%player_biome%==SWAMP' # Requires the player to be inside a SWAMP biome - 'PLACEHOLDER::%votingplugin_total_daily%!=0' # Requires the player to have voted atleast once ``` -------------------------------- ### Example Stew Effect Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Sets the effects for a SUSPICIOUS_STEW item. Multiple effects are separated by commas. ```yml stew-effect:WITHER,POISON ``` -------------------------------- ### Query Documentation Dynamically Source: https://wiki.gpplugins.com/economyshopgui/file-configuration Perform an HTTP GET request with the 'ask' query parameter to retrieve specific information not explicitly present on the page. The question should be specific and in natural language. ```http GET https://wiki.gpplugins.com/economyshopgui/file-configuration.md?ask= ``` -------------------------------- ### Item with Modified Buy Price Example Source: https://wiki.gpplugins.com/economyshopgui/basics/commands YAML snippet showing an item with an updated buy price. ```yaml '23': material: iron_block buy: 123.45 sell: 15 ``` -------------------------------- ### Basic Section Configuration Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/sections.yml This is a fundamental example of a section configuration file. It defines the slot, title, economy type, fill item, navigation bar mode, and the display item for a shop section. ```yaml enable: true slot: 4 title: " &8>>--- &a&lFarming &r&8---<< " sub-section: false hidden: false economy: VAULT fill-item: material: "GRAY_STAINED_GLASS_PANE" nav-bar: mode: DISABLED item: material: WHEAT name: '&aClick to enter the farming shop' lore: - "0x00CB14Gather your farming supplies here!" ``` -------------------------------- ### Primary Section Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Example configuration for a primary shop section. This defines properties like slot, title, and the display item for the section. ```yaml enable: true slot: 19 title: '' hidden: false display-item: false fill-item: material: AIR nav-bar: mode: INHERIT item: material: GRASS_BLOCK displayname: '&2&lBlocks' name: '&2&lBlocks' ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/sections.yml Use this method to dynamically query the documentation for information not explicitly present on the page. The 'ask' parameter should contain a specific, self-contained question in natural language. ```http GET https://wiki.gpplugins.com/economyshopgui/file-configuration/sections.yml.md?ask= ``` -------------------------------- ### Empty Lore and Denied Message Example Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Demonstrates how to leave the lore and denied message fields empty for a requirement, resulting in no display lore or denied message being shown to the player. ```text :::: :: ``` -------------------------------- ### Custom Currency Formats Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml Configure the display format for different currencies, including singular and plural forms, and a friendly name for messages. This example shows formats for UltraEconomy, Vault, a custom item economy, and CoinsEngine. ```yaml currency-formats: ultra-economy:Gems: singular: "Gem" plural: "Gems" friendly: "Gems" vault: singular: "%currency-symbol%" plural: "%currency-symbol%" friendly: "money" item:Bullets: singular: "Bullet" plural: "Bullets" friendly: "Bullets" coins-engine:Cash2: format: "#,##0.#" abbreviations: enabled: true formats: - 'KK' - 'MM' - 'BB' ``` -------------------------------- ### Economy Provider - Get Balance Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Gets the player's balance using a retrieved EconomyProvider. ```java Double balance = provider.getBalance(player); ``` -------------------------------- ### Query Documentation API Source: https://wiki.gpplugins.com/economyshopgui/api To get specific information not directly found on a page, make an HTTP GET request to the page URL with the 'ask' query parameter. The question should be clear and self-contained. ```http GET https://wiki.gpplugins.com/economyshopgui/api.md?ask= ``` -------------------------------- ### Import ShopGUI+ Data (Summary) Source: https://wiki.gpplugins.com/economyshopgui/basics/commands Generates a summary of items, sections, and settings from ShopGUI+ for review before import. This does not directly modify current configurations. ```minecraft-commands /editshop import shopguiplus all ``` -------------------------------- ### Example Ignored Tags Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Ignores specific NBT or component data on an item. ```yml ignored-tags:enchantments,trim,food ``` -------------------------------- ### Example CustomModelData Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Assigns a CustomModelData tag to an item for custom textures or models. ```yml CustomModelData:1003 ``` -------------------------------- ### Querying Documentation with 'ask' Parameter Source: https://wiki.gpplugins.com/economyshopgui/basics Use this method to ask specific questions about the documentation. The response includes a direct answer and relevant excerpts. ```http GET https://wiki.gpplugins.com/economyshopgui/basics.md?ask= ``` -------------------------------- ### Item with Removed Enchantment Example Source: https://wiki.gpplugins.com/economyshopgui/basics/commands YAML snippet showing an item after an enchantment has been removed. ```yaml tools: '12': material: iron_pickaxe buy: 300 sell: 30 enchantments: - fortune:2 - unbreaking:5 ``` -------------------------------- ### Configure Custom Shop Background (ItemsAdder) Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Replace the main shop title in your language file with this format to use custom images as the shop background. Experiment with offset values for precise placement. ```properties inventory-main.shop-title: ':offset_0::filename_1::offset_0::filename_2:' ``` -------------------------------- ### Migrate Shop Database (Premium Only) Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to For premium users, this command migrates limited stock and sell limit data for shop items to the new database structure. Ensure you have backups and shops are already migrated to the new file structure before running. ```bash /eshop migrate economyshopgui V1toV2 --database ``` -------------------------------- ### Configure Multiple Buy Prices with require-all: true Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Use this configuration when all specified buy prices are required to purchase an item. The first payment option is the default. ```yaml pages: pages1: items: 11: material: MAGMA_CREAM buy-prices: require-all: true prices: - "Vault::40" - "ITEM:material:diamond id:CRYSTAL::2" - "ITEM:material:emerald id:Gems::30" - "ITEM:material:gold_nugget id:Gold::5" sell: 30 ``` -------------------------------- ### Get Economy Provider Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves an EconomyProvider for a given EcoType, allowing interaction with specific economy systems. ```java EcoType type = shopItem.getEcoType(); EconomyProvider provider = EconomyShopGUIHook.getEcon(type); ``` -------------------------------- ### PostTransactionEvent Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage This event fires after a shop transaction has been completed. It is useful for verifying transactions and sending alerts, for example, to DiscordSRV. ```APIDOC ## PostTransactionEvent ### Description The PostTransactionEvent is called after any shop transaction. This allows any plugin to listen and verify that a shop transaction has come through and check the result of the transaction. ### Event Details * Contains information about shop items involved, total quantity, total cost, transaction type, and the player. * Useful for logging, verification, and external alerts. ``` -------------------------------- ### Configure Item Stack Sizes for Selling Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml Defines configurations for selling items in various stack sizes. Each entry specifies the item material, name, lore, stack size, and the slot it occupies on the screen. The action is set to INSTA_SELL for all. ```yaml 4: material: '%selected_item%' name: '%translations-shopstand-click-to-sell%' lore: - '%translations-shopstand-total-price%' stack-size: 16 hideDefaultLore: true action: INSTA_SELL slot: 3 5: material: '%selected_item%' name: '%translations-shopstand-click-to-sell%' lore: - '%translations-shopstand-total-price%' stack-size: 32 hideDefaultLore: true action: INSTA_SELL slot: 4 6: material: '%selected_item%' name: '%translations-shopstand-click-to-sell%' lore: - '%translations-shopstand-total-price%' stack-size: 64 hideDefaultLore: true action: INSTA_SELL slot: 5 7: material: '%selected_item%' name: '%translations-shopstand-click-to-sell%' lore: - '%translations-shopstand-total-price%' stack-size: 128 hideDefaultLore: true action: INSTA_SELL slot: 6 8: material: '%selected_item%' name: '%translations-shopstand-click-to-sell%' lore: - '%translations-shopstand-total-price%' stack-size: 256 hideDefaultLore: true action: INSTA_SELL slot: 7 9: material: '%selected_item%' name: '%translations-shopstand-click-to-sell%' lore: - '%translations-shopstand-total-price%' stack-size: 512 hideDefaultLore: true action: INSTA_SELL slot: 8 ``` -------------------------------- ### Example Skull Texture Configuration Source: https://wiki.gpplugins.com/economyshopgui/basics/how-to Specifies a custom texture for a player head item using a base64 encoded string. ```yml skull-texture:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2ZkYWI0MDQzNGVkNWQwMWY1OGM0NWNhMGM5ZmFkYTQ2NjJlMTc3MmZmNDNlMjk3NDk3OTQ0MGE1Y2ZlMTVjOSJ9fX0= ``` -------------------------------- ### Set Up Discount Groups Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml Placeholder for defining discount groups and their associated percentages. Players with specific permissions can receive these discounts. ```yaml # Here you can set all discounts active inside the shop ``` -------------------------------- ### Get Item Sell Price Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves the sell price of a shop item for a given player, considering sell multipliers. ```APIDOC ## EconomyShopGUIHook.getItemSellPrice ### Description Gets an shop item's sell price, calculating any sell multipliers for the player. ### Method Java method call ### Parameters - **shopItem** (ShopItem) - The shopItem to get the price from - **player** (Player) - Player to check for multipliers - **item** (ItemStack) - The item to get the sell price for - **amount** (int) - The amount of the item ### Response - **sellPrice** (double) - The sell price of the item ``` -------------------------------- ### Configure Item Discounts Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml Define discounts for shop sections. Players with specific permission nodes receive percentage-based discounts on items within these sections. The 'all' placeholder can apply discounts globally. ```yaml discounts: # Section blocks Blocks: # Players with the permission node EconomyShopGUI.discounts.vip inside your permissions system will get 20% discount on every item inside this section. vip: 20 # Players with the permission node EconomyShopGUI.discounts.gold inside your permissions system will get 2.5% discount on every item inside this section. gold: 2.5 Farming: vip: 15 Redstone: diamond: 30 all: # Players with the permission 'EconomyShopGUI.discounts.lucky' will get a 1% discount on every item inside the shop lucky: 1 ``` -------------------------------- ### Command Configuration for Shop Items Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Configures commands executed on item buy, sell, or click. Supports player execution (p:), temporary OP execution (o:), and console execution. Placeholders like %player%, %quantity%, and %price% can be used. ```yaml #Example Command item: pages: pages1: items: 1: material: "GOLD_INGOT" displayname: "&8&lGet rich or unlucky." buy: 1000000 sell: 250000 giveItem: true click-commands: - "40::o:/playsound entity.ender_dragon.growl ambient" # Plays the sound effect 2 seconds after clicking the shop item buy-commands: - "/minecraft:give %player% diamond 2" - "/minecraft:give %player% emerald %quantity%" #This command gives out emeralds based on the amount of times the shop item was purchased - "p: repair hand" # This command is executed as the player - "o: i netherite_ingot 5" # This command is executed as the player having temp OP requireItem: true sell-commands: - "20::/minecraft:give %player% MILK_BUCKET 1" # Will be delayed by 1 second - "eco reset %player%" # This command will get executed as the console - "effect give %player% minecraft:nausea 255 255" ``` -------------------------------- ### Configure Multiple Sell Prices with give-all: true Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Use this configuration when players receive all specified prices for selling an item. The first price is the default if 'give-all' is false. ```yaml pages: pages1: items: 13: material: LEATHER buy: 50.0 sell-prices: give-all: true prices: - "Vault::40" - "item:material:diamond id:CRYSTAL::2" - "item:material:emerald id:Gems::30" ``` -------------------------------- ### Select Storage Type (SQLite/MySQL) Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml Choose the storage backend for the plugin. SQLite is suitable for local storage, while MySQL is for networked environments. ```yaml storage-type: SQLite ``` -------------------------------- ### Get Sell Limit Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves the current sell limit for a shop item for a specific player. Returns 0 for the free version. ```APIDOC ## EconomyShopGUIHook.getSellLimit ### Description Retrieves the current sell limit for a shop item for a specific player. Returns 0 for the free version of EconomyShopGUI to ensure version compatibility. ### Method Java method call ### Parameters - **shopItem** (ShopItem) - The shop item to check sell limit for - **playerUUID** (UUID) - The unique ID of the player ### Response - **sellLimit** (int) - The current sell limit of the item. Returns -1 if sell limit is reached. ``` -------------------------------- ### Get Item Stock Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves the current stock limit for a shop item for a specific player. Returns 0 for the free version. ```APIDOC ## EconomyShopGUIHook.getItemStock ### Description Retrieves the current stock limit for a shop item for a specific player. Returns 0 for the free version of EconomyShopGUI to ensure version compatibility. ### Method Java method call ### Parameters - **shopItem** (ShopItem) - The shop item to check stock for - **playerUUID** (UUID) - The unique ID of the player ### Response - **stock** (int) - The current stock limit of the item. Returns -1 if stock limit is reached. ``` -------------------------------- ### Configure Click Mappings Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/sections.yml Allows for custom click actions (BUY, SELL, SELL_ALL) for different click types (LEFT, SHIFT_LEFT, RIGHT, NONE) on shop items. These settings override global configurations. ```yaml click-mappings: BUY: LEFT SELL: RIGHT SELL_ALL: SHIFT_RIGHT ``` -------------------------------- ### Import EconomyShopGUI (Free) Data Source: https://wiki.gpplugins.com/economyshopgui/basics/commands Imports all existing shops, sections, and configurations from the free version of EconomyShopGUI to the premium version. Recommended for a smooth transition. ```minecraft-commands /editshop import EconomyShopGUI all ``` -------------------------------- ### Get Item Buy Price Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves the buy price of a shop item for a given player, considering discounts, multipliers, and dynamic pricing. ```APIDOC ## EconomyShopGUIHook.getItemBuyPrice ### Description Gets an shop item's buy price, calculating any discounts/sell multipliers, pricing multipliers and dynamic pricing for the player. ### Method Java method call ### Parameters - **shopItem** (ShopItem) - The shopItem to get the price from - **player** (Player) - Player to check for multipliers - **item** (ItemStack) - The item to get the buy price for - **amount** (int) - The amount of the item ### Response - **buyPrice** (double) - The buy price of the item ``` -------------------------------- ### Configure Multiple Buy Prices with default selection Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Use this configuration when players can choose from multiple payment options to buy an item. The first option in the list is the default. ```yaml pages: pages1: items: 12: material: GHAST_TEAR buy-prices: prices: - "ULTRA_ECONOMY:Gems::15" - "VAULT::40" - "ITEM:material:emerald id:CRYSTAL::5" sell: -1 ``` -------------------------------- ### Get Sell Price Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves the sell price for an item, performing several checks automatically. Returns an empty Optional if checks fail. ```java Optional optional = EconomyShopGUIHook.getSellPrice(owner, new ItemStack(Material.COBBLESTONE)); if (!optional.isPresent()) return -1; // The item was able to be sold, according all item limits SellPrice price = optional.get(); ``` -------------------------------- ### Get Buy Price Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves the buy price for an item, performing several checks automatically. Returns an empty Optional if checks fail. ```java Optional optional = EconomyShopGUIHook.getBuyPrice(owner, new ItemStack(Material.COBBLESTONE)); if (!optional.isPresent()) return -1; // The item was able to be sold, according all item limits BuyPrice price = optional.get(); ``` -------------------------------- ### Import Essentials worth.yml Sell Prices Source: https://wiki.gpplugins.com/economyshopgui/basics/commands Imports sell prices from the EssentialsX worth.yml file into EconomyShopGUI. Existing sell prices in the shops configuration will be overwritten. ```minecraft-commands /editshop import essentials worth.yml ``` -------------------------------- ### Item Flags Configuration Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Use item flags to hide default lore for specific item properties. This example hides dye and enchantment lore. ```yaml pages: pages1: items: CustomArmor: material: LEATHER_CHESTPLATE name: '&c&lVIP++ Armor' buy: 2500 sell: -1 armorcolor: "#44FF00" enchantments: - "UNBREAKING:10" - "PROTECTION:15" - "BLAST_PROTECTION::15" - "FIRE_PROTECTION:15" - "PROJECTILE_PROTECTION:15" - "THORNS:10" item-flags: - 'HIDE_DYE' - 'HIDE_ENCHANTS' ``` -------------------------------- ### Configure Multiple Sell Prices with default selection Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Use this configuration when players can choose from multiple payment options when selling an item. The first option is used by default for commands like /sellgui or /sellall. ```yaml pages: pages1: items: 14: material: RABBIT_HIDE buy: 50.0 sell-prices: prices: - "Vault::40" - "item:material:redstone::50" ``` -------------------------------- ### Get Specific Economy Type Price Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves the price for a specific economy type (e.g., VAULT) from a map of prices, returning -1.0 if not found. ```java double vaultPrice = buyPrices.getOrDefault(EconomyType.getFromString("VAULT"), -1d); ``` -------------------------------- ### Update Limits and Get Multiple Prices Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Updates stock limits and retrieves a map of all configured prices for an item. This is useful when supporting multiple economy providers. ```java price.updateLimits(); // Update all item limits set on items return price.getPrices(); ``` -------------------------------- ### Restore Global Stock/Limit After Time Source: https://wiki.gpplugins.com/economyshopgui/basics/limited-items The 'auto-restock-global' option allows items to restock their stock or limit automatically after a specified time, starting the countdown only when the limit is reached. ```yaml auto-restock-global: 10m ``` -------------------------------- ### Conditional Item Display (If Not Met) Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/shops.yml Configure items to be hidden or replaced with a placeholder if player requirements are not met. This example hides the item if playtime is less than 2 days. ```yaml pages: pages1: gui-rows: 3 items: netherite_block: material: NETHERITE_BLOCK buy: 22374 sell: 5593.5 requirements: - "PLAYTIME::2d" if-not-met: hide: true placeholder: material: BARRIER name: "&c&lRequires a playtime of atleast 2 days" ``` -------------------------------- ### Get Player Price Modifiers (Online Player) Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves all price modifiers currently set for a loaded, online player. Returns null if the player has no modifiers or is not loaded. ```java PlayerPriceModifier modifiers = EconomyShopGUIHook.getPlayerPriceModifiers(player.getUniqueID()); ``` -------------------------------- ### Configure MySQL Database Connection Source: https://wiki.gpplugins.com/economyshopgui/file-configuration/config.yml Set up connection details for a MySQL database, including host, port, credentials, and display cache settings for dynamic pricing and limited stock. ```yaml mysql: database: database host: localhost port: 3306 username: root password: password display-cache: 5m pool: maximum-lifetime: 1800000 idle-timeout: 600000 maximum-pool-size: 10 minimum-idle: 10 ``` -------------------------------- ### Import ShopGUI+ Data (Confirm) Source: https://wiki.gpplugins.com/economyshopgui/basics/commands Confirms and completes the import of ShopGUI+ data after reviewing the summary. This command finalizes the data transfer. ```minecraft-commands /editshop import shopguiplus all confirm ``` -------------------------------- ### Get ShopItem Object Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Retrieves a ShopItem object for a given player and ItemStack. Returns null if the item is not found, not sellable, or if the player lacks permissions or meets requirements. ```java ShopItem shopItem = EconomyShopGUIHook.getShopItem(player, item); if(shopItem == null) { return -1; // ShopItem does not exist/is not found, or the player doesn't have permissions } ``` -------------------------------- ### Update Limits and Get Single Price Source: https://wiki.gpplugins.com/economyshopgui/api/api-usage Updates stock limits and retrieves a specific price for an item, such as the Vault currency price. Returns -1 if the specified price is not configured. ```java price.updateLimits(); // Update all item limits set on items return price.getPrice(EconomyType.getFromString("VAULT")); ``` -------------------------------- ### Assigning All Sell Permissions with LuckPerms Source: https://wiki.gpplugins.com/economyshopgui/basics/permission Use these commands to grant players access to all sell-related features in EconomyShopGUI. This is useful if you don't need to restrict specific shop access for selling. ```bash /lp group default permission set EconomyShopGUI.sellall.all true ``` ```bash /lp group default permission set EconomyShopGUI.sellallitem.all true ``` ```bash /lp group default permission set EconomyShopGUI.sellallhand.all true ``` ```bash /lp group default permission set EconomyShopGUI.sellgui.all true ```