Vintage Story Mod DB · Vintage Story mod
Effectlib
Allows modders to create items that will give effects to players when used, either through json or code. Adds a command that allows admins to grant temporary effects or until death effects to players using /efflib. Required by current test build of alchemy 2
Quick answer
Which Effectlib release should I use?
Effectlib 1.1.1 targets 1.22.0, 1.22.1, 1.22.2. It must be installed on the client. Installation on the dedicated server is optional. No extra mods listed for this file.
Where it goes
Is Effectlib required on the client, server, or both?
It must be installed on the client. Installation on the dedicated server is optional.
This release supports both sides, but the source does not require it on the server.
What else does Effectlib 1.1.1 need?
1.1.1. Change the file and its required mods may change too.
This file does not list any required mods. Do not add a library just because a different file uses it.
This file does not list any required or optional mods.
Before you install it
Add Effectlib without breaking your instance.
Built for Effectlib 1.1.1. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 1.1.1. It targets 1.22.0, 1.22.1, 1.22.2; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
This file does not list any required mods. Do not add a library just because a different file uses it.
- 03
Put it on the correct side
It must be installed on the client. Installation on the dedicated server is optional.
- 04
Pick the file you checked
Use the “Get this file” button beside 1.1.1. It opens that exact file at the source.
About this project
What does Effectlib add?
Allows modders to create items that will give effects to players when used, either through json or code.
Adds a command that allows admins to grant temporary effects or until death effects to players using /efflib.
Required by current test build of alchemy 2.2.0-rc.10.
Some examples of pure json items are in Effectlib examples mod
If you want to look at the more complicated examples inside of the alchemy mod look here. The alchemy mod is a lot more complicated than just simple json items but allows for heavy config in game.
Here is a list of effect types find the one that suits your needs then copy and paste it to merge it into an item json. You can probably use them together if you want to.
The example json below is for items. For example a wand that grants you an effect you a speed bonus for x amount of seconds using its durability on use or a pill you consume to teleport you home.
// EffectLib: CONSUMABLE ITEM (eat or drink it to get the effect)// Merge "behaviors" and "attributes" into your item's JSON.// Everything is optional except effectId and one effect behavior (Choose CoatSource, EffectItem or both). Comment out (//) the lines you don't want. "behaviors": [ { "name": "EffectItem", "properties": { "consumeTime": 1.5, // Seconds to hold right-click. 0 = instant "consumeOnUse": true, // Use up 1 item from the stack, set this to false if you want them to be reusable "durabilityCost": 0, // If above 0 and the item has durability, it loses this much durability instead of being used up "animation": "eat", // e.g. "eat", "drink". Uses AnimationManager so it should take any animation set to the entity
// but I haven't tested it with many animations other than eat and drink "sound": "game:sounds/player/eat" // e.g. "game:sounds/player/drink". Uses Entity so again it should take any sound
// but again I have only really used it on eat or drink sounds so far
"attributeKey": "effectinfo", // Advanced: which attribute holds the effect definition. Default "effectinfo". Change it to give one item two
// effect behaviors with separate definitions, e.g. EffectItem reads "effectinfo" and EffectCarry reads "carryinfo"
"idField": "effectId" // Advanced: which field inside that attribute holds the effect id. Default "effectId"
} }, // Optional: hold in off hand, shift + right-click to coat the weapon/arrow in your main hand.
// Players you hit get the full effect. Creatures only get health and resetsEffects applied, there are some outliers like stats that could be applied but most effects won't ever work. { "name": "CoatSource", "properties": { "consumeTime": 1.5 } } ],
"attributes": { "effectinfo": { // ---- Identity ---- "effectId": "myeffect", // REQUIRED. Items with the same id share one effect and never stack. Most items should have different ids but you should share
// ids if you want upgrades for an item to make sure they never stack "hudIcon": "mymod:textures/hud/myeffect.png", // HUD icon. Default: the item's own icon. I would personally leave this line commented out unless you wanna start making
// a hud icon for every item
// ---- Timing ---- "duration": 120, // Seconds. -1 = until death. 0/unset = instant: only health + one-time actions (stats and certain utitlies need a duration).
"repeatSec": 30, // Re-run the one-time actions every N seconds while active
// Note: I haven't done much testing on -1 duration setting and repeatSec
// They are both new to effectlib so let me know if it needs improvements or bug fixing
// ---- Stacking and clearing ---- "replaceIfActive": true, // Can reuse while effect is already active to restart it, even if the server turned global refreshing off "exclusivityGroup": "elixirs", // Only one effect per group at a time. A new one replaces the old. This is used to make sure players
// can't just use every effect together making them a god. "resetsEffects": true, // Clear other active effects before applying... "resetDomains": ["mymod"], // ...from these mods ("*" = everything). Default: this effect's own mod "resetEffectIds": ["othermod:someeffect"], // ...plus these specific effects "channels": ["drink", "throw", "coat"], // Currently only for the Alchemy mod without some code. It declares which ways a potion can be used without ripping out the
// behaviour. This will probably be changed in the future
// ---- Stats: 0.2 = +20%, -0.2 = -20% ---- "stats": { "walkspeed": 0.2, "hungerrate": -0.2, "maxhealthExtraPoints": 0.25, // Fraction of max health, 0.25 = +25% max HP "healingeffectivness": 0.2, // Spelled like this in vanilla "rangedWeaponsAcc": 0.2, "rangedWeaponsSpeed": 0.2, "rangedWeaponsDamage": 0.2, "meleeWeaponsDamage": 0.2, "mechanicalsDamage": 0.2, // Damage against mechanical enemies "bowDrawingStrength": 0.2, "miningSpeedMul": 0.2, "oreDropRate": 0.2, "forageDropRate": 0.2, "wildCropDropRate": 0.2, "animalLootDropRate": 0.2, "animalSeekingRange": -0.2, // Negative = animals notice you from less far away "animalHarvestingTime": -0.2, // Negative = faster "vesselContentsDropRate": 0.2, "wholeVesselLootChance": 0.2, "rustyGearDropRate": 0.2, "armorDurabilityLoss": -0.2, // Negative = armor wears out slower "temporalGearTLRepairCost": -0.2 // Negative = cheaper translocator repairs
// This list probably could be expanded, if another mod creates new stats I would assume this would still work the same but at this point in time I don't think I will
// expand this list as it is just vanilla stats at the moment. It would probably require a lot of harmony patching and could get quite complicated with other mods.
},
// ---- Health ---- "health": 2, // HP. Positive heals, negative hurts. On its own: applied once "tickSec": 5, // With health: apply it every N seconds for the whole duration instead "damageType": "Poison", // Default: Heal if positive, Poison if negative.
// It takes the types from this enum from vintagestory EnumDamageType // Also: Fire, Frost, Heat, Acid, Electricity, Suffocation, Hunger, Injury, // Gravity, Crushing, BluntAttack, SlashingAttack, PiercingAttack
// ---- Abilities (last for the duration) ---- "glowStrength": 12, // Give off light, 0-31. The strongest active glow wins "waterBreathe": true, // Breathe underwater "coldResist": true, // Immune to cold damage by setting the player's temp to normal while active. (I don't think it stops frost damage) "canFly": true, // Fly freely. Server config can fully disable this feature (AllowFly) "noGravity": true, // Float, unaffected by gravity, this one is sorta strange. I wouldn't reccommend it but give it a try if you want.
// Server config can fully disable this feature (AllowFly) "canClimbAnywhere": true, // Climb any wall. Server config can fully disable this feature (AllowClimb) "disableClimbing": true, // Can't climb at all "climbTouchDistance": 0.5, // Extra climbing reach in blocks. Server config can fully disable this feature (AllowClimb) "noFallDamage": true, // No fall damage. Server config can fully disable this feature (AllowFall) "fallDamageReduction": 0.5, // Cut fall damage, 0-1 (0.5 = half). Server config can fully disable this feature (AllowFall) "knockbackResistance": 0.5, // Added to knockback resistance "weight": -20, // Kg added to body weight (I never really looked into what this actually does)
// ---- One-time actions (happen once when used) ---- "sizeChange": 0.4, // Grow (+) or shrink (-) height by N blocks. Lasts until death or a reset.
// Server config can fully disable this feature (AllowResize) "sizeMinHeight": 0.8, // This effect can't shrink you below this height (blocks) "sizeMaxHeight": 2.5, // This effect can't grow you above this height (blocks). Server limits always apply. Best to leave these as default
// by commentting them out but if you want players to not get too large or small via this alone item then its great to use "retainedNutrition": 0.5, // Pool all 5 food groups, keep this fraction, split it evenly between them "temporalStabilityGain": 0.3, // +0.3 = +30% temporal stability "respawn": true, // Teleport to your spawn point "blockRecallOnVessel": true, // (default true) Can't teleport while in a boat. HIGHLY RECOMMENDED TO LEAVE THIS ALONE but you can change it if you want "blockRecallOnMount": false, // (default false) Can't teleport while riding an animal "reshape": true, // Lets you reopen character creation once with .charsel "blockReshapeReentry": true // (default true) Can't use again until .charsel has been used. Turn off if the item is meant for multiple effects and
// not just charsel ability } }
The example json below is for containers and whats inside the container. You need to give the container a behaviour to allow it to understand that it will give the effects of whatever is inside the container. Part 1 belongs to the container. Part 2 belongs to the item inside the container.
// EffectLib: LIQUID (drink the liquid out of a container to get the effect)// Two parts, going in two different files:// PART 1 "behaviors" -> your liquid container block (bowl, jug, flask...)// PART 2 "attributes" -> the liquid itself (the portion item that goes inside the container)// Any liquid with an "effectinfo" works in any container that has these behaviors.// Everything is optional except effectId and one effect behavior (Choose CoatSourceLiquid, EffectLiquid or both). Comment out (//) the lines you don't want. // ---- PART 1: on the liquid container block ---- "behaviors": [ { "name": "EffectLiquid", "properties": { "consumeTime": 1.5, // Seconds to hold right-click. 0 = instant "consumeLitres": 0.25, // Litres drunk per use "checkLitres": 0.25, // Minimum litres needed to be able to drink (Usually leave blank or -0.01 than consumeLitres just in case of rounding errors) "animation": "drink", // e.g. "eat", "drink". Uses AnimationManager so it should take any animation set to the entity
// but I haven't tested it with many animations other than eat and drink
"sound": "game:sounds/player/drink" // e.g. "game:sounds/player/eat". Uses Entity so again it should take any sound
// but again I have only really used it on eat or drink sounds so far
"attributeKey": "effectinfo", // Advanced: which attribute ON THE LIQUID holds the effect definition. Default "effectinfo".
// Every liquid drunk from this container must use the same key. Barrel coating only reads "effectinfo"
"idField": "effectId" // Advanced: which field inside that attribute holds the effect id. Default "effectId"
} }, // Optional: hold in off hand, shift + right-click to coat the weapon/arrow in your main hand. // Players you hit get the full effect. Creatures only get health and resetsEffects applied, there are some outliers like stats that could be applied but most effects won't ever work. { "name": "CoatSourceLiquid", "properties": { "consumeTime": 1.5, "consumeLitres": 0.25, "checkLitres": 0.25 } } ], // ---- PART 2: on the liquid (portion) item ---- "attributes": { "effectinfo": { // ---- Identity ---- "effectId": "myeffect", // REQUIRED. Items with the same id share one effect and never stack. Most items should have different ids but you should share // ids if you want upgrades for an item to make sure they never stack "hudIcon": "mymod:textures/hud/myeffect.png", // HUD icon. Default: the item's own icon. I would personally leave this line commented out unless you wanna start making // a hud icon for every item // ---- Timing ---- "duration": 120, // Seconds. -1 = until death. 0/unset = instant: only health + one-time actions (stats and certain utitlies need a duration). "repeatSec": 30, // Re-run the one-time actions every N seconds while active // Note: I haven't done much testing on -1 duration setting and repeatSec // They are both new to effectlib so let me know if it needs improvements or bug fixing // ---- Stacking and clearing ---- "replaceIfActive": true, // Can reuse while effect is already active to restart it, even if the server turned global refreshing off "exclusivityGroup": "elixirs", // Only one effect per group at a time. A new one replaces the old. This is used to make sure players // can't just use every effect together making them a god. "resetsEffects": true, // Clear other active effects before applying... "resetDomains": ["mymod"], // ...from these mods ("*" = everything). Default: this effect's own mod "resetEffectIds": ["othermod:someeffect"], // ...plus these specific effects "channels": ["drink", "throw", "coat"], // Currently only for the Alchemy mod without some code. It declares which ways a potion can be used without ripping out the // behaviour. This will probably be changed in the future // ---- Stats: 0.2 = +20%, -0.2 = -20% ---- "stats": { "walkspeed": 0.2, "hungerrate": -0.2, "maxhealthExtraPoints": 0.25, // Fraction of max health, 0.25 = +25% max HP "healingeffectivness": 0.2, // Spelled like this in vanilla "rangedWeaponsAcc": 0.2, "rangedWeaponsSpeed": 0.2, "rangedWeaponsDamage": 0.2, "meleeWeaponsDamage": 0.2, "mechanicalsDamage": 0.2, // Damage against mechanical enemies "bowDrawingStrength": 0.2, "miningSpeedMul": 0.2, "oreDropRate": 0.2, "forageDropRate": 0.2, "wildCropDropRate": 0.2, "animalLootDropRate": 0.2, "animalSeekingRange": -0.2, // Negative = animals notice you from less far away "animalHarvestingTime": -0.2, // Negative = faster "vesselContentsDropRate": 0.2, "wholeVesselLootChance": 0.2, "rustyGearDropRate": 0.2, "armorDurabilityLoss": -0.2, // Negative = armor wears out slower "temporalGearTLRepairCost": -0.2 // Negative = cheaper translocator repairs // This list probably could be expanded, if another mod creates new stats I would assume this would still work the same but at this point in time I don't think I will // expand this list as it is just vanilla stats at the moment. It would probably require a lot of harmony patching and could get quite complicated with other mods. }, // ---- Health ---- "health": 2, // HP. Positive heals, negative hurts. On its own: applied once "tickSec": 5, // With health: apply it every N seconds for the whole duration instead "damageType": "Poison", // Default: Heal if positive, Poison if negative. // It takes the types from this enum from vintagestory EnumDamageType // Also: Fire, Frost, Heat, Acid, Electricity, Suffocation, Hunger, Injury, // Gravity, Crushing, BluntAttack, SlashingAttack, PiercingAttack // ---- Abilities (last for the duration) ---- "glowStrength": 12, // Give off light, 0-31. The strongest active glow wins "waterBreathe": true, // Breathe underwater "coldResist": true, // Immune to cold damage by setting the player's temp to normal while active. (I don't think it stops frost damage) "canFly": true, // Fly freely. Server config can fully disable this feature (AllowFly) "noGravity": true, // Float, unaffected by gravity, this one is sorta strange. I wouldn't reccommend it but give it a try if you want. // Server config can fully disable this feature (AllowFly) "canClimbAnywhere": true, // Climb any wall. Server config can fully disable this feature (AllowClimb) "disableClimbing": true, // Can't climb at all "climbTouchDistance": 0.5, // Extra climbing reach in blocks. Server config can fully disable this feature (AllowClimb) "noFallDamage": true, // No fall damage. Server config can fully disable this feature (AllowFall) "fallDamageReduction": 0.5, // Cut fall damage, 0-1 (0.5 = half). Server config can fully disable this feature (AllowFall) "knockbackResistance": 0.5, // Added to knockback resistance "weight": -20, // Kg added to body weight (I never really looked into what this actually does) // ---- One-time actions (happen once when used) ---- "sizeChange": 0.4, // Grow (+) or shrink (-) height by N blocks. Lasts until death or a reset. // Server config can fully disable this feature (AllowResize) "sizeMinHeight": 0.8, // This effect can't shrink you below this height (blocks) "sizeMaxHeight": 2.5, // This effect can't grow you above this height (blocks). Server limits always apply. Best to leave these as default // by commentting them out but if you want players to not get too large or small via this alone item then its great to use "retainedNutrition": 0.5, // Pool all 5 food groups, keep this fraction, split it evenly between them "temporalStabilityGain": 0.3, // +0.3 = +30% temporal stability "respawn": true, // Teleport to your spawn point "blockRecallOnVessel": true, // (default true) Can't teleport while in a boat. HIGHLY RECOMMENDED TO LEAVE THIS ALONE but you can change it if you want "blockRecallOnMount": false, // (default false) Can't teleport while riding an animal "reshape": true, // Lets you reopen character creation once with .charsel "blockReshapeReentry": true // (default true) Can't use again until .charsel has been used. Turn off if the item is meant for multiple effects and // not just charsel ability } } This is for an item that should allow for passive effects by just being inside the players inventory, hotbar or held. For example a charm that you hold on your offhand that shrinks the player but makes them faster.
// EffectLib: CARRIED ITEM (effect while the item is in your inventory or specified location)// Merge "behaviors" and "attributes" into your item's JSON.// Everything is optional except effectId and activation. Comment out (//) the lines you don't want.// Carried effects last as long as the item stays in inventory or specified location - there is no duration.// Not allowed here (ignored with a log warning): one-time actions (respawn, reshape, retainedNutrition,// temporalStabilityGain), resetsEffects, and health without tickSec.
"behaviors": [
{
"name": "EffectCarry",
"properties": {
"attributeKey": "effectinfo", // Advanced: which attribute holds the effect definition. Default "effectinfo". Change it to give one item two
// effect behaviors with separate definitions, e.g. EffectItem reads "effectinfo" and EffectCarry reads "carryinfo"
"idField": "effectId" // Advanced: which field inside that attribute holds the effect id. Default "effectId"
}
}
],
"attributes": { "effectinfo": { // ---- Identity ---- "effectId": "myeffect", // REQUIRED. Items with the same id share one effect and never stack. Most items should have different ids but you should share // ids if you want upgrades for an item to make sure they never stack (see "order" below) "hudIcon": "mymod:textures/hud/myeffect.png", // HUD icon. Default: the item's own icon. I would personally leave this line commented out unless you wanna start making // a hud icon for every item "activation": "held", // REQUIRED. "held", "hotbar" or "inventory" "hand": "either", // "main", "off", "either" (default) or "both" (the same item in both hands) // ---- Carry options ---- "toggle": true, // Right-click while holding it to switch on/off. It only works while on "notify": true, // Chat message when the effect switches on. Default false "order": 1, // Several items with the same effectId: only the highest order applies "exclusivityGroup": "rings", // Only one effect per group at a time. Items in hand win, then hotbar, then backpack. This is used to make sure players // can't just use every effect together making them a god. "allowWhenBroken": false, // Keep working at 0 durability "durabilityDrainIntervalSec": 60, // Lose durability every N seconds while the effect is on (item needs durability) "durabilityDrainAmount": 1, // Durability lost each interval. Default 1 "destroyWhenBroken": false, // Drained to 0: destroy the item instead of leaving it broken // ---- Stats: 0.2 = +20%, -0.2 = -20% ---- "stats": { "walkspeed": 0.2, "hungerrate": -0.2, "maxhealthExtraPoints": 0.25, // Fraction of max health, 0.25 = +25% max HP "healingeffectivness": 0.2, // Spelled like this in vanilla "rangedWeaponsAcc": 0.2, "rangedWeaponsSpeed": 0.2, "rangedWeaponsDamage": 0.2, "meleeWeaponsDamage": 0.2, "mechanicalsDamage": 0.2, // Damage against mechanical enemies "bowDrawingStrength": 0.2, "miningSpeedMul": 0.2, "oreDropRate": 0.2, "forageDropRate": 0.2, "wildCropDropRate": 0.2, "animalLootDropRate": 0.2, "animalSeekingRange": -0.2, // Negative = animals notice you from less far away "animalHarvestingTime": -0.2, // Negative = faster "vesselContentsDropRate": 0.2, "wholeVesselLootChance": 0.2, "rustyGearDropRate": 0.2, "armorDurabilityLoss": -0.2, // Negative = armor wears out slower "temporalGearTLRepairCost": -0.2 // Negative = cheaper translocator repairs // This list probably could be expanded, if another mod creates new stats I would assume this would still work the same but at this point in time I don't think I will // expand this list as it is just vanilla stats at the moment. It would probably require a lot of harmony patching and could get quite complicated with other mods. }, // ---- Health (needs tickSec on carried items) ---- "health": 1, // HP per tick. Positive heals, negative hurts "tickSec": 10, // Apply 'health' every N seconds while carried "damageType": "Heal", // Default: Heal if positive, Poison if negative. // It takes the types from this enum from vintagestory EnumDamageType // Also: Fire, Frost, Heat, Acid, Electricity, Suffocation, Hunger, Injury, // Gravity, Crushing, BluntAttack, SlashingAttack, PiercingAttack // ---- Abilities ---- "glowStrength": 12, // Give off light, 0-31. The strongest active glow wins "waterBreathe": true, // Breathe underwater "coldResist": true, // Immune to cold damage by setting the player's temp to normal while active. (I don't think it stops frost damage) "canFly": true, // Fly freely. Server config can fully disable this feature (AllowFly) "noGravity": true, // Float, unaffected by gravity, this one is sorta strange. I wouldn't reccommend it but give it a try if you want. // Server config can fully disable this feature (AllowFly) "canClimbAnywhere": true, // Climb any wall. Server config can fully disable this feature (AllowClimb) "disableClimbing": true, // Can't climb at all "climbTouchDistance": 0.5, // Extra climbing reach in blocks. Server config can fully disable this feature (AllowClimb) "noFallDamage": true, // No fall damage. Server config can fully disable this feature (AllowFall) "fallDamageReduction": 0.5, // Cut fall damage, 0-1 (0.5 = half). Server config can fully disable this feature (AllowFall) "knockbackResistance": 0.5, // Added to knockback resistance "weight": -20, // Kg added to body weight (I never really looked into what this actually does) "sizeChange": 0.4 // Grow (+) or shrink (-) height by N blocks while carried. // Server config can fully disable this feature (AllowResize) } }
Todo list:
- A lot of documentation (Currently its very minimal, I will try add code comments and documentation soon)
- Support for clothing
- Support for hotkey activation
- Finish alchemy and effect lib seperation (Nearly done I think)
Please provide feedback on any suggested improvements or any critiques on the code. Please let me know if you are using or planning to use this library. This library will get more updates the more I know modders are using this and I will be happy to list your mod on this page if you use this library.
Any questions, bug reports or suggestions go to vintage story discord and send a message on the effectlib post. You can still use github, comments below or forum but I will be more likely to see it on discord.
Project description from Vintage Story Mod DB.
Pick your setup
Effectlib releases for each Vintage Story version.
Choose the version and loader you play, then open the matching release.
1.22.6
1 loader build1.22.5
1 loader build1.22.4
1 loader build1.22.3
1 loader build1.22.2
1 loader build1.22.1
1 loader build1.22.0
1 loader buildCheck the dependencies, then try the file in a copied instance before changing a world you care about.
Recent files
Effectlib versions and loaders
1.1.1
effectlib_1.1.1.zip
27 Sept 2026
1.1.0
effectlib_1.1.0.zip
26 Sept 2026
1.0.1
effectlib_1.0.1.zip
14 Sept 2026
1.0.0
effectlib_1.0.0.zip
13 Sept 2026
Looking for an older file? The official Vintage Story Mod DB project page is in Resources.
