Posted April 13, 20187 yr How do i send a Message to a specific Player? i tried following: EntityPlayer p = Minecraft.getMinecraft().world.getPlayerEntityByName(playername); if (p != null) { p.sendMessage(new TextComponentString(msg); } but this only causes the Message to appear on my own Chat. The addChatMessage also seem not to work anymore, so how is the new way? Can i prevent it from appearing in chat (gets handled by ClientChatReceivedEvent)
April 13, 20187 yr 2 hours ago, ChiroxT said: Minecraft.getMinecraft() This is the client. Not the server. This will crash the server. The only player here will be the local user. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
April 13, 20187 yr Author Okay, then how I do get the meant player? I saw some stuff with Player lists, but them didnt worked for me either.
April 13, 20187 yr 1) You have to do it server side 2) Use the server's player list Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
April 13, 20187 yr https://mcforge.readthedocs.io/en/latest/networking/simpleimpl/ Always looking for new challenges, and happy to help the people where ever I can
April 16, 20187 yr Author On 14.4.2018 at 4:24 PM, diesieben07 said: This is not applicable here. So, then what in your oppinion is applicable here??? Edited April 16, 20187 yr by ChiroxT
April 16, 20187 yr Author 55 minutes ago, diesieben07 said: You need to call EntityPlayer::sendMessage on the server. That is as specific as I can get, because you have not specified when or how exactly you want these messages to be sent. This is a Guild System and this feature is for inviting players. The Leader enters the name in a Textbox and presses a button. This shall send a Message to this specific Player which gets handled by ClientChatReceivedEvent, which shows a Accept/Refuse dialog. All those Gui's and the function of accepting are working. Just the Message to the player is my last Problem. How can i manage, that the server knows, that it have to send this message. I thought about writing the player- and the guildname into a List, but then, this list must be checked constantly by the server and in case, send the message.
April 16, 20187 yr Author 2 hours ago, diesieben07 said: Why are you doing this via chat messages?! You should be using custom packets, like was said above. Nothing of what you are doing requires chat messages. Maybe because this is my first Forge-Mod??? I did not knew about this feature and tutorials on YT also did not speak about it. I will check it out, but what i were reading for now seemed to be pretty usable just wanna understand it before using it
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.