Compatibility
Minecraft: Java Edition
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Details
Requires ASJCore (check files description for version info)
MineTweaker3/CraftTweaker addon for configuring attributes and other common stats for mobs, tools, weapons, and armor. Balancing your modpack never been so easy.
Open for feature requests.
Documentation:
Spoiler (click to show)
Note: All lines must start with mods.StatTweaker.
or use import (see example StatTweaker.zs).
Parameters are written in form of (parameter_name: Parameter_type)
:
EntityName
type — String literal (in double quotes like "this") of registry entity name (as seen in /summon command autocompletion). Can also be "~player~"
to change something in players.
Int
for Integer numbers. Float
and Double
are both for floating-point numbers; Double
is just with double decimal precision.
Question mark after type indicates that this value can be null
(no ? — no null
allowed) — use it if you want to leave that value unchanged.
Regarding material-changing functions, if a parameter is red-colored, its value won't reflect on items, only on material itself.
Warning: All functions may not work with one or the other mob/item/material because its code may be written in non-standard way. Known exceptions will be noted.
Entities:
Spoiler (click to show)
Changes default mob's attributes (if those are registered) base values. If maxHealth
was changed, entity's health will be set to max on spawn.
setDefaultAttributes(name: EntityName, maxHealth: Double?, followRange: Double?, knockbackResistance: Double?, movementSpeed: Double?, attackDamage: Double?)
Example: You want to increase Wither's maximum health by 3 times.
setDefaultAttributes("WitherBoss", 900.0, null, null, null, null);
Used to avoid above health set behavior. (ex: Wither's health charge when it raises health from 0 to 300 after summon structure is created; Gaia from Botania or Flügel from Alfheim are good examples too).
blacklistSetHealth(name: EntityName)
Example: Just adding the Wither, whose maximum health we previously extended to 900.
blacklistSetHealth("WitherBoss");
This will change how much hp entity gains from healing. You can change any original healing values (be it potions, natural creature regeneration, and others).
changeHealing(name: EntityName, old: Float, new: Float)
Example: If you change Wither's maximum health from 300 to 900, you may want to change its charging heal value from 10 to 30, so the animation won't break. And this won't reflect on its +1hp regeneration after it was fully charged — to change it to use 1 and 3 values.
changeHealing("WitherBoss", 10.0, 30.0);
changeHealing("WitherBoss", 1.0, 3.0);
Changes custom mob's attributes base values. Warning: this WON'T add new attributes.
setCustomAttributes(name: EntityName, attr: String, value: Double)
Example: You can make all Crimson Knights (Thaumcraft) have a runic shield.
setCustomAttributes("Thaumcraft.CultistKnight", "tc.mobmod", 4.0);
Set the maximum health of the mob.
setMaxHealth(name: EntityName, value: Double)
Example: Pigs should live longer.
setMaxHealth("Pig", 20.0);
Set the distance at which mobs will follow the player.
setFollowRange(name: EntityName, value: Double)
Example: Myopic (can't see beyond three blocks) skeletons will no longer bother you.
setFollowRange("Skeleton", 3.0);
Set the value of the knockback resistance. A value of 1.0 equals 100% knockback resistance.
setKnockbackResistance(name: EntityName, value: Double)
Example: Unmovable sheep!
setKnockbackResistance("Sheep", 1.0);
Set the value of the mob's movement speed.
setMovementSpeed(name: EntityName, value: Double)
Example: The cows are running around like stung.
setMovementSpeed("Cow", 0.5);
Set the damage value of the mobs.
setAttackDamage(name: EntityName, value: Double)
Example: Zombies are more dangerous now.
setAttackDamage("Zombie", 8.0);
Set new XP drop value for mob. Warning: this won't affect animals.
setXP(name: EntityName, newXP: Int)
Example: More slimes, more experience.
setXP("Slime", 1000);
Step height is how high animal can climb without jumping. Default is 0.5 — because of that, mob don't need to jump to get on slabs. You can put 1 to allow one block step or 1.5 to make it able to get over the fence. This won't reflect on jump height, though.
setStepHeight(name: EntityName, stepHeight: Float)
Example: The chickens now not only descend safely from a height, but also “fly” 5 blocks up.
setStepHeight("Chicken", 5.0);
Entity's hitbox sizes (as seen if you hit F3+B).
setSize(name: EntityName, width: Float, height: Float)
Example: Ocelots, true cats, will now get into narrow spaces (like under slabs).
setSize("Ozelot", 0.5, 0.5);
Adds new regeneration value for every set amount of ticks entity existed in world.
addHealing(name: EntityName, frequency: Int, amount: Float)
Example: Mooshrooms are worthy of regenerating at any time.
addHealing("MushroomCow", 20, 1.0);
Adds (or changes) mob's NBT values. NBT string syntax is the same as tag syntax in /summon command, NOT as default MineTweaker syntax. Suggestion: use NBTEdit mod to see NBT tags in mobs.
addNBT(name: EntityName, nbt: String)
Example: Creepers are full of energy, like they've been struck by lightning.
addNBT("Creeper", "{powered:1}");
Materials:
Spoiler (click to show)
Armor repair materials.
changeArmorRepairMaterials(material: String, resources: ItemStack[])
Example: Why not repair diamond tools and armor with emeralds.
changeArmorRepairMaterials("DIAMOND", [<minecraft:diamond>, <minecraft:emerald>]);
Tool repair materials.
changeToolRepairMaterials(material: String, resources: ItemStack[])
Example: Stone tools should be repaired with stone, not just cobblestones. That makes sense.
changeToolRepairMaterials("STONE", [<minecraft:cobblestone>, <minecraft:stone>]);
Armor material properties. Durability Factor is NOT the durability itself, just multiply factor for default values.
armorProperties(name: String, durabilityFactor: Int?, protection: Int[]?, enchantability: Int?)
Example: The leather armor just reeks of magic. Enchantability needs to be raised.
armorProperties("CLOTH", null, null, 30);
Tool material properties.
toolProperties(name: String, harvestLevel: Int?, durability: Int?, efficiency: Float?, damage: Float?, enchantability: Int?)
Example: A stone pickaxe should be able to mine diamonds, and the damage of stone tools should be higher.
toolProperties("STONE", 3, null, null, 8.0, null);
Items:
Spoiler (click to show)
Armor item properties.
armorProperties(item: ItemStack, protection: Int?, durability: Int?)
Example: A gold chestplate protects the same as an iron chestplate.
armorProperties(<minecraft:golden_chestplate>, 6, null);
Tool item properties.
toolProperties(item: ItemStack, efficiency: Float?, damage: Float?, durability: Int?)
Example: A golden shovel is now much faster and stronger.
toolProperties(<minecraft:golden_shovel>, 60.0, null, 1000);
Sword item properties.
swordProperties(item: ItemStack, damage: Float?, durability: Int?)
Example: A gold sword is just as dangerous as an iron sword, for they are both heavy.
swordProperties(<minecraft:golden_sword>, 6.0, null);
Item properties.
itemProperties(item: ItemStack, size: Int?, durability: Int?)
Example: Stack of chicken eggs expanded to 64.
itemProperties(<minecraft:egg>, 64, null);