Blade Bot

this is mod : https://modrinth.com/mod/gtp?loader=fabric&version=26.2#download

📎 1 file 3,139 chars
📄
pasted-code-1792222680059.txt
txt 37 lines
▶
Develop a Minecraft Fabric mod named **Jijikka** for Minecraft **26.1, 26.2, and 26.3**, using Java and compatible Fabric APIs.

**Core concept:** A GTA V-style character-switching system for single-player worlds, allowing the player to control 1 of 3 characters while preserving the other characters' states.

### Features

1. **Three characters:** Create 3 independent characters with configurable names, positions, rotations, inventories, armor, health, hunger, XP, and game states.
2. **Switch key:** Press `J` to open a GTA-style character-selection GUI displaying each character's name, skin, location, and status. Select a character to switch control with cinematic transitions.
3. **Character persistence:** Save each character's state independently and restore it after switching, world reloads, or game restarts.
4. **Inactive characters:** Keep characters at their last positions with their inventories and states preserved. Implement optional simulation for inactive characters where technically possible.
5. **AFK/farms:** Support separate AFK locations. Investigate chunk loading and ticking limitations; never falsely claim farms will operate when chunks are not simulated.
6. **Settings:** Allow editing character names, keybinds, transition effects, and simulation options.
7. **GUI:** Create a polished, Minecraft-themed interface with smooth animations, character previews, and clear active/inactive indicators.
8. **Safety:** Prevent duplicated items, lost inventories, corrupted saves, and accidental state overwrites. Support existing worlds without damaging them.

### Technical requirements

* Use Fabric, Java, Gradle, and compatible Minecraft/Fabric APIs.
* Keep the architecture modular and maintainable.
* Store character data safely in world-specific persistent storage.
* Implement proper initialization, cleanup, error handling, and version compatibility.
* Do not simply change usernames or pretend extra player entities are genuine independent players.
* For single-player, implement three locally managed character states/entities as appropriate. Explain any limitations involving real player behavior, AI, chunk simulation, and farm mechanics.
* Do not use unsupported or invented APIs. Verify actual mappings and dependencies for each target version.

### Development plan

1. Inspect the target versions and choose compatible dependencies.
2. Build the core mod and character-state manager.
3. Implement three independent inventories and character states.
4. Add the `J` keybind, selector GUI, and switching transitions.
5. Implement persistence and inactive-character behavior.
6. Test switching, death, inventory changes, world reloads, and save integrity.
7. Build and validate separate JARs for Minecraft 26.1, 26.2, and 26.3.

**Deliverables:** Complete source code, Gradle configuration, installation instructions, README, and tested JARs for each supported version. Prioritize a working, compilable implementation over placeholder code. If a feature is impossible with the client-only architecture, explain why and implement the closest reliable alternative.
Kodari AI
KodariOct 17 at 7:55 am 4
Jijikka
Jijikka is a Minecraft Fabric mod for versions 26.1, 26.2, and 26.3 that introduces a GTA V-style character-switching system for single-player worlds. Players can create and manage three independent characters, each with their own name, position, rotation, inventory, armor, health, hunger, XP, and game state. Press the J key to open a polished, Minecraft-themed selection GUI with cinematic transitions, character previews, and active/inactive indicators. Character states are persistently saved to world-specific storage, surviving world reloads and game restarts. Inactive characters remain at their last positions with preserved inventories and states, with optional simulation where technically feasible. The mod includes configurable settings for names, keybinds, transition effects, and simulation options, while ensuring data safety through careful save management and compatibility with existing worlds.
  1. Create a Fabric 26.2 project with durable, world-specific character snapshots.

  2. Add the J keybind, owo character selector, and safe switching behavior.

  3. Include setup notes and clearly document simulation/version limits.

Created Jijikka as a Fabric client mod targeting Minecraft 26.2.

  • Character switching: Press J for an owo-ui selector with three editable names, skin previews, locations, levels, and active-state indicators. Switching saves inventory, armor, offhand, health, hunger, XP, position, rotation, and dimension for the one real player.

  • Persistence and safety: Character data is stored per world in jijikka/characters.json. Writes use a temporary file and atomic replacement; interrupted switches are recovered rather than silently replacing the save with defaults.

  • Limits: This project supports 26.2 only; separate, source-verified 26.1 and 26.3 builds were not created. Inactive characters are saved states, not simulated players: they have no AI, and their locations do not keep chunks ticking or farms running. The selector keeps the world running while open. The handoff is brief, not a camera cutscene; profiles also share the account’s skin and do not store effects, attributes, or game mode.

  • Install/build: The project includes Gradle configuration and a README. In Kodari, click Compile in the top bar (phone: ⋮ → Compile Project), click Compile in the window, then Download after it succeeds. No separate tested jars for all three requested versions are included.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
README.md
settings.gradle
Code
12 1,005
src/client/java/com/kodari/jijikka/JijikkaClient.java
package com.kodari.jijikka;

import com.mojang.blaze3d.platform.InputConstants;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.Identifier;
import net.minecraft.server.MinecraftServer;

import java.util.List;
import java.util.UUID;

public final class JijikkaClient implements ClientModInitializer {
	private static final KeyMapping OPEN_SELECTOR = KeyMappingHelper.registerKeyMapping(new KeyMapping(
			"key.jijikka.open_selector",
			InputConstants.Type.KEYSYM,
			InputConstants.KEY_J,
			KeyMapping.Category.register(Identifier.fromNamespaceAndPath("jijikka", "controls"))
	));

	private static volatile Boolean operationResult;
	private static int ticks;

	@Override
	public void onInitializeClient() {
		ClientTickEvents.END_CLIENT_TICK.register(client -> {
			MinecraftServer server = client.getSingleplayerServer();
			if (server == null || client.player == null) {
				ticks = 0;
				while (OPEN_SELECTOR.consumeClick()) {
				}
				return;
			}

			UUID playerId = client.player.getUUID();
			if (++ticks >= 20) {
				ticks = 0;
				server.execute(() -> CharacterManager.INSTANCE.maintain(server, playerId));
			}
			while (OPEN_SELECTOR.consumeClick()) {
				client.gui.setScreen(new CharacterSelectorScreen());
			}
		});
	}

	static boolean requestSwitch(int index, String name) {
		Minecraft client = Minecraft.getInstance();
		MinecraftServer server = client.getSingleplayerServer();
		if (server == null || client.player == null) {
			return false;
		}
		UUID playerId = client.player.getUUID();
		operationResult = null;
		server.execute(() -> operationResult = CharacterManager.INSTANCE.switchTo(server, playerId, index, name));
		return true;
	}

	static boolean requestSaveNames(List<String> names) {
		Minecraft client = Minecraft.getInstance();
		MinecraftServer server = client.getSingleplayerServer();
		if (server == null || client.player == null) {
			return false;
		}
		UUID playerId = client.player.getUUID();
		List<String> copy = List.copyOf(names);
		operationResult = null;
		server.execute(() -> operationResult = CharacterManager.INSTANCE.saveNames(server, playerId, copy));
		return true;
	}

	static Boolean takeOperationResult() {
		Boolean result = operationResult;
		operationResult = null;
		return result;
	}
}