How can I get a random player's name in ScriptAPI?
Solved
ScriptAPI
-
array of NetworkPlayerInfos
playerInfos = Java.from(mc.getNetHandler().getPlayerInfoMap())
array of names
playerNames = playerInfos.map(function (info) info.getGameProfile().getName())
getting a random name
playerInfos.random().getGameProfile().getName()
or
playerNames.random()
if you don't use Core then just skid the random() function thx
https://github.com/CzechHek/Core/blob/15d49a96a9423bd03dc2981392fae61b433122c8/Core.lib#L359 -