BananaPuncher714 / NBTEditor

A single class NBT editor for items, skulls, mobs, and tile entities
MIT License
138 stars 29 forks source link

dont work in 1.21 #37

Closed UnDeadlyDev closed 3 months ago

UnDeadlyDev commented 3 months ago

Tried to load invalid item: 'No component with type: 'null'; No component with type: 'null' missed input: {COSMETIC:{SPRAY:0}}'

FOR GET: int id = NBTEditor.getInt(item, "COSMETIC", "SPRAY");

FOR SET: return NBTEditor.set(icon, id,"COSMETIC", "SPRAY");

BananaPuncher714 commented 3 months ago

You will need to use NBTEditor.CUSTOM_DATA as an additional key to work with 1.21.

int id = NBTEditor.getInt(item, NBTEditor.CUSTOM_DATA, "COSMETIC", "SPRAY");

return NBTEditor.set(icon, id, NBTEditor.CUSTOM_DATA, "COSMETIC", "SPRAY");

This is because of how minecraft items are serialized/deserialized starting version 1.20.5.

UnDeadlyDev commented 3 months ago

Now work thanks and good job