Pommel - Held Item Models

Pommel - Held Item Models

Mod

Fabric mod that allows resource pack creators to overwrite the models for held items just like the spyglass and trident

Client DecorationEquipmentUtility

26.5k downloads
55 followers
Follow Save
Filter versions...

Additions

  • New predicate, pommel:is_enchanted
    • Value of 1 if item is enchanted or 0 if not
    • Based on if item has enchantment or stored enchantments nbt element(s)
  • Example JSON:
    {
      "parent": "minecraft:item/handheld",
      "textures": {
        "layer0": "minecraft:item/diamond_pickaxe"
      },
      "overrides": [
        { "predicate": { "pommel:is_held": 1.0 }, "model": "minecraft:item/pommel_held_models/diamond_pickaxe" },
        { "predicate": { "pommel:is_enchanted": 1.0 }, "model": "minecraft:item/diamond_pickaxe_enchanted" },
        { "predicate": { "pommel:is_held": 1.0, "pommel:is_enchanted": 1.0 }, "model": "minecraft:item/pommel_held_models/diamond_pickaxe_enchanted" }
      ]
    }
    

Additions

  • New predicate, pommel:is_enchanted
    • Value of 1 if item is enchanted or 0 if not
    • Based on if item has enchantment or stored enchantments component(s)
  • Example JSON:
    {
      "parent": "minecraft:item/handheld",
      "textures": {
        "layer0": "minecraft:item/diamond_pickaxe"
      },
      "overrides": [
        { "predicate": { "pommel:is_held": 1.0 }, "model": "minecraft:item/pommel_held_models/diamond_pickaxe" },
        { "predicate": { "pommel:is_enchanted": 1.0 }, "model": "minecraft:item/diamond_pickaxe_enchanted" },
        { "predicate": { "pommel:is_held": 1.0, "pommel:is_enchanted": 1.0 }, "model": "minecraft:item/pommel_held_models/diamond_pickaxe_enchanted" }
      ]
    }
    

Additons

  • Added new predicate: pommel:item_use.
    • Starts from value 0 when player starts to use/consume an item and ends at value 1 when player finishes using the item.
    • apple.json eating food example:
    {
      "parent": "minecraft:item/generated",
      "textures": {
        "layer0": "minecraft:item/apple"
      },
      "overrides": [
        { "predicate": { "pommel:item_use": 0.25 }, "model": "minecraft:item/apple_eat_0" },
        { "predicate": { "pommel:item_use": 0.50 }, "model": "minecraft:item/apple_eat_1" },
        { "predicate": { "pommel:item_use": 0.75 }, "model": "minecraft:item/apple_eat_2" }
      ]
    }
    
    • The time it takes to go from 0 to 1 is based on the item's use ticks.

Fixes

  • Fixed an issue where it would output to the console/log every time you used an item. Uhhh.. oops.

Additons

  • Added new predicate: pommel:item_use.
    • Starts from value 0 when player starts to use/consume an item and ends at value 1 when player finishes using the item.
    • apple.json eating food example:
    {
      "parent": "minecraft:item/generated",
      "textures": {
        "layer0": "minecraft:item/apple"
      },
      "overrides": [
        { "predicate": { "pommel:item_use": 0.25 }, "model": "minecraft:item/apple_eat_0" },
        { "predicate": { "pommel:item_use": 0.50 }, "model": "minecraft:item/apple_eat_1" },
        { "predicate": { "pommel:item_use": 0.75 }, "model": "minecraft:item/apple_eat_2" }
      ]
    }
    
    • The time it takes to go from 0 to 1 is based on the item's use ticks.

Additions

  • New predicate: pommel:is_misc_entity_holding
    • Value 1.0 will change the item held for Villagers, Witches, Pandas, and Foxes to the specified model

Changes

  • Villagers, Witches, Pandas, and Foxes no longer use predicate, is_held and will now use, is_misc_entity_holding

Fixes

  • Predicate, is_thrown now properly registers and will now work for thrown item entities
  • Fixed couple of ticks of is_using predicate changing item models in first person when swapping to a new item

Additions:

  • New predicate: pommel:first_third_person

    • Value of 0.5 changes the model specified when in first person, value of 1.0 changes the model when in third person.
    • Example JSON:
    {
      "parent": "minecraft:item/handheld",
      "textures": {
        "layer0": "minecraft:item/stick"
      },
      "overrides": [
        { "predicate": { "pommel:first_third_person": 0.5 }, "model": "minecraft:item/pommel_held_models/wooden_axe" },
        { "predicate": { "pommel:first_third_person": 1.0 }, "model": "minecraft:item/pommel_held_models/golden_axe" }
      ]
    }
    
    
    • Item will change to custom "wooden_axe" model when in first person, and will change to custom "golden_axe" model when in third person. Other cases will render "stick".

Fixes:

  • Using an item with is_used predicate will now properly reset when swapping to a new item. Before it could change item models for a couple ticks when you switch to a new item.
  • Fixed a crash when right clicking with a shield with a banner pattern, or other similar items that have component range values.
  • Predicate is_submerged will now properly work with thrown item entities. Item entities will now properly change to the specified is_submerged model when in water, and will stay in that state when out of water.
    • Before, item entities would only use the is_submerged model even when they weren't suppposed to.

Additions:

  • New predicate: is_using predicate will change the item model when you hold the use/right click with any item
  • is_using has an "interpolation" of ~1sec to swap to other item models over time as it changes back to the normal model when the player stops using said item
  • Thrown projectiles (eggs, snowballs, enderpearls, etc.) all use a new predicate: is_thrown
  • New predicate: is_submerged when the player is under minecraft:water (doesn't work with other liquids)
    • When an item entity is thrown into water but then is no longer in water (i.e. you remove the water) the item still stays in it's "submerged" state
  • is_using and is_submerged also change the item model in the gui

Changes:

  • Villagers, Pandas, and Witches all now use the is_held predicate instead of is_ground
    • Note that these entities will still also take the display settings of the Ground display settings for said model. If need be, you can change the Ground display rotation, translation, scale to make items look better when held in these entity's hands.
  • is_ground no longer changes the item model for thrown projectiles

Known Issues:

  • is_using - Using an item and quickly switching to another may change the item model for a couple ticks for the client player.

Additions:

  • New predicate: is_using predicate will change the item model when you hold the use/right click with any item
  • is_using has an "interpolation" of ~1sec to swap to other item models over time as it changes back to the normal model when the player stops using said item
  • Thrown projectiles (eggs, snowballs, enderpearls, etc.) all use a new predicate: is_thrown
  • New predicate: is_submerged when the player is under minecraft:water (doesn't work with other liquids)
    • When an item entity is thrown into water but then is no longer in water (i.e. you remove the water) the item still stays in it's "submerged" state
  • is_using and is_submerged also change the item model in the gui

Changes:

  • Villagers, Pandas, and Witches all now use the is_held predicate instead of is_ground
    • Note that these entities will still also take the display settings of the Ground display settings for said model. If need be, you can change the Ground display rotation, translation, scale to make items look better when held in these entity's hands.
  • is_ground no longer changes the item model for thrown projectiles

Pushing fix from 1.20.1 to 1.21.x

Fix for the mod, Knights & Heraldry

Resource packs can now change the item model when it is in an Item Frame (aka "Fixed") or when worn in the head slot.

New Item Predicates:

  • pommel:is_fixed - Used for when item is in an item frame
  • pommel:is_head - Used for when item is worn on head

Bonus Tip: If you use the mod, Arsenal (1.20.1 only), the mod's back slot uses the item frame render type for it. Feel free to use pommel:is_fixed to replace the back item (as seen below).

Player with custom item models for the head and on back (fixed/item frame) Replaces the carved pumpkin on head with an emerald.. just like a Sim. Sword on back with the use of Arsenal (1.20.1).

Backport to 1.20.1

Any resource packs made for 1.21.x are still compatible with this version of the mod.


Project members

TimmyChips

Member

Details

Licensed MIT
Published a year ago
Updated a day ago