A faction is a abstract group that mobs belong to.
Players can't "join" a faction, the player counts as a member of a faction depending on their Reputation. However, if the "enableOldFactionMemberTeams" option is set to true, CQR will try to match the name of an entity's scoreboard team to an existing faction. That faction then defines the entity's faction.
A CQR faction basically consists of 4 things. These are:
- a unique name as it's identifier
- two list of faction names, these are for the ally and enemy factions of this faction. They can be empty
- the default Reputation a player has towards this faction
There are more points to this, but these are the real basic ones.
Configuring a faction
|name||String||The name and unique identifier for this faction||Has to be unique accross all factions, this is not case sensitive.|
|defaultReputation||String||Defines the default Reputation a player has towards this faciton.||Has to match one of these values (case sensitive), ordered from lowest to highest reputation: ARCH_ENEMY, ENEMY, HATED, AVOIDED, NEUTRAL, ACCEPTED, FRIEND, ALLY, MEMBER|
|staticReputation||Boolean||Wether or not the player's Reputation towards this faction can change.||Has to be set to "true" or "false"|
|repuChangeOnKillAlly||Integer||Value that gets subtracted from the player's Reputation when he kills an ally of this faction.||Has to be a valid integer value. Should be positive, negative values can cause weird issues. Can be left empty, it will then use the default reputation value (2).|
|repuChangeOnKillMember||Integer||Value that gets subtracted from the player's Reputation when he kills a member of this faction.||Has to be a valid integer value. Should be positive, negative values can cause weird issues. Can be left empty, it will then use the default reputation value (5).|
|repuChangeOnKillEnemy||Integer||Value that gets added to the player's Reputation when he kills an enemy of this faction.||Has to be a valid integer value. Should be positive, negative values can cause weird issues. Can be left empty, it will then use the default reputation value (1).|
|allies||List of Strings||Defines the allied-factions of this faction, the strings represent the names of the ally-factions.||The names should represent existing factions. Can be left empty.|
|enemies||List of Strings||Defines the enemiy-factions of this faction, the strings represent the names of the ally-factions.||The names should represent existing factions. Can be left empty.|
|textureSet||String||The Texture Set this faction uses, leave empty to use none.||The name should represent the name of an existing and valid Texture Set. Can be left empty.|
Creating a new faciton
CQR tries to load every .properties file inside the "factions" folder inside the CQR-folder on game startup, so to add a new faction, you just need to insert a correctly formatted faciton file in there.
To create a new faction, simply create a new .properties file and open it with a generic text editor.
Then you add the config-option-names and values to the file (one per line) in this format: <OPTION-NAME>=<VALUE> (without the '>' and '<').
There also is a blank faction preset file named "FactionPreset.properties" located inside the CQR-folder that you can use.
Overriding an entity's faction
To override an entity's faction, open up the "entityFactionRelation.properties" file located inside the CQR folder with a text editor.
Once there, you can assign a faction to every non-CQR entity by using this format:
<ENTITY-ID>=<FACTION-NAME> (without the '>' and '<')
Due to how java reads .properties files, you must replace every ':' in the entity-ID with a '.'.
- 'iceandfire.icedragon=DRAGONS': Assigns every ice and fire ice-dragon to the "DRAGONS" faction
- 'mod_lavacow.banshee=UNDEAD': Assigns every banshee from fish's undead rising to the "UNDEAD" faction
- 'minecraft.vindication_illager=ILLAGERS': Assigns every vanilla vindicator mob to the "ILLAGERS" faction
Joining a faction
There are exactly two ways to join a faction:
- Reach the 'MEMBER' Reputation status (either by using the 'cqr_set_reputation' command or by trading or killing enemies)
- Actually joining
So, how do I actually join a faction? It actually is pretty simple. What you need to do is to first shut down your server or game, then set 'enableOldFactionMemberTeams' in CQR's main config (cqrepoured.cfg) to true. After that, join your server or enter your world. Then you want to create a scoreboard team with the same name as the faction you want to join (it is case sensitive). Then you join that team.
Example: Joining the illager faction
- Name of the CQR illager faction (taken from it's faction config): "ILLAGERS"
- <set the 'enableOldFactionMemberTeams' config option to true and restart>
- Join world or server
- Create the scoreboard team: /scoreboard teams add ILLAGERS CQR-Faction-Illagers
- * 'CQR-Faction-Illagers' is only cosmetic, the thing that matters is the 'ILLAGERS'
- Joining the team: /scoreboard teams join ILLAGERS <PLAYERNAME>