toxyt69

ou are an expert Minecraft Mod Developer specializing in Fabric API for version 1.21.x. Your task is to design and generate code for a mod named "Autowork" (also known as "AutoBeam").

Mod Overview

  • Name: Autowork by TOX
  • Version: 1.21.x
  • Loader: Fabric
  • Type: Utility/Automation Mod

Core Features & Logic

1. Keybinding System

  • Implement a customizable keybinding via FabricKeyBinding or standard Minecraft keybind registry.
  • The key should open the main GUI when pressed.
  • Optional: Add a secondary keybind for quick-toggling specific features if needed.

2. Main GUI Interface

Create a simple custom screen (using Screen class) with the following controls:

  • Toggle Switches:

- AutoAI Chat: ON/OFF toggle. - AutoActions: ON/OFF toggle.

  • Status Indicator: Show current state (Active/Inactive).
  • Settings Button: To configure keybinds or other options.

3. Feature: AutoAI Chat

  • Trigger: When enabled, the mod detects when the player is looking at another entity (player/NPC).
  • Logic:

1. Detect target entity within render distance. 2. Send a pre-defined message from the user's input list. 3. Simulate typing delay to appear human-like. 4. Wait for response (optional advanced feature, but basic version just sends messages).

  • Customization: Allow users to add multiple chat messages in settings.

4. Feature: AutoActions (Automation)

  • Trigger: When enabled, perform a sequence of actions on a targeted block or entity.
  • Sequence:

1. Right Click: Interact with the target (e.g., open a door, use an item, activate a beam). 2. Crouch: Press 'Sneak' key immediately after interaction. 3. Loop: Repeat this sequence at a configurable interval (e.g., every 1-5 seconds).

  • Targeting: Use Raycast to find the block/entity the player is looking at.

Technical Requirements for Fabric 1.21.x

  • Use net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper for keybindings.
  • Use ScreenHandler and Container logic if building complex GUIs, otherwise stick to simple Screen overrides.
  • Use ClientPlayerInteractionManager for right-click actions.
  • Use Input class to simulate key presses (like Sneak/Crouch) using KeyboardInput or AbstractClientPlayerEntity.
  • Ensure all client-side logic is properly registered in ClientModInitializer.

Code Structure

Provide the following files:

  1. AutoworkMod.java (Main entry point implementing ClientModInitializer)
  2. Keybinds.java (Register keybinds)
  3. AutoworkScreen.java (The GUI)
  4. AutoTaskScheduler.java (Handles the timing for Chat and Actions)
  5. Mixin classes if necessary for injecting into client methods.

Tone

  • Professional, clean code.
  • Add comments explaining each section.
  • Ensure compatibility with Fabric API latest version for 1.21.x.

```

Kodari AI
KodariOct 12 at 2:07 am 3
Autowork
Autowork is a client-side Fabric utility mod for Minecraft 1.21 that automates repetitive tasks. It features a customizable keybinding to open a GUI with toggles for AutoAI Chat and AutoActions. AutoAI Chat detects entities in view and sends configurable messages with human-like delays. AutoActions performs automated right-click interactions followed by crouch presses on targeted blocks or entities at configurable intervals. The mod includes a scheduler for precise timing and uses raycasting for target detection.
  1. Set up the client entrypoint and registered keybinds.

  2. Build the main controls with owo-ui.

  3. Add configurable chat messages and a rate-limited tick scheduler for targeting and actions.

  4. Add Fabric metadata and resources.

Initialized Autowork by TOX as a client-only Fabric 1.21.11 project.

  • Press B to open the owo-ui dashboard; the key can be rebound under Controls → Key Binds.

  • The dashboard includes AutoAI Chat and AutoActions toggles, status, editable chat messages, and a 1–5 second action interval. Settings are saved in config/autowork.properties.

  • AutoAI Chat targets the living entity under the crosshair, waits a message-length-based delay, and applies a 60-second global cooldown. AutoActions interacts with the targeted block or entity, then briefly crouches and repeats at the configured interval. Automation pauses while a screen is open.

  • Added the Fabric/Loom project files and the required owo-lib bundle manifest. No custom items or mixins are needed.

Compilation wasn’t run here.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
11 557
src/client/java/com/tox/autowork/AutoworkMod.java
package com.tox.autowork;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

public class AutoworkMod implements ClientModInitializer {
    public static final String MOD_ID = "autowork";

    @Override
    public void onInitializeClient() {
        AutoworkSettings.load();
        Keybinds.initialize();
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            if (Keybinds.OPEN_GUI.wasPressed())
                client.setScreen(new AutoworkScreen());

            AutoTaskScheduler.tick(client);
        });
    }
}