Skip to content

Commit

Permalink
add updated blood value data
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheaterpaul committed Apr 19, 2024
1 parent 619d2a0 commit d3b7bfb
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 57 additions & 40 deletions docs/data/bloodvalues.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,81 @@ title: Blood Values

Blood values can be configured for items, entities and fluids.

## Types
In the following context the `file-id` is an identified for your file that is relevant if you want to override values. This works similar to the tag system. Creating the file `vampirism.json` and setting `replace` to `true` will remove all values that vampirism sets in `vamprism.json` and adds your values.
### Items
Starting with NeoForge Vampirism uses the new data maps to assign blood values to items, fluids and entities. Take a look at the [official wiki](https://docs.neoforged.net/docs/datamaps/structure) for more information about data maps.

## Items
Item blood values are used by the [Grinder](../wiki/content/blocks#grinder) to determine the amount of impure blood of an item when grinding it.
A configured value of `20` means that the grinder will produce 20mb impure blood when grinding the item.

File location : `data/<your-modid>/vampirism/bloodvalues/items/<file-id>.json`
### Schema
```json title="data/vampirism/data_maps/item/item_blood_value.json"
{
"replace": false,
"values": {
"<item-id>": {
"blood": <blood-amount>
},
"<item-id>": {
"blood": <blood-amount>
}
}
}
```

| Field | Type | Description |
|-----------|------------------|---------------------------------------------------------------------------------------------------------------|
| `replace` | bool | If the values should replace the existing values. If `false` the values will be added to the existing values. |
| `item-id` | ResourceLocation | The id of the item tha should be convertible to impure blood |
| `blood` | int | The amount of blood the item will produce when grinding it. e.g. `20` for 20mb impure blood. |

### Entities
## Entities
Entity blood values are relevant for biting creatures as Vampire. It determines the amount of blood the creature has or if it has no blood at all.
A configured value of `10` means that the creature can fill 10 half-blood / 5 blood in the blood bar.
A value of `0` means that the creature cannot be bitten.

File location : `data/<your-modid>/vampirism/bloodvalues/entities/<file-id>.json`

### Fluids
Fluid blood values are conversion rates from other fluids to blood. It is used by the [Blood Sieve](../wiki/content/blocks#blood-sieve) to transform [Impure Blood](../wiki/content/fluids#impure-blood) into [Blood](../wiki/content/fluids#blood).
But this also support third party fluids if configured. A configured value of `0.75` means that 1 bucket of the fluid is converted to 0.75 buckets of blood.

File location : `data/<your-modid>/vampirism/bloodvalues/fluids/<file-id>.json`

## Schema
All types share the same schema:

##### Minecraft 1.16
```json title="<fileid>.json"
### Schema
```json title="data/vampirism/data_maps/item/entity_blood_value.json"
{
"replace": false,
"values": {
"<item_id>": <blood_value>,
"<item_id>": <blood_value>,
"<item_id>": <blood_value>,
"<item_id>": <blood_value>
"<entity-id>": {
"blood": 0 # no blood
},
"<entity-id>": {
"blood": <blood-amount>
}
}
}
```
- `<item-id>`: The registry id of the type.
- `<blood_value>`: The floating point blood value.

##### Minecraft 1.19
```json title="<fileid>.json"
| Field | Type | Description |
|-------------------|------------------|---------------------------------------------------------------------------------------------------------------|
| `replace` | bool | If the values should replace the existing values. If `false` the values will be added to the existing values. |
| `entity-id` | ResourceLocation | The id of the entity that should have blood or no blood |
| `blood` | int | The amount of blood the entity will produce when bitten. e.g. `10` for 10 half-blood / 5 blood. |

## Fluids
Fluid blood values are conversion rates from other fluids to blood. It is used by the [Blood Sieve](../wiki/content/blocks#blood-sieve) to transform [Impure Blood](../wiki/content/fluids#impure-blood) into [Blood](../wiki/content/fluids#blood).
But this also supports third party fluids if configured. A configured value of `0.75` means that 1 bucket of the fluid is converted to 0.75 buckets of blood.

### Schema

```json title="data/vampirism/data_maps/item/fluid_blood_conversion.json"
{
"replace": false,
"values": [
{
"id": "<item_id>",
"value": <blood_value>
},
{
"id": "<item_id>",
"value": <blood_value>
"values": {
"<fluid-id>": {
"conversionRate": <conversion-rate>
},
{
"id": "<item_id>",
"value": <blood_value>
"<fluid-id>": {
"conversionRate": <conversion-rate>
}
]
}
}
```
- `<item-id>`: The registry id of the type.
- `<blood_value>`: The floating point blood value.

| Field | Type | Description |
|------------------|------------------|---------------------------------------------------------------------------------------------------------------|
| `replace` | bool | If the values should replace the existing values. If `false` the values will be added to the existing values. |
| `fluid-id` | ResourceLocation | The id of the fluid to convert to blood |
| `conversionRate` | float | The conversion rate from the fluid to impure blood. e.g. `0.75` for 1 bucket to 0.75 buckets of blood. |
42 changes: 29 additions & 13 deletions docs/data/convertibles.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,37 @@ sidebar_position: 4
title: Convertibles
---

Main article about Vampiric Creatures can be found [here](../wiki/content/entities/bitten_animal).
The Main article about Vampiric Creatures can be found [here](../wiki/content/entities/bitten_animal).

By default, only vanilla animals can be converted to a vampiric version and Vampirism Integrations adds support for some other mods.
But if you want to make your own modded creatures convertible, or you are a modpack creator who wants more compatibility you can easily create simple vampiric version of other creatures.
By default, only vanilla animals can be converted to a vampiric version, and Vampirism Integrations add support for some other mods.
But if you want to make your own modded creatures convertible, or you are a modpack creator who wants more compatibility, you can easily create a simple vampiric version of other creatures.

## Prerequisites
First of all the entity must have blood values configured for them to be convertible. See [Blood Values](bloodvalues.md) for more information.
A convertible handler is registered alongside [blood values](./bloodvalues#entities). The entity must have a blood value greater than 0 to be convertible.

The convertible handler is added like this:
```json title="data/vampirism/data_maps/entity_type/entity_converter.json"
{
"values": {
"<entity-id>": {
"handler": {
"type": "vampirism:default"
},
"overlay": "<path-to-overlay-texture>"
}
}
}
```


## Different converter
There are two build-in converters available. Others can be added by other mods.
There are two build-in converters available. Other mods can add different converters.

### Default Converter
The default converter can be used for any entity. It will create a vampiric version of the entity. The problem with this variant is that the converted entity acts as dummy entity, which does not support the interactions of the source entity.
What this means is that if you convert a horse with this converter, you will no longer be able to ride it, access the inventory, etc ...

```json title="data/<modid>/vampirism/converter/<entity-modid>/<entity-id-path>.json"
```json
{
"handler": {
"type": "vampirism:default"
Expand All @@ -29,7 +43,7 @@ What this means is that if you convert a horse with this converter, you will no

### Special Converter
The special converter is used to convert an entity into a specific vampiric entity. This is used, for example, to convert a horse into a vampire horse with full functionality. But this requires a custom converted entity to be registered.
```json title="data/<modid>/vampirism/converter/<entity-modid>/<entity-id-path>.json"
```json
{
"handler": {
"type": "vampirism:special",
Expand All @@ -42,15 +56,15 @@ The special converter is used to convert an entity into a specific vampiric enti

Additionally, a converted entity requires an overlay texture to distinguish it from the original entity. This overlay texture is applied to the original entities texture and can be specified with the `overlay` property.

```json title="data/<modid>/vampirism/converter/<entity-modid>/<entity-id-path>.json"
```json
{
"handler": {...},
"overlay": "<path-to-overlay-texture>"
}
```

## Attribute modifiers
If no attribute modifier are defined the following default modifiers will be applied to the converted entity:
If no attribute modifier is defined, the following default modifiers will be applied to the converted entity:

- Attack Damage: x1.3
- Knockback Resistance: x1.3
Expand All @@ -59,7 +73,7 @@ If no attribute modifier are defined the following default modifiers will be app

They can be configured with the `attribute_helper` property. The following example shows how to configure the attack damage modifier.

```json title="data/<modid>/vampirism/converter/<entity-modid>/<entity-id-path>.json"
```json
{
"handler": {
"type": ...,
Expand All @@ -74,6 +88,8 @@ They can be configured with the `attribute_helper` property. The following examp
}
```

- `attribute`: The attribute to modify. See [here](https://minecraft.fandom.com/wiki/Attribute) for all vanilla attributes.
- `modifier`: The modifier to apply to the attribute. The final value will be `base * modifier`.
- `fallback_base`: The base value to use if the entity does not have the attribute. This is useful for modded entities which do not have the vanilla attributes.
| Field | Type | Description |
|-----------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| `attribute` | ResourceLocation | The attribute to modify. See [here](https://minecraft.fandom.com/wiki/Attribute) for all vanilla attributes. |
| `modifier` | float | The modifier to apply to the attribute. The final value will be `base * modifier`. |
| `fallback_base` | float | The base value to use if the entity does not have the attribute. This is useful for modded entities which do not have the vanilla attributes. |

0 comments on commit d3b7bfb

Please sign in to comment.