Solved [1.14.4] Custom items in custom shapeless recipe

Discussion in 'Spigot Plugin Development' started by YourCoal, Sep 13, 2019 at 11:31 PM.

  1. Hello, I am currently wondering how to go about an issue. It is simple to have a custom recipe using vanilla items. However, when trying to use custom items to craft a custom item in shapeless recipes, you can use the vanilla item source to craft said item, not only its actual custom item you are supposed to use.

    What it SHOULD be like:
    [​IMG]
    This is the bug:
    [​IMG]

    When using RecipeChoice rc = new RecipeChoice.ExactChoice(custom item ID), it works fine for shaped recipes but not for shapeless, and would like to know if anyone knows of an alternative solution to this nasty bug? Because as it was mentioned*, it sounded as if this may not be fixed immediately.


    * https://hub.spigotmc.org/jira/browse/SPIGOT-5320
     
  2. theoretically, you could use the (dont quote the name) CraftPrepareEvent, check for the output, then check for input blocks, if they dont match your recipe, set the output to air
     
    • Useful Useful x 1
  3. Custom recipes in vanilla do not accept items with an nbt. Therefor, 'clean' items must be used, like minecraft:stone or minecraft:red_concrete. This will likely be implemented in a future update but Dinnerbone said on Twitter that it's very challenging.
     
  4. I am working on a system now that will work for that, a map storing required items and a map storing items in the crafting table, I am just running into problems with figuring out exactly to know what is what, though I think I am close to solving it, it's just the way I have custom recipes being stored. If I run into issues I'll for sure seek assistance, thanks for this idea!


    Shaped recipes do accept custom NBT, as seen here:
    [​IMG]
    Whether this is Spigot or Minecraft, I do not know. The only annoying bug about the recipe book is that itself won't check NBT data, but it will at least show the correct required item and only accept required items, not vanilla ones. Shapeless recipes just taking a big oof right now.
    But yes, I hope that Mojang does support this in the near future, it's kinda annoying (and I'd say a big deal) to fix this.
     
  5. EDIT: I got it to work perfectly by just checking that the recipe is a shapeless one. Thank you for the assistance :D
     
    • Friendly Friendly x 1