You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stefan van der Velden edited this page Mar 7, 2025
·
5 revisions
The changelogs for the Java edition of Minecraft do not include any syntax highlighting, so in order to perform our own syntax highlighting we need to use some heuristics to determine what kind of highlighting to do.
The current implemented/planned heuristics are as follows, in the order they are checked:
Tags (^#[a-z0-9._-]+(:[a-z0-9._-]+)?$), would highlight as a comment if naively highlighted as mcfunction, need to add any command prefix in the grammar state (e.g. t ) to ensure it is highlighted as a tag
Special keywords: true, false, highlight as mcfunction. These would normally be hit by the key case below, but are very unlikely to be used for anything other than being these keywords
Simple identifier (^[a-zA-Z][a-zA-Z0-9._-]*$): The name of an identifier, e.g. the keys in key:value pairs or the name of a variable, would also match a command name but there isn't really a good way to differentiate
Folder paths/resource locations, potentially with placeholders, would like some custom highlighting for these (currently not implemented). e.g. data/<namespace>/wolf_sound_variant/<id>.json and <namespace>:<id>
Just highlight as mcfunction, works for command related stuff, SNBT, and JSON