• Recently Browsing

    No registered users viewing this page.

  • Posts

    • That method never cause this exception. There is no point in adding it here. Even if some of your code might cause this, you should handle it inside the method properly (you are making a mod, not an API).   LivingDamageEvent is a Forge event. You are putting it in the Mod event subscriber.
    • Thanks for your advice! I ended up using a PlayerModel as I needed the outer skin thing, and for my Renderer i used BipedRenderer. Cheers
    • Hello, this is my first try at making a mod on Minecraft, and I'm facing a problem. I'm using forge's 1.16.1 example mod that i modified to suit my needs. My mod is very simple, I just want to execute some code when the player takes damage. For that, I'm using the LivingDamageEvent event, and it works exactly as i want in singleplayer. However, when I join a multiplayer server, it seems like my mod is turned off automatically for some reason. The FMLServerStartingEvent doesn't trigger because I don't see anything in the launcher_log.txt after I close minecraft, and same for LivingDamageEvent. Is there a reason for that ?   Here's the code i'm using, it's just a modified version of forge's example mod :   package com.example.examplemod; import net.minecraft.block.Blocks; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDamageEvent; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.server.FMLServerStartingEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import java.io.IOException; import java.io.InputStream; import java.net.URL; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // The value here should match an entry in the META-INF/mods.toml file @Mod("examplemod") public class examplemod { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public examplemod() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); // 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("HELLO FROM PREINIT"); LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName()); } @SuppressWarnings("resource") private void doClientStuff(final FMLClientSetupEvent event) { // do something that can only be done on the client LOGGER.info("Got game settings {}", event.getMinecraftSupplier().get().gameSettings); } // 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 LOGGER.info("HELLO from server starting"); } public class MyForgeEventHandler { @SubscribeEvent public void pickupItem(EntityItemPickupEvent event) { System.out.println("Item picked up!"); } } @SubscribeEvent public void onPlayerHurt(LivingDamageEvent event) throws IOException { System.out.println("Player attacked ! damage : " + event.getAmount()); #Execute some code here ... } }  
    • I was trying to play the avatar last block bender mod on 1.7.10 forge and the mod works in single player but not on my server. Every time I open the forge-1.7.10-10.13.4.1614-1.7.10-universal file it doesn't start the file. I am very new to adding mods to a server so I was wondering if anyone can help. Thanks.   Here's the logs:   [18:10:42] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLServerTweaker [18:10:42] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLServerTweaker [18:10:42] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLServerTweaker [18:10:43] [main/INFO] [FML]: Forge Mod Loader version 7.99.40.1614 for Minecraft 1.7.10 loading [18:10:43] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_251, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_251 [18:10:43] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:10:43] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker [18:10:43] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:10:43] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [18:10:43] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [18:10:44] [main/INFO] [FML]: Found valid fingerprint for Minecraft Forge. Certificate fingerprint e3c3d50c7c986df74c645c0ac54639741c90a557 [18:10:44] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [18:10:44] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker [18:10:45] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker [18:10:45] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker [18:10:45] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer} [18:10:48] [main/WARN] [FML]: ============================================================= [18:10:48] [main/WARN] [FML]: MOD HAS DIRECT REFERENCE System.exit() THIS IS NOT ALLOWED REROUTING TO FML! [18:10:48] [main/WARN] [FML]: Offendor: net/minecraft/server/gui/MinecraftServerGui$1.windowClosing(Ljava/awt/event/WindowEvent;)V [18:10:48] [main/WARN] [FML]: Use FMLCommonHandler.exitJava instead [18:10:48] [main/WARN] [FML]: ============================================================= [18:10:48] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Starting minecraft server version 1.7.10 [18:10:48] [Server console handler/ERROR] [net.minecraft.server.dedicated.DedicatedServer]: Exception handling console input java.io.IOException: The handle is invalid     at java.io.FileInputStream.readBytes(Native Method) ~[?:1.8.0_251]     at java.io.FileInputStream.read(Unknown Source) ~[?:1.8.0_251]     at java.io.BufferedInputStream.read1(Unknown Source) ~[?:1.8.0_251]     at java.io.BufferedInputStream.read(Unknown Source) ~[?:1.8.0_251]     at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) ~[?:1.8.0_251]     at sun.nio.cs.StreamDecoder.implRead(Unknown Source) ~[?:1.8.0_251]     at sun.nio.cs.StreamDecoder.read(Unknown Source) ~[?:1.8.0_251]     at java.io.InputStreamReader.read(Unknown Source) ~[?:1.8.0_251]     at java.io.BufferedReader.fill(Unknown Source) ~[?:1.8.0_251]     at java.io.BufferedReader.readLine(Unknown Source) ~[?:1.8.0_251]     at java.io.BufferedReader.readLine(Unknown Source) ~[?:1.8.0_251]     at net.minecraft.server.dedicated.DedicatedServer$2.run(DedicatedServer.java:97) [lv.class:?] [18:10:49] [Server thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [18:10:49] [Server thread/INFO] [FML]: MinecraftForge v10.13.4.1614 Initialized [18:10:49] [Server thread/INFO] [FML]: Replaced 183 ore recipies [18:10:49] [Server thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [18:10:49] [Server thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [18:10:49] [Server thread/INFO] [FML]: Searching C:\Users\choco\Desktop\Forge server 1.7.10\mods for mods [18:10:50] [Server thread/INFO] [FML]: Attempting to reparse the mod container Avatar-The-Last-Blockbender-Mod-1.7.10.jar [18:10:50] [Server thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load [18:10:50] [Server thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, examplemod, kieranvs_avatar] at CLIENT [18:10:50] [Server thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, examplemod, kieranvs_avatar] at SERVER [18:10:51] [Server thread/INFO] [FML]: Processing ObjectHolder annotations [18:10:51] [Server thread/INFO] [FML]: Found 341 ObjectHolder annotations [18:10:51] [Server thread/INFO] [FML]: Identifying ItemStackHolder annotations [18:10:51] [Server thread/INFO] [FML]: Found 0 ItemStackHolder annotations [18:10:52] [Server thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [18:10:52] [Server thread/INFO] [STDOUT]: [kieranvs.avatar.CommonProxy:registerRenderers:45]: [Avatar] The CommonProxy has loaded. [18:10:52] [Server thread/INFO] [FML]: Applying holder lookups [18:10:52] [Server thread/INFO] [FML]: Holder lookups applied [18:10:52] [Server thread/INFO] [FML]: Injecting itemstacks [18:10:52] [Server thread/INFO] [FML]: Itemstack injection complete [18:10:52] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Loading properties [18:10:52] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Default game type: SURVIVAL [18:10:52] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Generating keypair [18:10:52] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Starting Minecraft server on 192.168.1.140:25565 [18:10:53] [Server thread/INFO] [STDOUT]: [com.example.examplemod.ExampleMod:init:18]: DIRT BLOCK >> tile.dirt [18:10:53] [Server thread/INFO] [FML]: Injecting itemstacks [18:10:53] [Server thread/INFO] [FML]: Itemstack injection complete [18:10:53] [Server thread/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods [18:10:53] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Preparing level "world" [18:10:53] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance [18:10:53] [Server thread/INFO] [FML]: Applying holder lookups [18:10:53] [Server thread/INFO] [FML]: Holder lookups applied [18:10:53] [Server thread/INFO] [FML]: Loading dimension 0 (world) (net.minecraft.server.dedicated.DedicatedServer@e2eda86) [18:10:53] [Server thread/INFO] [FML]: Loading dimension 8 (world) (net.minecraft.server.dedicated.DedicatedServer@e2eda86) [18:10:53] [Server thread/INFO] [FML]: Loading dimension 1 (world) (net.minecraft.server.dedicated.DedicatedServer@e2eda86) [18:10:53] [Server thread/INFO] [FML]: Loading dimension -1 (world) (net.minecraft.server.dedicated.DedicatedServer@e2eda86) [18:10:53] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Preparing start region for level 0 [18:10:54] [Server thread/INFO] [net.minecraft.server.MinecraftServer]: Preparing spawn area: 54% [18:10:54] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Done (1.639s)! For help, type "help" or "?" [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.net.UnknownHostException: modupdate.ddns.net [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.AbstractPlainSocketImpl.connect(Unknown Source) [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.PlainSocketImpl.connect(Unknown Source) [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.SocksSocketImpl.connect(Unknown Source) [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.connect(Unknown Source) [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.connect(Unknown Source) [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.<init>(Unknown Source) [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.<init>(Unknown Source) [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at kieranvs.avatar.UpdateChecker.run(UpdateChecker.java:30) [18:11:03] [Thread-8/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.lang.Thread.run(Unknown Source) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.net.UnknownHostException: modupdate.ddns.net [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.AbstractPlainSocketImpl.connect(Unknown Source) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.PlainSocketImpl.connect(Unknown Source) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.SocksSocketImpl.connect(Unknown Source) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.connect(Unknown Source) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.connect(Unknown Source) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.<init>(Unknown Source) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.<init>(Unknown Source) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at kieranvs.avatar.UpdateChecker.run(UpdateChecker.java:30) [18:11:03] [Thread-9/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.lang.Thread.run(Unknown Source) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.net.UnknownHostException: modupdate.ddns.net [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.AbstractPlainSocketImpl.connect(Unknown Source) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.PlainSocketImpl.connect(Unknown Source) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.SocksSocketImpl.connect(Unknown Source) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.connect(Unknown Source) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.connect(Unknown Source) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.<init>(Unknown Source) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.<init>(Unknown Source) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at kieranvs.avatar.UpdateChecker.run(UpdateChecker.java:30) [18:21:05] [Thread-10/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.lang.Thread.run(Unknown Source) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.net.UnknownHostException: modupdate.ddns.net [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.AbstractPlainSocketImpl.connect(Unknown Source) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.PlainSocketImpl.connect(Unknown Source) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.SocksSocketImpl.connect(Unknown Source) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.connect(Unknown Source) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.connect(Unknown Source) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.<init>(Unknown Source) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.net.Socket.<init>(Unknown Source) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at kieranvs.avatar.UpdateChecker.run(UpdateChecker.java:30) [18:31:06] [Thread-11/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]:     at java.lang.Thread.run(Unknown Source)  
  • Topics

  • Who's Online (See full list)