From 2fe9f2ed705f576de9d23c4a0153eb8c0636d182 Mon Sep 17 00:00:00 2001 From: Daan Verstraten Date: Sat, 29 Oct 2022 16:36:39 +0200 Subject: [PATCH] Starting on blocks (#137) * Starting on blocks * Updated collision box * Updated block components * Fixed block/rotation * Making orbi responsible for dependencies * Updating blocks * trigger -> triggers --- .github/workflows/dependabot.yml | 2 +- .../components/block_light_emission.json | 10 --- .../format/components/block_light_filter.json | 8 -- .../blocks/format/components/breakonpush.json | 7 -- .../format/components/breathability.json | 9 -- .../format/components/collision_box.json | 37 ++++++++ .../format/components/crafting_table.json | 28 ++++++ .../format/components/destroy_time.json | 8 -- .../components/destructible_by_explosion.json | 24 ++++++ .../components/destructible_by_mining.json | 24 ++++++ .../format/components/display_name.json | 5 +- .../format/components/entity_collision.json | 36 -------- .../components/explosion_resistance.json | 8 -- .../blocks/format/components/flammable.json | 34 ++++---- .../blocks/format/components/friction.json | 9 +- .../blocks/format/components/geometry.json | 6 +- .../blocks/format/components/immovable.json | 7 -- .../format/components/light_dampening.json | 9 ++ .../format/components/light_emission.json | 9 ++ .../blocks/format/components/loot.json | 5 +- .../blocks/format/components/map_color.json | 40 +++++++-- .../format/components/material_instances.json | 85 ++++++++++++------- .../blocks/format/components/on_interact.json | 11 --- .../blocks/format/components/on_placed.json | 11 --- .../components/on_player_destroyed.json | 11 --- .../format/components/on_player_placing.json | 11 --- .../blocks/format/components/on_step_off.json | 11 --- .../blocks/format/components/on_step_on.json | 11 --- .../format/components/onlypistonpush.json | 6 -- .../format/components/part_visibility.json | 8 +- .../format/components/pick_collision.json | 36 -------- .../format/components/placement_filter.json | 27 +++--- .../format/components/preventsjumping.json | 6 -- .../blocks/format/components/rotation.json | 10 +-- .../format/components/selection_box.json | 38 +++++++++ .../blocks/format/components/ticking.json | 29 ------- .../blocks/format/components/unit_cube.json | 6 +- .../blocks/format/components/unwalkable.json | 7 -- .../blocks/format/minecraft.block.json | 67 ++++++++------- .../{components => triggers}/on_fall_on.json | 16 +++- .../blocks/format/triggers/on_interact.json | 21 +++++ .../blocks/format/triggers/on_placed.json | 21 +++++ .../format/triggers/on_player_destroyed.json | 21 +++++ .../format/triggers/on_player_placing.json | 21 +++++ .../blocks/format/triggers/on_step_off.json | 21 +++++ .../blocks/format/triggers/on_step_on.json | 21 +++++ .../queued_ticking.json} | 9 +- .../format/triggers/random_ticking.json | 31 +++++++ source/general/block/reference.json | 2 +- source/general/format_version.json | 6 +- 50 files changed, 530 insertions(+), 376 deletions(-) delete mode 100644 source/behavior/blocks/format/components/block_light_emission.json delete mode 100644 source/behavior/blocks/format/components/block_light_filter.json delete mode 100644 source/behavior/blocks/format/components/breakonpush.json delete mode 100644 source/behavior/blocks/format/components/breathability.json create mode 100644 source/behavior/blocks/format/components/collision_box.json create mode 100644 source/behavior/blocks/format/components/crafting_table.json delete mode 100644 source/behavior/blocks/format/components/destroy_time.json create mode 100644 source/behavior/blocks/format/components/destructible_by_explosion.json create mode 100644 source/behavior/blocks/format/components/destructible_by_mining.json delete mode 100644 source/behavior/blocks/format/components/entity_collision.json delete mode 100644 source/behavior/blocks/format/components/explosion_resistance.json delete mode 100644 source/behavior/blocks/format/components/immovable.json create mode 100644 source/behavior/blocks/format/components/light_dampening.json create mode 100644 source/behavior/blocks/format/components/light_emission.json delete mode 100644 source/behavior/blocks/format/components/on_interact.json delete mode 100644 source/behavior/blocks/format/components/on_placed.json delete mode 100644 source/behavior/blocks/format/components/on_player_destroyed.json delete mode 100644 source/behavior/blocks/format/components/on_player_placing.json delete mode 100644 source/behavior/blocks/format/components/on_step_off.json delete mode 100644 source/behavior/blocks/format/components/on_step_on.json delete mode 100644 source/behavior/blocks/format/components/onlypistonpush.json delete mode 100644 source/behavior/blocks/format/components/pick_collision.json delete mode 100644 source/behavior/blocks/format/components/preventsjumping.json create mode 100644 source/behavior/blocks/format/components/selection_box.json delete mode 100644 source/behavior/blocks/format/components/ticking.json delete mode 100644 source/behavior/blocks/format/components/unwalkable.json rename source/behavior/blocks/format/{components => triggers}/on_fall_on.json (54%) create mode 100644 source/behavior/blocks/format/triggers/on_interact.json create mode 100644 source/behavior/blocks/format/triggers/on_placed.json create mode 100644 source/behavior/blocks/format/triggers/on_player_destroyed.json create mode 100644 source/behavior/blocks/format/triggers/on_player_placing.json create mode 100644 source/behavior/blocks/format/triggers/on_step_off.json create mode 100644 source/behavior/blocks/format/triggers/on_step_on.json rename source/behavior/blocks/format/{components/random_ticking.json => triggers/queued_ticking.json} (80%) create mode 100644 source/behavior/blocks/format/triggers/random_ticking.json diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index d8efb69f..7afd7e1f 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -19,4 +19,4 @@ jobs: run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + GITHUB_TOKEN: ${{secrets.ORBI_TOKEN}} diff --git a/source/behavior/blocks/format/components/block_light_emission.json b/source/behavior/blocks/format/components/block_light_emission.json deleted file mode 100644 index 20f55967..00000000 --- a/source/behavior/blocks/format/components/block_light_emission.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.block_light_emission", - "additionalProperties": false, - "type": "number", - "title": "Block Light Emission", - "description": "The amount of light this block will emit in a range [0.0, 1.0].", - "minimum": 0, - "maximum": 1, - "default": 0.0 -} diff --git a/source/behavior/blocks/format/components/block_light_filter.json b/source/behavior/blocks/format/components/block_light_filter.json deleted file mode 100644 index ba718f5f..00000000 --- a/source/behavior/blocks/format/components/block_light_filter.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.block_light_filter", - "additionalProperties": false, - "type": "integer", - "title": "Block Light filter", - "description": "The amount of light this block will filter out. Higher value means more light will be filtered out (0 - 15).", - "default": 0 -} diff --git a/source/behavior/blocks/format/components/breakonpush.json b/source/behavior/blocks/format/components/breakonpush.json deleted file mode 100644 index e78172c2..00000000 --- a/source/behavior/blocks/format/components/breakonpush.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.breakonpush", - "additionalProperties": false, - "type": "boolean", - "title": "Break On Push", - "description": "When pushed by a piston the block breaks." -} diff --git a/source/behavior/blocks/format/components/breathability.json b/source/behavior/blocks/format/components/breathability.json deleted file mode 100644 index 726485ba..00000000 --- a/source/behavior/blocks/format/components/breathability.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.breathability", - "additionalProperties": false, - "type": "string", - "title": "Breathability", - "description": "Property describing the breathability of the block, and whether it's treated as a solid block or a block of air.", - "enum": ["solid", "air"], - "default": "solid" -} diff --git a/source/behavior/blocks/format/components/collision_box.json b/source/behavior/blocks/format/components/collision_box.json new file mode 100644 index 00000000..4fafd43c --- /dev/null +++ b/source/behavior/blocks/format/components/collision_box.json @@ -0,0 +1,37 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.collision_box", + "title": "Collision Box", + "description": "This component can be specified as a Boolean. If this component is omitted, the default value for this component is true, which will give your block the default values for its parameters (a collision box the size/shape of a regular block).", + "oneOf": [ + { + "type": "boolean", + "default": true + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "origin": { + "title": "Origin", + "description": "Minimal position of the bounds of the collision box. origin is specified as [x, y, z] and must be in the range (-8, 0, -8) to (8, 16, 8), inclusive.", + "type": "array", + "items": [ + { "title": "X", "type": "number", "minimum": -8.0, "maximum": 8 }, + { "title": "Y", "type": "number", "minimum": 0, "maximum": 16 }, + { "title": "Z", "type": "number", "minimum": -8.0, "maximum": 8 } + ] + }, + "size": { + "title": "Size", + "description": "Size of each side of the collision box. Size is specified as [x, y, z]. origin + size must be in the range (-8, 0, -8) to (8, 16, 8), inclusive.", + "type": "array", + "items": [ + { "title": "X", "type": "number" }, + { "title": "Y", "type": "number" }, + { "title": "Z", "type": "number" } + ] + } + } + } + ] +} diff --git a/source/behavior/blocks/format/components/crafting_table.json b/source/behavior/blocks/format/components/crafting_table.json new file mode 100644 index 00000000..66aae2a2 --- /dev/null +++ b/source/behavior/blocks/format/components/crafting_table.json @@ -0,0 +1,28 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.crafting_table", + "title": "Crafting Table", + "description": "[Experimental] Makes your block into a custom crafting table which enables the crafting table UI and the ability to craft recipes.", + "additionalProperties": false, + "type": "object", + "required": [], + "properties": { + "crafting_tags": { + "title": "Crafting Tags", + "description": "Defines the tags recipes should define to be crafted on this table. Limited to 64 tags. Each tag is limited to 64 characters.", + "type": "array", + "maxItems": 64, + "items": { + "type": "string", + "title": "Tag", + "description": "The tag to check for.", + "minLength": 1, + "maxLength": 64 + } + }, + "table_name": { + "title": "Table Name", + "description": "Specifies the language file key that maps to what text will be displayed in the UI of this table. If the string given can not be resolved as a loc string, the raw string given will be displayed. If this field is omitted, the name displayed will default to the name specified in the \"display_name\" component. If this block has no \"display_name\" component, the name displayed will default to the name of the block.", + "type": "string" + } + } +} diff --git a/source/behavior/blocks/format/components/destroy_time.json b/source/behavior/blocks/format/components/destroy_time.json deleted file mode 100644 index 71aaf4c1..00000000 --- a/source/behavior/blocks/format/components/destroy_time.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.destroy_time", - "additionalProperties": false, - "type": "number", - "title": "Destroy Time", - "description": "Sets the destroy time property for the block. Greater numbers result in greater mining times. Time is measured in seconds with base equipment.", - "default": 0.0 -} diff --git a/source/behavior/blocks/format/components/destructible_by_explosion.json b/source/behavior/blocks/format/components/destructible_by_explosion.json new file mode 100644 index 00000000..438bf70b --- /dev/null +++ b/source/behavior/blocks/format/components/destructible_by_explosion.json @@ -0,0 +1,24 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.destructible_by_explosion", + "title": "Destructible By Explosion", + "description": "Describes the destructible by explosion properties for this block. If set to true, the block will have the default explosion resistance. If set to false, this block is indestructible by explosion. If the component is omitted, the block will have the default explosion resistance.", + "oneOf": [ + { + "type": "boolean", + "default": true + }, + { + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "explosion_resistance": { + "title": "Explosion Resistance", + "description": "Describes how resistant the block is to explosion. Greater values mean the block is less likely to break when near an explosion (or has higher resistance to explosions). The scale will be different for different explosion power levels. A negative value or 0 means it will easily explode; larger numbers increase level of resistance.", + "type": "number", + "default": 0.0 + } + } + } + ] +} diff --git a/source/behavior/blocks/format/components/destructible_by_mining.json b/source/behavior/blocks/format/components/destructible_by_mining.json new file mode 100644 index 00000000..e838308d --- /dev/null +++ b/source/behavior/blocks/format/components/destructible_by_mining.json @@ -0,0 +1,24 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.destructible_by_mining", + "title": "Destructible By Mining", + "description": "Describes the destructible by mining properties for this block. If set to true, the block will take the default number of seconds to destroy. If set to false, this block is indestructible by mining. If the component is omitted, the block will take the default number of seconds to destroy.", + "oneOf": [ + { + "type": "boolean", + "default": true + }, + { + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "seconds_to_destroy": { + "title": "Seconds To Destroy", + "description": "Sets the number of seconds it takes to destroy the block with base equipment. Greater numbers result in greater mining times.", + "type": "number", + "default": 0.0 + } + } + } + ] +} diff --git a/source/behavior/blocks/format/components/display_name.json b/source/behavior/blocks/format/components/display_name.json index e0aad71e..0b369039 100644 --- a/source/behavior/blocks/format/components/display_name.json +++ b/source/behavior/blocks/format/components/display_name.json @@ -1,7 +1,6 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.display_name", - "additionalProperties": false, - "type": "string", "title": "Display Name", - "description": "Specifies the language file key that maps to what text will be displayed when you hover over the block." + "description": "Specifies the language file key that maps to what text will be displayed when you hover over the block in your inventory and hotbar. If the string given can not be resolved as a loc string, the raw string given will be displayed. If this component is omitted, the name of the block will be used as the display name.", + "type": "string" } diff --git a/source/behavior/blocks/format/components/entity_collision.json b/source/behavior/blocks/format/components/entity_collision.json deleted file mode 100644 index 9f152740..00000000 --- a/source/behavior/blocks/format/components/entity_collision.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.entity_collision", - "title": "Entity Collision", - "description": "Can only be set to false or an object, it disables the collision of the block with entities.", - "oneOf": [ - { "type": "boolean", "const": false }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "origin": { - "type": "array", - "title": "Origin", - "description": "Minimal position Bounds of the collision box.", - "default": [-8.0, 0.0, -8.0], - "items": [ - { "type": "number", "title": "X", "description": "The x offset." }, - { "type": "number", "title": "Y", "description": "The y offset." }, - { "type": "number", "title": "Z", "description": "The z offset." } - ] - }, - "size": { - "type": "array", - "title": "Size", - "description": "Size of each side of the box of the component.", - "default": [16.0, 16.0, 16.0], - "items": [ - { "type": "number", "title": "X", "description": "The x size." }, - { "type": "number", "title": "Y", "description": "The y size." }, - { "type": "number", "title": "Z", "description": "The z size." } - ] - } - } - } - ] -} diff --git a/source/behavior/blocks/format/components/explosion_resistance.json b/source/behavior/blocks/format/components/explosion_resistance.json deleted file mode 100644 index 052fb385..00000000 --- a/source/behavior/blocks/format/components/explosion_resistance.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.explosion_resistance", - "additionalProperties": false, - "type": "number", - "title": "Explosion Resistance", - "description": "Sets the explosion resistance for this block.", - "default": 0.0 -} diff --git a/source/behavior/blocks/format/components/flammable.json b/source/behavior/blocks/format/components/flammable.json index 29755e5c..f96e6d93 100644 --- a/source/behavior/blocks/format/components/flammable.json +++ b/source/behavior/blocks/format/components/flammable.json @@ -1,22 +1,24 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.flammable", - "additionalProperties": false, - "type": "object", "title": "Flammable", - "description": "Describes the flammable properties for this block.", - "additionalItems": false, - "properties": { - "burn_odds": { - "type": "integer", - "default": 0, - "description": "How likely the block will be destroyed by flames when on fire. Value must be greater than or equal to 0.", - "title": "Burn Odds" + "description": "Describes the flammable properties for this block. If set to true, default values are used. If set to false, or if this component is omitted, the block will not be able to catch on fire naturally from neighbors, but it can still be directly ignited.", + "oneOf": [ + { + "type": "boolean", + "default": true }, - "flame_odds": { - "type": "integer", - "default": 0, - "description": "How likely the block will catch flame when next to a fire. Value must be greater than or equal to 0.", - "title": "Flame Odds" + { + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "seconds_to_destroy": { + "title": "Seconds To Destroy", + "description": "Sets the number of seconds it takes to destroy the block with base equipment. Greater numbers result in greater mining times.", + "type": "number", + "default": 0.0 + } + } } - } + ] } diff --git a/source/behavior/blocks/format/components/friction.json b/source/behavior/blocks/format/components/friction.json index 7febfea7..829ce275 100644 --- a/source/behavior/blocks/format/components/friction.json +++ b/source/behavior/blocks/format/components/friction.json @@ -1,8 +1,9 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.friction", - "additionalProperties": false, - "type": "number", "title": "Friction", - "description": "Property describing the friction for this block. Friction effects an entities movements when it walks on the block.", - "default": 0.1 + "description": "Describes the friction for this block in a range of (0.0-0.9). Friction affects an entity's movement speed when it travels on the block. Greater value results in more friction.", + "type": "number", + "default": 0.4, + "minimum": 0, + "maximum": 0.9 } diff --git a/source/behavior/blocks/format/components/geometry.json b/source/behavior/blocks/format/components/geometry.json index 38724885..9b058c3d 100644 --- a/source/behavior/blocks/format/components/geometry.json +++ b/source/behavior/blocks/format/components/geometry.json @@ -1,8 +1,6 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.geometry", - "additionalProperties": false, - "type": "string", "title": "Geometry", - "description": "The geometry description identifier to use, this identifier must match an existing geometry identifier in any of the currently loaded resource packs.", - "pattern": "^geometry\\.[a-zA-Z0-9_\\-\\.]+$" + "description": "The description identifier of the geometry file to use to render this block. This identifier must match an existing geometry identifier in any of the currently loaded resource packs.", + "type": "string" } diff --git a/source/behavior/blocks/format/components/immovable.json b/source/behavior/blocks/format/components/immovable.json deleted file mode 100644 index 4aaab266..00000000 --- a/source/behavior/blocks/format/components/immovable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.immovable", - "additionalProperties": false, - "type": "boolean", - "title": "Immovable", - "description": "An Immovable block cannot be pushed by pistons." -} diff --git a/source/behavior/blocks/format/components/light_dampening.json b/source/behavior/blocks/format/components/light_dampening.json new file mode 100644 index 00000000..003b7bfd --- /dev/null +++ b/source/behavior/blocks/format/components/light_dampening.json @@ -0,0 +1,9 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.light_dampening", + "title": "Light Dampening", + "description": "The amount that light will be dampened when it passes through the block, in a range (0-15). Higher value means the light will be dampened more.", + "type": "integer", + "default": 15, + "minimum": 0, + "maximum": 15 +} diff --git a/source/behavior/blocks/format/components/light_emission.json b/source/behavior/blocks/format/components/light_emission.json new file mode 100644 index 00000000..1e266591 --- /dev/null +++ b/source/behavior/blocks/format/components/light_emission.json @@ -0,0 +1,9 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.light_emission", + "title": "Light Emission", + "description": "The amount of light this block will emit in a range (0-15). Higher value means more light will be emitted.", + "type": "integer", + "default": 15, + "minimum": 0, + "maximum": 15 +} diff --git a/source/behavior/blocks/format/components/loot.json b/source/behavior/blocks/format/components/loot.json index 530e37cb..a2c5d626 100644 --- a/source/behavior/blocks/format/components/loot.json +++ b/source/behavior/blocks/format/components/loot.json @@ -1,8 +1,7 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.loot", - "additionalProperties": false, - "type": "string", "title": "Loot", - "description": "The path to the loot table, relative to the behavior pack. Path string is limited to 256 characters.", + "description": "The path to the loot table, relative to the behavior pack.", + "type": "string", "pattern": "loot_tables/.*\\.json$" } diff --git a/source/behavior/blocks/format/components/map_color.json b/source/behavior/blocks/format/components/map_color.json index af82380d..fc51277e 100644 --- a/source/behavior/blocks/format/components/map_color.json +++ b/source/behavior/blocks/format/components/map_color.json @@ -1,9 +1,39 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.map_color", - "additionalProperties": false, - "type": "string", "title": "Map Color", - "description": "A color represented as a hex value. This will be the color rendered to a map.", - "format": "color-hex", - "examples": ["#FFFFFF"] + "description": "Sets the color of the block when rendered to a map. The color is represented as a hex value in the format \"#RRGGBB\". May also be expressed as an array of [R, G, B] from 0 to 255. If this component is omitted, the block will not show up on the map.", + "oneOf": [ + { + "type": "string", + "format": "colox-hex", + "default": "#FFFFFF" + }, + { + "type": "array", + "items": [ + { + "title": "Red", + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 255 + }, + { + "title": "Green", + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 255 + }, + { + "title": "Blue", + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 255 + } + ] + } + ], + "examples": ["#FFFFFF", [255, 255, 255]] } diff --git a/source/behavior/blocks/format/components/material_instances.json b/source/behavior/blocks/format/components/material_instances.json index 5b9e9b4f..8690f57c 100644 --- a/source/behavior/blocks/format/components/material_instances.json +++ b/source/behavior/blocks/format/components/material_instances.json @@ -1,37 +1,58 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.material_instances", - "type": "object", "title": "Material Instances", - "description": "Maps face or material_instance names in a geometry file to an actual material instance. Material instance can either be a full material instance or a name to another already defined instance", - "definitions": { - "material_instance": { - "title": "Material Instance", - "description": "A single material instance.", - "additionalProperties": false, - "properties": { - "ambient_occlusion": { - "title": "Ambient Occlusion", - "type": "boolean", - "description": "UNDOCUMENTED.", - "$comment": "UNDOCUMENTED" - }, - "face_dimming": { - "title": "Face Dimming", - "type": "boolean", - "description": "UNDOCUMENTED.", - "$comment": "UNDOCUMENTED" - }, - "render_method": { - "type": "string", - "title": "Render Method", - "description": "UNDOCUMENTED.", - "$comment": "UNDOCUMENTED", - "enum": ["blend", "opaque", "alpha_test"] - }, - "texture": { "type": "string", "title": "Texture", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" } + "description": "The material instances for a block. Maps face or material_instance names in a geometry file to an actual material instance. You can assign a material instance object to any of these faces: \"up\", \"down\", \"north\", \"south\", \"east\", \"west\", or \"*\". You can also give an instance the name of your choosing such as \"my_instance\", and then assign it to a face by doing \"north\":\"my_instance\".", + "required": [], + "examples": [ + { "*": {} }, + { "custom_sides": {} }, + { "up": {} }, + { "down": {} }, + { "north": {} }, + { "south": "custom_sides" }, + { "east": "custom_sides" }, + { "west": "custom_sides" } + ], + "type": "object", + "additionalProperties": { + "title": "Material Instance", + "description": "The material instance for a block. Maps face or material_instance names in a geometry file to an actual material instance. You can assign a material instance object to any of these faces: \"up\", \"down\", \"north\", \"south\", \"east\", \"west\", or \"*\". You can also give an instance the name of your choosing such as \"my_instance\", and then assign it to a face by doing \"north\":\"my_instance\".", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "ambient_occlusion": { + "title": "Ambient Occlusion", + "type": "boolean", + "default": true, + "description": "Should this material have ambient occlusion applied when lighting? If true, shadows will be created around and underneath the block." + }, + "face_dimming": { + "title": "Face Dimming", + "type": "boolean", + "default": true, + "description": "Should this material be dimmed by the direction it's facing?" + }, + "render_method": { + "title": "Render Method", + "type": "string", + "default": "opaque", + "description": "The render method to use. Must be one of these options: opaque - Used for a regular block texture without an alpha layer. Does not allow for transparency or translucency. double_sided - Used for completely disabling backface culling. blend - Used for a block like stained glass. Allows for transparency and translucency (slightly transparent textures). alpha_test - Used for a block like the vanilla (unstained) glass. Does not allow for translucency, only fully opaque or fully transparent textures. Also disables backface culling.", + "markdownDescription": "The render method to use. Must be one of these options: \nopaque - Used for a regular block texture without an alpha layer. Does not allow for transparency or translucency.\ndouble_sided - Used for completely disabling backface culling.\nblend - Used for a block like stained glass. Allows for transparency and translucency (slightly transparent textures).\nalpha_test - Used for a block like the vanilla (unstained) glass. Does not allow for translucency, only fully opaque or fully transparent textures. Also disables backface culling.", + "enum": ["opaque", "double_sided", "blend", "alpha_test"] + }, + "texture": { + "title": "Texture", + "type": "string", + "default": "", + "description": "Texture name for the material." + } + } } - } - }, - "properties": { "*": { "$ref": "#/definitions/material_instance" } }, - "additionalProperties": { "$ref": "#/definitions/material_instance" } + ] + } } diff --git a/source/behavior/blocks/format/components/on_interact.json b/source/behavior/blocks/format/components/on_interact.json deleted file mode 100644 index 1656f561..00000000 --- a/source/behavior/blocks/format/components/on_interact.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.on_interact", - "type": "object", - "title": "On Fall On", - "description": "Describes event for this block.", - "properties": { - "condition": { "type": "string", "default": "", "description": "The condition of event to be executed on the block.", "title": "Condition" }, - "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, - "target": { "type": "string", "default": "self", "description": "The target of event executed on the block.", "title": "Target" } - } -} diff --git a/source/behavior/blocks/format/components/on_placed.json b/source/behavior/blocks/format/components/on_placed.json deleted file mode 100644 index 7aa7b8ac..00000000 --- a/source/behavior/blocks/format/components/on_placed.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.on_placed", - "type": "object", - "title": "On Placed", - "description": "Describes event for this block.", - "properties": { - "condition": { "type": "string", "default": "", "description": "The condition of event to be executed on the block.", "title": "Condition" }, - "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, - "target": { "type": "string", "default": "self", "description": "The target of event executed on the block.", "title": "Target" } - } -} diff --git a/source/behavior/blocks/format/components/on_player_destroyed.json b/source/behavior/blocks/format/components/on_player_destroyed.json deleted file mode 100644 index 4c2ed77f..00000000 --- a/source/behavior/blocks/format/components/on_player_destroyed.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.on_player_destroyed", - "type": "object", - "title": "On Player Destroyed", - "description": "Describes event for this block.", - "properties": { - "condition": { "type": "string", "default": "", "description": "The condition of event to be executed on the block.", "title": "Condition" }, - "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, - "target": { "type": "string", "default": "self", "description": "The target of event executed on the block.", "title": "Target" } - } -} diff --git a/source/behavior/blocks/format/components/on_player_placing.json b/source/behavior/blocks/format/components/on_player_placing.json deleted file mode 100644 index ed9343fc..00000000 --- a/source/behavior/blocks/format/components/on_player_placing.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.on_player_placing", - "type": "object", - "title": "On Player Placing", - "description": "Describes event for this block.", - "properties": { - "condition": { "type": "string", "default": "", "description": "The condition of event to be executed on the block.", "title": "Condition" }, - "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, - "target": { "type": "string", "default": "self", "description": "The target of event executed on the block.", "title": "Target" } - } -} diff --git a/source/behavior/blocks/format/components/on_step_off.json b/source/behavior/blocks/format/components/on_step_off.json deleted file mode 100644 index 3a399893..00000000 --- a/source/behavior/blocks/format/components/on_step_off.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.on_step_off", - "type": "object", - "title": "On Step Off", - "description": "Describes event for this block.", - "properties": { - "condition": { "type": "string", "default": "", "description": "The condition of event to be executed on the block.", "title": "Condition" }, - "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, - "target": { "type": "string", "default": "self", "description": "The target of event executed on the block.", "title": "Target" } - } -} diff --git a/source/behavior/blocks/format/components/on_step_on.json b/source/behavior/blocks/format/components/on_step_on.json deleted file mode 100644 index 8970aa51..00000000 --- a/source/behavior/blocks/format/components/on_step_on.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.on_step_on", - "type": "object", - "title": "On Step On", - "description": "Describes event for this block.", - "properties": { - "condition": { "type": "string", "default": "", "description": "The condition of event to be executed on the block.", "title": "Condition" }, - "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, - "target": { "type": "string", "default": "self", "description": "The target of event executed on the block.", "title": "Target" } - } -} diff --git a/source/behavior/blocks/format/components/onlypistonpush.json b/source/behavior/blocks/format/components/onlypistonpush.json deleted file mode 100644 index 7842aec1..00000000 --- a/source/behavior/blocks/format/components/onlypistonpush.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.onlypistonpush", - "type": "boolean", - "title": "Only Piston Push", - "description": "Blocks with those components won't stick to stickyPistons." -} diff --git a/source/behavior/blocks/format/components/part_visibility.json b/source/behavior/blocks/format/components/part_visibility.json index ca96fbb0..8c1c7e68 100644 --- a/source/behavior/blocks/format/components/part_visibility.json +++ b/source/behavior/blocks/format/components/part_visibility.json @@ -1,11 +1,11 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.part_visibility", "title": "Part Visibility", - "description": "Maps bone names in a geometry file to a condition that turns their rendering on/off. The condition should be a Molang query that uses block properties to determine true/falseSupported queries include 'has_block_property', 'block_property', and other queries that can evaluate without knowledge of the block's in-game positional or player affected data.", + "description": "[Experimental] Maps bone names in a geometry file to a condition that turns their rendering on/off. The condition should be a Molang query that uses block properties to determine true/false.", "type": "object", "additionalProperties": { - "title": "Bone Name", - "examples": [{ "root": "query.variant" }], - "type": "string" + "title": "Part Visibility", + "description": "[Experimental] Maps bone names in a geometry file to a condition that turns their rendering on/off. The condition should be a Molang query that uses block properties to determine true/false.", + "type": ["string", "boolean"] } } diff --git a/source/behavior/blocks/format/components/pick_collision.json b/source/behavior/blocks/format/components/pick_collision.json deleted file mode 100644 index b57c3180..00000000 --- a/source/behavior/blocks/format/components/pick_collision.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.pick_collision", - "title": "Pick Collision", - "description": "Can only be set to false, it disables the collision of the block with entities.", - "oneOf": [ - { "type": "boolean", "const": false }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "origin": { - "type": "array", - "title": "Origin", - "description": "Minimal position Bounds of the collision box.", - "default": [-8.0, 0.0, -8.0], - "items": [ - { "type": "number", "title": "X", "description": "The x offset." }, - { "type": "number", "title": "Y", "description": "The y offset." }, - { "type": "number", "title": "Z", "description": "The z offset." } - ] - }, - "size": { - "type": "array", - "title": "Size", - "description": "Size of each side of the box of the component.", - "default": [16.0, 16.0, 16.0], - "items": [ - { "type": "number", "title": "X", "description": "The x size." }, - { "type": "number", "title": "Y", "description": "The y size." }, - { "type": "number", "title": "Z", "description": "The z size." } - ] - } - } - } - ] -} diff --git a/source/behavior/blocks/format/components/placement_filter.json b/source/behavior/blocks/format/components/placement_filter.json index 9803839a..f7ff39f5 100644 --- a/source/behavior/blocks/format/components/placement_filter.json +++ b/source/behavior/blocks/format/components/placement_filter.json @@ -1,34 +1,35 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.placement_filter", "title": "Placement Filter", - "description": "Sets rules for under what conditions the block can be placed/survive.", + "description": "[Experimental]", "type": "object", "properties": { "conditions": { - "title": "Conditions", - "description": "List of conditions where the block can be placed/survive.", "type": "array", "items": { + "title": "Placement Filter", + "description": "[Experimental]", "type": "object", - "title": "Condition", - "description": "UNDOCUMENTED.", - "$comment": "UNDOCUMENTED", + "additionalProperties": false, "properties": { "allowed_faces": { "title": "Allowed Faces", - "description": "List of any of the following strings: up, down, north, south, east, west, side, all.", "type": "array", - "items": { "type": "string", "enum": ["up", "down", "north", "south", "east", "west", "side", "all"] } + "description": "List of any of the following strings describing which face(s) this block can be placed on: \"up\", \"down\", \"north\", \"south\", \"east\", \"west\", \"side\", \"all\". Limited to 6 faces.", + "uniqueItems": true, + "items": { + "type": "string", + "enum": ["up", "down", "north", "south", "east", "west", "side", "all"] + } }, "block_filter": { "title": "Block Filter", - "description": "List of blocks (can use tags to specify them) that this block can be placed against in the allowed_faces direction.", "type": "array", + "description": "List of blocks that this block can be placed against in the \"allowed_faces\" direction. Limited to 64 blocks. Each block in this list can either be specified as a String (block name) or as a BlockDescriptor. A BlockDescriptor is an object that allows you to reference a block (or multiple blocks) based on its tags, or based on its name and states. The fields of a BlockDescriptor are described below.", "items": { - "type": "string", - "title": "Block Identifier", - "description": "UNDOCUMENTED.", - "$comment": "UNDOCUMENTED" + "title": "Block Filter", + "description": "[Experimental]", + "$ref": "../../../../general/block/reference.json" } } } diff --git a/source/behavior/blocks/format/components/preventsjumping.json b/source/behavior/blocks/format/components/preventsjumping.json deleted file mode 100644 index d28679fb..00000000 --- a/source/behavior/blocks/format/components/preventsjumping.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.preventsjumping", - "title": "Prevents Jumping", - "description": "This component makes it so actors can't jump when walking on this block.", - "type": "boolean" -} diff --git a/source/behavior/blocks/format/components/rotation.json b/source/behavior/blocks/format/components/rotation.json index ff886e3b..f0d51d24 100644 --- a/source/behavior/blocks/format/components/rotation.json +++ b/source/behavior/blocks/format/components/rotation.json @@ -1,12 +1,6 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.rotation", "title": "Rotation", - "description": "This is the block's rotation around the center of the cube in degrees. The rotation order is x-y-z.", - "type": "array", - "additionalProperties": false, - "items": [ - { "type": "number", "title": "X" }, - { "type": "number", "title": "Y" }, - { "type": "number", "title": "Z" } - ] + "description": "The block's rotation around the center of the cube in degrees. The rotation order is [x, y, z]. Angles need to be in multiples of 90.", + "$ref": "../../../../general/vectors/number3.json" } diff --git a/source/behavior/blocks/format/components/selection_box.json b/source/behavior/blocks/format/components/selection_box.json new file mode 100644 index 00000000..1e973ba7 --- /dev/null +++ b/source/behavior/blocks/format/components/selection_box.json @@ -0,0 +1,38 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.selection_box", + "title": "Selection Box", + "description": "Defines the area of the block that is selected by the player's cursor. If set to true, default values are used. If set to false, this block is not selectable by the player's cursor. If this component is omitted, default values are used.", + "oneOf": [ + { "type": "boolean" }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "origin": { + "title": "Origin", + "default": [0, 0, 0], + "$ref": "../../../../general/vectors/number3.json", + "description": "Minimal position of the bounds of the selection box. \"origin\" is specified as [x, y, z] and must be in the range (-8, 0, -8) to (8, 16, 8), inclusive.", + "type": "array", + "items": [ + { "title": "X", "type": "number", "minimum": -8.0, "maximum": 8 }, + { "title": "Y", "type": "number", "minimum": 0, "maximum": 16 }, + { "title": "Z", "type": "number", "minimum": -8.0, "maximum": 8 } + ] + }, + "size": { + "title": "Size", + "$ref": "../../../../general/vectors/number3.json", + "default": [8.0, 8.0, 8.0], + "description": "Size of each side of the selection box. Size is specified as [x, y, z]. \"origin\" + \"size\" must be in the range (-8, 0, -8) to (8, 16, 8), inclusive.", + "type": "array", + "items": [ + { "title": "X", "type": "number" }, + { "title": "Y", "type": "number" }, + { "title": "Z", "type": "number" } + ] + } + } + } + ] +} diff --git a/source/behavior/blocks/format/components/ticking.json b/source/behavior/blocks/format/components/ticking.json deleted file mode 100644 index 35a17dc9..00000000 --- a/source/behavior/blocks/format/components/ticking.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.ticking", - "title": "Ticking", - "description": "Describes the component that will trigger an even at a regular interval between two values.", - "type": "object", - "additionalProperties": false, - "properties": { - "looping": { "type": "boolean", "title": "Looping", "description": "Does the event loop." }, - "range": { - "title": "Range", - "description": "The Range between which the component will trigger his event.", - "type": "array", - "items": [{ "type": "integer" }, { "type": "integer" }] - }, - "on_tick": { - "type": "object", - "title": "On Tick", - "description": "Describes the component that will trigger an even at a regular interval between two values.", - "condition": { "title": "Condition", "type": "string", "description": "The condition of event to be executed on the block. Molang" }, - "event": { "title": "Event", "type": "string", "description": "The type of event executed on the block." }, - "target": { - "title": "Target", - "description": "The target of event executed on the block.", - "type": "string", - "enum": ["block", "damager", "other", "parent", "player", "self", "target"] - } - } - } -} diff --git a/source/behavior/blocks/format/components/unit_cube.json b/source/behavior/blocks/format/components/unit_cube.json index 0a463b20..f792b45e 100644 --- a/source/behavior/blocks/format/components/unit_cube.json +++ b/source/behavior/blocks/format/components/unit_cube.json @@ -1,6 +1,8 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.unit_cube", "title": "Unit Cube", - "description": "Specifies that a unit cube is to be used with tessellation.", - "type": "object" + "description": "[Experimental] Specifies that a unit cube is to be used with tessellation.", + "type": "object", + "additionalProperties": false, + "properties": {} } diff --git a/source/behavior/blocks/format/components/unwalkable.json b/source/behavior/blocks/format/components/unwalkable.json deleted file mode 100644 index 1ec73c99..00000000 --- a/source/behavior/blocks/format/components/unwalkable.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$id": "blockception.minecraft.behavior.blocks.minecraft.unwalkable", - "title": "Unwalkable", - "description": "Sets the block as unwalkable. Mobs would not attempt to path over top of it when the value is set to true.", - "default": false, - "type": "boolean" -} diff --git a/source/behavior/blocks/format/minecraft.block.json b/source/behavior/blocks/format/minecraft.block.json index 1d1573f9..3f484821 100644 --- a/source/behavior/blocks/format/minecraft.block.json +++ b/source/behavior/blocks/format/minecraft.block.json @@ -14,38 +14,36 @@ "$comment": "UNDOCUMENTED", "additionalProperties": false, "properties": { - "minecraft:block_light_filter": { "$ref": "./components/block_light_filter.json" }, - "minecraft:block_light_emission": { "$ref": "./components/block_light_emission.json" }, - "minecraft:breakonpush": { "$ref": "./components/breakonpush.json" }, - "minecraft:breathability": { "$ref": "./components/breathability.json" }, - "minecraft:destroy_time": { "$ref": "./components/destroy_time.json" }, + //Components + "minecraft:collision_box": { "$ref": "./components/collision_box.json" }, + "minecraft:crafting_table": { "$ref": "./components/crafting_table.json" }, + "minecraft:destructible_by_explosion": { "$ref": "./components/destructible_by_explosion.json" }, + "minecraft:destructible_by_mining": { "$ref": "./components/destructible_by_mining.json" }, "minecraft:display_name": { "$ref": "./components/display_name.json" }, - "minecraft:entity_collision": { "$ref": "./components/entity_collision.json" }, - "minecraft:explosion_resistance": { "$ref": "./components/explosion_resistance.json" }, "minecraft:flammable": { "$ref": "./components/flammable.json" }, "minecraft:friction": { "$ref": "./components/friction.json" }, "minecraft:geometry": { "$ref": "./components/geometry.json" }, - "minecraft:immovable": { "$ref": "./components/immovable.json" }, + "minecraft:light_dampening": { "$ref": "./components/light_dampening.json" }, + "minecraft:light_emission": { "$ref": "./components/light_emission.json" }, "minecraft:loot": { "$ref": "./components/loot.json" }, "minecraft:map_color": { "$ref": "./components/map_color.json" }, "minecraft:material_instances": { "$ref": "./components/material_instances.json" }, - "minecraft:onlypistonpush": { "$ref": "./components/onlypistonpush.json" }, "minecraft:part_visibility": { "$ref": "./components/part_visibility.json" }, - "minecraft:on_fall_on": { "$ref": "./components/on_fall_on.json" }, - "minecraft:on_interact": { "$ref": "./components/on_interact.json" }, - "minecraft:on_placed": { "$ref": "./components/on_placed.json" }, - "minecraft:on_player_destroyed": { "$ref": "./components/on_player_destroyed.json" }, - "minecraft:on_player_placing": { "$ref": "./components/on_player_placing.json" }, - "minecraft:on_step_off": { "$ref": "./components/on_step_off.json" }, - "minecraft:on_step_on": { "$ref": "./components/on_step_on.json" }, - "minecraft:pick_collision": { "$ref": "./components/pick_collision.json" }, "minecraft:placement_filter": { "$ref": "./components/placement_filter.json" }, - "minecraft:preventsjumping": { "$ref": "./components/preventsjumping.json" }, - "minecraft:random_ticking": { "$ref": "./components/random_ticking.json" }, "minecraft:rotation": { "$ref": "./components/rotation.json" }, - "minecraft:ticking": { "$ref": "./components/ticking.json" }, + "minecraft:selection_box": { "$ref": "./components/selection_box.json" }, "minecraft:unit_cube": { "$ref": "./components/unit_cube.json" }, - "minecraft:unwalkable": { "$ref": "./components/unwalkable.json" } + + //Triggers + "minecraft:on_fall_on": { "$ref": "./triggers/on_fall_on.json" }, + "minecraft:on_interact": { "$ref": "./triggers/on_interact.json" }, + "minecraft:on_placed": { "$ref": "./triggers/on_placed.json" }, + "minecraft:on_player_destroyed": { "$ref": "./triggers/on_player_destroyed.json" }, + "minecraft:on_player_placing": { "$ref": "./triggers/on_player_placing.json" }, + "minecraft:on_step_off": { "$ref": "./triggers/on_step_off.json" }, + "minecraft:on_step_on": { "$ref": "./triggers/on_step_on.json" }, + "minecraft:queued_ticking": { "$ref": "./triggers/queued_ticking.json" }, + "minecraft:random_ticking": { "$ref": "./triggers/random_ticking.json" } } } }, @@ -66,12 +64,24 @@ "additionalProperties": false, "required": ["category"], "properties": { - "category": { - "title": "Category", - "$comment": "UNDOCUMENTED", - "description": "construction", - "type": "string", - "enum": ["construction", "equipment", "items", "nature"] + "menu_category": { + "title": "", + "description": "", + "type": "object", + "additionalProperties": false, + "properties": { + "category": { + "title": "Category", + "description": "Determines which category this block will be placed under in the inventory and crafting table container screens. Options are \"construction\", \"nature\", \"equipment\", \"items\", and \"none\". If omitted or \"none\" is specified, the block will not appear in the inventory or crafting table container screens.", + "type": "string", + "enum": ["construction", "nature", "equipment", "items", "none"] + }, + "group": { + "title": "Group", + "description": "Specifies the language file key that maps to which expandable/collapsible group this block will be a part of within a category. If this field is omitted, or there is no group whose name matches the loc string, this block will be placed standalone in the given category.", + "type": "string" + } + } }, "group": { "title": "Group", @@ -260,8 +270,7 @@ "properties": { "condition": { "title": "Condition", - "description": "UNDOCUMENTED.", - "$comment": "UNDOCUMENTED", + "description": "A Molang expression that evaluates to true or false to determine if this permutation should be used. For permutation conditions you are limited to using one Molang query: \"query.block_property()\"", "$ref": "../../../molang/string.json" }, "components": { diff --git a/source/behavior/blocks/format/components/on_fall_on.json b/source/behavior/blocks/format/triggers/on_fall_on.json similarity index 54% rename from source/behavior/blocks/format/components/on_fall_on.json rename to source/behavior/blocks/format/triggers/on_fall_on.json index 51187e09..5c49f7a8 100644 --- a/source/behavior/blocks/format/components/on_fall_on.json +++ b/source/behavior/blocks/format/triggers/on_fall_on.json @@ -2,9 +2,14 @@ "$id": "blockception.minecraft.behavior.blocks.minecraft.on_fall_on", "type": "object", "title": "On Fall On", - "description": "Describes event for this block.", + "description": "[Experimental] Describes event for this block.", "properties": { - "condition": { "type": "string", "default": "", "description": "The condition of event to be executed on the block.", "title": "Condition" }, + "condition": { + "type": "string", + "default": "", + "description": "The condition of event to be executed on the block.", + "title": "Condition" + }, "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, "min_fall_distance": { "type": "number", @@ -12,6 +17,11 @@ "description": "The minimum distance in blocks that an actor needs to fall to trigger this event.", "title": "Minimum Fall Distance" }, - "target": { "type": "string", "default": "self", "description": "The target of event executed on the block.", "title": "Target" } + "target": { + "type": "string", + "default": "self", + "description": "The target of event executed on the block.", + "title": "Target" + } } } diff --git a/source/behavior/blocks/format/triggers/on_interact.json b/source/behavior/blocks/format/triggers/on_interact.json new file mode 100644 index 00000000..c6d617a3 --- /dev/null +++ b/source/behavior/blocks/format/triggers/on_interact.json @@ -0,0 +1,21 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.on_interact", + "type": "object", + "title": "On Fall On", + "description": "[Experimental] Describes event for this block.", + "properties": { + "condition": { + "type": "string", + "default": "", + "description": "The condition of event to be executed on the block.", + "title": "Condition" + }, + "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, + "target": { + "type": "string", + "default": "self", + "description": "The target of event executed on the block.", + "title": "Target" + } + } +} diff --git a/source/behavior/blocks/format/triggers/on_placed.json b/source/behavior/blocks/format/triggers/on_placed.json new file mode 100644 index 00000000..653a3e29 --- /dev/null +++ b/source/behavior/blocks/format/triggers/on_placed.json @@ -0,0 +1,21 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.on_placed", + "type": "object", + "title": "On Placed", + "description": "[Experimental] Describes event for this block.", + "properties": { + "condition": { + "type": "string", + "default": "", + "description": "The condition of event to be executed on the block.", + "title": "Condition" + }, + "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, + "target": { + "type": "string", + "default": "self", + "description": "The target of event executed on the block.", + "title": "Target" + } + } +} diff --git a/source/behavior/blocks/format/triggers/on_player_destroyed.json b/source/behavior/blocks/format/triggers/on_player_destroyed.json new file mode 100644 index 00000000..e91b5849 --- /dev/null +++ b/source/behavior/blocks/format/triggers/on_player_destroyed.json @@ -0,0 +1,21 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.on_player_destroyed", + "type": "object", + "title": "On Player Destroyed", + "description": "[Experimental] Describes event for this block.", + "properties": { + "condition": { + "type": "string", + "default": "", + "description": "The condition of event to be executed on the block.", + "title": "Condition" + }, + "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, + "target": { + "type": "string", + "default": "self", + "description": "The target of event executed on the block.", + "title": "Target" + } + } +} diff --git a/source/behavior/blocks/format/triggers/on_player_placing.json b/source/behavior/blocks/format/triggers/on_player_placing.json new file mode 100644 index 00000000..ef6ea157 --- /dev/null +++ b/source/behavior/blocks/format/triggers/on_player_placing.json @@ -0,0 +1,21 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.on_player_placing", + "type": "object", + "title": "On Player Placing", + "description": "[Experimental] Describes event for this block.", + "properties": { + "condition": { + "type": "string", + "default": "", + "description": "The condition of event to be executed on the block.", + "title": "Condition" + }, + "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, + "target": { + "type": "string", + "default": "self", + "description": "The target of event executed on the block.", + "title": "Target" + } + } +} diff --git a/source/behavior/blocks/format/triggers/on_step_off.json b/source/behavior/blocks/format/triggers/on_step_off.json new file mode 100644 index 00000000..8df58b86 --- /dev/null +++ b/source/behavior/blocks/format/triggers/on_step_off.json @@ -0,0 +1,21 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.on_step_off", + "type": "object", + "title": "On Step Off", + "description": "[Experimental] Describes event for this block.", + "properties": { + "condition": { + "type": "string", + "default": "", + "description": "The condition of event to be executed on the block.", + "title": "Condition" + }, + "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, + "target": { + "type": "string", + "default": "self", + "description": "The target of event executed on the block.", + "title": "Target" + } + } +} diff --git a/source/behavior/blocks/format/triggers/on_step_on.json b/source/behavior/blocks/format/triggers/on_step_on.json new file mode 100644 index 00000000..38845753 --- /dev/null +++ b/source/behavior/blocks/format/triggers/on_step_on.json @@ -0,0 +1,21 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.on_step_on", + "type": "object", + "title": "On Step On", + "description": "[Experimental] Describes event for this block.", + "properties": { + "condition": { + "type": "string", + "default": "", + "description": "The condition of event to be executed on the block.", + "title": "Condition" + }, + "event": { "type": "string", "default": "", "description": "The event executed on the block.", "title": "Event" }, + "target": { + "type": "string", + "default": "self", + "description": "The target of event executed on the block.", + "title": "Target" + } + } +} diff --git a/source/behavior/blocks/format/components/random_ticking.json b/source/behavior/blocks/format/triggers/queued_ticking.json similarity index 80% rename from source/behavior/blocks/format/components/random_ticking.json rename to source/behavior/blocks/format/triggers/queued_ticking.json index 905698ac..a1a38ea2 100644 --- a/source/behavior/blocks/format/components/random_ticking.json +++ b/source/behavior/blocks/format/triggers/queued_ticking.json @@ -1,7 +1,7 @@ { "$id": "blockception.minecraft.behavior.blocks.minecraft.random_ticking", "title": "Random Ticking", - "description": "Describes the component that will trigger an even at a regular interval between two values.", + "description": "[Experimental] Describes the component that will trigger an even at a regular interval between two values.", "type": "object", "additionalProperties": false, "properties": { @@ -17,7 +17,12 @@ "default": "1", "description": "The condition of event to be executed on the block. Molang" }, - "event": { "title": "Event", "type": "string", "default": "set_block_property", "description": "The type of event executed on the block." }, + "event": { + "title": "Event", + "type": "string", + "default": "set_block_property", + "description": "The type of event executed on the block." + }, "range": { "title": "Range", "type": "array", "items": [{ "type": "integer" }, { "type": "integer" }] }, "target": { "title": "Target", diff --git a/source/behavior/blocks/format/triggers/random_ticking.json b/source/behavior/blocks/format/triggers/random_ticking.json new file mode 100644 index 00000000..beee36f1 --- /dev/null +++ b/source/behavior/blocks/format/triggers/random_ticking.json @@ -0,0 +1,31 @@ +{ + "$id": "blockception.minecraft.behavior.blocks.minecraft.random_ticking", + "title": "Random Ticking", + "description": "[Experimental] Triggers the specified event randomly based on the random tick speed gamerule. The random tick speed determines how often blocks are updated.", + "type": "object", + "additionalProperties": false, + "properties": { + "on_tick": { + "title": "On Tick", + "description": "the event that will be triggered on random ticks." + }, + "condition": { + "title": "Condition", + "type": "string", + "default": "1", + "description": "A condition using Molang queries that results to true/false. If true on the random tick, the event will be triggered. If false on the random tick, the event will not be triggered." + }, + "event": { + "title": "Event", + "type": "string", + "default": "set_block_property", + "description": "The event that will be triggered." + }, + "target": { + "title": "Target", + "type": "string", + "default": "self", + "description": "The target of the event executed by the block" + } + } +} diff --git a/source/general/block/reference.json b/source/general/block/reference.json index 13d0401f..8ac275c0 100644 --- a/source/general/block/reference.json +++ b/source/general/block/reference.json @@ -29,7 +29,7 @@ }, "tags": { "$ref": "../../molang/string.json", - "description": "[UNDOCUMENTED] A Molang expression ran against a block to match.", + "description": "A condition using Molang queries that results to true/false that can be used to query for blocks with certain tags.", "examples": ["query.any_tag('wood')"] } } diff --git a/source/general/format_version.json b/source/general/format_version.json index c3e3ba40..b8861ff5 100644 --- a/source/general/format_version.json +++ b/source/general/format_version.json @@ -4,7 +4,7 @@ "description": "A version that tells minecraft what type of data format can be expected when reading this file.", "pattern": "^([1-9]+)\\.([0-9]+)\\.([0-9]+)$", "type": "string", - "default": "1.19.0", - "examples": ["1.19.0", "1.18.30", "1.18.20", "1.18.10", "1.18.0", "1.17.0", "1.16.0", "1.15.0", "1.14.0", "1.13.0", "1.12.0", "1.10.0", "1.8.0"], - "defaultSnippets": [{ "label": "New Format version", "body": "1.${1|8,10,12,17,18|}.${3|2|0|}" }] + "default": "1.19.40", + "examples": ["1.19.40", "1.18.0", "1.17.0", "1.16.0", "1.15.0", "1.14.0", "1.13.0", "1.12.0", "1.10.0", "1.8.0"], + "defaultSnippets": [{ "label": "New Format version", "body": "1.${1|8,10,12,17,18,19|}.${3|2|0|}" }] }