Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANVIL - Add option keep enchants of left #339

Open
2 tasks done
TheJoshue opened this issue Dec 10, 2023 · 2 comments
Open
2 tasks done

ANVIL - Add option keep enchants of left #339

TheJoshue opened this issue Dec 10, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@TheJoshue
Copy link

The Problem

As you can see on the images below, this custom recipe makes diamond chestplate into netherite one using 1 netherite ingot just like smithing table in 1.16 does. It would be neat if we could keep the enchant of left item somehow just like smithing table does.
We use this recipe because if we create this crafting recipe for smithing table, we get duplication bug which was reported on discord because of the amount of things we needed to explain to be more neat.

image
image
image

Solution

Add option in editing GUI to keep enchants of left too

Alternatives

/

Additional Context

/

Submit issue

  • searched for and ensured there isn't already an open issue regarding this,
  • are running the latest version of your server software (Spigot, Paper, etc.), and plugins (WolfyUtilities, CustomCrafting).
@TheJoshue TheJoshue added the enhancement New feature or request label Dec 10, 2023
@WolfyScript
Copy link
Owner

I'll look into adding an option to the GUI to make it easier to enable such functionality.

However, using the advanced config features explained on the Wiki (Especially the Target feature) allow for even more functionality.

Here's are two simple example configs showing how such functionality can be achieved.
Note that the recipe was created in 1.20.4 using the latest CC beta, so it is not compatible with older versions.
You can simply copy the target section to your configs result section, though.

Copy only the enchants

Copies the enchants from the first anvil ingredient to the result.

"@type" : "customcrafting:anvil",
group : "",
hidden : false,
vanillaBook : true,
priority : NORMAL,
checkNBT : false,
conditions {
  values : [ ]
},
base {
  items : [ {
    parser : "wolfyutilities:bukkit",
    amount : 1,
    weight : 1.0,
    stack {
      "==" : "org.bukkit.inventory.ItemStack",
      v : 3700,
      type : "DIAMOND_CHESTPLATE"
    }
  } ],
  tags : [ ],
  replaceWithRemains : true,
  allowEmpty : false
},
addition {
  items : [ {
    parser : "wolfyutilities:bukkit",
    amount : 1,
    weight : 1.0,
    stack {
      "==" : "org.bukkit.inventory.ItemStack",
      v : 3700,
      type : "NETHERITE_INGOT"
    }
  } ],
  tags : [ ],
  replaceWithRemains : true,
  allowEmpty : false
},
autoDiscover : true,
blockRepair : false,
blockRename : false,
blockEnchant : false,
repairTask {
  key : "customcrafting:result",
  result {
    items : [ {
      parser : "wolfyutilities:bukkit",
      amount : 1,
      weight : 1.0,
      stack {
        "==" : "org.bukkit.inventory.ItemStack",
        v : 3700,
        type : "NETHERITE_CHESTPLATE"
      }
    } ],
    tags : [ ],
    extensions : [ ],
    // This is the important part, copy this to your configs result section
    target {
      mergeOptions: [
        {
          slots: [ 0 ]
          adapters: [
            {
               key: "customcrafting:enchant"
            }
          ]
        }
      ]
    }
  }
},
repairCost : 1,
applyRepairCost : false,
repairCostMode : NONE

Copy the full NBT Tag

Copies the full NBT Tag from the first Anvil ingredient to the result.
Obviously, renaming function of the anvil will no longer work.

"@type" : "customcrafting:anvil",
group : "",
hidden : false,
vanillaBook : true,
priority : NORMAL,
checkNBT : false,
conditions {
  values : [ ]
},
base {
  items : [ {
    parser : "wolfyutilities:bukkit",
    amount : 1,
    weight : 1.0,
    stack {
      "==" : "org.bukkit.inventory.ItemStack",
      v : 3700,
      type : "DIAMOND_CHESTPLATE"
    }
  } ],
  tags : [ ],
  replaceWithRemains : true,
  allowEmpty : false
},
addition {
  items : [ {
    parser : "wolfyutilities:bukkit",
    amount : 1,
    weight : 1.0,
    stack {
      "==" : "org.bukkit.inventory.ItemStack",
      v : 3700,
      type : "NETHERITE_INGOT"
    }
  } ],
  tags : [ ],
  replaceWithRemains : true,
  allowEmpty : false
},
autoDiscover : true,
blockRepair : false,
blockRename : false,
blockEnchant : false,
repairTask {
  key : "customcrafting:result",
  result {
    items : [ {
      parser : "wolfyutilities:bukkit",
      amount : 1,
      weight : 1.0,
      stack {
        "==" : "org.bukkit.inventory.ItemStack",
        v : 3700,
        type : "NETHERITE_CHESTPLATE"
      }
    } ],
    tags : [ ],
    extensions : [ ],
    // This is the important part, copy this to your configs result section
    target {
      mergeOptions: [
        {
          slots: [ 0 ]
          adapters: [
            {
               key: "customcrafting:nbt/merge"
               query {
                includeAll: true
               }
            }
          ]
        }
      ]
    }
  }
},
repairCost : 1,
applyRepairCost : false,
repairCostMode : NONE

@TheJoshue
Copy link
Author

Thank you so much for this legendary comment really, extremely helpful!

Hey, sorry that i write this here, i see you are not really too much active on your discord server

Please check out a bug i reported at https://discord.com/channels/477026331096514571/498358213842960394/1183474253018959872
That is link to my message in your discord server, regarding duplication glitch related to smithing table, i spread all the details there with GIF how it is done and provided config files of CustomCrafting plugin, also server details followed with list of plugins & version command output

I will edit my comment and remove everything unrelated to this post when you reply on my messages on discord, i did not want to post here because my internet is bad lately and only place i can send because i have nitro is discord.

Thanks for understanding and if you read all of my comment thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants