Posted April 28, 20214 yr Hello! Sorry if i posted this in a wrong forum, ive just created my account because i have no idea what to do now. I have somehow managed to create a code listening on player server join (the mod is supposed to be server only), and it looks like this: @Mod.EventBusSubscriber public static class RegistryEvents extends ListenerAdapter { public static TextChannel textChannel; //a discord textchannel set from another event @SubscribeEvent public static void onEvent(EntityJoinWorldEvent e) { if (e.getEntity() instanceof PlayerEntity) { // register join textChannel.sendMessage(e.getEntity().getDisplayName().getString() + " joined the game").queue(); } } and when I add this mod to my server and start it up, it works. When i join, it throws this and crashes: [21:29:01] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.Entity.getDisplayName()' Index: 3 Listeners: 0: HIGHEST 1: ASM: net.minecraftforge.common.ForgeInternalHandler@50fb855c onEntityJoinWorld(Lnet/minecraftforge/event/entity/EntityJoinWorldEvent;)V 2: NORMAL 3: ASM: class me.sansserif.creatediscord.CreateDiscord$RegistryEvents onEvent(Lnet/minecraftforge/event/entity/EntityJoinWorldEvent;)V java.lang.NoSuchMethodError: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.Entity.getDisplayName()' at me.sansserif.creatediscord.CreateDiscord$RegistryEvents.onEvent(CreateDiscord.java:72) at net.minecraftforge.eventbus.ASMEventHandler_16_RegistryEvents_onEvent_EntityJoinWorldEvent.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) at net.minecraft.world.server.ServerWorld.func_217448_f(ServerWorld.java:788) at net.minecraft.world.server.ServerWorld.func_217435_c(ServerWorld.java:780) at net.minecraft.server.management.PlayerList.func_72355_a(PlayerList.java:184) at net.minecraft.network.login.ServerLoginNetHandler.func_147326_c(ServerLoginNetHandler.java:118) at net.minecraft.network.login.ServerLoginNetHandler.func_73660_a(ServerLoginNetHandler.java:65) at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:222) at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) at java.base/java.lang.Thread.run(Thread.java:834) [21:29:25] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception java.lang.NoSuchMethodError: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.Entity.getDisplayName()' at me.sansserif.creatediscord.CreateDiscord$RegistryEvents.onEvent(CreateDiscord.java:72) ~[creatediscord:1.0] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_16_RegistryEvents_onEvent_EntityJoinWorldEvent.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraft.world.server.ServerWorld.func_217448_f(ServerWorld.java:788) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.world.server.ServerWorld.func_217435_c(ServerWorld.java:780) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.management.PlayerList.func_72355_a(PlayerList.java:184) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.login.ServerLoginNetHandler.func_147326_c(ServerLoginNetHandler.java:118) ~[?:?] {re:classloading} at net.minecraft.network.login.ServerLoginNetHandler.func_73660_a(ServerLoginNetHandler.java:65) ~[?:?] {re:classloading} at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:222) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at java.lang.Thread.run(Thread.java:834) [?:?] {} [21:29:32] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID c2f18443-d7b0-4832-8eee-569acf0fd479 I have tried googling and some pages said it has something in common with sides, so I tried the EntityJoinWorldEvent instead of PlayerLoggedInEvent, but still doesnt work. I don`t not know why it throws out NoSuchMethodError, as IntelliJ offers me the getDisplayName() method, so it probably exists if I am not wrong. Thanks in advance, and have a great day!
April 29, 20214 yr Author 9 hours ago, diesieben07 said: PlayerLoggedInEvent would be a better choice here. The log suggests you are running outside the development environment. How did you create your mod Jar? I have changed the events to PlayerLogged(In/Out)Event, so now the entire class looks like this: @Mod("creatediscord") public class CreateDiscord { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public CreateDiscord() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { // some preinit code LOGGER.info("Running CreateDiscord"); } // You can use SubscribeEvent and let the Event Bus discover methods to call @SubscribeEvent public void onServerStarting(FMLServerStartingEvent event) { // do something when the server starts JDABuilder jdaBuilder = JDABuilder.createDefault("Bot token :)"); JDA jda; //ENABLE STUFF jdaBuilder.addEventListeners(new RegistryEvents()); //ACTIVITY jdaBuilder.setStatus(OnlineStatus.IDLE); try { jda = jdaBuilder.build(); } catch (LoginException e) { e.printStackTrace(); } } // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD // Event bus for receiving Registry Events) @Mod.EventBusSubscriber public static class RegistryEvents extends ListenerAdapter { public static TextChannel textChannel; @SubscribeEvent public static void onEvent(PlayerEvent.PlayerLoggedInEvent e) { // register join textChannel.sendMessage(e.getPlayer().getDisplayName().getString() + " joined the game").queue(); } @SubscribeEvent public static void onEvent(PlayerEvent.PlayerLoggedOutEvent e) { // register leave textChannel.sendMessage(e.getPlayer().getDisplayName().getString() + " left the game").queue(); } public void onReady(ReadyEvent e) { textChannel = e.getJDA().getTextChannelById("Channel ID :)"); } } } My build.gradle looks like this: buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } plugins { id 'com.github.johnrengelman.shadow' version '4.0.0' id 'java' } apply plugin: 'net.minecraftforge.gradle' // extraLine "PK: org/apache/commons/collections4 me/sansserif/org/apache/commons/collections4" group = 'me.sansserif' version = '1.0' archivesBaseName = 'CreateDiscord' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' shadowJar { // Relocate fluent-hc to prevent conflicts with other mods that include it //relocate 'org.apache.commons.collections.collections4', 'me.sansserif.org.apache.commons.collections4' configurations = [project.configurations.shadow] classifier '' relocate('org.apache.commons', 'org.creatediscord.apache.commons') //relocated packages needed by JDA relocate('gnu.trove', 'gnu.creatediscord.trove') } minecraft { // The mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD Snapshot are built nightly. // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'snapshot', version: '20210309-1.16.5' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { creatediscord { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { creatediscord { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. args '--mod', 'creatediscord', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') mods { creatediscord { source sourceSets.main } } } } } // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } configurations { shade compile.extendsFrom shade } repositories { flatDir { dirs 'libs' } } dependencies { shadow 'net.dv8tion:JDA:4.2.1_253' //the discord api shadow 'org.apache.commons:commons-collections4:4.4' //a package needed by jda shadow 'gnu.trove:trove:3.0.3' //when i started the mod, it threw NoClassDefFoundError, so I added it too // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.16.5-36.1.4' // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" // compile "some.group:artifact:version" // Real examples // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // These dependencies get remapped to your current MCP mappings // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title" : "creatediscord", "Specification-Vendor" : "SansSerif", "Specification-Version" : "1", // We are version 1 of ourselves "Implementation-Title" : project.name, "Implementation-Version" : project.version, "Implementation-Vendor" : "SansSerif", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } configurations.shade.each { dep -> from(project.zipTree(dep)) { exclude 'META-INF', 'META-INF/**' } } } project.tasks.build.dependsOn shadowJar jar.finalizedBy('reobfJar') But even after changing the events to PlayerLogged..Event, it throws this: [08:16:10] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.player.PlayerEntity.getDisplayName()' Index: 2 Listeners: 0: NORMAL 1: ASM: net.minecraftforge.common.ForgeInternalHandler@38a07bdc playerLogin(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V 2: ASM: class me.sansserif.creatediscord.CreateDiscord$RegistryEvents onEvent(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V java.lang.NoSuchMethodError: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.player.PlayerEntity.getDisplayName()' at me.sansserif.creatediscord.CreateDiscord$RegistryEvents.onEvent(CreateDiscord.java:72) at net.minecraftforge.eventbus.ASMEventHandler_15_RegistryEvents_onEvent_PlayerLoggedInEvent.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) at net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerLoggedIn(BasicEventHooks.java:44) at net.minecraft.server.management.PlayerList.func_72355_a(PlayerList.java:231) at net.minecraft.network.login.ServerLoginNetHandler.func_147326_c(ServerLoginNetHandler.java:118) at net.minecraft.network.login.ServerLoginNetHandler.func_73660_a(ServerLoginNetHandler.java:65) at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:222) at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) at java.base/java.lang.Thread.run(Thread.java:834) [08:16:12] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception java.lang.NoSuchMethodError: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.player.PlayerEntity.getDisplayName()' at me.sansserif.creatediscord.CreateDiscord$RegistryEvents.onEvent(CreateDiscord.java:72) ~[creatediscord:1.0] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_15_RegistryEvents_onEvent_PlayerLoggedInEvent.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerLoggedIn(BasicEventHooks.java:44) ~[forge:?] {re:classloading} at net.minecraft.server.management.PlayerList.func_72355_a(PlayerList.java:231) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.login.ServerLoginNetHandler.func_147326_c(ServerLoginNetHandler.java:118) ~[?:?] {re:classloading} at net.minecraft.network.login.ServerLoginNetHandler.func_73660_a(ServerLoginNetHandler.java:65) ~[?:?] {re:classloading} at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:222) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at java.lang.Thread.run(Thread.java:834) [?:?] {} [08:16:13] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID b9d7c1a7-859d-4190-a0bc-74c8187051af EDIT: I didnt really answer the question how did I create the mod Jar, I just press Run in IntelliJ and copy the projectdir/build/libs/mod.jar to the serverdir/mods/ Also, thanks for a fast reply and have a good day! Edited April 29, 20214 yr by SansSerif_
April 29, 20214 yr Author 33 minutes ago, diesieben07 said: You must use the Gradle build task: https://mcforge.readthedocs.io/en/latest/gettingstarted/#building-and-testing-your-mod Thanks for the reply, unfortunately, I used "gradlew build" and "gradlew runServer", but it still throws this out, when I start my server with the mod: [09:58:32] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.player.PlayerEntity.getDisplayName()' Index: 2 Listeners: 0: NORMAL 1: ASM: net.minecraftforge.common.ForgeInternalHandler@4181b931 playerLogin(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V 2: ASM: class me.sansserif.creatediscord.CreateDiscord$RegistryEvents onEvent(Lnet/minecraftforge/event/entity/player/PlayerEvent$PlayerLoggedInEvent;)V java.lang.NoSuchMethodError: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.player.PlayerEntity.getDisplayName()' at me.sansserif.creatediscord.CreateDiscord$RegistryEvents.onEvent(CreateDiscord.java:68) at net.minecraftforge.eventbus.ASMEventHandler_15_RegistryEvents_onEvent_PlayerLoggedInEvent.invoke(.dynamic) at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) at net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerLoggedIn(BasicEventHooks.java:44) at net.minecraft.server.management.PlayerList.func_72355_a(PlayerList.java:231) at net.minecraft.network.login.ServerLoginNetHandler.func_147326_c(ServerLoginNetHandler.java:118) at net.minecraft.network.login.ServerLoginNetHandler.func_73660_a(ServerLoginNetHandler.java:65) at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:222) at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) at java.base/java.lang.Thread.run(Thread.java:834) [09:58:52] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception java.lang.NoSuchMethodError: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.player.PlayerEntity.getDisplayName()' at me.sansserif.creatediscord.CreateDiscord$RegistryEvents.onEvent(CreateDiscord.java:68) ~[creatediscord:1.0] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_15_RegistryEvents_onEvent_PlayerLoggedInEvent.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerLoggedIn(BasicEventHooks.java:44) ~[forge:?] {re:classloading} at net.minecraft.server.management.PlayerList.func_72355_a(PlayerList.java:231) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.login.ServerLoginNetHandler.func_147326_c(ServerLoginNetHandler.java:118) ~[?:?] {re:classloading} at net.minecraft.network.login.ServerLoginNetHandler.func_73660_a(ServerLoginNetHandler.java:65) ~[?:?] {re:classloading} at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:222) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:291) ~[?:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at java.lang.Thread.run(Thread.java:834) [?:?] {} [09:58:53] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 7a6a47a2-d5e5-4cbc-9b5f-00fedd7f7c5e Couldn't it be because of a broken server?
April 29, 20214 yr Author 11 hours ago, diesieben07 said: Which jar file did you use? Hello, if you mean the mod file, I just copy the projectdir/build/libs/CreateDiscord-1.0.jar to the server`s mods folder. If you mean the server jar, i use the "forge-1.16.5-36.1.4.jar" one. I have tried reinstalling the forge server, but even after that, it throws out the same error (java.lang.NoSuchMethodError: 'net.minecraft.util.text.ITextComponent net.minecraft.entity.player.PlayerEntity.getDisplayName()') EDIT: I could attach the entire project if you would like to check if i broke the project. Also I used Minecraft Development IntelliJ plugin to create the project if this could somehow help. Edited April 29, 20214 yr by SansSerif_
April 29, 20214 yr Author 30 minutes ago, diesieben07 said: Please post a Git repo, yes. Somehow managed to learn git, so here you go - https://github.com/SansSerif1/creatediscord
April 30, 20214 yr Author 10 hours ago, diesieben07 said: You have some weird mixture of fat-jaring in your build.gradle. On the one hand you are using the shadow plugin (but you are not reobfuscating it's jar, so it will crash in the final game), on the other hand you are manually copying the shade configuration into your jar file, but that configuration is also completely empty. Oh okay, may I ask, how could I fix that? I have some experience with java itself, and I have used only maven, but Gradle and this stuff is a new world to me. Thanks!
April 30, 20214 yr Author 5 minutes ago, diesieben07 said: Only use the Shadow plugin. Remove the shade configuration and the manual copying of it into your jar file. Update to ForgeGradle 4 (check the latest MDKs) and Gradle 6. Then update the Shadow plugin to version 6 as well. Stop using the flat dir libs folder for dependencies that are available in a maven repository. See here for JDA and use Maven Central for the other libraries. Do not set the shadow jar classifier to '' to avoid complications and confusion. Tell the reobfuscation task to also reobfuscate the shadow jar: reobf { shadowJar {} } Ensure the shadow jar is always reobfuscated: shadowJar.finalizedBy('reobfShadowJar') Thank you so much! The mod finally works! Have a great day and thank you again!
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.