Jump to content

Recommended Posts

Posted

Whenever I try to run runClient, I get past the Minecraft loading screen, only to be met by this error message:

 

"Users/neoskater/Desktop/ComputerScience/Java/MinecraftModding/1.15.2/ElementalMagic/bin/main has mods that were not found."

 

I went into the mods.toml file in main and it does appear to be set up correctly with the correct modid, but nothing is loading. Any idea what's going on?

 

(Note: For some reason the bin/main in this mod only contains a pack.mcmeta and a META-INF folder containing only mods.toml, while the one for the only mod I have successfully tested contains a full copy of the code. Maybe that has something to do with it?)

Screen Shot 2020-07-28 at 4.06.20 PM.png

Posted

Show your main mod class and your mods.toml file.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted (edited)
  On 7/28/2020 at 10:08 PM, Draco18s said:

Show your main mod class and your mods.toml file.

Expand  

Here you go. (I should probably get to cleaning up the files – I changed the minimum amount required from the defaults to make the mod work.)

The mod class:

package com.thornecorporation.elementalmagic;

import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.stream.Collectors;

// The value here should match an entry in the META-INF/mods.toml file
@Mod(ElementalMagic.MOD_ID)
public class ElementalMagic
{
    // Directly reference a log4j logger.
	public static final String MOD_ID = "elementalmagic";
    private static final Logger LOGGER = LogManager.getLogger();
    public static final ItemGroup ITEM_GROUP = new ElementalMagicItemGroup("elemental_magic_group");

    public ElementalMagic() {
        // Register the setup method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        // Register the enqueueIMC method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC);
        // Register the processIMC method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC);
        // Register the doClientStuff method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff);

        // Register ourselves for server and other game events we are interested in
        MinecraftForge.EVENT_BUS.register(this);
    }

    private void setup(final FMLCommonSetupEvent event)
    {
        
    }

    private void doClientStuff(final FMLClientSetupEvent event) {
        // do something that can only be done on the client
        LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings);
    }

    private void enqueueIMC(final InterModEnqueueEvent event)
    {
        // some example code to dispatch IMC to another mod
        InterModComms.sendTo("elementalmagic", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
    }

    private void processIMC(final InterModProcessEvent event)
    {
        // some example code to receive and process InterModComms from other mods
        LOGGER.info("Got IMC {}", event.getIMCStream().
                map(m->m.getMessageSupplier().get()).
                collect(Collectors.toList()));
    }
    // You can use SubscribeEvent and let the Event Bus discover methods to call
    @SubscribeEvent
    public void onServerStarting(FMLServerStartingEvent event) {
        
    }

    // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
    // Event bus for receiving Registry Events)
    @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
    public static class RegistryEvents {
        @SubscribeEvent
        public static void onNewRegistry(final RegistryEvent.NewRegistry event) {
            
        }
    }
    
    public static class ElementalMagicItemGroup extends ItemGroup {

		public ElementalMagicItemGroup(String name) {
			super(name);
		}

		@Override
		public ItemStack createIcon() {
			return new ItemStack(Items.COOKED_COD);
		}
        
    }
}

 

The mods.toml file at src/main/resources:

# This is an example mods.toml file. It contains the data relating to the loading mods.
# There are several mandatory fields (#mandatory), and many more that are optional (#optional).
# The overall format is standard TOML format, v0.5.0.
# Note that there are a couple of TOML lists in this file.
# Find more information on toml format here:  https://github.com/toml-lang/toml
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[31,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# A URL to refer people to when problems occur with this mod
issueTrackerURL="http://my.issue.tracker/" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
[[mods]] #mandatory
# The modid of the mod
modId="elementalmagic" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="${file.jarVersion}" #mandatory
 # A display name for the mod
displayName="Example Mod" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here>
updateJSONURL="http://myurl.me/" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
displayURL="http://example.com/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
logoFile="examplemod.png" #optional
# A text field displayed in the mod UI
credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors="Love, Cheese and small house plants" #optional
# The description text for the mod (multi line!) (#mandatory)
description='''
This is a long form description of the mod. You can write whatever you want here

Have some lorem ipsum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.examplemod]] #optional
    # the modid of the dependency
    modId="forge" #mandatory
    # Does this dependency have to exist - if not, ordering below must be specified
    mandatory=true #mandatory
    # The version range of the dependency
    versionRange="[31,)" #mandatory
    # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
    ordering="NONE"
    # Side this dependency is applied on - BOTH, CLIENT or SERVER
    side="BOTH"
# Here's another dependency
[[dependencies.examplemod]]
    modId="minecraft"
    mandatory=true
    versionRange="[1.15.2]"
    ordering="NONE"
    side="BOTH"

Hey, wait a minute. I forgot to change an appearance of "examplemod" in the toml files! Maybe that's it?

 

EDIT: Nope, that's not it. I fixed the mistake and it still gives me the same problem. I attached the latest.log for the mod, but here's the most relevant section (the first FATAL thing logged):

[28Jul2020 20:40:10.728] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Dev
[28Jul2020 20:40:26.227] [Render thread/INFO] [net.minecraft.client.Minecraft/]: Backend library: LWJGL version 3.2.1 build 12
[28Jul2020 20:40:29.655] [Render thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: File /Users/neoskater/Desktop/ComputerScience/Java/MinecraftModding/1.15.2/ElementalMagic/bin/main constructed 0 mods: [], but had 1 mods specified: [elementalmagic]
[28Jul2020 20:40:29.655] [Render thread/FATAL] [net.minecraftforge.fml.ModLoader/CORE]: Failed to initialize mod containers
net.minecraftforge.fml.ModLoadingException: The Mod File /Users/neoskater/Desktop/ComputerScience/Java/MinecraftModding/1.15.2/ElementalMagic/bin/main has mods that were not found

 

and the new and improved mods.toml:

modLoader="javafml" #mandatory
loaderVersion="[31,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
issueTrackerURL="http://my.issue.tracker/" #optional
[[mods]] #mandatory
modId="elementalmagic" #mandatory
version="${file.jarVersion}" #mandatory
displayName="Elemental Magic" #mandatory
updateJSONURL="http://myurl.me/" #optional
displayURL="http://example.com/" #optional
logoFile="examplemod.png" #optional
credits="Damian Thorne - the mod maker" #optional
authors="Damian Thorne, CEO of the Thorne Corporation" #optional
description='''A way to utilize the power of fire, water, air, earth, and ether in Minecraft.'''
[[dependencies.elementalmagic]] #optional
    modId="forge" #mandatory
    mandatory=true #mandatory
    versionRange="[31,)" #mandatory
    ordering="NONE"
    side="BOTH"
[[dependencies.elementalmagic]]
    modId="minecraft"
    mandatory=true
    versionRange="[1.15.2]"
    ordering="NONE"
    side="BOTH"

 

latest.logFetching info...

Edited by TheThorneCorporation
Posted

The mod.toml file looks fine, and so your mod main class... "examplemod.png" doesn't really matter, and as far as i know you can leave [dependencies.examplemod] as it is and your mod should run without problems. I tested this on 1.16.1 and the mod is loading correctly, but you can try to change "examplemod" in the dependencies to your mod ID and see if it loads, i doubt this is the issue though.

  • Like 1

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted

No, don't leave dependencies.examplemod, that declares dependencies for a mod that doesn't exist

The logo does matter if you plan to open the mod list

All values in mods.toml marked #Optional should be set or removed entirely, do not leave them blank

  • Like 1

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted
  On 7/29/2020 at 3:38 AM, DaemonUmbra said:

No, don't leave dependencies.examplemod, that declares dependencies for a mod that doesn't exist

The logo does matter if you plan to open the mod list

All values in mods.toml marked #Optional should be set or removed entirely, do not leave them blank

Expand  

I did that, but it still doesn't work, giving the same error.

Posted

Have you re-run genIDERuns after your changes?

  • Like 1

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

Honestly it's a shot in the dark

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

Sometimes

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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