Open Xterionix opened 5 months ago
You can register component diagnostics here:
To check if an item exists: you can use: behaviorpack_item_diagnose or behaviorpack_check_blockid
I'm not sure what the input would be for the block check function
export function check_if_block_exists(name: string, component: any, context: Context, diagnoser: DiagnosticsBuilder): void {
if (component === undefined) return;
if (component.target_blocks !== undefined && component.target_blocks instanceof Array) component.target_blocks.forEach((block: string) => behaviorpack_check_blockid(/**?**/ ,diagnoser) )
Aah the Types.OffsetWord is an object that stores the text of the data found, and the offset in the file where it is located.
Here you can see any example:
For the diagnosed (and vscode) to place the error in a document it needs to known a location
Even for checking the block Id I should get the item?
No, I think we are going to need a equivalent for block on that function, don't think it exists yet.
Ah, well let me know when that's been adeded
For entity components that reference items and blocks, it should check if they're valid. Happy to do this myself if you could point me in the direction as I believe it's already setup to check for valid blocks and items just not within the entity components