Game Rule Autocomplete
Features
GAMERULE-AUTOCOMPLETE-IMPLEMENTATION.md
Game Rule Autocomplete Implementation
Summary of Changes
Changes Applied Successfully
1. Updated BedrockCommands.cs (PublicUI & Android)
Changed
gameruleparameter type from"string"to"gamerule"for better identificationAdded comprehensive list of 35+ Minecraft Bedrock game rules:
Common Rules:
commandBlockOutput,doDaylightCycle,doEntityDrops,doFireTickdoInsomnia,doMobLoot,doMobSpawning,doTileDrops,doWeatherCycledrowningDamage,fallDamage,fireDamage,freezeDamagekeepInventory,mobGriefing,naturalRegeneration,pvprandomTickSpeed,sendCommandFeedback,showCoordinates,showDeathMessagesspawnRadius,tntExplodes
Additional Bedrock Rules:
announceAdvancements,disableElytraMovementCheck,doImmediateRespawndoLimitedCrafting,maxCommandChainLength,maxEntityCrammingplayersSleepingPercentage,reducedDebugInfo,respawnBlocksExplodeshowBorderEffect,showTags,spectatorsGenerateChunksuniversalAnger,doPatrolSpawning,doTraderSpawning
2. Updated Commands.razor (PublicUI)
- Added handling for
"gamerule"parameter type - Added generic handling for any parameter with
PossibleValues - Implemented smart filtering with prefix matching priority
- Added
GetSuggestionsHeader()method for dynamic dropdown headers - Now shows appropriate header: "Game Rules", "Minecraft Items", or " Options"
How It Works
Game Rule Autocomplete
Type: "gamerule " Shows all 35+ game rules
Type: "gamerule keep" Shows "keepInventory"
Type: "gamerule do" Shows all "do*" rules (doDaylightCycle, doMobSpawning, etc.)
Type: "gamerule show" Shows "showCoordinates", "showDeathMessages", "showBorderEffect", "showTags"
Generic Parameter Suggestions
The system now supports autocomplete for ANY command parameter that has PossibleValues defined:
- Game modes:
survival,creative,adventure,spectator - Difficulty levels:
peaceful,easy,normal,hard - Weather types:
clear,rain,thunder - Time values:
day,night,noon,midnight - And more...
Testing Commands
# Game rule suggestions
gamerule
gamerule keep
gamerule do
gamerule show
gamerule mob
# Other parameter suggestions
difficulty
gamemode
weather
time set
Features
- 35+ game rules with autocomplete
- Smart filtering (prefix matches shown first)
- Dynamic dropdown headers
- Works for all parameters with PossibleValues
- Keyboard navigation (arrows, Tab, Enter)
- Mouse selection support
- Real-time filtering as you type
Files Modified
MCBDS.PublicUI/Components/BedrockCommands.cs- Updated gamerule with full listMCBDS.PublicUI.Android/Components/BedrockCommands.cs- Updated gamerule with full listMCBDS.PublicUI/Components/Pages/Commands.razor- Added gamerule and generic PossibleValues handling
Build Status
Build Successful - All changes compiled successfully
Hot Reload Notice
If you're debugging the app, you may need to hot reload or restart to see the changes.
Complete Game Rules List
The following game rules are now available with autocomplete:
| Rule | Description |
|---|---|
commandBlockOutput |
Whether command blocks should output text |
doDaylightCycle |
Whether the daylight cycle advances |
doEntityDrops |
Whether entities drop items when killed |
doFireTick |
Whether fire should spread |
doInsomnia |
Whether phantoms can spawn |
doMobLoot |
Whether mobs drop items |
doMobSpawning |
Whether mobs spawn naturally |
doTileDrops |
Whether blocks drop items when broken |
doWeatherCycle |
Whether weather changes |
drowningDamage |
Whether players take drowning damage |
fallDamage |
Whether players take fall damage |
fireDamage |
Whether players take fire damage |
freezeDamage |
Whether players take freeze damage |
keepInventory |
Whether players keep inventory on death |
mobGriefing |
Whether mobs can modify blocks |
naturalRegeneration |
Whether players regenerate health naturally |
pvp |
Whether players can attack each other |
randomTickSpeed |
Speed of random block ticks |
sendCommandFeedback |
Whether commands show feedback |
showCoordinates |
Whether to show coordinates |
showDeathMessages |
Whether death messages appear in chat |
spawnRadius |
Radius around spawn where players appear |
tntExplodes |
Whether TNT explodes |
| ...and 12 more! |