Started by
Kiwiio_Gaming
on
Topic category: Help with Minecraft modding (Java Edition)
Hi,
I'm currently creating a food mod and I made an item called "Grape" and I'd like that when I eat it, the item changes textures (5 textures in total).
Any solutions? Thank you.
It shouldn't be random, there's nothing wrong with that procedure.
Well, I don't know, but doesn't that give me the next item every time there's a problem with what I've done?
I know what to do. First of all don't remove if do blocks. They are the main thing in almost every procedure. Is simple, just make 5 different items of the grape with the staged texture, and add an if do block. In if, add is provided itemstack and add a red = block and in the left one add the is item thing and in the right side, add a minecraft component a red square and select your item and replace provided itemstack with item in the main hand of event/target entity. Then take the whole red = block with both these things, and put it in left side of a light blue = box and change it to and. Then in right side add is event target entity eating. Then in do, add remove 1 (your grape item) from event/target entity or just add set item in the main hand of event target entity = air. And below it, add (get item or set item) in the main hand of event target entity = (lower stage grape item). Just make seperate procedures with everything same but change the item to lower stage grape and repeat it till you have the lowest grade grape in which don't add get item in hand to lower, just remove item (or set item in hand to air) and don't add anything more. And it's done. This might sound complex to read, but trust me it's really simple :)
I'll share a ptpl file or screenshot of the procedures if I get time
I know this is somewhat an old post but you can still change item textures on the fly with nbt data. This is a vanilla function similiar to that of bow and fishing rod. its used mainly in texture packs, the nbt is called custom model data or something.