How do I add a built-in Resourcepack to my Mod?

Started by pixelalex13 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I add a built-in Resourcepack to my Mod?

I want to add a build-in Ressourcepack to my Mod, like Programmer Art. I have tried to add it per the "resourcepacks" folder in "/src/main/resources/resourcepacks/" but for some reason it wont show up ingame. I am on 2025.1 and use Neoforge 1.21.4.

Add it to the correct folder…
Mon, 03/17/2025 - 18:29

Add it to the correct folder in runs folder in your workspace folder.

Runs folder is like regular MC install folder

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I would like it implemented…
Mon, 03/17/2025 - 18:36

I would like it implemented inside the mod. So when u instal the mod it is automatically in the Ressourepacks for example, the mod Continuity has 2 Ressourepacks build in. Is there a way to do this in MCreator?

 

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What he's trying to do and…
Mon, 12/08/2025 - 16:04

What he's trying to do and same as I am, is like myself I offer a dark mod option what you go in to the resource folder and enable it just like minecraft does for programers art many mods seem to do it in forge but I not getting any luck to get it to work in neoforge I think something changes in 1.20.x where we have to register the resource in the mod but nothing I try works..

So like him I am also trying to registed a second texture pack what isn't used untl they enable it what then would overirde my mods textures

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I couldn't get it to work or…
Mon, 12/08/2025 - 17:35

I couldn't get it to work or it changes a lot between versions so I just copy the zip

Warning this is a hacky way of doing it, just everything I tried it didn't work so I have in to do it away I know it should work.

Create a custom code element and then grab the name from the public class then chance CUSTOMCODENAME to your new name, then change net.namespace.modid; to your namespace/modid, you will find what you need at top of your MCreator custom code page
removed all the old stuff with this below with the above changes.

1.21.1/4 @EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD)
1.21.8 @EventBusSubscriber

package net.namespace.modid; //change me
import org.slf4j.Logger;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.bus.api.SubscribeEvent;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.nio.file.Files;
import java.io.InputStream;
import com.mojang.logging.LogUtils;

@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD)
public class CUSTOMCODENAME { //Change this
    private static final Logger LOGGER = LogUtils.getLogger();

    @SubscribeEvent
    public static void onSetup(FMLCommonSetupEvent event) {
        Path resourcePacksDir = Paths.get("resourcepacks");
        Path targetPack = resourcePacksDir.resolve("pulpe_faction_darkmode.zip");
        if (!Files.exists(targetPack)) {
            try (InputStream is = CUSTOMCODENAME.class.getResourceAsStream("/pulpe_faction_darkmode.zip")) { //Change this
                if (is != null) {
                    Files.createDirectories(resourcePacksDir);
                    Files.copy(is, targetPack);
                    LOGGER.info("Copying Custom Resource Pack..."); //Change this if you want
                }
            } catch (Exception e) {
                e.printStackTrace();
                LOGGER.error("Error Copying Resource Pack...", e); //Change this if you want
            }
        }
    }
}