Items: "DELETE_ITEM": Name: "Delete the item" Slot: 10 Lore: -Amogus is sus Material: BARRIER Action: "DELETE_CUBE" Basically i want when the item is clicked it gets its action name from config where the item is. I want to make it so every action has its own class and in that class there is a method execute where its specified what the action does All help is appreciated
1) You have already received answers on the previous thread. 2) Don't spam the forum with the same threads.
I actually found a thread where somebody had the same exact issue as you check here All of the answers are pretty solid.
What exactly are you looking for your question was answered pretty clearly and accurately. 1. Backtrack the item to the config 2. find action 3. use action in event if item matches ^ this is way less detailed than my previous answer on the last thread, but it exactly asks what you want. You will not be spoonfed code.
I think you have the wrong idea of what this category is for, its for helping other people with code, no one is going to spoon food for you here. What have you tried so far? What are you struggling with?
Well if you are building items from a configuration file there is obviously going to be some form of data on that item that would lead back to that item. Specifically since its in a GUI you can exploit its slot number. InventoryClickEvent 1.8.8 Now I like to store my GUI's in memory on top of having them in the config so this is much more of a trivial task for me as I'd call the InventoryBuilder and extract the information I need to continue without looping through the whole config, however if you do need to do that I would loop through everything grab until slot is equal to what you need it to be. Use that section and grab the action. This can all be done in a static method and you can pass it around to wherever you need. Now granted we are working with configuration files here I would check more than just the slot to be safe. Code (Java): public static String getActionFromConfig(FileConfiguration config, ItemStack stack){ // loop through config or grab data needed for path // other logic follows return action }
... how do i get the path of item that player clicked in config like maybe search for slot and then search where it has that slot number
https://tryitands.ee/ Also you havent asked my question, What are you struggling with, it seems like you are just waiting for somone to give you the code which isnt going to happen