Hello, I've been working on adding custom recipes to my server. I've accomplished adding them, however I can't find a way to remove a specific recipe based on it's NamespacedKey. Is there any way to get a specific recipe from it's NamespacedKey? Any help is appreciated!
Try using this https://hub.spigotmc.org/javadocs/s...getRecipesFor-org.bukkit.inventory.ItemStack- Also Control + F on that page for "recipes" for a few methods that handles the recipes
My own plugin, I've solved it already by using the RecipeIterator and getting the NamespacedKey name of each recipe
Im not sure if you know, but recipes reset each restart, you can just NOT register the recipe and next restart it'll wipe, they are not persistently saved anywhere.
Im not sure if you ever found a way to do this or not, but I recently added a method to Bukkit for removing recipes by key https://hub.spigotmc.org/javadocs/s...t.html#removeRecipe-org.bukkit.NamespacedKey-
Oh that’s helpful! I don’t think that existed when I made my method for removing by key. I’ll be sure to implement that, thanks!
Soooo... wouldnt it easyer to just use config for this? (if the recipe its enabled register it or not?) So it wont require any coding to place it back and such... Code (Text): if(config.getBoolean("isEmeraldSwordCraftable"){ getServer().registerRecipe(...); } ...
I’m making a plugin to add your own recipes. If you want to delete a recipe you shouldn’t have to restart the server to do it, so I want to remove it while the server is running. Regardless, I was able to solve this a while ago.