Solved Removing/editing plugins messages

Discussion in 'Plugin Development' started by NemesisMate, Oct 9, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    NemesisMate

    There are some plugins messages that are send to players on certain occasions. What I want is to edit/remove these based on the plugin sending it or, in it defect, based on it content, the problem is that I can't find the event firing it (if there is any event when a plugin send a message), I tried with AsyncPlayerChatEvent, but nothing.
    Any help is welcome :D.
     
  2. You cannot remove the Help commands of the plugins you have,
    If you want the player NOT to do a help command of a plugin,
    Get the help command, and send them a another message.
     
  3. Offline

    NemesisMate

    I never said is for a help command :S. What I want is to remove some plugins spamming messages on player movement (For example entering on a faction's faction chunk with differed access permissions)
     
  4. Offline

    metalhedd

    You can use ProtocolLib to block/modify the messages, but you won't know what plugin sent it, you'll have to work off the contents of the message.
     
  5. Offline

    NemesisMate

    That's better than nothing, could you save me some time putting here a fast way or a start-from of the code to do it with ProtocolLib?.
     
  6. Offline

    metalhedd


    No sorry, I haven't used it for that before, I only know that it's possible. You'd be better of reading the documentation and examples. They are quite good. http://dev.bukkit.org/bukkit-plugins/protocollib/
     
  7. Offline

    NemesisMate

    metalhedd
    Is done and working, thanks ;):
    Code:java
    1. ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this,ConnectionSide.SERVER_SIDE, ListenerPriority.NORMAL, Packets.Server.CHAT) {
    2. @Override
    3. public void onPacketSending(PacketEvent event) {
    4. if (event.getPacketID() == Packets.Server.CHAT && event.getPacket().getStrings().read(0).contains("access to this area"))
    5. event.setCancelled(true);
    6. }
    7. });
     
    metalhedd likes this.
Thread Status:
Not open for further replies.

Share This Page