Skip to main content

Overview

The Faction API is the code layer that powers Vampirism's faction system (factions, levels, lord levels, skills, actions, tasks, refinements, minions and faction villages). It is split into two Gradle modules:

ModulePackageContents
FactionApi-apide.teamlapen.faction.apiInterfaces, registry keys, events, builders, data components – everything an addon compiles against.
FactionApide.teamlapen.faction.common / .client / …The implementation. Needed at runtime, and needed at compile time if you register your own faction, skill or action (the base classes live here).

Vampirism itself is just a consumer of this API, so anything Vampirism does, your mod can do too.

info

API surface is marked with @ApiStatus annotations. Types/methods tagged @ApiStatus.Internal are not part of the contract and may change without notice.

New here?​

If you want to create your own faction, start with the guides, in this order:

  1. Concepts – the mental model, glossary and what is required vs optional.
  2. Your first faction – a complete minimal faction, step by step.
  3. Skills and actions – a skill tree and an ability.
  4. Optional features – lords, tasks, refinements, villages, minions, faction mobs.
  5. Troubleshooting – checklist and symptom → cause table.

The remaining pages are the reference.

Documentation map​

PageContents
Getting startedConcepts, tutorial for a first faction, skills and actions, optional features, troubleshooting.
Object modelIFaction / IPlayableFaction, the player handler, faction extensions.
RegistriesEvery Faction API registry and what it is used for.
Registering contentAdding factions, skills, actions, task types, minions and JSON callbacks.
UtilitiesFaction / skill tree tags, faction-specific tags, default targets, target selectors, item data components.
EventsThe game- and mod-bus events the API fires, incl. all FactionVillageEvents and RegisterItemBarsEvent.
LordsILordPlayer, lord titles and the lord builder.
RefinementsIRefinement, IRefinementSet, accessory items, rarity and the handler.
VillagesTotems, banners, capture entity interfaces and village configuration.
MinionsMinion entries, data, stats, appearances, tasks and task categories.
MiscDescriptions, customization, disguise, food, sync API, attachment / data component key lists, interface injection, utilities.

Entry points​

Everything is reached from two static hubs:

// Global services (server + client)
IFactionServices services = FactionsApi.services();
services.factionHelper(); // IFactionHelper – resolve an entity's faction
services.factionPredicates(); // IFactionPredicates – build target selectors
services.factionTags(); // IFactionSpecificTags – per-faction tags

// Per-player state (attached to every player)
IFactionPlayerHandler handler = FactionsApi.factionPlayerHandler(player);

Many sub-interfaces also expose their own get(...) shortcut:

CallReturns
IFactionHelper.get()the faction helper
IFactionSpecificTags.get()the faction tag service
ISkillPlayer.get(player)Optional<ISkillPlayer> for the active faction
ISkillHandler.get(player)Optional<ISkillHandler> – unlocked/enabled skills
IActionHandler.get(player)Optional<IActionHandler> – action cooldowns/toggles
IRefinementHandler.get(player)Optional<IRefinementHandler> – equipped accessories
IFactionPredicate.builder()a new target-selector builder

Need help?​

The API is still evolving. If something is missing or unclear, open an issue or ask on Discord / GitHub.