Jump to content

How can change the texture of an item depending of the amount?


Recommended Posts

Posted

I want to add coins in minecraft and i want the texture to change depending of the ammount but im really new and i cant find a tutorial that teaches u how to do it step by step so please help me

image.png

kompreya-burton-minecraft-coins.jpg

Posted
18 hours ago, diesieben07 said:

Look at how the bow changes texture based on the pull amount. You need to register an IItemPropertyGetter to ItemModelsProperties.

Do u have a link?

 

Posted
18 minutes ago, BandytBoss said:

A link to a forum or something that shows me how to do it

Maybe look inside the class itself. That could always help.

Don't ever try and take the easy way out by trying to find some tutorial that tells you exactly what you need to copy-paste. Apply your knowledge in Java and adapt to the current situation.

Posted
1 hour ago, ChampionAsh5357 said:

Maybe look inside the class itself. That could always help.

Don't ever try and take the easy way out by trying to find some tutorial that tells you exactly what you need to copy-paste. Apply your knowledge in Java and adapt to the current situation.

Where do i find the class?

 

Posted (edited)

This post helped me when I was also tackling ItemModelProperties. You want to create a method in your item class that designates each itemstack change with a float, and register it with:

DeferredWorkQueue.runLater(() -> {
    ItemModelsProperties.func_239418_a_(
            ModItems.YOUR_ITEM, new ResourceLocation(MOD_ID, "your_item"),
            (stack, world, entity) -> YourItemClass.yourMethod(stack));
});

And then specify the texture overrides in your item model json. Also you can find vanilla classes in External Libraries => Gradle net.minecraftforge:forge:[version]

Edited by urbanxx001

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.