-
[1.12.2] Saving a value to a Player
I am currently trying to find a way to see if something has been opened before by the player. If it is the first time, then show the first time menu, after they complete it, change the value to 1 (Meaning it has been setup/opened before). Thus the next time they open it, it will show the menu that is for a "returning" player. I think this might require player data but I have no idea how to use that. Does anyone have any ideas?
-
[Solved] Config Files [1.8.9]
, thanks for your help! I really do appreciate it. I guess its time for waiting.
-
[Solved] Config Files [1.8.9]
Hey, I truly am thankful for your help, but sadly it isn't working for me, just a reminder, I'm running 1.8.9 so I don't know if things are different or if you are also testing in that version. This is what I have now, @EventHandler public static void preInit(FMLPreInitializationEvent event) { File configFile = new File(Loader.instance().getConfigDir(), "keymod.cfg"); Configuration config = new Configuration(configFile); config.load(); Property isOn = config.get("test", "test value", 100); int update = isOn.getInt(); if (config.hasChanged()) { config.save(); proxy.registerKeyBindings(); } } I had to make an assumption that the update variable was an int. Sadly, once again when loading the game, under mod options, the config button is grayed out.
-
[Solved] Config Files [1.8.9]
Thank you for the reply, I have some questions. @EventHandler public static void preInit(FMLPreInitializationEvent event) { File configFile = new File(Loader.instance().getConfigDir(), "keymod.cfg"); Configuration config = new Configuration(configFile); config.load(); Property update = config.get("Update Checker", "Whether or not the Update Checker runs.", 50); if(config.hasChanged()) config.save(); proxy.registerKeyBindings(); } First, does everything go under preInit? Second, the variables config and update had some errors so I guessed the class for them, are they supposed to be something else? When I ran the game, under mod options, the config didn't load so I don't know if I did this wrong or not.
-
[Solved] Config Files [1.8.9]
Hello again, I have been searching and attempting multiple methods on creating configuration files but I have not succeeded at all. My mod has a version checker and I would like to add a config option to disable it. Does anyone know how to create one?
-
Send Client Side Message to Player when joining Server [1.8.9]
Thank you so much!!! That worked!
-
Send Client Side Message to Player when joining Server [1.8.9]
Could you show me an example?
-
Send Client Side Message to Player when joining Server [1.8.9]
Thanks for your help, I tried PlayerLoggedInEvent but I wasn't sure how to make it show even when you join a server, it only seems to work on Single Player worlds.
-
Send Client Side Message to Player when joining Server [1.8.9]
Hello! I am creating a Version Checker for my mod but I want the message to display not only in single player worlds, but when you join a server as well. @SubscribeEvent public void onConnectedToServerEvent(FMLNetworkEvent.ClientConnectedToServerEvent event) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("PlaceHolder")); } The problem is that the game can't seem to get the player and returns a Null Pointer Exception. I've tried tons of ways to get around this but I haven't figured one out. Thank you for the help!
IPS spam blocked by CleanTalk.