MagicPlugin icon indicating copy to clipboard operation
MagicPlugin copied to clipboard

Custom Armor -> Not Reading Properly

Open lashiam opened this issue 7 months ago • 36 comments

Custom wand armor is no longer taking the textures of the saved magic items. This is my usual process -> Obtain Armor from resource pack type /mitem save test_armor then in the code I put in the icon: test_armor For example;

stormrunners_sandals: name: '&#FFEE00S&#E3E41Ct&#C6D939o&#AACF55r&#8EC571m&#71BA8Er&#55B0AAu&#39A6C6n&#1C9BE3n&#0091FFe&#179DE3r &#45B6AAS&#5CC28Ea&#73CE71n&#8ADA55d&#A1E739a&#B8F31Cl&#CFFF00s' description: These sandals crackle with static energy. They were crafted from sky-forged leather, infused with bolts from Zeus' own hand. Wearing them grants the user unparalleled speed and mobility. inherit: false icon: zeus_boots quiet: true mode: none worn: true sets: zeus indestructible: true cast_interval: 5000 cast_spell: armor_check_99 attributes: dexterity: 8 force: 4

Whereas the Icon would be

zeus_boots: creator_id: 67f4346f-7203-4a3e-a439-ff92c2eda6c7 creator: MrSlushie96 worth: 0.0 item: ==: org.bukkit.inventory.ItemStack v: 4189 type: LEATHER_BOOTS meta: ==: ItemMeta meta-type: COLORABLE_ARMOR item-name: '{"text":"Zeus Boots","color":"white"}' custom-model-data: ==: CustomModelData floats: - 1022.0 flags: [] strings: [] colors: [] equippable: ==: Equippable slot: FEET equip-sound: minecraft:item.armor.equip_generic model: nexo:zeus dispensable: true swappable: true damage-on-hurt: true PublicBukkitValues: |- { "nexo:id": "zeus_boots" } color: ==: Color ALPHA: 255 RED: 147 BLUE: 200 GREEN: 169

It used to work just fine, but it's recently stopped working on the latest version for some reason.

lashiam avatar Jun 16 '25 04:06 lashiam

There were some changes to how custom model data works in 10.10.1 to fix issues in 1.21.5. Are you on the latest Magic release?

I don't have an RP with custom armor so I can't exactly test what you've done, but I did something similar?

/mgive leather_horse_armor{18001}
/mitem save test_armor
/wand
/wand configure icon test_armor

This seems to work, the wand has the appearance of the dragon head.

If this is somehow specific to leather armor it may be a little harder for me to test.

NathanWolf avatar Jun 16 '25 18:06 NathanWolf

I think the issue is the colors behind the leather armor, like the custom model data works fine, but I can’t input the colors. Is there anyway to do this?

lashiam avatar Jun 16 '25 18:06 lashiam

I’m on 1.21.4, latest version of Magic.

lashiam avatar Jun 16 '25 18:06 lashiam

Image

lashiam avatar Jun 18 '25 13:06 lashiam

Image

Ummm, does this help at all?

lashiam avatar Jun 18 '25 13:06 lashiam

Image Image

https://minecraft.wiki/w/Java_Edition_1.21.2

I think they changed the Equippables here, is it possible to add equippables to wands?

lashiam avatar Jun 20 '25 03:06 lashiam

That is true, I don't do much with item components.

Magic has its own system for custom armor that lets you wear any item on your head slot, but that's about it.

I'm confused as to what this has to do with the leather armor color, though?

NathanWolf avatar Jun 20 '25 14:06 NathanWolf

I thought you needed the leather armor color originally, but I was wrong, seems like it’s because of a component instead.

I just used to be able to have all my cool fancy armors work but now they don’t 😭

Also if I want to submit an Example, for example,

A “Greek based Example with 12 God classes” how would I go about doing that?

lashiam avatar Jun 20 '25 14:06 lashiam

Hm- well for the components, I will see if there is API support for any of that yet. I'd love to support arbitrary components but I'm trying to move away from NMS.

As for the example- that'd be really cool!

If you are git-savvy you could submit it as a PR. Clone this repo, add your files to the examples folder here:

https://github.com/elBukkit/MagicPlugin/tree/master/Magic/src/main/resources/examples

Then submit a PR

Otherwise if you can zip it up and upload it somewhere I'm happy to do that myself. New examples are always fun!

NathanWolf avatar Jun 20 '25 14:06 NathanWolf

xD i am not git-savvy but I'm sure ill figure it out.

Whats NMS?

lashiam avatar Jun 21 '25 03:06 lashiam

Hmm, do you thinks its possible to add attribute limiters and attributes to magic items instead of magic wands? For example, I could have a chest piece that has

armor_of_lightning: attributes: dexterity: 4 required_attributes: skill_level: 10

lashiam avatar Jun 22 '25 11:06 lashiam

Well a "wand" is basically just an item with magic properties. It doesn't have to cast spells or do anything special.

So you could make a chest piece that is a "wand" with such attributes, that's how magic armor is set up to work.

I think there are some examples in the (non-functional) RPG configs, but I can't remember offhand.

It's basically just a wand with no spells :)

NathanWolf avatar Jun 23 '25 14:06 NathanWolf

Right, that's how i normally have my armor, as a magic wand, but for some reason, the armor textures dont show when its a wand, they only show when its a magic item.

lashiam avatar Jun 23 '25 14:06 lashiam

Oooh, ok right, we've come full circle :joy:

I think the very first thing you posted should work. When I get a chance, I will test it myself.

The basic idea would be to make an item with the right equippable tag, then use that item as an icon for the wand.

I can't think of why that would've stopped working so I need to test it out and probably make some fixes. There were some changes to how wand icons work to support a wider variety of items so maybe I broke something there.

NathanWolf avatar Jun 23 '25 15:06 NathanWolf

I think it was the 1.21.2 changes to equipables

lashiam avatar Jun 23 '25 15:06 lashiam

If that's the case then it may be something we need to wait for Spigot to fix.

Item components like that saved to files use builtin Spigot item serialization to read and write the files, so I don't actually have control of that.

I'm still going to look into it, though, in case it's something I'm doing wrong on the "wand using an item as an icon" side of things.

NathanWolf avatar Jun 23 '25 22:06 NathanWolf

Did you want to check it out on my server? I can give you access to our host and server

lashiam avatar Jun 25 '25 17:06 lashiam

Excuse me, I think I've found a solution, but I need some help, I think I can make the Armors work if its possible to add the commands /mage attribute add and /mage attribute remove

instead of just set, since this way I could add certain amounts of attributes

lashiam avatar Jul 04 '25 11:07 lashiam

or if Wands could add Item: like the magic items can

ares_warchestplate: name: '&#FB0808Ares &#A00404chest&#440000piece' description: The Ares chestplate is a striking piece of armor, embodying the fierce essence of the Greek god of war. Crafted from gleaming bronze, it features intricate engravings of battle scenes and mythical creatures. Its imposing design offers both protection and intimidation, making it a symbol of strength and valor in combat. inherit: false icon: ares_chestplate item: ==: org.bukkit.inventory.ItemStack v: 4189 type: LEATHER_CHESTPLATE meta: ==: ItemMeta meta-type: COLORABLE_ARMOR display-name: '{"text":"Ares ","extra":[{"text":"Chestplate","color":"white"}],"italic":false,"color":"gold"}' item-name: '{"text":"Ares Chestplate","color":"white"}' custom-model-data: ==: CustomModelData floats: - 4211.0 flags: [] strings: [] colors: [] attribute-modifiers: minecraft:armor: - ==: org.bukkit.attribute.AttributeModifier amount: 30.0 slot: chest operation: 0 key: minecraft:3edeb2e2-2bcc-4f94-9806-d395f81cbda8 equippable: ==: Equippable slot: CHEST equip-sound: minecraft:item.armor.equip_generic model: nexo:ares dispensable: true swappable: true damage-on-hurt: true PublicBukkitValues: |- { "mythicmobs:prevent_crafting_with": 1b, "mythicmobs:prevent_repairing_with": 1b, "mythicmobs:prevent_smithing_with": 1b, "mythicmobs:type": "ARES_CHESTPLATE", "nexo:id": "ares_chestplate" } color: ==: Color ALPHA: 255 RED: 56 BLUE: 116 GREEN: 194

quiet: true keep: true mode: none worn: true class: ares indestructible: true cast_interval: 5000 cast_spell: armor_check_99 attributes: intelligence: 3 strength: 9 constitution: 10

I tested it out, but it looks like the wands don't pick up anything regarding the actual item besides for the icon.

lashiam avatar Jul 04 '25 11:07 lashiam

If that's the case then it may be something we need to wait for Spigot to fix.

Item components like that saved to files use builtin Spigot item serialization to read and write the files, so I don't actually have control of that.

I'm still going to look into it, though, in case it's something I'm doing wrong on the "wand using an item as an icon" side of things.

Hey Nathan,

Okay I talked to someone about the Armor issue, and he said that I should ask you for "ask the plugin owners to add support, if they dont have it, for the new equippable component equippable component"

Because i guess after 1.20, they changed the method of using leather armor and colors to components.

lashiam avatar Jul 05 '25 11:07 lashiam

Sorry I've let this sit for so long!

Do you know if it's working any better? I do think from what you've described, what needs to happen is:

  1. Spigot adds support for equippable components to their serialized item format, I would assume they've done this by now but I haven't checked myself
  2. You will need to recreate the custom armor and re-save them to replace the existing item
  3. Assuming that works (/mgive yourself the item to test it) then the wands should work again with that item as the icon

Let me know if it's still working, but since I'm using Bukkit item serialization I don't think there's anything I should or can do to add support for this, it's built in to Spigot/Paper.

NathanWolf avatar Aug 14 '25 16:08 NathanWolf

I can test it out again in a few hours, but it didn’t work the last time I checked

lashiam avatar Aug 14 '25 16:08 lashiam

Can you remind me what the plugin is that you're using for the custom armor? If it's free, I could try it out myself.

NathanWolf avatar Aug 14 '25 16:08 NathanWolf

? I just use Magic plugin and the resource pack

lashiam avatar Aug 14 '25 16:08 lashiam

Oh, I do use Nexo plugin in order to control my resource pack, but it’s not an armor plugin, just configures my rpack

lashiam avatar Aug 14 '25 16:08 lashiam

Oh... dang... I have apparently completely misunderstood this issue!

I thought you had some plugin for making custom armor.

Sorry.. ok, so .. the original item you posted, just used custom model data. And that used to work, to change the appearance of armor when worn?

But now it needs to use the equippable component instead, which would be referencing a specific model in the RP?

My confusion here is mainly that I thought CMD for armor appearances has never worked, except for items placed on your head .. and then it's more like an item attached to the head, not really custom helmets exactly. You're saying a chestplate or boots with CMD on it could show a custom appearance when worn on the chest/feet prior to 1.21.2?

NathanWolf avatar Aug 14 '25 16:08 NathanWolf

Umm it wasnt commands, it was more just, I would grab a custom armor texture, then I would use /mitem save custom_1 Then I would create a wand with the icon: custom_1 And it would work as custom armor

lashiam avatar Aug 14 '25 18:08 lashiam

Sorry if I'm being dense here, but what you do you mean by "grab a custom armor texture" ?

Like, where does that come from?

NathanWolf avatar Aug 14 '25 18:08 NathanWolf

/minecraft:give MrSlushie96 minecraft:leather_helmet{CustomModelData:700003,display:{"color":12321023}} 1

you can use this command, but with nexo, you can just do /nexo inv and then grab it from the inventory

lashiam avatar Aug 14 '25 18:08 lashiam

I think the problem is that command is outdated, according to what you've shown me CMD no longer works for this.

So you'd need a longer, more complicated set of commands that gives you an item with the equippable component set to a specific model in a resource pack.

But if Nexo can just give you the item, and that item works- then you should be able to /mitem save that item and it will keep working.

I'm trying to test this myself now by making an item with a custom overlay using the Equippable API, I'll let you know how that goes and what the saved item ends up looking like, if it works.

NathanWolf avatar Aug 14 '25 18:08 NathanWolf