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 there a way to get the raw sent json from the chat event?

I want to end with the result of something like

{"text":"this is just a text!","color":"red"}

And I belive it'll tell me how to get the commands executed by some clickable text that - lets say - the tellraw command makes..

Doing stuff n' things

  • Author

You really don't want the raw JSON, you want to interact with ITextComponent instead of strings. ITextComponent has a method getStyle which gives you a Style object which allows you to set a ClickEvent for the whole component.

 

no no, i want to use it one time to get it to the console so i could read what the server put in the clickable command.... im not planning to use this on the code after i get this....

 

how can i get the json or just get the commands that clickable chat does?

Doing stuff n' things

  • Author

Do the reverse of what I said then, you can get the click event from the ITextComponent. You can get the components from GuiNewChat which has a field chatLines. The ChatLine class then has a reference to the ITextComponent.

ok you made it a bit too complicated than it should be...

all i asked from the start is get the raw json of a text message....

 

thanks to you i looked a bit more into

ITextComponent

and found

ITextComponent.Serializer.componentToJson(ITextComponent)

which returns the raw json of the component object and that's exactly what i needed as you get the component from the

ClientChatReceivedEvent

and it works perfectly! thanks alot!

 

{TOPIC CLOSED}

Doing stuff n' things

  • Author

You should not be using the raw json...

Why do you want it?

again, this is not something that i would use after in my mod...

its being logged and i know to decipher what i need from it manually......

 

i used it now to test on hypixel soccer game when it says "want to play again? click me!" and took its raw json...

then i got that "/play arcade_soccer" makes you play a game of soccer... there are more commands i can figure with that and such.....

Doing stuff n' things

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.