Jump to content

Bets

Members
  • Posts

    153
  • Joined

  • Last visited

Everything posted by Bets

  1. Changed it to this one: @EventHandler public void serverLoad(ClientCommandHandler event) { event.registerCommand(new testCommand()); } Now it doesn't work not in single and not on multiplayer. I think I tried using this before and it just didn't work so I used the server one.
  2. No, it should be a Client only command.
  3. Oh! this makes sense lol, will definitely try that!
  4. If by @Mod class you mean the main class that has the mod name in it, then yes, it is. This is the test command class: public class testCommand extends CommandBase { @Override public String getCommandName() { return "test"; } @Override public String getCommandUsage(ICommandSender sender) { return "/<command>"; } @Override public int getRequiredPermissionLevel() { return 0; } @Override public boolean canCommandSenderUseCommand(ICommandSender sender) { return true; } @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (sender instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) sender; player.addChatComponentMessage(new ChatComponentText("Works!")); } } }
  5. Yeah this is what I was doing: @EventHandler public void serverLoad(FMLServerStartingEvent event) { event.registerServerCommand(new testCommand()); }
  6. It's pretty straight forward here. When I play in a singleplayer world the command works, you can find it using TAB as-well. But when I play on multiplayer the command does not work at all, like it doesn't exist. Do I need to configure it to work on a server too somehow? I am extending CommandBase in my class file.
  7. Probably everytime you join a specific server. Will that make it run when you join a specific server like I said before? (or even work at all? I just need to check if it loads the JSON when you use the Client)
  8. By work I mean make the function run. because currently it's just sitting there and doing nothing. I did make an other function that works in the same class, this is the working one: @SubscribeEvent public void onRenderText(RenderGameOverlayEvent.Text e) { //RENDER SCREEN TEXT HERE } So how can I make the second one to work like this too? I changed the name of the function before from main to something else, but how can I get Forge to recognize it and run it.
  9. How can I basically make the function work because I have one that has a @SubscribeEvent above it. and it works. So should I just do the same to this one or there's something else there?
  10. Yeah but the thing I need to do to the function I mentioned before is what? add something like @SubscribeEvent?
  11. Well, I'm a little new to Forge so I'm not sure how exactly to do that! but I have an FMLPreInitializationEvent in my main class, is that it? it's registering an event_bus to the other class I have there.
  12. So I need to invoke it from the main class? if so how can I do that
  13. Well inside a second class file I have I use a public static void function - for some reason, it just won't run when I run the Client. It does run only when I run the class file alone. public static void main(String[] args) { System.out.println("Is this working?"); }
  14. I'm not, because I need the text to be centered. I am using ingameGUI.drawCenteredString.
  15. Yeah well I am not familiar with it very much so I'll use this one for now. Oh and for some reason when I run the Client it's not loading the JSON for me, but when I run the class but it's own it does. Do I need to somehow add the functions of the class to the mod? by Maybe?
  16. Look like that's it! thank you thank you
  17. By crashing I mean this, and the only like that is causing this is the line I sent up there, for sure. report: Caused by: java.lang.NoClassDefFoundError: okio/BufferedSource at okhttp3.internal.Util.<clinit>(Util.java:48) at okhttp3.OkHttpClient.<clinit>(OkHttpClient.java:122) at me.mods.testingForge.this.that.<clinit>(that.java:14) at me.mods.testingForge.mainClass.preInit(mainClass.java:14) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556) ... 16 more Caused by: java.lang.ClassNotFoundException: okio.BufferedSource at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 47 more Caused by: java.lang.NullPointerException at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ... 49 more
  18. Hello there! I tried loading JSON data to my mod using OkHttpClient. for some reason when the client loads it just crushes itself. I checked what is causing this and this line was the problematic one (99% certain). public static OkHttpClient APIClient = new OkHttpClient(); Do you guys know why is this happening? and maybe how can I fix this? thanks!
  19. Btw, is there a way to make the text not have drop shadow and still be centered?
  20. I did this. but when I type for example ScaledResolution. (and than ctrl+space) it gives me nothing to work with for some reason EDIT: Nvm I got it to work now, thanks!
  21. Can't create an instance, no idea why isn't it working. Can you maybe write it here?
  22. Yeah so how can I use this
  23. Where is it, I can't find it in Minecraft.getMinecraft()
  24. This what I did, as mentioned before: mc.displayHeight - 100 Doesn' work. when I change the screen size vertically it moves the text down for some weird reason.
×
×
  • Create New...

Important Information

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