I was playing around with the PlayerChatTabCompleteEvent, and I got an amazing idea. So, first you want to have your listener and stuff all set up, and then you want to create a PlayerChatTabCompleteEvent. Code:java @EventHandlerpublic void tabChat(PlayerChatTabCompleteEvent e){ } Then you want to setup the listener. Code:java //@EventHandler//public void tabChat(PlayerChatTabCompleteEvent e){Player p = e.getPlayer();String m = e.getChatMessage();//} Then you want to make sure the player doesn't get any of the spam from hitting tab Code:java e.getTabCompletions().clear(); Next you want to send the message, you can modify the chat format as you wish Code:java //@EventHandler//public void tabChat(PlayerChatTabCompleteEvent e){//Player p = e.getPlayer();//String m= e.getChatMessage();//e.getTabCompletions().clear();this.getServer().broadcastMessage("<"+p.getName()+"> "+m);//} And then the last step is to close the chat menu. I haven't tested this myself, so I hope this works This is easy, you just need to open an empty inventory, and close it before the player see's. Code:java Inventory inv = this.getServer().createInventory(null, 9);p.openInventory(inv);p.closeInventory(); So I ended up with this inside my tab complete event: Code:java @EventHandlerpublic void tabChat(PlayerChatTabCompleteEvent e){ Player p = e.getPlayer(); String m= e.getChatMessage(); e.getTabCompletions().clear(); this.getServer().broadcastMessage("<"+p.getName()+"> "+m); Inventory inv = this.getServer().createInventory(null, 9); p.openInventory(inv); p.closeInventory();} And heres the version you can paste into your work without line numbers: Thanks, and I would be excited to see how people make use of this trick
I found out a server called 'Dungeon Realms' uses this technique. So If anyone wanted to know how to do the tab-chat like on dungeon-realms, here is the place for you.
Blah1 When you are typing in the chat, you usually hit enter, Well with this tutorial, you can add all sorts of new wacky things, because you can also press Tab to send the message, and you can do different things with that.
I actually already had this set up on a custom RPG server I'm developing for. If you chat normally, it sends the message only to people in the town you are currently in, but if you press tab, it sends it to the global chat instead.
Its still under development, not released to the public yet I stole the idea from another server though. I forget its name.
bobacadodl Think I may be able to join the dev team? I wont be very active, but I am good at plugins.