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 .ModLoadingContext ;
2422import net .neoforged .fml .common .Mod ;
2523import net .neoforged .fml .config .ModConfig ;
24+ import net .neoforged .fml .ModLoadingContext ;
25+ import net .neoforged .fml .common .Mod .EventBusSubscriber ;
2626import net .neoforged .fml .event .lifecycle .FMLClientSetupEvent ;
27+ import net .minecraft .client .Minecraft ;
2728import net .neoforged .fml .event .lifecycle .FMLCommonSetupEvent ;
2829import net .neoforged .neoforge .common .NeoForge ;
2930import net .neoforged .neoforge .event .BuildCreativeModeTabContentsEvent ;
@@ -39,7 +40,7 @@ public class ExampleMod {
3940 // Define mod id in a common place for everything to reference
4041 public static final String MODID = "examplemod" ;
4142 // Directly reference a slf4j logger
42- private static final Logger LOGGER = LogUtils .getLogger ();
43+ public static final Logger LOGGER = LogUtils .getLogger ();
4344 // Create a Deferred Register to hold Blocks which will all be registered under the "examplemod" namespace
4445 public static final DeferredRegister .Blocks BLOCKS = DeferredRegister .createBlocks (MODID );
4546 // Create a Deferred Register to hold Items which will all be registered under the "examplemod" namespace
@@ -118,10 +119,10 @@ public void onServerStarting(ServerStartingEvent event) {
118119 }
119120
120121 // You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
121- @ Mod . EventBusSubscriber (modid = MODID , bus = Mod . EventBusSubscriber .Bus .MOD , value = Dist .CLIENT )
122- public static class ClientModEvents {
122+ @ EventBusSubscriber (modid = ExampleMod . MODID , bus = EventBusSubscriber .Bus .MOD , value = Dist .CLIENT )
123+ static class ClientModEvents {
123124 @ SubscribeEvent
124- public static void onClientSetup (FMLClientSetupEvent event ) {
125+ static void onClientSetup (FMLClientSetupEvent event ) {
125126 // Some client setup code
126127 LOGGER .info ("HELLO FROM CLIENT SETUP" );
127128 LOGGER .info ("MINECRAFT NAME >> {}" , Minecraft .getInstance ().getUser ().getName ());
0 commit comments