Mojang / minecraft-creator-tools

A set of tools for creating content and add-ons for Minecraft Bedrock Edition.
Other
70 stars 3 forks source link

Doesn't like emitter_shape_entity_aabb fields #28

Open tryashtar opened 3 months ago

tryashtar commented 3 months ago

I got these errors:

additionalProperties /particle_effect/components/minecraft:emitter_shape_entity_aabb must NOT have additional properties: (additionalProperty: surface_only) Wrong type: /particle_effect/components/minecraft:emitter_shape_entity_aabb/direction type must be array

When using a particle with this component:

"minecraft:emitter_shape_entity_aabb": {
    "surface_only": true,
    "direction": "inwards"
}

These errors are wrong because these fields are valid and functional, I've tested it just now.

MKokeshi commented 3 months ago

The errors you’re encountering suggest that the JSON schema you're using for particle effects has strict validation rules that are not aligned with the latest changes or implementations you’ve tested. It’s possible that the schema you are using is outdated or not fully compatible with the current Minecraft updates or your specific setup.

Here's how you can address these issues:

1. Validate Schema and JSON

Ensure that your JSON and schema are compatible with the version of Minecraft you're using. Sometimes, official schemas might not immediately reflect changes or additions.

2. Correct JSON Structure

For the minecraft:emitter_shape_entity_aabb component, it seems there are discrepancies between the schema and what you’ve tested. Here’s how you should structure the JSON according to common patterns:

Valid JSON Structure for minecraft:emitter_shape_entity_aabb

{
  "particle_effect": {
    "components": {
      "minecraft:emitter_shape_entity_aabb": {
        "surface_only": true,
        "direction": ["inwards"]  // Ensure this is an array
      }
    }
  }
}

3. Update the Schema

If you are sure that the surface_only property is valid but the schema still flags it, you may be working with an outdated or incorrect schema file.

4. Check Property Types

Make sure that direction is indeed expected to be an array, and that it’s correctly formatted. The error message suggests that direction should be an array, so ensure it's formatted like this:

"direction": ["inwards"]

5. Consult Documentation and Community

Example Configuration

Here’s an example of how to structure minecraft:emitter_shape_entity_aabb properly:

{
  "particle_effect": {
    "components": {
      "minecraft:emitter_shape_entity_aabb": {
        "surface_only": true,
        "direction": ["inwards"]  // Ensure 'direction' is an array
      }
    }
  }
}

By following these guidelines, you should be able to correct the errors and ensure your JSON configuration is aligned with Minecraft’s expected structure.