Posted July 24, 20214 yr Here is my code: if (entity instanceof PlayerEntity) { Collection<NetworkPlayerInfo> users = Minecraft.getInstance().getConnection().getOnlinePlayers(); PlayerEntity player2 = (PlayerEntity) entity; specificPlayer.sendMessage(new StringTextComponent(player.getDisplayName().getString() + "evaporated " + player2.getDisplayName().getString() + " using the power of the void."), player.getUUID()); } I have a method of sending a message to a specific player. And a method of grabbing all online players. I'm not the smartest with java and I can't really figure out how to put the two together. I want to be able to send this message to all players, not just one as is currently. If someone could give me an example and explain what they did that would be great. As I said, I'm not the greatest with java (actually a beginner (blah blah I know, shouldn't start Java off with mc modding but here I am)) but coming from other languages like Python I'm a fast learner 😏
July 24, 20214 yr If you do it on the server, you can call ServerWorld#getPlayers and then iterate through the collection, sends a message to each player. If this somehow triggers on the client, you need a packet.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.