Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't like emitter_shape_entity_aabb fields #28

Open
tryashtar opened this issue Aug 7, 2024 · 1 comment
Open

Doesn't like emitter_shape_entity_aabb fields #28

tryashtar opened this issue Aug 7, 2024 · 1 comment

Comments

@tryashtar
Copy link

tryashtar commented Aug 7, 2024

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
Copy link

MKokeshi commented Aug 8, 2024

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.

  • Obtain the Latest Schema: Get the most recent JSON schema for Minecraft, which can be found in official resources or updated repositories. Ensure the schema aligns with your Minecraft version.
  • Schema Customization: If needed, update the schema definitions you are using to include properties like surface_only if you have control over the 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:

  • Array Format for direction:
"direction": ["inwards"]
  • Correct vs. Incorrect Formats:

    • Correct: ["inwards"] (Array with a string element)
    • Incorrect: "inwards" (String instead of an array)

5. Consult Documentation and Community

  • Minecraft Documentation: Check the official Minecraft Documentation or the Minecraft Wiki for up-to-date information on JSON components and their schema requirements.
  • Community Forums: Reach out to Minecraft modding or development communities, such as forums or Discord servers, for advice. Other developers may have encountered similar issues and can offer guidance.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants