I am new to creating a forge mod and was curious on how I could create a custom command that simply gets the position of every player in the server. I have already created the block of code necessary to do that, I just don't know how to create a command in the forge mod.
Player p = (Player) sender;
List<Location> locations = Bukkit.getOnlinePlayers().stream().map(Entity::getLocation).collect(Collectors.toList());
p.chat(locations.toString());