Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

forgive the clumsines also i dont speak the languague 

 i could'n figure out by miself how to make a item to change the model based on the state 
im making a custome shield just extending the vainilla shield it works blocks arrows and all 
now i want the shield to have 2 states two jsons

one for when relaxed 

 

 

and the other json model for when shielding 

 

those two models individually works as the videos prove know the troubles come here becoze from this point i dont understand a thing 
first of all the two models are named

"basemmod:item/carbon_shield_relaxed"

"basemmod:item/carbon_shield_blocking"

then im using the itembow as a base soo i let the shield whit same properties as the bow 

############

first problem 
based on answer from previous post i made a custome ModItemModelProperties class

but i dont have the lesser idea of how to apply this to the shield item 

	public class ModItemModelProperties {
	    //###### ###### ###### ###### ###### ######
    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;
        });
    }
}

where this class must gooo and how i declare it to works whith the shield ????

 

i made the parent json this way but donts work the shield is invisible i think is coze the missing step from the ModelProperties class before 
may it has also some errors i dont know yet

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

the shield item is invisible

image.png

carbon_shield_blocking

########## ########## ########## ##########
may the question be wrong formulated soo sorry before hand 

basically i want this shield to apply one of two json models based on if the item is in use 

 

Edited by perromercenary00
missing info

You're not understanding how the bow works. But even if so, you only have two models, so the bow doesn't make much sense. You basically need the default model, which I assumed is your relaxed, to have an item override to when a value is one, which can be determine by the item property, you use a different model. Your default model only needs to show the states it can switch to, not every possible state.

  • perromercenary00 changed the title to [solved][1.19.2] custome shield / shielding pose
  • Author

ya i found it 
mi base class was lacking client side 

	    @Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
    public static class ClientModEvents
    {
        @SubscribeEvent
        public static void onClientSetup(FMLClientSetupEvent event)
        {           
            ModItemModelProperties.make_shield_shield( ItemInit.CARBON_SHIELD.get() );
        }
    }


now i have some issues whit the model position and textures 
 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.