SamuKata
magmaguy
magmaguy

patreon


The weird state of making custom armor for Minecraft servers

Hello everyone,

This is a bit of a different post. It is half-exploration, half-tutorial, and a little bit of showcase, going over how I was able to make the armor model you see above display, the limited options I had to do it and the bizarre limitations the system has.

Weapons - easy mode

First off, the weapons. They are the only item in the picture that is actually working as Minecraft intended. They were designed in Blockbench, exported with an animation and uses custom model IDs to display it. This is all relatively easily achievable through Minecraft and Blockbench, and there are guides online on how to do this.

However, there are some items that are extremely problematic. The bow and crossbow require several different models (in Minecraft each model you see as a bow or crossbow gets drawn is actually an entirely separate model). I have not done these yet, but I am hoping it won't be too problematic to implement.

Ultimately, even here, we have the downright impossible - tridents. Not only do tridents have different states, like bows and crossbows, but they also are a kind of unique item/entity due to the fact that you can throw them. Have you ever noticed that they're they only real 3d model in default Minecraft that you can hold in your hand? As it turns out, the closest we can get to modifying tridents is by relying on Optifine to retexture them. This would mean that we can't change what they look like, just what the colors of the trident are. As such, we had to give up on their custom models, and will be using the models we made for them for something else.

Helmets - medium difficulty

Here is a fun question: what am I wearing in this screenshot? Here is a hint: it can't be a helmet because Minecraft does not let you add extra geometry to a model (or animations, for that matter), so the only helmet shape someone can create is by texturing the default Minecraft helmet space.

That's right, what you see me wearing on my head in this screenshot is iron horse armor, a certified classic!

 Obviously, this is a bit problematic for a couple of reasons - it's not "real" armor and by default players can't put it in the helmet slot, plus it will look weird if you're not using a resource pack.

 

I do, however, have some ideas on how to bypass these issues. More specifically, I am considering using packets to send data when specific helmets are obtained or worn, such that the underlying item is actually a helmet but players get sent data about it being something else. I don't want to get too technical and I've not yet created this system, so I will leave it at that for now.

Regarding the animation and modeling, the process is actually pretty much identical to creating a sword, because it is basically the equivalent of wearing a sword with a custom model on your head. Minecraft just happens to allow players to wear random item models on their head, which is very convenient for stuff like this - and I am pretty sure that is not accidental.

Armor - hard mode

 

Now, I am going to say something that sounds weird, but is mostly true - it is basically impossible to add custom armor models to a Minecraft resource pack.

First of all, it is not possible to make it a "model". You can notice that the armor I am wearing in the screenshot is completely flat, unlike the sword and helmet. This is because I am limited to using the same technique that Minecraft uses for creating armors - making it a texture. They are really little more than a player skin, so we tried to compensate by making the helmets and weapons really pop out.

Secondly, the only "simple" method Minecraft gives you to do this in a resource pack is by replacing an existing armor. You can retexture diamond armor, or leather armor, or chain armor, or whatever other default armor you want, but you effectively permanently lose that armor's original look.

This is obviously not acceptable for EliteMobs, as we are trying to add to the game, not replace it.

So, to non-destructively add models to a resource pack in unorthodox ways, this is what I found (I will go over what I actually used in the end):

And now, the option I ended up going with

So, let's talk downsides with this approach.

First of all, this is a shader technique. This inherently makes it incompatible with any custom shaders someone might want to use. This is unfortunate, but there's not really another option here.

Secondly, this only has two layers I can work with. This is a problem because there are 4 armor slots - helmet, chestplate, leggings and boots. As listed above, we already figured out a solution for the helmet, so that is not a problem. However, we now have an inevitable tradeoff - out of the three remaining slots, only two can be accurately represented.

What this means is that in the picture above, though it looks like I have a chestplate, leggings and boots equipped, I only have a chestplate and leggings equipped. Worse, this happens if I equip boots:

Thirdly, there is a bit of complexity with creating the textures for this technique. This is what the chestplate texture file looks like:

 

The listing goes top to bottom, from index 0 to 19. We hope to raise enough money to create 20 different armor tiers, so I've already reserved the spaces they will be going to ahead of time to make it both easier to edit in the future but also to make it easier for any admins to try to edit it, if they can make sense of it.

Ultimately, in the plugin's logic, you can just count from the top to the bottom and that multiplied by 10 is the look of the armor at that level (so level 10, 20, 30, 40... all the way up to 200)

Fourthly, this technique requires using leather armor with specific colors. Fortunately the data doesn't leak through, so it is entirely possible to retain the ability to use normal colored leather armor, thus this is a 100% non-destructive way of approaching this problem. I might also use packets here to replace items, it is unclear as ultimately it is less necessary than for the helmet.

Conclusion

And, with all of this, now you know what it takes to non-destructively create a full armor set and weapons for your own server!

As a reminder, we are raising money to make all 20 different sets of armors and weapons. At the time of writing this, we have raised $430/$2000. A single full set costs about $100.

In case you didn't read the previous post about this, the plan is to make high level elite armor and weapons optionally drop with these cools skins, visually indicating that they are higher level. Now that the resource pack work is mostly sorted out and working, I will be releasing a video and a poll that will delve more in-depth into how exactly obtaining these models will work.

If you wish to contribute to getting more cool models and armor like this created, you can just send the money here! https://www.paypal.com/paypalme/magmaguy

If you found this post to be interesting, leave a comment saying so, or like (heart) the post! I am unsure as to how interested by this style of more technical showcase of what is going behind the scenes people are, and it does take a little while to write, so I only plan to do it again if people find this interesting.

By the time you read this, an announcement will probably already be up on discord saying that the resource pack has updated.

For now, just for testing purposes, you can get the items by running the following commands:

Helmets:

/minecraft:give <username> minecraft:iron_horse_armor{CustomModelData:X}

where X is a number between 1-5

Weapons:

/minecraft:give <username> minecraft:diamond_sword{CustomModelData:X}

where X is a number between 1-5. diamond_axe / diamond_hoe also has models. diamond_sword with data 6-10 is where we currently hid the trident models, which we plan to reuse differently.

Armor:

/minecraft:give <username> minecraft:leather_chestplate{display:{color:X}}

where X is a number between 0-19. There are new armors for 0, 4, 9, 14, 19. To get the leggings, run the same command but for leather_leggings.

That's it for now!

Happy retexturing,

The weird state of making custom armor for Minecraft servers

More Creators