Pool and Billiards Datapack by YMS2001
It got a website for all info you need!
About
This datapack is designed for Minecraft players who enjoy cue sports.
Here, pool broadly refers to cue sports including Snooker, 8-Ball, 9-Ball, and related variants.
The datapack supports single-player, play-with-bot, and two-player gameplay in Minecraft Java Edition 1.16+. It also fully supports players without OP permission or in survival mode.
Supported game modes:
- Snooker
- UK 8-Ball
- Generic 8-Ball
- 9-Ball
- Rule-free practice mode
Dependencies
This datapack depends on the following component:
- Required — Pool and Billiards Resource Pack
When installing from Modrinth, the compatible resource pack should be installed automatically.
Please use matching versions of the datapack and resource pack whenever possible. If an exact matching resource-pack version is not available, this means the datapack was updated without requiring a resource-pack update; in that case, use the closest earlier compatible resource-pack version.
Make sure the required resource pack is installed and enabled before use.
Detailed README (GitHub)
中文版使用说明(GitHub)
Summary of Recent Changes
近期改动总结
Mod Version
Starting from v1.2.0, the datapack is also available as a mod version.
The mod version automatically loads the datapack, so you do not need to place it into each world’s datapacks folder manually. The regular datapack version is still fully supported.
Installation
1. Download the following for the correct game version
- Pool Datapack
- Pool and Billiards Resource Pack (Please check that the resourcepack has a matching minor version to ensure compatibility, i.e., v1.3.x datapack should use v1.3.x resourcepack)
2. Locate your Minecraft directory
On Windows this is usually:
C:/Users/YourUserName/AppData/Roaming/.minecraft
3. Install the resource pack
Move Pool Resource Pack into:
.minecraft/resourcepacks
4. Install the datapacks
Open the world folder where you want to install the datapacks:
.minecraft/saves/<your world>/datapacks
Move the file into this folder:
- Pool Datapack
Each world requires its own copy of the datapacks.
Alternative mod version, available since v1.2.0
You can download the mod version and place it into .minecraft/mods
The mod version automatically loads the datapack, so you do not need to place it into each world's datapacks folder every time.
5. Start Minecraft and open the world
6. Enable the resource pack
Esc -> Options -> Resource Packs
Move Pool Resource Pack to the enabled side.
7. Run the following command
/reload
8. Enjoy
Here are a few helpful commands.
- Open command window directly without clicking any buttons in chat.
/function app:help/pool/commandwindow
or/trigger swPool__trigger set 1if without permission - Run the loading function, in case you want to troubleshoot / check missing settings and don't want to run
reload.
/function pool:classes/main/load - Terminate a game without using command window.
/function pool:classes/lobby/terminate_helper - Remove a table without using command window.
/function pool:classes/table/clear
Included Mechanics
This datapack includes the following systems:
- Simplified Newtonian physics simulation for pool balls
- Neural network-based rack simulation during the break
- Simplified match setup and game rules
- Chat-based GUI for convenient interaction; most actions are done with the mouse
- Support for English and 简体中文
For performance and clarity, the simulation omits some real-world effects such as friction between pockets and balls, cushion deformation, and other minor physical complexities.
Additional Information
Full documentation, installation and usage guides, and source code are available here:
https://github.com/MingshiYangUIUC/Pool-Minecraft-Squid-Workshop-Project
Compatibility Note
For Minecraft versions before 1.21, you may need to edit pack.mcmeta to remove the compatibility warning.
The datapack content is mostly identical across supported versions, so adjusting this single file is usually easier than maintaining multiple nearly identical copies.
Please refer to the Pack Format documentation and update pack.mcmeta according to your Minecraft version:
All Versions
+ Add Version| Name | Game version | Platforms | Published | Downloads | Actions |
|---|---|---|---|---|---|
| 5d ago | 1 | ||||
| 5d ago | 1 | ||||
| 5d ago | 1 | ||||
| 5d ago | 1 | ||||
| 1mo ago | 1 | ||||
| 1mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 2mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 3mo ago | 1 | ||||
| 4mo ago | 1 | ||||
| 4mo ago | 1 | ||||
| 4mo ago | 1 | ||||
| 4mo ago | 1 | ||||
| 6mo ago | 1 | ||||
| 6mo ago | 1 | ||||
| 6mo ago | 1 | ||||
| 6mo ago | 1 | ||||
| 6mo ago | 1 | ||||
| 6mo ago | 1 | ||||
| 7mo ago | 1 | ||||
| 7mo ago | 1 | ||||
| 7mo ago | 1 | ||||
| 7mo ago | 1 | ||||
| 7mo ago | 1 | ||||
| 7mo ago | 1 | ||||
| 8mo ago | 1 | ||||
| 8mo ago | 1 |
This update introduces a **fully playable Snooker bot**, improves bot planning and shot selection, and adds more options for adjusting difficulty and physics accuracy.
## New Features
- Added a fully playable Snooker bot!**
- The bot aims to maximize its score while considering the difficulty of future shots.
- Defensive shot searches are triggered when attacking options are poor or when a snooker is needed to win.
- Added search depth 2 for bot players.**
- The bot can now simulate potential follow-up shots to make better decisions about cue-ball positioning.
- This requires additional computation but is now practical thanks to performance optimizations introduced in previous updates.
- Added adjustable shot-force accuracy for bot players.**
- Random variation can be applied to the bot's shot force, allowing players to adjust its difficulty.
- Higher accuracy makes the bot more consistent, while lower accuracy introduces more imperfections.
- Added an adjustable collision detection accuracy setting.**
- Controls how many nearby balls the physics engine checks for potential collisions.
- Higher settings reduce the risk of missed collisions, especially when balls are tightly packed together, as in Snooker, but slightly increase computational load.
- Lower settings are generally sufficient for normal gameplay and offer better performance.
## Bot Improvements
- Improved shot evaluation** to favor more reasonable cue-ball positioning.
- Added penalties for simulated shots involving excessive cue-ball collisions, as complex trajectories are less predictable.
- Increased penalties for cue-ball collisions with pocket edges, where small inaccuracies can increase the risk of scratching.
- Added gradual penalties for cue-ball positions near cushions, where subsequent shots may be more difficult.
- These adjustments reduce the estimated value of risky follow-up opportunities without completely discouraging difficult or necessary shots, such as breaking up ball clusters.
- Improved the bot's simulation and evaluation scheduler to reduce unexpected deadlocks and interruptions.
## Technical Improvements
- Added direct position updates using entity NBT as an alternative to teleportation-based ball movement.**
- Simplifies movement calculations, improves positioning accuracy, and reduces the number of commands needed to update ball positions.
- In testing, average motion load decreased by **44.8%**, making the new method approximately **1.8× faster**.
- However, the original teleportation method truncates small displacements, leaving a slight separation between balls. The more precise NBT method reduces this separation, potentially increasing the likelihood of balls clipping through each other due to numerical errors.
- This feature is **disabled by default**. To enable it, run
/function app:settings/pool/motion/use_nbt.
- For Minecraft 1.17+, Snooker now uses marker entities instead of area ef
This update introduces a **fully playable Snooker bot**, improves bot planning and shot selection, and adds more options for adjusting difficulty and physics accuracy.
## New Features
- Added a fully playable Snooker bot!**
- The bot aims to maximize its score while considering the difficulty of future shots.
- Defensive shot searches are triggered when attacking options are poor or when a snooker is needed to win.
- Added search depth 2 for bot players.**
- The bot can now simulate potential follow-up shots to make better decisions about cue-ball positioning.
- This requires additional computation but is now practical thanks to performance optimizations introduced in previous updates.
- Added adjustable shot-force accuracy for bot players.**
- Random variation can be applied to the bot's shot force, allowing players to adjust its difficulty.
- Higher accuracy makes the bot more consistent, while lower accuracy introduces more imperfections.
- Added an adjustable collision detection accuracy setting.**
- Controls how many nearby balls the physics engine checks for potential collisions.
- Higher settings reduce the risk of missed collisions, especially when balls are tightly packed together, as in Snooker, but slightly increase computational load.
- Lower settings are generally sufficient for normal gameplay and offer better performance.
## Bot Improvements
- Improved shot evaluation** to favor more reasonable cue-ball positioning.
- Added penalties for simulated shots involving excessive cue-ball collisions, as complex trajectories are less predictable.
- Increased penalties for cue-ball collisions with pocket edges, where small inaccuracies can increase the risk of scratching.
- Added gradual penalties for cue-ball positions near cushions, where subsequent shots may be more difficult.
- These adjustments reduce the estimated value of risky follow-up opportunities without completely discouraging difficult or necessary shots, such as breaking up ball clusters.
- Improved the bot's simulation and evaluation scheduler to reduce unexpected deadlocks and interruptions.
## Technical Improvements
- Added direct position updates using entity NBT as an alternative to teleportation-based ball movement.**
- Simplifies movement calculations, improves positioning accuracy, and reduces the number of commands needed to update ball positions.
- In testing, average motion load decreased by **44.8%**, making the new method approximately **1.8× faster**.
- However, the original teleportation method truncates small displacements, leaving a slight separation between balls. The more precise NBT method reduces this separation, potentially increasing the likelihood of balls clipping through each other due to numerical errors.
- This feature is **disabled by default**. To enable it, run
/function app:settings/pool/motion/use_nbt.
- For Minecraft 1.17+, Snooker now uses marker entities instead of area ef
This update adds support for Minecraft 26.3 for both the datapack and resource pack.
- Replaced many custom math and physics calculations with Minecraft 26.3's native
/computesystem for improved performance. - In the 8-ball break benchmark on Minecraft 26.3, compared with v1.3.5:
- Peak MSPT decreased by **25%**, from **8 ms to 6 ms**.
- Mean MSPT decreased by **33%**, from **3 ms to 2 ms**.
No changes were made for Minecraft 1.16–26.2, so there is no need to update from v1.3.5 if you are playing on those versions.
If you are using Minecraft 26.3, give v1.3.6 a try — it is even faster!
This update adds support for Minecraft 26.3 for both the datapack and resource pack.
- Replaced many custom math and physics calculations with Minecraft 26.3's native
/computesystem for improved performance. - In the 8-ball break benchmark on Minecraft 26.3, compared with v1.3.5:
- Peak MSPT decreased by **25%**, from **8 ms to 6 ms**.
- Mean MSPT decreased by **33%**, from **3 ms to 2 ms**.
No changes were made for Minecraft 1.16–26.2, so there is no need to update from v1.3.5 if you are playing on those versions.
If you are using Minecraft 26.3, give v1.3.6 a try — it is even faster!
This update focuses on performance optimization and brings major improvements.
IT RUNS MUCH MORE EFFICIENTLY!
For version-to-version comparison, an 8-ball break was tested in Minecraft 1.21.8 on a Ryzen 9 5900X processor in a clean singleplayer world, using a 6×10 table, default ball radius, 150% break power, 1 GB allocated RAM, PBO enabled, and no resource pack. Each version was tested five times, with load monitored over 10 seconds.
| Version | Peak MSPT Range | Mean MSPT Range |
|---|---:|---:|
| v1.0.0 | 38–39 | 09–10 |
| v1.1.0 | 37–38 | 09–10 |
| v1.2.0 | 51–56 | 10-10 |
| v1.3.1 | 39–44 | 06-06 |
| v1.3.2 | 33–38 | 06-06 |
| v1.3.3 | 28-28 | 06-06 |
| v1.3.4 | 23–25 | 05-05 |
| v1.3.5 | 08–11 | 03–04 |
## Performance Improvements
- Heavily optimized math functions and physics-engine logic to reduce unnecessary calculations.
- Restricted player-ball-table interaction checks to players within 50 blocks of the table center.
- Added a directional check to the quick-sorting logic to discard ball pairs that are moving away from each other.
- Greatly reduces peak load in situations where many balls are close together.
- Normal shot processing can now run at as low as ~1 mspt.
- Bot simulation speed is significantly improved, reaching up to ~2× the previous speed.
- Recommended bot performance settings have been adjusted accordingly.
- To further reduce lag spikes, the number of simulation steps per tick is now adjusted dynamically based on the number of moving balls on the table during simulation.
- The setting controls the maximum value, which corresponds to the steps per tick when one ball is moving. During simulation, this value is internally reduced when more balls are moving, such as being halved when two balls are moving.
- Changed to lightweight item detection for various held items in Minecraft 1.20.5 and later.
## Mechanism Changes
- Stopped balls no longer receive physics updates every tick.
- Previously, all stopped balls were still processed each tick. This allowed force to propagate through tightly packed balls within the same tick after an active ball collided with them.
- Now, a stopped ball begins receiving physics updates only after it is affected by a collision. As a result, force propagation through packed balls is more likely to take multiple ticks instead of occurring within a couple of ticks.
- This change substantially reduces the processing cost of normal shots and also contributes significantly to faster bot simulations.
- The practical impact is limited:
- Normal tightly packed situations (i.e., break shots) can be handled by the NN break system, which is unaffected by this change.
- In ordinary gameplay, the visual difference is very small.
## Fixes
- Fixed an issue in UK 8-Ball where foul feedback could unintentionally appear after the break shot without any foul.
- Fixed an issue in practice mode where only one player is given cue ball.
This update focuses on performance optimization and brings major improvements.
IT RUNS MUCH MORE EFFICIENTLY!
For version-to-version comparison, an 8-ball break was tested in Minecraft 1.21.8 on a Ryzen 9 5900X processor in a clean singleplayer world, using a 6×10 table, default ball radius, 150% break power, 1 GB allocated RAM, PBO enabled, and no resource pack. Each version was tested five times, with load monitored over 10 seconds.
| Version | Peak MSPT Range | Mean MSPT Range |
|---|---:|---:|
| v1.0.0 | 38–39 | 09–10 |
| v1.1.0 | 37–38 | 09–10 |
| v1.2.0 | 51–56 | 10-10 |
| v1.3.1 | 39–44 | 06-06 |
| v1.3.2 | 33–38 | 06-06 |
| v1.3.3 | 28-28 | 06-06 |
| v1.3.4 | 23–25 | 05-05 |
| v1.3.5 | 08–11 | 03–04 |
## Performance Improvements
- Heavily optimized math functions and physics-engine logic to reduce unnecessary calculations.
- Restricted player-ball-table interaction checks to players within 50 blocks of the table center.
- Added a directional check to the quick-sorting logic to discard ball pairs that are moving away from each other.
- Greatly reduces peak load in situations where many balls are close together.
- Normal shot processing can now run at as low as ~1 mspt.
- Bot simulation speed is significantly improved, reaching up to ~2× the previous speed.
- Recommended bot performance settings have been adjusted accordingly.
- To further reduce lag spikes, the number of simulation steps per tick is now adjusted dynamically based on the number of moving balls on the table during simulation.
- The setting controls the maximum value, which corresponds to the steps per tick when one ball is moving. During simulation, this value is internally reduced when more balls are moving, such as being halved when two balls are moving.
- Changed to lightweight item detection for various held items in Minecraft 1.20.5 and later.
## Mechanism Changes
- Stopped balls no longer receive physics updates every tick.
- Previously, all stopped balls were still processed each tick. This allowed force to propagate through tightly packed balls within the same tick after an active ball collided with them.
- Now, a stopped ball begins receiving physics updates only after it is affected by a collision. As a result, force propagation through packed balls is more likely to take multiple ticks instead of occurring within a couple of ticks.
- This change substantially reduces the processing cost of normal shots and also contributes significantly to faster bot simulations.
- The practical impact is limited:
- Normal tightly packed situations (i.e., break shots) can be handled by the NN break system, which is unaffected by this change.
- In ordinary gameplay, the visual difference is very small.
## Fixes
- Fixed an issue in UK 8-Ball where foul feedback could unintentionally appear after the break shot without any foul.
- Fixed an issue in practice mode where only one player is given cue ball.
This update focuses on a "distributed" bot thinking strategy, free ball rule for Snooker, and additional performance optimization and fixes.
## Improvements
- Assigned fixed UUIDs to helper entities and the pool-table marker to make entity selection slightly faster.
Helper entities
rhp1–rhp3:``
UUID:[I;797665,435737,0,4-6] # swPool, helper, 0, #4-#6
000c2be1-0006-a619-0000-00000000000[4-6]
`
Pool-table marker:
`
UUID:[I;797665,82253,0,0] # swPool, table, 0, 0
000c2be1-0001-414d-0000-000000000000
`
- Reduced the frequency of
OnGround NBT checks to once every 4 ticks.
- Reduced entity position reads after movement by accumulating position from the previously stored position and movement speed instead. Full position reads are now performed once every 10 ticks.
- For Minecraft 1.21+, reduced unnecessary calculations during spin rendering by normalizing quaternions less frequently, now once every 10 ticks.
These optimizations reduced active-gameplay MSPT by up to approximately 17% compared with v1.3.3 in a testing scenario outlined in README.
## Changes / Additions
- Dynamic pool-table scaling now supports ball radii above
1250, up to 1500`. Please use multiples of 250 for best results.- Shortened the name of release zip files and included version number.
## Fixes
- Fixed a 9-ball rule issue where potting a lower-numbered ball after illegally hitting the next higher-numbered ball first was not correctly identified as a foul.
- Fixed a bug where players sometimes could not shoot when pressing Shift.
This update focuses on a "distributed" bot thinking strategy, free ball rule for Snooker, and additional performance optimization and fixes.
## Improvements
- Assigned fixed UUIDs to helper entities and the pool-table marker to make entity selection slightly faster.
Helper entities
rhp1–rhp3:``
UUID:[I;797665,435737,0,4-6] # swPool, helper, 0, #4-#6
000c2be1-0006-a619-0000-00000000000[4-6]
`
Pool-table marker:
`
UUID:[I;797665,82253,0,0] # swPool, table, 0, 0
000c2be1-0001-414d-0000-000000000000
`
- Reduced the frequency of
OnGround NBT checks to once every 4 ticks.
- Reduced entity position reads after movement by accumulating position from the previously stored position and movement speed instead. Full position reads are now performed once every 10 ticks.
- For Minecraft 1.21+, reduced unnecessary calculations during spin rendering by normalizing quaternions less frequently, now once every 10 ticks.
These optimizations reduced active-gameplay MSPT by up to approximately 17% compared with v1.3.3 in a testing scenario outlined in README.
## Changes / Additions
- Dynamic pool-table scaling now supports ball radii above
1250, up to 1500`. Please use multiples of 250 for best results.- Shortened the name of release zip files and included version number.
## Fixes
- Fixed a 9-ball rule issue where potting a lower-numbered ball after illegally hitting the next higher-numbered ball first was not correctly identified as a foul.
- Fixed a bug where players sometimes could not shoot when pressing Shift.
This update focuses on performance optimization, several bot and respotting fixes, and small usability improvements.
## Performance Improvements
- Improved tick-function efficiency by reducing idle processing and the number of entity selectors.
- Improved ball-in-hand placement performance and behavior.
- Placement is now limited to a range of 10 blocks, so please remain near the table while placing a ball.
- Placement now activates only when the player is looking downward by at least 10 degrees.
- Replaced many entity-tag checks with scoreboard checks to improve efficiency.
- Added bounding-box constraints to entity selectors where possible, reducing the impact of large numbers of irrelevant nearby entities.
- Removed several unnecessary entity selectors.
- Reduced unnecessary calculation precision when updating armor-stand poses for ball-spin animations.
## Fixes
- Fixed a known issue in v1.3.2 that could incorrectly mute sound effects during bot mode.
- Fixed the 9-ball respot option sometimes not appearing in manual mode.
- Fixed the 8-ball bot sometimes failing to detect a successful hit during the break shot.
## Other Changes
- The single-player bot mode button is now hidden when automatic judging is disabled.
- Improved snooker color-ball respotting.
- Players are no longer given the ball-in-hand tag when no color balls need to be respotted.