Custom Model Predicates

Quick rating

Community listing page, reviews here may not be monitored by the author.

Custom Model Predicates

No reviews yet

A forge mod that allows changing models based on stack size, nbt and other factors similat to Custom Item Textures (CIT)

Mod Loaders
Forge
Minecraft

Community voices

Reviews

List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Show per page
10
25
50
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

About

Project Details

Type
Mod
Latest Version
custommodelpredicates-1.16.4-1.2.jar

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID

Resources

External Links

Source Issues Wiki Discord

About

Description

Custom Model Predicates

Custom Model Predicates is a Forge mod that allows resource pack makers and mod devs to specify custom models for items based on name, nbt, stack sizes and more.

How it works

To start, this mod uses model replacement in a similar way to how resource packs work, but with a few key differences.

First, the json file must have `"loader": "custommodelpredicates:custommodelpredicates"` in order for it to be read by this mod

Second,  every json requires a base model that's used when none of the predicates match.

Third, this mod does not use the overrides array, but instead uses a new array called "predicates".

This array is checked BEFORE the "overrides" block that's seen in vanilla jsons.

This array can hold as many predicates as required although it's recommended to keep the count low to reduce lag.

Each predicate in the array is checked every time the model is rendered and returns the first one that matches.

Order Matters!

Predicates

a predicate is composed of the type of predicate it is, the requirements for matching it, and the model to return if it matches.  This list of supported predicates will be periodically updated as the mod matures

Supported predicates: 

Name: the name predicate is used to match when an item has a specific name, example:

    {
      "type": "name",
      "name": "aw man",
      "model" :  {"parent" :"item/gunpowder"}
    }

 Count:  The count predicate is used to match whenever an item has more than, less than, or equal to a specific number. 

Examples:

Greater:  This predicate matches when the stack size of the target is greater than the specified number

    {
      "type": "count",
      "count": ">2",
      "model" :  {"parent" :"custommodelpredicates:item/three_gold_ingots"}
    }

Lesser:  This predicate matches when the stack size of the target is less than the specified count

    {
      "type": "count",
      "count": "<3",
      "model" :  {"parent" :"custommodelpredicates:item/two_gold_ingots"}
    }

Equal:  This predicate matches when the stack size of the target is equal to the specified count

    {
      "type": "count",
      "count": "2",
      "model" :  {"parent" :"custommodelpredicates:item/two_gold_ingots"}
    }

nbt:  The nbt predicate is used to match whenever an item has a specific nbt tag of a specific value or range.

There are multiple types of nbt tags, the ones this mod is currently capable of matching are boolean, byte, short, int, long, float, double, and string.

All nbt types except for boolean and string support < and > range matches.  All nbt types support exact matches.  Use caution with floats/doubles when exact matching

In order for an nbt predicate to match, the item has to have the tag specified, and it needs to be within the range set.

Example:

This tag matches whenever the itemstack has the "test_number" tag of the type int, and that value is equal to 1.

    {
      "type": "nbt",
      "tag_name" : "test_number",
      "tag_type": "int",
      "require" : "=1",
      "model" :  {"parent" :"item/diamond"}
    }<br /><br /><br />

modid:  The modid predicate is used to test whenever the specified mod is loaded.

Example:

    {
      "type": "modid",
      "modid": "examplemod",
      "model" :  {"parent" :"item/iron_ingot"}
    }

 

There's some basic examples included on github (wip).


FAQ:

Q: Can you port this to (insert any version below 1.16.5?)
A: No.

Q: Can this work client side only?

A: Yes, it even works on vanilla servers.

Q: Can this load CIT resource packs?
A: No, but when this mod is mature it should be able to have an equivalent for all of Optifine's predicates.

Q: Can this be used in modpacks?
A: Absolutely, no matter where.

Contact info

Need a custom mod for a reasonable fee? Just want to chat? Have a complex issue needing additional discussion? Join the Discord:

discordicon.png
Want to help support this mod and others? donate to my Patreon in the link below
patreon.png

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~1,000
Downloads
Last Updated
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works