Singleplayer Library
A blazing-fast library for datapacks and mods that simplifies singleplayer compatibility checks with minimal overhead.
截图
介绍



SinglePlayer Library is a lightweight utility library for datapacks and mods that helps developers support singleplayer environments without creating separate versions of their projects.
It provides a simple way to detect and enable singleplayer-specific features or settings, allowing projects that normally require manual setup or commands to work smoothly for singleplayer users.


- Ultra Lightweight : Minimal overhead designed for maximum performance.
- Easy Integration : Add singleplayer support to datapacks and mods without complex setup.
- Blazing Fast : Optimized to run efficiently with minimal impact.
- Developer Friendly : Built as a reusable foundation for other projects.
- Singleplayer Ready : Provides singleplayer support without requiring manual permission setup.
- Multi Version Support : Supports multiple Minecraft versions while keeping the same simple integration.


SinglePlayer Library uses tags to provide a simple way for projects to detect and handle singleplayer environments.
The library checks players at a 1-second interval to keep performance impact as low as possible. Unlike normal Minecraft tick functions that run 20 times per second, SinglePlayer Library only performs its check once per second, providing a lightweight and stable system.
splib_activeIndicates that the player has been detected by SinglePlayer Library and is running in a supported singleplayer environment. Projects can use this tag to enable singleplayer-specific features or settings.
splib_ignoreThis tag is intended for developers and server owners. Players with this tag will be excluded from SinglePlayer Library handling, preventingsplib_activefrom being automatically added.


Use splib_active to run features or settings that should only apply in singleplayer worlds.
Keep in mind that the code below does not run until the function is executed. The namespace my_pack is not automatically created by a datapack or mod you must implement and structure it yourself.
check.mcfunction
execute unless entity @s[tag=splib_active] run function my_pack:tellraw_missing_library
execute if entity @s[tag=splib_active] run function my_pack:singleplayer_settings
use_feature.mcfunction
execute if entity @s[tag=splib_active] run function my_pack:feature/run
execute unless entity @s[tag=splib_active] run function my_pack:feature/blocked
other.mcfunction
execute unless entity @s[tag=splib_active] run function my_pack:performance/low_mode


What Minecraft versions are supported?
SinglePlayer Library supports Minecraft Java Edition versions from 1.17 to 1.21+.
Does this add any gameplay features?
No. SinglePlayer Library is a developer utility and does not add gameplay features by itself. It provides a foundation that other projects can use for singleplayer-specific features and settings.
Can I use it in monetized projects?
Yes. Developers are allowed to use this library in projects that generate revenue.
However, the library itself must remain free and cannot be sold, paywalled, or redistributed as a paid product.
Is it required for players to install?
Only if a project using it requires the library. Otherwise, it has no effect on its own.
Can I modify or redistribute the library?
You may use it as a dependency in your projects, but you may not reupload, sell, redistribute it as a standalone product, or claim it as your own.


Datapack (Singleplayer / Server)
- Download the datapack.
- Place it in your world’s datapacks folder.
- Exit and rejoin the world. Search on youtube how to install datapack ↗
- Tip: Use
/datapack listandtag <targets> listto verify that it is installed correctly.


Mod Version (Client / Server)
- Install the mod file into your
modsfolder. - Launch the game or server with a compatible mod loader.
- No additional setup required. Search on youtube how to install mod ↗
- Tip: It will appear in the mod menu if installed correctly.

常见问题
Singleplayer Library 支持哪些 Minecraft 版本?
Singleplayer Library 支持 Minecraft Java 版 1.17–26.2,共 33 个版本,可用的加载器:Fabric / Forge / NeoForge / Quilt。下载时注意选择和你游戏版本一致的文件。
Singleplayer Library 怎么安装?
新建世界时在「数据包」里把下载的 .zip 拖进去;已有的存档,把文件放进存档目录下的 datapacks 文件夹,进游戏输入 /reload 即可生效。服务器同样放在世界目录的 datapacks 里。
BibekTheLegend 的其他作品
查看全部 →
Smooth PVP
A texture pack with smooth blocks, clean GUI & clean font and more..
Entity Cleaner
Automatically removes unwanted entities like items, arrows, XP orbs, and projectiles to improve performance.
Enchant Plus
Introduces over 100+ custom enchantments into the game.
Luminous loot
Adds glowing effects to rare loot drops so you never miss valuable items!


评论
登录后评论和评分