Factions
Give any mob a side with one field:plugins/LodeEntities/factions.yml:
Two things to know:
- Relations are one-way as written. The example above is only mutual because both halves are spelled out, which is deliberate: you can build a hunter that stalks a creature that never hunts back.
- Pets are always on their owner’s side. A pet is an ally of its owner and of that owner’s other pets, whatever
factions.ymlsays. - Players are the reserved faction
players, so you can write relations against them without tagging anything. A mob with nofaction:behaves exactly as before.
Threat
Damage generates threat equal to the damage actually dealt, after armor. Mobs retarget on a timer to whoever tops their table, and threat fades over time so old grudges lapse. Four knobs inconfig.yml:
retarget-interval for snappier switching.
Driving threat from effects
The threat mechanics are what make scripted fights possible: tanks that hold aggro, phase changes that reset the fight, mind-control gimmicks.@threatTable, @threatTablePlayers, @randomThreatTarget, and sort=HIGHEST_THREAT on any area targeter (Targeters). The samefaction and faction conditions test sides, and <target.threat> prints a value (Placeholders).
Addons get the same through LodeEntitiesAPI.mobs(): factionOf, setFaction, clearFaction, areAllies, relationBetween, threatOf, addThreat, threatTable, clearThreat. See Mobs & Factions.
