Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings

Version Detector

An API for datapacks to detect your Minecraft Version

1,114
5
Library
Management
Utility
AboutChangelogVersions

Version Detector is a proof of concept that more is possible with datapacks than you'd think, and also an API for datapacks to detect what version they're running.

It doesn't do much on its own, but can be useful for other datapacks.

Note: when adding the datapack to a world, if you're using a game version older than 1.20.2, Minecraft will warn you that the pack was made for an older version of Minecraft. Ignore this warning, I can't do anything about it on versions older than 1.20.2 as the feature of pack.mcmeta that allows me to add a range of supported versions instead of having just 1 was added in 1.20.2.

Questions/Issues? Post them in my discord as they are more likely to get seen there. Find it on the sidebar.

This pack uses the fact that Minecraft completely removes functions with invalid syntax when loading a datapack, for example "execute if entity @e[type=pillager]" is invalid syntax in 1.13, because Pillagers don't exist yet, causing the whole function to get removed in 1.13, but the function will load successfully and will exist in 1.14 and later because there is no more invalid syntax because Pillagers were added, and the command was written correctly. Each function sets a number in a scoreboard objective to a number and runs the next function, which has a different syntax to the previous one, for example "execute if entity @e[type=bee]" instead of "execute if entity @e[type=pillager]" when moving from the 1.14 function to the 1.15 function, checking for a different feature. If at any point the chain stops, the number stops changing, which matches your version of Minecraft.

The ID is stored in a score for "MinecraftVersion" in the "VersionInfo" objective. It goes from 0 (1.13) up to whatever the latest detectable version is, which is 33 (25w17a) right now.

This pack also has NeoForge and Forge detection. Fabric and Quilt are currently undetectable, as there is nothing I can detect that fabric or quilt (without mods installed) adds to the game.

To Modpack Creators:

I permit the use of this datapack/mod in your modpacks. You can include it in modpacks without the need to ask me about it. However, notifying me if it is being included in your modpack would be nice.

Versions Detected

List of versions detected, in order from oldest to newest, starting at ID 0 (1.13) and going up (if a version isn't in this list it is grouped with the newest version from before the version, example 1.21.3 is grouped with 1.21.2): 0. 1.13

  1. 1.13.1
  2. 1.14
  3. 1.14.3
  4. 1.14.4
  5. 1.15
  6. 1.15.2
  7. 1.16
  8. 1.16.2
  9. 1.17
  10. 1.18
  11. 1.18.2
  12. 1.19
  13. 1.19.3
  14. 1.19.4
  15. 1.20
  16. 1.20.2
  17. 1.20.3
  18. 1.20.5
  19. 1.21
  20. 1.21.2
  21. 1.21.4
  22. 25w02a
  23. 25w03a
  24. 25w04a
  25. 25w05a
  26. 25w06a
  27. 25w07a
  28. 25w08a
  29. 25w09a
  30. 25w10a
  31. 1.21.5
  32. 25w15a
  33. 25w17a
  34. 25w20a
  35. 1.21.6

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Compatibility

Minecraft: Java Edition

1.21.x
1.20.x
1.19.x
1.18.x
1.17.x
1.16.x
1.15.x
1.14.x
1.13.x

Platforms

Data Pack
Fabric
Forge
NeoForge
Quilt

Supported environments

Server-side
Client and server (optional)

Links

Report issues View source Visit wiki Join Discord server

Creators

AndrewGaming587
AndrewGaming587 Member

Details

Licensed CC-BY-4.0
Published 5 months ago
Updated 6 days ago

Modrinth is open source.

main@fafd47f

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.