Mods / Trait Restrictions
- Tags:
- Author:
- Cheeki
- Side:
- Both
- Created:
- Sep 17th at 11:33 AM
- Last modified:
- 4 days ago
- Downloads:
- 4881
-
Recommended download (for Vintage Story 1.22.0-pre.1 - 1.22.7):
TraitRestrictionsV1.1.0.zip 1-click install
THIS MOD DOES NOTHING ON ITS OWN. IT REQUIRES A RACE MOD THAT IMPLEMENT THESE FEATURES.
Traits can restrict which items a character can use to attack or interact with or wear and can be used to override food items values and edibility.
For food overrides, you can specify Satiety, Health and the food category. These values are optional and will use the item's base value if omitted, provided it has any.
Items that are explicitly allowed as food will not be blocked if listed in DisallowedInteract. If a liquid (example: milk) is specified as disallowed, any containers with milk inside them will not let you drink it.
Items or wearables that are explicitly allowed will always be allowed even if disallowed, even by other traits. The order is Exclusive>Allowed>Disallowed. You can use this in combination with wildcards to disallow a lot of items at once but only allow one or two.
Items marked as exclusive will only be able to be used by classes that have those traits and disallowed for everyone else even if in AllowedItems. The wearable restriction system supports usage of: "type:all" "type:armor" "type:clothing "type:bag" to easily restrict one or both categories of wearables.
All this acts as normal trait stuff, so they go in trait.json.
{
"code": "exampletrait",
"AllowedItems": ["game:spear-generic-iron"], // Allows usage of the iron spear even if it's later disallowed
"DisallowedItems": ["game:spear-*"], // Blocks both attacking and throwing of all spears. Disallows both attack and interaction.
"DisallowedAttack": ["game:blade-falx-copper-*" ], // Blocks attacking only
"DisallowedInteract": ["game:bow-*", "game:bread-*" ], // Blocks use interaction only (includes eating the item). This makes the bow unusable and the bread inedible
"DisallowedAsIngredient": ["game:fruit-cloudberry" ], // Blocks eating the item and eating any meal or pie that contain the item
"ExclusiveItems": ["game:spear-generic-ornategold"], // Only classes that have this trait can use this item
"AllowedWearables": ["game:armor-*-tailored-*"], // Allows wearing all variants and parts of the linen armor, even if later disallowed by wildcards
"DisallowedWearables": ["type:armor", "game:clothes-nadiya-*"], // Blocks wearing all armors and the nadiya clothing. Available types: type:all, type:armor, type:clothing
"ExclusiveWearables": ["game:armor-body-antique-forlorn-*"] // Makes forlorn hope armor exclusive to owners of this trait only
"AllowedFood": {
"game:fruit-*": { "Health": 2 }, // Overrides fruit to give health, leaves satiety and food category untouched
"game:redmeat-raw-*": { "Satiety": 200, "FoodCategory": "Protein" }, // Makes raw meat edible
"game:charcoal": {} // Makes charcoal edible, but gives no nutrition
}
}
Used by:
Lupines
Animalica & Body tools and classes
| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 1.1.0 | traitrestrictions | 859 | 4 days ago | TraitRestrictionsV1.1.0.zip | 1-click install | ||
|
Bag type items are now checked if they are forbidden to be equipped. This falls under the wearable check. You can also use type:bag to restrict all bags. | |||||||
| 1.0.0 | traitrestrictions | 4022 | Sep 17th at 11:53 AM | Empty | TraitRestrictionsV1.0.0.zip | 1-click install | |

Hi, i have an issue ive written this code(
) for my mod and it registers because it shows the "you cannot wear this" message but i can wear and use the glider anyway.
I'll give it a look
if you need my mod list let me know, i will provide <3
no it's just i forgot about the existence of bag items and the bag slots. i'll fix it soon.
thank you, youre great :)
implemented.
<3
Thank you so much for this! Getting a similar system jerry-rigged has been a task and a half, and your mod turned all that effort into an easy, simple system that works without 70 revisions. This will save me many, many more weeks I would’ve spent fixing every little thing!
Also, Animalica Core, and my Body tools mod uses this now!
How would one go about making this mod work with mods other than Lupines?
It's extra stuff you can put in a race's traits. Same as other things that PML exposes, if in doubt you can check how Lupines does it.
Awesome mod, I would recommend it to everyone, even if it doesn't do anything for you there is no harm in having it.