-
Notifications
You must be signed in to change notification settings - Fork 2
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
Check if valid block and item being used #206
Comments
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: BC-Minecraft-Bedrock-Diagnoser/src/Lib/Diagnostics/BehaviorPack/Loot Table/entry.ts Line 21 in 34732a1
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
The text was updated successfully, but these errors were encountered: