Coder Social home page Coder Social logo

blockception / minecraft-bedrock-json-schemas Goto Github PK

View Code? Open in Web Editor NEW
46.0 6.0 27.0 6.65 MB

The JSON validation schema files for Minecraft bedrock

License: BSD 3-Clause "New" or "Revised" License

JSON 99.30% TypeScript 0.70% Makefile 0.01%
minecraft bedrock json json-validation json-schema minecraft-bedrock animation-controllers snippets hacktoberfest open-source

minecraft-bedrock-json-schemas's Introduction

Minecraft-bedrock-json-schemas

Compress Json Schemas Format json files Unit Test

The JSON validation schema files for Minecraft bedrock

Contributing

Any changes to the schemas are to be done through the source files in the folder source. These get converted and compressed through an action into smaller schemas. On other matters follow the Contribution guide.

This project could use help in filling in descriptions, titles and giving snippets!

JSON validation can give snippets for sub items, as well as description, but this hasn't always been filled out!

Manual Usage

Vscode

  • Copy the vscode-settings.json file into the .vscode folder in your project and rename it to: settings.json
    OR
  • Copy the contents of vscode-settings.json into your .code-workspace file under the property settings:
{
  "folders": [ { "path": "." } ],
  "settings": {
    "json.schemas": [
      ...
    ]
  }
}

Contents

Behavior files

Resource files

License

This project makes use of Microsoft open source license: CC-BY-4.0, MIT licenses.

minecraft-bedrock-json-schemas's People

Contributors

adamraichu avatar chibimango avatar daanv2 avatar dependabot[bot] avatar dinnerbeef avatar doublef3lix avatar drinkwater623 avatar github-actions[bot] avatar ink0rr avatar jaylydev avatar mitgobla avatar mordud2 avatar orbi-bot avatar quazchick avatar r4isen1920 avatar stealthyexpertx avatar stirante avatar thijshankelmc avatar ultr4anubis avatar xterionix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

minecraft-bedrock-json-schemas's Issues

[Bug report] Dialogue property values doesn't necessarily need to be an object

Describe the bug
The dialogue features allows content creators to create and run pre-made dialogues in-game from dialogue files found in the BP/dialogue/ folder. With this, I find it weird that having certain properties of a dialogue's scene specifically only requires it to have an object instead of a string. That's not true. While these properties support rawtext values in a form of an object, we can just simply minimize this and use string on it's own.

To Reproduce
Steps to reproduce the behavior:

  1. Create a dialogue file under the BP/dialogue/ folder
  2. Add a scene to the dialogue within the file
  3. Change certain properties to string
  4. Extension incorrectly validates it

Expected behavior
Strings are also supported in the values, and no error validation would occur.

Screenshots
Sample usage with validation error

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: N/A
  • Version: v3.2.67 (latest)

Smartphone (please complete the following information):
N/A as this was done on PC

Additional context
None

[Bug] `minecraft:health` component shows an unnecessary warning

Describe the bug
The minecraft:health component warns that a value property is required when the max property is given. This is not necessary and Minecraft doesn't complain when value is omitted in this case; Minecraft assumes value = max.

To Reproduce
Steps to reproduce the behavior:

  1. Create an entity in the BP.
  2. Add this code to a component/group:
"minecraft:health": {
	//"value": 40,
	"max": 40
}
  1. Observe warning.

Expected behavior
Warning is not shown as property value is not required when max is given.

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: VSCode
  • Version:
    • VSCode: 1.66.2
    • Extension: 3.2.106

Allow VSCode-Specific Extensions in Schemas

Visual Studio Code allows for a couple of non-standard extensions to JSON schemas, most notably snippets. Snippets are a more useful alternative to "examples". Snippets allow for placeholders, in-object enumeration selection, and useful case/example descriptions. Additionally, Markdown may be used for any description (via an extension โ€” not overriding the base "description" schema property), allowing for better formatting or even possibly linking to online creator portal documentation.

These extensions make authoring JSON significantly faster and are designed in such a way so as not to interfere with the base JSON schema system. However, these extensions may be outside the scope of this repository if the intention is only for validation.

If extensions aren't desired here, should I make a ticket on the VS Code extension repository?

Update minecraft:equipment

Is your feature request related to a problem? Please describe.
Documentation got updated on minecraft:equipment, update the schemas accordingly

Loot table bug: Minecraft expects "binding", syntax suggests "curse_of_binding"

Describe the bug
The auto complete feature and syntax checker for loot tables suggests the enchatment name "curse_of_binding", however this does not work in-game, Minecraft expects the string to be "binding"

To Reproduce
Steps to reproduce the behavior:

  1. Create a new loot table
  2. Add an armor item with the "specific_enchants" function
  3. Set the enchants ID to "binding"
  4. Observe the syntax error saying "value is not accepted"
  5. Resolve the loot table in Minecraft and observe the Curse of Binding enchant on the item
  6. Change the enchant ID to "curse_of_binding"
  7. Observe the lack of syntax warning
  8. Resolve the loot table in Minecraft and observe the missing enchantment.

Expected behavior
"binding" is suggested as valid syntax, not "curse_of_binding"

Screenshots
Screenshot_367
A valid loot table entry, according to Minecraft

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser : None (VS Code)
  • Version: 3.2.98

EDIT: Additional note, this likely also affects the curse of vanishing, but I haven't tested that.

on_interact

Describe the bug
on_interact is saying there is a problem with stuff that is allowed

To Reproduce
Steps to reproduce the behavior:
Try an add "barter", "admire", cooldown_after_being_attacked" to on "on_interact" an it says its not allowed

Expected behavior
To work for "barter", "admire", "cooldown_after_being_attacked"

Additional context
https://docs.microsoft.com/en-us/minecraft/creator/reference/source/vanillabehaviorpack_snippets/entities/piglin
As seen here it does allow you to have these in there

minecraftschemas.net domain name

Hi crew,

Back when bedrock scripting was in private beta, I registered the minecraftschemas.net domain name with the intention of doing exactly what you guys are providing in this repository. Unfortunately I never actually got around to doing anything with it and my registrar is pinging me to say that it's going to expire in 54 days.

I figured rather than just let it go, I'd offer it to you guys before the domain squatters get it. If you want it, I'm happy to transfer it to you, if you don't, that's fine too, I'll just let it lapse.

Thanks for the service you're providing :)

Resource Animation: Uniform scale marked as incorrect

Describe the bug
When using a uniform value for the scale of a bone, the value is marked as "Incorrect Type. Expected array".

To Reproduce
Steps to reproduce the behavior:

  1. Create an animation with the following bone:
			"bones": {
				"root_item": {
					"rotation": [82, 1, 0],
					"position": [0.5, 22, 2],
					"scale": 0.6
				}
			}

Expected behavior
The scale value should be valid

Block ID -> Block Reference

There are multiple properties that maybe support block references instead of just identifiers.
These should be investigated.

Many relative file paths are wrong

Hey, I'm attempting to use these schemas to create classes in C# using quicktype. However, it seems that a lot of relative paths are incorrect. For example /behaviour/entities/1.16.0/components/minecraft.breedable.json#/properties/breed_items/oneOf/0/items refers to ../../../../general/item/identifier.json, which is not correct. It should be ../../../general/item/identifier.json instead. I started fixing them one by one but gave up after like 15 because I have no idea how many more there will be.

Any ideas why this could be the case? Otherwise this looks like a great project!

Many titles are wrong

Hey, I'd like to use this schema in my project but at the moment it's kind of unusable because the title fields should really be descriptions. Most schema parsers use the title field as the type name, so when the title is The minecraft item identifier 1.8.0, the generated type name is TheMinecraftItemIdentifier180, which is less than ideal. I'm not sure if this is on purpose or if it was done by some automated tool, but it should probably be "ItemIdentifier" or something instead. I'm creating this issue to make sure there's not a good reason for this, and if there's not then I'll start fixing them + make a PR. Let me know!

[Bug] "is_biome" filter value choice warning

Describe the bug
One of the value choices for the "is_biome" filter has a mistake.

To Reproduce
Add this code to an entity's BP components.

            "minecraft:environment_sensor": {
                "triggers": [
                    {
                        "event": "self:example",
                        "target": "self",
                        "filters": {
                            "test": "is_biome",
                            "value": "the_nether"
                        }
                    }
                ]
            }

Observed behavior
"the_nether" produces a warning.

Expected behavior
The code above produces no errors or warnings.

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10
  • Application: VSCode
  • Version:
    • VSCode: 1.63.2
    • Extension: 3.2.72

Additional context
N/A

loot table enchantment value "power" is considered invalid

Describe the bug
When creating a loot table with an enchanted item, "power" is missing from the enchantment names list but using it still results in a valid power enchantment on the item in-game

To Reproduce
Steps to reproduce the behavior:

  1. Create a loot table with an enchanted bow. Give it an enchantment with an "id" of "power"
  2. Notice that the syntax checker says "power" is invalid as a value.
  3. Load the loot-table in game.
  4. Observe the dropped item has the power enchantment.

Expected behavior
"power" is considered a valid enchantment value

Screenshots

Screenshot_311

Desktop (please complete the following information):

  • Windows 10
  • Visual Studio Code 1.60.1
  • Version 2.1.64

[Bug Report] Using dot "." in blocks.json objects throws warning

Using dot "." in blocks.json objects throws warning, and using 2 times ":" does not.

To Reproduce
Create a new resource pack workspace.
Create inside it a block.json file containing the following

{
	"format_version": [1, 1, 0],
	"studio:project.block": {
		"textures": "block_texture_reference"
	},
	"studio:project:block": {
		"textures": "block_texture_reference"
	}
}

You can type a dot in any part of the object name, including the

Actual Behaviour
It throws a 'String does not match the pattern of "^[\w_-:]+$".' warning.
It does not throw a warning when used ":" more than once.

Expected behavior
It should not throw any warnings for using dots.
It should throw a warning for using more than 1 ":".

Screenshots
image

Additional context
Note: not sure about the ":" behaviour is wai. Never used more than one ":".

Add `"$schema"` property to compiled Schemas, to reflect that they have been built for draft-07.

Is your feature request related to a problem? Please describe.
I would like to use these schemas with the validation library python jsonschema. This library assumes latest draft, unless explicitly supplied. I need to manually add the "$schema" property into the schemas, before I can validate.

Describe the solution you'd like
"$schema" can be included in the generated schemas, either by including in source schemas, or adding into compilation pipeline.

Describe alternatives you've considered
I will inject manually, after pulling git submodule.

Additional context
Its a dumb project, but src is here: https://github.com/Bedrock-OSS/bedrock-web-validator

1.16.0 Geometry Format Version

Describe the bug
The 1.16.0 geometry format version is not recognized and is marked as invalid. The new format version is required for the new "binding" property on bones to work.

To Reproduce
Steps to reproduce the behavior:

  1. Create a regular 1.12 geometry
  2. Change the format version to "1.16.0"
  3. Geometry file is marked as invalid

Expected behavior
The geometry file should be valid.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.