File Details
Magic NPCs 0.5.0 (Forge 1.20.1)
- R
- Jun 30, 2026
- 125.70 KB
- 126
- 1.20.1
- Forge
File Name
magicnpcs-0.5.0.jar
Supported Versions
- 1.20.1
Curse Maven Snippet
[0.5.0] — aimed casting fix, spell discovery, weighted gear, cooldown clarity
Quality-of-life for pack authors driving Iron's casters: projectile spells now fire at the
target (not in a stale direction), a new command lists every valid spell id, loadouts can grant
weighted starting gear, and the cooldown rules are documented in one place. Every new field is
optional and backward compatible — existing datapacks, configs, and shipped loadouts are unchanged,
and the offline bootSanity GameTest still passes with neither Iron's nor Recruits installed.
Added
/magicnpcs spells [filter]— list the valid Iron's spell registry ids with school, rarity, default cooldown, cast type, and a mob-friendly hint (filter by substring). Read-only; available whenever Iron's is present. Backed by the new generated referencedocs/irons_spell_ids.md.- Weighted starting equipment — an optional per-loadout
equipmentblock grants gear on spawn:mainhand/offhandweighted item lists (bare"id"or{ "item", "weight" }), pluschance(default 1.0) andonly_if_empty(default true). Omit the block to keep the existing globalequipment.spawnWithGearChancebehaviour. Useful withrequireSpellFocusto arm casters with a Pyrium Staff or other focus. - Mob-friendly spell guide (
docs/mob-friendly-spells.md): curated projectile / self-support / melee / AoE / not-recommended categories, with example projectile- and melee-mob loadouts. - Cooldown documentation in the README: explicit
cooldown(ticks) vscooldown_multiplier(scales the Iron's default — bigger = slower), theminCooldownTicksfloor, 20 ticks = 1 s, and a worked Phantomechoing_strikes5-second example.
Fixed
- Aimed casting / stale projectile direction. The casting goal relied on
LookControl, whose rotation is applied after the goal runs — so on the instant (windup = 0) path a projectile spell fired in the caster's previous facing. The goal now snaps the caster's yaw/pitch (head and body) onto the target immediately beforeonCast, so spells launch on-aim regardless of wind-up. - Silent unknown spell ids. A loadout referencing an unresolved spell id used to fail invisibly.
It now logs a clear warning naming the file, entity, field, and bad id, and a bare id (no namespace)
is auto-retried under
irons_spellbooks:(sodevourresolves toirons_spellbooks:devour).
Changed
NpcSpellAttackGoal.resolveCooldownnow delegates to a pure, unit-testedCooldownResolver(no behaviour change): explicit ticks > per-spell multiplier > global multiplier, always floored.
Tests
- New JUnit tests:
CooldownResolverTest(precedence, multiplier direction, floor) andWeightedItemPickTest(weighted equipment selection). New runtime GameTests:windupAimsAtTarget(projectile flies toward the target onwindup=0),focusGateRequiresHeldFocus,bareSpellIdAutoNamespaces, andperSpellCastChanceZeroNeverCasts.
Notes
- Fully backward compatible. Migration: none required — every new field is optional and omitting
it preserves current behaviour. If you were confused by cooldowns on an older build: raising
cooldown_multiplierincreases cooldown; use a value below 1.0 to speed a spell up, or just set an explicit"cooldown"in ticks (100= 5 s). - Spell ids and item ids are version-specific to your installed Iron's build;
/magicnpcs spellsand/giveare the authoritative sources.