Change texture when an item is eaten

Started by Kiwiio_Gaming on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Change texture when an item is eaten

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.
 

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It shouldn't be random,…
Fri, 05/15/2020 - 14:53

It shouldn't be random, there's nothing wrong with that procedure.

Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well, I don't know, but…
Fri, 05/15/2020 - 15:12

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?

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know what to do. First of…
Wed, 10/06/2021 - 16:16

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

 

 

 

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know this is somewhat an…
Thu, 11/11/2021 - 18:29

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.