From 98dbc99754eb23fb156430f8911097f9ca5bae54 Mon Sep 17 00:00:00 2001 From: cao-awa Date: Mon, 18 Nov 2024 14:24:45 +0800 Subject: [PATCH] Update documents. --- README.md | 174 +------------------------ document/data-driven/README.md | 123 +++++++++++++++++ document/data-driven/bedrock/README.md | 37 ++++++ document/data-driven/conium/README.md | 54 ++++++++ 4 files changed, 215 insertions(+), 173 deletions(-) create mode 100644 document/data-driven/README.md create mode 100644 document/data-driven/bedrock/README.md create mode 100644 document/data-driven/conium/README.md diff --git a/README.md b/README.md index cadf649..17027e3 100644 --- a/README.md +++ b/README.md @@ -27,181 +27,9 @@ Conium has configured whole project, just clone the repository, and reload proje | Fabric loom | 1.8-SNAPSHOT | 1.8-SNAPSHOT or other could be use | | Minecraft | 1.21.3!! | Only 1.21.3 can be use | -## Datapack structure - -+ \/datapacks - + \ - + data - + item - + This directory is items, data type is '.json' - + block - + This directory is blocks, data type is '.json' - + entity - + This directory is entities, data type is '.json' - + property - + item - + This directory is item properties injectors, data type is '.json' - + block - + This directory is block properties injectors, data type is '.json', current is no impls. - + script - + This directory is scripts, data type is 'kts', '.ts' and '.js' - ## Data driven -For items, currently supporting: - -| Conium schema key | Bedrock schema impls | Notes | -|-----------------------------:|:------------------------------------:|:-------------------------------------------------------------------------:| -| tool | * | Make the item be a tool | -| attack_damage (tool) | minecraft:damage | Setting tool damage amount to entities | -| attack_speed (tool) | No impl | Setting tool attack speed (the cooldown) | -| durability (tool) | minecraft:durability | Setting tool durability | -| effective_blocks (tool) | No impl | Setting what blocks can mined by this tool | -| material (tool) | No impl | Setting the base data using material | -| is_weapon (tool) | No impl | Make different durability consume when used to hit entity or break blocks | -| effective_blocks (tool) | No impl | Setting what blocks can mined by this tool | -| damage_chance (tool) | damage_chance (minecraft:durability) | Setting the probability of durability consuming | -| can_destroy_in_creative | minecraft:can_destroy_in_creative | Setting block breakable in creative mode when holding this item | -| max_count | minecraft:max_stack_size | Setting the max item stack count of the item | -| food | minecraft:food | Setting the item be a food | -| can_always_eat (food) | can_always_eat (minecraft:food) | Setting the food can always eats (no cooldown) | -| nutrition (food) | nutrition (minecraft:food) | Setting the nutrition of the food | -| saturation (food) | saturation_modifier (minecraft:food) | Setting the saturation of the food | -| consumable | * | Setting the item has consumable behaviors | -| convert_to (consumable) | using_converts_to (minecraft:food) | Setting the item will convert to other item when used | -| apply_effects (consumable) | No impl | Setting the item will give effects to entity when used | -| rarity | minecraft:rarity | Setting the rarity of the item | -| use_action | minecraft:use_animation | Setting the using action of the item (client animation) | -| fuel | minecraft:fuel | Setting the item can be put into furnaces and provides fuel time | -| glint | minecraft:glint | Setting the item will glint showing (client display) | -| armor | * | Setting the item be a armor and can be wear to the slot | -| defense (armor) | protection (minecraft:wearable) | Setting the armor providing how much protection (defense) | -| slot (armor) | slot (minecraft:wearable) | Setting the armor can wearing to what slot | -| knockback_resistance (armor) | No impl | Setting the armor providing how much knock back resistance | -| toughness (armor) | No impl | Setting armor toughness | -| enchantable (armor) | No impl | Setting armor enchantable (Not completed) | - -For blocks, currently supporting: - -| Conium schema key | Bedrock schema impls | Notes | -|------------------:|:--------------------------------:|:-----------------------------------------------------------------------:| -| hardness | minecraft:destructible_by_mining | Setting the hardness of the block | -| map_color | minecraft:map_color | Setting the map color of the block (Not completed) | -| luminance | minecraft:light_emission | Setting the lighting of the block (like torch or burning furnaces) | -| collision | minecraft:collision_box | Setting the collision box of the block | -| replaceable | No impl | Setting the block can be replaced when placing block like water or fire | -| movement_velocity | No impl | Setting the movement velocity when entities walk or jump on block | -| walk_velocity | No impl | Setting the movement velocity when entities walk on block | -| jump_velocity | No impl | Setting the movement velocity when entities jump on block | -| piston_behavior | No impl | Setting the behavior when piston interacting to the block | -| instrument | No impl | Setting the instrument of note block | - -For entities, supported to defines 'component_groups' in bedrock schema, but unable to switching now. - -Entities currently supporting: - -| Conium schema key | Bedrock schema impls | Notes | -|------------------:|:-----------------------:|:---------------------------------------------------------------------------:| -| dimension | minecraft:collision_box | Setting the collision box of the entity | -| pushable | minecraft:pushable | Setting the entity is can be pushing by other entities or pistons or fluids | -| model | No impl | Setting the entity rendering model | - -### Conium schema - -```json5 -{ - // If using conium schema, 'schema' is required. - "schema_style": "conium", - // The identifier must present. - "identifier": "awa:conium", - "templates": { - // The components where here following listed. - } -} -``` - -Example: - -```json5 -{ - "schema_style": "conium", - "identifier": "awa:conium", - "templates": { - "tool": { - // The damage amount when hitting the entity. - "attack_damage": 100, - // The cooldown modifier after once attack. - "attack_speed": -3.0, - // The durability amount. - "durability": 50, - // Which blocks this tool can mine. - // This value is a tag key. - "effective_blocks": "minecraft:mineable/pickaxe", - // This tool is what material. - "material": "netherite", - // This tool is weapon or not. - // The durability will decrement 2 after this tool damage to entity when it not weapon. - "is_weapon": false - }, - // Setting this tool item can destroy blocks in creative mode. - "can_destroy_in_creative": true, - // The max item stack size. - // The size value must in range 1 to 64. - "max_count": 64 - } -} -``` - -### bedrock schema - -```json5 -{ - // If using bedrock schema, 'schema' can be missing. - "schema_style": "bedrock", - // Format version is always can be missing, conium is supporting to the schemas by all versions. - "format_version": "1.20.10", - "minecraft:item": { - // Description and identifier must present. - "description": { - "identifier": "awa:bedrock" - }, - "components": { - // The components where here following listed. - } - } -} -``` - -Example: - -```json5 -{ - "minecraft:item": { - // Description and identifier must present. - "description": { - "identifier": "awa:bedrock" - }, - "components": { - // The damage amount when hitting the entity. - "minecraft:damage": 10, - // The durability amount of tool item. - // When damage chance is missing, it can be abbreviated as: - // "minecraft:durability": - "minecraft:durability": { - // The amount. - "max_durability": 50 - }, - // The max item stack size. - // The size value must in range 1 to 64. - // It can be abbreviated as: - // "minecraft:max_stack_size": - "minecraft:max_stack_size": { - "value": 64 - } - }, - } -} -``` +See the [Data driven](./document/data-driven/README.md) ## Conium script APIs diff --git a/document/data-driven/README.md b/document/data-driven/README.md new file mode 100644 index 0000000..f0b8dad --- /dev/null +++ b/document/data-driven/README.md @@ -0,0 +1,123 @@ +# Data driven + +## Datapack structure + ++ \/datapacks + + \ + + data + + item + + This directory is items, data type is '.json' + + block + + This directory is blocks, data type is '.json' + + entity + + This directory is entities, data type is '.json' + + property + + item + + This directory is item properties injectors, data type is '.json' + + block + + This directory is block properties injectors, data type is '.json', current is no impls. + + script + + This directory is scripts, data type is 'kts', '.ts' and '.js' + +## Templates or components + +For conium templates, see [Conium data driven](/document/data-driven/conium/README.md). + +For bedrock components, see [Bedrock data driven](/document/data-driven/bedrock/README.md). + +## Conium schema + +```json5 +{ + // If using conium schema, 'schema' is required. + "schema_style": "conium", + // The identifier must present. + "identifier": "awa:conium", + "templates": { + // The components where here following listed. + } +} +``` + +Example: + +```json5 +{ + "schema_style": "conium", + "identifier": "awa:conium", + "templates": { + "tool": { + // The damage amount when hitting the entity. + "attack_damage": 100, + // The cooldown modifier after once attack. + "attack_speed": -3.0, + // The durability amount. + "durability": 50, + // Which blocks this tool can mine. + // This value is a tag key. + "effective_blocks": "minecraft:mineable/pickaxe", + // This tool is what material. + "material": "netherite", + // This tool is weapon or not. + // The durability will decrement 2 after this tool damage to entity when it not weapon. + "is_weapon": false + }, + // Setting this tool item can destroy blocks in creative mode. + "can_destroy_in_creative": true, + // The max item stack size. + // The size value must in range 1 to 64. + "max_count": 64 + } +} +``` + +## bedrock schema + +```json5 +{ + // If using bedrock schema, 'schema' can be missing. + "schema_style": "bedrock", + // Format version is always can be missing, conium is supporting to the schemas by all versions. + "format_version": "1.20.10", + "minecraft:item": { + // Description and identifier must present. + "description": { + "identifier": "awa:bedrock" + }, + "components": { + // The components where here following listed. + } + } +} +``` + +Example: + +```json5 +{ + "minecraft:item": { + // Description and identifier must present. + "description": { + "identifier": "awa:bedrock" + }, + "components": { + // The damage amount when hitting the entity. + "minecraft:damage": 10, + // The durability amount of tool item. + // When damage chance is missing, it can be abbreviated as: + // "minecraft:durability": + "minecraft:durability": { + // The amount. + "max_durability": 50 + }, + // The max item stack size. + // The size value must in range 1 to 64. + // It can be abbreviated as: + // "minecraft:max_stack_size": + "minecraft:max_stack_size": { + "value": 64 + } + }, + } +} +``` diff --git a/document/data-driven/bedrock/README.md b/document/data-driven/bedrock/README.md new file mode 100644 index 0000000..b49933a --- /dev/null +++ b/document/data-driven/bedrock/README.md @@ -0,0 +1,37 @@ +## Items + +| Bedrock schema impls | Conium schema key | Notes | Value type | +|:------------------------------------------:|------------------------------:|:----------------------------------------------------------------:|:---------------------------:| +| minecraft:damage | attack_damage (```tool```) | Setting tool damage amount to entities | float | +| minecraft:durability | durability (```tool```) | Setting tool durability | int | +| damage_chance (```minecraft:durability```) | damage_chance (```tool```) | Setting the probability of durability consuming | float | +| minecraft:can_destroy_in_creative | can_destroy_in_creative | Setting block breakable in creative mode when holding this item | boolean | +| minecraft:max_stack_size | max_count | Setting the max item stack count of the item | int | +| minecraft:food | food | Setting the item be a food | Food object | +| can_always_eat (```minecraft:food```) | can_always_eat (```food```) | Setting the food can always eats (no cooldown) | boolean | +| nutrition (```minecraft:food```) | nutrition (```food```) | Setting the nutrition of the food | int | +| saturation_modifier (```minecraft:food```) | saturation (```food```) | Setting the saturation of the food | float | +| using_converts_to (minecraft:food) | convert_to (```consumable```) | Setting the item will convert to other item when used | string or Item stack object | +| minecraft:rarity | rarity | Setting the rarity of the item | string | +| minecraft:use_animation | use_action | Setting the using action of the item (client animation) | string | +| minecraft:fuel | fuel | Setting the item can be put into furnaces and provides fuel time | int or Fuel object | +| minecraft:glint | glint | Setting the item will glint showing (client display) | boolean | +| protection (minecraft:wearable) | defense (```armor```) | Setting the armor providing how much protection (defense) | float | +| slot (minecraft:wearable) | slot (```armor```) | Setting the armor can wearing to what slot | string | + +## Blocks + +| Bedrock schema impls | Conium schema key | Notes | Value type | +|:--------------------------------:|------------------:|:------------------------------------------------------------------:|:----------------:| +| minecraft:destructible_by_mining | hardness | Setting the hardness of the block | float | +| minecraft:map_color | map_color | Setting the map color of the block (Not completed) | Map color object | +| minecraft:light_emission | luminance | Setting the lighting of the block (like torch or burning furnaces) | int | +| minecraft:collision_box | collision | Setting the collision box of the block | Collision object | + +## Entities +Entities supported to defines 'component_groups' in bedrock schema, but unable to switching now. + +| Bedrock schema impls | Conium schema key | Notes | Value type | +|:-----------------------:|------------------:|:---------------------------------------------------------------------------:|:--------------------------:| +| minecraft:collision_box | dimension | Setting the collision box of the entity | Dimension object | +| minecraft:pushable | pushable | Setting the entity is can be pushing by other entities or pistons or fluids | boolean or Pushable object | diff --git a/document/data-driven/conium/README.md b/document/data-driven/conium/README.md new file mode 100644 index 0000000..b46506a --- /dev/null +++ b/document/data-driven/conium/README.md @@ -0,0 +1,54 @@ +## Items + +| Conium schema key | Bedrock schema impls | Notes | Value type | +|-----------------------------:|:------------------------------------:|:-------------------------------------------------------------------------:|:---------------------------:| +| tool | * | Make the item be a tool | Tool object | +| attack_damage (tool) | minecraft:damage | Setting tool damage amount to entities | float | +| attack_speed (tool) | No impl | Setting tool attack speed (the cooldown) | float | +| durability (tool) | minecraft:durability | Setting tool durability | int | +| effective_blocks (tool) | No impl | Setting what blocks can mined by this tool | string | +| material (tool) | No impl | Setting the base data using material | string | +| is_weapon (tool) | No impl | Make different durability consume when used to hit entity or break blocks | boolean | +| damage_chance (tool) | damage_chance (minecraft:durability) | Setting the probability of durability consuming | Damage chance object | +| can_destroy_in_creative | minecraft:can_destroy_in_creative | Setting block breakable in creative mode when holding this item | boolean | +| max_count | minecraft:max_stack_size | Setting the max item stack count of the item | int | +| food | minecraft:food | Setting the item be a food | Food object | +| can_always_eat (food) | can_always_eat (minecraft:food) | Setting the food can always eats (no cooldown) | boolean | +| nutrition (food) | nutrition (minecraft:food) | Setting the nutrition of the food | int | +| saturation (food) | saturation_modifier (minecraft:food) | Setting the saturation of the food | float | +| consumable | * | Setting the item has consumable behaviors | Consumable object | +| convert_to (consumable) | using_converts_to (minecraft:food) | Setting the item will convert to other item when used | string or Item stack object | +| apply_effects (consumable) | No impl | Setting the item will give effects to entity when used | Apply effects list | +| rarity | minecraft:rarity | Setting the rarity of the item | string | +| use_action | minecraft:use_animation | Setting the using action of the item (client animation) | string | +| fuel | minecraft:fuel | Setting the item can be put into furnaces and provides fuel time | int or Fuel object | +| glint | minecraft:glint | Setting the item will glint showing (client display) | boolean | +| armor | * | Setting the item be a armor and can be wear to the slot | Armor object | +| defense (armor) | protection (minecraft:wearable) | Setting the armor providing how much protection (defense) | double | +| slot (armor) | slot (minecraft:wearable) | Setting the armor can wearing to what slot | string | +| knockback_resistance (armor) | No impl | Setting the armor providing how much knock back resistance | double | +| toughness (armor) | No impl | Setting armor toughness | double | +| enchantable (armor) | No impl | Setting armor enchantable (Not completed) | int | + +## Blocks + +| Conium schema key | Bedrock schema impls | Notes | Value type | +|------------------:|:--------------------------------:|:-----------------------------------------------------------------------:|:------------------------:| +| hardness | minecraft:destructible_by_mining | Setting the hardness of the block | float | +| map_color | minecraft:map_color | Setting the map color of the block (Not completed) | Map color object | +| luminance | minecraft:light_emission | Setting the lighting of the block (like torch or burning furnaces) | int | +| collision | minecraft:collision_box | Setting the collision box of the block | Collision object | +| replaceable | No impl | Setting the block can be replaced when placing block like water or fire | boolean | +| movement_velocity | No impl | Setting the movement velocity when entities walk or jump on block | Movement velocity object | +| walk_velocity | No impl | Setting the movement velocity when entities walk on block | float | +| jump_velocity | No impl | Setting the movement velocity when entities jump on block | float | +| piston_behavior | No impl | Setting the behavior when piston interacting to the block | string | +| instrument | No impl | Setting the instrument of note block | string | + +## Entities + +| Conium schema key | Bedrock schema impls | Notes | Value type | +|------------------:|:-----------------------:|:---------------------------------------------------------------------------:|:-----------------------------:| +| dimension | minecraft:collision_box | Setting the collision box of the entity | Dimension object | +| pushable | minecraft:pushable | Setting the entity is can be pushing by other entities or pistons or fluids | boolean or Pushable object | +| model | No impl | Setting the entity rendering model | Entity rendering model object |