Skip to content

Commit

Permalink
Add value schema to item components
Browse files Browse the repository at this point in the history
  • Loading branch information
ExDrill committed May 28, 2024
1 parent 03f0e9d commit de86b47
Show file tree
Hide file tree
Showing 26 changed files with 326 additions and 66 deletions.
3 changes: 2 additions & 1 deletion packages/minecraftBedrock/formatVersions.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"1.20.60",
"1.20.70",
"1.20.80",
"1.21.0"
"1.21.0",
"1.21.10"
]
}
8 changes: 7 additions & 1 deletion packages/minecraftBedrock/schema/biome/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@
"if": {
"properties": {
"format_version": {
"enum": ["1.20.60", "1.20.70", "1.20.80"]
"enum": [
"1.20.60",
"1.20.70",
"1.20.80",
"1.21.0",
"1.21.10"
]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/minecraftBedrock/schema/block/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"if": {
"properties": {
"format_version": {
"enum": ["1.20.80"]
"enum": ["1.20.80", "1.21.0", "1.21.10"]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/minecraftBedrock/schema/geometry/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"if": {
"properties": {
"format_version": {
"enum": ["1.21.0"]
"enum": ["1.21.0", "1.21.10"]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/minecraftBedrock/schema/item/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"if": {
"properties": {
"format_version": {
"enum": ["1.20.80"]
"enum": ["1.20.80", "1.21.0", "1.21.10"]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"type": "boolean",
"description": "Prevent destruction of blocks in creative mode while holding this item."
"description": "Whether the item can destroy blocks while in creative."
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"type": "integer",
"description": "Set the damage an item deals."
"description": "How much extra damage the item does on attack."
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"type": "object",
"description": "Makes an item enchantable.",
"description": "Determines what enchantments can be applied to the item. Not all enchantments will have an effect on all item components.",
"properties": {
"slot": {
"description": "What enchantments can be applied.",
"type": "string",
"enum": [
"armor_feet",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,22 @@
"$ref": "./explodeable.json"
},
"minecraft:damage": {
"$ref": "../../v1.16.100/components/damage.json"
"$ref": "./damage.json"
},
"minecraft:liquid_clipped": {
"$ref": "../../v1.16.100/components/liquid_clipped.json"
"$ref": "./liquid_clipped.json"
},
"minecraft:allow_off_hand": {
"$ref": "../../v1.16.100/components/allow_off_hand.json"
"$ref": "./allow_off_hand.json"
},
"minecraft:use_animation": {
"$ref": "../../v1.16.100/components/use_animation.json"
"$ref": "./use_animation.json"
},
"minecraft:hover_text_color": {
"$ref": "../../v1.16.100/components/hover_text_color.json"
"$ref": "./hover_text_color.json"
},
"minecraft:can_destroy_in_creative": {
"$ref": "../../v1.16.100/components/can_destroy_in_creative.json"
"$ref": "./can_destroy_in_creative.json"
},
"minecraft:projectile": {
"$ref": "../../v1.16.100/components/projectile.json"
Expand Down Expand Up @@ -127,10 +127,10 @@
"$ref": "../../v1.16.100/components/max_damage.json"
},
"minecraft:hand_equipped": {
"$ref": "../../v1.10.0/components/hand_equipped.json"
"$ref": "./hand_equipped.json"
},
"minecraft:stacked_by_data": {
"$ref": "../../v1.10.0/components/stacked_by_data.json"
"$ref": "./stacked_by_data.json"
},
"minecraft:glint": {
"$ref": "./glint.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"anyOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
}
}
],
"description": "Whether the item can be placed inside of the off hand."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"anyOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
}
}
],
"description": "Whether the item can destroy blocks while in creative."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "object",
"properties": {
"value": {
"type": "integer",
"minimum": 0
}
}
}
],
"description": "How much extra damage the item does on attack."
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"type": "boolean",
"anyOf": [
{
"type": "boolean",
"minimum": 0
},
{
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
}
}
],
"description": "Whether the item has the glint effect."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"anyOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
}
}
],
"description": "Whether the item is rendered like a tool while in hand."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "string",
"description": "The color of the item's name.",
"anyOf": [
{
"$ref": "../../../general/minecraftColor.json"
},
{
"type": "object",
"properties": {
"value": {
"$ref": "../../../general/minecraftColor.json"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"anyOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
}
}
],
"description": "Whether the item interacts with liquid blocks on use."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"anyOf": [
{
"type": "integer",
"default": 64
},
{
"type": "object",
"properties": {
"value": {
"type": "integer",
"default": 64
}
}
}
],
"description": "The max stack size of the item."
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,17 @@
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Should Despawn",
"description": "Whether the item should eventually despawn while floating in the world.",
"type": "boolean"
"anyOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Should Despawn",
"description": "Whether the same item with different aux values can stack. Also defines whether the item actors can merge while floating in the world.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"value": {
"type": "boolean"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"description": "The animation to use when this item is being used, e.g when the item is being eaten.",
"anyOf": [
{
"type": "string",
"enum": [
"block",
"bow",
"brush",
"camera",
"crossbow",
"eat",
"drink",
"none",
"spear",
"spyglass"
]
},
{
"type": "object",
"properties": {
"value": {
"type": "string",
"enum": [
"block",
"bow",
"brush",
"camera",
"crossbow",
"eat",
"drink",
"none",
"spear",
"spyglass"
]
}
}
}
]
}
Loading

0 comments on commit de86b47

Please sign in to comment.