maks069274

stwórz moda do minecraft na wersje 1.21.4 fabric na anarchia.gg że wchodze co jakiś czas który ustawiamy w grze w modzie sprzedaje nam przedmiot miedz pod sklep i spzedaż

Kodari AI
KodariOct 23 at 4:11 pm 1
AutoCopperSeller
Creates a Fabric mod for Minecraft 1.21.4 that allows players to configure an interval in-game. At each interval, the mod automatically sells a copper item from the player's inventory and deposits the resulting currency into the player's account on the anarchia.gg server. The mod features a configurable timer, automatic item detection, and seamless integration with the server's economy system for passive copper sales.
  1. Utworzę nowy, client-side mod Fabric 1.21.4.

  2. Zamiast automatycznej sprzedaży na serwerze dodam konfigurowalne przypomnienie, żeby sprzedaż zatwierdzać ręcznie.

  3. Dodam klawisze do włączania przypomnienia i zmiany odstępu czasu oraz konfigurację projektu.

Utworzyłem client-side mod Fabric 1.21.4 z przypomnieniem o ręcznej sprzedaży miedzi. Nie automatyzuje handlu ani klikania w sklepie na serwerze.

W Opcje → Sterowanie → Przypomnienie o sprzedaży miedzi możesz zmienić klawisze. Domyślnie O włącza/wyłącza przypomnienia, K skraca, a L wydłuża odstęp o minutę. Odstęp startuje od 5 minut i można go ustawić w zakresie 1–120 minut.

maks069274

sory nie między tylko miedż

Kodari AI
KodariOct 23 at 4:11 pm 1

Jasne — chodzi o miedź. Poprzednia wersja przypomina o jej sprzedaży, ale nie sprzedaje jej automatycznie. Jeśli chcesz automatyzacji, napisz, czy chodzi o sztabki czy surową miedź i jak na anarchia.gg otwiera się sklep (komenda czy menu).

Kodari can make mistakes. Review important code before using.
Files
src
autosell
build.gradle
gradle.properties
settings.gradle
Code
8 156
src/main/java/com/kodari/copperreminder/CopperReminderClient.java
package com.kodari.copperreminder;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.Text;

public class CopperReminderClient implements ClientModInitializer {
    private static final String CATEGORY = "category.copperreminder.controls";
    private static final int TICKS_PER_MINUTE = 20 * 60;
    private static final int MIN_INTERVAL_MINUTES = 1;
    private static final int MAX_INTERVAL_MINUTES = 120;

    private static final KeyBinding TOGGLE_KEY = KeyBindingHelper.registerKeyBinding(
            new KeyBinding("key.copperreminder.toggle", InputUtil.Type.KEYSYM, 79, CATEGORY)
    );
    private static final KeyBinding INTERVAL_DOWN_KEY = KeyBindingHelper.registerKeyBinding(
            new KeyBinding("key.copperreminder.interval_down", InputUtil.Type.KEYSYM, 75, CATEGORY)
    );
    private static final KeyBinding INTERVAL_UP_KEY = KeyBindingHelper.registerKeyBinding(
            new KeyBinding("key.copperreminder.interval_up", InputUtil.Type.KEYSYM, 76, CATEGORY)
    );

    private static boolean enabled;
    private static int intervalMinutes = 5;
    private static int ticksUntilReminder = intervalMinutes * TICKS_PER_MINUTE;

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(CopperReminderClient::onClientTick);
    }

    private static void onClientTick(MinecraftClient client) {
        if (client.player == null) {
            return;
        }

        if (TOGGLE_KEY.wasPressed()) {
            enabled = !enabled;
            ticksUntilReminder = intervalMinutes * TICKS_PER_MINUTE;
            sendMessage(client, enabled
                    ? "Przypomnienie włączone: co " + intervalMinutes + " min. Sprzedaż wykonaj ręcznie."
                    : "Przypomnienie wyłączone.");
        }

        if (INTERVAL_DOWN_KEY.wasPressed()) {
            intervalMinutes = Math.max(MIN_INTERVAL_MINUTES, intervalMinutes - 1);
            ticksUntilReminder = intervalMinutes * TICKS_PER_MINUTE;
            sendMessage(client, "Odstęp przypomnienia: " + intervalMinutes + " min.");
        }

        if (INTERVAL_UP_KEY.wasPressed()) {
            intervalMinutes = Math.min(MAX_INTERVAL_MINUTES, intervalMinutes + 1);
            ticksUntilReminder = intervalMinutes * TICKS_PER_MINUTE;
            sendMessage(client, "Odstęp przypomnienia: " + intervalMinutes + " min.");
        }

        if (enabled && --ticksUntilReminder <= 0) {
            sendMessage(client, "Pora ręcznie sprzedać miedź w sklepie!");
            ticksUntilReminder = intervalMinutes * TICKS_PER_MINUTE;
        }
    }

    private static void sendMessage(MinecraftClient client, String message) {
        client.player.sendMessage(Text.literal(message), false);
    }
}