Enderplus
📎 1 file 1,789 chars
📄
pasted-code-1791394018414.txt
txt 39 lines
▶
Create a Minecraft Forge 1.20.1 mod (Java 17) with mod ID "chatlosttools".

FEATURE: Add a "Tornado Staff" item. Right-click summons a tornado at the target location.

TORNADO BEHAVIOR:
- Lasts 15 seconds, radius 20 blocks.
- Pulls all mobs, items, and blocks into a spinning vortex.
- Blocks get broken and sucked in; mobs/items orbit the center.
- After it ends, everything drops back down.
- Cooldown: 30 seconds. Durability: 100 (loses 10 per use).

GUI TAB FEATURE:
- Press G to open a tabbed GUI screen (like Creative Inventory tabs).
- Tab 1 "Tornado Settings": sliders for radius (5-50), duration (5-60s), pull strength.
- Tab 2 "Block Filter": checkbox list of all blocks; only checked ones get sucked.
- Tab 3 "Mob Filter": checkbox list of all mobs; only checked ones get sucked.
- Save settings per-player using Capability + network packets (SimpleChannel).

FILES NEEDED:
- ChatlostTools.java (main class, creative tab, config)
- TornadoStaffItem.java
- TornadoEntity.java (custom entity)
- TornadoRenderer.java (spinning particle vortex, screen shake, dark clouds)
- TornadoSettingsScreen.java (tabbed GUI)
- ModMessages.java (network)
- PlayerSettingsCapability.java
- assets/chatlosttools/ (models, textures, en_us.json, fa_ir.json)
- data/chatlosttools/ (recipe: 4 Netherite Ingot + 4 Nether Star + 1 Trident)

USE:
- ParticleTypes.CLOUD + SWEEP_ATTACK for tornado particles.
- SoundEvents.ENTITY_ENDER_DRAGON_FLAP for tornado sound.
- ForgeConfigSpec for max radius/duration, block destroy toggle.

BALANCE:
- Expensive end-game craft. Cannot use in Nether/End.
- Creative mode = no cooldown.

Generate complete compilable code with build.gradle, mods.toml, pack.mcmeta. Make sure it compiles on Forge 1.20.1 (47.2.0) without errors.
Kodari AI
KodariOct 7 at 5:32 pm 5
TornadoStaffMod
A Forge 1.20.1 mod adding a Tornado Staff that summons a destructive vortex. Right-click launches a 15-second tornado pulling mobs, items, and blocks into a spinning cloud. Features a tabbed GUI (press G) with sliders for radius, duration, and pull strength, plus checkbox filters for blocks and mobs. Settings persist per-player via capability and network packets. Staff has 100 durability, 30-second cooldown, and requires an expensive end-game recipe. Includes custom entity rendering with particle effects, screen shake, and dark clouds. Configurable via ForgeConfigSpec with creative mode bypassing cooldown.
  1. Set up the Forge 1.20.1 / Java 17 project and register the item, entity, config, and creative tab.

  2. Implement the staff, tornado effects, cooldown/durability, and per-player saved settings with SimpleChannel sync.

  3. Add the G-key tabbed settings screen, renderer/client effects, recipe, metadata, and language/model assets.

Created the Forge 1.20.1 / Java 17 project with the Tornado Staff, tornado entity effects, cooldown and durability, per-player saved settings and SimpleChannel sync, G-key tabbed settings screen, config, recipe, and English/Persian language files.

The staff model uses Minecraft’s trident texture; no custom texture was generated. To enable texture generation, use Settings → Generation for this project, or enable it for all projects at https://kodari.ai/settings?tab=features.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
16 1,088
src/main/java/com/chatlosttools/ChatlostTools.java
package com.chatlosttools;

import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

@Mod(ChatlostTools.MODID)
public class ChatlostTools {
    public static final String MODID = "chatlosttools";
    public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
    public static final DeferredRegister<EntityType<?>> ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, MODID);
    public static final DeferredRegister<CreativeModeTab> CREATIVE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);

    public static final RegistryObject<Item> TORNADO_STAFF = ITEMS.register("tornado_staff",
            () -> new TornadoStaffItem(new Item.Properties().durability(100)));
    public static final RegistryObject<EntityType<TornadoEntity>> TORNADO_ENTITY = ENTITY_TYPES.register("tornado",
            () -> EntityType.Builder.of(TornadoEntity::new, MobCategory.MISC)
                    .sized(0.1F, 0.1F)
                    .clientTrackingRange(64)
                    .updateInterval(1)
                    .build("chatlosttools:tornado"));
    public static final RegistryObject<CreativeModeTab> MAIN_TAB = CREATIVE_TABS.register("main",
            () -> CreativeModeTab.builder()
                    .title(Component.translatable("itemGroup.chatlosttools"))
                    .icon(() -> new ItemStack(TORNADO_STAFF.get()))
                    .displayItems((parameters, output) -> output.accept(TORNADO_STAFF.get()))
                    .build());

    private static final ForgeConfigSpec.Builder CONFIG_BUILDER = new ForgeConfigSpec.Builder();
    public static final ForgeConfigSpec.IntValue MAX_RADIUS = CONFIG_BUILDER
            .defineInRange("maxRadius", 50, 5, 50);
    public static final ForgeConfigSpec.IntValue MAX_DURATION_SECONDS = CONFIG_BUILDER
            .defineInRange("maxDurationSeconds", 60, 5, 60);
    public static final ForgeConfigSpec.BooleanValue DESTROY_BLOCKS = CONFIG_BUILDER
            .define("destroyBlocks", true);
    public static final ForgeConfigSpec CONFIG = CONFIG_BUILDER.build();

    public ChatlostTools() {
        IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus();
        ITEMS.register(modBus);
        ENTITY_TYPES.register(modBus);
        CREATIVE_TABS.register(modBus);
        modBus.addListener(PlayerSettingsCapability::register);
        ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, CONFIG);
        ModMessages.register();
        MinecraftForge.EVENT_BUS.register(this);
    }
}