From 7bf2a01caa26c2da38ddf9878b97575d686f9584 Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Wed, 13 Dec 2023 18:24:52 +0100 Subject: [PATCH] add task data pack page --- docs/api/reference.md | 15 +- docs/data/lootconditions/_category_.json | 2 +- docs/data/lootfunctions/_category_.json | 2 +- docs/data/recipes/_category_.json | 2 +- docs/data/reference.md | 24 ++ docs/data/tasks.md | 304 +++++++++++++++++++++++ 6 files changed, 338 insertions(+), 11 deletions(-) create mode 100644 docs/data/reference.md create mode 100644 docs/data/tasks.md diff --git a/docs/api/reference.md b/docs/api/reference.md index 3c8fb44574..f3d2869b38 100644 --- a/docs/api/reference.md +++ b/docs/api/reference.md @@ -25,13 +25,8 @@ Contains all `IGuiOverlay`s that are used by Vampirism, which are filled during All custom registries are using the [VampirismRegistries](https://github.com/TeamLapen/Vampirism/blob/4ea422de4d01b52d07b6d9b8e0c536394ae5d515/src/api/java/de/teamlapen/vampirism/api/VampirismRegistries.java#L25) class to store the registry key and registry supplier. -#### Minecraft 1.16-1.18 -Vampirism's custom forge registries are not accessible through the API. They are not declared in the API [ModRegistries](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/main/java/de/teamlapen/vampirism/core/ModRegistries.java). -But you can get them from the RegistryManager with `RegistryManager.ACTIVE.getRegistry(...)`. Either use the RegistryEntry class or the resource location of the registry. - - ### Registries -Following registries are currently available: +The following registries are currently available: | Name | Resourcelocation | Class | |-----------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -39,6 +34,10 @@ Following registries are currently available: | Actions | `vampirism:actions` | [IAction](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/api/java/de/teamlapen/vampirism/api/entity/player/actions/IAction.java) | | Entity Actions | `vampirism:entityactions` | [IEntityAction](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/api/java/de/teamlapen/vampirism/api/entity/actions/IEntityAction.java) | | Minion Tasks | `vampirism:miniontasks` | [IMinionTask](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/api/java/de/teamlapen/vampirism/api/entity/minion/IMinionTask.java) | -| Tasks | `vampirism:tasks` | [Task](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/api/java/de/teamlapen/vampirism/api/entity/player/task/Task.java) | | Refinements | `vampirism:refinement` | [IRefinement](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/api/java/de/teamlapen/vampirism/api/entity/player/refinement/IRefinement.java) | -| Refinement Sets | `vampirism:refinement_set` | [IRefinementSet](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/api/java/de/teamlapen/vampirism/api/entity/player/refinement/IRefinementSet.java) | \ No newline at end of file +| Refinement Sets | `vampirism:refinement_set` | [IRefinementSet](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/api/java/de/teamlapen/vampirism/api/entity/player/refinement/IRefinementSet.java) | + +### Data Registries +| Name | Resourcelocation | Class | +|-----------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Tasks | `vampirism:tasks` | [Task](https://github.com/TeamLapen/Vampirism/blob/4bf2c73fb860a23de225edbae9c0b1c1ead3dd1a/src/api/java/de/teamlapen/vampirism/api/entity/player/task/Task.java) | diff --git a/docs/data/lootconditions/_category_.json b/docs/data/lootconditions/_category_.json index 1408c84a77..2f23696dd7 100644 --- a/docs/data/lootconditions/_category_.json +++ b/docs/data/lootconditions/_category_.json @@ -1,6 +1,6 @@ { "label": "Loot Conditions", - "position": 7, + "position": 8, "collapsed": true, "collapsible": true } diff --git a/docs/data/lootfunctions/_category_.json b/docs/data/lootfunctions/_category_.json index 3876dc3031..954a7bb30e 100644 --- a/docs/data/lootfunctions/_category_.json +++ b/docs/data/lootfunctions/_category_.json @@ -1,6 +1,6 @@ { "label": "Loot Functions", - "position": 8, + "position": 9, "collapsed": true, "collapsible": true } diff --git a/docs/data/recipes/_category_.json b/docs/data/recipes/_category_.json index a41ef269a8..a0d818524c 100644 --- a/docs/data/recipes/_category_.json +++ b/docs/data/recipes/_category_.json @@ -1,6 +1,6 @@ { "label": "Recipes", - "position": 6, + "position": 7, "collapsed": true, "collapsible": true } diff --git a/docs/data/reference.md b/docs/data/reference.md new file mode 100644 index 0000000000..5fda1244d4 --- /dev/null +++ b/docs/data/reference.md @@ -0,0 +1,24 @@ +--- +title: Reference +--- + +## Faction +```json +{ + "id": "" +} +``` + +| Field | Type | Description | +|------------|------------------|------------------------------------------------| +| faction-id | ResourceLocation | The id of the faction. e.g `vampirism:vampire` | + +## Refinement Rarity + +| Type | String Representation | +|-----------|-----------------------| +| COMMON | common | +| UNCOMMON | uncommon | +| RARE | rare | +| EPIC | epic | +| LEGENDARY | legendary | diff --git a/docs/data/tasks.md b/docs/data/tasks.md new file mode 100644 index 0000000000..b133a9f89b --- /dev/null +++ b/docs/data/tasks.md @@ -0,0 +1,304 @@ +--- +sidebar_position: 6 +title: Tasks +--- + +Tasks are given to faction player to collect items or achieve certain goals. They are given by a [Faction Representative](/docs/wiki/content/entities/village_representative) + + +## Location +All task files need to be located in the folder `data//vampirism/tasks/` +## Id +Every task has an id that is determined by the files' name and directory. E.g., the task in the file `data/vampirism/vampirism/tasks/hunter/hunter_lord2.json` will have the id `vampirism:hunter/hunter_lord2` + +## Schema + +```json title="taskname.json" +{ + "requirements": { + "requirements": [] + }, + "rewards": {}, + "title": {}, + "description": {}, + "unlocker": [] +} +``` +- `requirements`: The requirements to finish the task. +- `rewards`: The rewards for finishing the task. +- `title`: The title of the task. Component + +| Field | Type | Description | +|--------------|------------------------------------------------------------------------|--------------------------------------| +| requirements | [Requirements](#requirements) | The requirements to finish the task. | +| rewards | [Rewards](#rewards) | The reward for finishing the task. | +| unlocker | [Unlocker](#unlocker) | The requirements to accept the task. | +| title | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | The title of the task. | +| description | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | The description of the task. | + +### Requirements + +#### Entity Requirement +This requirement checks if the player has killed a certain amount of a specific entity. +```json +{ + "type": "vampirism:entity", + "amount": , + "description": , + "entityType": "", + "id": "" +} +``` + +| Field | Type | Description | +|-------------|-------------------------------------------------------------------------|-------------------------------------------------| +| amount | int | the amount of entities that need to be killed | +| description | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | the description of the requirement | +| entity_type | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | id of the entity | +| id | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | unique id of the requirement inside of the task | + + + +#### Entity Type Requirement +This requirement checks if the player has killed a certain amount of entity belonging to an entity tag. +```json +{ + "type": "vampirism:entity_type", + "amount": , + "description": , + "entityType": "", + "id": "" +} +``` + +| Field | Type | Description | +|-------------|-------------------------------------------------------------------------|-------------------------------------------------| +| amount | int | the amount of entities that need to be killed | +| description | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | the description of the requirement | +| entity_type | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | id of the entity tag | +| id | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | unique id of the requirement inside of the task | + + + +#### Stat Requirement +This requirement checks if a given stat was increased by a defined number. + +```json +{ + "type": "vampirism:stat", + "amount": , + "description": , + "id": "", + "stat": "" +} +``` + +| Field | Type | Description | +|-------------|-------------------------------------------------------------------------|-----------------------------------------------------| +| amount | int | the amount with which the stat need to be increased | +| description | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | the description of the requirement | +| id | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | unique id of the requirement inside of the task | +| stat | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | the id of the stat that should be checked | + + + +#### Item Requirement +This requirement checks if the player has the itemstack in their inventory. +```json +{ + "type": "vampirism:item", + "description": , + "id": "", + "item": +} +``` + +| Field | Type | Description | +|-------------|----------------------------------------------------------------------------|-----------------------------------------------------------| +| description | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | the description of the requirement | +| id | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | unique id of the requirement inside of the task | +| item | [Item](https://minecraft.fandom.com/wiki/Tutorials/Command_NBT_tags#Items) | the item that should be checked. This includes the amount | + + + +#### Boolean Requirement +The Boolean requirement checks a registered funtion, if the requirement is completed. This can only be registered using the api +```json +{ + "type": "vampirism:boolean", + "description": , + "id": "", + "function": "" +} +``` + +| Field | Type | Description | +|-------------|-------------------------------------------------------------------------|----------------------------------------------------------| +| description | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | the description of the requirement | +| id | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | unique id of the requirement inside of the task | +| function | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | the id of the registered function that should be checked | + +### Rewards +#### Item Reward +A simple item reward that will reward the player with a specific itemstack. + +```json +{ + "type": "vampirism:item", + "item": +} +``` + +| Field | Type | Description | +|-------|----------------------------------------------------------------------------|---------------------------------------------------| +| item | [Item](https://minecraft.fandom.com/wiki/Tutorials/Command_NBT_tags#Items) | the itemstack that will be rewarded to the player | + + +#### Refinement Item Reward +This is a special item Reward that rewards an accessory item to the player. When a parameter is not given, it will be randomly chosen from the available refinements. + +```json +{ + "type": "vampirism:refinement_item", + "faction": , + "item": , + "rarity": +} +``` + +| Field | Optional | Type | Description | +|---------|----------|----------------------------------------------------------------------------|-----------------------------------------------------------| +| faction | x | [Faction](reference#faction) | the faction for which the accessory should be created | +| item | x | [Item](https://minecraft.fandom.com/wiki/Tutorials/Command_NBT_tags#Items) | the accessory item that should be filled with refinements | +| rarity | x | [Rarity](reference#refinement-rarity) | a specific rarity for the refinements. | +#### Lord Level Reward +The Lord Level Reward will reward the player with a specific lord level. +```json +{ + "type": "vampirism:lord_level", + "description": , + "targetLevel": +} +``` + +| Field | Type | Description | +|-------------|-------------------------------------------------------------------------|------------------------------------| +| description | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | the description of the requirement | +| targetLevel | int | the level that should be awarded | +#### Action Reward + +The action reward will execute a specific registered action upon completion. + +```json +{ + "type": "vampirism:consumer", + "description": , + "consumer": "" +} +``` + +| Field | Type | Description | +|-------------|-------------------------------------------------------------------------|-----------------------------------------------------------| +| description | [Component](https://minecraft.fandom.com/wiki/Raw_JSON_text_format) | the description of the requirement | +| consumer | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | the id of the registered function that should be executed | + +### Unlocker +#### Level Unlocker + +```json +{ + "type": "vampirism:level", + "reqLevel": , + "maxLevel": +} +``` + +| Field | Required | Type | Description | +|----------|----------|------|-------------------------------------------------------| +| reqLevel | x | int | the minimum level that is required to unlock the task | +| maxLevel | | int | the maximum level that allows this task | +#### Lord Level Unlocker + +```json +{ + "type": "vampirism:lord_level", + "exact": true, + "reqLordLevel": +} +``` + +| Field | Required | Type | Description | +|------------|----------|------|---------------------------------------------------------| +| exact | x | bool | if the lord level should be exactly the given level | +| lord-level | x | int | the lord level to unlock this task, or the minium level | +#### Parent Unlocker + +```json +{ + "type": "vampirism:parent", + "parent": "" +} +``` + +| Field | Type | Description | +|--------|-------------------------------------------------------------------------|-------------------------------------------------------------------------------| +| parent | [ResourceLocation](https://minecraft.fandom.com/wiki/Resource_location) | the id of the task that needs to be completed before this task can be started | +## Example + +```json +{ + "requirements": { + "requirements": [ + { + "type": "vampirism:stat", + "amount": 6, + "description": { + "translate": "stat.vampirism.capture_village" + }, + "id": "vampirism:capture_village", + "stat": "vampirism:capture_village" + }, + { + "type": "vampirism:item", + "description": { + "translate": "item.minecraft.gold_ingot" + }, + "id": "minecraft:gold_ingot", + "item": { + "Count": 64, + "id": "minecraft:gold_ingot" + } + }, + { + "type": "vampirism:entity_type", + "amount": 100, + "description": { + "translate": "entity_tag.vampirism.vampire" + }, + "entityType": "vampirism:vampire", + "id": "vampirism:vampire" + } + ] + }, + "rewards": { + "type": "vampirism:lord_level", + "description": { + "translate": "task_reward.vampirism.lord_level_reward", + "with": [ + "5" + ] + }, + "targetLevel": 5 + }, + "title": { + "translate": "task.vampirism.hunter_lord5" + }, + "unlocker": [ + { + "type": "vampirism:lord_level", + "exact": true, + "reqLordLevel": 4 + } + ] +} +``` \ No newline at end of file