interacting with other users in the system #77
Replies: 1 comment
-
Chat support is very limited, and only a very small part of the full chat system is implemented. I'd say your best move would indeed be to use GetRawText() on the chat object and directly parse the json from here to extract the name. Be careful though because all servers don't send chat in the same way (paper servers send a much more complicated json than vanilla for example). Your solution would thus not be compatible with any server. But if you know you'll always use it on one type of server, you should go with this approach.
You're right. I don't even remember what this from thing is or why it's here. That's one of those things that were added like 4 years ago and never changed since.
Correct. There is currently no support for the "tab" thing with names and ping of logged in players. I'm not even sure which packet is used for it.
Basically you can't. At the moment, UUID are not stored in entities, correct. But even if they were, that wouldn't be a solution for you anyway because player entities only exist if you're "close" to them. Not for all logged in players. So if you receive a chat message from someone far away (i.e. not in the entity render distance range), you wouldn't have an associated entity. Neither in botcraft nor in vanilla minecraft. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I would like to make it possible that other players send commands to my bot.
For that I need to know who send it.
See #61
It looks like the GetFrom of a chat-message is always empty so I don't know who sent the command.
Also I don't think there's a way of finding who's logged in so that I could just iterate through the list and let people mention their name in the chat-message?
ClientboundChatPacket has a GetSender but I can't find a way of mapping a UUID-type to a username or Entity object?
I could invoke GetRawText() on the chat-message and interpret the json, but how can I find then the Entity-object that belongs to it? (to find the coordinates of the user).
Beta Was this translation helpful? Give feedback.
All reactions