Posted April 13, 201510 yr I've seen a lot of other mods do it but I can't get mine to be clickable (in the sense that it asks to open it in your browser when you click on it). What am I doing wrong? public class LoadingEvent { private static String url = "http://missapocalypse.wix.com/fandomcraft"; @SubscribeEvent public void playerLogsIn(PlayerLoggedInEvent event) { try { URL site = new URL(url); event.player.addChatMessage(new ChatComponentText("You are playing '" + EnumChatFormatting.RED + "FandomCraft v4S" + EnumChatFormatting.WHITE + ",' singleplayer version of the '" + EnumChatFormatting.GREEN + "Fable Update" + EnumChatFormatting.WHITE + ".'")); event.player.addChatMessage(new ChatComponentText("You can check for updates at " + EnumChatFormatting.GOLD + site)); } catch (MalformedURLException e) { e.printStackTrace(); } } }
April 13, 201510 yr Take a look at the ClickEvent.class as it contains a open url action that will allow you to open your url upon clicking the text. Aether II Developer
April 14, 201510 yr Take a look at what I have in my mod: https://github.com/Zalth-One-Three/Zombie-Infection/blob/master/src/main/resources/assets/zombieinfection/lang/en_US.lang#L9 https://github.com/Zalth-One-Three/Zombie-Infection/blob/master/src/main/java/com/zalthonethree/zombieinfection/updatechecker/UpdateChecker.java#L111-112
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.