Jump to content

Recommended Posts

Posted (edited)

Hi!

First of all if I am just simply stupid sorry but I just can't get the LootTableLoadEven. I got to the point that I just copied a tutorial line and it still misses it please help or link something to read about it

 

package com.eiachh.mainmod;
 
import org.apache.logging.log4j.Logger;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.world.storage.loot.LootTableList;

import com.eiachh.mainmod.proxy.IProxy;
import com.eiachh.mainmod.recipes.My_Recipes;
import com.eiachh.mainmod.tabs.NewTab;

import net.minecraftforge.event.LootTableLoadEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
 
@Mod(modid = MainModpls.MODID, name = MainModpls.NAME, version = MainModpls.VERSION, acceptedMinecraftVersions = MainModpls.MC_VERSION)
public class MainModpls {
 
    public static final String MODID = "cutsiemod";
    public static final String NAME = "Cutsiemod yaas";
    public static final String VERSION = "1.0";
    public static final String MC_VERSION = "[1.12.2]";
    
    public static final String CLIENT = "com.eiachh.mainmod.proxy.ClientProxy";
    public static final String SERVER = "com.eiachh.mainmod.proxy.ServerProxy";
 
    public static final CreativeTabs TUTORIAL_TAB = new NewTab("mainTab");
    
    String asd ="LULULULLULULULULULULULLULULULULLULULULULULULU";
    
    
    @SidedProxy(clientSide = MainModpls.CLIENT, serverSide=MainModpls.SERVER)
    public static IProxy proxy;
    
    public static Logger logger;
    
    
    @SubscribeEvent
	public void onLootTablesLoaded(LootTableLoadEvent event) {
	 
		System.out.println("GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG");
		this.asd="kecske";
	    if (event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) {
	         
	    }
	}
    
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        logger = event.getModLog();
        proxy.preInit(event);
        //this.asd="RTRTRTRTRTRTTTRT";
        
        
    }
    
  
 
    @EventHandler
    public void init(FMLInitializationEvent event) {
        logger.info(MainModpls.NAME  + "says hi!");
        proxy.init(event);
        My_Recipes.initSmelting();
    }
 
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
    	proxy.postInit(event);
    	
    	logger.info(asd);
    }
 
}

It just comletly ignoring the fact that I am trying to catch it.

I also tried to put the @subscribe... to a different class but i don't have a better bet than before Init()

Edited by Eiachh
Posted

Nvm I just figured out that you have to actually register the @subcribe annotation so it works.

But then why don't you have to register the @EventHandler ? 

Posted
3 hours ago, Eiachh said:

But then why don't you have to register the @EventHandler ? 

You do, that’s what the @Mod annotation does

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

You probably want a static event subscriber in a different class, then registration is handles the same way as @Mod

  • Thanks 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.