Hello, I am messing around with somethings for a GUI. Server owners will be able to add the custom items they set in the config into the GUI. I know how to make the GUIs and trigger events and such but how can I fetch the set item from the config and then place it in the GUI? And how would I also be able to replace all of the %target% with the actual target player's name? My config.yml would look like this: Spoiler: Config Code (YAML): GUI: Main: Size: 54 Name: '&cPunish &7> &c%target%' Items: 1: Name: '&cBan' Lore: '&eAn example lore' Command: 'ban %target% %reason%' Slot: 5 Item: DIRT 2: Name: '&cMute' Lore: '&eAnother lore' Command: 'mute %target% %reason%' Slot: 18 Item: STONE
For String manipulation: https://docs.oracle.com/javase/tutorial/java/data/manipstrings.html For ItemStack serialization: https://www.spigotmc.org/wiki/itemstack-serialization/ You should at least look at all the info Spigot provides before asking in the Forums. It covers a lot of the basics of plugin development.
Learn how yml works and use the data to create an itemstack. You could replace the placeholders with string.replace("%target%", p.getName());
Why not just make a configuration file in a similar format? Code (Text): item: Item-1: name: "" lore: - 'My Lore' item: GOLD_INGOT Etc Then you can iterate over each item and get the strings as needed.