Magic NPCs: Configuration
On this page (19)
- Shipping server defaults in a modpack
- Common config ( config/magicnpcs-common.toml )
- [general]
- [compat]
- [customnpcs]
- Server config ( <world>/serverconfig/magicnpcs-server.toml )
- [general]
- [balance]
- [targeting]
- [equipment]
- [reactive]
- [feedback]
- [spells]
- [recruits]
- [easynpc]
- [customnpcs]
- [builtinLoadouts]
- [compat] (Deprecated Server Copy)
- [schools]
Magic NPCs splits its settings across two TOML files so per-world gameplay balance stays cleanly separate from installation-wide modpack toggles:
| Config | File location | Scope | When changes take effect |
|---|---|---|---|
Common |
config/magicnpcs-common.toml |
Installation-wide (all worlds) |
Restart for [compat] namespace toggles; immediately on reload for debugLogging and [customnpcs] flags. |
Server |
<world>/serverconfig/magicnpcs-server.toml |
Per world, auto-synced to clients on login |
Live on config reload (and /reload), triggering world-wide caster reconciliation. |
Shipping server defaults in a modpack
- Ship
config/magicnpcs-common.tomldirectly inconfig/. - Because
magicnpcs-server.tomllives inside each save folder (saves/<world>/serverconfig/in single-player or<level-name>/serverconfig/on dedicated servers), place your modpack defaults indefaultconfigs/magicnpcs-server.toml. Forge copies that file into every newly created world (existing saves are not overwritten retroactively).
Legacy fallback keys:
[compat]toggles andgeneral.debugLogginginmagicnpcs-server.tomlare deprecated; if still set there, they are OR-ed withmagicnpcs-common.tomland logged as a warning. Move them toconfig/magicnpcs-common.toml.
Common config (config/magicnpcs-common.toml)
[general]
| Option | Default | Type | Effect |
|---|---|---|---|
debugLogging |
false |
Boolean |
Logs each NPC cast (spell and mana before/after), goal injection, and skip reasons at INFO level. |
[compat]
Each key gates whether datapack (or shipped) loadouts targeting that mod’s entity-type namespace apply. All default false for modpack safety. Magic NPCs logs a warning at load time if a mod is installed while its toggle is false.
| Option | Namespace gated | Default | Notes |
|---|---|---|---|
guardvillagers |
guardvillagers |
false |
Gates the shipped guardvillagers:guard loadout and custom Guard Villagers loadouts. |
mca |
mca |
false |
MCA Reborn shares mca:male / mca:female across all roles; enabling makes all of them use matching loadouts. |
minecolonies |
minecolonies |
false |
Citizens use Colony AI; prefer enabling only for raiders. |
easynpc |
easy_npc |
false |
Admits loadouts on easy_npc:* types. Also set [easynpc].enabled = true in server config to let Easy NPCs cast. |
customnpcs |
customnpcs |
false |
Admits loadouts on customnpcs:* types. Authored NPCs; opt in deliberately. |
humancompanions |
humancompanions |
false |
Admits loadouts on humancompanions:* types. |
morevillagers |
morevillagers |
false |
Admits loadouts on morevillagers:* types. |
villagersplus |
villagersplus |
false |
Admits loadouts on villagersplus:* types. |
[customnpcs]
| Option | Default | Type | Effect |
|---|---|---|---|
bridgeEnabled |
true |
Boolean |
Master installation switch for the CustomNPCs bridge (adapter, AI repair, script surface). When false, CustomNPCs is ignored entirely. |
scriptGlobalEnabled |
true |
Boolean |
Exposes the MagicNPCs script global object to CustomNPCs scripts (server-config [customnpcs] flags still govern triggers, mailbox, mutations, and vetoes). |
Server config (<world>/serverconfig/magicnpcs-server.toml)
[general]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enableSpellcasting |
true |
Boolean |
Master switch for all NPC spellcasting. Takes effect on already-spawned casters on config reload. |
castingGoalPriority |
2 |
0–99 |
Default GoalSelector priority for injected casting goals (lower = higher priority). Overridden per loadout by goal_priority. |
castingGoalUsesLookFlag |
false |
Boolean |
Legacy pre-0.6.0 mode that makes the casting goal claim Goal.Flag.LOOK. Leave false so native ranged/potion AI does not starve or preempt casting. |
disabledEntityTypes |
[] |
List of resource IDs |
Entity type IDs (e.g. "minecraft:skeleton") that must never cast, suppressing every loadout for them. |
suppressibleAttackGoals |
[] |
List of strings |
Extra simple goal class names (e.g. "MyModRangedGoal") that native_attack: suppress wraps and yield treats as an active native attack. |
attackGoalNamePatterns |
["Attack", "Ranged", "Shoot", "Bow", "Crossbow", "Gun", "Spit", "Breath", "Charge", "Cast"] |
List of regexes |
Case-sensitive regexes matched via find() against a goal’s simple / Outer$Inner name (non-target goals declaring MOVE or LOOK only). |
strictLoadoutSchema |
false |
Boolean |
If true, unknown keys in a loadout JSON reject the file as an error instead of emitting a warning. |
reconcileBatchSize |
200 |
1–20000 |
Maximum loaded mobs reconciled per server tick after a reload or /magicnpcs reconcile. |
debugLogging |
false |
Boolean |
Deprecated fallback copy of common general.debugLogging. |
[balance]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
manaMultiplier |
1.0 |
0.0–1000.0 |
Global multiplier applied to every caster’s max mana pool. |
cooldownMultiplier |
1.0 |
0.0–100.0 |
Global multiplier applied to Iron’s spell cooldowns ( >1.0 = slower casting; ignored when a spell specifies explicit cooldown). |
regenMultiplier |
1.0 |
0.0–100.0 |
Global multiplier applied to mana regeneration per regen tick. |
decisionIntervalTicks |
10 |
1–200 |
Minimum ticks between combat spell-selection checks ( 20 ticks = 1 second). |
castChance |
1.0 |
0.0–1.0 |
Default probability that a caster actually casts when a spell is selected. Overridden per spell by cast_chance. |
minCooldownTicks |
20 |
0–1200 |
Hard minimum floor in ticks applied to all spell cooldowns, including explicit per-spell cooldown values. |
supportHealthThreshold |
0.5 |
0.0–1.0 |
Health fraction below which an NPC self-casts support spells (when not overridden by a self-health condition). |
supportOutOfCombat |
true |
Boolean |
Allows wounded casters to self-cast support spells without a hostile target. |
supportOutOfCombatIntervalTicks |
100 |
20–2400 |
Ticks between out-of-combat support checks. |
friendlyFireCheck |
true |
Boolean |
Skips attack casts when a protected ally or bystander sits within the spell’s safety_radius geometry. |
peacefulDisablesCasting |
true |
Boolean |
Disables all NPC casting while world difficulty is Peaceful. |
difficultyScaling |
true |
Boolean |
Scales NPC max mana by world difficulty (Easy 0.85x, Normal 1.0x, Hard 1.2x). |
casterMovement |
true |
Boolean |
Enables repositioning ( CasterMovementGoal) for casters whose loadout uses "native_attack": "suppress". |
casterMovementSpeed |
1.0 |
0.1–5.0 |
Movement speed multiplier used by CasterMovementGoal. |
rankLevelPerRank |
0.25 |
0.0–10.0 |
Spell levels gained per NPC progression rank/level above the loadout’s level floor (0 disables spell-level scaling). |
rankLevelMaxBonus |
2 |
0–10 |
Maximum bonus spell levels rank scaling may add above a loadout entry’s level (still capped by the spell’s own max level). |
[targeting]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
requireLineOfSight |
true |
Boolean |
Requires unobstructed line of sight to the target before casting attack spells. |
castWindupTicks |
6 |
0–100 |
Default aim wind-up in ticks before an attack spell enters Iron’s cast lifecycle. Overridden per spell by windup. |
protectBystanders |
true |
Boolean |
Protects nearby villagers ( AbstractVillager), Iron Golems, and tamed animals from attack line of fire. |
protectBystanderPlayers |
false |
Boolean |
Also protects non-target Survival/Adventure players standing near the firing line. |
protectOwners |
true |
Boolean |
Enables OwnableTeamAdapter so OwnableEntity companions and scoreboard-teamed mobs protect owners, siblings, and teammates. |
protectRaidAllies |
true |
Boolean |
Enables RaidAllyAdapter so raiders in the same Raid do not hit each other. |
sittingPetsMayCast |
false |
Boolean |
If false, vanilla TamableAnimal companions ordered to sit cannot cast either attack or support spells. |
[equipment]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
requireSpellFocus |
false |
Boolean |
Requires every caster to hold an item in #magicnpcs:spell_focuses (or its school focus tag if schools.schoolAwareFocus = true) to cast. |
spawnWithGearChance |
0.0 |
0.0–1.0 |
Chance ( 0–1) for spawning casters (without a per-loadout equipment block) to receive a random item from #magicnpcs:spell_focuses in an empty main hand. |
[reactive]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enabled |
true |
Boolean |
Enables per-spell condition blocks in loadouts. When false, reactive conditions are ignored. |
matchedConditionWeightBonus |
1.0 |
1.0–100.0 |
Selection-weight multiplier applied to spells that declare a condition while that condition is currently satisfied. |
[feedback]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
telegraphs |
true |
Boolean |
Plays server-side particle and sound cues during attack spell wind-ups (never plays for out-of-combat support heals). |
schoolParticles |
true |
Boolean |
Tints telegraph DustParticleOptions with the spell’s school colour (false uses vanilla WITCH particles). |
telegraphGlow |
false |
Boolean |
Applies a temporary glowing outline ( magicnpcs.telegraph tag) to the caster during attack wind-up. |
telegraphVolume |
0.5 |
0.0–1.0 |
Volume of the cast telegraph sound ( 0.0 silences sound). |
minDangerTier |
0 |
0–4 |
Minimum spell danger tier ( 0–4) required before playing telegraphs. |
[spells]
| Option | Default | Type | Effect |
|---|---|---|---|
spellBlacklist |
[] |
List of IDs / ns:* |
Spell IDs or whole-namespace wildcards (e.g. "traveloptics:*") that NPCs may never cast. |
spellWhitelist |
[] |
List of IDs / ns:* |
When non-empty, NPCs may only cast matching spell IDs or ns:* wildcards. |
allowUnverifiedSpells |
false |
Boolean |
Allows casting spells marked UNVERIFIED by all layers. Skipped spells remain refused unless covered by override, manifest, or namespace trust. |
trustedNamespaces |
[] |
List of namespaces |
Bare spell namespaces (e.g. "traveloptics", no colon) treated as ADDON_DEFAULT when not overridden by a manifest or override. |
capabilityOverrides |
[] |
List of ns:path=CAP |
Highest-priority per-spell capability overrides (e.g. "traveloptics:tidal_lance=TARGET_ENTITY"), outranking datapack manifests and the built-in table. |
[recruits]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enabled |
true |
Boolean |
Enables Villager Recruits casting and rank mana scaling (owner/ally protection stays active even when false). |
manaPerLevel |
0.10 |
0.0–100.0 |
Extra max-mana fraction per Recruit XP level ( 0.10 = +10% per rank). |
[easynpc]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enabled |
false |
Boolean |
Enables Easy NPC casting, magicnpcs:cast action execution, and experience-level mana scaling. Owner/faction protection stays active even when false. |
manaPerLevel |
0.02 |
0.0–100.0 |
Extra max-mana fraction per Easy NPC experience level ( 0–60). |
useObjective |
true |
Boolean |
Allows Easy NPC’s magicnpcs:cast_spell custom objective to attach the reconciled casting goal. |
respectFactions |
true |
Boolean |
Protects same-faction Easy NPCs from attack casts unless their faction marks the target hostile. |
[customnpcs]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
repairAfterAiRebuild |
true |
Boolean |
Re-installs casting goals via the reconcile queue after CustomNPCs clears and rebuilds an NPC’s AI selectors. |
respectFactions |
true |
Boolean |
Protects same-faction CustomNPCs and friendly players ( playerStatus == 1) from offensive casts. |
pauseDuringDialog |
true |
Boolean |
Prevents casting and cancels active casts while a player has a dialog open with the NPC. |
blockedJobs |
["puppet", "builder"] |
List of lowercase names |
CustomNPCs job names whose NPCs never cast. |
blockedRoles |
[] |
List of lowercase names |
CustomNPCs role names whose NPCs never cast. |
emitScriptTriggers |
true |
Boolean |
Fires CustomNPCs script triggers on cast/school lifecycle signals. |
scriptTriggerId |
8800 |
1–2147483647 |
Custom trigger ID passed to CustomNPCs scripts. |
scriptMailboxEnabled |
true |
Boolean |
Enables reading/writing magicnpcs.request.v1.* / magicnpcs.result.v1.* in NPC stored data. |
scriptMutationsEnabled |
true |
Boolean |
Allows scripts ( MagicNPCs global and mailbox) to mutate school state or trigger cast(). |
scriptCancelHandshakeEnabled |
true |
Boolean |
Allows scripts to veto casts during cast_pre by setting magicnpcs.cancel.v1 to 1 in temp data. |
[builtinLoadouts]
Individual switches for the five loadouts bundled inside the Magic NPCs JAR (all default true). Setting one to false disables that shipped loadout without writing a datapack:
recruit(recruits:recruit)bowman(recruits:bowman)crossbowman(recruits:crossbowman)captain(recruits:captain)guard(guardvillagers:guard, also requirescompat.guardvillagers = trueinmagicnpcs-common.toml)
[compat] (Deprecated Server Copy)
Contains deprecated fallback copies of guardvillagers, mca, minecolonies, easynpc, customnpcs, humancompanions, morevillagers, and villagersplus (all default false). Use config/magicnpcs-common.toml instead.
[schools]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enableSchools |
true |
Boolean |
Master switch for dynamic magic-school assignment. |
allowedSchools |
All 9 Iron’s schools ( fire, ice, lightning, holy, ender, blood, evocation, nature, eldritch) |
List of resource IDs |
School IDs eligible for automatic, command, and School Tome assignment. |
maxRarity |
"RARE" |
COMMON..LEGENDARY |
Maximum spell rarity included in generated school pools. |
maxSpellLevel |
3 |
1–10 |
Maximum spell level for generated school spells. |
spellsPerSchool |
4 |
1–32 |
Number of spells sampled per school caster. |
includeSupportSpells |
true |
Boolean |
Includes support spells in generated school pools. |
supportSpellIds |
18 healing/buff/defensive Iron’s spell IDs |
List of resource IDs |
Explicit spell IDs classified as support in school pools (before keyword matching). |
allowedCastTypes |
["INSTANT", "LONG"] |
INSTANT, LONG, CONTINUOUS |
Cast types permitted in generated school pools. |
weightingMode |
"INVERSE_RARITY" |
UNIFORM / INVERSE_RARITY |
How spells in a school pool are weighted for sampling and casting. |
attackMaxRange |
20.0 |
1.0–128.0 |
max_range assigned to generated school attack spells. |
baseMaxMana |
100.0 |
1.0–100000.0 |
Base max mana for school-assigned casters before scaling. |
baseManaRegen |
10.0 |
0.0–10000.0 |
Base mana regen for school-assigned casters. |
schoolAwareFocus |
false |
Boolean |
When equipment.requireSpellFocus is true, accepts Iron’s per-school #irons_spellbooks:<school>_focus tags for school casters. |
[schools.recruits]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enabled |
true |
Boolean |
Enables automatic school assignment for Villager Recruits. |
casterChance |
0.35 |
0.0–1.0 |
Probability a newly spawned Recruit rolls a magic school. |
assignmentMode |
"RANDOM" |
RANDOM, BY_TYPE, BY_RANK |
How a school is chosen ( BY_RANK cycles allowedSchools by rank; BY_TYPE uses typeSchools). |
typeSchools |
[] |
List of entityType=school[,school] |
Per-entity-type school mappings when assignmentMode = "BY_TYPE". |
minRankToCast |
0 |
0–100 |
Minimum Recruit XP rank required to roll a school. |
[schools.easynpc]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enabled |
false |
Boolean |
Enables automatic school assignment for Easy NPCs. |
casterChance |
0.25 |
0.0–1.0 |
Probability a newly spawned Easy NPC rolls a school. |
assignmentMode |
"RANDOM" |
RANDOM, BY_TYPE, BY_RANK |
Selection strategy ( RANDOM, BY_TYPE, BY_RANK). |
typeSchools |
[] |
List of entityType=school[,school] |
Per-variant Easy NPC school mappings for BY_TYPE. |
minLevelToCast |
0 |
0–100 |
Minimum Easy NPC experience level ( 0–60) required to roll a school. |
[schools.customnpcs]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enabled |
false |
Boolean |
Enables automatic school assignment for CustomNPCs NPCs. |
casterChance |
0.25 |
0.0–1.0 |
Probability a newly spawned CustomNPC rolls a school. |
assignmentMode |
"RANDOM" |
RANDOM, BY_TYPE, BY_RANK |
Selection strategy ( RANDOM, BY_TYPE, BY_RANK). |
typeSchools |
[] |
List of entityType=school[,school] |
Per-entity-type school mappings for BY_TYPE. |
minLevelToCast |
0 |
0–100 |
Minimum level required (CustomNPCs reports level 0, so values above 0 prevent rolling). |
[schools.villagers]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
enabled |
true |
Boolean |
Enables automatic school assignment for vanilla and modded Villager entities. |
casterChance |
0.5 |
0.0–1.0 |
Probability an eligible employed villager rolls a school. |
professionSchools |
cleric=holy, librarian=evocation, weaponsmith=fire, toolsmith=lightning, fletcher=ender, farmer=nature (minecraft: / irons_spellbooks: prefixed) |
List of profession=school[,school] |
Maps villager professions to eligible schools. |
selfDefense |
false |
Boolean |
Grants a HurtByTargetGoal to school-assigned villagers so they retaliate with attack spells when struck. |
unmappedGetRandom |
false |
Boolean |
If true, villagers whose profession is not listed in professionSchools roll from allowedSchools. |
[schools.control]
| Option | Default | Range / Type | Effect |
|---|---|---|---|
commandEnabled |
true |
Boolean |
Enables the school-mutating /magicnpcs school subcommands (set, reroll, clear, auto, info). pool always stays available. |
commandPermissionLevel |
2 |
0–4 |
Operator permission level required for /magicnpcs school. |
itemEnabled |
true |
Boolean |
Enables right-click / sneak-right-click School Tome interactions. |