Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- get shield item
- shield.addPropertyOverride(new ResourceLocation("yourmod", "blockheld"), new IItemPropertyOverride() {
- @Override
- @SideOnly(Side.CLIENT)
- public float apply(ItemStack stack, World worldIn, EntityLivingBase entityIn) {
- if stack == entity's main hand
- checkhand = offhand
- else checkhand = mainhand
- if (checkhand holding a block)
- return 1;
- else return 0;
- }
- });
- in the main shield.json
- {
- "parent": "builtin/entity",
- "overrides": [
- {
- "predicate": {
- "yourmod:blockheld": 1 // this the resourcelocation you made above. The JSON tests for a value greater than or equal to what we specify here. Predicates tested from top to bottom
- },
- "model": "yourmod:item/shield_with_block_held" // give it another item json
- }
- ]
- }
- in shield_with_block_held
- {
- "parent": "builtin/entity",
- <add your transforms>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement