Add Item Examples (#182)

Add Examples to Item Components from MS-Learn Website
This commit is contained in:
DW623
2023-08-17 11:04:39 -07:00
committed by GitHub
parent 2abff2794e
commit d3a8c7a4a4
16 changed files with 112 additions and 34 deletions

View File

@@ -14,5 +14,11 @@
"title": "Texture Type",
"enum": ["gold", "none", "leather", "chain", "iron", "diamond", "elytra", "turtle", "netherite"]
}
}
},
"examples": [
{
"protection": 5,
"texture_type" : "diamond"
}
]
}

View File

@@ -12,5 +12,11 @@
"title": "Duration",
"type": "number"
}
}
},
"examples": [
{
"category" : "attack",
"duration" : 0.2
}
]
}

View File

@@ -5,5 +5,8 @@
"type": "object",
"additionalProperties": false,
"required": ["value"],
"properties": { "value": { "type": "string", "title": "Value", "description": "Set the display name for an item." } }
"properties": { "value": { "type": "string", "title": "Value", "description": "Set the display name for an item." } },
"examples": [
{ "value": "secret_weapon"}
]
}

View File

@@ -20,7 +20,13 @@
"max_durability": {
"title": "Maximum Durability",
"description": "Maximum durability is the amount of damage that this item can take before breaking.",
"type": "number"
"type": "integer"
}
}
},
"examples": [
{
"damage_chance": {"min":10,"max":50},
"max_durability": 36
}
]
}

View File

@@ -5,5 +5,8 @@
"type": "object",
"additionalProperties": false,
"required": ["duration"],
"properties": { "duration": { "type": "number", "title": "Duration", "description": "How long in seconds will this fuel cook items for." } }
"properties": { "duration": { "type": "number", "title": "Duration", "description": "How long in seconds will this fuel cook items for." } },
"examples": [
{"duration": 3.0}
]
}

View File

@@ -1,5 +1,5 @@
{
"$id": "blockception.minecraft.behavior.items.minecraft:hand_equiped",
"$id": "blockception.minecraft.behavior.items.minecraft:hand_equipped",
"additionalProperties": false,
"required": ["texture"],
"type": "boolean",

View File

@@ -18,5 +18,8 @@
"title": "Texture",
"description": "The key from the resource_pack/textures/item_texture.json `texture_data` object associated with the texture file Example: blaze_powder."
}
}
},
"examples": [
{"texture": "stick"}
]
}

View File

@@ -9,7 +9,11 @@
"protection": {
"title": "Protection",
"description": "Amount of knockback resistance provided with the total maximum protection being 1.0",
"type": "number"
"type": "number",
"maximum": 1.0
}
}
},
"examples": [
{ "protection": 0.5}
]
}

View File

@@ -12,9 +12,14 @@
"type": "object",
"additionalProperties": false,
"properties": {
"event": { "type": "string", "title": "Event", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" },
"target": { "type": "string", "title": "Target", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED", "enum": ["self"] }
"event": { "type": "string", "title": "Event", "description": "Event trigger for when the item is used."},
"target": { "type": "string", "title": "Target", "description": "Event Target.", "enum": ["self"] }
}
}
}
},
"examples": [
{
"on_use": "minecraft:entity_transformed"
}
]
}

View File

@@ -6,15 +6,20 @@
"additionalProperties": false,
"required": ["on_use_on"],
"properties": {
"on_use": {
"title": "On Use",
"on_use_on": {
"title": "On Use On",
"description": "Event trigger for when the item is used.",
"type": "object",
"additionalProperties": false,
"properties": {
"event": { "type": "string", "title": "Event", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" },
"target": { "type": "string", "title": "Target", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED", "enum": ["block"] }
"event": { "type": "string", "title": "Event", "description": "Event trigger for when the item is used." },
"target": { "type": "string", "title": "Target", "description": "Event target (block).", "$comment": "UNDOCUMENTED", "enum": ["block"] }
}
}
}
},
"Examples": [
{
"on_use_on": "minecraft:entity_primed"
}
]
}

View File

@@ -1,7 +1,7 @@
{
"$id": "blockception.minecraft.behavior.items.minecraft:projectile",
"title": "Projectile",
"description": "Projectile item component. projectile items shoot out, like an arrow.",
"description": "Compels the item shoot, like an arrow. Pair with minecraft:shooter for dispensers or as ammunition. Pair with minecraft:throwable to set the entity spawned.",
"type": "object",
"additionalProperties": false,
"required": ["projectile_entity"],
@@ -12,5 +12,11 @@
"description": "How long you must charge a projectile for it to critically hit."
},
"projectile_entity": { "title": "Projectile Entity", "description": "The entity to be fired as a projectile.", "type": "string" }
}
},
"examples": [
{
"minimum_critical_power": 1.25,
"projectile_entity": "arrow"
}
]
}

View File

@@ -1,7 +1,7 @@
{
"$id": "blockception.minecraft.behavior.items.minecraft:render_offsets",
"title": "Render Offsets",
"description": "Render offsets component: optional values can be given to offset the way the item is rendered.",
"description": "Render offsets component: optional values can be given to offset the way the item is rendered. Depreciated in json formats 1.20.10 and higher",
"type": "object",
"additionalProperties": false,
"definitions": {
@@ -64,5 +64,11 @@
"properties": {
"main_hand": { "title": "Main Hand", "description": "Right hand transform data.", "type": "string" },
"off_hand": { "title": "Off Hand", "description": "Left hand transform data.", "type": "string" }
}
},
"examples": [
{
"main_hand": [0,0,0],
"off_hand":[0,0.5,0]
}
]
}

View File

@@ -24,19 +24,27 @@
}
},
"charge_on_draw": { "title": "Charge On Draw", "description": "Charge on draw? Default is set to false.", "default": false, "type": "boolean" },
"launch_power_scale": {
"title": "Launch Power Scale",
"description": "Launch power scale. Default is set to 1.0.",
"default": 1.0,
"type": "number"
},
"max_draw_duration": { "title": "Maximum Draw Duration", "description": "Draw Duration. Default is set to 0.", "default": 0, "type": "number" },
"max_launch_power": { "title": "Maximum Launch Power", "description": "Launch power. Default is set to 1.0.", "default": 0, "type": "number" },
"scale_power_by_draw_duration": {
"title": "Scale Power By Draw Duration",
"description": "Scale power by draw duration? Default is set to false.",
"default": false,
"type": "boolean"
}
}
},
"examples": [
{
"ammunition" :[
{
"item" :"custom_projectile",
"use_offhand" :true,
"search_inventory" :true,
"use_in_creative" :true
}
],
"max_draw_duration" :1.0,
"scale_power_by_draw_duration" :true,
"charge_on_draw" :false
}
]
}

View File

@@ -41,5 +41,15 @@
"default": false,
"type": "boolean"
}
}
},
"examples": [
{
"do_swing_animation" : false,
"min_draw_duration" : 0.0,
"max_draw_duration" : 1.0,
"launch_power_scale" : 1.0,
"max_launch_power" : 2.0,
"scale_power_by_draw_duration" : false
}
]
}

View File

@@ -29,5 +29,12 @@
"event": { "type": "string", "title": "Event", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" },
"target": { "type": "string", "title": "Target", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED", "enum": ["self"] }
}
}
},
"examples": [
{
"on_hit_block" : "my_event:block_hit",
"on_hurt_entity" : "my_event:ouch",
"on_not_hurt_entity" : "my_event:panic"
}
]
}

View File

@@ -5,10 +5,10 @@
"type": "object",
"additionalProperties": false,
"properties": {
"dispensable": { "title": "Dispensable", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED", "type": "boolean" },
"dispensable": { "title": "Dispensable", "description": "Sets if the item can be dropped by a dispenser block", "type": "boolean" },
"slot": {
"title": "Slot",
"description": "equipment_slot: slot.weapon.mainhand, slot.weapon.offhand, slot.armor.head, slot.armor.chest, slot.armor.legs, slot.armor.feet, slot.hotbar, slot.inventory, slot.enderchest, slot.saddle, slot.armor, slot.chest",
"description": "Which equipment slot the item can fit in",
"type": "string",
"enum": [
"slot.weapon.mainhand",