📎
1 file
11,791 chars
📄
pasted-code-1794031168797.txt
txt
413 lines
▶
pasted-code-1794031168797.txt
txt
413 lines
# ROOTBOUND: FOUNDATION SYSTEM
## First-Join Onboarding, Floating Python IDE & Coding Leaderboard
**Project:** Rootbound
**Minecraft:** Java 1.21.5
**Mod loader:** Fabric
**Java:** 21
Build the foundation of Rootbound, a Minecraft survival mod where players learn real Python programming through gameplay.
This task focuses on three essential systems:
1. First-join onboarding questionnaire.
2. A fully functional, floating Minecraft-styled Python IDE.
3. A coding leaderboard and player statistics system.
These must be working features integrated into Minecraft, not mockups or placeholder interfaces.
---
# 1. FIRST JOIN: STARTING TERRITORY
When a player enters a world for the first time with Rootbound installed:
- Detect and save the original world spawn coordinates.
- Set the Minecraft world border to exactly 15 × 15 blocks.
- Center it on the original world spawn.
- Use Minecraft's normal world-border visuals.
- Save the initial border configuration permanently.
- Do not reset the border when the player rejoins.
- Preserve all existing terrain, structures and world data.
Normal Minecraft survival must remain completely functional.
Players can walk, sprint, jump, mine, build, explore, fight mobs, craft and use their inventory without writing Python.
**Multiplayer requirement:** Minecraft's native world border is shared across a world. Do not pretend it is independently applied to each player. Handle multiplayer configuration honestly and use server-side validation.
---
# 2. FIRST-JOIN ONBOARDING QUESTIONNAIRE
When a player joins for the first time, show an interactive onboarding interface.
The design should combine Minecraft's visual style with the progression and friendly questionnaire experience of Duolingo.
Do not copy Duolingo branding.
## Visual design
- Minecraft pixel-style typography.
- Minecraft-inspired buttons and rectangular panels.
- Grass, dirt, stone, emerald green and sky-blue colours.
- Pixel-art icons and subtle animations.
- Clear progress bar.
- Minecraft-style selection boxes.
- Smooth transitions between questions.
It must feel like a polished Minecraft menu, not a website or generic mobile app.
## Questionnaire
Show one question at a time.
**Question 1: How much Python do you know?**
- I've never coded before.
- I know a few basics.
- I understand variables, loops and conditions.
- I'm comfortable writing Python.
- I'm already an advanced Python programmer.
**Question 2: How much time are you willing to dedicate to learning and coding?**
- 5 minutes a day.
- 10–15 minutes a day.
- 20–30 minutes a day.
- Around an hour a day.
- It depends on my schedule.
This is a preference, not a compulsory daily commitment.
**Question 3: What interests you most?**
- Automating Minecraft tasks.
- Learning Python from scratch.
- Building complicated systems.
- Solving programming challenges.
- A combination of everything.
**Question 4: How would you like to learn?**
- Step-by-step explanations.
- Hints when I get stuck.
- Minimal guidance and more challenges.
- Let me choose depending on the lesson.
**Question 5: What difficulty do you prefer?**
- Relaxed.
- Balanced.
- Challenging.
- Adaptive difficulty.
## Questionnaire behaviour
- One question per screen.
- Selectable answers.
- Back and Continue buttons.
- Visible progress indicator.
- Allow players to skip the questionnaire.
- Allow players to edit their answers later.
- Save answers permanently.
- Do not ask for real-world personal information.
Use the answers to personalize lesson recommendations, hints, difficulty and suggested coding activities.
Do not punish players for choosing less time or having no previous programming experience.
At the end, show a Minecraft-styled welcome screen with a summary of their learning preferences.
---
# 3. THE FLOATING PYTHON IDE
This is one of the most important features in Rootbound.
Create a fully functional, floating Python IDE inside Minecraft.
The design should be inspired by Visual Studio Code, but redesigned to fit Minecraft's visual identity.
It must be a real code editor, not a fake terminal or a static interface.
## Opening the IDE
- Add a configurable keybind to open and close the IDE.
- The IDE should appear as a floating window over the Minecraft world.
- It should not force the player into a separate menu screen.
- The player should be able to move, resize, minimize, maximize and drag the IDE window.
- Allow the player to reposition it anywhere on the screen.
- Remember its position and size.
- Include a clean close button.
- Allow the player to reopen it without losing their scripts.
## IDE appearance
Create a modern Minecraft-inspired VS Code interface.
Use:
- Dark charcoal background.
- Minecraft-inspired purple, blue and green accents.
- Pixel-inspired interface details.
- Readable programming fonts.
- Syntax highlighting.
- Line numbers.
- Indentation guides.
- Code editor tabs.
- A file explorer sidebar.
- A bottom output panel.
- A status bar.
Avoid DOS-style interfaces, old terminal designs and generic HTML-looking forms.
The interface should feel like a modern desktop IDE that happens to exist inside Minecraft.
## Essential editor functionality
Implement:
- Actual text input and editing.
- Syntax highlighting for Python.
- Line numbers.
- Automatic indentation.
- Bracket matching.
- Code suggestions and autocomplete.
- Multiple script tabs.
- Create, open, rename and delete scripts.
- Save and autosave.
- Undo and redo.
- Find and replace.
- Run script.
- Stop script.
- Clear output.
- Display Python errors with line numbers.
- Explain errors in beginner-friendly language.
The editor must support typing actual Python code.
## IDE layout
Include these panels:
**Explorer**
- Saved scripts.
- Script folders.
- Create new file.
- Rename and delete files.
**Editor**
- Main Python code editor.
- Syntax highlighting.
- Multiple tabs.
- Line numbers.
- Autocomplete.
**Output**
- Display print() output.
- Display execution status.
- Show errors and warnings.
- Show execution time.
**Rootbound sidebar**
- Current lesson.
- Current quest.
- Python API reference.
- Player XP and level.
- Coding statistics.
Allow panels to be resized or collapsed.
## Python execution
Use a genuine Python interpreter integrated with the Java mod.
Investigate GraalPy compatibility with Java 21 and Fabric. If unsuitable, evaluate another genuine Python runtime and document the trade-offs.
Do not create a fake Python interpreter or a Python-like custom language.
The editor must eventually execute real Python scripts and connect them to actual Minecraft gameplay APIs.
For the foundation stage, establish the editor, file management, interpreter integration and execution architecture. If Minecraft API functions are not implemented yet, clearly label them as unavailable rather than pretending they work.
## Script safety
Python scripts must run in a restricted environment.
- No unrestricted operating-system access.
- No arbitrary shell execution.
- No unrestricted filesystem access.
- No unrestricted network access.
- No access to unrelated processes.
- Execution time and memory limits.
- A working stop mechanism.
- Server-side validation in multiplayer.
- Restrict scripts to approved Rootbound APIs.
Do not rely only on blocking Python imports as a security measure.
---
# 4. PLAYER PROFILE & CODING STATISTICS
Every player should have a persistent Rootbound profile.
Track:
- Minecraft username.
- Python experience level.
- Rootbound level.
- Total Rootbound XP.
- Total time spent coding.
- Number of scripts created.
- Number of scripts successfully executed.
- Number of coding challenges completed.
- Lessons completed.
- Current learning streak.
- Achievements unlocked.
Display these statistics in a Minecraft-styled player profile.
## Coding time tracking
Track actual time spent actively using the IDE.
Rules:
- Start counting when the player actively uses the editor.
- Pause when the player is AFK or the IDE is inactive for a configurable period.
- Stop counting when the IDE is closed or the game exits.
- Do not count idle time as coding time.
- Persist statistics across sessions.
- Avoid counting the same session twice.
Display both daily and lifetime coding time.
---
# 5. ROOTBOUND LEADERBOARD
Create a proper leaderboard that displays player coding progress.
The leaderboard should look like a Minecraft statistics board.
## Leaderboard columns
- Rank.
- Minecraft username.
- Rootbound level.
- Total coding time.
- Total XP.
- Scripts executed.
- Challenges completed.
## Leaderboard categories
Allow players to switch between:
- Overall leaderboard.
- Most coding time.
- Highest Rootbound XP.
- Most challenges completed.
- Weekly leaderboard.
- Daily leaderboard.
## Visual presentation
Use:
- Minecraft-style panels.
- Player usernames.
- Rank numbers.
- Pixel-art medals.
- Gold, silver and bronze accents for the top three.
- Clearly readable statistics.
- Searchable player list.
- Pagination for large leaderboards.
Do not make the leaderboard depend only on coding time. Reward learning, completing challenges and writing working code too.
## Multiplayer and data integrity
- Use Minecraft usernames or authenticated player UUIDs.
- Store statistics reliably.
- Validate leaderboard submissions server-side.
- Prevent duplicate or fabricated statistics.
- Do not trust client-reported coding time or XP.
- Keep singleplayer statistics locally.
- Make multiplayer leaderboards server-controlled.
- Do not transmit personal information beyond the Minecraft identity and gameplay statistics needed for the leaderboard.
---
# 6. PERSISTENCE
All foundation data must survive closing Minecraft and reopening the world.
Save:
- Original spawn position.
- Initial world-border configuration.
- Onboarding completion status.
- Questionnaire answers.
- Player profile.
- Coding time.
- XP and level.
- Script files.
- Editor settings.
- IDE position and size.
- Leaderboard statistics.
- Achievements.
Use appropriate world data, player data and configuration storage.
Avoid corrupting existing Minecraft saves.
---
# 7. IMPLEMENTATION REQUIREMENTS
Build this in stages.
**Stage 1:** First-join detection, spawn recording and 15 × 15 world border.
**Stage 2:** Onboarding questionnaire and persistent player preferences.
**Stage 3:** Floating Minecraft-styled IDE window and actual text editor.
**Stage 4:** Script management, syntax highlighting and editor functionality.
**Stage 5:** Genuine Python interpreter integration and execution controls.
**Stage 6:** Player profile and accurate coding-time tracking.
**Stage 7:** Persistent leaderboard with server-side validation.
After each stage:
- Compile the mod.
- Fix all compilation errors.
- Test the feature in Minecraft.
- Check that existing features still work.
- Do not leave placeholder buttons.
- Do not claim unfinished functionality is complete.
Prioritize performance on low-end computers. Avoid unnecessarily heavy rendering, background tasks and excessive memory usage.
## FINAL REQUIREMENT
The result must be a functional foundation for Rootbound.
A player should be able to:
1. Join a normal Minecraft world.
2. Start inside a 15 × 15 territory.
3. Complete or skip the onboarding questionnaire.
4. Open a floating Minecraft-themed Python IDE.
5. Type and save real Python code.
6. Execute code through the genuine Python runtime once integrated.
7. View their coding statistics.
8. Compare their progress on the leaderboard.
Do not build the entire future progression system yet. Make these foundation systems reliable, polished and extensible so future lessons, Minecraft automation APIs, quests, XP rewards and boss challenges can integrate into them.
KodariNov 7 at 6:00 am 1
RootboundFoundation
Builds the foundation of Rootbound, a Minecraft Fabric mod teaching Python programming. Implements first-join detection with a 15x15 world border centered on spawn, a Duolingo-inspired onboarding questionnaire with persistent player preferences, a floating Minecraft-styled Python IDE with syntax highlighting and file management, genuine Python interpreter integration via GraalPy, player coding statistics tracking, and a server-validated leaderboard. All data persists across sessions.
This project is a Fabric 1.21.4 mod, but Rootbound is specified for Fabric 1.21.5, which Kodari doesn’t have. The closest options are Fabric 1.21.4 and 1.21.11.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code