-
Notifications
You must be signed in to change notification settings - Fork 3
Home
To help navigate this wiki, you can use the bar on the side of the page to jump around
Welcome to the wiki for the reputation mod! This page will serve as a comprehensive guide to using the mod as well as answer a few questions about some common issues you may run into when configuring the mod.
The most important thing to note about this mod is that it aims to be nearly fully data-driven, meaning that almost anything the mod does and changes will be able to be configured with datapacks and resourcepacks. By itself, this mod will not do anything, but it has a lot of potential features to be used including setting factions, changing and adding to mob AI, and even making mobs more expressive by use of chat icons.
A datapack is basically just a pack.mcmeta file zipped together with a data folder. To learn more about the basics of a datapack, please consult this vanilla wiki page. All of the files and folders you will need for this mod will be under data/reputation.
The faction system in this mod is what you will use to group mobs, AI changes, and even players together. Everything about a faction is customizable, including the name of the faction, it's enemy factions, and even the icon representing the faction. Note that to apply almost any of the changes from this mod to a specific mob, that mob must be within a faction (even if its a dummy faction without any real usages).
All faction files will be in json format and must be located with a factions folder under the base directory. The name of the file itself does not matter as long as the file is a json, as everything about the faction will be defined by various parameters within that file.
For a faction to be read in correctly, all of the following parameter values should be present within the file: name, default_reputation, lower_reputation_bound, upper_reputation_bound, currency, weighted_murder, weighted_looting, weighted_fleeing, members, and enemies
Here is a short description on what each of those do:
name: This is the name of faction. It can be whatever combination of letters you want it to be,
as long as it is a string within the bounds of a resource location (no capital letters, generally
no special characters other than _-)
default_reputation: This is the reputation value that every player will start at for the faction.
Any integer value is accepted.
lower_reputation_bound: This is the lower bound of neutral reputation. Any reputation value at
or below this value will count as the player being in "bad" standing with the faction. Any integer
value is accepted.
upper_reputation_bound: This is the upper bound of neutral reputation. Any reputation value at
or above this value will count as the player being in "good" standing with the faction. Any integer
value is accepted.
currency: This is the item that the faction accepts as it's main form of currency. This is used for
the ledger system. Any string value is accepted, but if it is not a valid item, it will default to
"minecraft:emerald"
weighted_murder: This is the amount of reputation lost for each entity member of the faction that
sees the player kill another member of the faction. Any integer value is accepted.
weighted_looting: This is the amount of reputation lost for each entity member of the faction that
sees the player open a chest belonging to the faction. Some mobs are pretty greedy... Any integer
value is accepted.
weighted_fleeing: This is the amount of reputation lost when an enemy of a faction that the player
is not currently in escapes during combat with the player. The reputation lost here is for the faction
that the enemy is a part of. Any integer value is accepted.
members: This is an array list of all entity members of the faction. Only living entities are allowed
to be added to a faction.
enemies: This is an array list of all enemy factions of the current faction being defined. The mobs
from the defined faction will not like the ones from enemy factions. (This has not yet been implemented)
{
"name": "villager",
"default_reputation": 50,
"lower_reputation_bound": -50,
"upper_reputation_bound": 50,
"currency": "minecraft:emerald"
"weighted_murder": 5,
"weighted_looting": 2,
"weighted_fleeing": 3,
"members": [
"minecraft:villager",
"guardvillagers:guard",
"minecraft:iron_golem",
"minecraft:wandering_trader"
],
"enemies": [
"reputation:illager",
"reputation:skeleton",
"reputation:nether",
"reputation:piglin"
]
}
In order to be able to change the AI for an entity, it must be assigned to a faction!
The AI file should be called ai.json and should be located directly under the base directory. This is the only place AI changes will be read from.
For the AI file to be read in correctly, all of the following parameter values should be present within the file: passive_fleeing, hostile, passive, injured_fleeing, and trading`
Here is a short description on what each of those do:
passive_fleeing: All mobs in this will flee from the players in the specified reputation standing. The default
standing is "bad".
hostile: All neutral mobs in this list will become hostile towards the player in the specified reputation standing.
The default standing is "bad".
passive: All hostile mobs in this list will become passive towards the player in the specified reputation standing.
The default standing is "good".
injured_fleeing: If a mob is in this list, there is a chance that it will attempt to flee from battle from players
in the specified reputation standing. If the player is in the same faction as the mob it will not attempt to flee.
The default standing is "neutral".
trading: (Currently only affects villagers) Any mob in this list will have their trading prices changed based on
the reputation of the player. The specified reputation standing acts as a cutoff in this case where the mob will
refuse to trade with the player. The default standing is "neutral".
The parameter values for the AI file mention "reputation bounds". Those are simply the values in reputation that the player has to be in, bounded by your higher and lower reputation bounds from the faction file. good reputation means the player's reputation for that faction has to be equal to or greater than the upper reputation bound, neutral reputation means the player's reputation for that faction has to be in between the higher and lower reputation bounds, and bad reputation means that the player's reputation for that faction has to be less than or equal to the lower reputation bound. A reputation bound for a mob can be defined like minecraft:villager:bad
{
"passive_fleeing": [
"minecraft:villager:neutral"
],
"hostile": [],
"passive": [],
"injured_fleeing": [
"minecraft:pillager"
],
"trading": [
"minecraft:villager"
]
}
Chat Icons are a way to let user define images be rendered above the heads of whatever mobs are defined in the files as if the mobs are talking.
All chat icon files will be in a chat folder under the base directory of the datapack. It does not matter what the names of the files are, but there has to be a file for every mob that you want to add chat icons to. The name parameter within each json file dictates what mob is being targeted by the file.
As of reputation V0.9.2 there are 4 different events for chat icons. In order of lowest to higher priority, those are idle, idle_faction, engage, and flee. The priority in this case just means which event will push it's icons to the client in case of multiple being active at once. Within each event goes a list of icons that will be tied to the event when it gets fired. Here is a short description for each of the events.
idle: This event has a random chance of firing once every second.
idle_faction: This event fires whenever the idle event does, but only if there are other mobs in the same faction
nearby
engage: This event fires when the mob is in battle with another entity
flee: This event fires when the mob is fleeing via the "injured_fleeing" or "passive_fleeing" changes within the
AI file of the mod
{
"name": "minecraft:villager",
"idle": [
"meat"
],
"idle_faction": [
"skele", "creeper"
],
"engage": [
],
"flee": [
]
}
A resourcepack is basically just a pack.mcmeta file zipped together with an assets folder. To learn more about the basics of a resourcepack, please consult this vanilla wiki page. All of the files and folders you will need for this mod will be under assets/reputation.
This is the main icon for the faction used when gaining/losing reputation for the faction as well as what is rendered above an entity's head within the faction when the client side debug info is turned on.
All faction icon files will be in a folder located at textures/icons under the base directory of the resourcepack. The name of the file must be in the form of faction_factionname.png. For example, if you have a faction called villager, then the icon for that faction would have to be called faction_villager.png
This is where the chat icons on the datapack side will pull their resources from. Any chat icons referenced there must be valid resources here, otherwise the default missing texture icon will be rendered instead.
All chat icon files will be in a folder located at textures/chat under the base directory of the resourcepack. The name of the file must be in the form of file.png and should be a square image, but otherwise you can do basically whatever you want For example, if you are referencing an icon called meat from the datapack side, that file should be meat.png on this side.
Here is some additional information not directly related to either the datapack or resourcepack sides of the mod.
There are a few commands for externally manipulating the reputation values for specific factions. Commands are also currently the only way of adding players to a faction (or removing them from one).
This command adds a set amount of reputation for the specified faction for the player. It can be formatted as /addreputation reputation:factionname amount (this only works if a player is running the command) or /addreputation reputation:factionname player amount For example, if you wanted to add 5 to the reputation of a faction called villager for the player player123, you would do /addreputation reputation:villager player123 5
This command sets the reputation for the specified faction for the player to the specified amount. It can be formatted as /setreputation reputation:factionname amount (this only works if a player is running the command) or /setreputation reputation:factionname player amount For example, if you wanted to set the reputation of a faction called villager for the player player123, to 69 you would do /setreputation reputation:villager player123 69
This command allows you to add a player to a defined faction. It can be formatted as /addplayerfaction reputation:factionname (this only works if a player is running the command) or /addplayerfaction reputation:factionname player For example, if you wanted to add the player player123 to the faction called villager, you would do /addplayerfaction reputation:villager player123
This command allows you to remove a player a player from a faction, if they are a part of that faction. If they are not already a part of that faction, the command will do nothing. It can be formatted as /removeplayerfaction reputation:factionname (this only works if a player is running the command) or /removeplayerfaction reputation:factionname player For example, if you wanted to remove the player player123 from the faction called villager, you would do /removeplayerfaction reputation:villager player123
The ledger system is a system that allows you to trade a form of currency in order to increase your reputation with that faction. As of V0.9.5 it is currently the only way to gain reputation for a faction other than either the addreputation or setrputation commands.
The currency bag is a bundle of the specified currency item for the faction. The default crafting method for this is to surround a piece of leather with 8 of the currency from the desired faction. Grabbing a faction bag from the creative menu or from JEI cheat mode currently does not work at the moment, as custom nbt data is attached to the bag when it is crafted.
The currency bag must be signed before it can be deposited into a ledger and converted into positive reputation for that faction. For this to work, you must right click a ledger book block with a currency bag that has the correct nbt data from crafting while holding an ink sac in your offhand. You get double the reputation increase if there is a mob from the faction within the vicinity to witness you signing the bag at the ledger book.
After a currency bag is signed, it can then be deposited into a ledger block. Once the sun goes down all currency bags will be processed and the correct reputation increase will be distributed to the factions you signed bags for. You can put whatever you want into a ledger, but be careful since it will not let you take anything out and its inventory gets cleared during the sunset check! This is to act as insurance in multiplayer worlds so that other players cannot interfere with your deposits.