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

Posted

I know this is a silly question to ask but is there a way to get the chat right after the players name?  I need to check if the players name is in chat and it keeps firing when that user sends a message.  Its a client ONLY mod so I cant use any server methods.

 

Also, is there a way to play a sound that overrides the minecraft sound settings and plays even if sound is turned off?

Thanks,

~Shaun O'Neill

View my website at -> http://www.xelitexirish.com/

You can nearly always contact me on my twitter (XeliteXirish)

  • Author

Scratch the top one off the list, sorry I managed to figure out how to do it.

 

Just need a way to play a sound overriding the sound settings?

View my website at -> http://www.xelitexirish.com/

You can nearly always contact me on my twitter (XeliteXirish)

  • Author

how about u tell us which version u are in?

in 1.7 there is PlaySoundEvent

 

Sorry forgot to mention that haha, its Minecraft 1.8 with newest forge version.

View my website at -> http://www.xelitexirish.com/

You can nearly always contact me on my twitter (XeliteXirish)

I know you may already have the first one solved, but in case others don't know, and would like to know, you can subscribe to the ClientChatReceivedEvent and use regex to separate the player name from the chat.

 

	try {
		if (event.type == 0) {
			UUID player = null;
			Pattern p = Pattern.compile("\\<(.*?)\\>");
			Matcher m = p.matcher(event.message.getUnformattedText());
			while (m.find()) {
				String s = m.group(1);
				for (EntityPlayer ep:(List<EntityPlayer>)Minecraft.getMinecraft().theWorld.playerEntities) {
					if (ep.getName().equals(s)) {
						player = ep.getUniqueID();
						break;
					}
				}
			}
			if (player != null && event.message.getFormattedText() != null) {
				String chat =  event.message.getFormattedText().replaceFirst("\\<(.*?)\\> ", "");
			}
		}
	} catch (Exception e) {
		e.printStackTrace();
	}

  • Author

I know you may already have the first one solved, but in case others don't know, and would like to know, you can subscribe to the ClientChatReceivedEvent and use regex to separate the player name from the chat.

 

	try {
		if (event.type == 0) {
			UUID player = null;
			Pattern p = Pattern.compile("\\<(.*?)\\>");
			Matcher m = p.matcher(event.message.getUnformattedText());
			while (m.find()) {
				String s = m.group(1);
				for (EntityPlayer ep:(List<EntityPlayer>)Minecraft.getMinecraft().theWorld.playerEntities) {
					if (ep.getName().equals(s)) {
						player = ep.getUniqueID();
						break;
					}
				}
			}
			if (player != null && event.message.getFormattedText() != null) {
				String chat =  event.message.getFormattedText().replaceFirst("\\<(.*?)\\> ", "");
			}
		}
	} catch (Exception e) {
		e.printStackTrace();
	}

 

Just out of curiosity, can you not just split the chat by every space and just check everything after the first word which is always the player name?  Thats what I did and it seems to be okay.

View my website at -> http://www.xelitexirish.com/

You can nearly always contact me on my twitter (XeliteXirish)

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.