daniil148852

Создай полноценный Minecraft Fabric 1.21.4 мод — Дрон с планшетом управления. Что нужно реализовать: Предметы: Дрон (размещается как entity, не блок) Планшет управления (открывает INVENTORY INVENTORY GUI для пилотирования) Крафт рецепты для обоих Дрон Entity: Летает в воздухе, физика с инерцией (не резкие движения) Управляется через планшет на расстоянии до 64 блоков Если связь потеряна (>64 блоков) — медленно приземляется Может перевозить 9 слотов инвентаря Разрушается при сильном падении (>10 блоков без управления) Планшет INVENTORY INVENTORY GUI: Экран с видом от дрона (как body cam) Кнопки WASD + подъём/спуск Индикатор дистанции до дрона Индикатор высоты 3D модель: Сделай через BlockBench JSON формат прямо в коде (4 лопасти + корпус) Анимация вращения лопастей когда летит Звуки: Используй Python чтобы сгенерировать текстуры и .ogg файлы: drone_idle.ogg — тихое жужжание (синусоида ~180Hz с небольшим шумом) drone_fly.ogg — активный полёт (180Hz + 360Hz гармоника, громче) drone_crash.ogg — крэш звук (нисходящий pitch + белый шум) Используй Python библиотеку scipy + numpy + soundfile или pydub Зарегистрируй звуки в sounds.json Структура проекта: Gradle Fabric 1.20.1 со всеми нужными зависимостями fabric.mod.json заполненный Все файлы по правильным путям Сначала сгенерируй звуки, потом напиши весь Java код, потом 3D модель.

Kodari AI
KodariMay 9 at 4:32 pm 114,929 (v2)

I’ll create a full Drone + Control Tablet mod for Fabric 1.21.4. Let me read the necessary docs first.

DroneControlMod
A Fabric 1.21.4 mod adding a controllable Drone entity and a Control Tablet item. The drone flies with inertia-based physics, carries a 9-slot inventory, and is piloted remotely via the tablet's GUI (WASD + up/down controls, distance/height indicators, body-cam view). Signal lost beyond 64 blocks triggers auto-landing. Hard crashes destroy the drone. Includes custom 3D model with spinning rotors, sounds, and craft recipes.
DroneControlMod
A Fabric 1.21.4 mod adding a controllable Drone entity and Control Tablet item. The drone flies with inertia-based physics, supports a 9-slot cargo inventory, and is piloted remotely via the tablet's HUD (WASD + Up/Down, distance and altitude indicators). Signal lost beyond 64 blocks triggers auto-landing. Hard crashes destroy the drone and scatter its cargo. Includes a custom 3D quad-rotor model with animated spinning blades, custom sounds, and shaped crafting recipes.

Here’s my plan:

  • Build files → Gradle 1.9.2 loom, Fabric API, Java 21

  • Registry layer → ModItems, ModEntities, ModSounds with proper 1.21.4 RegistryKey pattern

  • Entity → DroneEntity extends Entity with inertia physics, 9-slot inventory, UDP-style per-tick input

  • Networking → 4 custom payloads (C2S input, C2S open-inventory, S2C sync, S2C open-screen)

  • Client → DroneControlScreen with WASD HUD, DroneEntityModel with 4 spinning rotors, DroneEntityRenderer

  • Python script → generates all 3 OGG sounds + all PNG textures (item + entity)

Now I notice a typo in DroneInputPayload — let me fix that import:Let me write all files now properly:

Now the resource files:

Finally, the Python asset-generation script:


Summary

The complete mod is structured as follows:

What was created (30 files)

Layer
Key files
Build
build.gradle
,
settings.gradle
,
gradle.properties
Fabric meta
fabric.mod.json
,
dronemod.mixins.json
Registry
ModItems
,
ModEntities
,
ModSounds
Items
DroneItem
(spawns entity on use),
ControlTabletItem
(links + opens screen)
Entity
DroneEntity
— inertia physics, 9-slot
SimpleInventory
, auto-land, crash detection,
TrackedData
for rotor angle
Networking
DroneInputPayload
(C2S),
DroneOpenInventoryPayload
(C2S),
DroneSyncPayload
(S2C),
DroneOpenScreenPayload
(S2C)
Client render
DroneEntityRenderState
,
DroneEntityModel
(4-arm quad-rotor, 64×32 texture),
DroneEntityRenderer
Client screen
DroneControlScreen
— WASD D-pad HUD, altitude/distance telemetry, cargo button, auto-close on signal loss
Resources
sounds.json
,
items/
defs,
models/item/
JSONs,
lang/en_us.json
, shaped recipes
Python
generate_assets.py
— generates
drone_idle.ogg
,
drone_fly.ogg
,
drone_crash.ogg
, all PNG textures via numpy + soundfile + Pillow

Usage flow

  1. Run python generate_assets.py to generate sounds + textures

  2. Craft a Drone (iron + redstone + glass) → right-click to deploy it in front of you

  3. Craft a Control Tablet (glass + redstone + comparator + iron) → right-click the drone to link

  4. Right-click air with the linked tablet → control screen opens; WASD moves, Space ascends, Shift descends, Open Cargo accesses the 9-slot inventory

  5. Move >64 blocks away → drone auto-lands; crash from high fall → drone explodes and drops cargo

daniil148852

The compilation failed with this error:

code
Compilation failed with 8 error(s):

ERROR in src/main/java/com/dronemod/item/ControlTabletItem.java at line 13: cannot find symbol
import net.minecraft.util.TypedActionResult;
                         ^
  symbol: class TypedActionResult
  location: package net.minecraft.util

ERROR in src/main/java/com/dronemod/item/ControlTabletItem.java at line 26: cannot find symbol
    public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
           ^
  symbol: class TypedActionResult
  location: class ControlTabletItem

ERROR in src/main/java/com/dronemod/item/DroneItem.java at line 9: cannot find symbol
import net.minecraft.util.TypedActionResult;
                         ^
  symbol: class TypedActionResult
  location: package net.minecraft.util

ERROR in src/main/java/com/dronemod/item/DroneItem.java at line 19: cannot find symbol
    public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
           ^
  symbol: class TypedActionResult
  location: class DroneItem

ERROR in   src/main/java/com/dronemod/item/ControlTabletItem.java at line 13: cannot find symbol
  import net.minecraft.util.TypedActionResult;
                           ^
  symbol: class TypedActionResult
  location: package net.minecraft.util

ERROR in   src/main/java/com/dronemod/item/ControlTabletItem.java at line 26: cannot find symbol
      public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
             ^
  symbol: class TypedActionResult
  location: class ControlTabletItem

ERROR in   src/main/java/com/dronemod/item/DroneItem.java at line 9: cannot find symbol
  import net.minecraft.util.TypedActionResult;
                           ^
  symbol: class TypedActionResult
  location: package net.minecraft.util

ERROR in   src/main/java/com/dronemod/item/DroneItem.java at line 19: cannot find symbol
      public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
             ^
  symbol: class TypedActionResult
  location: class DroneItem


=== COMPILATION ERROR ANALYSIS ===

MISSING CLASSES:
  - TypedActionResult
ACTION: Create these classes or check imports

FILES TO INVESTIGATE:
  - src/main/java/com/dronemod/item/ControlTabletItem.java
  - src/main/java/com/dronemod/item/DroneItem.java
  -   src/main/java/com/dronemod/item/ControlTabletItem.java
  -   src/main/java/com/dronemod/item/DroneItem.java

Please fix this error by creating a new artifact with the corrected code.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
generate_assets.py
gradle.properties
settings.gradle
Code
32 1,493
src/main/java/com/dronemod/DroneControlModClient.java
package com.dronemod;

import com.dronemod.network.DroneSyncPayload;
import com.dronemod.network.DroneOpenScreenPayload;
import com.dronemod.render.DroneEntityModel;
import com.dronemod.render.DroneEntityRenderer;
import com.dronemod.screen.DroneControlScreen;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.client.MinecraftClient;

@Environment(EnvType.CLIENT)
public class DroneControlModClient implements ClientModInitializer {

    @Override
    public void onInitializeClient() {
        EntityModelLayerRegistry.registerModelLayer(
                DroneEntityModel.MODEL_LAYER,
                DroneEntityModel::getTexturedModelData
        );
        EntityRendererRegistry.register(ModEntities.DRONE, DroneEntityRenderer::new);

        ClientPlayNetworking.registerGlobalReceiver(DroneOpenScreenPayload.ID, (payload, context) -> {
            MinecraftClient.getInstance().setScreen(new DroneControlScreen(payload.droneId()));
        });

        ClientPlayNetworking.registerGlobalReceiver(DroneSyncPayload.ID, (payload, context) -> {
            MinecraftClient mc = MinecraftClient.getInstance();
            if (mc.currentScreen instanceof DroneControlScreen screen
                    && screen.getDroneId().equals(payload.droneId())) {
                screen.updateState(payload.x(), payload.y(), payload.z(), payload.distance());
            }
        });
    }
}