Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added syntax support for .mcfunction files (Minecraft functions)#3953

Open
BuriXon-code wants to merge 1 commit intomicro-editor:master from
BuriXon-code:master
Open

Added syntax support for .mcfunction files (Minecraft functions) #3953
BuriXon-code wants to merge 1 commit intomicro-editor:master from
BuriXon-code:master

Conversation

@BuriXon-code
Copy link

@BuriXon-code BuriXon-code commented Dec 27, 2025

Pull Request: Add mcfunction Syntax Highlighting

Summary

This PR adds syntax highlighting support for Minecraft .mcfunction files in Micro editor.
It provides better readability for datapack and command development, including commands, selectors, effects, JSON-like arguments, and numbers.

Features

  • Commands (effect, execute, give, tp, scoreboard, etc.) highlighted as statements
  • Subcommands / operators (run, if, matches, modify, etc.) highlighted separately
  • Selectors (@s, @e, @a) clearly highlighted
  • Minecraft namespaces (minecraft:wither, minecraft:stone) highlighted as identifiers
  • Numbers and boolean values (true, false) highlighted
  • Dangerous commands (kill @e, tp @e, clear @a, etc.) highlighted as error (screaming red in most colorschemes)
  • JSON-like arguments ({"text":"Hello","color":"red"}) highlighted for better readability

Motivation

  • Micro lacks built-in support for .mcfunction files
  • Developers editing Minecraft datapacks, functions, and command scripts in Micro will benefit from immediate visual feedback
  • Dangerous commands and important effects are visually emphasized to prevent mistakes

Testing / Examples

Example mcfunction snippet highlighting all token types:

effect give @s minecraft:wither 5 1 true 
execute if score @s weapon_random matches 25 run item modify entity @s weapon.mainhand murder_weapon:mark25 
kill @e[type=zombie]
  • effect → statement
  • give → subcommand
  • @s → selector
  • minecraft:wither → identifier
  • Numbers (5 1) → numbers
  • true → boolean / constant
  • Dangerous commands (kill @e) → error / red

Notes

  • Only .mcfunction syntax is added
  • No changes to Micro core functionality or existing syntax files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /