# Custom Genes

Genes are data-driven, which means you can make custom Genes using jsons in a datapack.

Gene definition jsons go in `/data/namespace/geneticsresequenced/gene/`. For example, the file `/data/coolmodpack/geneticsresequenced/gene/example.json` would make a Gene with the id `coolmodpack:example`.

The Gene's translation key is dynamically generated, using the pattern `gene.namespace.path`. For the above example, the key would be `gene.coolmodpack.example`.

The Gene's EMI Information recipe is also dynamically generated! It's the exact same as above, but with `info.` at the start. For example `info.gene.coolmodpack.example`.

## The json itself

Every field in a Gene definition file is optional, making `{}` a completely valid json. In fact, several default Genes already use this!

The possible fields are:

- `dna_points_required`
	- An integer, defaults to `1`
	- How many DNA Points are required to fill a Plasmid
- `requires_genes`
	- A list of Gene ids, defaults to `[]`
	- The Gene will fade away if the entity doesn't have everything in the list
- `allowed_entities`
	- An entity type filter, defaults to `{"type": "neoforge:any"}`
		- Can also just use a single entity type id (`minecraft:pig`), or a list of entity type ids (`["minecraft:cow","minecraft:player"]`)
	- Entities not in the list cannot have the Gene
- `potion_details`
	- A list of objects with the following fields:
		- `effect`
			- A mob effect id
		- `level`
			- The potions level (**not its amplifier**)
			- Optional, defaults to 1
		- `duration`
			- The amount of ticks the effect lasts
				- Generally not requires, since the potion is reapplied every couple seconds
			- Optional, defaults to -1 (infinite)
- `attribute_modifiers`
	- A list of objects with the following fields
		- `attribute`
			- An entity attribute id (like `"minecraft:generic.max_health"`)
		- modifier
			- An object with these fields
				- `id`
					- A resource location for the attribute modifier
					- Should be unique
				- `operation`
					- One of the following:
						- "add_value"
						- "add_multiplied_base"
						- "add_multiplied_total"
				- `amount`
					- A number
- `scares_entities_with_tag`
	- An entity type tag, defaults to nothing
	- Entities with that tag run away from entities that have the Gene
- `incompatible_genes`
	- A list of Gene ids, defaults to `[]`
	- The Gene will not be added to entities that already have any of the Genes in the list