September 30, 201411 yr Author I'm new in Java and in Minecraft modding. This is good? "PlayerEvent pe = new PlayerEvent(player);"
September 30, 201411 yr Author package mods.Gunscraft; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.KeyEvent; import java.io.BufferedReader; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.InputStreamReader; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.GuiOptions; import net.minecraft.client.gui.ScreenChatOptions; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.client.event.GuiOpenEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; import cpw.mods.fml.common.network.FMLNetworkEvent; public class Events { @SubscribeEvent public void loginEvent(FMLNetworkEvent.ClientConnectedToServerEvent event) { EntityPlayer player = null; PlayerEvent pe = new PlayerEvent(player); MinecraftServer.getServer().getCommandManager().executeCommand(player, "login ciao"); } } Show me how you would do.
September 30, 201411 yr Author I need to take the contents of a txt file in .minecraft folder and use it in Java. The event must be client-side.
September 30, 201411 yr Author I don't host the server. The server is in a remote host, and the host don't have a .minecraft folder. A minecraft server don't have a .minecraft folder.
September 30, 201411 yr Author If I use "Minecraft.getMinecraft().thePlayer.sendChatMessage()" in multiplayer, I get this crash: ---- Minecraft Crash Report ---- // Daisy, daisy... Time: 30/09/14 18.46 Description: Ticking screen java.lang.NullPointerException: Ticking screen at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:110) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) at net.minecraft.client.multiplayer.GuiConnecting.updateScreen(GuiConnecting.java:116) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1751) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) at net.minecraft.client.Minecraft.run(Minecraft.java:961) at net.minecraft.client.main.Main.main(Main.java:164) 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.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 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 GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:55) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:110) at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247) at net.minecraft.client.multiplayer.GuiConnecting.updateScreen(GuiConnecting.java:116) -- Affected screen -- Details: Screen name: net.minecraft.client.multiplayer.GuiConnecting Stacktrace: at net.minecraft.client.Minecraft.runTick(Minecraft.java:1751) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) at net.minecraft.client.Minecraft.run(Minecraft.java:961) at net.minecraft.client.main.Main.main(Main.java:164) 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.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 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 GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:55) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_67, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 957437624 bytes (913 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available mod_Gunscraft{1.0} [Gunscraft Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: AMD Radeon R9 200 Series GL version 4.3.12682 Compatibility Profile Context 13.301.1001.0, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: Italiano (Italia) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
September 30, 201411 yr Author The real problem is: I have a custom launcher modified by me with a custom login database made by me. The launcher start a custom client that is made for enter in a server. The launcher is open source and if a player modify the source and toggle the password option can enter in any account. So I thinked: this launcher create a txt file with the password and when the player enters the server the client take the password and execute the "/login pass". I do this because so much people don't know how tu use "/register pass pass" and "/login pass" commands. There are other solutions? :\
October 1, 201411 yr Author I need it because I have a custom client with a server and if that login system doesn't exist, all the player can enter in the server with any account.
October 1, 201411 yr Author How I add a new parameter (as username, password, version, assetIndex, assetsDir...) in the client?
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.