GenerateSchemaEvent
Package:
com.hypixel.hytale.server.core.assetImplements:IEvent<Void>Cancellable: No
Standard event dispatched during schema generation for editor toolchain integration (e.g., VS Code JSON schema configuration). Listeners can add schemas and configure file associations through the provided methods.
Fields / Accessors
Section titled “Fields / Accessors”| Field | Type | Accessor | Mutable | Nullable |
|---|---|---|---|---|
schemas | Map<String,Schema> | — | No | No |
context | SchemaContext | getContext() | No | No |
vsCodeConfig | BsonDocument | getVsCodeConfig() | No | No |
- schemas — The map of schema filenames to
Schemaobjects. Accessible viaaddSchema(String, Schema). - context — The schema generation context.
- vsCodeConfig — The VS Code configuration document for JSON schema associations.
Methods
Section titled “Methods”addSchema(String fileName, Schema schema)
Section titled “addSchema(String fileName, Schema schema)”Adds a schema to the generation output.
addSchemaLink(String name, List<String> paths, String extension)
Section titled “addSchemaLink(String name, List<String> paths, String extension)”Configures a VS Code JSON schema file match. Paths are prefixed with /Server/ and the schema URL is set to ./Schema/<name>.json. If the extension is non-null and not .json, a file association is added.
Fired By
Section titled “Fired By”Dispatch location not identified in decompiled source. This event may be dispatched by game modules not yet mapped.
Listening
Section titled “Listening”getEventRegistry().register(GenerateSchemaEvent.class, event -> { SchemaContext context = event.getContext();
// Add a custom schema event.addSchema("my_config", myConfigSchema);
// Link it to file patterns event.addSchemaLink("my_config", List.of("Config/MyPlugin/*.json"), ".json");});Related Events
Section titled “Related Events”LoadAssetEvent— Fired during the asset loading phase.