I am coding a 1.18 Spigot plugin in java and i want to make a line breaker. The problem is to pick the length of it. I would like to send the player a Message like: "_______________________________" but this message should be exacly the length of his chat. Bcs. when my chat is set to small then the message goes over 2 lines. Is this possible or should i just try to find a sweet spot? Help would be awesome ty
Asked
Active
Viewed 488 times
0
-
2You can't, because it depend of the size of the MC screen, the zoom etc... – Elikill58 Feb 14 '22 at 23:45
-
1You can't get the width of someones chat. Just try to make it look good on default settings. – Oliver Stahl Feb 15 '22 at 11:59
-
Chat width is client-side and can't be accessed by a plugin. – nullFoo Feb 16 '22 at 01:52
1 Answers
0
You can't do that. This is because the size of the chat depends on the client version, the size of the Minecraft window. Here are some examples
two lines are the same length

NullPointerException
- 25
- 6