MiniGame
MiniGame is a Minecraft mod project based on NeoForge. It is used to collect small game-rule features and mini-game style mechanics.
Currently supported features:
SameBlockBreak: when a player breaks a block, matching blocks in the configured range are also destroyed.
ChunkPlaceBlock: when a player places a block, the same local position in other chunks will try to place the same block.
Config Files
In the development environment, config files are generated under:
run/config/minigame/
Main config files:
sameblockbreak.toml
chunkplaceblock.toml
After changing configs, restarting the world or server is recommended. You can also use the commands below to enable or disable features.
SameBlockBreak
When a player breaks a block, the mod scans chunks within the configured radius and destroys matching blocks.
Default behavior:
- Enabled by default.
- Only matches the same block type by default.
- Only processes loaded chunks by default.
- Water sources and lava sources can also be triggered by buckets.
- Natural drops can be limited by range to avoid too many dropped items.
Common config options:
| Option |
Description |
enabled |
Enables or disables SameBlockBreak |
radius |
Scan radius in blocks |
matchBlockType |
When true, only destroys the same block type |
dropRadius |
Blocks within this X/Z radius use natural breaking and can drop items |
maxNaturalBreakBlocks |
Maximum naturally broken blocks per task, 0 means no drops, -1 means unlimited |
cleanupUnsupportedNeighbors |
Removes attached blocks that can no longer survive, such as torches, saplings, and sugar cane |
rememberBrokenBlocksForever |
Remembers broken block types and prevents them from being generated or placed again in this save |
loadedChunksOnly |
Only processes already loaded chunks |
allowChunkGeneration |
Allows missing chunks to be synchronously loaded or generated |
Commands:
/minigame sameblockbreak status
/minigame sameblockbreak cancel
/minigame sameblockbreak cancelall
/minigame sameblockbreak enable
/minigame sameblockbreak disable
These commands require game master permission.
ChunkPlaceBlock
When a player places a block, the mod tries to place the same block at the same local chunk position in other chunks within the configured radius.
"Same position" means:
- Same local X coordinate inside the chunk.
- Same Y coordinate.
- Same local Z coordinate inside the chunk.
For example, if a player places a chest at (localX=5, y=64, localZ=8) in one chunk, other chunks will also try to place the same chest at (localX=5, y=64, localZ=8) if that target position is air.
Default behavior:
- Enabled by default.
- Only places into air and does not overwrite existing blocks.
- Supports normal block placement.
- Supports water and lava source placement from buckets.
- Copies block entity data, such as chest contents.
- Later changes to managed copied block entities are synced to matching positions.
- Remembers placement rules and applies them later when chunks load or generate.
- Broadcasts a server-wide message when a player places a block:
'PlayerName' placed 'BlockName'.
Common config options:
| Option |
Description |
enabled |
Enables or disables ChunkPlaceBlock |
radius |
Processing radius in blocks |
syncBlockEntityData |
Copies and syncs block entity data, such as chest contents |
applyToFutureChunkLoads |
Applies remembered placements when chunks load or generate later |
destroySamePositionOnBreak |
When a block is broken, also destroys matching blocks at the same local position in other chunks |
placementDelayTicks |
Ticks to wait after placement before reading source block data |
blockEntitySyncDelayTicks |
Ticks to debounce block entity data changes before syncing |
loadedChunksOnly |
Only processes already loaded chunks |
allowChunkGeneration |
Allows missing chunks to be synchronously loaded or generated |
Commands:
/minigame chunkplaceblock enable
/minigame chunkplaceblock disable
These commands require game master permission.
Feature Interaction
SameBlockBreak and ChunkPlaceBlock can both handle block-breaking behavior.
To avoid conflicts:
- When
SameBlockBreak is enabled, ChunkPlaceBlock automatically sets destroySamePositionOnBreak to false.
- If you want to use ChunkPlaceBlock's same-position breaking behavior, disable
SameBlockBreak first.
Performance Notes
These features can scan or modify many chunks. Larger radii put more pressure on the server.
Recommendations:
- Keep
loadedChunksOnly=true when using a large radius.
- Avoid enabling
allowChunkGeneration casually. It may synchronously load or generate many chunks.
- If the server lags, reduce
radius, chunksPerTick, blocksPerTick, or maxMsPerTick.
- For large destruction tasks, limit natural drops to avoid too many item entities.
Notes
This project is still being expanded. When adding new mini-game features, it is recommended to give each feature its own:
- package
- config
- command
- feature/register entry point
This keeps the main mod class focused on registration and keeps feature logic easier to maintain.