Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Author

I'm new in Java and in Minecraft modding.

This is good? "PlayerEvent pe = new PlayerEvent(player);"

  • 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.

  • 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.

  • Author

I need to execute the command with the content of the txt file.

  • 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.

  • 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)

  • 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? :\

  • 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.

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.