Shaky Vibes

Create a new Minecraft tool. Appearance: a wrench. Behavior: a wrench that i can craft in survival that can rotate rails like a corner turn but dosen't need to be connected to anything

Kodari AI
KodariOct 15 at 2:16 pm 6
RailWrench
A craftable wrench tool that rotates rail blocks in Minecraft. When used on any rail, it cycles the rail's shape through its valid corner and straight orientations without requiring adjacent rail connections. The wrench has custom durability, is crafted from iron ingots and sticks, and provides a survival-friendly way to reconfigure rail layouts. It supports all vanilla rail types including normal, powered, and detector rails, with a visual rotation animation and sound effect on use.
  1. Add a craftable wrench item and its texture/model assets.

  2. Make using it on a rail cycle the rail’s shape directly, without relying on neighboring rails.

  3. Register the item and add its recipe and name.

Added the Rail Wrench. Use it on a standard rail to rotate its shape 90°, including into a corner even when it isn’t connected to other rails. It makes a metallic sound and appears in Tools & Utilities.

Survival recipe: 2 iron ingots above 2 sticks, arranged as a wrench-shaped pattern.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
11 173
src/main/java/com/kodari/railwrench/RailWrench.java
package com.kodari.railwrench;

import net.minecraft.world.item.CreativeModeTabs;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;

@Mod(RailWrench.MOD_ID)
public final class RailWrench {
    public static final String MOD_ID = "railwrench";

    public RailWrench(IEventBus modEventBus) {
        ModItems.ITEMS.register(modEventBus);
        modEventBus.addListener(this::addCreative);
    }

    private void addCreative(BuildCreativeModeTabContentsEvent event) {
        if (event.getTabKey().equals(CreativeModeTabs.TOOLS_AND_UTILITIES)) {
            event.accept(ModItems.WRENCH);
        }
    }
}