Jump to content

Recommended Posts

Posted

I’m struggling to deal with the textureing of shields.

I have the current code https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/blob/main/src/main/kotlin/io/github/realyusufismail/armourandtoolsmod/core/init/ItemInit.kt#L235 but I don’t get how to make the texturing of the shield work. Like link with it the shield json

Posted

the json part

	{
    "overrides": [
        {
            "predicate": {
                "pulling": 0
            },
            "model": "merctool:item/carbon_shield_relaxed"
        },
        {
            "predicate": {
                "pulling": 1
            },
            "model": "merctool:item/carbon_shield_blocking"
	        }
    ]
}
	

or the Item properties thing 

	    //###### ###### ###### ###### ###### ######
    public static void make_shield_shield(Item shield) {
        ItemProperties.register(shield, new ResourceLocation("pull"), (itemstack, warudo, le, p_174638_) -> {
        //ItemModelsProperties.register(item, new ResourceLocation("pull"), (itemstack, warudo, le) -> {
	            if (le == null) {
                return 0.0F;
            } else {
                float pull = (float)((( itemstack.getUseDuration() - le.getUseItemRemainingTicks() ) % 5 ) / 5.0F);
                //System.out.println( " ticks = " + pull );
                
                return (le.getUseItem() != itemstack )? 0.0F : pull; 
                        //(itemstack.getUseDuration() - le.getUseItemRemainingTicks()) / 20.0F;
            }
        });
	        ItemProperties.register(shield, new ResourceLocation("pulling"), (itemstack, warudo, le, p_174638_) -> {
        //ItemModelsProperties.register(item, new ResourceLocation("pulling"), (itemstack, warudo, le) -> {
            return (le != null && le.getUseItem() == itemstack) ? 1.0F : 0.0F;
        });
    }
	

 

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.