Jump to content

I'm trying to make a mod with Fabric but it keeps messing up for a reason I can't understand


Recommended Posts

Posted

I'm trying to make a mod with fabric that simply makes a new sword in the game, but it keeps messing up on this line:

 

package Serowi913.zA.Hand0;
 
import net.fabricmc.api.ModInitializer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.Identifier;
 
public class zahando implements ModInitializer {
    
    public static final Item ZA_HANDO = new Item(new Item.Settings().group(ItemGroup.MISC));
    
    @Override
    public void onInitialize() {
        // This code runs as soon as Minecraft is in a mod-load-ready state.
        // However, some things (like resources) may still be uninitialized.
        // Proceed with mild caution.
 
        System.out.println("Hello Fabric world!");
        Registry.register(Registry.ITEMnew Identifier("zahando""za_hando")ZA_HANDO);
    }
}

 

The line is the one that starts with Registry.register. There's always soemthing wrong with that line, and it's usually either ITEM or register that messes up, and there isnt any quick fixes, so idk what to do. And when I run it without the registry line, it launches Minecraft perfectly fine. I'm very lost. Also I'm using vs code if that helps.

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.