Posted May 12, 20205 yr I'm looking to send this message if a mod is not installed to the chat: 'To use all the features of this item, please install the latest version of 'The Midnight', which can be found here' I've already got everything in place for checking if the mod is installed, but I don't know where to go from here, a code example would be incredibly helpful to me! What I've already got: if(ModList.get().isLoaded("midnight")) { if (worldIn.isRemote) { playerIn.sendMessage(/*a hyperlinked message*/); } } Thank you for your time and help! Edited May 12, 20205 yr by squidlex
May 13, 20205 yr Author 6 hours ago, diesieben07 said: You need to give a ClickEvent to an ITextComponent via it's Style (ITextComponent#getStyle). Thanks for your help! I now have myMessage.getStyle().setClickEvent() But I don't know how to actually provide a link.
May 13, 20205 yr ClickEvent.Action.OPEN_URL Have you ever want the new operator to return a type that you didn't ask for? Well, now you can!
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.