Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand block reference schema #121

Merged
merged 6 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion source/behavior/blocks/format/events/set_block.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@
"description": "Sets this block to another block type.",
"title": "Set Block",
"additionalProperties": false,
"properties": { "block_type": { "type": "string", "default": "", "description": "The type of block to set.", "title": "Block Type" } }
"properties": {
"block_type": {
"$ref": "../../../../general/block/reference.json",
"default": "",
"description": "The type of block to set.",
"title": "Block Type"
}
}
}
7 changes: 6 additions & 1 deletion source/behavior/blocks/format/events/set_block_at_pos.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
{ "type": "number", "title": "Z", "description": "The z offset from the block's center." }
]
},
"block_type": { "type": "string", "default": "", "description": "The type of block to set.", "title": "Block Type" }
"block_type": {
"$ref": "../../../../general/block/reference.json",
"default": "",
"description": "The type of block to set.",
"title": "Block Type"
}
}
}
2 changes: 1 addition & 1 deletion source/behavior/entities/format/behaviors/raid_garden.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"type": "string",
"title": "Block Id",
"description": "A block identifier.",
"$ref": "../../../../general/item/descriptor.json"
"$ref": "../../../../general/block/reference.json"
}
},
"eat_delay": {
Expand Down
8 changes: 4 additions & 4 deletions source/behavior/entities/format/components/ageable.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
{
"type": "array",
"items": {
"$ref": "../../../../general/item/identifier.json"
"$ref": "../../../../general/item/descriptor.json"
}
},
{
"type": "string",
"$ref": "../../../../general/item/identifier.json"
"$ref": "../../../../general/item/descriptor.json"
}
],
"title": "Drop Items"
Expand Down Expand Up @@ -44,7 +44,7 @@
"type": "number"
},
"item": {
"$ref": "../../../../general/item/identifier.json"
"$ref": "../../../../general/item/descriptor.json"
}
}
}
Expand All @@ -64,7 +64,7 @@
"title": "Grow Up"
},
"transform_to_item": {
"type": "string",
"$ref": "../../../../general/item/descriptor.json",
"title": "Transform To Item",
"description": "The feed item used will transform to this item upon successful interaction. Format: itemName:auxValue"
}
Expand Down
10 changes: 8 additions & 2 deletions source/behavior/entities/format/components/boostable.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@
"description": "This is the damage that the item will take each time it is used.",
"title": "Damage"
},
"item_damage": {
"type": "integer",
"default": 1,
"description": "UNDOCUMENTED.",
"title": "Item Damage"
},
"item": {
"type": "string",
"$ref": "../../../../general/item/descriptor.json",
"default": "",
"description": "Name of the item that can be used to boost.",
"title": "Item"
},
"replace_item": {
"type": "string",
"$ref": "../../../../general/item/descriptor.json",
"default": "",
"description": "The item used to boost will become this item once it is used up.",
"title": "Replace Item"
Expand Down
4 changes: 2 additions & 2 deletions source/behavior/entities/format/components/breathable.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
"type": "array",
"description": "List of blocks this entity can breathe in, in addition to the above.",
"items": {
"$ref": "../../../../general/block/identifier.json"
"$ref": "../../../../general/block/reference.json"
},
"title": "Breathe Blocks"
},
"non_breathe_blocks": {
"type": "array",
"description": "List of blocks this entity can't breathe in, in addition to the above.",
"items": {
"$ref": "../../../../general/block/identifier.json"
"$ref": "../../../../general/block/reference.json"
},
"title": "Non Breathes Blocks"
}
Expand Down
8 changes: 4 additions & 4 deletions source/behavior/entities/format/components/breedable.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
"items": {
"description": "A block type required nearby for the entity to breed.",
"type": "string",
"$ref": "../../../../general/blocks_item.json",
"$ref": "../../../../general/block/reference.json",
"title": "Blocks"
}
},
{
"description": "A block type required nearby for the entity to breed.",
"type": "string",
"$ref": "../../../../general/blocks_item.json",
"$ref": "../../../../general/block/reference.json",
"title": "Blocks"
}
]
Expand Down Expand Up @@ -95,13 +95,13 @@
"items": {
"type": "string",
"description": "An item that can be used to get the entity into the `love` state.",
"$ref": "../../../../general/item/identifier.json",
"$ref": "../../../../general/item/descriptor.json",
"title": "Breed Item"
}
},
{
"type": "string",
"$ref": "../../../../general/item/identifier.json"
"$ref": "../../../../general/item/descriptor.json"
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions source/behavior/entities/format/components/buoyant.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"description": "List of blocks this entity can float on. Must be a liquid block.",
"title": "Liquid Blocks",
"items": {
"type": "string",
"title": "Block ID"
"title": "Block",
"$ref": "../../../../general/block/reference.json"
}
},
"simulate_waves": {
Expand Down
2 changes: 1 addition & 1 deletion source/behavior/entities/format/components/equippable.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
},
"item": {
"$ref": "../../../../general/item/identifier.json",
"$ref": "../../../../general/item/descriptor.json",
"description": "Identifier of the item that can be equipped for this slot.",
"title": "Item"
},
Expand Down
44 changes: 42 additions & 2 deletions source/behavior/entities/format/components/healable.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@
"title": "Healable",
"additionalProperties": false,
"required": [],
"definitions": {
"effect": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED",
"type": "string"
},
"duration": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "The duration of the effect.",
"$comment": "UNDOCUMENTED"
},
"amplifier": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "The amplifier of the effect.",
"$comment": "UNDOCUMENTED"
}
}
}
},
"properties": {
"filters": {
"$ref": "../../filters/filters.json"
Expand Down Expand Up @@ -33,9 +60,22 @@
"title": "Heal Amount"
},
"item": {
"type": "string",
"description": "Item identifier that can be used to heal this entity.",
"$ref": "../../../../general/item/descriptor.json",
"description": "Item that can be used to heal this entity.",
"title": "Item"
},
"effects": {
"oneOf": [
{
"$ref": "#/definitions/effect"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/effect"
}
}
]
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions source/behavior/entities/format/components/npc.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
"$comment": "UNDOCUMENTED",
"type": "integer",
"minimum": 0
},
"mark_variant": {
"title": "Mark Variant",
"description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED",
"type": "integer",
"minimum": 0
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"blocks": {
"type": "array",
"items": {
"$ref": "../../../../general/blocks_item.json"
"$ref": "../../../../general/block/reference.json"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"title": "Spawn Event"
},
"spawn_item": {
"type": "string",
"$ref": "../../../../general/item/descriptor.json",
"default": "egg",
"description": "Item identifier of the item to spawn.",
"title": "Spawn Item"
Expand Down
4 changes: 2 additions & 2 deletions source/behavior/entities/format/components/tamemount.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"description": "The list of items that can be used to increase the entity's temper and speed up the taming process.",
"properties": {
"item": {
"$ref": "../../../../general/item/identifier.json",
"$ref": "../../../../general/item/descriptor.json",
"description": "Name of the item this entity likes and can be used to increase this entity's temper.",
"title": "Item"
},
Expand All @@ -27,7 +27,7 @@
"description": "The list of items that this entity dislikes and will cause it to get angry if used while untamed.",
"properties": {
"item": {
"$ref": "../../../../general/item/identifier.json",
"$ref": "../../../../general/item/descriptor.json",
"description": "Name of the item this entity dislikes and will cause it to get angry if used while untamed."
}
}
Expand Down
20 changes: 20 additions & 0 deletions source/behavior/entities/format/types/entity_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@
"default": 16,
"title": "Maximum Dist"
},
"max_height": {
"type": "number",
"description": "UNDOCUMENTED.",
"title": "Maximum Height"
},
"max_flee": {
"type": "number",
"description": "UNDOCUMENTED.",
"title": "Maximum Height"
},
"priority": {
"type": "number",
"description": "UNDOCUMENTED.",
"title": "Priority"
},
"check_if_outnumbered": {
"type": "number",
"description": "UNDOCUMENTED.",
"title": "Check If Outnumbered"
},
"must_see": {
"type": "boolean",
"description": "If true, the mob has to be visible to be a valid choice.",
Expand Down
5 changes: 5 additions & 0 deletions source/general/block/reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"title": "State Value",
"description": "The key of property is the name of the block state/property, the value must be the same as the block properties accepted values."
}
},
"tags": {
"$ref": "../../molang/string.json",
"description": "[UNDOCUMENTED] A Molang expression ran against a block to match.",
"examples": ["query.any_tag('wood')"]
stirante marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/general/item/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"type": "object",
"properties": {
"tags": {
"type": "string",
"$ref": "../../molang/string.json",
"description": "[UNDOCUMENTED] A Molang expression ran against item or block to match.",
"examples": ["query.any_tag('minecraft:is_tool')"]
},
Expand Down