Skip to content

Adding command functionality

PizzaThatCodes edited this page Dec 25, 2023 · 1 revision

So, you want to add items to a inventory huh? Well, here's how!

First, you need to head to your config.yml (/plugins/DailyShop/config.yml), and find the guis: section. Once you have done that, find the item you want to add command functionality to.

When you have found that item, you will see two sections left-click-commands and right-click-commands, it doesn't matter which one you put it in, but they do trigger depending on click type!

Command Functionality

At the start of the command, you will need to specify if it's the player executing the command, if it's the console, or if you want to trigger a sound!

"[player]": This is if you want the player to execute the command (good for opening other gui's & if you want to do a command that requires a permission) example: "[player] dailyshop gui "

"[console]": This is if you want the console to execute the command (good for bypassing a player's permission and still send it) example: "[console] crate give %player_name% ..."

"[sound]": This is if you want to play a sound to the player, you will need to specify the sound type (If you are on 1.20.4: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html, if your on an older version, you might need to find a list somewhere else), then you will need to specify the pitch & volume, example of this: "[sound] BLOCK_COMPARATOR_CLICK 1 5"

Clone this wiki locally