Started by
xxx_fake_xxx
on
Topic category: Help with Minecraft modding (Java Edition)
I want to create a mod for my zombie apocalypse pack that will allow me to search corpses and visually display the armor in their inventory on them.
(in fact, it is a hybrid of a chest and an armor stand)
I have already prepared a graphical interface (GUI) and created a model with textures. And as far as I understand, in order for the armor to be displayed, you need an entity, not just a block.
How do I make a procedure for displaying armor taken from an entity's inventory? version 1 21 1 neoforge if needed
The zombie dies and spawns a static entity of a corpse, you want to display the armour that the zombie was wearing on the corpse entity? You could make it a block with different blockstates/models/textures, for the armour to show you need the relevant model/bone within your model, potentially some other data as well.
I would recommend getting the default zombie model on blockbench and using that to make your corpse model. Then check out the zombie.json model file and see if you need anything from there
For the procedure, on entity dies, you just make 4 itemstack local variables and save item in armour slot 0-3 to each variable. You then spawn your corpse entity or place the block and add 4 synced data integers to that entity. Set the integer to 1-6 for (1.leather,2.iron,3.chain,4.gold,5.diamond,6.netherite. also 7.turtle if you want or elytra etc), if your 4 variables are a different slot, so helmet, chestplate. leggings and boots. Then on entity spawn, the corpse, you add the armour to their inventory based on the values of the number variables.
I meant a survivor corpse sitting in my structure, and it has armor from other people's mods and other items in its inventory. When you remove its armor, it stops rendering on the model. But thanks for the idea with zombie corpses.
Damn, I can't seem to send the video I wanted to show it to you.
Well it’s the same for any model you need the same models so to use custom armor is only possible if it uses the default armor models otherwise you would need to add all the armor models to your model.
Then as before the model file may need additional data or the entity code.