Posted July 19, 201411 yr Hi there! I can't figure out how to make my tellraw comment to get the clickevent action and open up an url. My code so far: ICommand command = new CommandMessageRaw(); ClickEvent clickevent = new ClickEvent(Action.OPEN_URL, "http://www.google.hu"); CommandMessageRaw.func_152373_a(player, command, "Test", this.equals(clickevent)); //Im not sure about the last parameter. The message appears in the chat but its not clickable. If you can please help me. Thanks!
July 19, 201411 yr I usually open up a browser this way. Create a class like: import java.awt.Desktop; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import net.minecraft.client.gui.ScaledResolution; public class Browser { public static void browse(String parUrl) { // Create Desktop object Desktop d=Desktop.getDesktop(); // Browse a URL, say google.com try { d.browse(new URI(parUrl)); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } ScaledResolution sr; } } Then you can open browser with: Browse.browse("http://www.google.hu"); Check out my tutorials here: http://jabelarminecraft.blogspot.com/
July 19, 201411 yr Author Thats a good way, but not for me. I made a mod update detector that now finally works. If there is an update its have sends a tellraw message what you can click to bring up the mod webpage. I don't want to force the player to open up a webbrowser every time he/she join to a world. Thanks for your help trought!
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.