hi I’m trying to bind a serversocket to my spigot server, but it says the port is already used. Does this mean here’s is already a server socket running? If so, how can I get that socket?
The port of your server socket cannot be the same as the server port or any other port in use. If you're using an online hosting service check what ports you have available.
well yeah, but my other servers need to know what port the socket is running on. is there a way to send messages to another server w/o dealing with ports? is it possible to send a custom Minecraft packet from bungeecord to spigot or from a spigot server to another? edit: even w/o players online
I created a plugin where you have to enter the addresses of the other servers including the port the ServerSocket object of their plugin runs on in a configuration file. You also have to register the port the ServerSocket object of this plugin will use there.
BungeeCord messaging channel is not in-game chat. https://www.spigotmc.org/wiki/bukkit-bungee-plugin-messaging-channel/
would creating a fake entityplayer make the spigot/bungee messaging stuff work? Would the data still send even if the fake player is the only one "online"?
i thought this would work, but creating an entityplayer doesn't seem to change the online player count. Code (Text): MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer(); WorldServer nmsWorld = ((CraftWorld)Bukkit.getWorlds().get(0)).getHandle(); GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "3fi48hyfkdihjfh"); EntityPlayer npc = new EntityPlayer(nmsServer, nmsWorld, gameProfile, new PlayerInteractManager(nmsWorld)); npc.setLocation(0, 0, 0, 0, 0); do you know how to create an entityplayer that affects the Bukkit#getOnlinePlayers() Collection?
You are trying to use NMS? NMS makes your plugin version dependant. Maybe you are ok with this, and don't care. Just for me I don't like my plugin to be version dependant.
To change the count can't you just add a player to the list. Code (Text): Bukkit.getOnlinePlayers().add(*player*);