Posted July 28, 201510 yr I am working on a mod, and I need to be able to disconnect with a custom message. Any help?
July 28, 201510 yr Author ((EntityPlayerMP) player).playerNetServerHandler.kickPlayerFromServer(<msg>) I cant cast EntityClientPlayerMP to EntityPlayerMP (Minecraft.getMinecraft().thePlayer) I am using this in a ClientTickEvent, what should I do?
July 28, 201510 yr Author You can't disconnect the player on the client, at least not with a custom message. I think its possible, I saw Hack clients do it before!
July 28, 201510 yr Author You are talking about the message that appears in chat? No, you cannot change that at all from the client. Example. Huzuni has this thing called AutoDisconnect, how does that work?
July 29, 201510 yr Author I have no idea what that is or does. It basically disconnects you with a custom message. I tried to decompile the jar and see, but it was obfuscated
July 29, 201510 yr Author You are talking about the message that appears in chat? Not in chat. The disconnect message... (In Bukkit, e.getReason() in the PlayerDisconnectEvent.)
July 29, 201510 yr Author This reason is determined serverside and not set by the client at all. Can I send illegal characters or something to do this?
July 29, 201510 yr Author No. why not. Can you just tell me how to send illegal characters to get kicked out?
July 29, 201510 yr Author You will get kicked out, sure. But you will not be kicked with a custom message. k, now help me out do this?
July 29, 201510 yr Author To disconnect yourself from the server call Minecraft.getMinecraft().theWorld.sendQuittingDisconnectingPacket(); I want to disconnect with the reason "Illegal Characters".
July 29, 201510 yr Author Minecraft.getMinecraft().thePlayer.sendChatMessage("§"); This doesn't kick me out.
July 29, 201510 yr Author Show your code. @SubscribeEvent public void onTick(ClientTickEvent e) { if(this.ad.isPressed()) { Minecraft.getMinecraft().thePlayer.sendChatMessage("§"); } }
July 29, 201510 yr Author I just tried it, yes, you will get kicked. If you don't, you messed up. same code? It just prints it out in chat... maybe try it out on play.itsjerryandharry.com?
July 29, 201510 yr Author I am not going to log into some random server. Yes, it will kick you if the server does not change vanilla behavior. Also make sure your file encoding is right (always use UTF-8 everywhere). Where can I change file encoding?
July 29, 201510 yr Author I am not going to log into some random server. Yes, it will kick you if the server does not change vanilla behavior. Also make sure your file encoding is right (always use UTF-8 everywhere). On every server I go to thats bukkit, has text pop up instead of me getting kicked.
July 29, 201510 yr Bukkit != Vanilla Yes, it will kick you if the server does not change vanilla behavior. I think it's would be fair to say that Bukkit supports more symbols? 1.7.10 is no longer supported by forge, you are on your own.
July 29, 201510 yr Author Bukkit != Vanilla Yes, it will kick you if the server does not change vanilla behavior. I think it's would be fair to say that Bukkit supports more symbols? I am trying alot of different characters in the character map. but none of them are working atm D:
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.