Osama Fostok
๐Ÿ“Ž 1 file 6,838 chars
๐Ÿ“„
pasted-code-1794959165484.txt
txt 225 lines
โ–ถ
# PROJECT: Dynamic Player Face Plate
## Minecraft Java 1.21.11 | Fabric Mod

You are an expert Minecraft Fabric mod developer. I want you to develop a complete, working Minecraft mod from scratch.

Do not just explain how to make it. Actually create the complete project, write all source code, configure all dependencies, build it, test it, and provide the finished ZIP file.

# 1. Main Idea

I want to replace the visual appearance of Minecraft Player Heads with a custom 16ร—16 plate texture.

The plate should display the actual Minecraft player's face based on the username entered when renaming the Player Head in an anvil.

Example:

1. Obtain a Player Head.
2. Put it inside an anvil.
3. Rename it to `Notch`.
4. The mod automatically identifies the Minecraft username.
5. It retrieves Notch's actual Minecraft skin.
6. It extracts the player's face, including the outer skin layer (hat, hair, etc.).
7. It displays the face as a layer on top of the custom plate texture.

This must work with ANY valid Minecraft Java username, not just predefined usernames.

# 2. Technical Specifications

- Minecraft Java Edition: 1.21.11
- Mod loader: Fabric
- Use Java.
- Use Fabric API.
- Use the correct Minecraft 1.21.11 mappings and dependencies.
- Include a complete Gradle build configuration.
- Make the mod compatible with the correct Java runtime required by Minecraft 1.21.11.

# 3. Item Behavior

The item must remain a normal Minecraft Player Head internally.

Do not replace the actual item with a custom unrelated item.

Requirements:

- Preserve normal item functionality.
- Preserve inventory behavior.
- Preserve item naming.
- Preserve anvil functionality.
- Preserve item stacking behavior where possible.
- Only change the visual appearance.

# 4. Dynamic Username Detection

The most important feature is detecting the custom name entered in the anvil.

For example:

Input name: `Dream`

The mod should:
- Read the custom item name.
- Validate whether it is a Minecraft username.
- Resolve the username to its official Minecraft profile.
- Retrieve the player's skin texture.
- Cache the skin locally.
- Extract the face texture.
- Include the outer skin layer.
- Render the result on the plate.

This must work for different usernames without requiring the user to manually add skins.

Do not assume that a resource pack can automatically retrieve arbitrary player skins from anvil names. Implement the necessary mod functionality.

# 5. Texture Design

Create a custom 16ร—16 plate texture from scratch.

The design must:
- Be pixel art.
- Be suitable for Minecraft's original texture style.
- Have a clean, recognizable plate appearance.
- Display the player's face as an overlay.
- Preserve the plate underneath the face.
- Include the outer skin layer when available.
- Avoid displaying the entire player head model.
- Avoid displaying a 3D player head.

The result should look like a flat custom plate with the player's actual face printed or layered onto it.

Create the necessary PNG textures yourself.

# 6. Rendering

Implement proper Minecraft item rendering.

The appearance should update automatically when the item's custom name changes.

Requirements:
- Render correctly in the inventory.
- Render correctly in the hotbar.
- Render correctly when held.
- Render correctly when dropped.
- Render correctly in item frames where possible.
- Avoid changing the appearance of unrelated items.
- Avoid rendering glitches and incorrect texture scaling.

The player's face must be correctly cropped from the Minecraft skin texture.

Support both classic and slim player skin models.

# 7. Skin Resolution

Use official Minecraft profile and skin resolution mechanisms wherever possible.

Important:
- Do not rely on unofficial skin websites as the primary source.
- Handle usernames that do not exist.
- Handle players without available skins.
- Handle network failures.
- Avoid freezing the game while downloading skins.
- Cache downloaded skins.
- Avoid repeatedly downloading the same skin.
- Refresh cached skins when appropriate.

# 8. Multiplayer Compatibility

Explain and implement the correct architecture for multiplayer.

If the feature requires server-side processing, implement the necessary server component.

If the client can perform profile resolution independently, explain its limitations.

Do not falsely claim that arbitrary renamed heads will work on every multiplayer server without the required support.

# 9. User Experience

The mod should require as little configuration as possible.

Expected workflow:

1. Install the mod.
2. Launch Minecraft.
3. Obtain a Player Head.
4. Rename it in an anvil to any valid Minecraft username.
5. The plate automatically displays that player's skin face.

No manual texture editing should be required.

# 10. Error Handling

Implement sensible fallbacks.

Examples:
- Invalid username: display the default plate.
- Username not found: display the default plate.
- Skin unavailable: display the default plate.
- Internet unavailable: use cached skin if available.
- Skin loading: display a temporary default texture.

Never crash Minecraft because a skin cannot be retrieved.

# 11. Project Structure

Create a complete, organized project containing:

- build.gradle
- settings.gradle
- gradle.properties
- Fabric mod metadata
- Java source files
- Client rendering code
- Skin/profile resolution code
- Skin cache system
- Texture PNG files
- Any required mixins
- README.md
- Installation instructions
- Build instructions

Include the Gradle wrapper if possible.

# 12. Testing

Before delivering the project:

- Compile the mod.
- Fix all compilation errors.
- Check Minecraft 1.21.11 compatibility.
- Check Fabric compatibility.
- Test invalid usernames.
- Test valid usernames.
- Test skin loading and caching.
- Test renamed Player Heads.
- Test classic and slim skins.
- Test that unrelated items remain unchanged.

Do not leave unfinished methods, placeholder implementations, fake functionality, or TODO comments for essential features.

# 13. Final Deliverables

I want:

1. A complete source-code ZIP.
2. A compiled Fabric mod JAR.
3. A README explaining installation.
4. A list of required dependencies.
5. Instructions for installing it into the Minecraft mods folder.
6. A clear explanation of multiplayer requirements.

The final project must be usable, not just a demonstration.

# IMPORTANT

Do not simplify the project into a normal resource pack.

Do not use predefined player names.

Do not require me to manually create a texture for every player.

Do not display a normal Minecraft Player Head.

Do not display a 3D head.

The goal is a dynamic 16ร—16 plate that automatically displays the actual face and outer skin layer of whichever valid Minecraft username I enter in the anvil.

Build the complete working project from scratch.
Kodari AI
KodariTue at 11:59 pm 5
DynamicPlayerFacePlate
Dynamically renders a custom 16x16 plate texture with the actual Minecraft player's face (including outer skin layer) onto renamed Player Heads in anvil. Resolves usernames via Mojang API, caches skins locally, supports classic and slim models, and falls back to default plate on errors. Client-side rendering with async skin loading, preserving vanilla item behavior.

Created the 16ร—16 plate texture, but the mod is not yet implemented or usable. Skin resolution, caching, rendering, project configuration and testing remain unfinished; no source ZIP or compiled JAR is available.

Kodari can make mistakes. Review important code before using.
Files
src
Code
1 0