Skip to content

Commit

Permalink
Update documents.
Browse files Browse the repository at this point in the history
  • Loading branch information
cao-awa committed Nov 18, 2024
1 parent 85cec54 commit 98dbc99
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 173 deletions.
174 changes: 1 addition & 173 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

+ \<path-to-save\>/datapacks
+ \<pack-name\>
+ 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": <int>
"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": <int>
"minecraft:max_stack_size": {
"value": 64
}
},
}
}
```
See the [Data driven](./document/data-driven/README.md)

## Conium script APIs

Expand Down
123 changes: 123 additions & 0 deletions document/data-driven/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Data driven

## Datapack structure

+ \<path-to-save\>/datapacks
+ \<pack-name\>
+ 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": <int>
"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": <int>
"minecraft:max_stack_size": {
"value": 64
}
},
}
}
```
37 changes: 37 additions & 0 deletions document/data-driven/bedrock/README.md
Original file line number Diff line number Diff line change
@@ -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 |
Loading

0 comments on commit 98dbc99

Please sign in to comment.