44
55import com .mojang .logging .LogUtils ;
66
7- import net .minecraft .client .Minecraft ;
87import net .minecraft .core .registries .BuiltInRegistries ;
98import net .minecraft .core .registries .Registries ;
109import net .minecraft .network .chat .Component ;
2019import net .neoforged .api .distmarker .Dist ;
2120import net .neoforged .bus .api .IEventBus ;
2221import net .neoforged .bus .api .SubscribeEvent ;
23- import net .neoforged .fml .ModContainer ;
24- import net .neoforged .fml .common .EventBusSubscriber ;
2522import net .neoforged .fml .common .Mod ;
2623import net .neoforged .fml .config .ModConfig ;
24+ import net .neoforged .fml .ModContainer ;
25+ import net .neoforged .fml .common .EventBusSubscriber ;
2726import net .neoforged .fml .event .lifecycle .FMLClientSetupEvent ;
27+ import net .minecraft .client .Minecraft ;
2828import net .neoforged .fml .event .lifecycle .FMLCommonSetupEvent ;
2929import net .neoforged .neoforge .common .NeoForge ;
3030import net .neoforged .neoforge .event .BuildCreativeModeTabContentsEvent ;
@@ -40,7 +40,7 @@ public class ExampleMod {
4040 // Define mod id in a common place for everything to reference
4141 public static final String MODID = "examplemod" ;
4242 // Directly reference a slf4j logger
43- private static final Logger LOGGER = LogUtils .getLogger ();
43+ public static final Logger LOGGER = LogUtils .getLogger ();
4444 // Create a Deferred Register to hold Blocks which will all be registered under the "examplemod" namespace
4545 public static final DeferredRegister .Blocks BLOCKS = DeferredRegister .createBlocks (MODID );
4646 // Create a Deferred Register to hold Items which will all be registered under the "examplemod" namespace
@@ -119,10 +119,10 @@ public void onServerStarting(ServerStartingEvent event) {
119119 }
120120
121121 // You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
122- @ EventBusSubscriber (modid = MODID , bus = EventBusSubscriber .Bus .MOD , value = Dist .CLIENT )
123- public static class ClientModEvents {
122+ @ EventBusSubscriber (modid = ExampleMod . MODID , bus = EventBusSubscriber .Bus .MOD , value = Dist .CLIENT )
123+ static class ClientModEvents {
124124 @ SubscribeEvent
125- public static void onClientSetup (FMLClientSetupEvent event ) {
125+ static void onClientSetup (FMLClientSetupEvent event ) {
126126 // Some client setup code
127127 LOGGER .info ("HELLO FROM CLIENT SETUP" );
128128 LOGGER .info ("MINECRAFT NAME >> {}" , Minecraft .getInstance ().getUser ().getName ());
0 commit comments