Jump to content

CoalOres

Members
  • Posts

    86
  • Joined

  • Last visited

Everything posted by CoalOres

  1. Why is it so difficult to convey things to you . I meant the corrected version of MY code. I have no idea how to put that into my code. It would save a lot of time if I could just have it fixed and then try to understand from that. No one is going to provide you code that you can copy and paste. You have top actually know what you're doing. You apparently missed the "this is not Java school" on the board description. Good news: that info is also in my sig. Helpful comment is helpful. The majority of stuff said in this post could be on the first page. I've had an issue getting the arguments to work at all.
  2. I've done so and it doesn't even come with any reason at all. That was my initial problem, none of the arguments actually came up.
  3. Why is it so difficult to convey things to you . I meant the corrected version of MY code. I have no idea how to put that into my code. It would save a lot of time if I could just have it fixed and then try to understand from that.
  4. Simpler imho: Joiner.on("").join(strings); Or some Java 8 magic: Stream.of(strings).join(Collectors.joining()); Jesus... you are not supposed to just copy the code. You are supposed to understand it and adapt it to your situation. I understand now, just threw me off with the Strings thing, didn't realise I needed to replace it with args. I would have written it for(String s: (strings)), that would have made more sense to me because it was in brackets. Either way I understand now, still don't know how to incorporate it. Be nice if you could just send me a corrected version.
  5. How do I incorporate that bottom thing? I've got to this stage: String res = ""; { for (String s : args) { res += s + " "; }}
  6. The reason isn't working for some reason. New Code: Main: package com.testmod; import com.testmod.SampleCommand; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @Mod(modid="testmod", name="Test Mod", version="1.0", clientSideOnly = true) public class TutorialMain { // The instance of your mod that Forge uses, in my case tutorial. @Instance("testmod") public static TutorialMain instance; @EventHandler public void preInit(FMLPreInitializationEvent event) { // Stub Method MinecraftForge.EVENT_BUS.register(new ChatListener()); } @EventHandler public void init(FMLInitializationEvent event) { ClientCommandHandler.instance.registerCommand(new SampleCommand()); } @EventHandler public void postInit(FMLPostInitializationEvent event) { // Stub Method } } SampleCommand: package com.testmod; import java.util.ArrayList; import java.util.List; import eu.copybara.barra.util.*; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; public class SampleCommand extends CommandBase { @Override public boolean canCommandSenderUse(ICommandSender icommandsender) { // TODO Auto-generated method stub return true; } @Override public void execute(ICommandSender icommandsender, String[] args) throws CommandException { // TODO Auto-generated method stub if (ChatListener.isAFK == false) { ChatListener.isAFK = true; icommandsender.addChatMessage(new ChatComponentText("You are now AFK!")); return; } if (ChatListener.isAFK == true) { ChatListener.isAFK = false; icommandsender.addChatMessage(new ChatComponentText("You are no longer AFK!")); return; } if (args.length == 1){ ChatListener.reason = args[0].toString(); ChatListener.isAFK = true; } } @Override public String getCommandUsage(ICommandSender icommandsender) { // TODO Auto-generated method stub return "afk <reason>"; } @Override public String getName() { // TODO Auto-generated method stub return "afk"; } @Override public boolean isUsernameIndex(String[] arg0, int arg1) { // TODO Auto-generated method stub return false; }} ChatListener: package com.testmod; import net.minecraft.client.Minecraft; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class ChatListener { public static boolean isAFK = false; public static String reason = ""; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { String message = event.message.getUnformattedText(); if (message.contains("From") && isAFK) { Minecraft.getMinecraft().thePlayer.sendChatMessage("/r I am currently AFK. Reason: " + ChatListener.reason); } } } If I do /afk <reason> it just comes up with whatever I had it preset to in the code, which in this case is "".
  7. And why is it still there? ... Well, static state is always bad, because it hurts maintainability, etc. Ideally you'd want this in like a capability on the player, but that is overkill for now. What... that is not how Java works. I guess you could do that, yes. But as you can see this is already getting kinda messy Would this segment of code work? if (args.length == 1){ ChatListener.reason = args[0].toString(); ChatListener.isAFK = true;
  8. What do you mean by "// Stub Method"? Why is this here? It does precisely nothing. Pretty ugly to just have it in a global variable somewhere, but I suppose this will work. Why is this still here? How many times do I need to say this? Also why do all your methods still have the stupid comment from Eclipse inside them?! This is not how you check a boolean variable. This if statement will never run. = means assign, not compare. You want ==. Please learn basic Java. Same as above, why is this still here? 1. It's something generated automatically by eclipse. 2.It may do in the future, all of the tutorials I have seen recommend keeping those for the future. 3. Anyway I could make it neater? It was a post I saw on stack overflow. 4. I thought anything that returns false or 0 was important, but anything which returned null wasn't. 5. I'm sorry, it was a mistake I won't make again. 6. 4 And how do I add a reason to it? Another global string called reason which I modify in the SampleCommand class?
  9. Didn't help, but if I set the isAfk variable to true beforehand the /r function works, upon doing it again it says "No longer afk" constantly and doesnt work.
  10. There are two possible places for this, which are you referring to? Here if (ChatListener.isAFK = false) { ChatListener.isAFK = true; icommandsender.addChatMessage(new ChatComponentText("You are now AFK!")); return; } If this doesn't work it is not being called. I use that and it only comes up with the "Hello" message, not the "You are now AFK!". Then it is never making it into the if statement, or it can't send the message try removing the help message. Removed the help message and this time it came up with nothing. I don't really understand how the code you sent me is going to work, what if isAfk = true? Then it does nothing and doesn't set it to false so it just doesn't work. Was I supposed to use two of those if statements? <-- Will try Edit: Having two statements returned "No longer afk" constantly. I feel like it isn't setting the variable to true.
  11. There are two possible places for this, which are you referring to? Here if (ChatListener.isAFK = false) { ChatListener.isAFK = true; icommandsender.addChatMessage(new ChatComponentText("You are now AFK!")); return; } If this doesn't work it is not being called. I use that and it only comes up with the "Hello" message, not the "You are now AFK!".
  12. There are two possible places for this, which are you referring to?
  13. One more issue, bit more advanced now: Main: package com.testmod; import com.testmod.SampleCommand; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @Mod(modid="testmod", name="Test Mod", version="1.0") public class TutorialMain { // The instance of your mod that Forge uses, in my case tutorial. @Instance("testmod") public static TutorialMain instance; @EventHandler public void preInit(FMLPreInitializationEvent event) { // Stub Method MinecraftForge.EVENT_BUS.register(new ChatListener()); } @EventHandler public void init(FMLInitializationEvent event) { ClientCommandHandler.instance.registerCommand(new SampleCommand()); } @EventHandler public void postInit(FMLPostInitializationEvent event) { // Stub Method } } ChatListener: package com.testmod; import net.minecraft.client.Minecraft; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class ChatListener { public static boolean isAFK = false; @SubscribeEvent public void onChat(ClientChatReceivedEvent event) { String message = event.message.getUnformattedText(); if (message.contains("From") && isAFK) { Minecraft.getMinecraft().thePlayer.sendChatMessage("/r I am currently AFK. Reason: "); } } } SampleCommand: package com.testmod; import java.util.ArrayList; import java.util.List; import eu.copybara.barra.util.*; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; public class SampleCommand extends CommandBase { @Override public int compareTo(Object o) { // TODO Auto-generated method stub return 0; } @Override public boolean canCommandSenderUse(ICommandSender icommandsender) { // TODO Auto-generated method stub return true; } @Override public void execute(ICommandSender icommandsender, String[] arg1) throws CommandException { // TODO Auto-generated method stub icommandsender.addChatMessage(new ChatComponentText("Hello")); if (ChatListener.isAFK = false) { ChatListener.isAFK = true; icommandsender.addChatMessage(new ChatComponentText("You are now AFK!")); } else if (ChatListener.isAFK = true) { ChatListener.isAFK = false; icommandsender.addChatMessage(new ChatComponentText("You are no longer AFK!")); } } @Override public String getCommandUsage(ICommandSender icommandsender) { // TODO Auto-generated method stub return "afk <reason>"; } @Override public String getName() { // TODO Auto-generated method stub return "afk"; } @Override public boolean isUsernameIndex(String[] arg0, int arg1) { // TODO Auto-generated method stub return false; }} When I do /afk it returns "You are no longer AFK!" constantly, never does the /r and also never says the "You are now AFK!".
  14. No, you should remove those methods. Why are they there? Don't just have stuff in your code that you do not understand. First of all, you will need a client-side command, not a server command like you are registering currently. Client commands are registered using ClientCommandHandler . To detect the receiving string you need to use ClientChatReceivedEvent . Alright, so this is my new code: Main: package com.testmod; import com.testmod.SampleCommand; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @Mod(modid="testmod", name="Test Mod", version="1.0") public class TutorialMain { // The instance of your mod that Forge uses, in my case tutorial. @Instance("testmod") public static TutorialMain instance; @EventHandler public void clientLoad(ClientCommandHandler clientcommandhandler) { // register server commands clientcommandhandler.instance.registerCommand(new SampleCommand()); } @EventHandler public void preInit(FMLPreInitializationEvent event) { // Stub Method } @EventHandler public void init(FMLInitializationEvent event) { } @EventHandler public void postInit(FMLPostInitializationEvent event) { // Stub Method } } SampleCommand: package com.testmod; import java.util.ArrayList; import java.util.List; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; public class SampleCommand extends CommandBase { @Override public int compareTo(Object o) { // TODO Auto-generated method stub return 0; } @Override public boolean canCommandSenderUse(ICommandSender icommandsender) { // TODO Auto-generated method stub return true; } @Override public void execute(ICommandSender icommandsender, String[] arg1) throws CommandException { // TODO Auto-generated method stub icommandsender.addChatMessage(new ChatComponentText("Hello")); } @Override public String getCommandUsage(ICommandSender icommandsender) { // TODO Auto-generated method stub return "coal"; } @Override public String getName() { // TODO Auto-generated method stub return "coal"; } @Override public boolean isUsernameIndex(String[] arg0, int arg1) { // TODO Auto-generated method stub return false; }} I removed all the methods that returned null, and used a syntax I found online for ClientCommandHandler. Edit: I added the register command to the init and it worked!
  15. This feature exists in other mods and works, I'm fairly sure that all you do is detect a "From" string in the chat, messages appear like this: "From Player117: Want to play a game?" and the "From" part is pink, so you could detect it I think.
  16. That's what I mean, I want it to send THROUGH MY PLAYER "/r" which is the /reply command.
  17. The syntax would be: /afk <reason> And whenever somebody messaged you (could detect this by the pink "From" in chat) it would send "/r I am currently afk" + reason to the chat. This was a simple test to see if I could have it print something to the chat upon a command.
  18. That would have been nice to know before hand. How does one create a client side mod then? Because all of the tutorials I have seen followed this exact procedure.
  19. How do you expect a server-side command that you added to work on a server that is not yours? This crash happens because you are still overriding all those methods to perform nonsense instead of their actual intended function. 1. So I need to rename these things to something else? Anything of my choosing? And how am I supposed to change the parameters? Won't that screw stuff up? 2. I'm attempting to make a client side mod, eventually for convenience, for example a /afk command which will /reply to anybody who messages you after you have done /afk.
  20. What kind of server? Does it have your mod installed? If so: How? Post the full crash. 1. I really don't understand what I'm overriding, how I'm doing it and what effect it is having, this is one of my first times modding. 2. It's Hypixel, so of course it doesn't have my mod installed. 3. Crash: Caught exception from testmod java.lang.NullPointerException at net.minecraft.command.CommandHandler.registerCommand(CommandHandler.java:138) ~[forgeBin-1.8-11.14.1.1334.jar:?] at net.minecraftforge.fml.common.event.FMLServerStartingEvent.registerServerCommand(FMLServerStartingEvent.java:44) ~[forgeBin-1.8-11.14.1.1334.jar:?] at com.testmod.TutorialMain.serverLoad(TutorialMain.java:27) ~[bin/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518) ~[forgeBin-1.8-11.14.1.1334.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[forgeBin-1.8-11.14.1.1334.jar:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[forgeBin-1.8-11.14.1.1334.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?] at net.minecraftforge.fml.common.Loader.serverStarting(Loader.java:738) [Loader.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.handleServerStarting(FMLCommonHandler.java:319) [FMLCommonHandler.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:128) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:438) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101] [21:00:10] [server thread/ERROR]: A fatal exception occurred during the server starting event java.lang.NullPointerException at net.minecraft.command.CommandHandler.registerCommand(CommandHandler.java:138) ~[forgeBin-1.8-11.14.1.1334.jar:?] at net.minecraftforge.fml.common.event.FMLServerStartingEvent.registerServerCommand(FMLServerStartingEvent.java:44) ~[forgeBin-1.8-11.14.1.1334.jar:?] at com.testmod.TutorialMain.serverLoad(TutorialMain.java:27) ~[bin/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:518) ~[forgeBin-1.8-11.14.1.1334.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_101] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) ~[LoadController.class:?] at net.minecraftforge.fml.common.Loader.serverStarting(Loader.java:738) [Loader.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.handleServerStarting(FMLCommonHandler.java:319) [FMLCommonHandler.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:128) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:438) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101] [21:00:10] [server thread/INFO]: Applying holder lookups
  21. package com.testmod; import java.util.ArrayList; import java.util.List; import eu.copybara.barra.util.*; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; public class SampleCommand extends CommandBase { public int compareTo(Object o) { // TODO Auto-generated method stub return 0; } public List addTabCompletionOptions(ICommandSender icommandsender, String[] arg1, BlockPos arg2) { // TODO Auto-generated method stub return null; } public boolean canCommandSenderUse(ICommandSender icommandsender) { // TODO Auto-generated method stub return true; } public void execute(ICommandSender icommandsender, String[] arg1) throws CommandException { // TODO Auto-generated method stub icommandsender.addChatMessage(new ChatComponentText("Hello")); } public List getAliases() { // TODO Auto-generated method stub return null; } public String getCommandUsage(ICommandSender icommandsender) { // TODO Auto-generated method stub return "coal"; } public String getName() { // TODO Auto-generated method stub return "coal"; } public boolean isUsernameIndex(String[] arg0, int arg1) { // TODO Auto-generated method stub return false; }} Main: package com.testmod; import com.testmod.SampleCommand; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @Mod(modid="testmod", name="Test Mod", version="1.0") public class TutorialMain { // The instance of your mod that Forge uses, in my case tutorial. @Instance("testmod") public static TutorialMain instance; @EventHandler public void serverLoad(FMLServerStartingEvent event) { // register server commands event.registerServerCommand(new SampleCommand()); } @EventHandler public void preInit(FMLPreInitializationEvent event) { // Stub Method } @EventHandler public void init(FMLInitializationEvent event) { } @EventHandler public void postInit(FMLPostInitializationEvent event) { // Stub Method } }[code] As I said, I click the "Run" button on eclipse, it opens Minecraft, I go onto a server (have to because single player crashes it for some reason) and do /coal. Note: When it crashes on singleplayer it returns this on the console: The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED. Errors may have been discarded. The state engine was in incorrect state ERRORED and forced into state AVAILABLE. Errors may have been discarded.
  22. You told me to override all the methods I need, so I thought I needed to remove the "@Override" for all the methods that returned null. And I'm running it through eclipse with the run function, logged into my Minecraft account. Edit: Just removed the overrides, still nothing.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.