Commit graph

1579 commits

Author SHA1 Message Date
Anon
968800b95a Added a bunch of new useful MCP Tools 2026-03-30 23:14:28 +02:00
Anon
7b415d5388 Added a Skill for MCP 2026-03-29 20:57:16 +02:00
Anon
cf382122e9 Added inventory manipulation to the MCP, improved the test harness 2026-03-28 16:44:22 +01:00
Anon
7f9023e7bb More tools, added debug tools, fixed issues with some tools. 2026-03-28 04:12:37 +01:00
Anon
79b091cab6 Implemented a first version of an MCP server as a Chat Bot 2026-03-28 02:08:47 +01:00
BruceChen
0194380fbc TUI support for more container 2026-03-28 02:18:11 +08:00
BruceChen
ef133f3d6d Enhance container handling for Minecraft protocol updates
- Updated the Container class to include a protocol version parameter for accurate container type mapping.
- Modified the GetContainerType method to account for changes in container types introduced in Minecraft 1.20.4.
- Added new container types, including Crafter, to the ContainerType enum.
- Adjusted ContainerTypeExtensions to reflect the new container mappings and ensure compatibility with the updated protocol.
2026-03-28 02:17:47 +08:00
BruceChen
22f46d14a9 Fix negative location error 2026-03-28 02:17:47 +08:00
BruceChen
448e1ef6f5
Merge pull request #3010 from BruceChenQAQ/master
Update Crowdin GitHub Action version in build-and-release.yml
2026-03-28 00:48:31 +08:00
Anon
0a9948a92a Merge branch 'master' of github.com:MCCTeam/Minecraft-Console-Client into fix/use-item 2026-03-27 16:46:29 +01:00
Anon
0c9ff137b2 Fixed shovel not being able to be used on dirt 2026-03-27 16:43:53 +01:00
Anon
f6446b198d Implemented effects support, as a command, chat notification and added in TUI mode 2026-03-27 15:47:27 +01:00
BruceChen
4b9e0e93aa Fix: cursor locate at the beginning when pressing Up to view history 2026-03-27 22:47:20 +08:00
BruceChen
ac1d5c37a6 Refactor tab cycling logic in TUI command input handling
- Simplified the condition for disabling tab cycling by checking only for the Tab key.
- Improved clarity in the command key down event handling for better user experience.
2026-03-27 00:30:52 +08:00
BruceChen
fe7ab9f373 Implement startup state management and enhance configuration loading
- Introduced a new `StartupState` class to encapsulate the state collected before the console backend initialization.
- Updated the configuration loading process to handle legacy upgrades and provide detailed feedback on configuration status.
- Enhanced the TUI backend to utilize the new startup state for improved initialization flow.
- Refactored the `LoadFromFile` method in `Settings` to return a structured result, improving error handling and clarity.
2026-03-27 00:30:52 +08:00
BruceChen
b33ee7e4a1 Refactor exit handling and command input in TUI
- Improved the exit process by ensuring the backend shutdown is called after handling offline prompts.
- Enhanced command input history management by encapsulating text setting logic in a dedicated method to prevent event handler interference.
- Adjusted the background color in the color parser for better visibility.
- Increased the sleep duration in the TUI exit guard thread to ensure a smoother shutdown process.
2026-03-27 00:30:52 +08:00
Anon
7da47d36dc
[skipci]Fixed session id changing not working in the Web Socket Chat bot. 2026-03-25 22:02:22 +01:00
Anon
05afeaf5bc Fixed session if changing in the Web Socket Chat bot. 2026-03-25 21:59:01 +01:00
Anon
966b787a4c
feat: Added missing enchantments for new versions 2026-03-25 20:01:43 +01:00
BruceChen
e5b81fe428 feat: add support for unsupported container type in inventory TUI
- Implemented a check in the Inventory command to log a warning and return a failure status if the container type is not PlayerInventory.
- Added a new localized string for the warning message to inform users about unsupported container types.

These changes improve user feedback and error handling in the inventory management system.
2026-03-26 02:35:50 +08:00
BruceChen
dcfff3f1ba feat: enhance Protocol18 and SocketWrapper for improved functionality
- Added support for the new world border hit flag in Protocol18 for protocol version 1.21.2.
- Updated SocketWrapper to throw a SocketException if SendDataRAW is called when not connected, improving error handling.

These changes enhance the protocol handling and error management in the Minecraft Console Client.
2026-03-26 02:35:43 +08:00
BruceChen
8456e363f5
TUI for MCC (#2976)
* feat: implement interactive TUI inventory viewer

- Added InventoryTui command to open an interactive terminal user interface for inventory management.
- Introduced InventoryApp and InventoryMainView classes for TUI layout and functionality.
- Created InventoryViewModel and SlotViewModel to manage inventory data and display.
- Integrated Consolonia for enhanced console UI experience.
- Updated McClient to support console message handling during TUI operation.

These changes enhance user interaction with inventory management in Minecraft Console Client.

* feat: enhance debugging workflow with mcc-debug.sh and TUI support

- Introduced mcc-debug.sh for streamlined one-step build, server start, and MCC launch.
- Added TUI mode for improved user experience during debugging sessions.
- Updated mcc-env.sh to include new debug helpers and TUI mode functionality.
- Enhanced SKILL.md with detailed instructions for using the new debugging tools and console modes.

These changes significantly improve the debugging process for Minecraft Console Client, making it more efficient and user-friendly.

* feat: introduce TUI console backend and related enhancements

- Added ClassicConsoleBackend and TuiConsoleBackend to support different console I/O modes.
- Implemented IConsoleBackend interface for better abstraction of console operations.
- Enhanced ConsoleIO to utilize the new backend structure for input and output handling.
- Introduced MainTuiView and MccTuiApp for a full-screen TUI experience using Avalonia.
- Updated InventoryTuiHost to manage TUI lifecycle and interactions.

These changes significantly improve the console experience in Minecraft Console Client, providing a more flexible and user-friendly interface.

* refactor: remove InventoryTui command implementation

- Deleted the InventoryTui class, which provided an interactive terminal user interface for inventory management.
- This change simplifies the command structure as part of ongoing improvements to the console experience in Minecraft Console Client.

The removal of this command is aligned with recent enhancements to the console backend and user interface.

* refactor: update InventoryMainView and MainTuiView for improved UI handling

- Changed several fields from readonly to mutable in InventoryMainView to allow for dynamic updates.
- Introduced a new McColorParser class for parsing Minecraft color codes and creating colored text blocks.
- Enhanced MainTuiView to support formatted log lines and improved notification handling.
- Updated chat scrolling behavior to ensure better user experience during text input and log display.

These changes streamline the UI components and enhance the overall console experience in Minecraft Console Client.

* feat: enhance command input handling in MainTuiView

- Updated command input to use event routing for better key handling.
- Added support for Ctrl key shortcuts to improve text manipulation (e.g., word deletion, caret movement).
- Implemented text cleaning on input change to prevent newline characters.
- Improved health and food status bar rendering with a new method for building bar text.

These changes significantly enhance the user experience in the TUI by providing more intuitive command input functionality.

* feat: enhance TUI command suggestion functionality

- Introduced a new CommandSuggestion struct for backend-independent suggestion handling.
- Updated ConsoleIO to streamline suggestion updates for both Classic and TUI backends.
- Enhanced MainTuiView to display command suggestions with improved visibility and interaction.
- Increased the maximum number of displayed suggestions from 6 to 10 for better user experience.

These changes significantly improve the command input experience in the TUI, making it more intuitive and user-friendly.

* feat: enhance offline command autocomplete functionality

- Introduced an OfflineAutocompleteHandler to provide command suggestions for offline commands.
- Added support for tab cycling through suggestions in the TUI.
- Improved command input handling to clear suggestions when necessary and manage user input more effectively.
- Updated TuiConsoleBackend to integrate with the new autocomplete feature.

These changes significantly enhance the user experience by making command input more intuitive and responsive in offline scenarios.

* feat: enhance localization and user feedback in TUI

- Updated various TUI components to utilize localized strings for improved user experience.
- Enhanced debug state output with translated labels for better clarity.
- Improved inventory command help messages with localized text.
- Added new translations for console mode descriptions and inventory viewer prompts.

These changes significantly enhance the usability and accessibility of the TUI in Minecraft Console Client, making it more user-friendly and informative.

* feat: enforce localization for user-facing strings in AGENTS.md

- Added guidelines to ensure all user-facing text, including log messages and error messages, is managed through the translation system.
- Specified the use of `Translations.resx` and `Translations.Designer.cs` for localization, emphasizing the importance of avoiding hardcoded strings in source code.

These changes improve the consistency and accessibility of user-facing content across the application.
2026-03-26 02:08:18 +08:00
copilot-swe-agent[bot]
d9f79bf512 fix: correct enchantment mapping typo messages
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/16e21ef0-6f09-4280-b539-8d704ddc3b67
2026-03-25 18:05:56 +00:00
copilot-swe-agent[bot]
a79373c713 refactor: make enchantment version buckets explicit
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/16e21ef0-6f09-4280-b539-8d704ddc3b67
2026-03-25 18:03:36 +00:00
copilot-swe-agent[bot]
71c01c739a refactor: simplify fallback enchantment reverse maps
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/16e21ef0-6f09-4280-b539-8d704ddc3b67
2026-03-25 18:02:12 +00:00
copilot-swe-agent[bot]
d4faea9ecc fix: add lunge enchantment mapping for 1.21.11
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/16e21ef0-6f09-4280-b539-8d704ddc3b67
2026-03-25 18:00:38 +00:00
copilot-swe-agent[bot]
a4ade66b8e fix: keep item classification ordering consistent
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/eb7f44aa-fc12-4c47-85ca-fe7ab80cfe30
2026-03-25 17:31:56 +00:00
copilot-swe-agent[bot]
69070f0157 fix: update manual item stack classifications
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/eb7f44aa-fc12-4c47-85ca-fe7ab80cfe30
2026-03-25 17:30:38 +00:00
copilot-swe-agent[bot]
d3c3e5a554 fix: add names for new enchantments
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/99915717-46df-4681-a568-5a9f0b244361
2026-03-25 17:21:17 +00:00
copilot-swe-agent[bot]
eeb4383099 Fix Roslyn compiler references for WebSocket/HttpListener and fix MCCScript using directive semicolons
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/6fa57d65-60be-4a4b-b15a-ad3541ac6de3
2026-03-25 14:32:39 +00:00
copilot-swe-agent[bot]
ed0a69185f Fix timing attack in password comparison using constant-time XOR
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/c762752f-46be-44f6-a05d-8c5effc8ef43
2026-03-25 13:57:34 +00:00
copilot-swe-agent[bot]
d5a9ae3deb Address code review feedback: fix password placeholder, IPv4 regex, and doc references
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/c762752f-46be-44f6-a05d-8c5effc8ef43
2026-03-25 13:54:04 +00:00
copilot-swe-agent[bot]
c8c9f9ada5 Add WebSocketBot as external MCCScript bot with string enum serialization (#2805)
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/c762752f-46be-44f6-a05d-8c5effc8ef43
2026-03-25 13:47:33 +00:00
copilot-swe-agent[bot]
7fca2acd24 Add WebSocketBot as external MCCScript bot with string enum serialization
Port the WebSocket bot functionality to an external standalone script that:
- Uses //MCCScript 1.0 format instead of being a built-in bot
- Uses System.Text.Json instead of Newtonsoft.Json (no external DLL)
- Serializes ItemType, EntityType, and other enums as string names
  instead of numeric IDs (addresses #2805)
- Adds GetItemTypeMappings and GetEntityTypeMappings commands
- Accepts both string names and numeric IDs for enum parameters
- Uses 4096 byte WebSocket buffer for better message handling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-25 13:42:01 +00:00
Anon
154778a488
bugfix: Fixed transfering breaking on multiple versions 2026-03-25 14:11:48 +01:00
Anon
41a1a1db9b Fixed transfering breaking on multiple versions 2026-03-25 14:05:43 +01:00
copilot-swe-agent[bot]
f405548529 Harden CLI setting value conversion error handling
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/d53ef12a-695a-4687-bb53-f467c7121aea
2026-03-25 12:47:12 +00:00
copilot-swe-agent[bot]
87593b17b9 Implement CLI --section.setting=value overrides in Settings.LoadArguments
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/d53ef12a-695a-4687-bb53-f467c7121aea
2026-03-25 12:30:24 +00:00
Anon
52eda4ccdd
bugfix: Fixed more components on 1.21.5, 1.21.11 and 26.1 and crashing on 1.21.8 2026-03-25 12:50:10 +01:00
Anon
2f40cc1538 More component updates and fixes for 1.21.5, 1.21.11 and 26.1 2026-03-25 12:46:43 +01:00
copilot-swe-agent[bot]
5c9319c10d Fix AutoRelog not triggering when initial TCP connection fails (server offline)
When AutoRelog was enabled and the server was offline (SocketException during
initial connection), AutoRelog's reconnection logic was never invoked. The
Retry block's else branch either called HandleFailure() without a disconnect
reason (so AutoRelog.OnDisconnectStatic was skipped) or did nothing at all.

Now the else branch directly calls AutoRelog.OnDisconnectStatic with the
standard "Connection has been lost" message (matching the default
Kick_Messages), ensuring reconnection is properly triggered.

Fixes MCCTeam/Minecraft-Console-Client#2781

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/30698499-fdeb-44ce-9552-a64c4c5fb62b
2026-03-25 10:43:50 +00:00
copilot-swe-agent[bot]
7e9be430db Merge remote-tracking branch 'origin/master' into copilot/reimplement-chat-formatting-feature
# Conflicts:
#	MinecraftClient/Protocol/Message/ChatParser.cs
2026-03-25 10:05:37 +00:00
Anon
c43b157b55 More fixed for 1.21.5, 1.21.9, 1.21.11, stress tested against everything from 1.20.6 - 1.21.11 2026-03-25 02:08:59 +01:00
Anon
17808bb652 Fixed the component system from 1.20.6 - 1.21.11 2026-03-25 01:08:27 +01:00
copilot-swe-agent[bot]
6c70685d52 Changes before error encountered
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/e56a9086-4921-4504-ab06-ebb912cf52ce
2026-03-24 21:11:43 +00:00
Anon
6f30f9b79a
bugfix: Fixed Web Requests in Chat Bots and a sample script 2026-03-24 21:21:53 +01:00
Anon
699b2cad6b
bugfix: Fixed scoreboard command crashing the client on 1.20.4 2026-03-24 21:20:14 +01:00
copilot-swe-agent[bot]
3fb7625b39 Add chat formatting code propagation (bold, italic, underline, strikethrough, obfuscated)
Re-implements PR #2851 against the current System.Text.Json.Nodes codebase.

Changes:
- ChatParser.cs: Add FormattingCodes dict, update JSONData2String to propagate
  formatting codes alongside colors, update NbtToString for the NBT chat path
  (used in MC 1.20.4+), fix root-string shortcut to preserve formatting prefix
- DiscordBridge.cs: Add GetDiscordText() converting § codes to Discord Markdown,
  handle unclosed formatting codes with end-of-string matching

End-to-end tested against Minecraft 1.21.11 (MC 26.1) offline server.
All 8 formatting types verified: bold(§l), italic(§o), strikethrough(§m),
underline(§n), combined, nested, reset-via-false, obfuscated(§k).

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/65b0d230-287c-4ed8-9b3c-a5ea25411804
2026-03-24 20:18:53 +00:00
copilot-swe-agent[bot]
8ab9f8505f Fix crash when scoreboard is updated on MC 1.20.4+
ChatParser.NbtToString crashed with InvalidCastException when a scoreboard
update was received. The switch expressions for extra/with NBT arrays only
handled int and string; everything else fell through to a hard cast to
Dictionary<string,object>, which fails for long/short/byte/float/double.

Replace with a pattern that explicitly matches string and Dictionary, and
converts all other values (any numeric NBT type) to a text component via
ToString(). This matches the behavior that ReadNbtField can return for
TAG_Byte, TAG_Short, TAG_Int, TAG_Long, TAG_Float, and TAG_Double.

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/44b66082-14ee-4966-9c23-4074134e0187
2026-03-24 19:58:58 +00:00
copilot-swe-agent[bot]
461be9f368 docs: clarify players app var behavior
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/c9f7aa87-50b7-4725-aa39-613eba1a07fd
2026-03-24 19:51:46 +00:00