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

Custom Item NBT data not correctly reproduced #360

Closed
3 tasks done
Veyjinn opened this issue Apr 5, 2024 · 3 comments
Closed
3 tasks done

Custom Item NBT data not correctly reproduced #360

Veyjinn opened this issue Apr 5, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Veyjinn
Copy link

Veyjinn commented Apr 5, 2024

What happened?

When creating an custom item with the help of Itemsadder or the Give Command Item Generator (https://www.gamergeeks.net/apps/minecraft/give-command-generator/armor) the custom item is not being detected in the custom crafting recipe after reloading the plugin.

I've been trying to identify the issue for weeks now but with little to no success. The one thing I noticed is that sometimes when adding various types of nbt the recipe breaks. For example I've been trying to add knockback resistance. After modifying the recipe and reloading the plugin the recipe stops working.

I would really appreciate Your assistance in this matter.

How can the bug be reproduced?

An example command that has been used on a command block to create the custom item:

give @a iron_helmet{Trim:{pattern:host,material:iron},display:{Name:'["",{"text":"Iron Greathelm","italic":false,"color":"#6633ff"}]',Lore:['["",{"text":"It\'s a solid and","italic":false,"color":"gray"}]','["",{"text":"heavy piece of armor","italic":false,"color":"gray"}]','["",{"text":"(Upgrade 1/2)","italic":false,"color":"gray"}]','[""]','["",{"text":"〔","italic":false,"bold":true,"color":"#6633ff"},{"text":"TIER III","italic":false,"color":"#6633ff"},{"text":"〕","italic":false,"bold":true,"color":"#6633ff"}]']},Enchantments:[{lvl:2,id:protection}],Unbreakable:1,RepairCost:999999,AttributeModifiers:[{AttributeName:"generic.armor",Amount:1.3,Slot:head,Name:"generic.armor",UUID:[I;-12435,12450,92014,-24900]},{AttributeName:"generic.knockback_resistance",Amount:0.03,Slot:head,Name:"generic.knockback_resistance",UUID:[I;-12435,12750,92014,-25500]},{AttributeName:"generic.max_health",Amount:2,Slot:head,Name:"generic.max_health",UUID:[I;-12435,13050,92014,-26100]},{AttributeName:"generic.armor_toughness",Amount:1,Slot:head,Name:"generic.armor_toughness",UUID:[I;-12435,13350,92014,-26700]}],HideFlags:132}

Just try to create the armor and add it the customcrafting recipe

Expected Behaviour?

Custom armor should naturally be a part of Custom Crafting. The expected result is that custom armor should be recognized by the plugin.

Plugin version

customcrafting-spigot-4.16.9.1 & wolfyutils-spigot-4.16.15.1

Server software

paper-1.20.4-466 (newest 05.04.2024)

Relevant log output

No errors show on console

Submit issue

  • read the Wiki and especially the FaQ, and made sure there is no fix to your 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).
@Veyjinn Veyjinn added the bug Something isn't working label Apr 5, 2024
@Veyjinn
Copy link
Author

Veyjinn commented Apr 16, 2024

I've found a workaround by saving and reloading the custom armor recipe and copying the custom armor direct from the CC folder in the recipe editor. By doing this the copied armor is detectable in the crafting table

@WolfyScript
Copy link
Owner

Alright, I was able to replicate the issue. I'll work on a fix now.

@WolfyScript
Copy link
Owner

I have found a really weird behaviour from Spigot here.
The NBT from the item stored in the recipe and the item from the give command are exactly the same, still Spigot says they are not equal.
My suspicion is that the internal conversion Spigot is doing for items is messing things up.

Workarounds:

  • Moving the item around the player inventory seems to convert it too, and it suddenly works inside the recipe again.
  • Another workaround is to open the recipe via the creator and copy the item from the GUI using middle click.
  • If you have another recipe that produces the item, that works too.

So this is not something I can fix, but the workarounds make it work.

@WolfyScript WolfyScript pinned this issue May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants