Skip to main content

Other data

Besides the dynamic registries (tasks, skill trees, skill segments), FactionApi ships further data pack content: tags, loot tables and damage types. All of it is generated into projects/faction/src/generated/resources/data/factionapi and can be extended or overridden by any data pack.

Tags​

Tags for FactionApi's own registries live under data/<ns>/tags/factionapi/<registry>/…; tags for vanilla registries use the usual folder (tags/item, tags/mob_effect, …).

Tag fileRegistryContents (FactionApi)Effect
factionapi/faction/*.jsonfactionapi:factionsee Faction tagsall, not_neutral, is_neutral, hostile_towards_neutral, friendly_towards_neutral, has_lord_skills, can_raid, has_random_raid
factionapi/skill_tree/…factionapi:skill_treedefault = type/level + type/lordsee Skill tree tags
factionapi/tasks/…factionapi:tasksis_unique includes awards_lord_level; has_factionsee Task assignment
factionapi/actions/…factionapi:actionsshow_cooldown_in_hud, show_duration_in_hudsee Action tags
item/minion_tools/*itemsee Minion tool tagsdecides which loot pools a minion can roll
mob_effect/disables_actionsmob_effectfactionapi:resurrection_fatigueeffects that block faction actions
villager_profession/has_factionvillager_professionempty in FactionApi (Vampirism fills it)see below
point_of_interest_type/has_factionpoint_of_interest_typeempty in FactionApi (Vampirism adds its three totem POIs)see below
block/totem_top, totem_top_fragile, totem_top_craftedblocktotem_top = fragile + crafted tags; fragile = factionapi:totem_top, crafted = factionapi:totem_top_craftedmarks totem top blocks (added by factions through FactionProperties#totem)

Action tags​

Tags in the factionapi:actions registry (data/<ns>/tags/factionapi/actions/<name>.json). Both tags are empty by default; Vampirism fills them. They only affect the HUD of the client:

  • factionapi:show_cooldown_in_hud – unlocked actions in this tag are drawn as a faded icon with a shrinking overlay in the bottom-right corner while they are on cooldown (ActionCooldownOverlay, can be disabled with the client option showActionCooldownOverlay).
  • factionapi:show_duration_in_hud – the same for the remaining duration of active lasting actions (ActionDurationOverlay, option showActionDurationOverlay).
data/mypack/tags/factionapi/actions/show_cooldown_in_hud.json
{ "values": [ "mypack:my_action" ] }

Skill tree and task tags​

Skill tree tags (type/level, type/lord, default) are documented under Skill tree tags; they select which trees take part in the shared skill point pool. Task tags (has_faction, is_unique, awards_lord_level) are described in Tasks.

Minion tool tags​

The tool a minion holds in its main hand is passed to the collect-resource loot tables as minecraft:match_tool context. FactionApi defines item tags for four tool types plus a fishing rod tag; each type has a base tag and two tiers where tier 2 is contained in tier 1, which is contained in the base tag:

Base tagContainsTier 1Tier 2
factionapi:minion_tools/axe#minecraft:axes, #…/axe/tier_1minecraft:iron_axe, #…/axe/tier_2minecraft:diamond_axe, minecraft:netherite_axe
factionapi:minion_tools/pickaxe#minecraft:pickaxes, #…/pickaxe/tier_1minecraft:iron_pickaxe, #…/pickaxe/tier_2minecraft:diamond_pickaxe, minecraft:netherite_pickaxe
factionapi:minion_tools/shovel#minecraft:shovels, #…/shovel/tier_1minecraft:iron_shovel, #…/shovel/tier_2minecraft:diamond_shovel, minecraft:netherite_shovel
factionapi:minion_tools/sword#minecraft:swords, #…/sword/tier_1minecraft:iron_sword, #…/sword/tier_2minecraft:diamond_sword, minecraft:netherite_sword
factionapi:minion_tools/fishing_rod#c:tools/fishing_rod––

Add an item to one of these tags to let minions use a modded tool.

Villager and POI tags​

  • villager_profession/factionapi:has_faction – when a village capture finishes, villagers in the village whose profession is in this tag are reset to the none profession (TotemBlockEntity#updateCreaturesOnCapture). Use it for faction-specific professions that must not survive a change of ownership.
  • point_of_interest_type/factionapi:has_faction – POI types in this tag are ignored when the totem collects the points of interest that make up a village area (TotemHelper#getVillagePointsOfInterest). Add the POI types of faction totems here so they do not extend the village themselves.

Mob effect tag​

mob_effect/factionapi:disables_actions lists effects that prevent a faction player from using actions (ActionHelper#checkActionDisableEffect). A faction can replace it with its own tag via the factionapi:action_disable faction-specific tag.

Minion collect loot tables​

The collect_* minion tasks roll a loot table every cooldown and put the result into the minion's inventory. The tables are in data/factionapi/loot_table/minion_tasks/<name>.json and use the loot table type factionapi:minion_collect, whose context provides the minion's main hand item as minecraft:tool (required) and the lord player as factionapi:lord_player (optional, only if the lord is online).

Loot tableTask
factionapi:minion_tasks/collect_resourcescollect_resources (default of the collect resources category)
…/collect_woodcollect_wood
…/collect_orescollect_ores
…/collect_fishcollect_fish
…/collect_plantscollect_plants
…/collect_mob_lootcollect_mob_loot

The generated tables show the pattern: a first pool without conditions (always rolled), followed by pools guarded by minecraft:match_tool with the minion tool tags (and, for fishing, the Luck of the Sea enchantment) so that better tools unlock better drops:

excerpt: collect_wood.json
{
"type": "factionapi:minion_collect",
"pools": [
{ "rolls": 1.0, "entries": [ { "type": "minecraft:item", "name": "minecraft:stick", "weight": 30,
"functions": [ { "function": "minecraft:set_count", "count": { "type": "minecraft:uniform", "min": 4, "max": 10 } } ] } ] },
{ "rolls": 1.0,
"conditions": [ { "condition": "minecraft:match_tool", "predicate": { "items": "#factionapi:minion_tools/axe" } } ],
"entries": [ { "type": "minecraft:item", "name": "minecraft:oak_log", "weight": 30 } ] }
]
}

Override a table (same path in your data pack) to change what minions collect. Collection speed and failure handling are controlled by the server config (minionResourceCooldown, minionOfflineResourceCooldownMultiplier, minionCollectFailuresUntilFinished).

Block loot tables​

loot_table/blocks/totem_base, totem_top and totem_top_crafted drop the block itself (totem_base only if it survives an explosion).

Damage types​

Damage typemessage_idScaling / exhaustionUsed for
factionapi:minionfactionapi.minionnever / 0.1damage dealt by minions (MinionDamageSource)
factionapi:leave_factionfactionapi.leave_factionwhen caused by living non-player / 0.0the 10000 damage a player takes when leaving a faction with die = true (FactionPlayerHandler#leaveFaction); it is in the vanilla tags bypasses_armor and bypasses_effects