MCBDSHost - Professional Minecraft Bedrock Server Management

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 gamerule parameter type from "string" to "gamerule" for better identification

  • Added comprehensive list of 35+ Minecraft Bedrock game rules:

    Common Rules:

    • commandBlockOutput, doDaylightCycle, doEntityDrops, doFireTick
    • doInsomnia, doMobLoot, doMobSpawning, doTileDrops, doWeatherCycle
    • drowningDamage, fallDamage, fireDamage, freezeDamage
    • keepInventory, mobGriefing, naturalRegeneration, pvp
    • randomTickSpeed, sendCommandFeedback, showCoordinates, showDeathMessages
    • spawnRadius, tntExplodes

    Additional Bedrock Rules:

    • announceAdvancements, disableElytraMovementCheck, doImmediateRespawn
    • doLimitedCrafting, maxCommandChainLength, maxEntityCramming
    • playersSleepingPercentage, reducedDebugInfo, respawnBlocksExplode
    • showBorderEffect, showTags, spectatorsGenerateChunks
    • universalAnger, 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

  1. MCBDS.PublicUI/Components/BedrockCommands.cs - Updated gamerule with full list
  2. MCBDS.PublicUI.Android/Components/BedrockCommands.cs - Updated gamerule with full list
  3. MCBDS.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!

Support MCBDSHost Development

Help us continue developing and improving MCBDSHost. Your support makes a difference!