Compare commits

...

2 Commits

Author SHA1 Message Date
85d9ffb6e8 slowly but it does not print errors 2025-08-31 12:21:56 +02:00
beca2bada8 bugs go away pls 2 2025-08-31 11:15:31 +02:00
2 changed files with 11 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.event.entity.player.PlayerEvent; // chatGPT
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@ -69,6 +70,14 @@ public class LearningMod
LOGGER.info("HELLO from server starting");
}
// My shit and prayers
@SubscribeEvent
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event)
{
// Do something when the server starts
LOGGER.info("Motherfucker just logged in");
}
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public static class ClientModEvents
@ -82,3 +91,4 @@ public class LearningMod
}
}
}

View File

@ -2,7 +2,7 @@ package net.ggodot.learningmod.event;
import net.ggodot.learningmod.LearningMod;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;