FORGOTTEN TOWNS

FORGOTTEN TOWNS / МОДИНГОВАЯ ДОКУМЕНТАЦИЯ

Моддинг вики ↗

Java Ссылка на API (Javadoc)

MOD API 15

Просмотрите вики

Текущая документация API модов.

Техническая документация доступна на английском языке. Имена кода и полей соответствуют текущему Mod API.

МОДИНГОВАЯ ДОКУМЕНТАЦИЯ

Creature field explanations

Use these fields inside values for registry creatures. Start with Add a creature. The generated index is the accepted-key list; this page explains how the groups work.

Defaults below apply when no copied definition or unitArchetypeId supplies a value. With copyFrom, omission preserves the source. Distances are world tiles unless stated; ticks are simulation ticks, not rendered frames. Copy a compatible creature before changing special actions: an action may also need matching art, an existing projectile, or an existing sound.

Identity and movement

Field Meaning / fallback
bodyType Existing body classification; required without a copy
controlMode Existing control classification; does not implement a new controller
disposition Existing friendly/neutral/hostile classification
role Existing actor role
tags String selectors used by loot, taming, and other existing systems; copied tags retain those effects
factionId Faction identity; empty when absent
hostileFactionIds Faction IDs treated as hostile; empty array when absent
unitArchetypeId Existing unit archetype supplying inherited visuals/combat/movement; explicit creature fields override inherited defaults
movementPerTick Movement per simulation tick; fallback 0.041667, or the linked archetype's value
movementProfile DEFAULT, SKITTISH, ROAMING, TERRITORIAL, SETTLED, HOME_GUARD; fallback DEFAULT
wanderRadius Wandering radius; fallback 6
tamingFoodIds Accepted existing food resource IDs; an empty list adds no taming foods

A new creature ID does not create a new recruitable profession or unit archetype.

Visuals

These names are inside visuals. Paths reference existing game art or your pack's art. Directional row order and asset paths are explained in the artwork guide.

Field Meaning / fallback
spriteSheetPath Walking sheet; required without an inherited value
attackSpriteSheetPath Normal attack sheet
deathSpriteSheetPath Death animation sheet
finalDeathSpriteSheetPath Optional separate final-death sheet
rangedAttackSpriteSheetPath Ranged attack animation sheet
chargeSpriteSheetPath Charge animation sheet
summonSpriteSheetPath Summoning animation sheet
warCrySpriteSheetPath War-cry animation sheet
cadenceAttackSpriteSheetPath Special cadence attack sheet
walkColumnsPerBank, walkFrameCount Walking bank width and playable frame count; fallback 4 each
attackColumnsPerBank, attackFrameCount Attack bank width and frame count; fallback 8 each
deathColumnsPerBank, deathFrameCount Death bank width and frame count; fallback 8 each
chargeColumnsPerBank, chargeFrameCount Charge bank width and frame count; fallback 8 each
warCryColumnsPerBank, warCryFrameCount War-cry bank width and frame count; fallback 8 each
rangedAttackColumnsPerBank, rangedAttackFrameCount Ranged bank width and frame count; default to corresponding attack values
summonColumnsPerBank, summonFrameCount Summon bank width and frame count; default to corresponding attack values
cadenceAttackColumnsPerBank, cadenceAttackFrameCount Cadence bank width and frame count; default to corresponding attack values
renderScale Visual scale; fallback 0.62; does not set collision geometry
deathRenderScaleMultiplier Additional death-render scale; fallback 1
reverseLowerDirectionRows Legacy animation-row compatibility option; fallback false; preserve normal row order for new sheets

Bank width describes the source sheet layout; frame count describes the animation length. Adding an animation path does not by itself enable the corresponding combat action.

Ordinary combat

These names are inside combat. Level and existing scaling profiles derive the actor's stats.

Field Meaning / fallback
level Base level; fallback 0
maximumLevel Upper level bound; defaults to level
attackScalingProfile Existing attack-scaling profile; fallback melee
alertRangeTiles Threat detection radius; fallback 6
attackTicksPerFrame Simulation ticks per attack animation frame; fallback 2
attackImpactFrame Attack frame that resolves impact; fallback 3
willFlee Health percentage at or below which the creature attempts to flee; fallback 0
attackPattern Existing target pattern; fallback SINGLE_TARGET
attackAccuracyMultiplier Accuracy multiplier; fallback 1
meleeDamageMultiplier Melee damage multiplier; fallback 1
meleeReach Existing melee footprint/reach choice; omit to use the engine default
meleePiercing Lets a supported single-target thrust hit both tiles along its reach; fallback false
meleeKnockbackTiles Guaranteed melee knockback distance; fallback 0
combatMovementSpeedMultiplier Movement multiplier during combat; fallback 1
elementalBonusIntScaling Elemental bonus scaling per intelligence point; fallback 0
statusEffectImmune Status immunity; fallback false
critDamageTakenMultiplier Critical damage received multiplier; fallback 1
damageElementTakenMultipliers Map of existing element IDs to damage-received multipliers; omitted elements keep normal behavior
trampleDamage Damage dealt by the existing trample behavior; fallback 0
trampleRadiusTiles Trample radius; fallback 0
trampleKnockbackChancePercent Trample knockback probability in percent; fallback 0

A key present in the game's base JSON is not necessarily exposed to mods. For example, xpRewardOverride, rangedDamageMultiplier, and travelTrail are not currently in the mod field allowlist. Do not put them in values.

Ranged combat

These names are also inside combat.

Field Meaning / fallback
rangedProjectileKind Existing projectile kind; absent is empty
rangedAttackSoundId Existing attack sound ID; absent is empty
rangedAttackMinRangeTiles Minimum ranged distance; fallback 0
rangedAttackMaxRangeTiles Maximum ranged distance; fallback 0
rangedAttackHitChance Accuracy percentage applied to the actor's hit stat; fallback 100
rangedAttackCadenceCycles Animation cycles per shot; fallback 1
rangedPressureAwarenessTiles Radius for reacting to nearby pressure; fallback 0
rangedPressureStandoffTiles Preferred separation from nearby pressure; fallback 0
rangedAttackEffects Ranged-only effects; empty when absent

Use a compatible existing ranged creature as the source. New strings do not register a new projectile implementation or sound.

Attack effects and aura

combat.attackEffects is an array of normal attack effects. combat.rangedAttackEffects is the separate ranged-only array. Each effect has the following settings, subject to the exact per-path allowlist:

Field Meaning / fallback
type Existing effect type; required
chance Proc chance in percent, not a 0-1 fraction; fallback 100
durationTicks Effect duration in simulation ticks; fallback 0
tickIntervalTicks Interval between repeated effect ticks; fallback 0
intScaling Per-intelligence scaling; fallback 0.4 for poison/burn, otherwise 0
maxStacks Maximum effect stacks; fallback 1
magnitudePercent Effect strength in percent; fallback 0; exposed in attackEffects, not every other effect path

Do not assume two similar nested objects accept identical fields. The index lists the exact paths.

combat.attackAura supplies an optional once-per-attack radial action:

Field Meaning / fallback
supportType Existing support effect; fallback NONE
supportRadiusTiles Allied support radius; fallback 0
supportMaxHpFraction Fraction of maximum HP used by support; 0.1 means 10%; fallback 0
enemyRadiusTiles Radius for the enemy effect; fallback 0
enemyEffect One effect object using its listed type, chance, durationTicks, intScaling, tickIntervalTicks, and maxStacks fields

Travel and special attacks

These names are inside combat:

Field Meaning / fallback
travelAction Existing combat travel action; fallback AUTO
travelActionCadenceCycles Completed attack cycles before travel becomes available; fallback 3
travelActionMinimumRangeTiles Minimum target distance for travel; fallback 2
travelActionReplacesMelee Prefer travel even from a legal melee position; fallback false
travelActionCountsAsAttack Completed travel advances attack cadence; fallback false

combat.cadenceAttack optionally replaces a normal attack on its cadence:

Field Meaning / fallback
cadenceCycles Cycles between special attacks; fallback 2
impactFrame Special attack impact frame; fallback 4
attackPattern Existing target pattern; fallback SINGLE_TARGET
damageMultiplier Special attack damage multiplier; fallback 1
defenseMultiplier Defense multiplier associated with this action; fallback 1

combat.warCry optionally replaces a normal attack with radial support:

Field Meaning / fallback
cadenceCycles Attack-cycle cadence; fallback 3
cooldownSeconds Positive values configure a time cooldown; fallback 0
activationHealthPercent Maximum current-health percentage permitting the action; 0 means no threshold
impactFrame One-based support activation frame; fallback 4
radiusTiles Support radius; fallback 0
healMaxHpPercent Healing as percent of maximum HP; fallback 0
shieldMaxHpPercent Shield as percent of maximum HP; fallback 0
attackDamageBonusPercent Attack damage bonus in percent; fallback 0
attackDamageBonusDurationSeconds Bonus duration in seconds; fallback 0

combat.deathBurst optionally configures a death-time burst:

Field Meaning / fallback
radiusTiles Burst radius; fallback 1
damage Flat physical damage before armor; 0 uses derived creature damage
damageMultiplier Multiplier on derived creature damage when damage is zero; fallback 1
structureDamageMultiplier Structure damage multiplier; fallback 1
impactFrame Zero-based death-sheet frame that resolves the burst; fallback 0
selfDestructOnAttackImpact Triggers self-destruction at attack impact; fallback false
fadeAfterDeathAnimation Skips corpse loot and fades after the death animation; fallback false

Initial surface spawns

These are root values fields. There is no supported root spawn object.

Field Meaning / fallback
spawnCount Base initial count; fallback 0
spawnCountRandomMin, spawnCountRandomMax Inclusive random count bounds; fallback 0 each
spawnCountNormalBonus, spawnCountLargeBonus Count bonuses for the corresponding world size; fallback 0
spawnBiomes Allowed biome IDs
initialSpawnBiomes Optional subset of spawnBiomes allowed during initial surface population; empty uses spawnBiomes. Later migration and births still use spawnBiomes. Random mixed worlds retain their ordinary habitat rules.
spawnSurfaceTypes Allowed supporting block types
spawnMinDepthBelowSurface, spawnMaxDepthBelowSurface Depth bounds below the surface; fallback 0 each

A positive spawnCountRandomMax selects the random range plus the matching world-size bonus; otherwise the engine uses spawnCount. Difficulty and valid placement affect the result. These settings do not populate an existing save.

Herds

Root fields describe herd families and composition. Targets count herds; member counts describe animals within a herd. Do not copy a herd animal and change only spawnCount if you want a simple independent spawn.

Field Meaning / fallback
herdFamilyId Shared family identity; absent means no authored herd family
herdLeaderPreferred Whether this definition is preferred for leaders; fallback false
herdTargetSmall, herdTargetNormal, herdTargetLarge Herd targets for each world size; fallback 0
herdTargetRandomMin, herdTargetRandomMax Inclusive random herd-target bounds; fallback 0
herdTargetNormalBonus, herdTargetLargeBonus World-size bonuses to the random herd target; fallback 0
herdMinLeaderCount, herdMaxLeaderCount Leader-count range; fallback 0
herdMinFollowerCount, herdMaxFollowerCount Follower-count range; fallback 0
herdMinSeparationTiles Requested separation between herds; fallback 0
herdCompositions Weighted alternatives for a herd; each has weight, leaderCount, followerCount

A positive herdTargetRandomMax selects the random target plus the matching size bonus; otherwise the engine uses the per-size target. Leader counts and herd separation normalize to at least one when generating a herd. Composition defaults are weight 1, leader count 1, follower count 0. Replacing the compositions array removes the inherited alternatives.

Underground spawns

These names are inside optional undergroundSpawn:

Field Meaning / fallback
groupCountRandomMin, groupCountRandomMax Inclusive group-count bounds; fallback 0
groupCountNormalBonus, groupCountLargeBonus World-size group-count bonuses; fallback 0
groupSizeMin, groupSizeMax Inclusive members-per-group bounds; fallback 1
minDepthBelowSurface, maxDepthBelowSurface Inclusive depth range; fallback 1
preferredUpperDepthBelowSurface Preferred shallow depth; fallback 1
deepestDepthWeightMultiplier Weight multiplier at the deepest end; fallback 0.35
minSeparationTiles Requested separation between groups; fallback 4
spawnSurfaceTypes Allowed supporting block types
spawnBiomes Allowed biomes
maxLayersFromWorldBottom Inclusive distance limit from the world bottom; fallback -1 means no additional bottom limit

Camp spawns

campSpawns is an array. Each entry describes a surface camp:

Field Meaning
spawnBiomes Allowed biome IDs
campCountRandomMin, campCountRandomMax Inclusive number-of-camps range
campCountNormalBonus, campCountLargeBonus World-size camp-count bonuses
minSeparationTiles Requested separation between camp anchors
preferredAnchorSurfaceTypes Preferred supporting block types at the anchor
preferredNeighborSurfaceTypes Preferred nearby supporting block types
preferredNeighborRadiusTiles Radius used to check those neighbors
preferredPlacementWeight Weight for locations matching those preferences
placeableId Optional existing placeable associated with the camp
compositions Array of weighted member groups

Each composition has weight, optional allowedSizeProfiles, and members. Each member has definitionId, minCount, and maxCount. Use existing creature IDs and size-profile values from a compatible base camp. The separate difficulty and migration reference describes later population changes; they are not implied by initial spawn settings.